PageSourceSearch

https://np-mrd.org/assets/application-ce4c378625e7a5dfb4ed6cb70c77b71ae3f266eee0b331b75807bd923ed4ca1e.js

js np-mrd.org collected 2026-09-28 08:14:28 UTC 1,770,718 bytes, 862 lines download raw bytes

1/*!
2 * jQuery JavaScript Library v1.12.4
3 * http://jquery.com/
4 *
5 * Includes Sizzle.js
6 * http://sizzlejs.com/
7 *
8 * Copyright jQuery Foundation and other contributors
9 * Released under the MIT license
10 * http://jquery.org/license
11 *
12 * Date: 2016-05-20T17:17Z
13 */
14(function(t,e){if(typeof module==="object"&&typeof module.exports==="object"){module.exports=t.document?e(t,true):function(t){if(!t.document){throw new Error("jQuery requires a window with a document")}return e(t)}}else{e(t)}})(typeof window!=="undefined"?window:this,function(t,e){var n=[];var i=t.document;var r=n.slice;var s=n.concat;var o=n.push;var a=n.indexOf;var l={};var c=l.toString;var u=l.hasOwnProperty;var h={};var f="1.12.4",d=function(t,e){return new d.fn.init(t,e)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,m=/^-ms-/,g=/-([\da-z])/gi,_=function(t,e){return e.toUpperCase()};d.fn=d.prototype={jquery:f,constructor:d,selector:"",length:0,toArray:function(){return r.call(this)},get:function(t){return t!=null?t<0?this[t+this.length]:this[t]:r.call(this)},pushStack:function(t){var e=d.merge(this.constructor(),t);e.prevObject=this;e.context=this.context;return e},each:function(t){return d.each(this,t)},map:function(t){return this.pushStack(d.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice};d.extend=d.fn.extend=function(){var t,e,n,i,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=false;if(typeof o==="boolean"){c=o;o=arguments[a]||{};a++}if(typeof o!=="object"&&!d.isFunction(o)){o={}}if(a===l){o=this;a--}for(;a<l;a++){if((r=arguments[a])!=null){for(i in r){t=o[i];n=r[i];if(o===n){continue}if(c&&n&&(d.isPlainObject(n)||(e=d.isArray(n)))){if(e){e=false;s=t&&d.isArray(t)?t:[]}else{s=t&&d.isPlainObject(t)?t:{}}o[i]=d.extend(c,s,n)}else if(n!==undefined){o[i]=n}}}}return o};d.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:true,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return d.type(t)==="function"},isArray:Array.isArray||function(t){return d.type(t)==="array"},isWindow:function(t){return t!=null&&t==t.window},isNumeric:function(t){var e=t&&t.toString();return!d.isArray(t)&&e-parseFloat(e)+1>=0},isEmptyObject:function(t){var e;for(e in t){return false}return true},isPlainObject:function(t){var e;if(!t||d.type(t)!=="object"||t.nodeType||d.isWindow(t)){return false}try{if(t.constructor&&!u.call(t,"constructor")&&!u.call(t.constructor.prototype,"isPrototypeOf")){return false}}catch(n){return false}if(!h.ownFirst){for(e in t){return u.call(t,e)}}for(e in t){}return e===undefined||u.call(t,e)},type:function(t){if(t==null){return t+""}return typeof t==="object"||typeof t==="function"?l[c.call(t)]||"object":typeof t},globalEval:function(e){if(e&&d.trim(e)){(t.execScript||function(e){t["eval"].call(t,e)})(e)}},camelCase:function(t){return t.replace(m,"ms-").replace(g,_)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var n,i=0;if(v(t)){n=t.length;for(;i<n;i++){if(e.call(t[i],i,t[i])===false){break}}}else{for(i in t){if(e.call(t[i],i,t[i])===false){break}}}return t},trim:function(t){return t==null?"":(t+"").replace(p,"")},makeArray:function(t,e){var n=e||[];if(t!=null){if(v(Object(t))){d.merge(n,typeof t==="string"?[t]:t)}else{o.call(n,t)}}return n},inArray:function(t,e,n){var i;if(e){if(a){return a.call(e,t,n)}i=e.length;n=n?n<0?Math.max(0,i+n):n:0;for(;n<i;n++){if(n in e&&e[n]===t){return n}}}return-1},merge:function(t,e){var n=+e.length,i=0,r=t.length;while(i<n){t[r++]=e[i++]}if(n!==n){while(e[i]!==undefined){t[r++]=e[i++]}}t.length=r;return t},grep:function(t,e,n){var i,r=[],s=0,o=t.length,a=!n;for(;s<o;s++){i=!e(t[s],s);if(i!==a){r.push(t[s])}}return r},map:function(t,e,n){var i,r,o=0,a=[];if(v(t)){i=t.length;for(;o<i;o++){r=e(t[o],o,n);if(r!=null){a.push(r)}}}else{for(o in t){r=e(t[o],o,n);if(r!=null){a.push(r)}}}return s.apply([],a)},guid:1,proxy:function(t,e){var n,i,s;if(typeof e==="string"){s=t[e];e=t;t=s}if(!d.isFunction(t)){return undefined}n=r.call(arguments,2);i=function(){return t.apply(e||this,n.concat(r.call(arguments)))};i.guid=t.guid=t.guid||d.guid++;return i},now:function(){return+new Date},support:h});if(typeof Symbol==="function"){d.fn[Symbol.iterator]=n[Symbol.iterator]}d.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){l["[object "+e+"]"]=e.toLowerCase()});function v(t){var e=!!t&&"length"in t&&t.length,n=d.type(t);if(n==="function"||d.isWindow(t)){return false}return n==="array"||e===0||typeof e==="number"&&e>0&&e-1 in t}var y=
15/*!
16 * Sizzle CSS Selector Engine v2.2.1
17 * http://sizzlejs.com/
18 *
19 * Copyright jQuery Foundation and other contributors
20 * Released under the MIT license
21 * http://jquery.org/license
22 *
23 * Date: 2015-10-17
24 */
25function(t){var e,n,i,r,s,o,a,l,c,u,h,f,d,p,m,g,_,v,y,b="sizzle"+1*ne
25w Date,x=t.document,w=0,k=0,S=st(),M=st(),T=st(),C=function(t,e){if(t===e){h=true}return 0},A=1<<31,D={}.hasOwnProperty,E=[],N=E.pop,z=E.push,P=E.push,j=E.slice,I=function(t,e){var n=0,i=t.length;for(;n<i;n++){if(t[n]===e){return n}}return-1},$="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",F="\\["+R+"*("+L+")(?:"+R+"*([*^$|!~]?=)"+R+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+R+"*\\]",O=":("+L+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+F+")*)|"+".*"+")\\)|)",H=new RegExp(R+"+","g"),V=new RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),q=new RegExp("^"+R+"*,"+R+"*"),B=new RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),U=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),W=new RegExp(O),Y=new RegExp("^"+L+"$"),X={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+$+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,tt=/'|\\/g,et=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),nt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320)},it=function(){f()};try{P.apply(E=j.call(x.childNodes),x.childNodes);E[x.childNodes.length].nodeType}catch(kt){P={apply:E.length?function(t,e){z.apply(t,j.call(e))}:function(t,e){var n=t.length,i=0;while(t[n++]=e[i++]){}t.length=n-1}}}function rt(t,e,i,r){var s,a,c,u,h,p,_,v,w=e&&e.ownerDocument,k=e?e.nodeType:9;i=i||[];if(typeof t!=="string"||!t||k!==1&&k!==9&&k!==11){return i}if(!r){if((e?e.ownerDocument||e:x)!==d){f(e)}e=e||d;if(m){if(k!==11&&(p=Z.exec(t))){if(s=p[1]){if(k===9){if(c=e.getElementById(s)){if(c.id===s){i.push(c);return i}}else{return i}}else{if(w&&(c=w.getElementById(s))&&y(e,c)&&c.id===s){i.push(c);return i}}}else if(p[2]){P.apply(i,e.getElementsByTagName(t));return i}else if((s=p[3])&&n.getElementsByClassName&&e.getElementsByClassName){P.apply(i,e.getElementsByClassName(s));return i}}if(n.qsa&&!T[t+" "]&&(!g||!g.test(t))){if(k!==1){w=e;v=t}else if(e.nodeName.toLowerCase()!=="object"){if(u=e.getAttribute("id")){u=u.replace(tt,"\\$&")}else{e.setAttribute("id",u=b)}_=o(t);a=_.length;h=Y.test(u)?"#"+u:"[id='"+u+"']";while(a--){_[a]=h+" "+mt(_[a])}v=_.join(",");w=Q.test(t)&&dt(e.parentNode)||e}if(v){try{P.apply(i,w.querySelectorAll(v));return i}catch(S){}finally{if(u===b){e.removeAttribute("id")}}}}}}return l(t.replace(V,"$1"),e,i,r)}function st(){var t=[];function e(n,r){if(t.push(n+" ")>i.cacheLength){delete e[t.shift()]}return e[n+" "]=r}return e}function ot(t){t[b]=true;return t}function at(t){var e=d.createElement("div");try{return!!t(e)}catch(kt){return false}finally{if(e.parentNode){e.parentNode.removeChild(e)}e=null}}function lt(t,e){var n=t.split("|"),r=n.length;while(r--){i.attrHandle[n[r]]=e}}function ct(t,e){var n=e&&t,i=n&&t.nodeType===1&&e.nodeType===1&&(~e.sourceIndex||A)-(~t.sourceIndex||A);if(i){return i}if(n){while(n=n.nextSibling){if(n===e){return-1}}}return t?1:-1}function ut(t){return function(e){var n=e.nodeName.toLowerCase();return n==="input"&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return(n==="input"||n==="button")&&e.type===t}}function ft(t){return ot(function(e){e=+e;return ot(function(n,i){var r,s=t([],n.length,e),o=s.length;while(o--){if(n[r=s[o]]){n[r]=!(i[r]=n[r])}}})})}function dt(t){return t&&typeof t.getElementsByTagName!=="undefined"&&t}n=rt.support={};s=rt.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?e.nodeName!=="HTML":false};f=rt.setDocument=function(t){var e,r,o=t?t.ownerDocument||t:x;if(o===d||o.nodeType!==9||!o.documentElement){return d}d=o;p=d.documentElement;m=!s(d);if((r=d.defaultView)&&r.top!==r){if(r.addEventListener){r.addEventListener("unload",it,false)}else if(r.attachEvent){r.attachEvent("onunload",it)}}n.attributes=at(function(t){t.className="i";return!t.getAttribute("className")});n.getElementsByTagName=at(function(t){t.appendChild(d.createComment(""));return!t.getElementsByTagName("*").length});n.getElementsByClassName=K.test(d.getElementsByClassName);n.getById=at(function(t){p.appendChild(t).id=b;return!d.getElementsByName||!d.getElementsByName(b).length});if(n.getById){i.find["ID"]=function(t,e){if(typeof e.getElementById!=="undefined"&&m){var n=e.getElementById(t);return n?[n]:[]}};i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}}}else{delete i.find["ID"];i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){var n=typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id");return n&&n.value===e}}}i.find["TAG"]=n.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!=="undefined"){return e.getElementsByTagName(t)}else if(n.qsa){return e.querySelectorAll(t)}}:function(t,e){var n,i=[],r=0,s=e.getElementsByTagName(t);if(t==="*"){while(n=s[r++]){if(n.nodeType===1){i.push(n)}}return i}return s};i.find["CLASS"]=n.getElementsByClassName&&function(t,e){if(typeof e.getElementsByClassName!=="undefined"&&m){return e.getElementsByClassName(t)}};_=[];g=[];if(n.qsa=K.test(d.querySelectorAll)){at(function(t){p.appendChild(t).innerHTML="<a id='"+b+"'></a>"+"<select id='"+b+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(t.querySelectorAll("[msallowcapture^='']").length){g.push("[*^$]="+R+"*(?:''|\"\")")}if(!t.querySelectorAll("[selected]").length){g.push("\\["+R+"*(?:value|"+$+")")}if(!t.querySelectorAll("[id~="+b+"-]").length){g.push("~=")}if(!t.querySelectorAll(":checked").length){g.push(":checked")}if(!t.querySelectorAll("a#"+b+"+*").length){g.push(".#.+[+~]")}});at(function(t){var e=d.createElement("input");e.setAttribute("type","hidden");t.appendChild(e).setAttribute("name","D");if(t.querySelectorAll("[name=d]").length){g.push("name"+R+"*[*^$|!~]?=")}if(!t.querySelectorAll(":enabled").length){g.push(":enabled",":disabled")}t.querySelectorAll("*,:x");g.push(",.*:")})}if(n.matchesSelector=K.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector)){at(function(t){n.disconnectedMatch=v.call(t,"div");v.call(t,"[s!='']:x");_.push("!=",O)})}g=g.length&&new RegExp(g.join("|"));_=_.length&&new RegExp(_.join("|"));e=K.test(p.compareDocumentPosition);y=e||K.test(p.contains)?function(t,e){var n=t.nodeType===9?t.documentElement:t,i=e&&e.parentNode;return t===i||!!(i&&i.nodeType===1&&(n.contains?n.contains(i):t.compareDocumentPosition&&t.compareDocumentPosition(i)&16))}:function(t,e){if(e){while(e=e.parentNode){if(e===t){return true}}}return false};C=e?function(t,e){if(t===e){h=true;return 0}var i=!t.compareDocumentPosition-!e.compareDocumentPosition;if(i){return i}i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1;if(i&1||!n.sortDetached&&e.compareDocumentPosition(t)===i){if(t===d||t.ownerDocument===x&&y(x,t)){return-1}if(e===d||e.ownerDocument===x&&y(x,e)){return 1}return u?I(u,t)-I(u,e):0}return i&4?-1:1}:function(t,e){if(t===e){h=true;return 0}var n,i=0,r=t.parentNode,s=e.parentNode,o=[t],a=[e];if(!r||!s){return t===d?-1:e===d?1:r?-1:s?1:u?I(u,t)-I(u,e):0}else if(r===s){return ct(t,e)}n=t;while(n=n.parentNode){o.unshift(n)}n=e;while(n=n.parentNode){a.unshift(n)}while(o[i]===a[i]){i++}return i?ct(o[i],a[i]):o[i]===x?-1:a[i]===x?1:0};return d};rt.matches=function(t,e){return rt(t,null,null,e)};rt.matchesSelector=function(t,e){if((t.ownerDocument||t)!==d){f(t)}e=e.replace(U,"='$1']");if(n.matchesSelector&&m&&!T[e+" "]&&(!_||!_.test(e))&&(!g||!g.test(e))){try{var i=v.call(t,e);if(i||n.disconnectedMatch||t.document&&t.document.nodeType!==11){return i}}catch(kt){}}return rt(e,d,null,[t]).length>0};rt.contains=function(t,e){if((t.ownerDocument||t)!==d){f(t)}return y(t,e)};rt.attr=function(t,e){if((t.ownerDocument||t)!==d){f(t)}var r=i.attrHandle[e.toLowerCase()],s=r&&D.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):undefined;return s!==undefined?s:n.attributes||!m?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null};rt.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)};rt.uniqueSort=function(t){var e,i=[],r=0,s=0;h=!n.detectDuplicates;u=!n.sortStable&&t.slice(0);t.sort(C);if(h){while(e=t[s++]){if(e===t[s]){r=i.push(s)}}while(r--){t.splice(i[r],1)}}u=null;return t};r=rt.getText=function(t){var e,n="",i=0,s=t.nodeType;if(!s){while(e=t[i++]){n+=r(e)}}else if(s===1||s===9||s===11){if(typeof t.textContent==="string"){return t.textContent}else{for(t=t.firstChild;t;t=t.nextSibling){n+=r(t)}}}else if(s===3||s===4){return t.nodeValue}return n};i=rt.selectors={cacheLength:50,createPseudo:ot,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){t[1]=t[1].replace(et,nt);t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt);if(t[2]==="~="){t[3]=" "+t[3]+" "}return t.slice(0,4)},CHILD:function(t){t[1]=t[1].toLowerCase();if(t[1].slice(0,3)==="nth"){if(!t[3]){rt.error(t[0])}t[4]=+(t[4]?t[5]+(t[6]||1):2*(t[3]==="even"||t[3]==="odd"));t[5]=+(t[7]+t[8]||t[3]==="odd")}else if(t[3]){rt.error(t[0])}return t},PSEUDO:function(t){var e,n=!t[6]&&t[2];if(X["CHILD"].test(t[0])){return null}if(t[3]){t[2]=t[4]||t[5]||""}else if(n&&W.test(n)&&(e=o(n,true))&&(e=n.indexOf(")",n.length-e)-n.length)){t[0]=t[0].slice(0,e);t[2]=n.slice(0,e)}return t.slice(0,3)}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return t==="*"?function(){return true}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&S(t,function(t){return e.test(typeof t.className==="string"&&t.className||typeof t.getAttribute!=="undefined"&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=rt.attr(i,t);if(r==null){return e==="!="}if(!e){return true}r+="";return e==="="?r===n:e==="!="?r!==n:e==="^="?n&&r.indexOf(n)===0:e==="*="?n&&r.indexOf(n)>-1:e==="$="?n&&r.slice(-n.length)===n:e==="~="?(" "+r.replace(H," ")+" ").indexOf(n)>-1:e==="|="?r===n||r.slice(0,n.length+1)===n+"-":false}},CHILD:function(t,e,n,i,r){var s=t.slice(0,3)!=="nth",o=t.slice(-4)!=="last",a=e==="of-type";return i===1&&r===0?function(t){return!!t.parentNode}:function(e,n,l){var c,u,h,f,d,p,m=s!==o?"nextSibling":"previousSibling",g=e.parentNode,_=a&&e.nodeName.toLowerCase(),v=!l&&!a,y=false;if(g){if(s){while(m){f=e;while(f=f[m]){if(a?f.nodeName.toLowerCase()===_:f.nodeType===1){return false}}p=m=t==="only"&&!p&&"nextSibling"}return true}p=[o?g.firstChild:g.lastChild];if(o&&v){f=g;h=f[b]||(f[b]={});u=h[f.uniqueID]||(h[f.uniqueID]={});c=u[t]||[];d=c[0]===w&&c[1];y=d&&c[2];f=d&&g.childNodes[d];while(f=++d&&f&&f[m]||(y=d=0)||p.pop()){if(f.nodeType===1&&++y&&f===e){u[t]=[w,d,y];break}}}else{if(v){f=e;h=f[b]||(f[b]={});u=h[f.uniqueID]||(h[f.uniqueID]={});c=u[t]||[];d=c[0]===w&&c[1];y=d}if(y===false){while(f=++d&&f&&f[m]||(y=d=0)||p.pop()){if((a?f.nodeName.toLowerCase()===_:f.nodeType===1)&&++y){if(v){h=f[b]||(f[b]={});u=h[f.uniqueID]||(h[f.uniqueID]={});u[t]=[w,y]}if(f===e){break}}}}}y-=r;return y===i||y%i===0&&y/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||rt.error("unsupported pseudo: "+t);if(r[b]){return r(e)}if(r.length>1){n=[t,t,"",e];return i.setFilters.hasOwnProperty(t.toLowerCase())?ot(function(t,n){var i,s=r(t,e),o=s.length;while(o--){i=I(t,s[o]);t[i]=!(n[i]=s[o])}}):function(t){return r(t,0,n)}}return r}},pseudos:{not:ot(function(t){var e=[],n=[],i=a(t.replace(V,"$1"));return i[b]?ot(function(t,e,n,r){var s,o=i(t,null,r,[]),a=t.length;while(a--){if(s=o[a]){t[a]=!(e[a]=s)}}}):function(t,r,s){e[0]=t;i(e,null,s,n);e[0]=null;return!n.pop()}}),has:ot(function(t){return function(e){return rt(t,e).length>0}}),contains:ot(function(t){t=t.replace(et,nt);return function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:ot(function(t){if(!Y.test(t||"")){rt.error("unsupported lang: "+t)}t=t.replace(et,nt).toLowerCase();return function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){n=n.toLowerCase();return n===t||n.indexOf(t+"-")===0}}while((e=e.parentNode)&&e.nodeType===1);return false}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===false},disabled:function(t){return t.disabled===true},checked:function(t){var e=t.nodeName.toLowerCase();return e==="input"&&!!t.checked||e==="option"&&!!t.selected},selected:function(t){if(t.parentNode){t.parentNode.selectedIndex}return t.selected===true},empty:function(t){for(t=t.firstChild;t;
25t=t.nextSibling){if(t.nodeType<6){return false}}return true},parent:function(t){return!i.pseudos["empty"](t)},header:function(t){return G.test(t.nodeName)},input:function(t){return J.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return e==="input"&&t.type==="button"||e==="button"},text:function(t){var e;return t.nodeName.toLowerCase()==="input"&&t.type==="text"&&((e=t.getAttribute("type"))==null||e.toLowerCase()==="text")},first:ft(function(){return[0]}),last:ft(function(t,e){return[e-1]}),eq:ft(function(t,e,n){return[n<0?n+e:n]}),even:ft(function(t,e){var n=0;for(;n<e;n+=2){t.push(n)}return t}),odd:ft(function(t,e){var n=1;for(;n<e;n+=2){t.push(n)}return t}),lt:ft(function(t,e,n){var i=n<0?n+e:n;for(;--i>=0;){t.push(i)}return t}),gt:ft(function(t,e,n){var i=n<0?n+e:n;for(;++i<e;){t.push(i)}return t})}};i.pseudos["nth"]=i.pseudos["eq"];for(e in{radio:true,checkbox:true,file:true,password:true,image:true}){i.pseudos[e]=ut(e)}for(e in{submit:true,reset:true}){i.pseudos[e]=ht(e)}function pt(){}pt.prototype=i.filters=i.pseudos;i.setFilters=new pt;o=rt.tokenize=function(t,e){var n,r,s,o,a,l,c,u=M[t+" "];if(u){return e?0:u.slice(0)}a=t;l=[];c=i.preFilter;while(a){if(!n||(r=q.exec(a))){if(r){a=a.slice(r[0].length)||a}l.push(s=[])}n=false;if(r=B.exec(a)){n=r.shift();s.push({value:n,type:r[0].replace(V," ")});a=a.slice(n.length)}for(o in i.filter){if((r=X[o].exec(a))&&(!c[o]||(r=c[o](r)))){n=r.shift();s.push({value:n,type:o,matches:r});a=a.slice(n.length)}}if(!n){break}}return e?a.length:a?rt.error(t):M(t,l).slice(0)};function mt(t){var e=0,n=t.length,i="";for(;e<n;e++){i+=t[e].value}return i}function gt(t,e,n){var i=e.dir,r=n&&i==="parentNode",s=k++;return e.first?function(e,n,s){while(e=e[i]){if(e.nodeType===1||r){return t(e,n,s)}}}:function(e,n,o){var a,l,c,u=[w,s];if(o){while(e=e[i]){if(e.nodeType===1||r){if(t(e,n,o)){return true}}}}else{while(e=e[i]){if(e.nodeType===1||r){c=e[b]||(e[b]={});l=c[e.uniqueID]||(c[e.uniqueID]={});if((a=l[i])&&a[0]===w&&a[1]===s){return u[2]=a[2]}else{l[i]=u;if(u[2]=t(e,n,o)){return true}}}}}}}function _t(t){return t.length>1?function(e,n,i){var r=t.length;while(r--){if(!t[r](e,n,i)){return false}}return true}:t[0]}function vt(t,e,n){var i=0,r=e.length;for(;i<r;i++){rt(t,e[i],n)}return n}function yt(t,e,n,i,r){var s,o=[],a=0,l=t.length,c=e!=null;for(;a<l;a++){if(s=t[a]){if(!n||n(s,i,r)){o.push(s);if(c){e.push(a)}}}}return o}function bt(t,e,n,i,r,s){if(i&&!i[b]){i=bt(i)}if(r&&!r[b]){r=bt(r,s)}return ot(function(s,o,a,l){var c,u,h,f=[],d=[],p=o.length,m=s||vt(e||"*",a.nodeType?[a]:a,[]),g=t&&(s||!e)?yt(m,f,t,a,l):m,_=n?r||(s?t:p||i)?[]:o:g;if(n){n(g,_,a,l)}if(i){c=yt(_,d);i(c,[],a,l);u=c.length;while(u--){if(h=c[u]){_[d[u]]=!(g[d[u]]=h)}}}if(s){if(r||t){if(r){c=[];u=_.length;while(u--){if(h=_[u]){c.push(g[u]=h)}}r(null,_=[],c,l)}u=_.length;while(u--){if((h=_[u])&&(c=r?I(s,h):f[u])>-1){s[c]=!(o[c]=h)}}}}else{_=yt(_===o?_.splice(p,_.length):_);if(r){r(null,o,_,l)}else{P.apply(o,_)}}})}function xt(t){var e,n,r,s=t.length,o=i.relative[t[0].type],a=o||i.relative[" "],l=o?1:0,u=gt(function(t){return t===e},a,true),h=gt(function(t){return I(e,t)>-1},a,true),f=[function(t,n,i){var r=!o&&(i||n!==c)||((e=n).nodeType?u(t,n,i):h(t,n,i));e=null;return r}];for(;l<s;l++){if(n=i.relative[t[l].type]){f=[gt(_t(f),n)]}else{n=i.filter[t[l].type].apply(null,t[l].matches);if(n[b]){r=++l;for(;r<s;r++){if(i.relative[t[r].type]){break}}return bt(l>1&&_t(f),l>1&&mt(t.slice(0,l-1).concat({value:t[l-2].type===" "?"*":""})).replace(V,"$1"),n,l<r&&xt(t.slice(l,r)),r<s&&xt(t=t.slice(r)),r<s&&mt(t))}f.push(n)}}return _t(f)}function wt(t,e){var n=e.length>0,r=t.length>0,s=function(s,o,a,l,u){var h,p,g,_=0,v="0",y=s&&[],b=[],x=c,k=s||r&&i.find["TAG"]("*",u),S=w+=x==null?1:Math.random()||.1,M=k.length;if(u){c=o===d||o||u}for(;v!==M&&(h=k[v])!=null;v++){if(r&&h){p=0;if(!o&&h.ownerDocument!==d){f(h);a=!m}while(g=t[p++]){if(g(h,o||d,a)){l.push(h);break}}if(u){w=S}}if(n){if(h=!g&&h){_--}if(s){y.push(h)}}}_+=v;if(n&&v!==_){p=0;while(g=e[p++]){g(y,b,o,a)}if(s){if(_>0){while(v--){if(!(y[v]||b[v])){b[v]=N.call(l)}}}b=yt(b)}P.apply(l,b);if(u&&!s&&b.length>0&&_+e.length>1){rt.uniqueSort(l)}}if(u){w=S;c=x}return y};return n?ot(s):s}a=rt.compile=function(t,e){var n,i=[],r=[],s=T[t+" "];if(!s){if(!e){e=o(t)}n=e.length;while(n--){s=xt(e[n]);if(s[b]){i.push(s)}else{r.push(s)}}s=T(t,wt(r,i));s.selector=t}return s};l=rt.select=function(t,e,r,s){var l,c,u,h,f,d=typeof t==="function"&&t,p=!s&&o(t=d.selector||t);r=r||[];if(p.length===1){c=p[0]=p[0].slice(0);if(c.length>2&&(u=c[0]).type==="ID"&&n.getById&&e.nodeType===9&&m&&i.relative[c[1].type]){e=(i.find["ID"](u.matches[0].replace(et,nt),e)||[])[0];if(!e){return r}else if(d){e=e.parentNode}t=t.slice(c.shift().value.length)}l=X["needsContext"].test(t)?0:c.length;while(l--){u=c[l];if(i.relative[h=u.type]){break}if(f=i.find[h]){if(s=f(u.matches[0].replace(et,nt),Q.test(c[0].type)&&dt(e.parentNode)||e)){c.splice(l,1);t=s.length&&mt(c);if(!t){P.apply(r,s);return r}break}}}}(d||a(t,p))(s,e,!m,r,!e||Q.test(t)&&dt(e.parentNode)||e);return r};n.sortStable=b.split("").sort(C).join("")===b;n.detectDuplicates=!!h;f();n.sortDetached=at(function(t){return t.compareDocumentPosition(d.createElement("div"))&1});if(!at(function(t){t.innerHTML="<a href='#'></a>";return t.firstChild.getAttribute("href")==="#"})){lt("type|href|height|width",function(t,e,n){if(!n){return t.getAttribute(e,e.toLowerCase()==="type"?1:2)}})}if(!n.attributes||!at(function(t){t.innerHTML="<input/>";t.firstChild.setAttribute("value","");return t.firstChild.getAttribute("value")===""})){lt("value",function(t,e,n){if(!n&&t.nodeName.toLowerCase()==="input"){return t.defaultValue}})}if(!at(function(t){return t.getAttribute("disabled")==null})){lt($,function(t,e,n){var i;if(!n){return t[e]===true?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}})}return rt}(t);d.find=y;d.expr=y.selectors;d.expr[":"]=d.expr.pseudos;d.uniqueSort=d.unique=y.uniqueSort;d.text=y.getText;d.isXMLDoc=y.isXML;
25d.contains=y.contains;var b=function(t,e,n){var i=[],r=n!==undefined;while((t=t[e])&&t.nodeType!==9){if(t.nodeType===1){if(r&&d(t).is(n)){break}i.push(t)}}return i};var x=function(t,e){var n=[];for(;t;t=t.nextSibling){if(t.nodeType===1&&t!==e){n.push(t)}}return n};var w=d.expr.match.needsContext;var k=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/;var S=/^.[^:#\[\.,]*$/;function M(t,e,n){if(d.isFunction(e)){return d.grep(t,function(t,i){return!!e.call(t,i,t)!==n})}if(e.nodeType){return d.grep(t,function(t){return t===e!==n})}if(typeof e==="string"){if(S.test(e)){return d.filter(e,t,n)}e=d.filter(e,t)}return d.grep(t,function(t){return d.inArray(t,e)>-1!==n})}d.filter=function(t,e,n){var i=e[0];if(n){t=":not("+t+")"}return e.length===1&&i.nodeType===1?d.find.matchesSelector(i,t)?[i]:[]:d.find.matches(t,d.grep(e,function(t){return t.nodeType===1}))};d.fn.extend({find:function(t){var e,n=[],i=this,r=i.length;if(typeof t!=="string"){return this.pushStack(d(t).filter(function(){for(e=0;e<r;e++){if(d.contains(i[e],this)){return true}}}))}for(e=0;e<r;e++){d.find(t,i[e],n)}n=this.pushStack(r>1?d.unique(n):n);n.selector=this.selector?this.selector+" "+t:t;return n},filter:function(t){return this.pushStack(M(this,t||[],false))},not:function(t){return this.pushStack(M(this,t||[],true))},is:function(t){return!!M(this,typeof t==="string"&&w.test(t)?d(t):t||[],false).length}});var T,C=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=d.fn.init=function(t,e,n){var r,s;if(!t){return this}n=n||T;if(typeof t==="string"){if(t.charAt(0)==="<"&&t.charAt(t.length-1)===">"&&t.length>=3){r=[null,t,null]}else{r=C.exec(t)}if(r&&(r[1]||!e)){if(r[1]){e=e instanceof d?e[0]:e;d.merge(this,d.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:i,true));if(k.test(r[1])&&d.isPlainObject(e)){for(r in e){if(d.isFunction(this[r])){this[r](e[r])}else{this.attr(r,e[r])}}}return this}else{s=i.getElementById(r[2]);if(s&&s.parentNode){if(s.id!==r[2]){return T.find(t)}this.length=1;this[0]=s}this.context=i;this.selector=t;return this}}else if(!e||e.jquery){return(e||n).find(t)}else{return this.constructor(e).find(t)}}else if(t.nodeType){this.context=this[0]=t;this.length=1;return this}else if(d.isFunction(t)){return typeof n.ready!=="undefined"?n.ready(t):t(d)}if(t.selector!==undefined){this.selector=t.selector;this.context=t.context}return d.makeArray(t,this)};A.prototype=d.fn;T=d(i);var D=/^(?:parents|prev(?:Until|All))/,E={children:true,contents:true,next:true,prev:true};d.fn.extend({has:function(t){var e,n=d(t,this),i=n.length;return this.filter(function(){for(e=0;e<i;e++){if(d.contains(this,n[e])){return true}}})},closest:function(t,e){var n,i=0,r=this.length,s=[],o=w.test(t)||typeof t!=="string"?d(t,e||this.context):0;for(;i<r;i++){for(n=this[i];n&&n!==e;n=n.parentNode){if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&d.find.matchesSelector(n,t))){s.push(n);break}}}return this.pushStack(s.length>1?d.uniqueSort(s):s)},index:function(t){if(!t){return this[0]&&this[0].parentNode?this.first().prevAll().length:-1}if(typeof t==="string"){return d.inArray(this[0],d(t))}return d.inArray(t.jquery?t[0]:t,this)},add:function(t,e){return this.pushStack(d.uniqueSort(d.merge(this.get(),d(t,e))))},addBack:function(t){return this.add(t==null?this.prevObject:this.prevObject.filter(t))}});function N(t,e){do{t=t[e]}while(t&&t.nodeType!==1);return t}d.each({parent:function(t){var e=t.parentNode;return e&&e.nodeType!==11?e:null},parents:function(t){return b(t,"parentNode")},parentsUntil:function(t,e,n){return b(t,"parentNode",n)},next:function(t){return N(t,"nextSibling")},prev:function(t){return N(t,"previousSibling")},nextAll:function(t){return b(t,"nextSibling")},prevAll:function(t){return b(t,"previousSibling")},nextUntil:function(t,e,n){return b(t,"nextSibling",n)},prevUntil:function(t,e,n){return b(t,"previousSibling",n)},siblings:function(t){return x((t.parentNode||{}).firstChild,t)},children:function(t){return x(t.firstChild)},contents:function(t){return d.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:d.merge([],t.childNodes)}},function(t,e){d.fn[t]=function(n,i){var r=d.map(this,e,n);if(t.slice(-5)!=="Until"){i=n}
25if(i&&typeof i==="string"){r=d.filter(i,r)}if(this.length>1){if(!E[t]){r=d.uniqueSort(r)}if(D.test(t)){r=r.reverse()}}return this.pushStack(r)}});var z=/\S+/g;function P(t){var e={};d.each(t.match(z)||[],function(t,n){e[n]=true});return e}d.Callbacks=function(t){t=typeof t==="string"?P(t):d.extend({},t);var e,n,i,r,s=[],o=[],a=-1,l=function(){r=t.once;i=e=true;for(;o.length;a=-1){n=o.shift();while(++a<s.length){if(s[a].apply(n[0],n[1])===false&&t.stopOnFalse){a=s.length;n=false}}}if(!t.memory){n=false}e=false;if(r){if(n){s=[]}else{s=""}}},c={add:function(){if(s){if(n&&!e){a=s.length-1;o.push(n)}(function i(e){d.each(e,function(e,n){if(d.isFunction(n)){if(!t.unique||!c.has(n)){s.push(n)}}else if(n&&n.length&&d.type(n)!=="string"){i(n)}})})(arguments);if(n&&!e){l()}}return this},remove:function(){d.each(arguments,function(t,e){var n;while((n=d.inArray(e,s,n))>-1){s.splice(n,1);if(n<=a){a--}}});return this},has:function(t){return t?d.inArray(t,s)>-1:s.length>0},empty:function(){if(s){s=[]}return this},disable:function(){r=o=[];s=n="";return this},disabled:function(){return!s},lock:function(){r=true;if(!n){c.disable()}return this},locked:function(){return!!r},fireWith:function(t,n){if(!r){n=n||[];n=[t,n.slice?n.slice():n];o.push(n);if(!e){l()}}return this},fire:function(){c.fireWith(this,arguments);return this},fired:function(){return!!i}};return c};d.extend({Deferred:function(t){var e=[["resolve","done",d.Callbacks("once memory"),"resolved"],["reject","fail",d.Callbacks("once memory"),"rejected"],["notify","progress",d.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){r.done(arguments).fail(arguments);return this},then:function(){var t=arguments;return d.Deferred(function(n){d.each(e,function(e,s){var o=d.isFunction(t[e])&&t[e];r[s[1]](function(){var t=o&&o.apply(this,arguments);if(t&&d.isFunction(t.promise)){t.promise().progress(n.notify).done(n.resolve).fail(n.reject)}else{n[s[0]+"With"](this===i?n.promise():this,o?[t]:arguments)}})});t=null}).promise()},promise:function(t){return t!=null?d.extend(t,i):i}},r={};i.pipe=i.then;d.each(e,function(t,s){var o=s[2],a=s[3];i[s[1]]=o.add;if(a){o.add(function(){n=a},e[t^1][2].disable,e[2][2].lock)}r[s[0]]=function(){r[s[0]+"With"](this===r?i:this,arguments);return this};r[s[0]+"With"]=o.fireWith});i.promise(r);if(t){t.call(r,r)}return r},when:function(t){var e=0,n=r.call(arguments),i=n.length,s=i!==1||t&&d.isFunction(t.promise)?i:0,o=s===1?t:d.Deferred(),a=function(t,e,n){return function(i){e[t]=this;n[t]=arguments.length>1?r.call(arguments):i;if(n===l){o.notifyWith(e,n)}else if(!--s){o.resolveWith(e,n)}}},l,c,u;if(i>1){l=new Array(i);c=new Array(i);u=new Array(i);for(;e<i;e++){if(n[e]&&d.isFunction(n[e].promise)){n[e].promise().progress(a(e,c,l)).done(a(e,u,n)).fail(o.reject)}else{--s}}}if(!s){o.resolveWith(u,n)}return o.promise()}});var j;d.fn.ready=function(t){d.ready.promise().done(t);return this};d.extend({isReady:false,readyWait:1,holdReady:function(t){if(t){d.readyWait++}else{d.ready(true)}},ready:function(t){if(t===true?--d.readyWait:d.isReady){return}d.isReady=true;if(t!==true&&--d.readyWait>0){return}j.resolveWith(i,[d]);if(d.fn.triggerHandler){d(i).triggerHandler("ready");d(i).off("ready")}}});function I(){if(i.addEventListener){i.removeEventListener("DOMContentLoaded",$);t.removeEventListener("load",$)}else{i.detachEvent("onreadystatechange",$);t.detachEvent("onload",$)}}function $(){if(i.addEventListener||t.event.type==="load"||i.readyState==="complete"){I();d.ready()}}d.ready.promise=function(e){if(!j){j=d.Deferred();if(i.readyState==="complete"||i.readyState!=="loading"&&!i.documentElement.doScroll){t.setTimeout(d.ready)}else if(i.addEventListener){i.addEventListener("DOMContentLoaded",$);t.addEventListener("load",$)}else{i.attachEvent("onreadystatechange",$);t.attachEvent("onload",$);var n=false;try{n=t.frameElement==null&&i.documentElement}catch(r){}if(n&&n.doScroll){(function e(){if(!d.isReady){try{n.doScroll("left")}catch(r){return t.setTimeout(e,50)}I();d.ready()}})()}}}return j.promise(e)};d.ready.promise();var R;for(R in d(h)){break}h.ownFirst=R==="0";h.inlineBlockNeedsLayout=false;d(function(){var t,e,n,r;n=i.getElementsByTagName("body")[0];if(!n||!n.style){return}e=i.createElement("div");r=i.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!=="undefined"){e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
25h.inlineBlockNeedsLayout=t=e.offsetWidth===3;if(t){n.style.zoom=1}}n.removeChild(r)});(function(){var t=i.createElement("div");h.deleteExpando=true;try{delete t.test}catch(e){h.deleteExpando=false}t=null})();var L=function(t){var e=d.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return n!==1&&n!==9?false:!e||e!==true&&t.getAttribute("classid")===e};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function H(t,e,n){if(n===undefined&&t.nodeType===1){var i="data-"+e.replace(O,"-$1").toLowerCase();n=t.getAttribute(i);if(typeof n==="string"){try{n=n==="true"?true:n==="false"?false:n==="null"?null:+n+""===n?+n:F.test(n)?d.parseJSON(n):n}catch(r){}d.data(t,e,n)}else{n=undefined}}return n}function V(t){var e;for(e in t){if(e==="data"&&d.isEmptyObject(t[e])){continue}if(e!=="toJSON"){return false}}return true}function q(t,e,i,r){if(!L(t)){return}var s,o,a=d.expando,l=t.nodeType,c=l?d.cache:t,u=l?t[a]:t[a]&&a;if((!u||!c[u]||!r&&!c[u].data)&&i===undefined&&typeof e==="string"){return}if(!u){if(l){u=t[a]=n.pop()||d.guid++}else{u=a}}if(!c[u]){c[u]=l?{}:{toJSON:d.noop}}if(typeof e==="object"||typeof e==="function"){if(r){c[u]=d.extend(c[u],e)}else{c[u].data=d.extend(c[u].data,e)}}o=c[u];if(!r){if(!o.data){o.data={}}o=o.data}if(i!==undefined){o[d.camelCase(e)]=i}if(typeof e==="string"){s=o[e];if(s==null){s=o[d.camelCase(e)]}}else{s=o}return s}function B(t,e,n){if(!L(t)){return}var i,r,s=t.nodeType,o=s?d.cache:t,a=s?t[d.expando]:d.expando;if(!o[a]){return}if(e){i=n?o[a]:o[a].data;if(i){if(!d.isArray(e)){if(e in i){e=[e]}else{e=d.camelCase(e);if(e in i){e=[e]}else{e=e.split(" ")}}}else{e=e.concat(d.map(e,d.camelCase))}r=e.length;while(r--){delete i[e[r]]}if(n?!V(i):!d.isEmptyObject(i)){return}}}if(!n){delete o[a].data;if(!V(o[a])){return}}if(s){d.cleanData([t],true)}else if(h.deleteExpando||o!=o.window){delete o[a]}else{o[a]=undefined}}d.extend({cache:{},noData:{"applet ":true,"embed ":true,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){t=t.nodeType?d.cache[t[d.expando]]:t[d.expando];return!!t&&!V(t)},data:function(t,e,n){return q(t,e,n)},removeData:function(t,e){return B(t,e)},_data:function(t,e,n){return q(t,e,n,true)},_removeData:function(t,e){return B(t,e,true)}});d.fn.extend({data:function(t,e){var n,i,r,s=this[0],o=s&&s.attributes;if(t===undefined){if(this.length){r=d.data(s);if(s.nodeType===1&&!d._data(s,"parsedAttrs")){n=o.length;while(n--){if(o[n]){i=o[n].name;if(i.indexOf("data-")===0){i=d.camelCase(i.slice(5));H(s,i,r[i])}}}d._data(s,"parsedAttrs",true)}}return r}if(typeof t==="object"){return this.each(function(){d.data(this,t)})}return arguments.length>1?this.each(function(){d.data(this,t,e)}):s?H(s,t,d.data(s,t)):undefined},removeData:function(t){return this.each(function(){d.removeData(this,t)})}});d.extend({queue:function(t,e,n){var i;if(t){e=(e||"fx")+"queue";i=d._data(t,e);if(n){if(!i||d.isArray(n)){i=d._data(t,e,d.makeArray(n))}else{i.push(n)}}return i||[]}},dequeue:function(t,e){e=e||"fx";var n=d.queue(t,e),i=n.length,r=n.shift(),s=d._queueHooks(t,e),o=function(){d.dequeue(t,e)};if(r==="inprogress"){r=n.shift();i--}if(r){if(e==="fx"){n.unshift("inprogress")}delete s.stop;r.call(t,o,s)}if(!i&&s){s.empty.fire()}},_queueHooks:function(t,e){var n=e+"queueHooks";return d._data(t,n)||d._data(t,n,{empty:d.Callbacks("once memory").add(function(){d._removeData(t,e+"queue");d._removeData(t,n)})})}});d.fn.extend({queue:function(t,e){var n=2;if(typeof t!=="string"){e=t;t="fx";n--}if(arguments.length<n){return d.queue(this[0],t)}return e===undefined?this:this.each(function(){var n=d.queue(this,t,e);d._queueHooks(this,t);if(t==="fx"&&n[0]!=="inprogress"){d.dequeue(this,t)}})},dequeue:function(t){return this.each(function(){d.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=d.Deferred(),s=this,o=this.length,a=function(){if(!--i){r.resolveWith(s,[s])}};if(typeof t!=="string"){e=t;t=undefined}t=t||"fx";while(o--){n=d._data(s[o],t+"queueHooks");if(n&&n.empty){i++;n.empty.add(a)}}a();return r.promise(e)}});(function(){var t;h.shrinkWrapBlocks=function(){if(t!=null){return t}t=false;var e,n,r;n=i.getElementsByTagName("body")[0];if(!n||!n.style){return}e=i.createElement("div");r=i.createElement("div");r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px";n.appendChild(r).appendChild(e);if(typeof e.style.zoom!=="undefined"){e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"+"box-sizing:content-box;display:block;margin:0;border:0;"+"padding:1px;width:1px;zoom:1";e.appendChild(i.createElement("div")).style.width="5px";t=e.offsetWidth!==3}n.removeChild(r);return t}})()
26;var U=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;var W=new RegExp("^(?:([+-])=|)("+U+")([a-z%]*)$","i");var Y=["Top","Right","Bottom","Left"];var X=function(t,e){t=e||t;return d.css(t,"display")==="none"||!d.contains(t.ownerDocument,t)};function J(t,e,n,i){var r,s=1,o=20,a=i?function(){return i.cur()}:function(){return d.css(t,e,"")},l=a(),c=n&&n[3]||(d.cssNumber[e]?"":"px"),u=(d.cssNumber[e]||c!=="px"&&+l)&&W.exec(d.css(t,e));if(u&&u[3]!==c){c=c||u[3];n=n||[];u=+l||1;do{s=s||".5";u=u/s;d.style(t,e,u+c)}while(s!==(s=a()/l)&&s!==1&&--o)}if(n){u=+u||+l||0;r=n[1]?u+(n[1]+1)*n[2]:+n[2];if(i){i.unit=c;i.start=u;i.end=r}}return r}var G=function(t,e,n,i,r,s,o){var a=0,l=t.length,c=n==null;if(d.type(n)==="object"){r=true;for(a in n){G(t,e,a,n[a],true,s,o)}}
26else if(i!==undefined){r=true;if(!d.isFunction(i)){o=true}if(c){if(o){e.call(t,i);e=null}else{c=e;e=function(t,e,n){return c.call(d(t),n)}}}if(e){for(;a<l;a++){e(t[a],n,o?i:i.call(t[a],a,e(t[a],n)))}}}return r?t:c?e.call(t):l?e(t[0],n):s};var K=/^(?:checkbox|radio)$/i;var Z=/<([\w:-]+)/;var Q=/^$|\/(?:java|ecma)script/i;var tt=/^\s+/;var et="abbr|article|aside|audio|bdi|canvas|data|datalist|"+"details|dialog|figcaption|figure|footer|header|hgroup|main|"+"mark|meter|nav|output|picture|progress|section|summary|template|time|video";function nt(t){var e=et.split("|"),n=t.createDocumentFragment();if(n.createElement){while(e.length){n.createElement(e.pop())}}return n}(function(){var t=i.createElement("div"),e=i.createDocumentFragment(),n=i.createElement("input");t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";h.leadingWhitespace=t.firstChild.nodeType===3;h.tbody=!t.getElementsByTagName("tbody").length;h.htmlSerialize=!!t.getElementsByTagName("link").length;h.html5Clone=i.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>";n.type="checkbox";n.checked=true;e.appendChild(n);h.appendChecked=n.checked;t.innerHTML="<textarea>x</textarea>";h.noCloneChecked=!!t.cloneNode(true).lastChild.defaultValue;e.appendChild(t);n=i.createElement("input");n.setAttribute("type","radio");n.setAttribute("checked","checked");n.setAttribute("name","t");t.appendChild(n);h.checkClone=t.cloneNode(true).cloneNode(true).lastChild.checked;h.noCloneEvent=!!t.addEventListener;t[d.expando]=1;h.attributes=!t.getAttribute(d.expando)})();var it={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:h.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};it.optgroup=it.option;it.tbody=it.tfoot=it.colgroup=it.caption=it.thead;it.th=it.td;function rt(t,e){var n,i,r=0,s=typeof t.getElementsByTagName!=="undefined"?t.getElementsByTagName(e||"*"):typeof t.querySelectorAll!=="undefined"?t.querySelectorAll(e||"*"):undefined;if(!s){for(s=[],n=t.childNodes||t;(i=n[r])!=null;r++){if(!e||d.nodeName(i,e)){s.push(i)}else{d.merge(s,rt(i,e))}}}return e===undefined||e&&d.nodeName(t,e)?d.merge([t],s):s}function st(t,e){var n,i=0;for(;(n=t[i])!=null;i++){d._data(n,"globalEval",!e||d._data(e[i],"globalEval"))}}var ot=/<|&#?\w+;/,at=/<tbody/i;function lt(t){if(K.test(t.type)){t.defaultChecked=t.checked}}function ct(t,e,n,i,r){var s,o,a,l,c,u,f,p=t.length,m=nt(e),g=[],_=0;for(;_<p;_++){o=t[_];if(o||o===0){if(d.type(o)==="object"){d.merge(g,o.nodeType?[o]:o)}else if(!ot.test(o)){g.push(e.createTextNode(o))}else{l=l||m.appendChild(e.createElement("div"));c=(Z.exec(o)||["",""])[1].toLowerCase();f=it[c]||it._default;l.innerHTML=f[1]+d.htmlPrefilter(o)+f[2];s=f[0];while(s--){l=l.lastChild}if(!h.leadingWhitespace&&tt.test(o)){g.push(e.createTextNode(tt.exec(o)[0]))}if(!h.tbody){o=c==="table"&&!at.test(o)?l.firstChild:f[1]==="<table>"&&!at.test(o)?l:0;s=o&&o.childNodes.length;while(s--){if(d.nodeName(u=o.childNodes[s],"tbody")&&!u.childNodes.length){o.removeChild(u)}}}d.merge(g,l.childNodes);l.textContent="";while(l.firstChild){l.removeChild(l.firstChild)}l=m.lastChild}}}if(l){m.removeChild(l)}if(!h.appendChecked){d.grep(rt(g,"input"),lt)}_=0;while(o=g[_++]){if(i&&d.inArray(o,i)>-1){if(r){r.push(o)}continue}a=d.contains(o.ownerDocument,o);l=rt(m.appendChild(o),"script");if(a){st(l)}if(n){s=0;while(o=l[s++]){if(Q.test(o.type||"")){n.push(o)}}}}l=null;return m}(function(){var e,n,r=i.createElement("div");for(e in{submit:true,change:true,focusin:true}){n="on"+e;if(!(h[e]=n in t)){r.setAttribute(n,"t");h[e]=r.attributes[n].expando===false}}r=null})();var ut=/^(?:input|select|textarea)$/i,ht=/^key/,ft=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,dt=/^(?:focusinfocus|focusoutblur)$/,pt=/^([^.]*)(?:\.(.+)|)/;function mt(){return true}function gt(){return false}function _t(){try{return i.activeElement}catch(t){}}function vt(t,e,n,i,r,s){var o,a;if(typeof e==="object"){if(typeof n!=="string"){i=i||n;n=undefined}for(a in e){vt(t,a,n,i,e[a],s)}return t}if(i==null&&r==null){r=n;
vendor: 4,088 bytes, line 26
26i=n=undefined}else if(r==null){if(typeof n==="string"){r=i;i=undefined}else{r=i;i=n;n=undefined}}if(r===false){r=gt}else if(!r){return t}if(s===1){o=r;r=function(t){d().off(t);return o.apply(this,arguments)};r.guid=o.guid||(o.guid=d.guid++)}return t.each(function(){d.event.add(this,e,r,i,n)})}d.event={global:{},add:function(t,e,n,i,r){var s,o,a,l,c,u,h,f,p,m,g,_=d._data(t);if(!_){return}if(n.handler){l=n;n=l.handler;r=l.selector}if(!n.guid){n.guid=d.guid++}if(!(o=_.events)){o=_.events={}}if(!(u=_.handle)){u=_.handle=function(t){return typeof d!=="undefined"&&(!t||d.event.triggered!==t.type)?d.event.dispatch.apply(u.elem,arguments):undefined};u.elem=t}e=(e||"").match(z)||[""];a=e.length;while(a--){s=pt.exec(e[a])||[];p=g=s[1];m=(s[2]||"").split(".").sort();if(!p){continue}c=d.event.special[p]||{};p=(r?c.delegateType:c.bindType)||p;c=d.event.special[p]||{};h=d.extend({type:p,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&d.expr.match.needsContext.test(r),namespace:m.join(".")},l);if(!(f=o[p])){f=o[p]=[];f.delegateCount=0;if(!c.setup||c.setup.call(t,i,m,u)===false){if(t.addEventListener){t.addEventListener(p,u,false)}else if(t.attachEvent){t.attachEvent("on"+p,u)}}}if(c.add){c.add.call(t,h);if(!h.handler.guid){h.handler.guid=n.guid}}if(r){f.splice(f.delegateCount++,0,h)}else{f.push(h)}d.event.global[p]=true}t=null},remove:function(t,e,n,i,r){var s,o,a,l,c,u,h,f,p,m,g,_=d.hasData(t)&&d._data(t);if(!_||!(u=_.events)){return}e=(e||"").match(z)||[""];c=e.length;while(c--){a=pt.exec(e[c])||[];p=g=a[1];m=(a[2]||"").split(".").sort();if(!p){for(p in u){d.event.remove(t,p+e[c],n,i,true)}continue}h=d.event.special[p]||{};p=(i?h.delegateType:h.bindType)||p;f=u[p]||[];a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)");l=s=f.length;while(s--){o=f[s];if((r||g===o.origType)&&(!n||n.guid===o.guid)&&(!a||a.test(o.namespace))&&(!i||i===o.selector||i==="**"&&o.selector)){f.splice(s,1);if(o.selector){f.delegateCount--}if(h.remove){h.remove.call(t,o)}}}if(l&&!f.length){if(!h.teardown||h.teardown.call(t,m,_.handle)===false){d.removeEvent(t,p,_.handle)}delete u[p]}}if(d.isEmptyObject(u)){delete _.handle;d._removeData(t,"events")}},trigger:function(e,n,r,s){var o,a,l,c,h,f,p,m=[r||i],g=u.call(e,"type")?e.type:e,_=u.call(e,"namespace")?e.namespace.split("."):[];l=f=r=r||i;if(r.nodeType===3||r.nodeType===8){return}if(dt.test(g+d.event.triggered)){return}if(g.indexOf(".")>-1){_=g.split(".");g=_.shift();_.sort()}a=g.indexOf(":")<0&&"on"+g;e=e[d.expando]?e:new d.Event(g,typeof e==="object"&&e);e.isTrigger=s?2:3;e.namespace=_.join(".");e.rnamespace=e.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;e.result=undefined;if(!e.target){e.target=r}n=n==null?[e]:d.makeArray(n,[e]);h=d.event.special[g]||{};if(!s&&h.trigger&&h.trigger.apply(r,n)===false){return}if(!s&&!h.noBubble&&!d.isWindow(r)){c=h.delegateType||g;if(!dt.test(c+g)){l=l.parentNode}for(;l;l=l.parentNode){m.push(l);f=l}if(f===(r.ownerDocument||i)){m.push(f.defaultView||f.parentWindow||t)}}p=0;while((l=m[p++])&&!e.isPropagationStopped()){e.type=p>1?c:h.bindType||g;o=(d._data(l,"events")||{})[e.type]&&d._data(l,"handle");if(o){o.apply(l,n)}o=a&&l[a];if(o&&o.apply&&L(l)){e.result=o.apply(l,n);if(e.result===false){e.preventDefault()}}}e.type=g;if(!s&&!e.isDefaultPrevented()){if((!h._default||h._default.apply(m.pop(),n)===false)&&L(r)){if(a&&r[g]&&!d.isWindow(r)){f=r[a];if(f){r[a]=null}d.event.triggered=g;try{r[g]()}catch(v){}d.event.triggered=undefined;if(f){r[a]=f}}}}return e.result},dispatch:function(t){t=d.event.fix(t);var e,n,i,s,o,a=[],l=r.call(arguments),c=(d._data(this,"events")||{})[t.type]||[],u=d.event.special[t.type]||{};l[0]=t;t.delegateTarget=this;if(u.preDispatch&&u.preDispatch.call(this,t)===false){return}a=d.event.handlers.call(this,t,c);e=0;while((s=a[e++])&&!t.isPropagationStopped()){t.currentTarget=s.elem;n=0;while((o=s.handlers[n++])&&!t.isImmediatePropagationStopped()){if(!t.rnamespace||t.rnamespace.test(o.namespace)){t.handleObj=o;t.data=o.data;i=((d.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,l);
26if(i!==undefined){if((t.result=i)===false){t.preventDefault();t.stopPropagation()}}}}}if(u.postDispatch){u.postDispatch.call(this,t)}return t.result},handlers:function(t,e){var n,i,r,s,o=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&(t.type!=="click"||isNaN(t.button)||t.button<1)){for(;l!=this;l=l.parentNode||this){if(l.nodeType===1&&(l.disabled!==true||t.type!=="click")){i=[];for(n=0;n<a;n++){s=e[n];r=s.selector+" ";if(i[r]===undefined){i[r]=s.needsContext?d(r,this).index(l)>-1:d.find(r,this,null,[l]).length}if(i[r]){i.push(s)}}if(i.length){o.push({elem:l,handlers:i})}}}}if(a<e.length){o.push({elem:this,handlers:e.slice(a)})}return o},fix:function(t){if(t[d.expando]){return t}var e,n,r,s=t.type,o=t,a=this.fixHooks[s];if(!a){this.fixHooks[s]=a=ft.test(s)?this.mouseHooks:ht.test(s)?this.keyHooks:{}}r=a.props?this.props.concat(a.props):this.props;t=new d.Event(o);e=r.length;while(e--){n=r[e];t[n]=o[n]}if(!t.target){t.target=o.srcElement||i}if(t.target.nodeType===3){t.target=t.target.parentNode}t.metaKey=!!t.metaKey;return a.filter?a.filter(t,o):t},props:("altKey bubbles cancelable ctrlKey currentTarget detail eventPhase "+"metaKey relatedTarget shiftKey target timeStamp view which").split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){if(t.which==null){t.which=e.charCode!=null?e.charCode:e.keyCode}return t}},mouseHooks:{props:("button buttons clientX clientY fromElement offsetX offsetY "+"pageX pageY screenX screenY toElement").split(" "),filter:function(t,e){var n,r,s,o=e.button,a=e.fromElement;if(t.pageX==null&&e.clientX!=null){r=t.target.ownerDocument||i;s=r.documentElement;n=r.body;t.pageX=e.clientX+(s&&s.scrollLeft||n&&n.scrollLeft||0)-(s&&s.clientLeft||n&&n.clientLeft||0);t.pageY=e.clientY+(s&&s.scrollTop||n&&n.scrollTop||0)-(s&&s.clientTop||n&&n.clientTop||0)}if(!t.relatedTarget&&a){t.relatedTarget=a===t.target?e.toElement:a}if(!t.which&&o!==undefined){t.which=o&1?1:o&2?3:o&4?2:0}return t}},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==_t()&&this.focus){try{this.focus();return false}catch(t){}}},delegateType:"focusin"},blur:{trigger:function(){if(this===_t()&&this.blur){this.blur();return false}},delegateType:"focusout"},click:{trigger:function(){if(d.nodeName(this,"input")&&this.type==="checkbox"&&this.click){this.click();return false}},_default:function(t){return d.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){if(t.result!==undefined&&t.originalEvent){t.originalEvent.returnValue=t.result}}}},simulate:function(t,e,n){var i=d.extend(new d.Event,n,{type:t,isSimulated:true});d.event.trigger(i,null,e);if(i.isDefaultPrevented()){n.preventDefault()}}};d.removeEvent=i.removeEventListener?function(t,e,n){if(t.removeEventListener){t.removeEventListener(e,n)}}:function(t,e,n){var i="on"+e;if(t.detachEvent){if(typeof t[i]==="undefined"){t[i]=null}t.detachEvent(i,n)}};d.Event=function(t,e){if(!(this instanceof d.Event)){return new d.Event(t,e)}if(t&&t.type){this.originalEvent=t;this.type=t.type;this.isDefaultPrevented=t.defaultPrevented||t.defaultPrevented===undefined&&t.returnValue===false?mt:gt}else{this.type=t}if(e){d.extend(this,e)}this.timeStamp=t&&t.timeStamp||d.now();this[d.expando]=true};d.Event.prototype={constructor:d.Event,isDefaultPrevented:gt,isPropagationStopped:gt,isImmediatePropagationStopped:gt,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=mt;if(!t){return}if(t.preventDefault){t.preventDefault()}else{t.returnValue=false}},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=mt;if(!t||this.isSimulated){return}if(t.stopPropagation){t.stopPropagation()}t.cancelBubble=true},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=mt;if(t&&t.stopImmediatePropagation){t.stopImmediatePropagation()}this.stopPropagation()}};
26d.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){d.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,s=t.handleObj;if(!r||r!==i&&!d.contains(i,r)){t.type=s.origType;n=s.handler.apply(this,arguments);t.type=e}return n}}});if(!h.submit){d.event.special.submit={setup:function(){if(d.nodeName(this,"form")){return false}d.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=d.nodeName(e,"input")||d.nodeName(e,"button")?d.prop(e,"form"):undefined;if(n&&!d._data(n,"submit")){d.event.add(n,"submit._submit",function(t){t._submitBubble=true});d._data(n,"submit",true)}})},postDispatch:function(t){if(t._submitBubble){delete t._submitBubble;if(this.parentNode&&!t.isTrigger){d.event.simulate("submit",this.parentNode,t)}}},teardown:function(){if(d.nodeName(this,"form")){return false}d.event.remove(this,"._submit")}}}if(!h.change){d.event.special.change={setup:function(){if(ut.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){d.event.add(this,"propertychange._change",function(t){if(t.originalEvent.propertyName==="checked"){this._justChanged=true}});d.event.add(this,"click._change",function(t){if(this._justChanged&&!t.isTrigger){this._justChanged=false}d.event.simulate("change",this,t)})}return false}d.event.add(this,"beforeactivate._change",function(t){var e=t.target;if(ut.test(e.nodeName)&&!d._data(e,"change")){d.event.add(e,"change._change",function(t){if(this.parentNode&&!t.isSimulated&&!t.isTrigger){d.event.simulate("change",this.parentNode,t)}});d._data(e,"change",true)}})},handle:function(t){var e=t.target;if(this!==e||t.isSimulated||t.isTrigger||e.type!=="radio"&&e.type!=="checkbox"){return t.handleObj.handler.apply(this,arguments)}},teardown:function(){d.event.remove(this,"._change");return!ut.test(this.nodeName)}}}if(!h.focusin){d.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){d.event.simulate(e,t.target,d.event.fix(t))};d.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=d._data(i,e);if(!r){i.addEventListener(t,n,true)}d._data(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=d._data(i,e)-1;if(!r){i.removeEventListener(t,n,true);d._removeData(i,e)}else{d._data(i,e,r)}}}})}d.fn.extend({on:function(t,e,n,i){return vt(this,t,e,n,i)},one:function(t,e,n,i){return vt(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj){i=t.handleObj;d(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler);return this}if(typeof t==="object"){for(r in t){this.off(r,e,t[r])}return this}if(e===false||typeof e==="function"){n=e;e=undefined}if(n===false){n=gt}return this.each(function(){d.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){d.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n){return d.event.trigger(t,e,n,true)}}});var yt=/ jQuery\d+="(?:null|\d+)"/g,bt=new RegExp("<(?:"+et+")[\\s/>]","i"),xt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wt=/<script|<style|<link/i,kt=/checked\s*(?:[^=]|=\s*.checked.)/i,St=/^true\/(.*)/,Mt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Tt=nt(i),Ct=Tt.appendChild(i.createElement("div"));function At(t,e){return d.nodeName(t,"table")&&d.nodeName(e.nodeType!==11?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function Dt(t){t.type=(d.find.attr(t,"type")!==null)+"/"+t.type;return t}function Et(t){var e=St.exec(t.type);if(e){t.type=e[1]}else{t.removeAttribute("type")}return t}function Nt(t,e){if(e.nodeType!==1||!d.hasData(t)){return}var n,i,r,s=d._data(t),o=d._data(e,s),a=s.events;if(a){delete o.handle;o.events={};for(n in a){for(i=0,r=a[n].length;i<r;i++){d.event.add(e,n,a[n][i])}}}if(o.data){o.data=d.extend({},o.data)}}function zt(t,e){var n,i,r;if(e.nodeType!==1){return}n=e.nodeName.toLowerCase();if(!h.noCloneEvent&&e[d.expando]){r=d._data(e);for(i in r.events){d.removeEvent(e,i,r.handle)}e.removeAttribute(d.expando)}if(n==="script"&&e.text!==t.text){Dt(e).text=t.text;Et(e)}else if(n==="object"){if(e.parentNode){e.outerHTML=t.outerHTML}
26if(h.html5Clone&&(t.innerHTML&&!d.trim(e.innerHTML))){e.innerHTML=t.innerHTML}}else if(n==="input"&&K.test(t.type)){e.defaultChecked=e.checked=t.checked;if(e.value!==t.value){e.value=t.value}}else if(n==="option"){e.defaultSelected=e.selected=t.defaultSelected}else if(n==="input"||n==="textarea"){e.defaultValue=t.defaultValue}}function Pt(t,e,n,i){e=s.apply([],e);var r,o,a,l,c,u,f=0,p=t.length,m=p-1,g=e[0],_=d.isFunction(g);if(_||p>1&&typeof g==="string"&&!h.checkClone&&kt.test(g)){return t.each(function(r){var s=t.eq(r);if(_){e[0]=g.call(this,r,s.html())}Pt(s,e,n,i)})}if(p){u=ct(e,t[0].ownerDocument,false,t,i);r=u.firstChild;if(u.childNodes.length===1){u=r}if(r||i){l=d.map(rt(u,"script"),Dt);a=l.length;for(;f<p;f++){o=u;if(f!==m){o=d.clone(o,true,true);if(a){d.merge(l,rt(o,"script"))}}n.call(t[f],o,f)}if(a){c=l[l.length-1].ownerDocument;d.map(l,Et);for(f=0;f<a;f++){o=l[f];if(Q.test(o.type||"")&&!d._data(o,"globalEval")&&d.contains(c,o)){if(o.src){if(d._evalUrl){d._evalUrl(o.src)}}else{d.globalEval((o.text||o.textContent||o.innerHTML||"").replace(Mt,""))}}}}u=r=null}}return t}function jt(t,e,n){var i,r=e?d.filter(e,t):t,s=0;for(;(i=r[s])!=null;s++){if(!n&&i.nodeType===1){d.cleanData(rt(i))}if(i.parentNode){if(n&&d.contains(i.ownerDocument,i)){st(rt(i,"script"))}i.parentNode.removeChild(i)}}return t}d.extend({htmlPrefilter:function(t){return t.replace(xt,"<$1></$2>")},clone:function(t,e,n){var i,r,s,o,a,l=d.contains(t.ownerDocument,t);if(h.html5Clone||d.isXMLDoc(t)||!bt.test("<"+t.nodeName+">")){s=t.cloneNode(true)}else{Ct.innerHTML=t.outerHTML;Ct.removeChild(s=Ct.firstChild)}if((!h.noCloneEvent||!h.noCloneChecked)&&(t.nodeType===1||t.nodeType===11)&&!d.isXMLDoc(t)){i=rt(s);a=rt(t);for(o=0;(r=a[o])!=null;++o){if(i[o]){zt(r,i[o])}}}if(e){if(n){a=a||rt(t);i=i||rt(s);for(o=0;(r=a[o])!=null;o++){Nt(r,i[o])}}else{Nt(t,s)}}i=rt(s,"script");if(i.length>0){st(i,!l&&rt(t,"script"))}i=a=r=null;return s},cleanData:function(t,e){var i,r,s,o,a=0,l=d.expando,c=d.cache,u=h.attributes,f=d.event.special;for(;(i=t[a])!=null;a++){if(e||L(i)){s=i[l];o=s&&c[s];if(o){if(o.events){for(r in o.events){if(f[r]){d.event.remove(i,r)}else{d.removeEvent(i,r,o.handle)}}}if(c[s]){delete c[s];if(!u&&typeof i.removeAttribute!=="undefined"){i.removeAttribute(l)}else{i[l]=undefined}n.push(s)}}}}}});d.fn.extend({domManip:Pt,detach:function(t){return jt(this,t,true)},remove:function(t){return jt(this,t)},text:function(t){return G(this,function(t){return t===undefined?d.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(t))},null,t,arguments.length)},append:function(){return Pt(this,arguments,function(t){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var e=At(this,t);e.appendChild(t)}})},prepend:function(){return Pt(this,arguments,function(t){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var e=At(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Pt(this,arguments,function(t){if(this.parentNode){this.parentNode.insertBefore(t,this)}})},after:function(){return Pt(this,arguments,function(t){if(this.parentNode){this.parentNode.insertBefore(t,this.nextSibling)}})},empty:function(){var t,e=0;for(;(t=this[e])!=null;e++){if(t.nodeType===1){d.cleanData(rt(t,false))}while(t.firstChild){t.removeChild(t.firstChild)}if(t.options&&d.nodeName(t,"select")){t.options.length=0}}return this},clone:function(t,e){t=t==null?false:t;e=e==null?t:e;return this.map(function(){return d.clone(this,t,e)})},html:function(t){return G(this,function(t){var e=this[0]||{},n=0,i=this.length;if(t===undefined){return e.nodeType===1?e.innerHTML.replace(yt,""):undefined}if(typeof t==="string"&&!wt.test(t)&&(h.htmlSerialize||!bt.test(t))&&(h.leadingWhitespace||!tt.test(t))&&!it[(Z.exec(t)||["",""])[1].toLowerCase()]){t=d.htmlPrefilter(t);try{for(;n<i;n++){e=this[n]||{};if(e.nodeType===1){d.cleanData(rt(e,false));e.innerHTML=t}}e=0}catch(r){}}if(e){this.empty().append(t)}},null,t,arguments.length)},replaceWith:function(){var t=[];return Pt(this,arguments,function(e){var n=this.parentNode;if(d.inArray(this,t)<0){d.cleanData(rt(this));if(n){n.replaceChild(e,this)}}},t)}});d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){d.fn[t]=function(t){var n,i=0,r=[],s=d(t),a=s.length-1;for(;i<=a;i++){n=i===a?this:this.clone(true);d(s[i])[e](n);o.apply(r,n.get())}return this.pushStack(r)}});var It,$t={HTML:"block",BODY:"block"};function Rt(t,e){var n=d(e.createElement(t)).appendTo(e.body),i=d.css(n[0],"display");n.detach();return i}function Lt(t){var e=i,n=$t[t];if(!n){n=Rt(t,e);if(n==="none"||!n){It=(It||d("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement);e=(It[0].contentWindow||It[0].contentDocument).document;e.write();e.close();n=Rt(t,e);It.detach()}$t[t]=n}return n}var Ft=/^margin/;var Ot=new RegExp("^("+U+")(?!px)[a-z%]+$","i");var Ht=function(t,e,n,i){var r,s,o={};for(s in e){o[s]=t.style[s];t.style[s]=e[s]}r=n.apply(t,i||[]);for(s in e){t.style[s]=o[s]}return r};var Vt=i.documentElement;(function(){var e,n,r,s,o,a,l=i.createElement("div"),c=i.createElement("div");if(!c.style){return}c.style.cssText="float:left;opacity:.5";h.opacity=c.style.opacity==="0.5";h.cssFloat=!!c.style.cssFloat;c.style.backgroundClip="content-box";c.cloneNode(true).style.backgroundClip="";h.clearCloneStyle=c.style.backgroundClip==="content-box";l=i.createElement("div");l.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;"+"padding:0;margin-top:1px;position:absolute";c.innerHTML="";l.appendChild(c);h.boxSizing=c.style.boxSizing===""||c.style.MozBoxSizing===""||c.style.WebkitBoxSizing==="";d.extend(h,{reliableHiddenOffsets:function(){if(e==null){u()}return s},boxSizingReliable:function(){if(e==null){u()}return r},pixelMarginRight:function(){if(e==null){u()}return n},pixelPosition:function(){if(e==null){u()}return e},reliableMarginRight:function(){if(e==null){u()}return o},reliableMarginLeft:function(){if(e==null){u()}return a}});function u(){var u,h,f=i.documentElement;f.appendChild(l);c.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;"+"position:relative;display:block;"+"margin:auto;border:1px;padding:1px;"+"top:1%;width:50%";e=r=a=false;n=o=true;if(t.getComputedStyle){h=t.getComputedStyle(c);e=(h||{}).top!=="1%";a=(h||{}).marginLeft==="2px";r=(h||{width:"4px"}).width==="4px";c.style.marginRight="50%";n=(h||{marginRight:"4px"}).marginRight==="4px";u=c.appendChild(i.createElement("div"));u.style.cssText=c.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;"+"box-sizing:content-box;display:block;margin:0;border:0;padding:0";u.style.marginRight=u.style.width="0";c.style.width="1px";o=!parseFloat((t.getComputedStyle(u)||{}).marginRight);c.removeChild(u)}c.style.display="none";s=c.getClientRects().length===0;if(s){c.style.display="";c.innerHTML="<table><tr><td></td><td>t</td></tr></table>";c.childNodes[0].style.borderCollapse="separate";u=c.getElementsByTagName("td");u[0].style.cssText="margin:0;border:0;padding:0;display:none";s=u[0].offsetHeight===0;if(s){u[0].style.display="";u[1].style.display="none";s=u[0].offsetHeight===0}}f.removeChild(l)}})();var qt,Bt,Ut=/^(top|right|bottom|left)$/;if(t.getComputedStyle){qt=function(e){var n=e.ownerDocument.defaultView;if(!n||!n.opener){n=t}return n.getComputedStyle(e)};Bt=function(t,e,n){var i,r,s,o,a=t.style;n=n||qt(t);o=n?n.getPropertyValue(e)||n[e]:undefined;if((o===""||o===undefined)&&!d.contains(t.ownerDocument,t)){o=d.style(t,e)}if(n){if(!h.pixelMarginRight()&&Ot.test(o)&&Ft.test(e)){i=a.width;r=a.minWidth;s=a.maxWidth;a.minWidth=a.maxWidth=a.width=o;o=n.width;a.width=i;a.minWidth=r;a.maxWidth=s}}return o===undefined?o:o+""}}else if(Vt.currentStyle){qt=function(t){return t.currentStyle};Bt=function(t,e,n){var i,r,s,o,a=t.style;n=n||qt(t);o=n?n[e]:undefined;if(o==null&&a&&a[e]){o=a[e]}if(Ot.test(o)&&!Ut.test(e)){i=a.left;r=t.runtimeStyle;s=r&&r.left;if(s){r.left=t.currentStyle.left}a.left=e==="fontSize"?"1em":o;o=a.pixelLeft+"px";a.left=i;if(s){r.left=s}}return o===undefined?o:o+""||"auto"}}function Wt(t,e){return{get:function(){if(t()){delete this.get;return}return(this.get=e).apply(this,arguments)}}}
26var Yt=/alpha\([^)]*\)/i,Xt=/opacity\s*=\s*([^)]*)/i,Jt=/^(none|table(?!-c[ea]).+)/,Gt=new RegExp("^("+U+")(.*)$","i"),Kt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"},Qt=["Webkit","O","Moz","ms"],te=i.createElement("div").style;function ee(t){if(t in te){return t}var e=t.charAt(0).toUpperCase()+t.slice(1),n=Qt.length;while(n--){t=Qt[n]+e;if(t in te){return t}}}function ne(t,e){var n,i,r,s=[],o=0,a=t.length;for(;o<a;o++){i=t[o];if(!i.style){continue}s[o]=d._data(i,"olddisplay");n=i.style.display;if(e){if(!s[o]&&n==="none"){i.style.display=""}if(i.style.display===""&&X(i)){s[o]=d._data(i,"olddisplay",Lt(i.nodeName))}}else{r=X(i);if(n&&n!=="none"||!r){d._data(i,"olddisplay",r?n:d.css(i,"display"))}}}for(o=0;o<a;o++){i=t[o];if(!i.style){continue}if(!e||i.style.display==="none"||i.style.display===""){i.style.display=e?s[o]||"":"none"}}return t}function ie(t,e,n){var i=Gt.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function re(t,e,n,i,r){var s=n===(i?"border":"content")?4:e==="width"?1:0,o=0;for(;s<4;s+=2){if(n==="margin"){o+=d.css(t,n+Y[s],true,r)}if(i){if(n==="content"){o-=d.css(t,"padding"+Y[s],true,r)}if(n!=="margin"){o-=d.css(t,"border"+Y[s]+"Width",true,r)}}else{o+=d.css(t,"padding"+Y[s],true,r);if(n!=="padding"){o+=d.css(t,"border"+Y[s]+"Width",true,r)}}}return o}function se(t,e,n){var i=true,r=e==="width"?t.offsetWidth:t.offsetHeight,s=qt(t),o=h.boxSizing&&d.css(t,"boxSizing",false,s)==="border-box";if(r<=0||r==null){r=Bt(t,e,s);if(r<0||r==null){r=t.style[e]}if(Ot.test(r)){return r}i=o&&(h.boxSizingReliable()||r===t.style[e]);r=parseFloat(r)||0}return r+re(t,e,n||(o?"border":"content"),i,s)+"px"}d.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Bt(t,"opacity");return n===""?"1":n}}}},cssNumber:{animationIterationCount:true,columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{float:h.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,i){if(!t||t.nodeType===3||t.nodeType===8||!t.style){return}var r,s,o,a=d.camelCase(e),l=t.style;e=d.cssProps[a]||(d.cssProps[a]=ee(a)||a);o=d.cssHooks[e]||d.cssHooks[a];if(n!==undefined){s=typeof n;if(s==="string"&&(r=W.exec(n))&&r[1]){n=J(t,e,r);s="number"}if(n==null||n!==n){return}if(s==="number"){n+=r&&r[3]||(d.cssNumber[a]?"":"px")}if(!h.clearCloneStyle&&n===""&&e.indexOf("background")===0){l[e]="inherit"}if(!o||!("set"in o)||(n=o.set(t,n,i))!==undefined){try{l[e]=n}catch(c){}}}else{if(o&&"get"in o&&(r=o.get(t,false,i))!==undefined){return r}return l[e]}},css:function(t,e,n,i){var r,s,o,a=d.camelCase(e);e=d.cssProps[a]||(d.cssProps[a]=ee(a)||a);o=d.cssHooks[e]||d.cssHooks[a];if(o&&"get"in o){s=o.get(t,true,n)}if(s===undefined){s=Bt(t,e,i)}if(s==="normal"&&e in Zt){s=Zt[e]}if(n===""||n){r=parseFloat(s);return n===true||isFinite(r)?r||0:s}return s}});d.each(["height","width"],function(t,e){d.cssHooks[e]={get:function(t,n,i){if(n){return Jt.test(d.css(t,"display"))&&t.offsetWidth===0?Ht(t,Kt,function(){return se(t,e,i)}):se(t,e,i)}},set:function(t,n,i){var r=i&&qt(t);return ie(t,n,i?re(t,e,i,h.boxSizing&&d.css(t,"boxSizing",false,r)==="border-box",r):0)}}});if(!h.opacity){d.cssHooks.opacity={get:function(t,e){return Xt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,r=d.isNumeric(e)?"alpha(opacity="+e*100+")":"",s=i&&i.filter||n.filter||"";n.zoom=1;if((e>=1||e==="")&&d.trim(s.replace(Yt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(e===""||i&&!i.filter){return}}n.filter=Yt.test(s)?s.replace(Yt,r):s+" "+r}}}d.cssHooks.marginRight=Wt(h.reliableMarginRight,function(t,e){if(e){return Ht(t,{display:"inline-block"},Bt,[t,"marginRight"])}});d.cssHooks.marginLeft=Wt(h.reliableMarginLeft,function(t,e){if(e){return(parseFloat(Bt(t,"marginLeft"))||(d.contains(t.ownerDocument,t)?t.getBoundingClientRect().left-Ht(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}):0))+"px"}});d.each({margin:"",padding:"",border:"Width"},function(t,e){d.cssHooks[t+e]={expand:function(n){var i=0,r={}
26,s=typeof n==="string"?n.split(" "):[n];for(;i<4;i++){r[t+Y[i]+e]=s[i]||s[i-2]||s[0]}return r}};if(!Ft.test(t)){d.cssHooks[t+e].set=ie}});d.fn.extend({css:function(t,e){return G(this,function(t,e,n){var i,r,s={},o=0;if(d.isArray(e)){i=qt(t);r=e.length;for(;o<r;o++){s[e[o]]=d.css(t,e[o],false,i)}return s}return n!==undefined?d.style(t,e,n):d.css(t,e)},t,e,arguments.length>1)},show:function(){return ne(this,true)},hide:function(){return ne(this)},toggle:function(t){if(typeof t==="boolean"){return t?this.show():this.hide()}return this.each(function(){if(X(this)){d(this).show()}else{d(this).hide()}})}});function oe(t,e,n,i,r){return new oe.prototype.init(t,e,n,i,r)}d.Tween=oe;oe.prototype={constructor:oe,init:function(t,e,n,i,r,s){this.elem=t;this.prop=n;this.easing=r||d.easing._default;this.options=e;this.start=this.now=this.cur();this.end=i;this.unit=s||(d.cssNumber[n]?"":"px")},cur:function(){var t=oe.propHooks[this.prop];return t&&t.get?t.get(this):oe.propHooks._default.get(this)},run:function(t){var e,n=oe.propHooks[this.prop];if(this.options.duration){this.pos=e=d.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration)}else{this.pos=e=t}this.now=(this.end-this.start)*e+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this)}if(n&&n.set){n.set(this)}else{oe.propHooks._default.set(this)}return this}};oe.prototype.init.prototype=oe.prototype;oe.propHooks={_default:{get:function(t){var e;if(t.elem.nodeType!==1||t.elem[t.prop]!=null&&t.elem.style[t.prop]==null){return t.elem[t.prop]}e=d.css(t.elem,t.prop,"");return!e||e==="auto"?0:e},set:function(t){if(d.fx.step[t.prop]){d.fx.step[t.prop](t)}else if(t.elem.nodeType===1&&(t.elem.style[d.cssProps[t.prop]]!=null||d.cssHooks[t.prop])){d.style(t.elem,t.prop,t.now+t.unit)}else{t.elem[t.prop]=t.now}}}};oe.propHooks.scrollTop=oe.propHooks.scrollLeft={set:function(t){if(t.elem.nodeType&&t.elem.parentNode){t.elem[t.prop]=t.now}}};d.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"};d.fx=oe.prototype.init;d.fx.step={};var ae,le,ce=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function he(){t.setTimeout(function(){ae=undefined});return ae=d.now()}function fe(t,e){var n,i={height:t},r=0;e=e?1:0;for(;r<4;r+=2-e){n=Y[r];i["margin"+n]=i["padding"+n]=t}if(e){i.opacity=i.width=t}return i}function de(t,e,n){var i,r=(ge.tweeners[e]||[]).concat(ge.tweeners["*"]),s=0,o=r.length;for(;s<o;s++){if(i=r[s].call(n,e,t)){return i}}}function pe(t,e,n){var i,r,s,o,a,l,c,u,f=this,p={},m=t.style,g=t.nodeType&&X(t),_=d._data(t,"fxshow");if(!n.queue){a=d._queueHooks(t,"fx");if(a.unqueued==null){a.unqueued=0;l=a.empty.fire;a.empty.fire=function(){if(!a.unqueued){l()}}}a.unqueued++;f.always(function(){f.always(function(){a.unqueued--;if(!d.queue(t,"fx").length){a.empty.fire()}})})}if(t.nodeType===1&&("height"in e||"width"in e)){n.overflow=[m.overflow,m.overflowX,m.overflowY];c=d.css(t,"display");u=c==="none"?d._data(t,"olddisplay")||Lt(t.nodeName):c;if(u==="inline"&&d.css(t,"float")==="none"){
27if(!h.inlineBlockNeedsLayout||Lt(t.nodeName)==="inline"){m.display="inline-block"}else{m.zoom=1}}}if(n.overflow){m.overflow="hidden";if(!h.shrinkWrapBlocks()){f.always(function(){m.overflow=n.overflow[0];m.overflowX=n.overflow[1];m.overflowY=n.overflow[2]})}}for(i in e){r=e[i];if(ce.exec(r)){delete e[i];s=s||r==="toggle";if(r===(g?"hide":"show")){if(r==="show"&&_&&_[i]!==undefined){g=true}else{continue}}p[i]=_&&_[i]||d.style(t,i)}else{c=undefined}}if(!d.isEmptyObject(p)){if(_){if("hidden"in _){g=_.hidden}}else{_=d._data(t,"fxshow",{})}if(s){_.hidden=!g}if(g){d(t).show()}else{f.done(function(){d(t).hide()})}f.done(function(){var e;d._removeData(t,"fxshow");for(e in p){d.style(t,e,p[e])}});for(i in p){o=de(g?_[i]:0,i,f);if(!(i in _)){_[i]=o.start;if(g){o.end=o.start;o.start=i==="width"||i==="height"?1:0}}}}else if((c==="none"?Lt(t.nodeName):c)==="inline"){m.display=c}}function me(t,e){var n,i,r,s,o;for(n in t){i=d.camelCase(n);r=e[i];s=t[n];if(d.isArray(s)){r=s[1];s=t[n]=s[0]}if(n!==i){t[i]=s;delete t[n]}o=d.cssHooks[i];if(o&&"expand"in o){s=o.expand(s);delete t[i];for(n in s){if(!(n in t)){t[n]=s[n];e[n]=r}}}else{e[i]=r}}}function ge(t,e,n){var i,r,s=0,o=ge.prefilters.length,a=d.Deferred().always(function(){delete l.elem}),l=function(){if(r){return false}var e=ae||he(),n=Math.max(0,c.startTime+c.duration-e),i=n/c.duration||0,s=1-i,o=0,l=c.tweens.length;for(;o<l;o++){c.tweens[o].run(s)}a.notifyWith(t,[c,s,n]);if(s<1&&l){return n}else{a.resolveWith(t,[c]);return false}},c=a.promise({elem:t,props:d.extend({},e),opts:d.extend(true,{specialEasing:{},easing:d.easing._default},n),originalProperties:e,originalOptions:n,startTime:ae||he(),duration:n.duration,tweens:[],createTween:function(e,n){var i=d.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);c.tweens.push(i);return i},stop:function(e){var n=0,i=e?c.tweens.length:0;if(r){return this}r=true;for(;n<i;n++){c.tweens[n].run(1)}if(e){a.notifyWith(t,[c,1,0]);a.resolveWith(t,[c,e])}else{a.rejectWith(t,[c,e])}return this}}),u=c.props;me(u,c.opts.specialEasing);for(;s<o;s++){i=ge.prefilters[s].call(c,t,u,c.opts);if(i){if(d.isFunction(i.stop)){d._queueHooks(c.elem,c.opts.queue).stop=d.proxy(i.stop,i)}return i}}d.map(u,de,c);if(d.isFunction(c.opts.start)){c.opts.start.call(t,c)}d.fx.timer(d.extend(l,{elem:t,anim:c,queue:c.opts.queue}));return c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}d.Animation=d.extend(ge,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);J(n.elem,t,W.exec(e),n);return n}]},tweener:function(t,e){if(d.isFunction(t)){e=t;t=["*"]}else{t=t.match(z)}var n,i=0,r=t.length;for(;i<r;i++){n=t[i];ge.tweeners[n]=ge.tweeners[n]||[];ge.tweeners[n].unshift(e)}},prefilters:[pe],prefilter:function(t,e){if(e){ge.prefilters.unshift(t)}else{ge.prefilters.push(t)}}});d.speed=function(t,e,n){var i=t&&typeof t==="object"?d.extend({},t):{complete:n||!n&&e||d.isFunction(t)&&t,duration:t,easing:n&&e||e&&!d.isFunction(e)&&e};i.duration=d.fx.off?0:typeof i.duration==="number"?i.duration:i.duration in d.fx.speeds?d.fx.speeds[i.duration]:d.fx.speeds._default;if(i.queue==null||i.queue===true){i.queue="fx"}i.old=i.complete;i.complete=function(){if(d.isFunction(i.old)){i.old.call(this)}if(i.queue){d.dequeue(this,i.queue)}};return i};d.fn.extend({fadeTo:function(t,e,n,i){return this.filter(X).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=d.isEmptyObject(t),s=d.speed(e,n,i),o=function(){var e=ge(this,d.extend({},t),s);if(r||d._data(this,"finish")){e.stop(true)}};o.finish=o;return r||s.queue===false?this.each(o):this.queue(s.queue,o)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop;e(n)};if(typeof t!=="string"){n=e;e=t;t=undefined}if(e&&t!==false){this.queue(t||"fx",[])}return this.each(function(){var e=true,r=t!=null&&t+"queueHooks",s=d.timers,o=d._data(this);
27if(r){if(o[r]&&o[r].stop){i(o[r])}}else{for(r in o){if(o[r]&&o[r].stop&&ue.test(r)){i(o[r])}}}for(r=s.length;r--;){if(s[r].elem===this&&(t==null||s[r].queue===t)){s[r].anim.stop(n);e=false;s.splice(r,1)}}if(e||!n){d.dequeue(this,t)}})},finish:function(t){if(t!==false){t=t||"fx"}return this.each(function(){var e,n=d._data(this),i=n[t+"queue"],r=n[t+"queueHooks"],s=d.timers,o=i?i.length:0;n.finish=true;d.queue(this,t,[]);if(r&&r.stop){r.stop.call(this,true)}for(e=s.length;e--;){if(s[e].elem===this&&s[e].queue===t){s[e].anim.stop(true);s.splice(e,1)}}for(e=0;e<o;e++){if(i[e]&&i[e].finish){i[e].finish.call(this)}}delete n.finish})}});d.each(["toggle","show","hide"],function(t,e){var n=d.fn[e];d.fn[e]=function(t,i,r){return t==null||typeof t==="boolean"?n.apply(this,arguments):this.animate(fe(e,true),t,i,r)}});d.each({slideDown:fe("show"),slideUp:fe("hide"),slideToggle:fe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){d.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}});d.timers=[];d.fx.tick=function(){var t,e=d.timers,n=0;ae=d.now();for(;n<e.length;n++){t=e[n];if(!t()&&e[n]===t){e.splice(n--,1)}}if(!e.length){d.fx.stop()}ae=undefined};d.fx.timer=function(t){d.timers.push(t);if(t()){d.fx.start()}else{d.timers.pop()}};d.fx.interval=13;d.fx.start=function(){if(!le){le=t.setInterval(d.fx.tick,d.fx.interval)}};d.fx.stop=function(){t.clearInterval(le);le=null};d.fx.speeds={slow:600,fast:200,_default:400};d.fn.delay=function(e,n){e=d.fx?d.fx.speeds[e]||e:e;n=n||"fx";return this.queue(n,function(n,i){var r=t.setTimeout(n,e);i.stop=function(){t.clearTimeout(r)}})};(function(){var t,e=i.createElement("input"),n=i.createElement("div"),r=i.createElement("select"),s=r.appendChild(i.createElement("option"));n=i.createElement("div");n.setAttribute("className","t");n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";t=n.getElementsByTagName("a")[0];e.setAttribute("type","checkbox");n.appendChild(e);t=n.getElementsByTagName("a")[0];t.style.cssText="top:1px";h.getSetAttribute=n.className!=="t";h.style=/top/.test(t.getAttribute("style"));h.hrefNormalized=t.getAttribute("href")==="/a";h.checkOn=!!e.value;h.optSelected=s.selected;h.enctype=!!i.createElement("form").enctype;r.disabled=true;h.optDisabled=!s.disabled;e=i.createElement("input");e.setAttribute("value","");h.input=e.getAttribute("value")==="";e.value="t";e.setAttribute("type","radio");h.radioValue=e.value==="t"})();var _e=/\r/g,ve=/[\x20\t\r\n\f]+/g;d.fn.extend({val:function(t){var e,n,i,r=this[0];if(!arguments.length){if(r){e=d.valHooks[r.type]||d.valHooks[r.nodeName.toLowerCase()];if(e&&"get"in e&&(n=e.get(r,"value"))!==undefined){return n}n=r.value;return typeof n==="string"?n.replace(_e,""):n==null?"":n}return}i=d.isFunction(t);return this.each(function(n){var r;if(this.nodeType!==1){return}if(i){r=t.call(this,n,d(this).val())}else{r=t}if(r==null){r=""}else if(typeof r==="number"){r+=""}else if(d.isArray(r)){r=d.map(r,function(t){return t==null?"":t+""})}e=d.valHooks[this.type]||d.valHooks[this.nodeName.toLowerCase()];if(!e||!("set"in e)||e.set(this,r,"value")===undefined){this.value=r}})}});d.extend({valHooks:{option:{get:function(t){var e=d.find.attr(t,"value");return e!=null?e:d.trim(d.text(t)).replace(ve," ")}}
27,select:{get:function(t){var e,n,i=t.options,r=t.selectedIndex,s=t.type==="select-one"||r<0,o=s?null:[],a=s?r+1:i.length,l=r<0?a:s?r:0;for(;l<a;l++){n=i[l];if((n.selected||l===r)&&(h.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!d.nodeName(n.parentNode,"optgroup"))){e=d(n).val();if(s){return e}o.push(e)}}return o},set:function(t,e){var n,i,r=t.options,s=d.makeArray(e),o=r.length;while(o--){i=r[o];if(d.inArray(d.valHooks.option.get(i),s)>-1){try{i.selected=n=true}catch(a){i.scrollHeight}}else{i.selected=false}}if(!n){t.selectedIndex=-1}return r}}}});d.each(["radio","checkbox"],function(){d.valHooks[this]={set:function(t,e){if(d.isArray(e)){return t.checked=d.inArray(d(t).val(),e)>-1}}};if(!h.checkOn){d.valHooks[this].get=function(t){return t.getAttribute("value")===null?"on":t.value}}});var ye,be,xe=d.expr.attrHandle,we=/^(?:checked|selected)$/i,ke=h.getSetAttribute,Se=h.input;d.fn.extend({attr:function(t,e){return G(this,d.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){d.removeAttr(this,t)})}});d.extend({attr:function(t,e,n){var i,r,s=t.nodeType;if(s===3||s===8||s===2){return}if(typeof t.getAttribute==="undefined"){return d.prop(t,e,n)}if(s!==1||!d.isXMLDoc(t)){e=e.toLowerCase();r=d.attrHooks[e]||(d.expr.match.bool.test(e)?be:ye)}if(n!==undefined){if(n===null){d.removeAttr(t,e);return}if(r&&"set"in r&&(i=r.set(t,n,e))!==undefined){return i}t.setAttribute(e,n+"");return n}if(r&&"get"in r&&(i=r.get(t,e))!==null){return i}i=d.find.attr(t,e);return i==null?undefined:i},attrHooks:{type:{set:function(t,e){if(!h.radioValue&&e==="radio"&&d.nodeName(t,"input")){var n=t.value;t.setAttribute("type",e);if(n){t.value=n}return e}}}},removeAttr:function(t,e){var n,i,r=0,s=e&&e.match(z);if(s&&t.nodeType===1){while(n=s[r++]){i=d.propFix[n]||n;if(d.expr.match.bool.test(n)){if(Se&&ke||!we.test(n)){t[i]=false}else{t[d.camelCase("default-"+n)]=t[i]=false}}else{d.attr(t,n,"")}t.removeAttribute(ke?n:i)}}}});be={set:function(t,e,n){if(e===false){d.removeAttr(t,n)}else if(Se&&ke||!we.test(n)){t.setAttribute(!ke&&d.propFix[n]||n,n)}else{t[d.camelCase("default-"+n)]=t[n]=true}return n}};d.each(d.expr.match.bool.source.match(/\w+/g),function(t,e){var n=xe[e]||d.find.attr;if(Se&&ke||!we.test(e)){xe[e]=function(t,e,i){var r,s;if(!i){s=xe[e];xe[e]=r;r=n(t,e,i)!=null?e.toLowerCase():null;xe[e]=s}return r}}else{xe[e]=function(t,e,n){if(!n){return t[d.camelCase("default-"+e)]?e.toLowerCase():null}}}});if(!Se||!ke){d.attrHooks.value={set:function(t,e,n){if(d.nodeName(t,"input")){t.defaultValue=e}else{return ye&&ye.set(t,e,n)}}}}if(!ke){ye={set:function(t,e,n){var i=t.getAttributeNode(n);if(!i){t.setAttributeNode(i=t.ownerDocument.createAttribute(n))}i.value=e+="";if(n==="value"||e===t.getAttribute(n)){return e}}};xe.id=xe.name=xe.coords=function(t,e,n){var i;if(!n){return(i=t.getAttributeNode(e))&&i.value!==""?i.value:null}};d.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);if(n&&n.specified){return n.value}},set:ye.set};d.attrHooks.contenteditable={set:function(t,e,n){ye.set(t,e===""?false:e,n)}};d.each(["width","height"],function(t,e){d.attrHooks[e]={set:function(t,n){if(n===""){t.setAttribute(e,"auto");return n}}}})}if(!h.style){d.attrHooks.style={get:function(t){return t.style.cssText||undefined},set:function(t,e){return t.style.cssText=e+""}}}var Me=/^(?:input|select|textarea|button|object)$/i,Te=/^(?:a|area)$/i;d.fn.extend({prop:function(t,e){return G(this,d.prop,t,e,arguments.length>1)},removeProp:function(t){t=d.propFix[t]||t;return this.each(function(){try{this[t]=undefined;delete this[t]}catch(e){}})}});d.extend({prop:function(t,e,n){var i,r,s=t.nodeType;if(s===3||s===8||s===2){return}if(s!==1||!d.isXMLDoc(t)){e=d.propFix[e]||e;r=d.propHooks[e]}if(n!==undefined){if(r&&"set"in r&&(i=r.set(t,n,e))!==undefined){return i}return t[e]=n}if(r&&"get"in r&&(i=r.get(t,e))!==null){return i}return t[e]},propHooks:{tabIndex:{get:function(t){var e=d.find.attr(t,"tabindex");return e?parseInt(e,10):Me.test(t.nodeName)||Te.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}});if(!h.hrefNormalized){d.each(["href","src"],function(t,e){d.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}})}if(!h.optSelected){d.propHooks.selected={get:function(t){var e=t.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null},set:function(t){var e=t.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}}}}d.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){d.propFix[this.toLowerCase()]=this});if(!h.enctype){d.propFix.enctype="encoding"}var Ce=/[\t\r\n\f]/g;function Ae(t){return d.attr(t,"class")||""}d.fn.extend({addClass:function(t){var e,n,i,r,s,o,a,l=0;if(d.isFunction(t)){return this.each(function(e){d(this).addClass(t.call(this,e,Ae(this)))})}if(typeof t==="string"&&t){e=t.match(z)||[];while(n=this[l++]){r=Ae(n);i=n.nodeType===1&&(" "+r+" ").replace(Ce," ");
27if(i){o=0;while(s=e[o++]){if(i.indexOf(" "+s+" ")<0){i+=s+" "}}a=d.trim(i);if(r!==a){d.attr(n,"class",a)}}}}return this},removeClass:function(t){var e,n,i,r,s,o,a,l=0;if(d.isFunction(t)){return this.each(function(e){d(this).removeClass(t.call(this,e,Ae(this)))})}if(!arguments.length){return this.attr("class","")}if(typeof t==="string"&&t){e=t.match(z)||[];while(n=this[l++]){r=Ae(n);i=n.nodeType===1&&(" "+r+" ").replace(Ce," ");if(i){o=0;while(s=e[o++]){while(i.indexOf(" "+s+" ")>-1){i=i.replace(" "+s+" "," ")}}a=d.trim(i);if(r!==a){d.attr(n,"class",a)}}}}return this},toggleClass:function(t,e){var n=typeof t;if(typeof e==="boolean"&&n==="string"){return e?this.addClass(t):this.removeClass(t)}if(d.isFunction(t)){return this.each(function(n){d(this).toggleClass(t.call(this,n,Ae(this),e),e)})}return this.each(function(){var e,i,r,s;if(n==="string"){i=0;r=d(this);s=t.match(z)||[];while(e=s[i++]){if(r.hasClass(e)){r.removeClass(e)}else{r.addClass(e)}}}else if(t===undefined||n==="boolean"){e=Ae(this);if(e){d._data(this,"__className__",e)}d.attr(this,"class",e||t===false?"":d._data(this,"__className__")||"")}})},hasClass:function(t){var e,n,i=0;e=" "+t+" ";while(n=this[i++]){if(n.nodeType===1&&(" "+Ae(n)+" ").replace(Ce," ").indexOf(e)>-1){return true}}return false}});d.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(t,e){d.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});d.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}});var De=t.location;var Ee=d.now();var Ne=/\?/;var ze=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;d.parseJSON=function(e){if(t.JSON&&t.JSON.parse){return t.JSON.parse(e+"")}var n,i=null,r=d.trim(e+"");return r&&!d.trim(r.replace(ze,function(t,e,r,s){if(n&&e){i=0}if(i===0){return t}n=r||e;i+=!s-!r;return""}))?Function("return "+r)():d.error("Invalid JSON: "+e)};d.parseXML=function(e){var n,i;if(!e||typeof e!=="string"){return null}try{if(t.DOMParser){i=new t.DOMParser;n=i.parseFromString(e,"text/xml")}else{n=new t.ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(e)}}catch(r){n=undefined}if(!n||!n.documentElement||n.getElementsByTagName("parsererror").length){d.error("Invalid XML: "+e)}return n};var Pe=/#.*$/,je=/([?&])_=[^&]*/,Ie=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,$e=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Re=/^(?:GET|HEAD)$/,Le=/^\/\//,Fe=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Oe={},He={},Ve="*/".concat("*"),qe=De.href,Be=Fe.exec(qe.toLowerCase())||[];function Ue(t){return function(e,n){if(typeof e!=="string"){n=e;e="*"}var i,r=0,s=e.toLowerCase().match(z)||[];if(d.isFunction(n)){while(i=s[r++]){if(i.charAt(0)==="+"){i=i.slice(1)||"*";(t[i]=t[i]||[]).unshift(n)}else{(t[i]=t[i]||[]).push(n)}}}}}function We(t,e,n,i){var r={},s=t===He;function o(a){var l;r[a]=true;d.each(t[a]||[],function(t,a){var c=a(e,n,i);
27if(typeof c==="string"&&!s&&!r[c]){e.dataTypes.unshift(c);o(c);return false}else if(s){return!(l=c)}});return l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Ye(t,e){var n,i,r=d.ajaxSettings.flatOptions||{};for(i in e){if(e[i]!==undefined){(r[i]?t:n||(n={}))[i]=e[i]}}if(n){d.extend(true,t,n)}return t}function Xe(t,e,n){var i,r,s,o,a=t.contents,l=t.dataTypes;while(l[0]==="*"){l.shift();if(r===undefined){r=t.mimeType||e.getResponseHeader("Content-Type")}}if(r){for(o in a){if(a[o]&&a[o].test(r)){l.unshift(o);break}}}if(l[0]in n){s=l[0]}else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){s=o;break}if(!i){i=o}}s=s||i}if(s){if(s!==l[0]){l.unshift(s)}return n[s]}}function Je(t,e,n,i){var r,s,o,a,l,c={},u=t.dataTypes.slice();if(u[1]){for(o in t.converters){c[o.toLowerCase()]=t.converters[o]}}s=u.shift();while(s){if(t.responseFields[s]){n[t.responseFields[s]]=e}if(!l&&i&&t.dataFilter){e=t.dataFilter(e,t.dataType)}l=s;s=u.shift();if(s){if(s==="*"){s=l}else if(l!=="*"&&l!==s){o=c[l+" "+s]||c["* "+s];if(!o){for(r in c){a=r.split(" ");if(a[1]===s){o=c[l+" "+a[0]]||c["* "+a[0]];if(o){if(o===true){o=c[r]}else if(c[r]!==true){s=a[0];u.unshift(a[1])}break}}}}if(o!==true){if(o&&t["throws"]){e=o(e)}else{try{e=o(e)}catch(h){return{state:"parsererror",error:o?h:"No conversion from "+l+" to "+s}}}}}}}return{state:"success",data:e}}d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qe,type:"GET",isLocal:$e.test(Be[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,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":true,"text json":d.parseJSON,"text xml":d.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(t,e){return e?Ye(Ye(t,d.ajaxSettings),e):Ye(d.ajaxSettings,t)},ajaxPrefilter:Ue(Oe),ajaxTransport:Ue(He),ajax:function(e,n){if(typeof e==="object"){n=e;e=undefined}n=n||{};var i,r,s,o,a,l,c,u,h=d.ajaxSetup({},n),f=h.context||h,p=h.context&&(f.nodeType||f.jquery)?d(f):d.event,m=d.Deferred(),g=d.Callbacks("once memory"),_=h.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(b===2){if(!u){u={};while(e=Ie.exec(o)){u[e[1].toLowerCase()]=e[2]}}e=u[t.toLowerCase()]}return e==null?null:e},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();if(!b){t=y[n]=y[n]||t;v[t]=e}return this},overrideMimeType:function(t){if(!b){h.mimeType=t}return this},statusCode:function(t){var e;if(t){if(b<2){for(e in t){_[e]=[_[e],t[e]]}}else{w.always(t[w.status])}}return this},abort:function(t){var e=t||x;if(c){c.abort(e)}k(0,e);return this}};m.promise(w).complete=g.add;w.success=w.done;w.error=w.fail;h.url=((e||h.url||qe)+"").replace(Pe,"").replace(Le,Be[1]+"//");h.type=n.method||n.type||h.method||h.type;h.dataTypes=d.trim(h.dataType||"*").toLowerCase().match(z)||[""];if(h.crossDomain==null){i=Fe.exec(h.url.toLowerCase());h.crossDomain=!!(i&&(i[1]!==Be[1]||i[2]!==Be[2]||(i[3]||(i[1]==="http:"?"80":"443"))!==(Be[3]||(Be[1]==="http:"?"80":"443"))))}if(h.data&&h.processData&&typeof h.data!=="string"){h.data=d.param(h.data,h.traditional)}We(Oe,h,n,w);if(b===2){return w}l=d.event&&h.global;if(l&&d.active++===0){d.event.trigger("ajaxStart")}h.type=h.type.toUpperCase();h.hasContent=!Re.test(h.type);s=h.url;if(!h.hasContent){if(h.data){s=h.url+=(Ne.test(s)?"&":"?")+h.data;delete h.data}if(h.cache===false){h.url=je.test(s)?s.replace(je,"$1_="+Ee++):s+(Ne.test(s)?"&":"?")+"_="+Ee++}}if(h.ifModified){if(d.lastModified[s]){w.setRequestHeader("If-Modified-Since",d.lastModified[s])}if(d.etag[s]){w.setRequestHeader("If-None-Match",d.etag[s])}}if(h.data&&h.hasContent&&h.contentType!==false||n.contentType){w.setRequestHeader("Content-Type",h.contentType)}w.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+(h.dataTypes[0]!=="*"?", "+Ve+"; q=0.01":""):h.accepts["*"]);for(r in h.headers){w.setRequestHeader(r,h.headers[r])}
27if(h.beforeSend&&(h.beforeSend.call(f,w,h)===false||b===2)){return w.abort()}x="abort";for(r in{success:1,error:1,complete:1}){w[r](h[r])}c=We(He,h,n,w);if(!c){k(-1,"No Transport")}else{w.readyState=1;if(l){p.trigger("ajaxSend",[w,h])}if(b===2){return w}if(h.async&&h.timeout>0){a=t.setTimeout(function(){w.abort("timeout")},h.timeout)}try{b=1;c.send(v,k)}catch(S){if(b<2){k(-1,S)}else{throw S}}}function k(e,n,i,r){var u,v,y,x,k,S=n;if(b===2){return}b=2;if(a){t.clearTimeout(a)}c=undefined;o=r||"";w.readyState=e>0?4:0;u=e>=200&&e<300||e===304;if(i){x=Xe(h,w,i)}x=Je(h,x,w,u);if(u){if(h.ifModified){k=w.getResponseHeader("Last-Modified");if(k){d.lastModified[s]=k}k=w.getResponseHeader("etag");if(k){d.etag[s]=k}}if(e===204||h.type==="HEAD"){S="nocontent"}else if(e===304){S="notmodified"}else{S=x.state;v=x.data;y=x.error;u=!y}}else{y=S;if(e||!S){S="error";if(e<0){e=0}}}w.status=e;w.statusText=(n||S)+"";if(u){m.resolveWith(f,[v,S,w])}else{m.rejectWith(f,[w,S,y])}w.statusCode(_);_=undefined;if(l){p.trigger(u?"ajaxSuccess":"ajaxError",[w,h,u?v:y])}g.fireWith(f,[w,S]);if(l){p.trigger("ajaxComplete",[w,h]);if(!--d.active){d.event.trigger("ajaxStop")}}}return w},getJSON:function(t,e,n){return d.get(t,e,n,"json")},getScript:function(t,e){return d.get(t,undefined,e,"script")}});d.each(["get","post"],function(t,e){d[e]=function(t,n,i,r){if(d.isFunction(n)){r=r||i;i=n;n=undefined}return d.ajax(d.extend({url:t,type:e,dataType:r,data:n,success:i},d.isPlainObject(t)&&t))}});d._evalUrl=function(t){return d.ajax({url:t,type:"GET",dataType:"script",cache:true,async:false,global:false,throws:true})};d.fn.extend({wrapAll:function(t){if(d.isFunction(t)){return this.each(function(e){d(this).wrapAll(t.call(this,e))})}if(this[0]){var e=d(t,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){e.insertBefore(this[0])}e.map(function(){var t=this;while(t.firstChild&&t.firstChild.nodeType===1){t=t.firstChild}return t}).append(this)}return this},wrapInner:function(t){if(d.isFunction(t)){return this.each(function(e){d(this).wrapInner(t.call(this,e))})}return this.each(function(){var e=d(this),n=e.contents();if(n.length){n.wrapAll(t)}else{e.append(t)}})},wrap:function(t){var e=d.isFunction(t);return this.each(function(n){d(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){if(!d.nodeName(this,"body")){d(this).replaceWith(this.childNodes)}}).end()}});function Ge(t){return t.style&&t.style.display||d.css(t,"display")}function Ke(t){if(!d.contains(t.ownerDocument||i,t)){return true}while(t&&t.nodeType===1){if(Ge(t)==="none"||t.type==="hidden"){return true}t=t.parentNode}return false}d.expr.filters.hidden=function(t){return h.reliableHiddenOffsets()?t.offsetWidth<=0&&t.offsetHeight<=0&&!t.getClientRects().length:Ke(t)};d.expr.filters.visible=function(t){return!d.expr.filters.hidden(t)};var Ze=/%20/g,Qe=/\[\]$/,tn=/\r?\n/g,en=/^(?:submit|button|image|reset|file)$/i,nn=/^(?:input|select|textarea|keygen)/i;function rn(t,e,n,i){var r;if(d.isArray(e)){d.each(e,function(e,r){if(n||Qe.test(t)){i(t,r)}else{rn(t+"["+(typeof r==="object"&&r!=null?e:"")+"]",r,n,i)}})}else if(!n&&d.type(e)==="object"){for(r in e){rn(t+"["+r+"]",e[r],n,i)}}else{i(t,e)}}d.param=function(t,e){var n,i=[],r=function(t,e){e=d.isFunction(e)?e():e==null?"":e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(e===undefined){e=d.ajaxSettings&&d.ajaxSettings.traditional}if(d.isArray(t)||t.jquery&&!d.isPlainObject(t)){d.each(t,function(){r(this.name,this.value)})}else{for(n in t){rn(n,t[n],e,r)}}return i.join("&").replace(Ze,"+")};d.fn.extend({serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=d.prop(this,"elements");return t?d.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!d(this).is(":disabled")&&nn.test(this.nodeName)&&!en.test(t)&&(this.checked||!K.test(t))}).map(function(t,e){var n=d(this).val();return n==null?null:d.isArray(n)?d.map(n,function(t){return{name:e.name,value:t.replace(tn,"\r\n")}}):{name:e.name,value:n.replace(tn,"\r\n")}}).get()}});d.ajaxSettings.xhr=t.ActiveXObject!==undefined?function(){if(this.isLocal){return cn()}if(i.documentMode>8){return ln()}
27return/^(get|post|head|put|delete|options)$/i.test(this.type)&&ln()||cn()}:ln;var sn=0,on={},an=d.ajaxSettings.xhr();if(t.attachEvent){t.attachEvent("onunload",function(){for(var t in on){on[t](undefined,true)}})}h.cors=!!an&&"withCredentials"in an;an=h.ajax=!!an;if(an){d.ajaxTransport(function(e){if(!e.crossDomain||h.cors){var n;return{send:function(i,r){var s,o=e.xhr(),a=++sn;o.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields){for(s in e.xhrFields){o[s]=e.xhrFields[s]}}if(e.mimeType&&o.overrideMimeType){o.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!i["X-Requested-With"]){i["X-Requested-With"]="XMLHttpRequest"}for(s in i){if(i[s]!==undefined){o.setRequestHeader(s,i[s]+"")}}o.send(e.hasContent&&e.data||null);n=function(t,i){var s,l,c;if(n&&(i||o.readyState===4)){delete on[a];n=undefined;o.onreadystatechange=d.noop;if(i){if(o.readyState!==4){o.abort()}}else{c={};s=o.status;if(typeof o.responseText==="string"){c.text=o.responseText}try{l=o.statusText}catch(u){l=""}if(!s&&e.isLocal&&!e.crossDomain){s=c.text?200:404}else if(s===1223){s=204}}}if(c){r(s,l,c,o.getAllResponseHeaders())}};if(!e.async){n()}else if(o.readyState===4){t.setTimeout(n)}else{o.onreadystatechange=on[a]=n}},abort:function(){if(n){n(undefined,true)}}}}})}function ln(){try{return new t.XMLHttpRequest}catch(e){}}function cn(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){d.globalEval(t);return t}}});d.ajaxPrefilter("script",function(t){if(t.cache===undefined){t.cache=false}if(t.crossDomain){t.type="GET";t.global=false}});d.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=i.head||d("head")[0]||i.documentElement;return{send:function(r,s){e=i.createElement("script");e.async=true;if(t.scriptCharset){e.charset=t.scriptCharset}e.src=t.url;e.onload=e.onreadystatechange=function(t,n){if(n||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(e.parentNode){e.parentNode.removeChild(e)}e=null;if(!n){s(200,"success")}}};n.insertBefore(e,n.firstChild)},abort:function(){if(e){e.onload(undefined,true)}}}}});var un=[],hn=/(=)\?(?=&|$)|\?\?/;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=un.pop()||d.expando+"_"+Ee++;this[t]=true;return t}});d.ajaxPrefilter("json jsonp",function(e,n,i){var r,s,o,a=e.jsonp!==false&&(hn.test(e.url)?"url":typeof e.data==="string"&&(e.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&hn.test(e.data)&&"data");if(a||e.dataTypes[0]==="jsonp"){r=e.jsonpCallback=d.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback;if(a){e[a]=e[a].replace(hn,"$1"+r)}else if(e.jsonp!==false){e.url+=(Ne.test(e.url)?"&":"?")+e.jsonp+"="+r}e.converters["script json"]=function(){if(!o){d.error(r+" was not called")}return o[0]};e.dataTypes[0]="json";s=t[r];t[r]=function(){o=arguments};i.always(function(){if(s===undefined){d(t).removeProp(r)}else{t[r]=s}if(e[r]){e.jsonpCallback=n.jsonpCallback;un.push(r)}if(o&&d.isFunction(s)){s(o[0])}o=s=undefined});return"script"}});d.parseHTML=function(t,e,n){if(!t||typeof t!=="string"){return null}if(typeof e==="boolean"){n=e;e=false}e=e||i;var r=k.exec(t),s=!n&&[];if(r){return[e.createElement(r[1])]}r=ct([t],e,s);if(s&&s.length){d(s).remove()}return d.merge([],r.childNodes)};var fn=d.fn.load;d.fn.load=function(t,e,n){if(typeof t!=="string"&&fn){return fn.apply(this,arguments)}var i,r,s,o=this,a=t.indexOf(" ");if(a>-1){i=d.trim(t.slice(a,t.length));t=t.slice(0,a)}if(d.isFunction(e)){n=e;e=undefined}else if(e&&typeof e==="object"){r="POST"}if(o.length>0){d.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){s=arguments;o.html(i?d("<div>").append(d.parseHTML(t)).find(i):t)}).always(n&&function(t,e){o.each(function(){n.apply(this,s||[t.responseText,e,t])})})}return this};d.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){d.fn[e]=function(t){return this.on(e,t)}});d.expr.filters.animated=function(t){return d.grep(d.timers,function(e){return t===e.elem}).length};function dn(t){return d.isWindow(t)?t:t.nodeType===9?t.defaultView||t.parentWindow:false}d.offset={setOffset:function(t,e,n){var i,r,s,o,a,l,c,u=d.css(t,"position"),h=d(t),f={};if(u==="static"){t.style.position="relative"}a=h.offset();s=d.css(t,"top");l=d.css(t,"left");c=(u==="absolute"||u==="fixed")&&d.inArray("auto",[s,l])>-1;if(c){i=h.position();o=i.top;r=i.left}else{o=parseFloat(s)||0;r=parseFloat(l)||0}if(d.isFunction(e)){e=e.call(t,n,d.extend({},a))}if(e.top!=null){f.top=e.top-a.top+o}if(e.left!=null){f.left=e.left-a.left+r}if("using"in e){e.using.call(t,f)}else{h.css(f)}}};d.fn.extend({offset:function(t){if(arguments.length){return t===undefined?this:this.each(function(e){d.offset.setOffset(this,t,e)})}var e,n,i={top:0,left:0}
27,r=this[0],s=r&&r.ownerDocument;if(!s){return}e=s.documentElement;if(!d.contains(e,r)){return i}if(typeof r.getBoundingClientRect!=="undefined"){i=r.getBoundingClientRect()}n=dn(s);return{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},position:function(){if(!this[0]){return}var t,e,n={top:0,left:0},i=this[0];if(d.css(i,"position")==="fixed"){e=i.getBoundingClientRect()}else{t=this.offsetParent();e=this.offset();if(!d.nodeName(t[0],"html")){n=t.offset()}n.top+=d.css(t[0],"borderTopWidth",true);n.left+=d.css(t[0],"borderLeftWidth",true)}return{top:e.top-n.top-d.css(i,"marginTop",true),left:e.left-n.left-d.css(i,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var t=this.offsetParent;while(t&&(!d.nodeName(t,"html")&&d.css(t,"position")==="static")){t=t.offsetParent}return t||Vt})}});d.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);d.fn[t]=function(i){return G(this,function(t,i,r){var s=dn(t);if(r===undefined){return s?e in s?s[e]:s.document.documentElement[i]:t[i]}if(s){s.scrollTo(!n?r:d(s).scrollLeft(),n?r:d(s).scrollTop())}else{t[i]=r}},t,i,arguments.length,null)}});d.each(["top","left"],function(t,e){d.cssHooks[e]=Wt(h.pixelPosition,function(t,n){if(n){n=Bt(t,e);return Ot.test(n)?d(t).position()[e]+"px":n}})});d.each({Height:"height",Width:"width"},function(t,e){d.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,i){d.fn[i]=function(i,r){var s=arguments.length&&(n||typeof i!=="boolean"),o=n||(i===true||r===true?"margin":"border");return G(this,function(e,n,i){var r;if(d.isWindow(e)){return e.document.documentElement["client"+t]}if(e.nodeType===9){r=e.documentElement;return Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])}return i===undefined?d.css(e,n,o):d.style(e,n,i,o)},e,s?i:undefined,s,null)}})});d.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return arguments.length===1?this.off(t,"**"):this.off(e,t||"**",n)}});d.fn.size=function(){return this.length};d.fn.andSelf=d.fn.addBack;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return d})}var pn=t.jQuery,mn=t.$;d.noConflict=function(e){if(t.$===d){t.$=mn}if(e&&t.jQuery===d){t.jQuery=pn}return d};if(!e){t.jQuery=t.$=d}return d});(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)}else{t(jQuery)}})(function(t){t.ui=t.ui||{};return t.ui.version="1.12.1"});
28/*!
29 * jQuery UI Keycode 1.12.1
30 * http://jqueryui.com
31 *
32 * Copyright jQuery Foundation and other contributors
33 * Released under the MIT license.
34 * http://jquery.org/license
35 */
36/*!
37 * jQuery UI Keycode 1.12.1
38 * http://jqueryui.com
39 *
40 * Copyright jQuery Foundation and other contributors
41 * Released under the MIT license.
42 * http://jquery.org/license
43 */
44(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});
45/*!
46 * jQuery UI Datepicker 1.12.1
47 * http://jqueryui.com
48 *
49 * Copyright jQuery Foundation and other contributors
50 * Released under the MIT license.
51 * http://jquery.org/license
52 */
53/*!
54 * jQuery UI Datepicker 1.12.1
55 * http://jqueryui.com
56 *
57 * Copyright jQuery Foundation and other contributors
58 * Released under the MIT license.
59 * http://jquery.org/license
60 */
61(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../version","../keycode"],t)}else{t(jQuery)}})(function(t){t.extend(t.ui,{datepicker:{version:"1.12.1"}});var e;function n(t){var e,n;while(t.length&&t[0]!==document){e=t.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){n=parseInt(t.css("zIndex"),10);if(!isNaN(n)&&n!==0){return n}}t=t.parent()}return 0}function i(){this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;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","Frid
61ay","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:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,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:true,showButtonPanel:false,autoSize:false,disabled:false};t.extend(this._defaults,this.regional[""]);this.regional.en=t.extend(true,{},this.regional[""]);this.regional["en-US"]=t.extend(true,{},this.regional.en);this.dpDiv=r(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){o(this._defaults,t||{});return this},_attachDatepicker:function(e,n){var i,r,s;i=e.nodeName.toLowerCase();r=i==="div"||i==="span";if(!e.id){this.uuid+=1;e.id="dp"+this.uuid}s=this._newInst(t(e),r);s.settings=t.extend({},n||{});if(i==="input"){this._connectDatepicker(e,s)}else if(r){this._inlineDatepicker(e,s)}},_newInst:function(e,n){var i=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:i,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:!n?this.dpDiv:r(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}},_connectDatepicker:function(e,n){var i=t(e);n.append=t([]);n.trigger=t([]);if(i.hasClass(this.markerClassName)){return}this._attachments(i,n);i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp);this._autoSize(n);t.data(e,"datepicker",n);if(n.settings.disabled){this._disableDatepicker(e)}},_attachments:function(e,n){var i,r,s,o=this._get(n,"appendText"),a=this._get(n,"isRTL");if(n.append){n.append.remove()}if(o){n.append=t("<span class='"+this._appendClass+"'>"+o+"</span>");e[a?"before":"after"](n.append)}e.off("focus",this._showDatepicker);if(n.trigger){n.trigger.remove()}i=this._get(n,"showOn");if(i==="focus"||i==="both"){e.on("focus",this._showDatepicker)}if(i==="button"||i==="both"){r=this._get(n,"buttonText");s=this._get(n,"buttonImage");n.trigger=t(this._get(n,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:s,alt:r,title:r}):t("<button type='button'></button>").addClass(this._triggerClass).html(!s?r:t("<img/>").attr({src:s,alt:r,title:r})));e[a?"before":"after"](n.trigger);n.trigger.on("click",function(){if(t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]){t.datepicker._hideDatepicker()}else if(t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]){t.datepicker._hideDatepicker();t.datepicker._showDatepicker(e[0])}else{t.datepicker._showDatepicker(e[0])}return false})}},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,n,i,r,s=new Date(2009,12-1,20),o=this._get(t,"dateFormat");if(o.match(/[DM]/)){e=function(t){n=0;i=0;for(r=0;r<t.length;r++){if(t[r].length>n){n=t[r].length;i=r}}return i};s.setMonth(e(this._get(t,o.match(/MM/)?"monthNames":"monthNamesShort")));s.setDate(e(this._get(t,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())}t.input.attr("size",this._formatDate(t,s).length)}},_inlineDatepicker:function(e,n){var i=t(e);if(i.hasClass(this.markerClassName)){return}i.addClass(this.markerClassName).append(n.dpDiv);t.data(e,"datepicker",n);this._setDate(n,this._getDefaultDate(n),true);this._updateDatepicker(n);this._updateAlternate(n);if(n.settings.disabled){this._disableDatepicker(e)}n.dpDiv.css("display","block")},_dialogDatepicker:function(e,n,i,r,s){var a,l,c,u,h,f=this._dialogInst;if(!f){this.uuid+=1;a="dp"+this.uuid;this._dialogInput=t("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>");
61this._dialogInput.on("keydown",this._doKeyDown);t("body").append(this._dialogInput);f=this._dialogInst=this._newInst(this._dialogInput,false);f.settings={};t.data(this._dialogInput[0],"datepicker",f)}o(f.settings,r||{});n=n&&n.constructor===Date?this._formatDate(f,n):n;this._dialogInput.val(n);this._pos=s?s.length?s:[s.pageX,s.pageY]:null;if(!this._pos){l=document.documentElement.clientWidth;c=document.documentElement.clientHeight;u=document.documentElement.scrollLeft||document.body.scrollLeft;h=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[l/2-100+u,c/2-150+h]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");f.settings.onSelect=i;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if(t.blockUI){t.blockUI(this.dpDiv)}t.data(this._dialogInput[0],"datepicker",f);return this},_destroyDatepicker:function(n){var i,r=t(n),s=t.data(n,"datepicker");if(!r.hasClass(this.markerClassName)){return}i=n.nodeName.toLowerCase();t.removeData(n,"datepicker");if(i==="input"){s.append.remove();s.trigger.remove();r.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)}else if(i==="div"||i==="span"){r.removeClass(this.markerClassName).empty()}if(e===s){e=null}},_enableDatepicker:function(e){var n,i,r=t(e),s=t.data(e,"datepicker");if(!r.hasClass(this.markerClassName)){return}n=e.nodeName.toLowerCase();if(n==="input"){e.disabled=false;s.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(n==="div"||n==="span"){i=r.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled");i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false)}this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t})},_disableDatepicker:function(e){var n,i,r=t(e),s=t.data(e,"datepicker");if(!r.hasClass(this.markerClassName)){return}n=e.nodeName.toLowerCase();if(n==="input"){e.disabled=true;s.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(n==="div"||n==="span"){i=r.children("."+this._inlineClass);i.children().addClass("ui-state-disabled");i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true)}this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t});this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(t){if(!t){return false}for(var e=0;e<this._disabledInputs.length;e++){if(this._disabledInputs[e]===t){return true}}return false},_getInst:function(e){try{return t.data(e,"datepicker")}catch(n){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,n,i){var r,s,a,l,c=this._getInst(e);if(arguments.length===2&&typeof n==="string"){return n==="defaults"?t.extend({},t.datepicker._defaults):c?n==="all"?t.extend({},c.settings):this._get(c,n):null}r=n||{};if(typeof n==="string"){r={};r[n]=i}if(c){if(this._curInst===c){this._hideDatepicker()}s=this._getDateDatepicker(e,true);a=this._getMinMaxDate(c,"min");l=this._getMinMaxDate(c,"max");o(c.settings,r);if(a!==null&&r.dateFormat!==undefined&&r.minDate===undefined){c.settings.minDate=this._formatDate(c,a)}if(l!==null&&r.dateFormat!==undefined&&r.maxDate===undefined){c.settings.maxDate=this._formatDate(c,l)}if("disabled"in r){if(r.disabled){this._disableDatepicker(e)}else{this._enableDatepicker(e)}}this._attachments(t(e),c);this._autoSize(c);this._setDate(c,s);this._updateAlternate(c);this._updateDatepicker(c)}},_changeDatepicker:function(t,e,n){this._optionDatepicker(t,e,n)},_refreshDatepicker:function(t){var e=this._getInst(t);if(e){this._updateDatepicker(e)}},_setDateDatepicker:function(t,e){var n=this._getInst(t);if(n){this._setDate(n,e);this._updateDatepicker(n);this._updateAlternate(n)}},_getDateDatepicker:function(t,e){var n=this._getInst(t);if(n&&!n.inline){this._setDateFromField(n,e)}return n?this._getDate(n):null},_doKeyDown:function(e){var n,i,r,s=t.datepicker._getInst(e.target),o=true,a=s.dpDiv.is(".ui-datepicker-rtl");s._keyEvent=true;if(t.datepicker._datepickerShowing){switch(e.keyCode){case 9:t.datepicker._hideDatepicker();o=false;break;case 13:r=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",s.dpDiv);if(r[0]){t.datepicker._selectDay(e.target,s.selectedMonth,s.selectedYear,r[0])}n=t.datepicker._get(s,"onSelect");if(n){i=t.datepicker._formatDate(s);
61n.apply(s.input?s.input[0]:null,[i,s])}else{t.datepicker._hideDatepicker()}return false;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(s,"stepBigMonths"):-t.datepicker._get(s,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(s,"stepBigMonths"):+t.datepicker._get(s,"stepMonths"),"M");break;case 35:if(e.ctrlKey||e.metaKey){t.datepicker._clearDate(e.target)}o=e.ctrlKey||e.metaKey;break;case 36:if(e.ctrlKey||e.metaKey){t.datepicker._gotoToday(e.target)}o=e.ctrlKey||e.metaKey;break;case 37:if(e.ctrlKey||e.metaKey){t.datepicker._adjustDate(e.target,a?+1:-1,"D")}o=e.ctrlKey||e.metaKey;if(e.originalEvent.altKey){t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(s,"stepBigMonths"):-t.datepicker._get(s,"stepMonths"),"M")}break;case 38:if(e.ctrlKey||e.metaKey){t.datepicker._adjustDate(e.target,-7,"D")}o=e.ctrlKey||e.metaKey;break;case 39:if(e.ctrlKey||e.metaKey){t.datepicker._adjustDate(e.target,a?-1:+1,"D")}o=e.ctrlKey||e.metaKey;if(e.originalEvent.altKey){t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(s,"stepBigMonths"):+t.datepicker._get(s,"stepMonths"),"M")}break;case 40:if(e.ctrlKey||e.metaKey){t.datepicker._adjustDate(e.target,+7,"D")}o=e.ctrlKey||e.metaKey;break;default:o=false}}else if(e.keyCode===36&&e.ctrlKey){t.datepicker._showDatepicker(this)}else{o=false}if(o){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var n,i,r=t.datepicker._getInst(e.target);if(t.datepicker._get(r,"constrainInput")){n=t.datepicker._possibleChars(t.datepicker._get(r,"dateFormat"));i=String.fromCharCode(e.charCode==null?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||(i<" "||!n||n.indexOf(i)>-1)}},_doKeyUp:function(e){var n,i=t.datepicker._getInst(e.target);if(i.input.val()!==i.lastVal){try{n=t.datepicker.parseDate(t.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,t.datepicker._getFormatConfig(i));if(n){t.datepicker._setDateFromField(i);t.datepicker._updateAlternate(i);t.datepicker._updateDatepicker(i)}}catch(r){}}return true},_showDatepicker:function(e){e=e.target||e;if(e.nodeName.toLowerCase()!=="input"){e=t("input",e.parentNode)[0]}if(t.datepicker._isDisabledDatepicker(e)||t.datepicker._lastInput===e){return}var i,r,s,a,l,c,u;i=t.datepicker._getInst(e);if(t.datepicker._curInst&&t.datepicker._curInst!==i){t.datepicker._curInst.dpDiv.stop(true,true);if(i&&t.datepicker._datepickerShowing){t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])}}r=t.datepicker._get(i,"beforeShow");s=r?r.apply(e,[e,i]):{};if(s===false){return}o(i.settings,s);i.lastVal=null;t.datepicker._lastInput=e;t.datepicker._setDateFromField(i);if(t.datepicker._inDialog){e.value=""}if(!t.datepicker._pos){t.datepicker._pos=t.datepicker._findPos(e);t.datepicker._pos[1]+=e.offsetHeight}a=false;t(e).parents().each(function(){a|=t(this).css("position")==="fixed";return!a});l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]};t.datepicker._pos=null;i.dpDiv.empty();i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});t.datepicker._updateDatepicker(i);l=t.datepicker._checkOffset(i,l,a);i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"});if(!i.inline){c=t.datepicker._get(i,"showAnim");u=t.datepicker._get(i,"duration");i.dpDiv.css("z-index",n(t(e))+1);t.datepicker._datepickerShowing=true;if(t.effects&&t.effects.effect[c]){i.dpDiv.show(c,t.datepicker._get(i,"showOptions"),u)}else{i.dpDiv[c||"show"](c?u:null)}if(t.datepicker._shouldFocusInput(i)){i.input.trigger("focus")}t.datepicker._curInst=i}},_updateDatepicker:function(n){this.maxRows=4;e=n;n.dpDiv.empty().append(this._generateHTML(n));this._attachHandlers(n);var i,r=this._getNumberOfMonths(n),o=r[1],a=17,l=n.dpDiv.find("."+this._dayOverClass+" a");if(l.length>0){s.apply(l.get(0))}n.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(o>1){n.dpDiv.addClass("ui-datepicker-multi-"+o).css("width",a*o+"em")}n.dpDiv[(r[0]!==1||r[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");n.dpDiv[(this._get(n,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(n===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(n)){n.input.trigger("focus")}if(n.yearshtml){i=n.yearshtml;setTimeout(function(){if(i===n.yearshtml&&n.yearshtml){n.dpDiv.find("select.ui-datepicker-year:first").replaceWith(n.yearshtml)}i=n.yearshtml=null},0)}},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,n,i){var r=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),o=e.input?e.input.outerWidth():0,a=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(i?0:t(document).scrollLeft()),c=document.documentElement.clientHeight+(i?0:t(document).scrollTop());n.left-=this._get(e,"isRTL")?r-o:0;n.left-=i&&n.left===e.input.offset().left?t(document).scrollLeft():0;n.top-=i&&n.top===e.input.offset().top+a?t(document).scrollTop():0;n.left-=Math.min(n.left,n.left+r>l&&l>r?Math.abs(n.left+r-l):0);n.top-=Math.min(n.top,n.top+s>c&&c>s?Math.abs(s+a):0);return n},_findPos:function(e){var n,i=this._getInst(e),r=this._get(i,"isRTL");while(e&&(e.type==="hidden"||e.nodeType!==1||t.expr.filters.hidden(e))){e=e[r?"previousSibling":"nextSibling"]}n=t(e).offset();return[n.left,n.top]},_hideDatepicker:function(e){var n,i,r,s,o=this._curInst;if(!o||e&&o!==t.data(e,"datepicker")){return}if(this._datepickerShowing){n=this._get(o,"showAnim");i=this._get(o,"duration");r=function(){t.datepicker._tidyDialog(o)};if(t.effects&&(t.effects.effect[n]||t.effects[n])){o.dpDiv.hide(n,t.datepicker._get(o,"showOptions"),i,r)}else{o.dpDiv[n==="slideDown"?"slideUp":n==="fadeIn"?"fadeOut":"hide"](n?i:null,r)}if(!n){r()}this._datepickerShowing=false;s=this._get(o,"onClose");if(s){s.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(t.blockUI){t.unblockUI();t("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!t.datepicker._curInst){return}var n=t(e.target),i=t.datepicker._getInst(n[0]);if(n[0].id!==t.datepicker._mainDivId&&n.parents("#"+t.datepicker._mainDivId).length===0&&!n.hasClass(t.datepicker.markerClassName)&&!n.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&!(t.datepicker._inDialog&&t.blockUI)||n.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==i){t.datepicker._hideDatepicker()}},_adjustDate:function(e,n,i){var r=t(e),s=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0])){return}this._adjustInstDate(s,n+(i==="M"?this._get(s,"showCurrentAtPos"):0),i);this._updateDatepicker(s)},_gotoToday:function(e){var n,i=t(e),r=this._getInst(i[0]);if(this._get(r,"gotoCurrent")&&r.currentDay){r.selectedDay=r.currentDay;r.drawMonth=r.selectedMonth=r.currentMonth;r.drawYear=r.selectedYear=r.currentYear}else{n=new Date;r.selectedDay=n.getDate();r.drawMonth=r.selectedMonth=n.getMonth();r.drawYear=r.selectedYear=n.getFullYear()}this._notifyChange(r);this._adjustDate(i)},_selectMonthYear:function(e,n,i){var r=t(e),s=this._getInst(r[0]);s["selected"+(i==="M"?"Month":"Year")]=s["draw"+(i==="M"?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10);this._notifyChange(s);this._adjustDate(r)},_selectDay:function(e,n,i,r){var s,o=t(e);if(t(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])){return}s=this._getInst(o[0]);s.selectedDay=s.currentDay=t("a",r).html();s.selectedMonth=s.currentMonth=n;s.selectedYear=s.currentYear=i;this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var n=t(e);this._selectDate(n,"")},_selectDate:function(e,n){var i,r=t(e),s=this._getInst(r[0]);n=n!=null?n:this._formatDate(s);if(s.input){s.input.val(n)}this._updateAlternate(s);i=this._get(s,"onSelect");if(i){i.apply(s.input?s.input[0]:null,[n,s])}else if(s.input){s.input.trigger("change")}if(s.inline){this._updateDatepicker(s)}else{this._hideDatepicker();this._lastInput=s.input[0];if(typeof s.input[0]!=="object"){s.input.trigger("focus")}this._lastInput=null}},_updateAlternate:function(e){var n,i,r,s=this._get(e,"altField");if(s){n=this._get(e,"altFormat")||this._get(e,"dateFormat");i=this._getDate(e);r=this.formatDate(n,i,this._getFormatConfig(e));t(s).val(r)}}
61,noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e,n=new Date(t.getTime());n.setDate(n.getDate()+4-(n.getDay()||7));e=n.getTime();n.setMonth(0);n.setDate(1);return Math.floor(Math.round((e-n)/864e5)/7)+1},parseDate:function(e,n,i){if(e==null||n==null){throw"Invalid arguments"}n=typeof n==="object"?n.toString():n+"";if(n===""){return null}var r,s,o,a=0,l=(i?i.shortYearCutoff:null)||this._defaults.shortYearCutoff,c=typeof l!=="string"?l:(new Date).getFullYear()%100+parseInt(l,10),u=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,h=(i?i.dayNames:null)||this._defaults.dayNames,f=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,d=(i?i.monthNames:null)||this._defaults.monthNames,p=-1,m=-1,g=-1,_=-1,v=false,y,b=function(t){var n=r+1<e.length&&e.charAt(r+1)===t;if(n){r++}return n},x=function(t){var e=b(t),i=t==="@"?14:t==="!"?20:t==="y"&&e?4:t==="o"?3:2,r=t==="y"?i:1,s=new RegExp("^\\d{"+r+","+i+"}"),o=n.substring(a).match(s);if(!o){throw"Missing number at position "+a}a+=o[0].length;return parseInt(o[0],10)},w=function(e,i,r){var s=-1,o=t.map(b(e)?r:i,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});t.each(o,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase()){s=e[0];a+=i.length;return false}});if(s!==-1){return s+1}else{throw"Unknown name at position "+a}},k=function(){if(n.charAt(a)!==e.charAt(r)){throw"Unexpected literal at position "+a}a++};for(r=0;r<e.length;r++){if(v){if(e.charAt(r)==="'"&&!b("'")){v=false}else{k()}}else{switch(e.charAt(r)){case"d":g=x("d");break;case"D":w("D",u,h);break;case"o":_=x("o");break;case"m":m=x("m");break;case"M":m=w("M",f,d);break;case"y":p=x("y");break;case"@":y=new Date(x("@"));p=y.getFullYear();m=y.getMonth()+1;g=y.getDate();break;case"!":y=new Date((x("!")-this._ticksTo1970)/1e4);p=y.getFullYear();m=y.getMonth()+1;g=y.getDate();break;case"'":if(b("'")){k()}else{v=true}break;default:k()}}}if(a<n.length){o=n.substr(a);if(!/^\s+/.test(o)){throw"Extra/unparsed characters found in date: "+o}}if(p===-1){p=(new Date).getFullYear()}else if(p<100){p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=c?0:-100)}if(_>-1){m=1;g=_;do{s=this._getDaysInMonth(p,m-1);if(g<=s){break}m++;g-=s}while(true)}y=this._daylightSavingAdjust(new Date(p,m-1,g));if(y.getFullYear()!==p||y.getMonth()+1!==m||y.getDate()!==g){throw"Invalid date"}return y},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:((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*1e7,formatDate:function(t,e,n){if(!e){return""}var i,r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,a=(n?n.monthNames:null)||this._defaults.monthNames,l=function(e){var n=i+1<t.length&&t.charAt(i+1)===e;if(n){i++}return n},c=function(t,e,n){var i=""+e;if(l(t)){while(i.length<n){i="0"+i}}return i},u=function(t,e,n,i){return l(t)?i[e]:n[e]},h="",f=false;if(e){for(i=0;i<t.length;i++){if(f){if(t.charAt(i)==="'"&&!l("'")){f=false}else{h+=t.charAt(i)}}else{switch(t.charAt(i)){case"d":h+=c("d",e.getDate(),2);break;case"D":h+=u("D",e.getDay(),r,s);break;case"o":h+=c("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":h+=c("m",e.getMonth()+1,2);break;case"M":h+=u("M",e.getMonth(),o,a);break;case"y":h+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":h+=e.getTime();break;case"!":h+=e.getTime()*1e4+this._ticksTo1970;break;case"'":if(l("'")){h+="'"}else{f=true}break;default:h+=t.charAt(i)}}}}return h},_possibleChars:function(t){var e,n="",i=false,r=function(n){var i=e+1<t.length&&t.charAt(e+1)===n;if(i){e++}return i};for(e=0;e<t.length;e++){if(i){if(t.charAt(e)==="'"&&!r("'")){i=false}else{n+=t.charAt(e)}}else{switch(t.charAt(e)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":if(r("'")){n+="'"}else{i=true}break;default:n+=t.charAt(e)}}}return n},_get:function(t,e){return t.settings[e]!==undefined?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()===t.lastVal){return}var n=this._get(t,"dateFormat"),i=t.lastVal=t.input?t.input.val():null,r=this._getDefaultDate(t),s=r,o=this._getFormatConfig(t);
61try{s=this.parseDate(n,i,o)||r}catch(a){i=e?"":i}t.selectedDay=s.getDate();t.drawMonth=t.selectedMonth=s.getMonth();t.drawYear=t.selectedYear=s.getFullYear();t.currentDay=i?s.getDate():0;t.currentMonth=i?s.getMonth():0;t.currentYear=i?s.getFullYear():0;this._adjustInstDate(t)},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,n,i){var r=function(t){var e=new Date;e.setDate(e.getDate()+t);return e},s=function(n){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),n,t.datepicker._getFormatConfig(e))}catch(c){}var i=(n.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,r=i.getFullYear(),s=i.getMonth(),o=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=a.exec(n);while(l){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=parseInt(l[1],10)*7;break;case"m":case"M":s+=parseInt(l[1],10);o=Math.min(o,t.datepicker._getDaysInMonth(r,s));break;case"y":case"Y":r+=parseInt(l[1],10);o=Math.min(o,t.datepicker._getDaysInMonth(r,s));break}l=a.exec(n)}return new Date(r,s,o)},o=n==null||n===""?i:typeof n==="string"?s(n):typeof n==="number"?isNaN(n)?i:r(n):new Date(n.getTime());o=o&&o.toString()==="Invalid Date"?i:o;if(o){o.setHours(0);o.setMinutes(0);o.setSeconds(0);o.setMilliseconds(0)}return this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(t){if(!t){return null}t.setHours(t.getHours()>12?t.getHours()+2:0);return t},_setDate:function(t,e,n){var i=!e,r=t.selectedMonth,s=t.selectedYear,o=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=o.getDate();t.drawMonth=t.selectedMonth=t.currentMonth=o.getMonth();t.drawYear=t.selectedYear=t.currentYear=o.getFullYear();if((r!==t.selectedMonth||s!==t.selectedYear)&&!n){this._notifyChange(t)}this._adjustInstDate(t);if(t.input){t.input.val(i?"":this._formatDate(t))}},_getDate:function(t){var e=!t.currentYear||t.input&&t.input.val()===""?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var n=this._get(e,"stepMonths"),i="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(i,-n,"M")},next:function(){t.datepicker._adjustDate(i,+n,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(i)},selectDay:function(){t.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){t.datepicker._selectMonthYear(i,this,"M");return false},selectYear:function(){t.datepicker._selectMonthYear(i,this,"Y");return false}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,n,i,r,s,o,a,l,c,u,h,f,d,p,m,g,_,v,y,b,x,w,k,S,M,T,C,A,D,E,N,z,P,j,I,$,R,L,F,O=new Date,H=this._daylightSavingAdjust(new Date(O.getFullYear(),O.getMonth(),O.getDate())),V=this._get(t,"isRTL"),q=this._get(t,"showButtonPanel"),B=this._get(t,"hideIfNoPrevNext"),U=this._get(t,"navigationAsDateFormat"),W=this._getNumberOfMonths(t),Y=this._get(t,"showCurrentAtPos"),X=this._get(t,"stepMonths"),J=W[0]!==1||W[1]!==1,G=this._daylightSavingAdjust(!t.currentDay?new Date(9999,9,9):new Date(t.currentYear,t.currentMonth,t.currentDay)),K=this._getMinMaxDate(t,"min"),Z=this._getMinMaxDate(t,"max"),Q=t.drawMonth-Y,tt=t.drawYear;if(Q<0){Q+=12;tt--}if(Z){e=this._daylightSavingAdjust(new Date(Z.getFullYear(),Z.getMonth()-W[0]*W[1]+1,Z.getDate()));e=K&&e<K?K:e;while(this._daylightSavingAdjust(new Date(tt,Q,1))>e){Q--;if(Q<0){Q=11;tt--}}}t.drawMonth=Q;t.drawYear=tt;n=this._get(t,"prevText");n=!U?n:this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Q-X,1)),this._getFormatConfig(t));i=this._canAdjustMonth(t,-1,tt,Q)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'"+" title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"e":"w")+"'>"+n+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"e":"w")+"'>"+n+"</span></a>";r=this._get(t,"nextText");r=!U?r:this.formatDate(r,this._daylightSavingAdjust(new Date(tt,Q+X,1)),this._getFormatConfig(t));s=this._canAdjustMonth(t,+1,tt,Q)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'"+" title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"w":"e")+"'>"+r+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"w":"e")+"'>"+r+"</span></a>";o=this._get(t,"currentText");a=this._get(t,"gotoCurrent")&&t.currentDay?G:H;o=!U?o:this.formatDate(o,a,this._getFormatConfig(t));l=!t.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(t,"closeText")+"</button>":"";c=q?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(V?l:"")+(this._isInRange(t,a)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'"+">"+o+"</button>":"")+(V?"":l)+"</div>":"";u=parseInt(this._get(t,"firstDay"),10);u=isNaN(u)?0:u;h=this._get(t,"showWeek");f=this._get(t,"dayNames");d=this._get(t,"dayNamesMin");p=this._get(t,"monthNames");m=this._get(t,"monthNamesShort");
vendor: 3,153 bytes, line 61
61g=this._get(t,"beforeShowDay");_=this._get(t,"showOtherMonths");v=this._get(t,"selectOtherMonths");y=this._getDefaultDate(t);b="";for(w=0;w<W[0];w++){k="";this.maxRows=4;for(S=0;S<W[1];S++){M=this._daylightSavingAdjust(new Date(tt,Q,t.selectedDay));T=" ui-corner-all";C="";if(J){C+="<div class='ui-datepicker-group";if(W[1]>1){switch(S){case 0:C+=" ui-datepicker-group-first";T=" ui-corner-"+(V?"right":"left");break;case W[1]-1:C+=" ui-datepicker-group-last";T=" ui-corner-"+(V?"left":"right");break;default:C+=" ui-datepicker-group-middle";T="";break}}C+="'>"}C+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&w===0?V?s:i:"")+(/all|right/.test(T)&&w===0?V?i:s:"")+this._generateMonthYearHeader(t,Q,tt,K,Z,w>0||S>0,p,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";A=h?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"";for(x=0;x<7;x++){D=(x+u)%7;A+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+f[D]+"'>"+d[D]+"</span></th>"}C+=A+"</tr></thead><tbody>";E=this._getDaysInMonth(tt,Q);if(tt===t.selectedYear&&Q===t.selectedMonth){t.selectedDay=Math.min(t.selectedDay,E)}N=(this._getFirstDayOfMonth(tt,Q)-u+7)%7;z=Math.ceil((N+E)/7);P=J?this.maxRows>z?this.maxRows:z:z;this.maxRows=P;j=this._daylightSavingAdjust(new Date(tt,Q,1-N));for(I=0;I<P;I++){C+="<tr>";$=!h?"":"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(j)+"</td>";for(x=0;x<7;x++){R=g?g.apply(t.input?t.input[0]:null,[j]):[true,""];L=j.getMonth()!==Q;F=L&&!v||!R[0]||K&&j<K||Z&&j>Z;$+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(L?" ui-datepicker-other-month":"")+(j.getTime()===M.getTime()&&Q===t.selectedMonth&&t._keyEvent||y.getTime()===j.getTime()&&y.getTime()===M.getTime()?" "+this._dayOverClass:"")+(F?" "+this._unselectableClass+" ui-state-disabled":"")+(L&&!_?"":" "+R[1]+(j.getTime()===G.getTime()?" "+this._currentClass:"")+(j.getTime()===H.getTime()?" ui-datepicker-today":""))+"'"+((!L||_)&&R[2]?" title='"+R[2].replace(/'/g,"&#39;")+"'":"")+(F?"":" data-handler='selectDay' data-event='click' data-month='"+j.getMonth()+"' data-year='"+j.getFullYear()+"'")+">"+(L&&!_?"&#xa0;":F?"<span class='ui-state-default'>"+j.getDate()+"</span>":"<a class='ui-state-default"+(j.getTime()===H.getTime()?" ui-state-highlight":"")+(j.getTime()===G.getTime()?" ui-state-active":"")+(L?" ui-priority-secondary":"")+"' href='#'>"+j.getDate()+"</a>")+"</td>";j.setDate(j.getDate()+1);j=this._daylightSavingAdjust(j)}C+=$+"</tr>"}Q++;if(Q>11){Q=0;tt++}C+="</tbody></table>"+(J?"</div>"+(W[0]>0&&S===W[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"");k+=C}b+=k}b+=c;t._keyEvent=false;return b},_generateMonthYearHeader:function(t,e,n,i,r,s,o,a){var l,c,u,h,f,d,p,m,g=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),y="<div class='ui-datepicker-title'>",b="";if(s||!g){b+="<span class='ui-datepicker-month'>"+o[e]+"</span>"}else{l=i&&i.getFullYear()===n;c=r&&r.getFullYear()===n;b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";for(u=0;
61u<12;u++){if((!l||u>=i.getMonth())&&(!c||u<=r.getMonth())){b+="<option value='"+u+"'"+(u===e?" selected='selected'":"")+">"+a[u]+"</option>"}}b+="</select>"}if(!v){y+=b+(s||!(g&&_)?"&#xa0;":"")}if(!t.yearshtml){t.yearshtml="";if(s||!_){y+="<span class='ui-datepicker-year'>"+n+"</span>"}else{h=this._get(t,"yearRange").split(":");f=(new Date).getFullYear();d=function(t){var e=t.match(/c[+\-].*/)?n+parseInt(t.substring(1),10):t.match(/[+\-].*/)?f+parseInt(t,10):parseInt(t,10);return isNaN(e)?f:e};p=d(h[0]);m=Math.max(p,d(h[1]||""));p=i?Math.max(p,i.getFullYear()):p;m=r?Math.min(m,r.getFullYear()):m
62;t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";for(;p<=m;p++){t.yearshtml+="<option value='"+p+"'"+(p===n?" selected='selected'":"")+">"+p+"</option>"}t.yearshtml+="</select>";y+=t.yearshtml;t.yearshtml=null}}y+=this._get(t,"yearSuffix");if(v){y+=(s||!(g&&_)?"&#xa0;":"")+b}y+="</div>";return y},_adjustInstDate:function(t,e,n){var i=t.selectedYear+(n==="Y"?e:0),r=t.selectedMonth+(n==="M"?e:0),s=Math.min(t.selectedDay,this._getDaysInMonth(i,r))+(n==="D"?e:0),o=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(i,r,s)));t.selectedDay=o.getDate();t.drawMonth=t.selectedMonth=o.getMonth();t.drawYear=t.selectedYear=o.getFullYear();if(n==="M"||n==="Y"){this._notifyChange(t)}},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),r=n&&e<n?n:e;return i&&r>i?i:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");if(e){e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])}},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return e==null?[1,1]:typeof e==="number"?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,i){var r=this._getNumberOfMonths(t),s=this._daylightSavingAdjust(new Date(n,i+(e<0?e:r[0]*r[1]),1));if(e<0){s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth()))}return this._isInRange(t,s)},_isInRange:function(t,e){var n,i,r=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),o=null,a=null,l=this._get(t,"yearRange");if(l){n=l.split(":");i=(new Date).getFullYear();o=parseInt(n[0],10);a=parseInt(n[1],10);if(n[0].match(/[+\-].*/)){o+=i}if(n[1].match(/[+\-].*/)){a+=i}}return(!r||e.getTime()>=r.getTime())&&(!s||e.getTime()<=s.getTime())&&(!o||e.getFullYear()>=o)&&(!a||e.getFullYear()<=a)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");e=typeof e!=="string"?e:(new Date).getFullYear()%100+parseInt(e,10);return{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,i){if(!e){t.currentDay=t.selectedDay;t.currentMonth=t.selectedMonth;t.currentYear=t.selectedYear}var r=e?typeof e==="object"?e:this._daylightSavingAdjust(new Date(i,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}});function r(e){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",n,function(){t(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){t(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){t(this).removeClass("ui-datepicker-next-hover")}}).on("mouseover",n,s)}function s(){if(!t.datepicker._isDisabledDatepicker(e.inline?e.dpDiv.parent()[0]:e.input[0])){t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");t(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!==-1){t(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!==-1){t(this).addClass("ui-datepicker-next-hover")}}}function o(e,n){t.extend(e,n);for(var i in n){if(n[i]==null){e[i]=n[i]}}return e}t.fn.datepicker=function(e){if(!this.length){return this}if(!t.datepicker.initialized){t(document).on("mousedown",t.datepicker._checkExternalClick);t.datepicker.initialized=true}if(t("#"+t.datepicker._mainDivId).length===0){t("body").append(t.datepicker.dpDiv)}
62var n=Array.prototype.slice.call(arguments,1);if(typeof e==="string"&&(e==="isDisabled"||e==="getDate"||e==="widget")){return t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n))}if(e==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n))}return this.each(function(){typeof e==="string"?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(n)):t.datepicker._attachDatepicker(this,e)})};t.datepicker=new i;t.datepicker.initialized=false;t.datepicker.uuid=(new Date).getTime();t.datepicker.version="1.12.1";return t.datepicker});
63/*!
64 * jQuery UI Widget 1.12.1
65 * http://jqueryui.com
66 *
67 * Copyright jQuery Foundation and other contributors
68 * Released under the MIT license.
69 * http://jquery.org/license
70 */
71/*!
72 * jQuery UI Widget 1.12.1
73 * http://jqueryui.com
74 *
75 * Copyright jQuery Foundation and other contributors
76 * Released under the MIT license.
77 * http://jquery.org/license
78 */
79(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){var e=0;var n=Array.prototype.slice;t.cleanData=function(e){return function(n){var i,r,s;for(s=0;(r=n[s])!=null;s++){try{i=t._data(r,"events");if(i&&i.remove){t(r).triggerHandler("remove")}}catch(o){}}e(n)}}(t.cleanData);t.widget=function(e,n,i){var r,s,o;var a={};var l=e.split(".")[0];e=e.split(".")[1];var c=l+"-"+e;if(!i){i=n;n=t.Widget}if(t.isArray(i)){i=t.extend.apply(null,[{}].concat(i))}t.expr[":"][c.toLowerCase()]=function(e){return!!t.data(e,c)};t[l]=t[l]||{};r=t[l][e];s=t[l][e]=function(t,e){if(!this._createWidget){return new s(t,e)}if(arguments.length){this._createWidget(t,e)}};t.extend(s,r,{version:i.version,_proto:t.extend({},i),_childConstructors:[]});o=new n;o.options=t.widget.extend({},o.options);t.each(i,function(e,i){if(!t.isFunction(i)){a[e]=i;return}a[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function r(t){return n.prototype[e].apply(this,t)}return function(){var e=this._super;var n=this._superApply;var s;this._super=t;this._superApply=r;s=i.apply(this,arguments);this._super=e;this._superApply=n;return s}}()});s.prototype=t.widget.extend(o,{widgetEventPrefix:r?o.widgetEventPrefix||e:e},a,{constructor:s,namespace:l,widgetName:e,widgetFullName:c});if(r){t.each(r._childConstructors,function(e,n){var i=n.prototype;t.widget(i.namespace+"."+i.widgetName,s,n._proto)});delete r._childConstructors}else{n._childConstructors.push(s)}t.widget.bridge(e,s);return s};t.widget.extend=function(e){var i=n.call(arguments,1);var r=0;var s=i.length;var o;var a;for(;r<s;r++){for(o in i[r]){a=i[r][o];if(i[r].hasOwnProperty(o)&&a!==undefined){if(t.isPlainObject(a)){e[o]=t.isPlainObject(e[o])?t.widget.extend({},e[o],a):t.widget.extend({},a)}else{e[o]=a}}}}return e};t.widget.bridge=function(e,i){var r=i.prototype.widgetFullName||e;t.fn[e]=function(s){var o=typeof s==="string";var a=n.call(arguments,1);var l=this;if(o){if(!this.length&&s==="instance"){l=undefined}else{this.each(function(){var n;var i=t.data(this,r);if(s==="instance"){l=i;return false}if(!i){return t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+s+"'")}if(!t.isFunction(i[s])||s.charAt(0)==="_"){return t.error("no such method '"+s+"' for "+e+" widget instance")}n=i[s].apply(i,a);if(n!==i&&n!==undefined){l=n&&n.jquery?l.pushStack(n.get()):n;return false}})}}else{if(a.length){s=t.widget.extend.apply(null,[s].concat(a))}this.each(function(){var e=t.data(this,r);if(e){e.option(s||{});if(e._init){e._init()}}else{t.data(this,r,new i(s,this))}})}return l}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(n,i){i=t(i||this.defaultElement||this)[0];this.element=t(i);this.uuid=e++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=t();this.hoverable=t();this.focusable=t();this.classesElementLookup={};if(i!==this){t.data(i,this.widgetFullName,this);this._on(true,this.element,{remove:function(t){if(t.target===i){this.destroy()}}});this.document=t(i.style?i.ownerDocument:i.document||i);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)}this.options=t.widget.extend({},this.options,this._getCreateOptions(),n);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy();t.each(this.classesElementLookup,function(t,n){e._removeClass(n,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var i=e;var r;var s;var o;if(arguments.length===0){return t.widget.extend({},this.options)}if(typeof e==="string"){i={};r=e.split(".");e=r.shift();if(r.length){s=i[e]=t.widget.extend({},this.options[e]);for(o=0;o<r.length-1;o++){s[r[o]]=s[r[o]]||{};s=s[r[o]]}e=r.pop();if(arguments.length===1){return s[e]===undefined?null:s[e]}s[e]=n}else{if(arguments.length===1){return this.options[e]===undefined?null:this.options[e]}i[e]=n}}this._setOptions(i);return this},_setOptions:function(t){var e;
79for(e in t){this._setOption(e,t[e])}return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)}this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)}return this},_setOptionClasses:function(e){var n,i,r;for(n in e){r=this.classesElementLookup[n];if(e[n]===this.options.classes[n]||!r||!r.length){continue}i=t(r.get());this._removeClass(r,n);i.addClass(this._classes({element:i,keys:n,classes:e,add:true}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(e){var n=[];var i=this;e=t.extend({element:this.element,classes:this.options.classes||{}},e);function r(r,s){var o,a;for(a=0;a<r.length;a++){o=i.classesElementLookup[r[a]]||t();if(e.add){o=t(t.unique(o.get().concat(e.element.get())))}else{o=t(o.not(e.element).get())}i.classesElementLookup[r[a]]=o;n.push(r[a]);if(s&&e.classes[r[a]]){n.push(e.classes[r[a]])}}}this._on(e.element,{remove:"_untrackClassesElement"});if(e.keys){r(e.keys.match(/\S+/g)||[],true)}if(e.extra){r(e.extra.match(/\S+/g)||[])}return n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,function(i,r){if(t.inArray(e.target,r)!==-1){n.classesElementLookup[i]=t(r.not(e.target).get())}})},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,false)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,true)},_toggleClass:function(t,e,n,i){i=typeof i==="boolean"?i:n;var r=typeof t==="string"||t===null,s={extra:r?e:n,keys:r?t:e,element:r?this.element:t,add:i};s.element.toggleClass(this._classes(s),i);return this},_on:function(e,n,i){var r;var s=this;if(typeof e!=="boolean"){i=n;n=e;e=false}if(!i){i=n;n=this.element;r=this.widget()}else{n=r=t(n);this.bindings=this.bindings.add(n)}t.each(i,function(i,o){function a(){if(!e&&(s.options.disabled===true||t(this).hasClass("ui-state-disabled"))){return}return(typeof o==="string"?s[o]:o).apply(s,arguments)}if(typeof o!=="string"){a.guid=o.guid=o.guid||a.guid||t.guid++}var l=i.match(/^([\w:-]*)\s*(.*)$/);var c=l[1]+s.eventNamespace;var u=l[2];if(u){r.on(c,u,a)}else{n.on(c,a)}})}
79,_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.off(n).off(n);this.bindings=t(this.bindings.not(e).get());this.focusable=t(this.focusable.not(e).get());this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function n(){return(typeof t==="string"?i[t]:t).apply(i,arguments)}var i=this;return setTimeout(n,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,i){var r,s;var o=this.options[e];i=i||{};n=t.Event(n);n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();n.target=this.element[0];s=n.originalEvent;if(s){for(r in s){if(!(r in n)){n[r]=s[r]}}}this.element.trigger(n,i);return!(t.isFunction(o)&&o.apply(this.element[0],[n].concat(i))===false||n.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(i,r,s){if(typeof r==="string"){r={effect:r}}var o;var a=!r?e:r===true||typeof r==="number"?n:r.effect||n;r=r||{};if(typeof r==="number"){r={duration:r}}o=!t.isEmptyObject(r);r.complete=s;if(r.delay){i.delay(r.delay)}if(o&&t.effects&&t.effects.effect[a]){i[e](r)}else if(a!==e&&i[a]){i[a](r.duration,r.easing,s)}else{i.queue(function(n){t(this)[e]();if(s){s.call(i[0])}n()})}}});return t.widget});
80/*!
81 * jQuery UI Controlgroup 1.12.1
82 * http://jqueryui.com
83 *
84 * Copyright jQuery Foundation and other contributors
85 * Released under the MIT license.
86 * http://jquery.org/license
87 */
88/*!
89 * jQuery UI Controlgroup 1.12.1
90 * http://jqueryui.com
91 *
92 * Copyright jQuery Foundation and other contributors
93 * Released under the MIT license.
94 * http://jquery.org/license
95 */
96(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../widget"],t)}else{t(jQuery)}})(function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:true,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");if(this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()}},_initWidgets:function(){var e=this,n=[];t.each(this.options.items,function(i,r){var s;var o={};if(!r){return}if(i==="controlgroupLabel"){s=e.element.find(r);s.each(function(){var e=t(this);if(e.children(".ui-controlgroup-label-contents").length){return}e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")});e._addClass(s,null,"ui-widget ui-widget-content ui-state-default");n=n.concat(s.get());return}if(!t.fn[i]){return}if(e["_"+i+"Options"]){o=e["_"+i+"Options"]("middle")}else{o={classes:{}}}e.element.find(r).each(function(){var r=t(this);var s=r[i]("instance");var a=t.widget.extend({},o);if(i==="button"&&r.parent(".ui-spinner").length){return}if(!s){s=r[i]()[i]("instance")}if(s){a.classes=e._resolveClassesValues(a.classes,s)}r[i](a);var l=r[i]("widget");t.data(l[0],"ui-controlgroup-data",s?s:r[i]("instance"));n.push(l[0])})});this.childWidgets=t(t.unique(n));this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var n=t(this),i=n.data("ui-controlgroup-data");if(i&&i[e]){i[e]()}})},_updateCornerClass:function(t,e){var n="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,n);this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var n=this.options.direction==="vertical";var i={classes:{}};i.classes[e]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[t];return i},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");e.classes["ui-spinner-up"]="";e.classes["ui-spinner-down"]="";return e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e=this.options.direction==="vertical";return{width:e?"auto":false,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(n,i){var r={};t.each(n,function(s){var o=i.options.classes[s]||"";o=t.trim(o.replace(e,""));r[s]=(o+" "+n[s]).replace(/\s+/g," ")});return r},_setOption:function(t,e){if(t==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction)}this._super(t,e);if(t==="disabled"){this._callChildMethod(e?"disable":"enable");return}this.refresh()},refresh:function(){var e,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"){this._addClass(null,"ui-helper-clearfix")}this._initWidgets();e=this.childWidgets;if(this.options.onlyVisible){e=e.filter(":visible")}if(e.length){t.each(["first","last"],function(t,i){var r=e[i]().data("ui-controlgroup-data");if(r&&n["_"+r.widgetName+"Options"]){var s=n["_"+r.widgetName+"Options"](e.length===1?"only":i);s.classes=n._resolveClassesValues(s.classes,r);r.element[r.widgetName](s)}else{n._updateCornerClass(e[i](),i)}});this._callChildMethod("refresh")}}})});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}()});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.fn.form=function(){return typeof this[0].form==="string"?this.closest("form"):t(this[0].form)}});
97/*!
98 * jQuery UI Form Reset Mixin 1.12.1
99 * http://jqueryui.com
100 *
101 * Copyright jQuery Foundation and other contributors
102 * Released under the MIT license.
103 * http://jquery.org/license
104 */
105/*!
106 * jQuery UI Form Reset Mixin 1.12.1
107 * http://jqueryui.com
108 *
109 * Copyright jQuery Foundation and other contributors
110 * Released under the MIT license.
111 * http://jquery.org/license
112 */
113(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./form","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var n=e.data("ui-form-reset-instances");t.each(n,function(){this.refresh()})})},_bindFormResetHandler:function(){this.form=this.element.form();if(!this.form.length){return}var t=this.form.data("ui-form-reset-instances")||[];if(!t.length){this.form.on("reset.ui-form-reset",this._formResetHandler)}t.push(this);this.form.data("ui-form-reset-instances",t)},_unbindFormResetHandler:function(){if(!this.form.length){return}var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1);if(e.length){this.form.data("ui-form-reset-instances",e)}else{this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}});
114/*!
115 * jQuery UI Labels 1.12.1
116 * http://jqueryui.com
117 *
118 * Copyright jQuery Foundation and other contributors
119 * Released under the MIT license.
120 * http://jquery.org/license
121 */
122/*!
123 * jQuery UI Labels 1.12.1
124 * http://jqueryui.com
125 *
126 * Copyright jQuery Foundation and other contributors
127 * Released under the MIT license.
128 * http://jquery.org/license
129 */
130(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version","./escape-selector"],t)}else{t(jQuery)}})(function(t){return t.fn.labels=function(){var e,n,i,r,s;if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0].labels)}r=this.eq(0).parents("label");i=this.attr("id");
130if(i){e=this.eq(0).parents().last();s=e.add(e.length?e.siblings():this.siblings());n="label[for='"+t.ui.escapeSelector(i)+"']";r=r.add(s.find(n).addBack(n))}return this.pushStack(r)}});
131/*!
132 * jQuery UI Checkboxradio 1.12.1
133 * http://jqueryui.com
134 *
135 * Copyright jQuery Foundation and other contributors
136 * Released under the MIT license.
137 * http://jquery.org/license
138 */
139/*!
140 * jQuery UI Checkboxradio 1.12.1
141 * http://jqueryui.com
142 *
143 * Copyright jQuery Foundation and other contributors
144 * Released under the MIT license.
145 * http://jquery.org/license
146 */
147(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../escape-selector","../form-reset-mixin","../labels","../widget"],t)}else{t(jQuery)}})(function(t){t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:true,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,n;var i=this;var r=this._super()||{};this._readType();n=this.element.labels();this.label=t(n[n.length-1]);if(!this.label.length){t.error("No label found for checkboxradio widget")}this.originalLabel="";this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=this.nodeType===3?t(this).text():this.outerHTML});if(this.originalLabel){r.label=this.originalLabel}e=this.element[0].disabled;if(e!=null){r.disabled=e}return r},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){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");if(this.type==="radio"){this._addClass(this.label,"ui-checkboxradio-radio-label")}if(this.options.label&&this.options.label!==this.originalLabel){this._updateLabel()}else if(this.originalLabel){this.options.label=this.originalLabel}this._enhance();if(t){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active");if(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 e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type;if(e!=="input"||!/radio|checkbox/.test(this.type)){t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)}},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e;var n=this.element[0].name;var i="input[name='"+t.ui.escapeSelector(n)+"']";if(!n){return t([])}if(this.form.length){e=t(this.form[0].elements).filter(i)}else{e=t(i).filter(function(){return t(this).form().length===0})}return e.not(this.element)},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e);if(this.options.icon&&this.type==="checkbox"){this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e)}if(this.type==="radio"){this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");if(e){e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")}})}},_destroy:function(){this._unbindFormResetHandler();if(this.icon){this.icon.remove();this.iconSpace.remove()}},_setOption:function(t,e){if(t==="label"&&!e){return}this._super(t,e);if(t==="disabled"){this._toggleClass(this.label,null,"ui-state-disabled",e);this.element[0].disabled=e;return}this.refresh()},_updateIcon:function(e){var n="ui-icon ui-icon-background ";if(this.options.icon){if(!this.icon){this.icon=t("<span>");this.iconSpace=t("<span> </span>");
147this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")}if(this.type==="checkbox"){n+=e?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")}else{n+="ui-icon-blank"}this._addClass(this.icon,"ui-checkboxradio-icon",n);if(!e){this._removeClass(this.icon,null,"ui-icon-check ui-state-checked")}this.icon.prependTo(this.label).after(this.iconSpace)}else if(this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon}},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);if(this.icon){t=t.not(this.icon[0])}if(this.iconSpace){t=t.not(this.iconSpace[0])}t.remove();this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t);this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t);if(this.options.label!==null){this._updateLabel()}if(e!==this.options.disabled){this._setOptions({disabled:e})}}}]);return t.ui.checkboxradio});
148/*!
149 * jQuery UI Button 1.12.1
150 * http://jqueryui.com
151 *
152 * Copyright jQuery Foundation and other contributors
153 * Released under the MIT license.
154 * http://jquery.org/license
155 */
156/*!
157 * jQuery UI Button 1.12.1
158 * http://jqueryui.com
159 *
160 * Copyright jQuery Foundation and other contributors
161 * Released under the MIT license.
162 * http://jquery.org/license
163 */
164(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./controlgroup","./checkboxradio","../keycode","../widget"],t)}else{t(jQuery)}})(function(t){t.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:true},_getCreateOptions:function(){var t,e=this._super()||{};this.isInput=this.element.is("input");t=this.element[0].disabled;if(t!=null){e.disabled=t}this.originalLabel=this.isInput?this.element.val():this.element.html();if(this.originalLabel){e.label=this.originalLabel}return e},_create:function(){if(!this.option.showLabel&!this.options.icon){this.options.showLabel=true}if(this.options.disabled==null){this.options.disabled=this.element[0].disabled||false}this.hasTitle=!!this.element.attr("title");if(this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(this.options.label)}else{this.element.html(this.options.label)}}this._addClass("ui-button","ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is("a")){this._on({keyup:function(e){if(e.keyCode===t.ui.keyCode.SPACE){e.preventDefault();if(this.element[0].click){this.element[0].click()}else{this.element.trigger("click")}}}})}},_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button")}if(this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip()}},_updateTooltip:function(){this.title=this.element.attr("title");if(!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label)}},_updateIcon:function(e,n){var i=e!=="iconPosition",r=i?this.options.iconPosition:n,s=r==="top"||r==="bottom";if(!this.icon){this.icon=t("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(!this.options.showLabel){this._addClass("ui-button-icon-only")}}else if(i){this._removeClass(this.icon,null,this.options.icon)}if(i){this._addClass(this.icon,null,n)}this._attachIcon(r);if(s){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){this.iconSpace.remove()}}else{if(!this.iconSpace){this.iconSpace=t("<span> </span>");
164this._addClass(this.iconSpace,"ui-button-icon-space")}this._removeClass(this.icon,null,"ui-wiget-icon-block");this._attachIconSpace(r)}},_destroy:function(){this.element.removeAttr("role");if(this.icon){this.icon.remove()}if(this.iconSpace){this.iconSpace.remove()}if(!this.hasTitle){this.element.removeAttr("title")}},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=t.showLabel===undefined?this.options.showLabel:t.showLabel,n=t.icon===undefined?this.options.icon:t.icon;if(!e&&!n){t.showLabel=true}this._super(t)},_setOption:function(t,e){if(t==="icon"){if(e){this._updateIcon(t,e)}else if(this.icon){this.icon.remove();if(this.iconSpace){this.iconSpace.remove()}}}if(t==="iconPosition"){this._updateIcon(t,e)}if(t==="showLabel"){this._toggleClass("ui-button-icon-only",null,!e);this._updateTooltip()}if(t==="label"){if(this.isInput){this.element.val(e)}else{this.element.html(e);if(this.icon){this._attachIcon(this.options.iconPosition);this._attachIconSpace(this.options.iconPosition)}}}this._super(t,e);if(t==="disabled"){this._toggleClass(null,"ui-state-disabled",e);this.element[0].disabled=e;if(e){this.element.blur()}}},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");if(t!==this.options.disabled){this._setOptions({disabled:t})}this._updateTooltip()}});if(t.uiBackCompat!==false){t.widget("ui.button",t.ui.button,{options:{text:true,icons:{primary:null,secondary:null}},_create:function(){if(this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text}if(!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel}if(!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(this.options.icons.primary){this.options.icon=this.options.icons.primary}else{this.options.icon=this.options.icons.secondary;this.options.iconPosition="end"}}else if(this.options.icon){this.options.icons.primary=this.options.icon}this._super()},_setOption:function(t,e){if(t==="text"){this._super("showLabel",e);return}if(t==="showLabel"){this.options.text=e}if(t==="icon"){this.options.icons.primary=e}if(t==="icons"){if(e.primary){this._super("icon",e.primary);this._super("iconPosition","beginning")}else if(e.secondary){this._super("icon",e.secondary);this._super("iconPosition","end")}}this._superApply(arguments)}});t.fn.button=function(e){return function(){if(!this.length||this.length&&this[0].tagName!=="INPUT"||this.length&&this[0].tagName==="INPUT"&&(this.attr("type")!=="checkbox"&&this.attr("type")!=="radio")){return e.apply(this,arguments)}if(!t.ui.checkboxradio){t.error("Checkboxradio widget missing")}if(arguments.length===0){return this.checkboxradio({icon:false})}return this.checkboxradio.apply(this,arguments)}}(t.fn.button);t.fn.buttonset=function(){if(!t.ui.controlgroup){t.error("Controlgroup widget missing")}if(arguments[0]==="option"&&arguments[1]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]])}if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(this,[arguments[0],"items.button"])}if(typeof arguments[0]==="object"&&arguments[0].items){arguments[0].items={button:arguments[0].items}}return this.controlgroup.apply(this,arguments)}}return t.ui.button});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())});
165/*!
166 * jQuery UI Mouse 1.12.1
167 * http://jqueryui.com
168 *
169 * Copyright jQuery Foundation and other contributors
170 * Released under the MIT license.
171 * http://jquery.org/license
172 */
173/*!
174 * jQuery UI Mouse 1.12.1
175 * http://jqueryui.com
176 *
177 * Copyright jQuery Foundation and other contributors
178 * Released under the MIT license.
179 * http://jquery.org/license
180 */
181(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../ie","../version","../widget"],t)}else{t(jQuery)}})(function(t){var e=false;t(document).on("mouseup",function(){e=false});return t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(n){if(true===t.data(n.target,e.widgetName+".preventClickEvent")){t.removeData(n.target,e.widgetName+".preventClickEvent");n.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(n){if(e){return}this._mouseMoved=false;this._mouseStarted&&this._mouseUp(n);this._mouseDownEvent=n;var i=this,r=n.which===1,s=typeof this.options.cancel==="string"&&n.target.nodeName?t(n.target).closest(this.options.cancel).length:false;if(!r||s||!this._mouseCapture(n)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(n)&&this._mouseDelayMet(n)){this._mouseStarted=this._mouseStart(n)!==false;if(!this._mouseStarted){n.preventDefault();return true}}if(true===t.data(n.target,this.widgetName+".preventClickEvent")){t.removeData(n.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(t){return i._mouseMove(t)};this._mouseUpDelegate=function(t){return i._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);n.preventDefault();e=true;return true},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button){return this._mouseUp(e)}else if(!e.which){if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(e)}}}if(e.which||e.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==false;this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)}return!this._mouseStarted},_mouseUp:function(n){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(n.target===this._mouseDownEvent.target){t.data(n.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(n)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;e=false;n.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})});
182/*!
183 * jQuery UI :data 1.12.1
184 * http://jqueryui.com
185 *
186 * Copyright jQuery Foundation and other contributors
187 * Released under the MIT license.
188 * http://jquery.org/license
189 */
190/*!
191 * jQuery UI :data 1.12.1
192 * http://jqueryui.com
193 *
194 * Copyright jQuery Foundation and other contributors
195 * Released under the MIT license.
196 * http://jquery.org/license
197 */
198(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,i){return!!t.data(e,i[3])}})});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.plugin={add:function(e,n,i){var r,s=t.ui[e].prototype;for(r in i){s.plugins[r]=s.plugins[r]||[];s.plugins[r].push([n,i[r]])}},call:function(t,e,n,i){var r,s=t.plugins[e];if(!s){return}if(!i&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return}for(r=0;r<s.length;r++){if(t.options[s[r][0]]){s[r][1].apply(t.element,n)}}}}});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(n){e=t.body}if(!e){e=t.body}if(!e.nodeName){e=t.body}return e}});(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.ui.safeBlur=function(e){if(e&&e.nodeName.toLowerCase()!=="body"){t(e).trigger("blur")}}});
199/*!
200 * jQuery UI Scroll Parent 1.12.1
201 * http://jqueryui.com
202 *
203 * Copyright jQuery Foundation and other contributors
204 * Released under the MIT license.
205 * http://jquery.org/license
206 */
207/*!
208 * jQuery UI Scroll Parent 1.12.1
209 * http://jqueryui.com
210 *
211 * Copyright jQuery Foundation and other contributors
212 * Released under the MIT license.
213 * http://jquery.org/license
214 */
215(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.fn.scrollParent=function(e){var n=this.css("position"),i=n==="absolute",r=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);if(i&&e.css("position")==="static"){return false}return r.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return n==="fixed"||!s.length?t(this[0].ownerDocument||document):s}});
216/*!
217 * jQuery UI Draggable 1.12.1
218 * http://jqueryui.com
219 *
220 * Copyright jQuery Foundation and other contributors
221 * Released under the MIT license.
222 * http://jquery.org/license
223 */
224/*!
225 * jQuery UI Draggable 1.12.1
226 * http://jqueryui.com
227 *
228 * Copyright jQuery Foundation and other contributors
229 * Released under the MIT license.
230 * http://jquery.org/license
231 */
232(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../data","../plugin","../safe-active-element","../safe-blur","../scroll-parent","../version","../widget"],t)}else{t(jQuery)}})(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,curs
232or:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(e){var n=this.options;if(this.helper||n.disabled||t(e.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(e);if(!this.handle){return false}this._blurActiveElement(e);this._blockFrames(n.iframeFix===true?"iframe":n.iframeFix);return true},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(e){var n=t.ui.safeActiveElement(this.document[0]),i=t(e.target);if(i.closest(n).length){return}t.ui.safeBlur(n)},_mouseStart:function(e){var n=this.options;this.helper=this._createHelper(e);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(t.ui.ddmanager){t.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return t(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(e);this.originalPosition=this.position=this._generatePosition(e,false);this.originalPageX=e.pageX;this.originalPageY=e.pageY;n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt);this._setContainment();if(this._trigger("start",e)===false){this._clear();return false}this._cacheHelperProportions();if(t.ui.ddmanager&&!n.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}this._mouseDrag(e,true);if(t.ui.ddmanager){t.ui.ddmanager.dragStart(this,e)}return true},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,n){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(e,true);this.positionAbs=this._convertPositionTo("absolute");if(!n){var i=this._uiHash();if(this._trigger("drag",e,i)===false){this._mouseUp(new t.Event("mouseup",e));return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)}return false},_mouseStop:function(e){var n=this,i=false;if(t.ui.ddmanager&&!this.options.dropBehaviour){i=t.ui.ddmanager.drop(this,e)}if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(n._trigger("stop",e)!==false){n._clear()}})}else{if(this._trigger("stop",e)!==false){this._clear()}}return false},_mouseUp:function(e){this._unblockFrames();if(t.ui.ddmanager){t.ui.ddmanager.dragStop(this,e)}if(this.handleElement.is(e.target)){this.element.trigger("focus")}return t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new t.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:true},_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(e){var n=this.options,i=t.isFunction(n.helper),r=i?t(n.helper.apply(this.element[0],[e])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!r.parents("body").length){r.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo)}if(i&&r[0]===this.element[0]){this._setPositionRelative()}if(r[0]!==this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))){r.css("position","absolute")}return r},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}}
232,_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")}if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}}if("left"in e){this.offset.click.left=e.left+this.margins.left}if("right"in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left}if("top"in e){this.offset.click.top=e.top+this.margins.top}if("bottom"in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),n=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==n&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_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 e,n,i,r=this.options,s=this.document[0];this.relativeContainer=null;if(!r.containment){this.containment=null;return}if(r.containment==="window"){this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(r.containment==="document"){this.containment=[0,0,t(s).width()-this.helperProportions.width-this.margins.left,(t(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(r.containment.constructor===Array){this.containment=r.containment;return}if(r.containment==="parent"){r.containment=this.helper[0].parentNode}n=t(r.containment);i=n[0];if(!i){return}e=/(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),(e?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(i.scrollHeight,i.offsetHeight):i.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},_convertPositionTo:function(t,e){if(!e){e=this.position}var n=t==="absolute"?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*n+this.offset.parent.top*n-(this.cssPosition==="fixed"?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:e.left+this.offset.relative.left*n+this.offset.parent.left*n-(this.cssPosition==="fixed"?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(t,e){var n,i,r,s,o=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,c=t.pageY;if(!a||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(e){if(this.containment){if(this.relativeContainer){i=this.relativeContainer.offset();n=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else{n=this.containment}if(t.pageX-this.offset.click.left<n[0]){l=n[0]+this.offset.click.left}if(t.pageY-this.offset.click.top<n[1]){c=n[1]+this.offset.click.top}if(t.pageX-this.offset.click.left>n[2]){l=n[2]+this.offset.click.left}if(t.pageY-this.offset.click.top>n[3]){c=n[3]+this.offset.click.top}}if(o.grid){r=o.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;c=n?r-this.offset.click.top>=n[1]||r-this.offset.click.top>n[3]?r:r-this.offset.click.top>=n[1]?r-o.grid[1]:r+o.grid[1]:r;s=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)
232/o.grid[0])*o.grid[0]:this.originalPageX;l=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}if(o.axis==="y"){l=this.originalPageX}if(o.axis==="x"){c=this.originalPageY}}return{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(e,n,i){i=i||this._uiHash();t.ui.plugin.call(this,e,[n,i,this],true);if(/^(drag|start|stop)/.test(e)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return t.Widget.prototype._trigger.call(this,e,n,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});t.ui.plugin.add("draggable","connectToSortable",{start:function(e,n,i){var r=t.extend({},n,{item:i.element});i.sortables=[];t(i.options.connectToSortable).each(function(){var n=t(this).sortable("instance");if(n&&!n.options.disabled){i.sortables.push(n);n.refreshPositions();n._trigger("activate",e,r)}})},stop:function(e,n,i){var r=t.extend({},n,{item:i.element});i.cancelHelperRemoval=false;t.each(i.sortables,function(){var t=this;if(t.isOver){t.isOver=0;i.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",e,r)}})},drag:function(e,n,i){t.each(i.sortables,function(){var r=false,s=this;s.positionAbs=i.positionAbs;s.helperProportions=i.helperProportions;s.offset.click=i.offset.click;if(s._intersectsWith(s.containerCache)){r=true;t.each(i.sortables,function(){this.positionAbs=i.positionAbs;this.helperProportions=i.helperProportions;this.offset.click=i.offset.click;if(this!==s&&this._intersectsWith(this.containerCache)&&t.contains(s.element[0],this.element[0])){r=false}return r})}if(r){if(!s.isOver){s.isOver=1;i._parent=n.helper.parent();s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",true);s.options._helper=s.options.helper;s.options.helper=function(){return n.helper[0]};e.target=s.currentItem[0];s._mouseCapture(e,true);s._mouseStart(e,true,true);s.offset.click.top=i.offset.click.top;s.offset.click.left=i.offset.click.left;s.offset.parent.left-=i.offset.parent.left-s.offset.parent.left;s.offset.parent.top-=i.offset.parent.top-s.offset.parent.top;i._trigger("toSortable",e);i.dropped=s.element;t.each(i.sortables,function(){this.refreshPositions()});i.currentItem=i.element;s.fromOutside=i}if(s.currentItem){s._mouseDrag(e);n.position=s.position}}else{if(s.isOver){s.isOver=0;s.cancelHelperRemoval=true;s.options._revert=s.options.revert;s.options.revert=false;s._trigger("out",e,s._uiHash(s));s._mouseStop(e,true);s.options.revert=s.options._revert;s.options.helper=s.options._helper;if(s.placeholder){s.placeholder.remove()}n.helper.appendTo(i._parent);i._refreshOffsets(e);n.position=i._generatePosition(e,true);i._trigger("fromSortable",e);i.dropped=false;t.each(i.sortables,function(){this.refreshPositions()})}}})}});t.ui.plugin.add("draggable","cursor",{start:function(e,n,i){var r=t("body"),s=i.options;if(r.css("cursor")){s._cursor=r.css("cursor")}r.css("cursor",s.cursor)},stop:function(e,n,i){var r=i.options;if(r._cursor){t("body").css("cursor",r._cursor)}}});t.ui.plugin.add("draggable","opacity",{start:function(e,n,i){var r=t(n.helper),s=i.options;if(r.css("opacity")){s._opacity=r.css("opacity")}r.css("opacity",s.opacity)},stop:function(e,n,i){var r=i.options;if(r._opacity){t(n.helper).css("opacity",r._opacity)}}});t.ui.plugin.add("draggable","scroll",{start:function(t,e,n){if(!n.scrollParentNotHidden){n.scrollParentNotHidden=n.helper.scrollParent(false)}if(n.scrollParentNotHidden[0]!==n.document[0]&&n.scrollParentNotHidden[0].tagName!=="HTML"){n.overflowOffset=n.scrollParentNotHidden.offset()}},drag:function(e,n,i){var r=i.options,s=false,o=i.scrollParentNotHidden[0],a=i.document[0];if(o!==a&&o.tagName!=="HTML"){if(!r.axis||r.axis!=="x"){if(i.overflowOffset.top+o.offsetHeight-e.pageY<r.scrollSensitivity){o.scrollTop=s=o.scrollTop+r.scrollSpeed}else if(e.pageY-i.overflowOffset.top<r.scrollSensitivity){o.scrollTop=s=o.scrollTop-r.scrollSpeed}}if(!r.axis||r.axis!=="y"){if(i.overflowOffset.left+o.offsetWidth-e.pageX<r.scrollSensitivity){o.scrollLeft=s=o.scrollLeft+r.scrollSpeed}else if(e.pageX-i.overflowOffset.left<r.scrollSensitivity){o.scrollLeft=s=o.scrollLeft-r.scrollSpeed}}}
232else{if(!r.axis||r.axis!=="x"){if(e.pageY-t(a).scrollTop()<r.scrollSensitivity){s=t(a).scrollTop(t(a).scrollTop()-r.scrollSpeed)}else if(t(window).height()-(e.pageY-t(a).scrollTop())<r.scrollSensitivity){s=t(a).scrollTop(t(a).scrollTop()+r.scrollSpeed)}}if(!r.axis||r.axis!=="y"){if(e.pageX-t(a).scrollLeft()<r.scrollSensitivity){s=t(a).scrollLeft(t(a).scrollLeft()-r.scrollSpeed)}else if(t(window).width()-(e.pageX-t(a).scrollLeft())<r.scrollSensitivity){s=t(a).scrollLeft(t(a).scrollLeft()+r.scrollSpeed)}}}if(s!==false&&t.ui.ddmanager&&!r.dropBehaviour){t.ui.ddmanager.prepareOffsets(i,e)}}});t.ui.plugin.add("draggable","snap",{start:function(e,n,i){var r=i.options;i.snapElements=[];t(r.snap.constructor!==String?r.snap.items||":data(ui-draggable)":r.snap).each(function(){var e=t(this),n=e.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:n.top,left:n.left})}})},drag:function(e,n,i){var r,s,o,a,l,c,u,h,f,d,p=i.options,m=p.snapTolerance,g=n.offset.left,_=g+i.helperProportions.width,v=n.offset.top,y=v+i.helperProportions.height;for(f=i.snapElements.length-1;f>=0;f--){l=i.snapElements[f].left-i.margins.left;c=l+i.snapElements[f].width;u=i.snapElements[f].top-i.margins.top;h=u+i.snapElements[f].height;if(_<l-m||g>c+m||y<u-m||v>h+m||!t.contains(i.snapElements[f].item.ownerDocument,i.snapElements[f].item)){if(i.snapElements[f].snapping){i.options.snap.release&&i.options.snap.release.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[f].item}))}i.snapElements[f].snapping=false;continue}if(p.snapMode!=="inner"){r=Math.abs(u-y)<=m;s=Math.abs(h-v)<=m;o=Math.abs(l-_)<=m;a=Math.abs(c-g)<=m;if(r){n.position.top=i._convertPositionTo("relative",{top:u-i.helperProportions.height,left:0}).top}if(s){n.position.top=i._convertPositionTo("relative",{top:h,left:0}).top}if(o){n.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}if(a){n.position.left=i._convertPositionTo("relative",{top:0,left:c}).left}}d=r||s||o||a;if(p.snapMode!=="outer"){r=Math.abs(u-v)<=m;s=Math.abs(h-y)<=m;o=Math.abs(l-g)<=m;a=Math.abs(c-_)<=m;if(r){n.position.top=i._convertPositionTo("relative",{top:u,left:0}).top}if(s){n.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top}if(o){n.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}if(a){n.position.left=i._convertPositionTo("relative",{top:0,left:c-i.helperProportions.width}).left}}if(!i.snapElements[f].snapping&&(r||s||o||a||d)){i.options.snap.snap&&i.options.snap.snap.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[f].item}))}i.snapElements[f].snapping=r||s||o||a||d}}});t.ui.plugin.add("draggable","stack",{start:function(e,n,i){var r,s=i.options,o=t.makeArray(t(s.stack)).sort(function(e,n){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(n).css("zIndex"),10)||0)});if(!o.length){return}r=parseInt(t(o[0]).css("zIndex"),10)||0;t(o).each(function(e){t(this).css("zIndex",r+e)});this.css("zIndex",r+o.length)}});t.ui.plugin.add("draggable","zIndex",{start:function(e,n,i){var r=t(n.helper),s=i.options;if(r.css("zIndex")){s._zIndex=r.css("zIndex")}r.css("zIndex",s.zIndex)},stop:function(e,n,i){var r=i.options;if(r._zIndex){t(n.helper).css("zIndex",r._zIndex)}}});return t.ui.draggable});
233/*!
234 * jQuery UI Disable Selection 1.12.1
235 * http://jqueryui.com
236 *
237 * Copyright jQuery Foundation and other contributors
238 * Released under the MIT license.
239 * http://jquery.org/license
240 */
241/*!
242 * jQuery UI Disable Selection 1.12.1
243 * http://jqueryui.com
244 *
245 * Copyright jQuery Foundation and other contributors
246 * Released under the MIT license.
247 * http://jquery.org/license
248 */
249(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}})});
250/*!
251 * jQuery UI Resizable 1.12.1
252 * http://jqueryui.com
253 *
254 * Copyright jQuery Foundation and other contributors
255 * Released under the MIT license.
256 * http://jquery.org/license
257 */
258/*!
259 * jQuery UI Resizable 1.12.1
260 * http://jqueryui.com
261 *
262 * Copyright jQuery Foundation and other contributors
263 * Released under the MIT license.
264 * http://jquery.org/license
265 */
266(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../disable-selection","../plugin","../version","../widget"],t)}else{t(jQuery)}})(function(t){t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,n){if(t(e).css("overflow")==="hidden"){return false}var i=n&&n==="left"?"scrollLeft":"scrollTop",r=false;if(e[i]>0){return true}e[i]=1;r=e[i]>0;e[i]=0;return r},_create:function(){var e,n=this.options,i=this;this._addClass("ui-resizable");t.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});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(t("<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=true;e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(e);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(e);this._proportionallyResize()}this._setupHandles();if(n.autoHide){t(this.element).on("mouseenter",function(){if(n.disabled){return}i._removeClass("ui-resizable-autohide");i._handles.show()}).on("mouseleave",function(){if(n.disabled){return}if(!i.resizing){i._addClass("ui-resizable-autohide");i._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,n=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){n(this.element);e=this.element;this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e);e.remove()}this.originalElement.css("resize",this.originalResizeStyle);n(this.originalElement);return this},_setOption:function(t,e){this._super(t,e);switch(t){case"handles":this._removeHandles();this._setupHandles();break;default:break}},_setupHandles:function(){var e=this.options,n,i,r,s,o,a=this;this.handles=e.handles||(!t(".ui-resizable-handle",this.element).length?"e,s,se":{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"});this._handles=t();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}r=this.handles.split(",");this.handles={};for(i=0;i<r.length;i++){n=t.trim(r[i]);s="ui-resizable-"+n;o=t("<div>");this._addClass(o,"ui-resizable-handle "+s);o.css({zIndex:e.zIndex});this.handles[n]=".ui-resizable-"+n;this.element.append(o)}}this._renderAxis=function(e){var n,i,r,s;e=e||this.element;
266for(n in this.handles){if(this.handles[n].constructor===String){this.handles[n]=this.element.children(this.handles[n]).first().show()}else if(this.handles[n].jquery||this.handles[n].nodeType){this.handles[n]=t(this.handles[n]);this._on(this.handles[n],{mousedown:a._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){i=t(this.handles[n],this.element);s=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth();r=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");e.css(r,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(){if(!a.resizing){if(this.className){o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}a.axis=o&&o[1]?o[1]:"se"}});if(e.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var n,i,r=false;for(n in this.handles){i=t(this.handles[n])[0];if(i===e.target||t.contains(i,e.target)){r=true}}return!this.options.disabled&&r},_mouseStart:function(e){var n,i,r,s=this.options,o=this.element;this.resizing=true;this._renderProxy();n=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(s.containment){n+=t(s.containment).scrollLeft()||0;i+=t(s.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:n,top:i};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:i};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof s.aspectRatio==="number"?s.aspectRatio:this.originalSize.width/this.originalSize.height||1;r=t(".ui-resizable-"+this.axis).css("cursor");t("body").css("cursor",r==="auto"?this.axis+"-resize":r);this._addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var n,i,r=this.originalMousePosition,s=this.axis,o=e.pageX-r.left||0,a=e.pageY-r.top||0,l=this._change[s];this._updatePrevProperties();if(!l){return false}n=l.apply(this,[e,o,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){n=this._updateRatio(n,e)}n=this._respectSize(n,e);this._updateCache(n);this._propagate("resize",e);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!t.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",e,this.ui());this._applyChanges()}return false},_mouseStop:function(e){this.resizing=false;var n,i,r,s,o,a,l,c=this.options,u=this;if(this._helper){n=this._proportionallyResizeElements;i=n.length&&/textarea/i.test(n[0].nodeName);r=i&&this._hasScroll(n[0],"left")?0:u.sizeDiff.height;s=i?0:u.sizeDiff.width;o={width:u.helper.width()-s,height:u.helper.height()-r};a=parseFloat(u.element.css("left"))+(u.position.left-u.originalPosition.left)||null;l=parseFloat(u.element.css("top"))+(u.position.top-u.originalPosition.top)||null;if(!c.animate){this.element.css(t.extend(o,{top:l,left:a}))}u.helper.height(u.size.height);u.helper.width(u.size.width);if(this._helper&&!c.animate){this._proportionallyResize()}}t("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",e);if(this._helper){this.helper.remove()}return false},_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 t={};if(this.position.top!==this.prevPosition.top){t.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){t.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){t.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){t.height=this.size.height+"px"}this.helper.css(t);return t},_updateVirtualBoundaries:function(t){var e,n,i,r,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||t){e=s.minHeight*this.aspectRatio;i=s.minWidth/this.aspectRatio;n=s.maxHeight*this.aspectRatio;r=s.maxWidth/this.aspectRatio;if(e>s.minWidth){s.minWidth=e}if(i>s.minHeight){s.minHeight=i}if(n<s.maxWidth){s.maxWidth=n}if(r<s.maxHeight){s.maxHeight=r}}this._vBoundaries=s},_updateCache:function(t){this.offset=this.helper.offset();
266if(this._isNumber(t.left)){this.position.left=t.left}if(this._isNumber(t.top)){this.position.top=t.top}if(this._isNumber(t.height)){this.size.height=t.height}if(this._isNumber(t.width)){this.size.width=t.width}},_updateRatio:function(t){var e=this.position,n=this.size,i=this.axis;if(this._isNumber(t.height)){t.width=t.height*this.aspectRatio}else if(this._isNumber(t.width)){t.height=t.width/this.aspectRatio}if(i==="sw"){t.left=e.left+(n.width-t.width);t.top=null}if(i==="nw"){t.top=e.top+(n.height-t.height);t.left=e.left+(n.width-t.width)}return t},_respectSize:function(t){var e=this._vBoundaries,n=this.axis,i=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,r=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,s=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,o=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,c=/sw|nw|w/.test(n),u=/nw|ne|n/.test(n);if(s){t.width=e.minWidth}if(o){t.height=e.minHeight}if(i){t.width=e.maxWidth}if(r){t.height=e.maxHeight}if(s&&c){t.left=a-e.minWidth}if(i&&c){t.left=a-e.maxWidth}if(o&&u){t.top=l-e.minHeight}if(r&&u){t.top=l-e.maxHeight}if(!t.width&&!t.height&&!t.left&&t.top){t.top=null}else if(!t.width&&!t.height&&!t.top&&t.left){t.left=null}return t},_getPaddingPlusBorderDimensions:function(t){var e=0,n=[],i=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],r=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];for(;e<4;e++){n[e]=parseFloat(i[e])||0;n[e]+=parseFloat(r[e])||0}return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var t,e=0,n=this.helper||this.element;for(;e<this._proportionallyResizeElements.length;e++){t=this._proportionallyResizeElements[e];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(t)}t.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var e=this.element,n=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||t("<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()}else{this.helper=this.element}},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var n=this.originalSize,i=this.originalPosition;return{left:i.left+e,width:n.width-e}},n:function(t,e,n){var i=this.originalSize,r=this.originalPosition;return{top:r.top+n,height:i.height-n}},s:function(t,e,n){return{height:this.originalSize.height+n}},se:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},sw:function(e,n,i){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,n,i]))},ne:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,n,i]))},nw:function(e,n,i){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,n,i]))}},_propagate:function(e,n){t.ui.plugin.call(this,e,[n,this.ui()]);e!=="resize"&&this._trigger(e,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}}});t.ui.plugin.add("resizable","animate",{stop:function(e){var n=t(this).resizable("instance"),i=n.options,r=n._proportionallyResizeElements,s=r.length&&/textarea/i.test(r[0].nodeName),o=s&&n._hasScroll(r[0],"left")?0:n.sizeDiff.height,a=s?0:n.sizeDiff.width,l={width:n.size.width-a,height:n.size.height-o},c=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,u=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null;n.element.animate(t.extend(l,u&&c?{top:u,left:c}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var i={width:parseFloat(n.element.css("width")),height:parseFloat(n.element.css("height")),top:parseFloat(n.element.css("top")),left:parseFloat(n.element.css("left"))};if(r&&r.length){t(r[0]).css({width:i.width,height:i.height})}n._updateCache(i);n._propagate("resize",e)}})}});t.ui.plugin.add("resizable","containment",{start:function(){var e,n,i,r,s,o,a,l=t(this).resizable("instance"),c=l.options,u=l.element,h=c.containment,f=h instanceof t?h.get(0):/parent/.test(h)?u.parent().get(0):h;if(!f){return}l.containerElement=t(f);if(/document/.test(h)||h===document){l.containerOffset={left:0,top:0};l.containerPosition={left:0,top:0};l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}}else{e=t(f);n=[];t(["Top","Right","Left","Bottom"]).each(function(t,i){n[t]=l._num(e.css("padding"+i))});l.containerOffset=e.offset();l.containerPosition=e.position();
266l.containerSize={height:e.innerHeight()-n[3],width:e.innerWidth()-n[1]};i=l.containerOffset;r=l.containerSize.height;s=l.containerSize.width;o=l._hasScroll(f,"left")?f.scrollWidth:s;a=l._hasScroll(f)?f.scrollHeight:r;l.parentData={element:f,left:i.left,top:i.top,width:o,height:a}}},resize:function(e){var n,i,r,s,o=t(this).resizable("instance"),a=o.options,l=o.containerOffset,c=o.position,u=o._aspectRatio||e.shiftKey,h={top:0,left:0},f=o.containerElement,d=true;if(f[0]!==document&&/static/.test(f.css("position"))){h=l}if(c.left<(o._helper?l.left:0)){o.size.width=o.size.width+(o._helper?o.position.left-l.left:o.position.left-h.left);if(u){o.size.height=o.size.width/o.aspectRatio;d=false}o.position.left=a.helper?l.left:0}if(c.top<(o._helper?l.top:0)){o.size.height=o.size.height+(o._helper?o.position.top-l.top:o.position.top);if(u){o.size.width=o.size.height*o.aspectRatio;d=false}o.position.top=o._helper?l.top:0}r=o.containerElement.get(0)===o.element.parent().get(0);s=/relative|absolute/.test(o.containerElement.css("position"));if(r&&s){o.offset.left=o.parentData.left+o.position.left;o.offset.top=o.parentData.top+o.position.top}else{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-h.left:o.offset.left-l.left));i=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-h.top:o.offset.top-l.top));if(n+o.size.width>=o.parentData.width){o.size.width=o.parentData.width-n;if(u){o.size.height=o.size.width/o.aspectRatio;d=false}}if(i+o.size.height>=o.parentData.height){o.size.height=o.parentData.height-i;if(u){o.size.width=o.size.height*o.aspectRatio;d=false}}if(!d){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 e=t(this).resizable("instance"),n=e.options,i=e.containerOffset,r=e.containerPosition,s=e.containerElement,o=t(e.helper),a=o.offset(),l=o.outerWidth()-e.sizeDiff.width,c=o.outerHeight()-e.sizeDiff.height;if(e._helper&&!n.animate&&/relative/.test(s.css("position"))){t(this).css({left:a.left-r.left-i.left,width:l,height:c})}if(e._helper&&!n.animate&&/static/.test(s.css("position"))){t(this).css({left:a.left-r.left-i.left,width:l,height:c})}}});t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),n=e.options;t(n.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,n){var i=t(this).resizable("instance"),r=i.options,s=i.originalSize,o=i.originalPosition,a={height:i.size.height-s.height||0,width:i.size.width-s.width||0,top:i.position.top-o.top||0,left
266:i.position.left-o.left||0};t(r.alsoResize).each(function(){var e=t(this),i=t(this).data("ui-resizable-alsoresize"),r={},s=e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(s,function(t,e){var n=(i[e]||0)+(a[e]||0);if(n&&n>=0){r[e]=n||null}});e.css(r)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}});t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),n=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0});e._addClass(e.ghost,"ui-resizable-ghost");if(t.uiBackCompat!==false&&typeof e.options.ghost==="string"){e.ghost.addClass(this.options.ghost)}e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(){var e=t(this).resizable("instance");if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});t.ui.plugin.add("resizable","grid",{resize:function(){var e,n=t(this).resizable("instance"),i=n.options,r=n.size,s=n.originalSize,o=n.originalPosition,a=n.axis,l=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,c=l[0]||1,u=l[1]||1,h=Math.round((r.width-s.width)/c)*c,f=Math.round((r.height-s.height)/u)*u,d=s.width+h,p=s.height+f,m=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,_=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=l;if(_){d+=c}if(v){p+=u}if(m){d-=c}if(g){p-=u}if(/^(se|s|e)$/.test(a)){n.size.width=d;n.size.height=p}else if(/^(ne)$/.test(a)){n.size.width=d;n.size.height=p;n.position.top=o.top-f}else if(/^(sw)$/.test(a)){n.size.width=d;n.size.height=p;n.position.left=o.left-h}else{if(p-u<=0||d-c<=0){e=n._getPaddingPlusBorderDimensions(this)}if(p-u>0){n.size.height=p;n.position.top=o.top-f}else{p=u-e.height;n.size.height=p;n.position.top=o.top+s.height-p}if(d-c>0){n.size.width=d;n.position.left=o.left-h}else{d=c-e.width;n.size.width=d;n.position.left=o.left+s.width-d}}}});return t.ui.resizable});
267/*!
268 * jQuery UI Focusable 1.12.1
269 * http://jqueryui.com
270 *
271 * Copyright jQuery Foundation and other contributors
272 * Released under the MIT license.
273 * http://jquery.org/license
274 */
275/*!
276 * jQuery UI Focusable 1.12.1
277 * http://jqueryui.com
278 *
279 * Copyright jQuery Foundation and other contributors
280 * Released under the MIT license.
281 * http://jquery.org/license
282 */
283(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){t.ui.focusable=function(n,i){var r,s,o,a,l,c=n.nodeName.toLowerCase();if("area"===c){r=n.parentNode;s=r.name;if(!n.href||!s||r.nodeName.toLowerCase()!=="map"){return false}o=t("img[usemap='#"+s+"']");return o.length>0&&o.is(":visible")}if(/^(input|select|textarea|button|object)$/.test(c)){a=!n.disabled;if(a){l=t(n).closest("fieldset")[0];if(l){a=!l.disabled}}}else if("a"===c){a=n.href||i}else{a=i}return a&&t(n).is(":visible")&&e(t(n))};function e(t){var e=t.css("visibility");while(e==="inherit"){t=t.parent();e=t.css("visibility")}return e!=="hidden"}t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,t.attr(e,"tabindex")!=null)}});return t.ui.focusable});
284/*!
285 * jQuery UI Position 1.12.1
286 * http://jqueryui.com
287 *
288 * Copyright jQuery Foundation and other contributors
289 * Released under the MIT license.
290 * http://jquery.org/license
291 *
292 * http://api.jqueryui.com/position/
293 */
294/*!
295 * jQuery UI Position 1.12.1
296 * http://jqueryui.com
297 *
298 * Copyright jQuery Foundation and other contributors
299 * Released under the MIT license.
300 * http://jquery.org/license
301 *
302 * http://api.jqueryui.com/position/
303 */
304(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){(function(){var e,n=Math.max,i=Math.abs,r=/left|center|right/,s=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=t.fn.position;function u(t,e,n){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?n/100:1)]}function h(e,n){return parseInt(t.css(e,n),10)||0}function f(e){var n=e[0];if(n.nodeType===9){return{width:e.width(),height:e.height(),offset:{top:0,left:0}}}if(t.isWindow(n)){return{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}}if(n.preventDefault){return{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}}return{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.position={scrollbarWidth:function(){if(e!==undefined){return e}var n,i,r=t("<div "+"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>"+"<div style='height:100px;width:auto;'></div></div>"),s=r.children()[0];t("body").append(r);n=s.offsetWidth;r.css("overflow","scroll");i=s.offsetWidth;if(n===i){i=r[0].clientWidth}r.remove();return e=n-i},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),i=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),r=n==="scroll"||n==="auto"&&e.width<e.element[0].scrollWidth,s=i==="scroll"||i==="auto"&&e.height<e.element[0].scrollHeight;return{width:s?t.position.scrollbarWidth():0,height:r?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var n=t(e||window),i=t.isWindow(n[0]),r=!!n[0]&&n[0].nodeType===9,s=!i&&!r;return{element:n,isWindow:i,isDocument:r,offset:s?t(e).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}};t.fn.position=function(e){if(!e||!e.of){return c.apply(this,arguments)}e=t.extend({},e);var l,d,p,m,g,_,v=t(e.of),y=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),w={};_=f(v);
304if(v[0].preventDefault){e.at="left top"}d=_.width;p=_.height;m=_.offset;g=t.extend({},m);t.each(["my","at"],function(){var t=(e[this]||"").split(" "),n,i;if(t.length===1){t=r.test(t[0])?t.concat(["center"]):s.test(t[0])?["center"].concat(t):["center","center"]}t[0]=r.test(t[0])?t[0]:"center";t[1]=s.test(t[1])?t[1]:"center";n=o.exec(t[0]);i=o.exec(t[1]);w[this]=[n?n[0]:0,i?i[0]:0];e[this]=[a.exec(t[0])[0],a.exec(t[1])[0]]});if(x.length===1){x[1]=x[0]}if(e.at[0]==="right"){g.left+=d}else if(e.at[0]==="center"){g.left+=d/2}if(e.at[1]==="bottom"){g.top+=p}else if(e.at[1]==="center"){g.top+=p/2}l=u(w.at,d,p);g.left+=l[0];g.top+=l[1];return this.each(function(){var r,s,o=t(this),a=o.outerWidth(),c=o.outerHeight(),f=h(this,"marginLeft"),_=h(this,"marginTop"),k=a+f+h(this,"marginRight")+b.width,S=c+_+h(this,"marginBottom")+b.height,M=t.extend({},g),T=u(w.my,o.outerWidth(),o.outerHeight());if(e.my[0]==="right"){M.left-=a}else if(e.my[0]==="center"){M.left-=a/2}if(e.my[1]==="bottom"){M.top-=c}else if(e.my[1]==="center"){M.top-=c/2}M.left+=T[0];M.top+=T[1];r={marginLeft:f,marginTop:_};t.each(["left","top"],function(n,i){if(t.ui.position[x[n]]){t.ui.position[x[n]][i](M,{targetWidth:d,targetHeight:p,elemWidth:a,elemHeight:c,collisionPosition:r,collisionWidth:k,collisionHeight:S,offset:[l[0]+T[0],l[1]+T[1]],my:e.my,at:e.at,within:y,elem:o})}});if(e.using){s=function(t){var r=m.left-M.left,s=r+d-a,l=m.top-M.top,u=l+p-c,h={target:{element:v,left:m.left,top:m.top,width:d,height:p},element:{element:o,left:M.left,top:M.top,width:a,height:c},horizontal:s<0?"left":r>0?"right":"center",vertical:u<0?"top":l>0?"bottom":"middle"};if(d<a&&i(r+s)<d){h.horizontal="center"}if(p<c&&i(l+u)<p){h.vertical="middle"}if(n(i(r),i(s))>n(i(l),i(u))){h.important="horizontal"}else{h.important="vertical"}e.using.call(this,t,h)}}o.offset(t.extend(M,{using:s}))})};t.ui.position={fit:{left:function(t,e){var i=e.within,r=i.isWindow?i.scrollLeft:i.offset.left,s=i.width,o=t.left-e.collisionPosition.marginLeft,a=r-o,l=o+e.collisionWidth-s-r,c;if(e.collisionWidth>s){if(a>0&&l<=0){c=t.left+a+e.collisionWidth-s-r;t.left+=a-c}else if(l>0&&a<=0){t.left=r}else{if(a>l){t.left=r+s-e.collisionWidth}else{t.left=r}}}else if(a>0){t.left+=a}else if(l>0){t.left-=l}else{t.left=n(t.left-o,t.left)}},top:function(t,e){var i=e.within,r=i.isWindow?i.scrollTop:i.offset.top,s=e.within.height,o=t.top-e.collisionPosition.marginTop,a=r-o,l=o+e.collisionHeight-s-r,c;if(e.collisionHeight>s){if(a>0&&l<=0){c=t.top+a+e.collisionHeight-s-r;t.top+=a-c}else if(l>0&&a<=0){t.top=r}else{if(a>l){t.top=r+s-e.collisionHeight}else{t.top=r}}}else if(a>0){t.top+=a}else if(l>0){t.top-=l}else{t.top=n(t.top-o,t.top)}}},flip:{left:function(t,e){var n=e.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,a=t.left-e.collisionPosition.marginLeft,l=a-o,c=a+e.collisionWidth-s-o,u=e.my[0]==="left"?-e.elemWidth:e.my[0]==="right"?e.elemWidth:0,h=e.at[0]==="left"?e.targetWidth:e.at[0]==="right"?-e.targetWidth:0,f=-2*e.offset[0],d,p;if(l<0){d=t.left+u+h+f+e.collisionWidth-s-r;if(d<0||d<i(l)){t.left+=u+h+f}}else if(c>0){p=t.left-e.collisionPosition.marginLeft+u+h+f-o;if(p>0||i(p)<c){t.left+=u+h+f}}},top:function(t,e){var n=e.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,a=t.top-e.collisionPosition.marginTop,l=a-o,c=a+e.collisionHeight-s-o,u=e.my[1]==="top",h=u?-e.elemHeight:e.my[1]==="bottom"?e.elemHeight:0,f=e.at[1]==="top"?e.targetHeight:e.at[1]==="bottom"?-e.targetHeight:0,d=-2*e.offset[1],p,m;if(l<0){m=t.top+h+f+d+e.collisionHeight-s-r;if(m<0||m<i(l)){t.top+=h+f+d}}else if(c>0){p=t.top-e.collisionPosition.marginTop+h+f+d-o;if(p>0||i(p)<c){t.top+=h+f+d}}}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments);t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments);t.ui.position.fit.top.apply(this,arguments)}}}})();return t.ui.position});
305/*!
306 * jQuery UI Tabbable 1.12.1
307 * http://jqueryui.com
308 *
309 * Copyright jQuery Foundation and other contributors
310 * Released under the MIT license.
311 * http://jquery.org/license
312 */
313/*!
314 * jQuery UI Tabbable 1.12.1
315 * http://jqueryui.com
316 *
317 * Copyright jQuery Foundation and other contributors
318 * Released under the MIT license.
319 * http://jquery.org/license
320 */
321(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version","./focusable"],t)}else{t(jQuery)}})(function(t){return t.extend(t.expr[":"],{tabbable:function(e){var n=t.attr(e,"tabindex"),i=n!=null;return(!i||n>=0)&&t.ui.focusable(e,i)}})});
322/*!
323 * jQuery UI Unique ID 1.12.1
324 * http://jqueryui.com
325 *
326 * Copyright jQuery Foundation and other contributors
327 * Released under the MIT license.
328 * http://jquery.org/license
329 */
330/*!
331 * jQuery UI Unique ID 1.12.1
332 * http://jqueryui.com
333 *
334 * Copyright jQuery Foundation and other contributors
335 * Released under the MIT license.
336 * http://jquery.org/license
337 */
338(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./version"],t)}else{t(jQuery)}})(function(t){return t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+ ++t}})}}(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id
338)){t(this).removeAttr("id")}})}})});
339/*!
340 * jQuery UI Dialog 1.12.1
341 * http://jqueryui.com
342 *
343 * Copyright jQuery Foundation and other contributors
344 * Released under the MIT license.
345 * http://jquery.org/license
346 */
347/*!
348 * jQuery UI Dialog 1.12.1
349 * http://jqueryui.com
350 *
351 * Copyright jQuery Foundation and other contributors
352 * Released under the MIT license.
353 * http://jquery.org/license
354 */
355(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./button","./draggable","./mouse","./resizable","../focusable","../keycode","../position","../safe-active-element","../safe-blur","../tabbable","../unique-id","../version","../widget"],t)}else{t(jQuery)}})(function(t){t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var n=t(this).css(e).offset().top;if(n<0){t(this).css("top",e.top-n)}}},resizable:true,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:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},_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");if(this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle}if(this.options.disabled){this.options.disabled=false}this._createWrapper();this.element.show().removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content");this._createTitlebar();this._createButtonPane();if(this.options.draggable&&t.fn.draggable){this._makeDraggable()}if(this.options.resizable&&t.fn.resizable){this._makeResizable()}this._isOpen=false;this._trackFocus()},_init:function(){if(this.options.autoOpen){this.open()}},_appendTo:function(){var e=this.options.appendTo;if(e&&(e.jquery||e.nodeType)){return t(e)}return this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance();this._destroyOverlay();this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(this.originalTitle){this.element.attr("title",this.originalTitle)}t=e.parent.children().eq(e.index);if(t.length&&t[0]!==this.element[0]){t.before(this.element)}else{e.parent.append(this.element)}},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var n=this;if(!this._isOpen||this._trigger("beforeClose",e)===false){return}this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(!this.opener.filter(":focusable").trigger("focus").length){t.ui.safeBlur(t.ui.safeActiveElement(this.document[0]))}this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",e)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,n){var i=false,r=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),s=Math.max.apply(null,r);if(s>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",s+1);i=true}if(i&&!n){this._trigger("focus",e)}return i},open:function(){var e=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable()}return}this._isOpen=true;this.opener=t(t.ui.safeActiveElement(this.document[0]));this._size();this._position();this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",this.uiDialog.css("z-index")-1)}this._show(this.uiDialog,this.options.show,function(){e._focusTabbable();e._trigger("focus")});this._makeFocusTarget();this._trigger("open")},_focusTabbable:function(){var t=this._focusedElement;if(!t){t=this.element.find("[autofocus]")}if(!t.length){t=this.element.find(":tabbable")}if(!t.length){t=this.uiDialogButtonPane.find(":tabbable")}if(!t.length){t=this.uiDialogTitlebarClose.filter(":tabbable")}if(!t.length){t=this.uiDialog}t.eq(0).trigger("focus")},_keepFocus:function(e){function n(){var e=t.ui.safeActiveElement(this.document[0]),n=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);if(!n){this._focusTabbable()}}e.preventDefault();n.call(this);this._delay(n)},_createWrapper:function(){this.uiDialog=t("<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(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE){e.preventDefault();this.close(e);return}if(e.keyCode!==t.ui.keyCode.TAB||e.isDefaultPrevented()){return}var n=this.uiDialog.find(":tabbable"),i=n.filter(":first"),r=n.filter(":last");if((e.target===r[0]||e.target===this.uiDialog[0])&&!e.shiftKey){this._delay(function(){i.trigger("focus")});e.preventDefault()}else if((e.target===i[0]||e.target===this.uiDialog[0])&&e.shiftKey){this._delay(function(){r.trigger("focus")});e.preventDefault()}},mousedown:function(t){if(this._moveToTop(t)){this._focusTabbable()}}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})}},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>");this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{mousedown:function(e){if(!t(e.target).closest(".ui-dialog-titlebar-close")){this.uiDialog.trigger("focus")}}});this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault();this.close(t)}});e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(e,"ui-dialog-title");this._title(e);
355this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){if(this.options.title){t.text(this.options.title)}else{t.html("&#160;")}},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix");this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons()},_createButtons:function(){var e=this,n=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if(t.isEmptyObject(n)||t.isArray(n)&&!n.length){this._removeClass(this.uiDialog,"ui-dialog-buttons");return}t.each(n,function(n,i){var r,s;i=t.isFunction(i)?{click:i,text:n}:i;i=t.extend({type:"button"},i);r=i.click;s={icon:i.icon,iconPosition:i.iconPosition,showLabel:i.showLabel,icons:i.icons,text:i.text};delete i.click;delete i.icon;delete i.iconPosition;delete i.showLabel;delete i.icons;if(typeof i.text==="boolean"){delete i.text}t("<button></button>",i).button(s).appendTo(e.uiButtonSet).on("click",function(){r.apply(e.element[0],arguments)})});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){var e=this,n=this.options;function i(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,r){e._addClass(t(this),"ui-dialog-dragging");e._blockFrames();e._trigger("dragStart",n,i(r))},drag:function(t,n){e._trigger("drag",t,i(n))},stop:function(r,s){var o=s.offset.left-e.document.scrollLeft(),a=s.offset.top-e.document.scrollTop();n.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(a>=0?"+":"")+a,of:e.window};e._removeClass(t(this),"ui-dialog-dragging");e._unblockFrames();e._trigger("dragStop",r,i(s))}})},_makeResizable:function(){var e=this,n=this.options,i=n.resizable,r=this.uiDialog.css("position"),s=typeof i==="string"?i:"n,e,s,w,se,sw,ne,nw";function o(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:s,start:function(n,i){e._addClass(t(this),"ui-dialog-resizing");e._blockFrames();e._trigger("resizeStart",n,o(i))},resize:function(t,n){e._trigger("resize",t,o(n))},stop:function(i,r){var s=e.uiDialog.offset(),a=s.left-e.document.scrollLeft(),l=s.top-e.document.scrollTop();n.height=e.uiDialog.height();n.width=e.uiDialog.width();n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(l>=0?"+":"")+l,of:e.window};e._removeClass(t(this),"ui-dialog-resizing");e._unblockFrames();e._trigger("resizeStop",i,o(r))}}).css("position",r)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget();this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),n=t.inArray(this,e);if(n!==-1){e.splice(n,1)}},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");if(!t){t=[];this.document.data("ui-dialog-instances",t)}return t},_minHeight:function(){var t=this.options;return t.height==="auto"?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");if(!t){this.uiDialog.show()}this.uiDialog.position(this.options.position);if(!t){this.uiDialog.hide()}},_setOptions:function(e){var n=this,i=false,r={};t.each(e,function(t,e){n._setOption(t,e);if(t in n.sizeRelatedOptions){i=true}if(t in n.resizableRelatedOptions){r[t]=e}});if(i){this._size();this._position()}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",r)}},_setOption:function(e,n){var i,r,s=this.uiDialog;if(e==="disabled"){return}this._super(e,n);if(e==="appendTo"){this.uiDialog.appendTo(this._appendTo())}if(e==="buttons"){this._createButtons()}if(e==="closeText"){this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()})}if(e==="draggable"){i=s.is(":data(ui-draggable)");if(i&&!n){s.draggable("destroy")}if(!i&&n){this._makeDraggable()}}if(e==="position"){this._position()}if(e==="resizable"){r=s.is(":data(ui-resizable)");if(r&&!n){s.resizable("destroy")}
355if(r&&typeof n==="string"){s.resizable("option","handles",n)}if(!r&&n!==false){this._makeResizable()}}if(e==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))}},_size:function(){var t,e,n,i=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(i.minWidth>i.width){i.width=i.minWidth}t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight();e=Math.max(0,i.minHeight-t);n=typeof i.maxHeight==="number"?Math.max(0,i.maxHeight-t):"none";if(i.height==="auto"){this.element.css({minHeight:e,maxHeight:n,height:"auto"})}else{this.element.height(Math.max(0,i.height-t))}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_allowInteraction:function(e){if(t(e.target).closest(".ui-dialog").length){return true}return!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal){return}var e=true;this._delay(function(){e=false});if(!this.document.data("ui-dialog-overlays")){this._on(this.document,{focusin:function(t){if(e){return}if(!this._allowInteraction(t)){t.preventDefault();this._trackingInstances()[0]._focusTabbable()}}})}this.overlay=t("<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){return}if(this.overlay){var t=this.document.data("ui-dialog-overlays")-1;if(!t){this._off(this.document,"focusin");this.document.removeData("ui-dialog-overlays")}else{this.document.data("ui-dialog-overlays",t)}this.overlay.remove();this.overlay=null}}});if(t.uiBackCompat!==false){t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){if(t==="dialogClass"){this.uiDialog.removeClass(this.options.dialogClass).addClass(e)}this._superApply(arguments)}})}return t.ui.dialog});
356/*!
357 * jQuery UI Sortable 1.12.1
358 * http://jqueryui.com
359 *
360 * Copyright jQuery Foundation and other contributors
361 * Released under the MIT license.
362 * http://jquery.org/license
363 */
364/*!
365 * jQuery UI Sortable 1.12.1
366 * http://jqueryui.com
367 *
368 * Copyright jQuery Foundation and other contributors
369 * Released under the MIT license.
370 * http://jquery.org/license
371 */
372(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../data","../ie","../scroll-parent","../version","../widget"],t)}else{t(jQuery)}})(function(t){return t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,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(t,e,n){return t>=e&&t<e+n},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")}
372)},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--){this.items[t].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(e,n){var i=null,r=false,s=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){return false}this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,s.widgetName+"-item")===s){i=t(this);return false}});if(t.data(e.target,s.widgetName+"-item")===s){i=t(e.target)}if(!i){return false}if(this.options.handle&&!n){t(this.options.handle,i).find("*").addBack().each(function(){if(this===e.target){r=true}});if(!r){return false}}this.currentItem=i;this._removeCurrentsFromItems();return true},_mouseStart:function(e,n,i){var r,s,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);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};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.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(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(o.containment){this._setContainment()}if(o.cursor&&o.cursor!=="auto"){s=this.document.find("body");this.storedCursor=s.css("cursor");s.css("cursor",o.cursor);this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)}if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",o.opacity)}
372if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",o.zIndex)}if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!i){for(r=this.containers.length-1;r>=0;r--){this.containers[r]._trigger("activate",e,this._uiHash(this))}}if(t.ui.ddmanager){t.ui.ddmanager.current=this}if(t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(e){var n,i,r,s,o=this.options,a=false;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+o.scrollSpeed}else if(e.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-o.scrollSpeed}if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+o.scrollSpeed}else if(e.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-o.scrollSpeed}}else{if(e.pageY-this.document.scrollTop()<o.scrollSensitivity){a=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed)}else if(this.window.height()-(e.pageY-this.document.scrollTop())<o.scrollSensitivity){a=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)}if(e.pageX-this.document.scrollLeft()<o.scrollSensitivity){a=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed)}else if(this.window.width()-(e.pageX-this.document.scrollLeft())<o.scrollSensitivity){a=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed)}}if(a!==false&&t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}for(n=this.items.length-1;n>=0;n--){i=this.items[n];r=i.item[0];s=this._intersectsWithPointer(i);if(!s){continue}if(i.instance!==this.currentContainer){continue}if(r!==this.currentItem[0]&&this.placeholder[s===1?"next":"prev"]()[0]!==r&&!t.contains(this.placeholder[0],r)&&(this.options.type==="semi-dynamic"?!t.contains(this.element[0],r):true)){this.direction=s===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(i)){this._rearrange(e,i)}else{break}this._trigger("change",e,this._uiHash());break}}this._contactContainers(e);if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)}this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(e,n){if(!e){return}if(t.ui.ddmanager&&!this.options.dropBehaviour){t.ui.ddmanager.drop(this,e)}if(this.options.revert){var i=this,r=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x"){o.left=r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)}if(!s||s==="y"){o.top=r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)}this.reverting=true;t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(e)})}else{this._clear(e,n)}return false},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}t.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){t(this.domPosition.prev).after(this.currentItem)}else{t(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);if(n){i.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))}});if(!i.length&&e.key){i.push(e.key+"=")}
372return i.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};n.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")});return i},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,i=this.positionAbs.top,r=i+this.helperProportions.height,s=t.left,o=s+t.width,a=t.top,l=a+t.height,c=this.offset.click.top,u=this.offset.click.left,h=this.options.axis==="x"||i+c>a&&i+c<l,f=this.options.axis==="y"||e+u>s&&e+u<o,d=h&&f;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]){return d}else{return s<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&a<i+this.helperProportions.height/2&&r-this.helperProportions.height/2<l}},_intersectsWithPointer:function(t){var e,n,i=this.options.axis==="x"||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),s=i&&r;if(!s){return false}e=this._getDragVerticalDirection();n=this._getDragHorizontalDirection();return this.floating?n==="right"||e==="down"?2:1:e&&(e==="down"?2:1)},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();if(this.floating&&r){return r==="right"&&n||r==="left"&&!n}else{return i&&(i==="down"&&e||i==="up"&&!e)}},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return t!==0&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return t!==0&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n,i,r,s,o=[],a=[],l=this._connectWith();if(l&&e){for(n=l.length-1;n>=0;n--){r=t(l[n],this.document[0]);for(i=r.length-1;i>=0;i--){s=t.data(r[i],this.widgetFullName);if(s&&s!==this&&!s.options.disabled){a.push([t.isFunction(s.options.items)?s.options.items.call(s.element):t(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s])}}}}a.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function c(){o.push(this)}for(n=a.length-1;n>=0;n--){a[n][0].each(c)}return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n<e.length;n++){if(e[n]===t.item[0]){return false}}return true})},_refreshItems:function(e){this.items=[];this.containers=[this];var n,i,r,s,o,a,l,c,u=this.items,h=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready){for(n=f.length-1;n>=0;n--){r=t(f[n],this.document[0]);for(i=r.length-1;i>=0;i--){s=t.data(r[i],this.widgetFullName);if(s&&s!==this&&!s.options.disabled){h.push([t.isFunction(s.options.items)?s.options.items.call(s.element[0],e,{item:this.currentItem}):t(s.options.items,s.element),s]);this.containers.push(s)}}}}for(n=h.length-1;n>=0;n--){o=h[n][1];a=h[n][0];for(i=0,c=a.length;i<c;i++){l=t(a[i]);l.data(this.widgetName+"-item",o);u.push({item:l,instance:o,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}var n,i,r,s;for(n=this.items.length-1;n>=0;n--){i=this.items[n];if(i.instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]){continue}r=this.options.toleranceElement?t(this.options.toleranceElement,i.item):i.item;if(!e){i.width=r.outerWidth();i.height=r.outerHeight()}s=r.offset();i.left=s.left;i.top=s.top}
372if(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(e){e=e||this;var n,i=e.options;if(!i.placeholder||i.placeholder.constructor===String){n=i.placeholder;i.placeholder={element:function(){var i=e.currentItem[0].nodeName.toLowerCase(),r=t("<"+i+">",e.document[0]);e._addClass(r,"ui-sortable-placeholder",n||e.currentItem[0].className)._removeClass(r,"ui-sortable-helper");if(i==="tbody"){e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(r))}else if(i==="tr"){e._createTrPlaceholder(e.currentItem,r)}else if(i==="img"){r.attr("src",e.currentItem.attr("src"))}if(!n){r.css("visibility","hidden")}return r},update:function(t,r){if(n&&!i.forcePlaceholderSize){return}
372if(!r.height()){r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10))}if(!r.width()){r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}}e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,n){var i=this;e.children().each(function(){t("<td>&#160;</td>",i.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)})},_contactContainers:function(e){var n,i,r,s,o,a,l,c,u,h,f=null,d=null;for(n=this.containers.length-1;n>=0;n--){if(t.contains(this.currentItem[0],this.containers[n].element[0])){continue}if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0])){continue}f=this.containers[n];d=n}else{if(this.containers[n].containerCache.over){this.containers[n]._trigger("out",e,this._uiHash(this));this.containers[n].containerCache.over=0}}}if(!f){return}if(this.containers.length===1){if(!this.containers[d].containerCache.over){this.containers[d]._trigger("over",e,this._uiHash(this));this.containers[d].containerCache.over=1}}else{r=1e4;s=null;u=f.floating||this._isFloating(this.currentItem);o=u?"left":"top";a=u?"width":"height";h=u?"pageX":"pageY";for(i=this.items.length-1;i>=0;i--){if(!t.contains(this.containers[d].element[0],this.items[i].item[0])){continue}if(this.items[i].item[0]===this.currentItem[0]){continue}l=this.items[i].item.offset()[o];c=false;if(e[h]-l>this.items[i][a]/2){c=true}if(Math.abs(e[h]-l)<r){r=Math.abs(e[h]-l);s=this.items[i];this.direction=c?"up":"down"}}if(!s&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[d]){if(!this.currentContainer.containerCache.over){this.containers[d]._trigger("over",e,this._uiHash());this.currentContainer.containerCache.over=1}return}s?this._rearrange(e,s,null,true):this._rearrange(e,null,this.containers[d].element,true);this._trigger("change",e,this._uiHash());this.containers[d]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[d];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[d]._trigger("over",e,this._uiHash(this));this.containers[d].containerCache.over=1}},_createHelper:function(e){var n=this.options,i=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):n.helper==="clone"?this.currentItem.clone():this.currentItem;if(!i.parents("body").length){t(n.appendTo!=="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])}if(i[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")}}if(!i[0].style.width||n.forceHelperSize){i.width(this.currentItem.width())}if(!i[0].style.height||n.forceHelperSize){i.height(this.currentItem.height())}return i},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")}if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}}if("left"in e){this.offset.click.left=e.left+this.margins.left}if("right"in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left}if("top"in e){this.offset.click.top=e.top+this.margins.top}if("bottom"in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&t.ui.ie){e={top:0,left:0}}return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{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 e,n,i,r=this.options;if(r.containment==="parent"){r.containment=this.helper[0].parentNode}if(r.containment==="document"||r.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,r.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(r.containment==="document"?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(r.containment)){e=t(r.containment)[0];n=t(r.containment).offset();i=t(e).css("overflow")!=="hidden";this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),
37210)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(i?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(i?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,n){if(!n){n=this.position}var i=e==="absolute"?1:-1,r=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,s=/(html|body)/i.test(r[0].tagName);return{top:n.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:r.scrollTop())*i,left:n.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:r.scrollLeft())*i}},_generatePosition:function(e){var n,i,r=this.options,s=e.pageX,o=e.pageY,a=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=/(html|body)/i.test(a[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){s=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){o=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){s=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){o=this.containment[3]+this.offset.click.top}}if(r.grid){n=this.originalPageY+Math.round((o-this.originalPageY)/r.grid[1])*r.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-r.grid[1]:n+r.grid[1]:n;i=this.originalPageX+Math.round((s-this.originalPageX)/r.grid[0])*r.grid[0];s=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-r.grid[0]:i+r.grid[0]:i}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(t,e,n,i){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?e.item[0]:e.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay(function(){if(r===this.counter){this.refreshPositions(!i)}})},_clear:function(t,e){this.reverting=false;var n,i=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(n in this._storedCSS){if(this._storedCSS[n]==="auto"||this._storedCSS[n]==="static"){this._storedCSS[n]=""}}this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){i.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e){i.push(function(t){this._trigger("update",t,this._uiHash())})}if(this!==this.currentContainer){if(!e){i.push(function(t){this._trigger("remove",t,this._uiHash())});i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer));i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))}}
372function r(t,e,n){return function(i){n._trigger(t,i,e._uiHash(e))}}for(n=this.containers.length-1;n>=0;n--){if(!e){i.push(r("deactivate",this,this.containers[n]))}if(this.containers[n].containerCache.over){i.push(r("out",this,this.containers[n]));this.containers[n].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!e){this._trigger("beforeStop",t,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null}if(!e){for(n=0;n<i.length;n++){i[n].call(this,t)}this._trigger("stop",t,this._uiHash())}this.fromOutside=false;return!this.cancelHelperRemoval},_trigger:function(){if(t.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})});
373/*!
374 * jQuery UI Tabs 1.12.1
375 * http://jqueryui.com
376 *
377 * Copyright jQuery Foundation and other contributors
378 * Released under the MIT license.
379 * http://jquery.org/license
380 */
381/*!
382 * jQuery UI Tabs 1.12.1
383 * http://jqueryui.com
384 *
385 * Copyright jQuery Foundation and other contributors
386 * Released under the MIT license.
387 * http://jquery.org/license
388 */
389(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../escape-selector","../keycode","../safe-active-element","../unique-id","../version","../widget"],t)}else{t(jQuery)}})(function(t){t.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:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var n,i;n=e.href.replace(t,"");i=location.href.replace(t,"");try{n=decodeURIComponent(n)}catch(r){}try{i=decodeURIComponent(i)}catch(r){}return e.hash.length>1&&n===i}}(),_create:function(){var e=this,n=this.options;this.running=false;this._addClass("ui-tabs","ui-widget ui-widget-content");this._toggleClass("ui-tabs-collapsible",null,n.collapsible);this._processTabs();n.active=this._initialActive();if(t.isArray(n.disabled)){n.disabled=t.unique(n.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()}if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(n.active)}else{this.active=t()}this._refresh();if(this.active.length){this.load(n.active)}},_initialActive:function(){var e=this.options.active,n=this.options.collapsible,i=location.hash.substring(1);if(e===null){if(i){this.tabs.each(function(n,r){if(t(r).attr("aria-controls")===i){e=n;return false}})}if(e===null){e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))}if(e===null||e===-1){e=this.tabs.length?0:false}}if(e!==false){e=this.tabs.index(this.tabs.eq(e));if(e===-1){e=n?false:0}}if(!n&&e===false&&this.anchors.length){e=0}return e},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?t():this._getPanelForTab(this.active)}},_tabKeydown:function(e){var n=t(t.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(n),r=true;if(this._handlePageNav(e)){return}switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:i++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:r=false;i--;break;case t.ui.keyCode.END:i=this.anchors.length-1;break;case t.ui.keyCode.HOME:i=0;break;case t.ui.keyCode.SPACE:e.preventDefault();clearTimeout(this.activating);this._activate(i);return;case t.ui.keyCode.ENTER:e.preventDefault();clearTimeout(this.activating);this._activate(i===this.options.active?false:i);return;default:return}e.preventDefault();clearTimeout(this.activating);i=this._focusNextTab(i,r);if(!e.ctrlKey&&!e.metaKey){n.attr("aria-selected","false");this.tabs.eq(i).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",i)},this.delay)}},_panelKeydown:function(e){if(this._handlePageNav(e)){return}if(e.ctrlKey&&e.keyCode===t.ui.keyCode.UP){e.preventDefault();this.active.trigger("focus")}},_handlePageNav:function(e){if(e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true}if(e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true}},_findNextTab:function(e,n){var i=this.tabs.length-1;function r(){if(e>i){e=0}if(e<0){e=i}return e}while(t.inArray(r(),this.options.disabled)!==-1){e=n?e+1:e-1}return e},_focusNextTab:function(t,e){t=this._findNextTab(t,e);this.tabs.eq(t).trigger("focus");return t},_setOption:function(t,e){if(t==="active"){this._activate(e);return}this._super(t,e);if(t==="collapsible"){this._toggleClass("ui-tabs-collapsible",null,e);if(!e&&this.options.active===false){this._activate(0)}}if(t==="event"){this._setupEvents(e)}if(t==="heightStyle"){this._setupHeightStyle(e)}},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,n=this.tablist.children(":has(a[href])");e.disabled=t.map(n.filter(".ui-state-disabled"),function(t){return n.index(t)});this._processTabs();if(e.active===false||!this.anchors.length){e.active=false;this.active=t()}else if(this.active.length&&!t.contains(this.tablist[0],this.active[0])
389){if(this.tabs.length===e.disabled.length){e.active=false;this.active=t()}else{this._activate(this._findNextTab(Math.max(0,e.active-1),false))}}else{e.active=this.tabs.index(this.active)}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"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0)}else{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"})}},_processTabs:function(){var e=this,n=this.tabs,i=this.anchors,r=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(e){if(t(this).is(".ui-state-disabled")){e.preventDefault()}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){if(t(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 t("a",this)[0]}).attr({role:"presentation",tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=t();this.anchors.each(function(n,i){var r,s,o,a=t(i).uniqueId().attr("id"),l=t(i).closest("li"),c=l.attr("aria-controls");if(e._isLocal(i)){r=i.hash;o=r.substring(1);s=e.element.find(e._sanitizeSelector(r))}else{o=l.attr("aria-controls")||t({}).uniqueId()[0].id;r="#"+o;s=e.element.find(r);if(!s.length){s=e._createPanel(o);s.insertAfter(e.panels[n-1]||e.tablist)}s.attr("aria-live","polite")}if(s.length){e.panels=e.panels.add(s)}if(c){l.data("ui-tabs-aria-controls",c)}l.attr({"aria-controls":o,"aria-labelledby":a});s.attr("aria-labelledby",a)});this.panels.attr("role","tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(n){this._off(n.not(this.tabs));this._off(i.not(this.anchors));this._off(r.not(this.panels))}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",true)},_setOptionDisabled:function(e){var n,i,r;if(t.isArray(e)){if(!e.length){e=false}else if(e.length===this.anchors.length){e=true}}for(r=0;i=this.tabs[r];r++){n=t(i);if(e===true||t.inArray(r,e)!==-1){n.attr("aria-disabled","true");this._addClass(n,null,"ui-state-disabled")}else{n.removeAttr("aria-disabled");this._removeClass(n,null,"ui-state-disabled")}}this.options.disabled=e;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===true)},_setupEvents:function(e){var n={};if(e){t.each(e.split(" "),function(t,e){n[e]="_eventHandler"})}this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(t){t.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(e){var n,i=this.element.parent();if(e==="fill"){n=i.height();n-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var e=t(this),i=e.css("position");if(i==="absolute"||i==="fixed"){return}n-=e.outerHeight(true)});this.element.children().not(this.panels).each(function(){n-=t(this).outerHeight(true)});this.panels.each(function(){t(this).height(Math.max(0,n-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")}else if(e==="auto"){n=0;this.panels.each(function(){n=Math.max(n,t(this).height("").height())}).height(n)}},_eventHandler:function(e){var n=this.options,i=this.active,r=t(e.currentTarget),s=r.closest("li"),o=s[0]===i[0],a=o&&n.collapsible,l=a?t():this._getPanelForTab(s),c=!i.length?t():this._getPanelForTab(i),u={oldTab:i,oldPanel:c,newTab:a?t():s,newPanel:l};e.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",e,u)===false){return}n.active=a?false:this.tabs.index(s);this.active=o?t():s;if(this.xhr){this.xhr.abort()}if(!c.length&&!l.length){t.error("jQuery UI Tabs: Mismatching fragment identifier.")}if(l.length){this.load(this.tabs.index(s),e)}this._toggle(e,u)},_toggle:function(e,n){var i=this,r=n.newPanel,s=n.oldPanel;this.running=true;function o(){i.running=false;i._trigger("activate",e,n)}function a(){i._addClass(n.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(r.length&&i.options.show){i._show(r,i.options.show,o)}else{r.show();o()}}if(s.length&&this.options.hide){this._hide(s,this.options.hide,function(){i._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active");a()})}else{this._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active");s.hide();a()}s.attr("aria-hidden","true");n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(r.length&&s.length){n.oldTab.attr("tabIndex",-1)}else if(r.length){this.tabs.filter(function(){return t(this).attr("tabIndex")===0}).attr("tabIndex",-1)}r.attr("aria-hidden","false");n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var n,i=this._findActive(e);
389if(i[0]===this.active[0]){return}if(!i.length){i=this.active}n=i.find(".ui-tabs-anchor")[0];this._eventHandler({target:n,currentTarget:n,preventDefault:t.noop})},_findActive:function(e){return e===false?t():this.tabs.eq(e)},_getIndex:function(e){if(typeof e==="string"){e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))}return e},_destroy:function(){if(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(){if(t.data(this,"ui-tabs-destroy")){t(this).remove()}else{t(this).removeAttr("role tabIndex "+"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}});this.tabs.each(function(){var e=t(this),n=e.data("ui-tabs-aria-controls");if(n){e.attr("aria-controls",n).removeData("ui-tabs-aria-controls")}else{e.removeAttr("aria-controls")}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","")}},enable:function(e){var n=this.options.disabled;if(n===false){return}if(e===undefined){n=false}else{e=this._getIndex(e);if(t.isArray(n)){n=t.map(n,function(t){return t!==e?t:null})}else{n=t.map(this.tabs,function(t,n){return n!==e?n:null})}}this._setOptionDisabled(n)},disable:function(e){var n=this.options.disabled;if(n===true){return}if(e===undefined){n=true}else{e=this._getIndex(e);if(t.inArray(e,n)!==-1){return}if(t.isArray(n)){n=t.merge([e],n).sort()}else{n=[e]}}this._setOptionDisabled(n)},load:function(e,n){e=this._getIndex(e);var i=this,r=this.tabs.eq(e),s=r.find(".ui-tabs-anchor"),o=this._getPanelForTab(r),a={tab:r,panel:o},l=function(t,e){if(e==="abort"){i.panels.stop(false,true)}i._removeClass(r,"ui-tabs-loading");o.removeAttr("aria-busy");if(t===i.xhr){delete i.xhr}};if(this._isLocal(s[0])){return}this.xhr=t.ajax(this._ajaxSettings(s,n,a));if(this.xhr&&this.xhr.statusText!=="canceled"){this._addClass(r,"ui-tabs-loading");o.attr("aria-busy","true");this.xhr.done(function(t,e,r){setTimeout(function(){o.html(t);i._trigger("load",n,a);l(r,e)},1)}).fail(function(t,e){setTimeout(function(){l(t,e)},1)})}},_ajaxSettings:function(e,n,i){var r=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,s){return r._trigger("beforeLoad",n,t.extend({jqXHR:e,ajaxSettings:s},i))}}},_getPanelForTab:function(e){var n=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}});if(t.uiBackCompat!==false){t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments);this._addClass(this.tabs,"ui-tab")}})}return t.ui.tabs});(function(t,e){"use strict";if(t.rails!==e){t.error("jquery-ujs has already been loaded!")}var n;var i=t(document);t.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return t("meta[name=csrf-token]").attr("content")}
389,csrfParam:function(){return t("meta[name=csrf-param]").attr("content")},CSRFProtection:function(t){var e=n.csrfToken();if(e)t.setRequestHeader("X-CSRF-Token",e)},refreshCSRFTokens:function(){t('form input[name="'+n.csrfParam()+'"]').val(n.csrfToken())},fire:function(e,n,i){var r=t.Event(n);e.trigger(r,i);return r.result!==false},confirm:function(t){return confirm(t)},ajax:function(e){return t.ajax(e)},href:function(t){return t[0].href},isRemote:function(t){return t.data("remote")!==e&&t.data("remote")!==false},handleRemote:function(i){var r,s,o,a,l,c;if(n.fire(i,"ajax:before")){a=i.data("with-credentials")||null;l=i.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType;if(i.is("form")){r=i.data("ujs:submit-button-formmethod")||i.attr("method");s=i.data("ujs:submit-button-formaction")||i.attr("action");o=t(i[0]).serializeArray();var u=i.data("ujs:submit-button");if(u){o.push(u);i.data("ujs:submit-button",null)}i.data("ujs:submit-button-formmethod",null);i.data("ujs:submit-button-formaction",null)}else if(i.is(n.inputChangeSelector)){r=i.data("method");s=i.data("url");o=i.serialize();if(i.data("params"))o=o+"&"+i.data("params")}else if(i.is(n.buttonClickSelector)){r=i.data("method")||"get";s=i.data("url");o=i.serialize();if(i.data("params"))o=o+"&"+i.data("params")}else{r=i.data("method");s=n.href(i);o=i.data("params")||null}c={type:r||"GET",data:o,dataType:l,beforeSend:function(t,r){if(r.dataType===e){t.setRequestHeader("accept","*/*;q=0.5, "+r.accepts.script)}if(n.fire(i,"ajax:beforeSend",[t,r])){i.trigger("ajax:send",t)}else{return false}},success:function(t,e,n){i.trigger("ajax:success",[t,e,n])},complete:function(t,e){i.trigger("ajax:complete",[t,e])},error:function(t,e,n){i.trigger("ajax:error",[t,e,n])},crossDomain:n.isCrossDomain(s)};if(a){c.xhrFields={withCredentials:a}}if(s){c.url=s}return n.ajax(c)}else{return false}},isCrossDomain:function(t){var e=document.createElement("a");e.href=location.href;var n=document.createElement("a");try{n.href=t;n.href=n.href;return!((!n.protocol||n.protocol===":")&&!n.host||e.protocol+"//"+e.host===n.protocol+"//"+n.host)}catch(i){return true}},handleMethod:function(i){var r=n.href(i),s=i.data("method"),o=i.attr("target"),a=n.csrfToken(),l=n.csrfParam(),c=t('<form method="post" action="'+r+'"></form>'),u='<input name="_method" value="'+s+'" type="hidden" />';if(l!==e&&a!==e&&!n.isCrossDomain(r)){u+='<input name="'+l+'" value="'+a+'" type="hidden" />'}if(o){c.attr("target",o)}c.hide().append(u).appendTo("body");c.submit()},formElements:function(e,n){return e.is("form")?t(e[0].elements).filter(n):e.find(n)},disableFormElements:function(e){n.formElements(e,n.disableSelector).each(function(){n.disableFormElement(t(this))})},disableFormElement:function(t){var n,i;n=t.is("button")?"html":"val";i=t.data("disable-with");if(i!==e){t.data("ujs:enable-with",t[n]());t[n](i)}t.prop("disabled",true);t.data("ujs:disabled",true)},enableFormElements:function(e){n.formElements(e,n.enableSelector).each(function(){n.enableFormElement(t(this))})},enableFormElement:function(t){var n=t.is("button")?"html":"val";if(t.data("ujs:enable-with")!==e){t[n](t.data("ujs:enable-with"));t.removeData("ujs:enable-with")}t.prop("disabled",false);t.removeData("ujs:disabled")},allowAction:function(t){var e=t.data("confirm"),i=false,r;if(!e){return true}if(n.fire(t,"confirm")){try{i=n.confirm(e)}catch(s){(console.error||console.log).call(console,s.stack||s)}r=n.fire(t,"confirm:complete",[i])}return i&&r},blankInputs:function(e,n,i){var r=t(),s,o,a,l,c=n||"input,textarea",u=e.find(c),h={};u.each(function(){s=t(this);if(s.is("input[type=radio]")){l=s.attr("name");if(!h[l]){if(e.find('input[type=radio]:checked[name="'+l+'"]').length===0){a=e.find('input[type=radio][name="'+l+'"]');r=r.add(a)}h[l]=l}}else{o=s.is("input[type=checkbox],input[type=radio]")?s.is(":checked"):!!s.val();if(o===i){r=r.add(s)}}});return r.length?r:false},nonBlankInputs:function(t,e){return n.blankInputs(t,e,true)},stopEverything:function(e){t(e.target).trigger("ujs:everythingStopped");e.stopImmediatePropagation();return false},disableElement:function(t){var i=t.data("disable-with");if(i!==e){t.data("ujs:enable-with",t.html());t.html(i)}t.bind("click.railsDisable",function(t){return n.stopEverything(t)});t.data("ujs:disabled",true)},enableElement:function(t){if(t.data("ujs:enable-with")!==e){t.html(t.data("ujs:enable-with"));t.removeData("ujs:enable-with")}t.unbind("click.railsDisable");t.removeData("ujs:disabled")}};if(n.fire(i,"rails:attachBindings")){t.ajaxPrefilter(function(t,e,
389i){if(!t.crossDomain){n.CSRFProtection(i)}});t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);if(e.data("ujs:disabled")){t.rails.enableFormElement(e)}});t(t.rails.linkDisableSelector).each(function(){var e=t(this);if(e.data("ujs:disabled")){t.rails.enableElement(e)}})});i.on("ajax:complete",n.linkDisableSelector,function(){n.enableElement(t(this))});i.on("ajax:complete",n.buttonDisableSelector,function(){n.enableFormElement(t(this))});i.on("click.rails",n.linkClickSelector,function(e){var i=t(this),r=i.data("method"),s=i.data("params"),o=e.metaKey||e.ctrlKey;if(!n.allowAction(i))return n.stopEverything(e);if(!o&&i.is(n.linkDisableSelector))n.disableElement(i);if(n.isRemote(i)){if(o&&(!r||r==="GET")&&!s){return true}var a=n.handleRemote(i);if(a===false){n.enableElement(i)}else{a.fail(function(){n.enableElement(i)})}return false}else if(r){n.handleMethod(i);return false}});i.on("click.rails",n.buttonClickSelector,function(e){var i=t(this);if(!n.allowAction(i)||!n.isRemote(i))return n.stopEverything(e);if(i.is(n.buttonDisableSelector))n.disableFormElement(i);var r=n.handleRemote(i);if(r===false){n.enableFormElement(i)}else{r.fail(function(){n.enableFormElement(i)})}return false});i.on("change.rails",n.inputChangeSelector,function(e){var i=t(this);
389if(!n.allowAction(i)||!n.isRemote(i))return n.stopEverything(e);n.handleRemote(i);return false});i.on("submit.rails",n.formSubmitSelector,function(i){var r=t(this),s=n.isRemote(r),o,a;if(!n.allowAction(r))return n.stopEverything(i);if(r.attr("novalidate")===e){if(r.data("ujs:formnovalidate-button")===e){o=n.blankInputs(r,n.requiredInputSelector,false);if(o&&n.fire(r,"ajax:aborted:required",[o])){return n.stopEverything(i)}}else{r.data("ujs:formnovalidate-button",e)}}if(s){a=n.nonBlankInputs(r,n.fileInputSelector);if(a){setTimeout(function(){n.disableFormElements(r)},13);var l=n.fire(r,"ajax:aborted:file",[a]);if(!l){setTimeout(function(){n.enableFormElements(r)},13)}return l}n.handleRemote(r);return false}else{setTimeout(function(){n.disableFormElements(r)},13)}});i.on("click.rails",n.formInputClickSelector,function(e){var i=t(this);if(!n.allowAction(i))return n.stopEverything(e);var r=i.attr("name"),s=r?{name:r,value:i.val()}:null;var o=i.closest("form");if(o.length===0){o=t("#"+i.attr("form"))}o.data("ujs:submit-button",s);o.data("ujs:formnovalidate-button",i.attr("formnovalidate"));o.data("ujs:submit-button-formaction",i.attr("formaction"));o.data("ujs:submit-button-formmethod",i.attr("formmethod"))});i.on("ajax:send.rails",n.formSubmitSelector,function(e){if(this===e.target)n.disableFormElements(t(this))});i.on("ajax:complete.rails",n.formSubmitSelector,function(e){if(this===e.target)n.enableFormElements(t(this))});t(function(){n.refreshCSRFTokens()})}})(jQuery);(function(){window.ActiveAdmin={}}).call(this);(function(){$(document).on("ready page:load turbolinks:load",function(){$(".batch_actions_selector li a").click(function(t){var e;t.stopPropagation();t.preventDefault();if(e=$(this).data("confirm")){return ActiveAdmin.modal_dialog(e,$(this).data("inputs"),function(t){return function(e){return $(t).trigger("confirm:complete",e)}}(this))}else{return $(this).trigger("confirm:complete")}});$(".batch_actions_selector li a").on("confirm:complete",function(t,e){var n;if(n=JSON.stringify(e)){$("#batch_action_inputs").val(n)}else{$("#batch_action_inputs").attr("disabled","disabled")}$("#batch_action").val($(this).data("action"));return $("#collection_selection").submit()});if($(".batch_actions_selector").length&&$(":checkbox.toggle_all").length){if($(".paginated_collection table.index_table").length){$(".paginated_collection table.index_table").tableCheckboxToggler()}else{$(".paginated_collection").checkboxToggler()}return $(document).on("change",".paginated_collection :checkbox",function(){if($(".paginated_collection :checkbox:checked").length){return $(".batch_actions_selector").each(function(){return $(this).aaDropdownMenu("enable")})}else{return $(".batch_actions_selector").each(function(){return $(this).aaDropdownMenu("disable")})}})}})}).call(this);(function(){ActiveAdmin.CheckboxToggler=function(){function t(t,e){var n;this.options=t;this.container=e;n={};this.options=$.extend(n,this.options);this._init();this._bind()}t.prototype._init=function(){if(!this.container){throw new Error("Container element not found")}else{this.$container=$(this.container)}if(!this.$container.find(".toggle_all").length){throw new Error('"toggle all" checkbox not found')}else{this.toggle_all_checkbox=this.$container.find(".toggle_all")}return this.checkboxes=this.$container.find(":checkbox").not(this.toggle_all_checkbox)};t.prototype._bind=function(){this.checkboxes.change(function(t){return function(e){return t._didChangeCheckbox(e.target)}}(this));return this.toggle_all_checkbox.change(function(t){return function(){return t._didChangeToggleAllCheckbox()}}(this))};t.prototype._didChangeCheckbox=function(t){switch(this.checkboxes.filter(":checked").length){case this.checkboxes.length-1:return this.toggle_all_checkbox.prop({checked:null});case this.checkboxes.length:return this.toggle_all_checkbox.prop({checked:true})}};t.prototype._didChangeToggleAllCheckbox=function(){var t;t=this.toggle_all_checkbox.prop("checked")?true:null;return this.checkboxes.each(function(e){return function(n,i){$(i).prop({checked:t});return e._didChangeCheckbox(i)}}(this))};t.prototype.option=function(t,e){if($.isPlainObject(t)){return this.options=$.extend(true,this.options,t)}else if(t!=null){return this.options[t]}else{return this.options[t]=e}};return t}();$.widget.bridge("checkboxToggler",ActiveAdmin.CheckboxToggler)}).call(this);(function(){ActiveAdmin.DropdownMenu=function(){function t(t,e){var n;this.options=t;this.element=e;this.$element=$(this.element);n={fadeInDuration:20,fadeOutDuration:100,onClickActionItemCallback:null};this.options=$.extend(n,this.options);this.isOpen=false;this.$menuButton=this.$element.find(".dropdown_menu_button");this.$menuList=this.$element.find(".dropdown_menu_list_wrapper");this._buildMenuList();this._bind()}t.prototype.open=function(){this.isOpen=true;this.$menuList.fadeIn(this.options.fadeInDuration);this._position();return this};t.prototype.close=function(){this.isOpen=false;this.$menuList.fadeOut(this.options.fadeOutDuration);return this};t.prototype.destroy=function(){this.$element.unbind();this.$element=null;return this};t.prototype.isDisabled=function(){return this.$menuButton.hasClass("disabled")};t.prototype.disable=function(){return this.$menuButton.addClass("disabled")};t.prototype.enable=function(){return this.$menuButton.removeClass("disabled")};t.prototype.option=function(t,e){if($.isPlainObject(t)){return this.options=$.extend(true,this.options,t)}else if(t!=null){return this.options[t]}else{return this.options[t]=e}};t.prototype._buildMenuList=function(){this.$nipple=$('<div class="dropdown_menu_nipple"></div>');this.$menuList.prepend(this.$nipple);return this.$menuList.hide()};t.prototype._bind=function(){$("body").click(function(t){return function(){if(t.isOpen){return t.close()}}}(this));return this.$menuButton.click(function(t){return function(){if(!t.isDisabled()){if
389(t.isOpen){t.close()}else{t.open()}}return false}}(this))};t.prototype._position=function(){var t,e,n,i,r,s,o,a;this.$menuList.css("top",this.$menuButton.position().top+this.$menuButton.outerHeight()+10);e=this.$menuButton.position().left;t=this.$menuButton.outerWidth()/2;n=e+t*2;s=this.$menuList.outerWidth()/2;o=this.$nipple.outerWidth()/2;a=$(window).width();i=e+t-s;r=e+t+s;if(i<0){this.$menuList.css("left",e);return this.$nipple.css("left",t-o)}else if(r>a){this.$menuList.css("right",a-n);return this.$nipple.css("right",t-o)}else{this.$menuList.css("left",i);return this.$nipple.css("left",s-o)}};return t}();$.widget.bridge("aaDropdownMenu",ActiveAdmin.DropdownMenu);$(document).on("ready page:load turbolinks:load",function(){return $(".dropdown_menu").aaDropdownMenu()})}).call(this);(function(){var t;ActiveAdmin.flash=t=function(){t.error=function(t,e){return new this(t,"error",e)};t.notice=function(t,e){return new this(t,"notice",e)};t.prototype.reference=function(){return this.reference};function t(t,e,n){this.message=t;this.type=e!=null?e:"notice";this.reference=jQuery("<div>").addClass("flash flash_"+this.type).text(this.message);jQuery(".flashes").append(this.reference);if(n!=null){this.close_after(n)}}t.prototype.close_after=function(t){return setTimeout(function(t){return function(){return t.close()}}(this),t*1e3)};t.prototype.close=function(){return this.reference.remove()};return t}()}).call(this);(function(){var t,e;$(function(){$(document).on("click","a.button.has_many_remove",function(t){var n,i;t.preventDefault();n=$(this).closest(".has_many_container");i=$(this).closest("fieldset");e(n);n.trigger("has_many_remove:before",[i,n]);i.remove();return n.trigger("has_many_remove:after",[i,n])});$(document).on("click","a.button.has_many_add",function(t){var n,i,r,s,o,a;t.preventDefault();o=$(this).closest(".has_many_container");o.trigger(n=$.Event("has_many_add:before"),[o]);if(!n.isDefaultPrevented()){s=o.data("has_many_index")||o.children("fieldset").length-1;o.data({has_many_index:++s});a=new RegExp($(this).data("placeholder"),"g");r=$(this).data("html").replace(a,s);i=$(r).insertBefore(this);e(o);return o.trigger("has_many_add:after",[i,o])}});$(document).on("change",'.has_many_container[data-sortable] :input[name$="[_destroy]"]',function(){return e($(this).closest(".has_many"))});t();return $(document).on("has_many_add:after",".has_many_container",t)});t=function(){var t;t=$(".has_many_container[data-sortable]:not(.ui-sortable)");t.sortable({items:"> fieldset",handle:"> ol > .handle",stop:e});return t.each(e)};e=function(t){var e,n;t=t instanceof jQuery?t:$(this);e=t.data("sortable");n=parseInt(t.data("sortable-start")||0,10);return t.children("fieldset").each(function(){var t,i;t=$(this).find("> ol > .input > :input[name$='[_destroy]']");i=$(this).find("> ol > .input > :input[name$='["+e+"]']");if(i.length){return i.val(t.is(":checked")?"":n++)}})}}).call(this);(function(){ActiveAdmin.modal_dialog=function(t,e,n){var i,r,s,o,a,l,c,u,h,f,d,p;o='<form id="dialog_confirm" title="'+t+'"><ul>';for(l in e){f=e[l];if(/^(datepicker|checkbox|text|number)$/.test(f)){p="input"}else if(f==="textarea"){p="textarea"}else if($.isArray(f)){u=["select","option",f,""],p=u[0],r=u[1],c=u[2],f=u[3]}else{throw new Error("Unsupported input type: {"+l+": "+f+"}")}a=f==="datepicker"?f:"";o+="<li>\n<label>"+(l.charAt(0).toUpperCase()+l.slice(1))+"</label>\n<"+p+' name="'+l+'" class="'+a+'" type="'+f+'">'+(c?function(){var t,e,n;n=[];for(t=0,e=c.length;t<e;t++){d=c[t];i=$("<"+r+"/>");if($.isArray(d)){i.text(d[0]).val(d[1])}else{i.text(d)}n.push(i.wrap("<div>").parent().html())}return n}().join(""):"")+("</"+p+">")+"</li>";h=[],p=h[0],r=h[1],c=h[2],f=h[3],a=h[4]}o+="</ul></form>";s=$(o).appendTo("body");$("body").trigger("modal_dialog:before_open",[s]);return s.dialog({modal:true,open:function(t,e){return $("body").trigger("modal_dialog:after_open",[s])},dialogClass:"active_admin_dialog",buttons:{OK:function(){n($(this).serializeObject());return $(this).dialog("close")},Cancel:function(){return $(this).dialog("close").remove()}}})}}).call(this);(function(){ActiveAdmin.PerPage=function(){function t(t,e){this.options=t;this.element=e;this.$element=$(this.element);this._init();this._bind()}t.prototype._init=function(){return this.$params=this._queryParams()};t.prototype._bind=function(){return this.$element.change(function(t){return function(){t.$params["per_page"]=t.$element.val();delete t.$params["page"];if(typeof Turbolinks!=="undefined"){return Turbolinks.visit(window.location.href.split("?")[0]+"?"+$.param(t.$params))}else{return location.search=$.param(t.$params)}}}(this))};t.prototype._queryParams=function(){var t,e,n,i;n=window.location.search.substring(1);e={};i=/([^&=]+)=([^&]*)/g;while(t=i.exec(n)){e[this._decode(t[1])]=this._decode(t[2])}return e};t.prototype._decode=function(t){return decodeURIComponent(t.replace(/\+/g,"%20"))};t.prototype.option=function(t,e){if($.isPlainObject(t)){return this.options=$.extend(true,this.options,t)}else if(t!=null){return this.options[t]}else{return this.options[t]=e}};return t}();$.widget.bridge("perPage",ActiveAdmin.PerPage);
389$(document).on("ready page:load turbolinks:load",function(){return $(".pagination_per_page select").perPage()})}).call(this);(function(){var t=function(t,n){for(var i in n){if(e.call(n,i))t[i]=n[i]}function r(){this.constructor=t}r.prototype=n.prototype;t.prototype=new r;t.__super__=n.prototype;return t},e={}.hasOwnProperty;ActiveAdmin.TableCheckboxToggler=function(e){t(n,e);function n(){return n.__super__.constructor.apply(this,arguments)}n.prototype._init=function(){return n.__super__._init.apply(this,arguments)};n.prototype._bind=function(){n.__super__._bind.apply(this,arguments);return this.$container.find("tbody td").click(function(t){return function(e){if(e.target.type!=="checkbox"){return t._didClickCell(e.target)}}}(this))};n.prototype._didChangeCheckbox=function(t){var e;n.__super__._didChangeCheckbox.apply(this,arguments);e=$(t).parents("tr");if(t.checked){return e.addClass("selected")}else{return e.removeClass("selected")}};n.prototype._didClickCell=function(t){return $(t).parent("tr").find(":checkbox").click()};return n}(ActiveAdmin.CheckboxToggler);$.widget.bridge("tableCheckboxToggler",ActiveAdmin.TableCheckboxToggler)}).call(this);(function(){$.ui.dialog.prototype._focusTabbable=function(){return this.uiDialog.focus()}}).call(this);(function(){$.fn.serializeObject=function(){var t,e,n,i,r;i={};r=this.serializeArray();for(t=0,e=r.length;t<e;t++){n=r[t];i[n.name]=n.value}return i}}).call(this);(function(){$(document).on("ready page:load turbolinks:load",function(){var t;if((t=$(".table_tools .batch_actions_selector")).length){return t.next().css({width:"calc(100% - 10px - "+t.outerWidth()+"px)",float:"right"})}})}).call(this);(function(){$(document).on("ready page:load turbolinks:load",function(){return $(document).on("focus","input.datepicker:not(.hasDatepicker)",function(){var t,e,n;e=$(this);if(e[0].type==="date"){return}t={dateFormat:"yy-mm-dd"};n=e.data("datepicker-options");return e.datepicker($.extend(t,n))})})}).call(this)
390;(function(){$(document).on("ready page:load turbolinks:load",function(){$(".clear_filters_btn").click(function(t){var e,n,i;n=window.location.search.slice(1).split("&");i=/^(q\[|q%5B|q%5b|page|commit)/;if(typeof Turbolinks!=="undefined"){Turbolinks.visit(window.location.href.split("?")[0]+"?"+function(){var t,r,s;s=[];for(t=0,r=n.length;t<r;t++){e=n[t];if(!e.match(i)){s.push(e)}}return s}().join("&"));return t.preventDefault()}else{return window.location.search=function(){var t,r,s;s=[];for(t=0,r=n.length;t<r;t++){e=n[t];if(!e.match(i)){s.push(e)}}return s}().join("&")}});$(".filter_form").submit(function(t){$(this).find(":input").filter(function(){return this.value===""}).prop("disabled",true);if(typeof Turbolinks!=="undefined"){Turbolinks.visit(window.location.href.split("?")[0]+"?"+$(this).serialize());return t.preventDefault()}});return $(".filter_form_field.select_and_search select").change(function(){return $(this).siblings("input").prop({name:"q["+this.value+"]"})})})}).call(this);(function(){$(document).on("ready page:load turbolinks:load",function(){return $("#active_admin_content .tabs").tabs()})}).call(this);
391/*
392Copyright 2012 Igor Vaynberg
393
394Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
395
396This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
397General Public License version 2 (the "GPL License"). You may choose either license to govern your
398use of this software only upon the condition that you accept all of the terms of either the Apache
399License or the GPL License.
400
401You may obtain a copy of the Apache License and the GPL License at:
402
403    http://www.apache.org/licenses/LICENSE-2.0
404    http://www.gnu.org/licenses/gpl-2.0.html
405
406Unless required by applicable law or agreed to in writing, software distributed under the
407Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
408CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
409the specific language governing permissions and limitations under the Apache License and the GPL License.
410*/
411/*
412Copyright 2012 Igor Vaynberg
413
414Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
415
416This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
417General Public License version 2 (the "GPL License"). You may choose either license to govern your
418use of this software only upon the condition that you accept all of the terms of either the Apache
419License or the GPL License.
420
421You may obtain a copy of the Apache License and the GPL License at:
422
423    http://www.apache.org/licenses/LICENSE-2.0
424    http://www.gnu.org/licenses/gpl-2.0.html
425
426Unless required by applicable law or agreed to in writing, softw
426are distributed under the
427Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
428CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
429the specific language governing permissions and limitations under the Apache License and the GPL License.
430*/
431(function(t){if(typeof t.fn.each2=="undefined"){t.extend(t.fn,{each2:function(e){var n=t([0]),i=-1,r=this.length;while(++i<r&&(n.context=n[0]=this[i])&&e.call(n[0],i,n)!==false);return this}})}})(jQuery);(function(t,e){"use strict";if(window.Select2!==e){return}var n,i,r,s,o,a={x:0,y:0},l,c,u={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(t){t=t.which?t.which:t;switch(t){case u.LEFT:case u.RIGHT:case u.UP:case u.DOWN:return true}return false},isControl:function(t){var e=t.which;switch(e){case u.SHIFT:case u.CTRL:case u.ALT:return true}if(t.metaKey)return true;return false},isFunctionKey:function(t){t=t.which?t.which:t;return t>=112&&t<=123}},h="<div class='select2-measure-scrollbar'></div>",f={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7
431a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f"
431:"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};l=t(document);s=function(){var t=1;return function(){return t++}}();function d(e){var n=t(document.createTextNode(""));e.before(n);n.before(e);n.remove()}function p(t){function e(t){return f[t]||t}return t.replace(/[^\u0000-\u007E]/g,e)}function m(t,e){var n=0,i=e.length;for(;n<i;n=n+1){if(_(t,e[n]))return n}return-1}function g(){var e=t(h);e.appendTo(document.body);var n={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};e.remove();return n}function _(t,n){if(t===n)return true;if(t===e||n===e)return false;if(t===null||n===null)return false;if(t.constructor===String)return t+""===n+"";if(n.constructor===String)return n+""===t+"";return false}function v(t,e,n){var i,r,s;if(t===null||t.length<1)return[];i=t.split(e);for(r=0,s=i.length;r<s;r=r+1)i[r]=n(i[r]);return i}function y(t){return t.outerWidth(false)-t.width()}function b(n){var i="keyup-change-value";n.on("keydown",function(){if(t.data(n,i)===e){t.data(n,i,n.val())}});n.on("keyup",function(){var r=t.data(n,i);if(r!==e&&n.val()!==r){t.removeData(n,i);n.trigger("keyup-change")}})}function x(n){n.on("mousemove",function(n){var i=a;if(i===e||i.x!==n.pageX||i.y!==n.pageY){t(n.target).trigger("mousemove-filtered",n)}})}function w(t,n,i){i=i||e;var r;return function(){var e=arguments;window.clearTimeout(r);r=window.setTimeout(function(){n.apply(i,e)},t)}}function k(t,e){var n=w(t,function(t){e.trigger("scroll-debounced",t)});e.on("scroll",function(t){if(m(t.target,e.get())>=0)n(t)})}function S(t){if(t[0]===document.activeElement)return;window.setTimeout(function(){var e=t[0],n=t.val().length,i;t.focus();var r=e.offsetWidth>0||e.offsetHeight>0;if(r&&e===document.activeElement){if(e.setSelectionRange){e.setSelectionRange(n,n)}else if(e.createTextRange){i=e.createTextRange();i.collapse(false);i.select()}}},0)}function M(e){e=t(e)[0];var n=0;var i=0;if("selectionStart"in e){n=e.selectionStart;i=e.selectionEnd-n}else if("selection"in document){e.focus();var r=document.selection.createRange();i=document.selection.createRange().text.length;r.moveStart("character",-e.value.length);n=r.text.length-i}return{offset:n,length:i}}function T(t){t.preventDefault();t.stopPropagation()}function C(t){t.preventDefault();t.stopImmediatePropagation()}function A(e){if(!o){var n=e[0].currentStyle||window.getComputedStyle(e[0],null);o=t(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"});o.attr("class","select2-sizer");t(document.body).append(o)}o.text(e.val());return o.width()}function D(e,n,i){var r,s=[],o;r=t.trim(e.attr("class"));if(r){r=""+r;t(r.split(/\s+/)).each2(function(){if(this.indexOf("select2-")===0){s.push(this)}})}r=t.trim(n.attr("class"));if(r){r=""+r;t(r.split(/\s+/)).each2(function(){if(this.indexOf("select2-")!==0){o=i(this);if(o){s.push(o)}}})}e.attr("class",s.join(" "))}function E(t,e,n,i){var r=p(t.toUpperCase()).indexOf(p(e.toUpperCase())),s=e.length;if(r<0){n.push(i(t));return}n.push(i(t.substring(0,r)));n.push("<span class='select2-match'>");n.push(i(t.substring(r,r+s)));n.push("</span>");n.push(i(t.substring(r+s,t.length)))}function N(t){var e={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})}function z(n){var i,r=null,s=n.quietMillis||100,o=n.url,a=this;return function(l){window.clearTimeout(i);i=window.setTimeout(function(){var i=n.data,s=o,c=n.transport||t.fn.select2.ajaxDefaults.transport,u={type:n.type||"GET",cac
431he:n.cache||false,jsonpCallback:n.jsonpCallback||e,dataType:n.dataType||"json"},h=t.extend({},t.fn.select2.ajaxDefaults.params,u);i=i?i.call(a,l.term,l.page,l.context):null;s=typeof s==="function"?s.call(a,l.term,l.page,l.context):s;if(r&&typeof r.abort==="function"){r.abort()}if(n.params){if(t.isFunction(n.params)){t.extend(h,n.params.call(a))}else{t.extend(h,n.params)}}t.extend(h,{url:s,dataType:n.dataType,data:i,success:function(t){var e=n.results(t,l.page,l);l.callback(e)},error:function(t,e,n){var i={hasError:true,jqXHR:t,textStatus:e,errorThrown:n};l.callback(i)}});r=c.call(a,h)},s)}}function P(e){var n=e,i,r,s=function(t){return""+t.text};if(t.isArray(n)){r=n;n={results:r}}if(t.isFunction(n)===false){r=n;n=function(){return r}}var o=n();if(o.text){s=o.text;if(!t.isFunction(s)){i=o.text;s=function(t){return t[i]}}}return function(e){var i=e.term,r={results:[]},o;if(i===""){e.callback(n());return}o=function(n,r){var a,l;n=n[0];if(n.children){a={};for(l in n){if(n.hasOwnProperty(l))a[l]=n[l]}a.children=[];t(n.children).each2(function(t,e){o(e,a.children)});if(a.children.length||e.matcher(i,s(a),n)){r.push(a)}}else{if(e.matcher(i,s(n),n)){r.push(n)}}};t(n().results).each2(function(t,e){o(e,r.results)});e.callback(r)}}function j(n){var i=t.isFunction(n);return function(r){var s=r.term,o={results:[]};var a=i?n(r):n;if(t.isArray(a)){t(a).each(function(){var t=this.text!==e,n=t?this.text:this;if(s===""||r.matcher(s,n)){o.results.push(t?this:{id:this,text:this})}});r.callback(o)}}}function I(e,n){if(t.isFunction(e))return true;if(!e)return false;if(typeof e==="string")return true;throw new Error(n+" must be a string, function, or falsy value")}function $(e,n){if(t.isFunction(e)){var i=Array.prototype.slice.call(arguments,2);return e.apply(n,i)}return e}function R(e){var n=0;t.each(e,function(t,e){if(e.children){n+=R(e.children)}else{n++}});return n}function L(t,n,i,r){var s=t,o=false,a,l,c,u,h;if(!r.createSearchChoice||!r.tokenSeparators||r.tokenSeparators.length<1)return e;while(true){l=-1;for(c=0,u=r.tokenSeparators.length;c<u;c++){h=r.tokenSeparators[c];l=t.indexOf(h);if(l>=0)break}if(l<0)break;a=t.substring(0,l);t=t.substring(l+h.length);if(a.length>0){a=r.createSearchChoice.call(this,a,n);if(a!==e&&a!==null&&r.id(a)!==e&&r.id(a)!==null){o=false;for(c=0,u=n.length;c<u;c++){if(_(r.id(a),r.id(n[c]))){o=true;break}}if(!o)i(a)}}}if(s!==t)return t}function F(){var e=this;t.each(arguments,function(t,n){e[n].remove();e[n]=null})}function O(e,n){var i=function(){};i.prototype=new e;i.prototype.constructor=i;i.prototype.parent=e.prototype;i.prototype=t.extend(i.prototype,n);return i}n=O(Object,{bind:function(t){var e=this;return function(){t.apply(e,arguments)}},init:function(n){var i,r,o=".select2-results";this.opts=n=this.prepareOpts(n);this.id=n.id;if(n.element.data("select2")!==e&&n.element.data("select2")!==null){n.element.data("select2").destroy()}this.container=this.createContainer();this.liveRegion=t(".select2-hidden-accessible");if(this.liveRegion.length==0){this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)}this.containerId="s2id_"+(n.element.attr("id")||"autogen"+s());this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);this.container.attr("title",n.element.attr("title"));this.body=t(document.body);D(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.attr("style",n.element.attr("style"));this.container.css($(n.containerCss,this.opts.element));this.container.addClass($(n.containerCssClass,this.opts.element));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",T);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass($(n.dropdownCssClass,this.opts.element));this.dropdown.data("select2",this);this.dropdown.on("click",T);this.results=i=this.container.find(o);this.search=r=this.container.find("input.select2-input");this.queryCount=0;this.resultsPage=0;this.context=null;this.initContainer();this.container.on("click",T);x(this.results);this.dropdown.on("mousemove-filtered",o,this.bind(this.highlightUnderEvent));this.dropdown.on("touchstart touchmove touchend",o,this.bind(function(t){this._touchEvent=true;this.highlightUnderEvent(t)}));this.dropdown.on("touchmove",o,this.bind(this.touchMoved));this.dropdown.on("touchstart touchend",o,this.bind(this.clearTouchMoved));this.dropdown.on("click",this.bind(function(t){if(this._touchEvent){this._touchEvent=false;this.selectHighlighted()}}));k(80,this.results);this.dropdown.on("scroll-debounced",o,this.bind(this.loadMoreIfNeeded));t(this.container).on("change",".select2-input",function(t){t.stopPropagation()});t(this.dropdown).on("change",".select2-input",function(t){t.stopPropagation()});if(t.fn.mousewheel){i.mousewheel(function(t,e,n,r){var s=i.scrollTop();if(r>0&&s-r<=0){i.scrollTop(0);T(t)}else if(r<0&&i.get(0).scrollHeight-i.scrollTop()+r<=i.height()){i.scrollTop(i.get(0).scrollHeight-i.height());T(t)}})}b(r);r.on("keyup-change input paste",this.bind(this.updateResults));r.on("focus",function(){r.addClass("select2-focused")});r.on("blur",function(){r.removeClass("select2-focused")});this.dropdown.on("mouseup",o,this.bind(function(e){if(t(e.target).closest(".select2-result-selectable").length>0){this.highlightUnderEvent(e);this.selectHighlighted(e)}}));this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(t){t.stopPropagation()});this.lastSearchTerm=e;if(t.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource()}if(n.maximumInputLength!==null){this.search.attr("maxlength",n.maximumInputLength)}var a=n.element.prop("disabled");if(a===e)a=false;this.enable(!a);var l=n.element.prop("readonly");if(l===e)l=false;this.readonly(l);c=c||g();this.autofocus=n.element.prop("autofocus");n.element.prop("autofocus",false);
431if(this.autofocus)this.focus();this.search.attr("placeholder",n.searchInputPlaceholder)},destroy:function(){var t=this.opts.element,n=t.data("select2"),i=this;this.close();if(t.length&&t[0].detachEvent&&i._sync){t.each(function(){if(i._sync){this.detachEvent("onpropertychange",i._sync)}})}if(this.propertyObserver){this.propertyObserver.disconnect();this.propertyObserver=null}this._sync=null;if(n!==e){n.container.remove();n.liveRegion.remove();n.dropdown.remove();t.removeData("select2").off(".select2");if(!t.is("input[type='hidden']")){t.show().prop("autofocus",this.autofocus||false);if(this.elementTabIndex){t.attr({tabindex:this.elementTabIndex})}else{t.removeAttr("tabindex")}t.show()}else{t.css("display","")}}F.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(t){if(t.is("option")){return{id:t.prop("value"),text:t.text(),element:t.get(),css:t.attr("class"),disabled:t.prop("disabled"),locked:_(t.attr("locked"),"locked")||_(t.data("locked"),true)}}else if(t.is("optgroup")){return{text:t.attr("label"),children:[],element:t.get(),css:t.attr("class")}}},prepareOpts:function(n){var i,r,o,a,l=this;i=n.element;if(i.get(0).tagName.toLowerCase()==="select"){this.select=r=n.element}if(r){t.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}})}n.debug=n.debug||t.fn.select2.defaults.debug;if(n.debug&&console&&console.warn){if(n.id!=null){console.warn("Select2: The `id` option has been removed in Select2 4.0.0, "+"consider renaming your `id` property or mapping the property before your data makes it to Select2. "+"You can read more at https://select2.github.io/announcements-4.0.html#changed-id")}if(n.text!=null){console.warn("Select2: The `text` option has been removed in Select2 4.0.0, "+"consider renaming your `text` property or mapping the property before your data makes it to Select2. "+"You can read more at https://select2.github.io/announcements-4.0.html#changed-id")}if(n.sortResults!=null){console.warn("Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. ")}if(n.selectOnBlur!=null){console.warn("Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0.")}if(n.ajax!=null&&n.ajax.results!=null){console.warn("Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0.")}if(n.formatNoResults!=null){console.warn("Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0.")}if(n.formatSearching!=null){console.warn("Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0.")}if(n.formatInputTooShort!=null){console.warn("Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0.")}if(n.formatInputTooLong!=null){console.warn("Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0.")}if(n.formatLoading!=null){console.warn("Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0.")}if(n.formatSelectionTooBig!=null){console.warn("Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0.")}if(n.element.data("select2Tags")){console.warn("Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.")}}if(n.element.data("tags")!=null){var c=n.element.data("tags");if(!t.isArray(c)){c=[]}n.element.data("select2Tags",c)}if(n.sorter!=null){n.sortResults=n.sorter}if(n.selectOnClose!=null){n.selectOnBlur=n.selectOnClose}if(n.ajax!=null){if(t.isFunction(n.ajax.processResults)){n.ajax.results=n.ajax.processResults}}if(n.language!=null){var u=n.language;if(t.isFunction(u.noMatches)){n.formatNoMatches=u.noMatches}if(t.isFunction(u.searching)){n.formatSearching=u.searching}if(t.isFunction(u.inputTooShort)){n.formatInputTooShort=u.inputTooShort}if(t.isFunction(u.inputTooLong)){n.formatInputTooLong=u.inputTooLong}if(t.isFunction(u.loadingMore)){n.formatLoading=u.loadingMore}if(t.isFunction(u.maximumSelected)){n.formatSelectionTooBig=u.maximumSelected}}n=t.extend({},{populateResults:function(i,r,o){var a,c=this.opts.id,u=this.liveRegion;a=function(i,r,h){var f,d,p,m,g,_,v,y,b,x;i=n.sortResults(i,r,o);var w=[];for(f=0,d=i.length;f<d;f=f+1){p=i[f];g=p.disabled===true;m=!g&&c(p)!==e;_=p.children&&p.children.length>0;v=t("<li></li>");v.addClass("select2-results-dept-"+h);v.addClass("select2-result");v.addClass(m?"select2-result-selectable":"select2-result-unselectable");if(g){v.addClass("select2-disabled")}if(_){v.addClass("select2-result-with-children")}v.addClass(l.opts.formatResultCssClass(p));v.attr("role","presentation");y=t(document.createElement("div"));y.addClass("select2-result-label");y.attr("id","select2-result-label-"+s());y.attr("role","option");x=n.formatResult(p,y,o,l.opts.escapeMarkup);if(x!==e){y.html(x);v.append(y)}if(_){b=t("<ul></ul>");b.addClass("select2-result-sub");a(p.children,b,h+1);v.append(b)}v.data("select2-data",p);w.push(v[0])}r.append(w);u.text(n.formatMatches(i.length))};a(r,i,0)}},t.fn.select2.defaults,n);if(typeof n.id!=="function"){o=n.id;n.id=function(t){return t[o]}}
431if(t.isArray(n.element.data("select2Tags"))){if("tags"in n){throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id")}n.tags=n.element.data("select2Tags")}if(r){n.query=this.bind(function(t){var n={results:[],more:false},r=t.term,s,o,a;a=function(e,n){var i;if(e.is("option")){if(t.matcher(r,e.text(),e)){n.push(l.optionToData(e))}}else if(e.is("optgroup")){i=l.optionToData(e);e.children().each2(function(t,e){a(e,i.children)});if(i.children.length>0){n.push(i)}}};s=i.children();if(this.getPlaceholder()!==e&&s.length>0){o=this.getPlaceholderOption();if(o){s=s.not(o)}}s.each2(function(t,e){a(e,n.results)});t.callback(n)});n.id=function(t){return t.id}}else{if(!("query"in n)){if("ajax"in n){a=n.element.data("ajax-url");if(a&&a.length>0){n.ajax.url=a}n.query=z.call(n.element,n.ajax)}else if("data"in n){n.query=P(n.data)}else if("tags"in n){n.query=j(n.tags);if(n.createSearchChoice===e){n.createSearchChoice=function(e){return{id:t.trim(e),text:t.trim(e)}}}if(n.initSelection===e){n.initSelection=function(e,i){var r=[];t(v(e.val(),n.separator,n.transformVal)).each(function(){var e={id:this,text:this},i=n.tags;if(t.isFunction(i))i=i();t(i).each(function(){if(_(this.id,e.id)){e=this;return false}});r.push(e)});i(r)}}}}}if(typeof n.query!=="function"){throw"query function not defined for Select2 "+n.element.attr("id")}if(n.createSearchChoicePosition==="top"){n.createSearchChoicePosition=function(t,e){t.unshift(e)}}else if(n.createSearchChoicePosition==="bottom"){n.createSearchChoicePosition=function(t,e){t.push(e)}}else if(typeof n.createSearchChoicePosition!=="function"){throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function"}return n},monitorSource:function(){var n=this.opts.element,i,r=this;n.on("change.select2",this.bind(function(t){if(this.opts.element.data("select2-change-triggered")!==true){this.initSelection()}}));this._sync=this.bind(function(){var t=n.prop("disabled");if(t===e)t=false;this.enable(!t);var i=n.prop("readonly");if(i===e)i=false;this.readonly(i);if(this.container){D(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.addClass($(this.opts.containerCssClass,this.opts.element))}if(this.dropdown){D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass($(this.opts.dropdownCssClass,this.opts.element))}});if(n.length&&n[0].attachEvent){n.each(function(){this.attachEvent("onpropertychange",r._sync)})}i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(i!==e){if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null}this.propertyObserver=new i(function(e){t.each(e,r._sync)});this.propertyObserver.observe(n.get(0),{attributes:true,subtree:false})}},triggerSelect:function(e){var n=t.Event("select2-selecting",{val:this.id(e),object:e,choice:e});this.opts.element.trigger(n);return!n.isDefaultPrevented()},triggerChange:function(e){e=e||{};e=t.extend({},e,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",true);this.opts.element.trigger(e);this.opts.element.data("select2-change-triggered",false);this.opts.element.click();if(this.opts.blurOnChange)this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===true},enableInterface:function(){var t=this._enabled&&!this._readonly,e=!t;if(t===this.enabledInterface)return false;this.container.toggleClass("select2-container-disabled",e);this.close();this.enabledInterface=t;return true},enable:function(t){if(t===e)t=true;if(this._enabled===t)return;this._enabled=t;this.opts.element.prop("disabled",!t);this.enableInterface()},disable:function(){this.enable(false)},readonly:function(t){if(t===e)t=false;if(this._readonly===t)return;this._readonly=t;this.opts.element.prop("readonly",t);this.enableInterface()},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):false},positionDropdown:function(){var e=this.dropdown,n=this.container,i=n.offset(),r=n.outerHeight(false),s=n.outerWidth(false),o=e.outerHeight(false),a=t(window),l=a.width(),u=a.height(),h=a.scrollLeft()+l,f=a.scrollTop()+u,d=i.top+r,p=i.left,m=d+o<=f,g=i.top-o>=a.scrollTop(),_=e.outerWidth(false),v=function(){return p+_<=h},y=function(){return i.left+h+n.outerWidth(false)>_},b=e.hasClass("select2-drop-above"),x,w,k,S,M;if(b){w=true;if(!g&&m){k=true;w=false}}else{w=false;if(!m&&g){k=true;w=true}}if(k){e.hide();i=this.container.offset();r=this.container.outerHeight(false);s=this.container.outerWidth(false);o=e.outerHeight(false);h=a.scrollLeft()+l;f=a.scrollTop()+u;d=i.top+r;p=i.left;_=e.outerWidth(false);e.show();this.focusSearch()}if(this.opts.dropdownAutoWidth){M=t(".select2-results",e)[0];e.addClass("select2-drop-auto-width");e.css("width","");_=e.outerWidth(false)+(M.scrollHeight===M.clientHeight?0:c.width);_>s?s=_:_=s;o=e.outerHeight(false)}else{this.container.removeClass("select2-drop-auto-width")}if(this.body.css("position")!=="static"){x=this.body.offset();d-=x.top;p-=x.left}if(!v()&&y()){p=i.left+this.container.outerWidth(false)-_}S={left:p,width:s};if(w){this.container.addClass("select2-drop-above");e.addClass("select2-drop-above");o=e.outerHeight(false);S.top=i.top-o;S.bottom="auto"}else{S.top=d;S.bottom="auto";this.container.removeClass("select2-drop-above");e.removeClass("select2-drop-above")}S=t.extend(S,$(this.opts.dropdownCss,this.opts.element));e.css(S)},shouldOpen:function(){var e;if(this.opened())return false;if(this._enabled===false||this._readonly===true)return false;e=t.Event("select2-opening");this.opts.element.trigger(e);return!e.isDefaultPrevented()},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){
432if(!this.shouldOpen())return false;this.opening();l.on("mousemove.select2Event",function(t){a.x=t.pageX;a.y=t.pageY});return true},opening:function(){var e=this.containerEventName,n="scroll."+e,i="resize."+e,r="orientationchange."+e,s;this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.clearDropdownAlignmentPreference();
432if(this.dropdown[0]!==this.body.children().last()[0]){this.dropdown.detach().appendTo(this.body)}s=t("#select2-drop-mask");if(s.length===0){s=t(document.createElement("div"));s.attr("id","select2-drop-mask").attr("class","select2-drop-mask");s.hide();s.appendTo(this.body);s.on("mousedown touchstart click",function(e){d(s);var n=t("#select2-drop"),i;if(n.length>0){i=n.data("select2");if(i.opts.selectOnBlur){i.selectHighlighted({noFocus:true})}i.close();e.preventDefault();e.stopPropagation()}})}if(this.dropdown.prev()[0]!==s[0]){this.dropdown.before(s)}t("#select2-drop").removeAttr("id");this.dropdown.attr("id","select2-drop");s.show();this.positionDropdown();this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each(function(){t(this).on(i+" "+n+" "+r,function(t){if(o.opened())o.positionDropdown()})})},close:function(){if(!this.opened())return;var e=this.containerEventName,n="scroll."+e,i="resize."+e,r="orientationchange."+e;this.container.parents().add(window).each(function(){t(this).off(n).off(i).off(r)});this.clearDropdownAlignmentPreference();t("#select2-drop-mask").hide();this.dropdown.removeAttr("id");this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();l.off("mousemove.select2Event");this.clearSearch();this.search.removeClass("select2-active");this.search.removeAttr("aria-activedescendant");this.opts.element.trigger(t.Event("select2-close"))},externalSearch:function(t){this.open();this.search.val(t);this.updateResults(false)},clearSearch:function(){},prefillNextSearchTerm:function(){if(this.search.val()!==""){return false}var t=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);if(t!==e){this.search.val(t);this.search.select();return true}return false},getMaximumSelectionSize:function(){return $(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var e=this.results,n,i,r,s,o,a,l,c;i=this.highlight();if(i<0)return;if(i==0){e.scrollTop(0);return}n=this.findHighlightableChoices().find(".select2-result-label");r=t(n[i]);c=(r.offset()||{}).top||0;s=c+r.outerHeight(true);if(i===n.length-1){l=e.find("li.select2-more-results");if(l.length>0){s=l.offset().top+l.outerHeight(true)}}o=e.offset().top+e.outerHeight(false);if(s>o){e.scrollTop(e.scrollTop()+(s-o))}a=c-e.offset().top;if(a<0&&r.css("display")!="none"){e.scrollTop(e.scrollTop()+a)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(e){var n=this.findHighlightableChoices(),i=this.highlight();while(i>-1&&i<n.length){i+=e;var r=t(n[i]);if(r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")&&!r.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(e){var n=this.findHighlightableChoices(),i,r;if(arguments.length===0){return m(n.filter(".select2-highlighted")[0],n.get())}if(e>=n.length)e=n.length-1;if(e<0)e=0;this.removeHighlight();i=t(n[e]);i.addClass("select2-highlighted");this.search.attr("aria-activedescendant",i.find(".select2-result-label").attr("id"));this.ensureHighlightVisible();this.liveRegion.text(i.text());r=i.data("select2-data");if(r){this.opts.element.trigger({type:"select2-highlight",val:this.id(r),choice:r})}},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=true},clearTouchMoved:function(){this._touchMoved=false},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(e){var n=t(e.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(n))}else if(n.length==0){this.removeHighlight()}},loadMoreIfNeeded:function(){var t=this.results,e=t.find("li.select2-more-results"),n,i=this.resultsPage+1,r=this,s=this.search.val(),o=this.context;if(e.length===0)return;n=e.offset().top-t.offset().top-t.height();if(n<=this.opts.loadMorePadding){e.addClass("select2-active");this.opts.query({element:this.opts.element,term:s,page:i,context:o,matcher:this.opts.matcher,callback:this.bind(function(n){if(!r.opened())return;r.opts.populateResults.call(this,t,n.results,{term:s,page:i,context:o});r.postprocessResults(n,false,false);
432if(n.more===true){e.detach().appendTo(t).html(r.opts.escapeMarkup($(r.opts.formatLoadMore,r.opts.element,i+1)));window.setTimeout(function(){r.loadMoreIfNeeded()},10)}else{e.remove()}r.positionDropdown();r.resultsPage=i;r.context=n.context;this.opts.element.trigger({type:"select2-loaded",items:n})})})}},tokenize:function(){},updateResults:function(n){var i=this.search,r=this.results,s=this.opts,o,a=this,l,c=i.val(),u=t.data(this.container,"select2-last-term"),h;if(n!==true&&u&&_(c,u))return;t.data(this.container,"select2-last-term",c);if(n!==true&&(this.showSearchInput===false||!this.opened())){return}function f(){i.removeClass("select2-active");a.positionDropdown();if(r.find(".select2-no-results,.select2-selection-limit,.select2-searching").length){a.liveRegion.text(r.text())}else{a.liveRegion.text(a.opts.formatMatches(r.find('.select2-result-selectable:not(".select2-selected")').length))}}function d(t){r.html(t);f()}h=++this.queryCount;var p=this.getMaximumSelectionSize();if(p>=1){o=this.data();if(t.isArray(o)&&o.length>=p&&I(s.formatSelectionTooBig,"formatSelectionTooBig")){d("<li class='select2-selection-limit'>"+$(s.formatSelectionTooBig,s.element,p)+"</li>");return}}if(i.val().length<s.minimumInputLength){if(I(s.formatInputTooShort,"formatInputTooShort")){d("<li class='select2-no-results'>"+$(s.formatInputTooShort,s.element,i.val(),s.minimumInputLength)+"</li>")}else{d("")}if(n&&this.showSearch)this.showSearch(true);return}if(s.maximumInputLength&&i.val().length>s.maximumInputLength){if(I(s.formatInputTooLong,"formatInputTooLong")){d("<li class='select2-no-results'>"+$(s.formatInputTooLong,s.element,i.val(),s.maximumInputLength)+"</li>")}else{d("")}return}if(s.formatSearching&&this.findHighlightableChoices().length===0){d("<li class='select2-searching'>"+$(s.formatSearching,s.element)+"</li>")}i.addClass("select2-active");this.removeHighlight();l=this.tokenize();if(l!=e&&l!=null){i.val(l)}this.resultsPage=1;s.query({element:s.element,term:i.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var l;if(h!=this.queryCount){return}if(!this.opened()){this.search.removeClass("select2-active");return}if(o.hasError!==e&&I(s.formatAjaxError,"formatAjaxError")){d("<li class='select2-ajax-error'>"+$(s.formatAjaxError,s.element,o.jqXHR,o.textStatus,o.errorThrown)+"</li>");return}this.context=o.context===e?null:o.context;if(this.opts.createSearchChoice&&i.val()!==""){l=this.opts.createSearchChoice.call(a,i.val(),o.results);if(l!==e&&l!==null&&a.id(l)!==e&&a.id(l)!==null){if(t(o.results).filter(function(){return _(a.id(this),a.id(l))}).length===0){this.opts.createSearchChoicePosition(o.results,l)}}}if(o.results.length===0&&I(s.formatNoMatches,"formatNoMatches")){d("<li class='select2-no-results'>"+$(s.formatNoMatches,s.element,i.val())+"</li>");if(this.showSearch){this.showSearch(i.val())}return}r.empty();a.opts.populateResults.call(this,r,o.results,{term:i.val(),page:this.resultsPage,context:null});if(o.more===true&&I(s.formatLoadMore,"formatLoadMore")){r.append("<li class='select2-more-results'>"+s.escapeMarkup($(s.formatLoadMore,s.element,this.resultsPage))+"</li>");window.setTimeout(function(){a.loadMoreIfNeeded()},10)}this.postprocessResults(o,n);f();this.opts.element.trigger({type:"select2-loaded",items:o})})})},cancel:function(){this.close()},blur:function(){if(this.opts.selectOnBlur)this.selectHighlighted({noFocus:true});this.close();this.container.removeClass("select2-container-active");if(this.search[0]===document.activeElement){this.search.blur()}this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){S(this.search)},selectHighlighted:function(t){if(this._touchMoved){this.clearTouchMoved();return}var e=this.highlight(),n=this.results.find(".select2-highlighted"),i=n.closest(".select2-result").data("select2-data");if(i){this.highlight(e);this.onSelect(i,t)}else if(t&&t.noFocus){this.close()}},getPlaceholder:function(){var t;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((t=this.getPlaceholderOption())!==e?t.text():e)},getPlaceholderOption:function(){if(this.select){var n=this.select.children("option").first();if(this.opts.placeholderOption!==e){return this.opts.placeholderOption==="first"&&n||typeof this.opts.placeholderOption==="function"&&this.opts.placeholderOption(this.select)}
432else if(t.trim(n.text())===""&&n.val()===""){return n}}},initContainerWidth:function(){function e(){var e,n,i,r,s,o;if(this.opts.width==="off"){return null}else if(this.opts.width==="element"){return this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px"}else if(this.opts.width==="copy"||this.opts.width==="resolve"){e=this.opts.element.attr("style");if(typeof e==="string"){n=e.split(";");for(r=0,s=n.length;r<s;r=r+1){o=n[r].replace(/\s/g,"");i=o.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(i!==null&&i.length>=1)return i[1]}}if(this.opts.width==="resolve"){e=this.opts.element.css("width");if(e.indexOf("%")>0)return e;return this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px"}return null}else if(t.isFunction(this.opts.width)){return this.opts.width()}else{return this.opts.width}}var n=e.call(this);if(n!==null){this.container.css("width",n)}}});i=O(n,{createContainer:function(){var e=t(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""));return e},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.focusser.prop("disabled",!this.isInterfaceEnabled())}},opening:function(){var e,n,i;if(this.opts.minimumResultsForSearch>=0){this.showSearch(true)}this.parent.opening.apply(this,arguments);if(this.showSearchInput!==false){this.search.val(this.focusser.val())}if(this.opts.shouldFocusInput(this)){this.search.focus();e=this.search.get(0);if(e.createTextRange){n=e.createTextRange();n.collapse(false);n.select()}else if(e.setSelectionRange){i=this.search.val().length;e.setSelectionRange(i,i)}}this.prefillNextSearchTerm();this.focusser.prop("disabled",true).val("");this.updateResults(true);this.opts.element.trigger(t.Event("select2-open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}},focus:function(){if(this.opened()){this.close()}else{this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}}},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.prop("disabled",false);if(this.opts.shouldFocusInput(this)){this.focusser.focus()}},destroy:function(){t("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);F.call(this,"selection","focusser")},initContainer:function(){var e,n=this.container,i=this.dropdown,r=s(),o;if(this.opts.minimumResultsForSearch<0){this.showSearch(false)}else{this.showSearch(true)}this.selection=e=n.find(".select2-choice");this.focusser=n.find(".select2-focusser");e.find(".select2-chosen").attr("id","select2-chosen-"+r);this.focusser.attr("aria-labelledby","select2-chosen-"+r);this.results.attr("id","select2-results-"+r);this.search.attr("aria-owns","select2-results-"+r);this.focusser.attr("id","s2id_autogen"+r);o=t("label[for='"+this.opts.element.attr("id")+"']");this.opts.element.on("focus.select2",this.bind(function(){this.focus()}));this.focusser.prev().text(o.text()).attr("for",this.focusser.attr("id"));var a=this.opts.element.attr("title");this.opts.element.attr("title",a||o.text());this.focusser.attr("tabindex",this.elementTabIndex);this.search.attr("id",this.focusser.attr("id")+"_search");this.search.prev().text(t("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id"));this.search.on("keydown",this.bind(function(t){if(!this.isInterfaceEnabled())return;if(229==t.keyCode)return;if(t.which===u.PAGE_UP||t.which===u.PAGE_DOWN){T(t);return}switch(t.which){case u.UP:case u.DOWN:this.moveHighlight(t.which===u.UP?-1:1);T(t);return;case u.ENTER:this.selectHighlighted();T(t);return;case u.TAB:this.selectHighlighted({noFocus:true});return;case u.ESC:this.cancel(t);T(t);return}}));this.search.on("blur",this.bind(function(t){if(document.activeElement===this.body.get(0)){window.setTimeout(this.bind(function(){if(this.opened()&&this.results&&this.results.length>1){this.search.focus()}}),0)}}));
432this.focusser.on("keydown",this.bind(function(t){if(!this.isInterfaceEnabled())return;if(t.which===u.TAB||u.isControl(t)||u.isFunctionKey(t)||t.which===u.ESC){return}if(this.opts.openOnEnter===false&&t.which===u.ENTER){T(t);return}if(t.which==u.DOWN||t.which==u.UP||t.which==u.ENTER&&this.opts.openOnEnter){if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey)return;this.open();T(t);return}if(t.which==u.DELETE||t.which==u.BACKSPACE){if(this.opts.allowClear){this.clear()}T(t);return}}));b(this.focusser);this.focusser.on("keyup-change input",this.bind(function(t){if(this.opts.minimumResultsForSearch>=0){t.stopPropagation();if(this.opened())return;this.open()}}));e.on("mousedown touchstart","abbr",this.bind(function(t){if(!this.isInterfaceEnabled()){return}this.clear();C(t);this.close();if(this.selection){this.selection.focus()}}));e.on("mousedown touchstart",this.bind(function(n){d(e);if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(t.Event("select2-focus"))}if(this.opened()){this.close()}else if(this.isInterfaceEnabled()){this.open()}T(n)}));i.on("mousedown touchstart",this.bind(function(){if(this.opts.shouldFocusInput(this)){this.search.focus()}}));e.on("focus",this.bind(function(t){T(t)}));this.focusser.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(t.Event("select2-focus"))}this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active");this.opts.element.trigger(t.Event("select2-blur"))}}));this.search.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(t.Event("select2-focus"))}this.container.addClass("select2-container-active")}));this.initContainerWidth();this.opts.element.hide();this.setPlaceholder()},clear:function(e){var n=this.selection.data("select2-data");if(n){var i=t.Event("select2-clearing");this.opts.element.trigger(i);if(i.isDefaultPrevented()){return}var r=this.getPlaceholderOption();this.opts.element.val(r?r.val():"");this.selection.find(".select2-chosen").empty();this.selection.removeData("select2-data");this.setPlaceholder();if(e!==false){this.opts.element.trigger({type:"select2-removed",val:this.id(n),choice:n});this.triggerChange({removed:n})}}},initSelection:function(){var t;if(this.isPlaceholderOptionSelected()){this.updateSelection(null);this.close();this.setPlaceholder()}else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(t){if(t!==e&&t!==null){n.updateSelection(t);n.close();n.setPlaceholder();n.lastSearchTerm=n.search.val()}})}},isPlaceholderOptionSelected:function(){var t;if(this.getPlaceholder()===e)return false;return(t=this.getPlaceholderOption())!==e&&t.prop("selected")||this.opts.element.val()===""||this.opts.element.val()===e||this.opts.element.val()===null},prepareOpts:function(){var e=this.parent.prepareOpts.apply(this,arguments),n=this;if(e.element.get(0).tagName.toLowerCase()==="select"){e.initSelection=function(t,e){var i=t.find("option").filter(function(){return this.selected&&!this.disabled});e(n.optionToData(i))}}else if("data"in e){e.initSelection=e.initSelection||function(n,i){var r=n.val();var s=null;e.query({matcher:function(t,n,i){var o=_(r,e.id(i));if(o){s=i}return o},callback:!t.isFunction(i)?t.noop:function(){i(s)}})}}return e},getPlaceholder:function(){if(this.select){if(this.getPlaceholderOption()===e){return e}}return this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var t=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&t!==e){if(this.select&&this.getPlaceholderOption()===e)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(t));this.selection.addClass("select2-default");this.container.removeClass("select2-allowclear")}},postprocessResults:function(t,e,n){var i=0,r=this,s=true;this.findHighlightableChoices().each2(function(t,e){if(_(r.id(e.data("select2-data")),r.opts.element.val())){i=t;return false}});if(n!==false){if(e===true&&i>=0){this.highlight(i)}else{this.highlight(0)}}if(e===true){var o=this.opts.minimumResultsForSearch;if(o>=0){this.showSearch(R(t.results)>=o)}}},showSearch:function(e){if(this.showSearchInput===e)return;this.showSearchInput=e;this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!e);this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!e);t(this.dropdown,this.container).toggleClass("select2-with-searchbox",e)},onSelect:function(t,e){if(!this.triggerSelect(t)){return}var n=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(t));this.updateSelection(t);this.opts.element.trigger({type:"select2-selected",val:this.id(t),choice:t});this.lastSearchTerm=this.search.val();this.close();if((!e||!e.noFocus)&&this.opts.shouldFocusInput(this)){this.focusser.focus()}if(!_(n,this.id(t))){this.triggerChange({added:t,removed:i})}},updateSelection:function(t){var n=this.selection.find(".select2-chosen"),i,r;this.selection.data("select2-data",t);n.empty();if(t!==null){i=this.opts.formatSelection(t,n,this.opts.escapeMarkup)}if(i!==e){n.append(i)}r=this.opts.formatSelectionCssClass(t,n);if(r!==e){n.addClass(r)}this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==e){this.container.addClass("select2-allowclear")}},val:function(){var t,n=false,i=null,r=this,s=this.data();if(arguments.length===0){return this.opts.element.val()}t=arguments[0];if(arguments.length>1){n=arguments[1];if(this.opts.debug&&console&&console.warn){console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. '+"The `change` event will always be triggered in 4.0.0.")}}if(this.select){if(this.opts.debug&&console&&console.warn){console.warn('Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. '+'You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.')}this.select.val(t).find("option").filter(function(){return this.selected}).each2(function(t,e){i=r.optionToData(e);return false});this.updateSelection(i);this.setPlaceholder();if(n){this.triggerChange({added:i,removed:s})}}else{if(!t&&t!==0){this.clear(n);return}if(this.opts.initSelection===e){throw new Error("cannot call val() if initSelection() is not defined")}this.opts.element.val(t);this.opts.initSelection(this.opts.element,function(t){r.opts.element.val(!t?"":r.id(t));r.updateSelection(t);r.setPlaceholder();if(n){r.triggerChange({added:t,removed:s})}})}},clearSearch:function(){this.search.val("");this.focusser.val("")},data:function(t){var n,i=false;if(arguments.length===0){n=this.selection.data("select2-data");if(n==e)n=null;return n}else{if(this.opts.debug&&console&&console.warn){console.warn('Select2: The `select2("data")` method can no longer set selected values in 4.0.0, '+"consider using the `.val()` method instead.")}if(arguments.length>1){i=arguments[1]}if(!t){this.clear(i)}else{n=this.data();this.opts.element.val(!t?"":this.id(t));this.updateSelection(t);
432if(i){this.triggerChange({added:t,removed:n})}}}}});r=O(n,{createContainer:function(){var e=t(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return e},prepareOpts:function(){var e=this.parent.prepareOpts.apply(this,arguments),n=this;if(e.element.get(0).tagName.toLowerCase()==="select"){e.initSelection=function(t,e){var i=[];t.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(t,e){i.push(n.optionToData(e))});e(i)}}else if("data"in e){e.initSelection=e.initSelection||function(n,i){var r=v(n.val(),e.separator,e.transformVal);var s=[];e.query({matcher:function(n,i,o){var a=t.grep(r,function(t){return _(t,e.id(o))}).length;if(a){s.push(o)}return a},callback:!t.isFunction(i)?t.noop:function(){var t=[];for(var n=0;n<r.length;n++){var o=r[n];for(var a=0;a<s.length;a++){var l=s[a];if(_(o,e.id(l))){t.push(l);s.splice(a,1);break}}}i(t)}})}}return e},selectChoice:function(t){var e=this.container.find(".select2-search-choice-focus");if(e.length&&t&&t[0]==e[0]){}else{if(e.length){this.opts.element.trigger("choice-deselected",e)}e.removeClass("select2-search-choice-focus");if(t&&t.length){this.close();t.addClass("select2-search-choice-focus");this.opts.element.trigger("choice-selected",t)}}},destroy:function(){t("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments);F.call(this,"searchContainer","selection")},initContainer:function(){var e=".select2-choices",n;this.searchContainer=this.container.find(".select2-search-field");this.selection=n=this.container.find(e);var i=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(e){i.search[0].focus();i.selectChoice(t(this))});this.search.attr("id","s2id_autogen"+s());this.search.prev().text(t("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id"));this.opts.element.on("focus.select2",this.bind(function(){this.focus()}));this.search.on("input paste",this.bind(function(){if(this.search.attr("placeholder")&&this.search.val().length==0)return;if(!this.isInterfaceEnabled())return;if(!this.opened()){this.open()}}));this.search.attr("tabindex",this.elementTabIndex);this.keydowns=0;this.search.on("keydown",this.bind(function(t){if(!this.isInterfaceEnabled())return;++this.keydowns;var e=n.find(".select2-search-choice-focus");var i=e.prev(".select2-search-choice:not(.select2-locked)");var r=e.next(".select2-search-choice:not(.select2-locked)");var s=M(this.search);if(e.length&&(t.which==u.LEFT||t.which==u.RIGHT||t.which==u.BACKSPACE||t.which==u.DELETE||t.which==u.ENTER)){var o=e;if(t.which==u.LEFT&&i.length){o=i}else if(t.which==u.RIGHT){o=r.length?r:null}else if(t.which===u.BACKSPACE){if(this.unselect(e.first())){this.search.width(10);o=i.length?i:r}}else if(t.which==u.DELETE){if(this.unselect(e.first())){this.search.width(10);o=r.length?r:null}}else if(t.which==u.ENTER){o=null}this.selectChoice(o);T(t);if(!o||!o.length){this.open()}return}else if((t.which===u.BACKSPACE&&this.keydowns==1||t.which==u.LEFT)&&(s.offset==0&&!s.length)){this.selectChoice(n.find(".select2-search-choice:not(.select2-locked)").last());T(t);return}else{this.selectChoice(null)}if(this.opened()){switch(t.which){case u.UP:case u.DOWN:this.moveHighlight(t.which===u.UP?-1:1);T(t);return;case u.ENTER:this.selectHighlighted();T(t);return;case u.TAB:this.selectHighlighted({noFocus:true});this.close();return;case u.ESC:this.cancel(t);T(t);return}}if(t.which===u.TAB||u.isControl(t)||u.isFunctionKey(t)||t.which===u.BACKSPACE||t.which===u.ESC){return}if(t.which===u.ENTER){if(this.opts.openOnEnter===false){return}else if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey){return}}this.open();if(t.which===u.PAGE_UP||t.which===u.PAGE_DOWN){T(t)}if(t.which===u.ENTER){T(t)}}));this.search.on("keyup",this.bind(function(t){this.keydowns=0;this.resizeSearch()}));this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.selectChoice(null);if(!this.opened())this.clearSearch();e.stopImmediatePropagation();this.opts.element.trigger(t.Event("select2-blur"))}));this.container.on("click",e,this.bind(function(e){if(!this.isInterfaceEnabled())return;if(t(e.target).closest(".select2-search-choice").length>0){return}this.selectChoice(null);this.clearPlaceholder();if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(t.Event("select2-focus"))}this.open();this.focusSearch();e.preventDefault()}));this.container.on("focus",e,this.bind(function(){if(!this.isInterfaceEnabled())return;if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(t.Event("select2-focus"))}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder()}));this.initContainerWidth();this.opts.element.hide();this.clearSearch()},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.search.prop("disabled",!this.isInterfaceEnabled())}},initSelection:function(){var t;if(this.opts.element.val()===""&&this.opts.element.text()===""){this.updateSelection([]);this.close();this.clearSearch()}if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(t){if(t!==e&&t!==null){n.updateSelection(t);n.close();n.clearSearch()}})}},clearSearch:function(){var t=this.getPlaceholder(),n=this.getMaxSearchWidth();if(t!==e&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(t).addClass("select2-default");this.search.width(n>0?n:this.container.css("width"))}else{this.search.val("").width(10)}},clearPlaceholder:function(){if(this.search.hasClass("select2-default")){this.search.val("").removeClass("select2-default")}},opening:function(){this.clearPlaceholder();this.resizeSearch();this.parent.opening.apply(this,arguments);this.focusSearch();this.prefillNextSearchTerm();this.updateResults(true);if(this.opts.shouldFocusInput(this)){this.search.focus()}this.opts.element.trigger(t.Event("select2-open"))},close:function(){if(!this.opened())return;this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(e){var n={},i=[],r=this;t(e).each(function(){if(!(r.id(this)in n)){n[r.id(this)]=0;i.push(this)}});this.selection.find(".select2-search-choice").remove();this.addSelectedChoice(i);r.postprocessResults()},tokenize:function(){var t=this.search.val();t=this.opts.tokenizer.call(this,t,this.data(),this.bind(this.onSelect),this.opts);if(t!=null&&t!=e){this.search.val(t);if(t.length>0){this.open()}}},onSelect:function(t,e){if(!this.triggerSelect(t)||t.text===""){return}this.addSelectedChoice(t);this.opts.element.trigger({type:"selected",val:this.id(t),choice:t});this.lastSearchTerm=this.search.val();this.clearSearch();this.updateResults();if(this.select||!this.opts.closeOnSelect)this.postprocessResults(t,false,this.opts.closeOnSelect===true);if(this.opts.closeOnSelect){this.close();this.search.width(10)}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch();if(this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()){this.updateResults(true)}else{if(this.prefillNextSearchTerm()){this.updateResults()}}this.positionDropdown()}else{this.close();this.search.width(10)}}this.triggerChange({added:t});if(!e||!e.noFocus)this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(e){var n=this.getVal(),i=this;t(e).each(function(){n.push(i.createChoice(this))});this.setVal(n)},createChoice:function(n){var i=!n.locked,r=t("<li class='select2-search-choice'>"+"    <div></div>"+"    <a href='#' class='select2-search-choice-close' tabindex='-1'></a>"+"</li>"),s=t("<li class='select2-search-choice select2-locked'>"+"<div></div>"+"</li>");var o=i?r:s,a=this.id(n),l,c;l=this.opts.formatSelection(n,o.find("div"),this.opts.escapeMarkup);if(l!=e){o.find("div").replaceWith(t("<div></div>").html(l))}c=this.opts.formatSelectionCssClass(n,o.find("div"));if(c!=e){o.addClass(c)}if(i){o.find(".select2-search-choice-close").on("mousedown",T).on("click dblclick",this.bind(function(e){if(!this.isInterfaceEnabled())return;this.unselect(t(e.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");T(e);this.close();this.focusSearch()})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled())return;this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active")}))}o.data("select2-data",n);o.insertBefore(this.searchContainer);return a},unselect:function(e){var n=this.getVal(),i,r;e=e.closest(".select2-search-choice");
432if(e.length===0){throw"Invalid argument: "+e+". Must be .select2-search-choice"}i=e.data("select2-data");if(!i){return}var s=t.Event("select2-removing");s.val=this.id(i);s.choice=i;this.opts.element.trigger(s);if(s.isDefaultPrevented()){return false}while((r=m(this.id(i),n))>=0){n.splice(r,1);this.setVal(n);if(this.select)this.postprocessResults()}e.remove();this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i});this.triggerChange({removed:i});return true},postprocessResults:function(t,e,n){var i=this.getVal(),r=this.results.find(".select2-result"),s=this.results.find(".select2-result-with-children"),o=this;r.each2(function(t,e){var n=o.id(e.data("select2-data"));if(m(n,i)>=0){e.addClass("select2-selected");e.find(".select2-result-selectable").addClass("select2-selected")}});s.each2(function(t,e){if(!e.is(".select2-result-selectable")&&e.find(".select2-result-selectable:not(.select2-selected)").length===0){e.addClass("select2-selected")}});if(this.highlight()==-1&&n!==false&&this.opts.closeOnSelect===true){o.highlight(0)}if(!this.opts.createSearchChoice&&!r.filter(".select2-result:not(.select2-selected)").length>0){if(!t||t&&!t.more&&this.results.find(".select2-no-results").length===0){if(I(o.opts.formatNoMatches,"formatNoMatches")){this.results.append("<li class='select2-no-results'>"+$(o.opts.formatNoMatches,o.opts.element,o.search.val())+"</li>")}}}},getMaxSearchWidth:function(){return this.selection.width()-y(this.search)},resizeSearch:function(){var t,e,n,i,r,s=y(this.search);t=A(this.search)+10;e=this.search.offset().left;n=this.selection.width();i=this.selection.offset().left;r=n-(e-i)-s;if(r<t){r=n-s}if(r<40){r=n-s}if(r<=0){r=t}this.search.width(Math.floor(r))},getVal:function(){var t;if(this.select){t=this.select.val();return t===null?[]:t}else{t=this.opts.element.val();return v(t,this.opts.separator,this.opts.transformVal)}},setVal:function(e){if(this.select){this.select.val(e)}else{var n=[],i={};t(e).each(function(){
433if(!(this in i)){n.push(this);i[this]=0}});this.opts.element.val(n.length===0?"":n.join(this.opts.separator))}},buildChangeDetails:function(t,e){var e=e.slice(0),t=t.slice(0);for(var n=0;n<e.length;n++){for(var i=0;i<t.length;i++){if(_(this.opts.id(e[n]),this.opts.id(t[i]))){e.splice(n,1);n--;t.splice(i,1);break}}}return{added:e,removed:t}},val:function(n,i){var r,s=this;if(arguments.length===0){return this.getVal()}r=this.data();if(!r.length)r=[];if(!n&&n!==0){this.opts.element.val("");this.updateSelection([]);this.clearSearch();if(i){this.triggerChange({added:this.data(),removed:r})}return}this.setVal(n);if(this.select){this.opts.initSelection(this.select,this.bind(this.updateSelection));if(i){this.triggerChange(this.buildChangeDetails(r,this.data()))}}else{if(this.opts.initSelection===e){throw new Error("val() cannot be called if initSelection() is not defined")}this.opts.initSelection(this.opts.element,function(e){var n=t.map(e,s.id);s.setVal(n);s.updateSelection(e);s.clearSearch();if(i){s.triggerChange(s.buildChangeDetails(r,s.data()))}})}this.clearSearch()},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.")}this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var e=[],n=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){e.push(n.opts.id(t(this).data("select2-data")))});this.setVal(e);this.triggerChange()},data:function(e,n){var i=this,r,s;if(arguments.length===0){return this.selection.children(".select2-search-choice").map(function(){return t(this).data("select2-data")}).get()}else{s=this.data();if(!e){e=[]}r=t.map(e,function(t){return i.opts.id(t)});this.setVal(r);this.updateSelection(e);this.clearSearch();if(n){this.triggerChange(this.buildChangeDetails(s,this.data()))}}}});t.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),i,r,s,o,a,l=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],c=["opened","is
433Focused","container","dropdown"],u=["val","data"],h={search:"externalSearch"};this.each(function(){if(n.length===0||typeof n[0]==="object"){i=n.length===0?{}:t.extend({},n[0]);i.element=t(this);if(i.element.get(0).tagName.toLowerCase()==="select"){a=i.element.prop("multiple")}else{a=i.multiple||false;if("tags"in i){i.multiple=a=true}}r=a?new window.Select2["class"].multi:new window.Select2["class"].single;r.init(i)}else if(typeof n[0]==="string"){if(m(n[0],l)<0){throw"Unknown method: "+n[0]}o=e;r=t(this).data("select2");if(r===e)return;s=n[0];if(s==="container"){o=r.container}else if(s==="dropdown"){o=r.dropdown}else{if(h[s])s=h[s];o=r[s].apply(r,n.slice(1))}if(m(n[0],c)>=0||m(n[0],u)>=0&&n.length==1){return false}}else{throw"Invalid arguments to select2 plugin: "+n}});return o===e?this:o};t.fn.select2.defaults={debug:false,width:"copy",loadMorePadding:0,closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(t,e,n,i){var r=[];E(this.text(t),n.term,r,i);return r.join("")},transformVal:function(e){return t.trim(e)},formatSelection:function(t,n,i){return t?i(this.text(t)):e},sortResults:function(t,e,n){return t},formatResultCssClass:function(t){return t.css},formatSelectionCssClass:function(t,n){return e},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(t){return t==e?null:t.id},text:function(e){if(e&&this.data&&this.data.text){if(t.isFunction(this.data.text)){return this.data.text(e)}else{return e[this.data.text]}}else{return e.text}},matcher:function(t,e){return p(""+e).toUpperCase().indexOf(p(""+t).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:L,escapeMarkup:N,blurOnChange:false,selectOnBlur:false,adaptContainerCssClass:function(t){return t},adaptDropdownCssClass:function(t){return null},nextSearchTerm:function(t,n){return e},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(t){var e="ontouchstart"in window||navigator.msMaxTouchPoints>0;if(!e){return true}if(t.opts.minimumResultsForSearch<0){return false}return true}};t.fn.select2.locales=[];t.fn.select2.locales["en"]={formatMatches:function(t){if(t===1){return"One result is available, press enter to select it."}return t+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(t,e,n){return"Loading failed"},formatInputTooShort:function(t,e){var n=e-t.length;return"Please enter "+n+" or more character"+(n==1?"":"s")},formatInputTooLong:function(t,e){var n=t.length-e;return"Please delete "+n+" character"+(n==1?"":"s")},formatSelectionTooBig:function(t){return"You can only select "+t+" item"+(t==1?"":"s")},formatLoadMore:function(t){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}};t.extend(t.fn.select2.defaults,t.fn.select2.locales["en"]);t.fn.select2.ajaxDefaults={transport:t.ajax,params:{type:"GET",cache:false,dataType:"json"}};window.Select2={query:{ajax:z,local:P,tags:j},util:{debounce:w,markMatch:E,escapeMarkup:N,stripDiacritics:p},"class":{abstract:n,single:i,multi:r}}})(jQuery);(function(){var t;t=void 0;this.load_marvin_instance=function(t){return function(t){var e;e=void 0;return ChemicalizeMarvinJs.createEditor(t).then(function(t){return t},function(t){alert("Loading of the sketcher failed"+t);return void 0})}}(this);this.import_structure=function(t){return function(t,e){if(e.match(/M\s+END/)){return t.importStructure("mol",e)}else{return t.importStructure("smiles",e)}}}(this);$(function(){return $(".moldbi-search a.example-mol").click(function(){var e;e=$($(this).data("example")).val();return t.then(function(t){return t.importStructure("mol",e)})})});$(function(){if($(".moldbi-search")){return $("input[name='search_type']").change(function(){if($(this).val()==="similarity"){return $("#moldbi-similarity-option").fadeIn()}else{return $("#moldbi-similarity-option").fadeOut()}})}});window.initialize_sketch=function(){var t,e;if($("#moldbi-new-sketch").length){t=$("#moldbi-new-sketch").data("format")||"mol";e=load_marvin_instance("#moldbi-new-sketch");return e.then(function(e){if($("#moldbi-structure-input").text().length>0){import_structure(e,$("#moldbi-structure-input").text());$("#moldbi-structure-input").text("")}return e.on("molchange",function(){return e.isEmpty().then(function(n){if(n===true){return $("#moldbi-structure-input").text("").trigger("change")}else{return e.exportStructure(t).then(function(t){return $("#moldbi-structure-input").text(t).trigger("change")},function(t){return alert("Molecule export failed:"+t)})}},function(t){return alert("Empty canvas check failed:"+t)})})})}};window.initialize_draw=function(){var e,n;if($("#moldbi-new-draw").length){e=$("#moldbi-new-draw").data("format")||"smiles";n=load_marvin_instance("#moldbi-new-draw");t=n;return t.then(function(t){if($("#moldbi-structure-input").text().length>0){import_structure(t,$("#moldbi-structure-input").text())}return t.on("molchange",function(){return t.isEmpty().then(function(n){if(n===true){return $("#moldbi-structure-input").text("")}else{return t.exportStructure(e).then(function(t){return $("#moldbi-structure-input").text(t).trigger("change")},function(t){return alert("Molecule export failed:"+t)})}},function(t){return alert("Empty canvas check failed:"+t)})})})}};$(function(){initialize_sketch();return initialize_draw()});$(function(){if($(".moldbi-search").length>0){return $(".pager a").click(function(){$(".moldbi-search").attr("action",$(this).attr("href"));$(".moldbi-search").submit();return false})}});$(function(){if($(".classyfire-taxnode").length){return $(".classyfire-taxnode").tooltip()}})}).call(this);(function(){$(function(){return $(".remote-selector").each(function(){return add_remote_autocomplete($(this))})});$(function(){return $(".has_many_container").on("has_many_add:after",function(t,e){return add_remote_autocomplete($(e).find(".remote-selector"))})});this.add_remote_autocomplete=function(t){if(!t.length){return}return t.select2({placeholder:$(this).attr("placeholder"),minimumInputLength:t.data("min-length")||3,ajax:{quietMillis:100,url:function(){return $(this).data("source")+".json"},dataType:"json",data:function(t,e){return{q:t}},results:function(t,e){return{results:$.map(t,function(t){return{text:t.label,id:t.id}})}}},initSelection:function(t,e){var n,i;i=$(t).val();if(i!==""){n={id:i,text:$(t).data("label")};return e(n)}}})}}).call(this);(function(){}).call(this);(function(){}).call(this);(function(){$(function(){return $(".carbon-preds-example-loader").click(function(t){var e,n;n=$(this).data("smiles");e=document.getElementsByTagName("iframe")[0];load_marvin_instance("#moldbi-new-draw").then(function(t){t.on("molchange",function(){return t.isEmpty().then(function(e){if(e===true){return $("#moldbi-structure-input").text("").trigger("change")}else{return t.exportStructure("smiles").then(function(t){return $("#moldbi-structure-input").text(t).trigger("change")},function(t){return alert("Molecule export failed:"+t)})}},function(t){return alert("Empty canvas check failed:"+t)})});t.importStructure("smiles",n);return e.remove()});$("#carbonpred_nucleus").val("13C").change();return $("#carbonpred_chemical_shift_reference").val("TMS").change()})});$(function(){if($("#new_carbonpred").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for prediction.")}})}})}).call(this);(function(){$(function(){if($("#new_chemical_shift_submission").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for deposition.")}})}})}).call(this);(function(){}).call(this);
434// https://d3js.org v7.1.1 Copyright 2010-2021 Mike Bostock
435!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).d3v7=t.d3||{})}(this,function(t){"use strict";function e(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function n(t){let n=t,i=t,r=t;function s(t,e,n=0,s=t.length){if(n<s){if(0!==i(e,e))return s;do{const i=n+s>>>1;r(t[i],e)<0?n=i+1:s=i}while(n<s)}return n}return 2!==t.length&&(n=((e,n)=>t(e)-n),i=e,r=((n,i)=>
435e(t(n),i))),{left:s,center:function(t,e,i=0,r=t.length){const o=s(t,e,i,r-1);return o>i&&n(t[o-1],e)>-n(t[o],e)?o-1:o},right:function(t,e,n=0,s=t.length){if(n<s){if(0!==i(e,e))return s;do{const i=n+s>>>1;r(t[i],e)<=0?n=i+1:s=i}while(n<s)}return n}}}function i(t){return null===t?NaN:+t}const r=n(e),s=r.right,o=r.left,a=n(i).center;var l=s;function c(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(r=+r)>=r&&++n}return n}function u(t){return 0|t.length}function h(t){return!(t>0)}function f(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function d(t,e){let n,i=0,r=0,s=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-r,r+=n/++i,s+=n*(e-r));else{let o=-1;for(let a of t)null!=(a=e(a,++o,t))&&(a=+a)>=a&&(n=a-r,r+=n/++i,s+=n*(a-r))}if(i>1)return s/(i-1)}function p(t,e){const n=d(t,e);return n?Math.sqrt(n):n}function m(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(void 0===n?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class g{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],s=t+r,o=Math.abs(t)<Math.abs(r)?t-(s-r):r-(s-t);o&&(e[n++]=o),t=s}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,s=0;if(r>0){for(s=t[--r];r>0&&(e=s,n=t[--r],s=e+n,i=n-(s-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=s+n,n==e-s&&(s=e))}return s}}class _ extends Map{constructor(t,e=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(y(this,t))}has(t){return super.has(y(this,t))}set(t,e){return super.set(b(this,t),e)}"delete"(t){return super["delete"](x(this,t))}}class v extends Set{constructor(t,e=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(y(this,t))}add(t){return super.add(b(this,t))}"delete"(t){return super["delete"](x(this,t))}}function y({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function b({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function x({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t["delete"](i)),n}function w(t){return null!==t&&"object"==typeof t?t.valueOf():t}function k(t){return t}function S(t,...e){return E(t,k,k,e)}function M(t,...e){return E(t,Array.from,k,e)}function T(t,e){for(let n=1,i=e.length;n<i;++n)t=t.flatMap(t=>t.pop().map(([e,n])=>[...t,e,n]));return t}function C(t,e,...n){return E(t,k,e,n)}function A(t,e,...n){return E(t,Array.from,e,n)}function D(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function E(t,e,n,i){return function r(t,s){if(s>=i.length)return n(t);const o=new _,a=i[s++];let l=-1;for(const e of t){const n=a(e,++l,t),i=o.get(n);i?i.push(e):o.set(n,[e])}for(const[t,e]of o)o.set(t,r(e,s));return e(o)}(t,0)}function N(t,e){return Array.from(e,e=>t[e])}function z(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const i=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),i.sort((t,n)=>{for(const i of e){const e=j(i[t],i[n]);if(e)return e}})):(n=t.map(n),i.sort((t,e)=>j(n[t],n[e]))),N(t,i)}return t.sort(P(n))}function P(t=e){if(t===e)return j;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||0===i?i:(0===t(n,n))-(0===t(e,e))}}function j(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var I=Array.prototype.slice;function $(t){return()=>t}var R=Math.sqrt(50),L=Math.sqrt(10),F=Math.sqrt(2);function O(t,e,n){var i,r,s,o,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(o=H(t,e,n))||!isFinite(o))return[];if(o>0){let n=Math.round(t/o),i=Math.round(e/o);for(n*o<t&&++n,i*o>e&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)*o}else{o=-o;let n=Math.round(t*o),i=Math.round(e*o);for(n/o<t&&++n,i/o>e&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)/o}return i&&s.reverse(),s}
vendor: 10,409 bytes, line 435
435function H(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=R?10:s>=L?5:s>=F?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=R?10:s>=L?5:s>=F?2:1)}function V(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=R?r*=10:s>=L?r*=5:s>=F&&(r*=2),e<t?-r:r}function q(t,e,n){let i;for(;;){const r=H(t,e,n);if(r===i||0===r||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function B(t){return Math.ceil(Math.log(c(t))/Math.LN2)+1}function U(){var t=k,e=m,n=B;function i(i){Array.isArray(i)||(i=Array.from(i));var r,s,o=i.length,a=new Array(o);for(r=0;r<o;++r)a[r]=t(i[r],r,i);var c=e(a),u=c[0],h=c[1],f=n(a,u,h);if(!Array.isArray(f)){const t=h,n=+f;if(e===m&&([u,h]=q(u,h,n)),(f=O(u,h,n))[f.length-1]>=h)if(t>=h&&e===m){const t=H(u,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else f.pop()}for(var d=f.length;f[0]<=u;)f.shift(),--d;for(;f[d-1]>h;)f.pop(),--d;var p,g=new Array(d+1);for(r=0;r<=d;++r)(p=g[r]=[]).x0=r>0?f[r-1]:u,p.x1=r<d?f[r]:h;for(r=0;r<o;++r)null!=(s=a[r])&&u<=s&&s<=h&&g[l(f,s,0,d)].push(i[r]);return g}return i.value=function(e){return arguments.length?(t="function"==typeof e?e:$(e),i):t},i.domain=function(t){return arguments.length?(e="function"==typeof t?t:$([t[0],t[1]]),i):e},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?$(I.call(t)):$(t),i):n},i}function W(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Y(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function X(t,e,n=0,i=t.length-1,r){for(r=void 0===r?j:P(r);i>n;){if(i-n>600){const s=i-n+1,o=e-n+1,a=Math.log(s),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);X(t,e,Math.max(n,Math.floor(e-o*l/s+c)),Math.min(i,Math.floor(e+(s-o)*l/s+c)),r)}const s=t[e];let o=n,a=i;for(J(t,n,e),r(t[i],s)>0&&J(t,n,i);o<a;){for(J(t,o,a),++o,--a;r(t[o],s)<0;)++o;for(;r(t[a],s)>0;)--a}0===r(t[n],s)?J(t,n,a):(++a,J(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function J(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function G(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&(yield i)}}(t,n)),i=t.length){if((e=+e)<=0||i<2)return Y(t);if(e>=1)return W(t);var i,r=(i-1)*e,s=Math.floor(r),o=W(X(t,s).subarray(0,s+1));return o+(Y(t.subarray(s+1))-o)*(r-s)}}function K(t,e,n=i){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,s=(r-1)*e,o=Math.floor(s),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(s-o)}}function Z(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,i=r);else for(let s of t)null!=(s=e(s,++r,t))&&(n<s||void 0===n&&s>=s)&&(n=s,i=r);return i}function Q(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function tt(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,i=r);else for(let s of t)null!=(s=e(s,++r,t))&&(n>s||void 0===n&&s>=s)&&(n=s,i=r);return i}function et(t,e){return[t,e]}function nt(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i<r;)s[i]=t+i*n;return s}function it(t,n=e){if(1===n.length)return tt(t,n);let i,r=-1,s=-1;for(const e of t)++s,(r<0?0===n(e,e):n(e,i)<0)&&(i=e,r=s);return r}var rt=st(Math.random);function st(t){return function(e,n=0,i=e.length){let r=i-(n=+n);for(;r;){const i=t()*r--|0,s=e[r+n];e[r+n]=e[i+n],e[i+n]=s}return e}}function ot(t){if(!(r=t.length))return[];for(var e=-1,n=Y(t,at),i=new Array(n);++e<n;)for(var r,s=-1,o=i[e]=new Array(r);++s<r;)o[s]=t[s][e];return i}function at(t){return t.length}function lt(t){return t instanceof v?t:new v(t)}function ct(t,e){const n=t[Symbol.iterator](),i=new Set;for(const t of e){const e=ut(t);if(i.has(e))continue;let r,s;for(;({value:r,done:s}=n.next());){if(s)return!1;const t=ut(r);if(i.add(t),Object.is(e,t))break}}return!0}function ut(t){return null!==t&&"object"==typeof t?t.valueOf():t}function ht(t){return t}var ft=1e-6;function dt(t){return"translate("+t+",0)"}function pt(t){return"translate(0,"+t+")"}function mt(t){return e=>+t(e)}function gt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function _t(){return!this.__axis}function vt(t,e){var n=[],i=null,r=null,s=6,o=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?dt:pt;function f(f){var d=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,p=null==r?e.tickFormat?e.tickFormat.apply(e,n):ht:r,m=Math.max(s,0)+a,g=e.range(),_=+g[0]+l,v=+g[g.length-1]+l,y=(e.bandwidth?gt:mt)(e.copy(),l),b=f.selection?f.selection():f,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(d,e).order(),k=w.exit(),S=w.enter().append("g").attr("class","tick"),M=w.select("line"),T=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(S),M=M.merge(S.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),T=T.merge(S.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==b&&(x=x.transition(f),w=w.transition(f),M=M.transition(f),T=T.transition(f),k=k.transition(f).attr("opacity",ft).attr("transform",function(t){return isFinite(t=y(t))?h(t+l):this.getAttribute("transform")}),S.attr("opacity",ft).attr("transform",function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:y(t))+l)})),k.remove(),x.attr("d",4===t||2===t?o?"M"+c*o+","+_+"H"+l+"V"+v+"H"+c*o:"M"+l+","+_+"V"+v:o?"M"+_+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+_+","+l+"H"+v),w.attr("opacity",1).attr("transform",function(t){return h(y(t)+l)}),M.attr(u+"2",c*s),T.attr(u,c*m).text(p),b.filter(_t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each(function(){this.__axis=y})}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),f):i&&i.slice()},f.tickFormat=function(t){return arguments.length?(r=t,f):r},f.tickSize=function(t){return arguments.length?(s=o=+t,f):s},f.tickSizeInner=function(t){return arguments.length?(s=+t,f):s},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(a=+t,f):a},f.offset=function(t){return arguments.length?(l=+t,f):l},f}var yt={value:()=>{}};function bt(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new xt(i)}function xt(t){this._=t}function wt(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function kt(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function St(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=yt,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}xt.prototype=bt.prototype={constructor:xt,on:function(t,e){var n,i=this._,r=wt(t+"",i),s=-1,o=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<o;)if(n=(t=r[s]).type)i[n]=St(i[n],t.name,e);else if(null==e)for(n in i)i[n]=St(i[n],t.name,null);return this}for(;++s<o;)if((n=(t=r[s]).type)&&(n=kt(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new xt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),s=0;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=0,n=(i=this._[t]).length;s<n;++s)i[s].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};var Mt="http://www.w3.org/1999/xhtml",Tt={svg:"http://www.w3.org/2000/svg",xhtml:Mt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ct(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Tt.hasOwnProperty(e)?{space:Tt[e],local:t}:t}function At(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Mt&&e.documentElement.namespaceURI===Mt?e.createElement(t):e.createElementNS(n,t)}}function Dt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Et(t){var e=Ct(t);return(e.local?Dt:At)(e)}function Nt(){}function zt(t){return null==t?Nt:function(){return this.querySelector(t)}}function Pt(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function jt(){return[]}function It(t){return null==t?jt:function(){return this.querySelectorAll(t)}}function $t(t){return function(){return this.matches(t)}}function Rt(t){return function(e){return e.matches(t)}}var Lt=Array.prototype.find;function Ft(){return this.firstElementChild}var Ot=Array.prototype.filter;function Ht(){return Array.from(this.children)}function Vt(t){return new Array(t.length)}function qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Bt(t){return function(){return t}}function Ut(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;a<c;++a)(o=e[a])?(o.__data__=s[a],i[a]=o):n[a]=new qt(t,s[a]);for(;a<l;++a)(o=e[a])&&(r[a]=o)}function Wt(t,e,n,i,r,s,o){var a,l,c,u=new Map,h=e.length,f=s.length,d=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(d[a]=c=o.call(l,l.__data__,a,e)+"",u.has(c)?r[a]=l:u.set(c,l));for(a=0;a<f;++a)c=o.call(t,s[a],a,s)+"",(l=u.get(c))?(i[a]=l,l.__data__=s[a],u["delete"](c)):n[a]=new qt(t,s[a]);for(a=0;a<h;
vendor: 8,656 bytes, line 435
435++a)(l=e[a])&&u.get(d[a])===l&&(r[a]=l)}function Yt(t){return t.__data__}function Xt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Jt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Gt(t){return function(){this.removeAttribute(t)}}function Kt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zt(t,e){return function(){this.setAttribute(t,e)}}function Qt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function te(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function ee(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ne(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ie(t){return function(){this.style.removeProperty(t)}}function re(t,e,n){return function(){this.style.setProperty(t,e,n)}}function se(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function oe(t,e){return t.style.getPropertyValue(e)||ne(t).getComputedStyle(t,null).getPropertyValue(e)}function ae(t){return function(){delete this[t]}}function le(t,e){return function(){this[t]=e}}function ce(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function ue(t){return t.trim().split(/^|\s+/)}function he(t){return t.classList||new fe(t)}function fe(t){this._node=t,this._names=ue(t.getAttribute("class")||"")}function de(t,e){for(var n=he(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function pe(t,e){for(var n=he(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function me(t){return function(){de(this,t)}}function ge(t){return function(){pe(this,t)}}function _e(t,e){return function(){(e.apply(this,arguments)?de:pe)(this,t)}}function ve(){this.textContent=""}function ye(t){return function(){this.textContent=t}}function be(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function xe(){this.innerHTML=""}function we(t){return function(){this.innerHTML=t}}function ke(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Se(){this.nextSibling&&this.parentNode.appendChild(this)}function Me(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return null}function Ce(){var t=this.parentNode;t&&t.removeChild(this)}function Ae(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function De(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ee(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function Ne(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i<s;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function ze(t,e,n){return function(){var i,r=this.__on,s=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),void(i.value=e);this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Pe(t,e,n){var i=ne(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function je(t,e){return function(){return Pe(this,t,e)}}function Ie(t,e){return function(){return Pe(this,t,e.apply(this,arguments))}}qt.prototype={constructor:qt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},fe.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var $e=[null];function Re(t,e){this._groups=t,this._parents=e}function Le(){return new Re([[document.documentElement]],$e)}function Fe(t){return"string"==typeof t?new Re([[document.querySelector(t)]],[document.documentElement]):new Re([[t]],$e)}Re.prototype=Le.prototype={constructor:Re,select:function(t){"function"!=typeof t&&(t=zt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o,a=e[r],l=a.length,c=i[r]=new Array(l),u=0;u<l;++u)(s=a[u])&&(o=t.call(s,s.__data__,u,a))&&("__data__"in s&&(o.__data__=s.__data__),c[u]=o);return new Re(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return Pt(t.apply(this,arguments))}}(t):It(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var o,a=e[s],l=a.length,c=0;c<l;++c)(o=a[c])&&(i.push(t.call(o,o.__data__,c,a)),r.push(o));return new Re(i,r)},selectChild:function(t){return this.select(null==t?Ft:function(t){return function(){return Lt.call(this.children,t)}}("function"==typeof t?t:Rt(t)))},selectChildren:function(t){return this.selectAll(null==t?Ht:function(t){return function(){return Ot.call(this.children,t)}}("function"==typeof t?t:Rt(t)))},filter:function(t){"function"!=typeof t&&(t=$t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o=e[r],a=o.length,l=i[r]=[],c=0;c<a;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&l.push(s);return new Re(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Yt);var n=e?Wt:Ut,i=this._parents,r=this._groups;"function"!=typeof t&&(t=Bt(t));for(var s=r.length,o=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],h=r[c],f=h.length,d=Xt(t.call(u,u&&u.__data__,c,i)),p=d.length,m=a[c]=new Array(p),g=o[c]=new Array(p),_=l[c]=new Array(f);n(u,h,m,g,_,d,e);for(var v,y,b=0,x=0;b<p;++b)if(v=m[b]){for(b>=x&&(x=b+1);!(y=g[x])&&++x<p;);v._next=y||null}}return(o=new Re(o,i))._enter=a,o._exit=l,o},enter:function(){return new Re(this._enter||this._groups.map(Vt),this._parents)},exit:function(){return new Re(this._exit||this._groups.map(Vt),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,s=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?s.remove():n(s),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,o=Math.min(r,s),a=new Array(r),l=0;l<o;++l)for(var c,u=n[l],h=i[l],f=u.length,d=a[l]=new Array(f),p=0;p<f;++p)(c=u[p]||h[p])&&(d[p]=c);for(;l<r;++l)a[l]=n[l];return new Re(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],s=r.length-1,o=r[s];--s>=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Jt);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var o,a=n[s],l=a.length,c=r[s]=new Array(l),u=0;u<l;++u)(o=a[u])&&(c[u]=o);c.sort(e)}return new Re(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var o=i[r];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,s=e[n],o=0,a=s.length;o<a;++o)(r=s[o])&&t.call(r,r.__data__,o,s);return this},attr:function(t,e){var n=Ct(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?Kt:Gt:"function"==typeof e?n.local?ee:te:n.local?Qt:Zt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?ie:"function"==typeof e?se:re)(t,e,null==n?"":n)):oe(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ae:"function"==typeof e?ce:le)(t,e)):this.node()[t]},classed:function(t,e){var n=ue(t+"");
vendor: 7,334 bytes, line 435
435if(arguments.length<2){for(var i=he(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?_e:e?me:ge)(n,e))},text:function(t){return arguments.length?this.each(null==t?ve:("function"==typeof t?be:ye)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?xe:("function"==typeof t?ke:we)(t)):this.node().innerHTML},raise:function(){return this.each(Se)},lower:function(){return this.each(Me)},append:function(t){var e="function"==typeof t?t:Et(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Et(t),i=null==e?Te:"function"==typeof e?e:zt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(Ce)},clone:function(t){return this.select(t?De:Ae)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,s=Ee(t+""),o=s.length;if(!(arguments.length<2)){for(a=e?ze:Ne,i=0;i<o;++i)this.each(a(s[i],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(i=0,l=a[c];i<o;++i)if((r=s[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?Ie:je)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],s=0,o=r.length;s<o;++s)(i=r[s])&&(yield i)}};var Oe=0;function He(){return new Ve}function Ve(){this._="@"+(++Oe).toString(36)}function qe(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Be(t,e){if(t=qe(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Ve.prototype=He.prototype={constructor:Ve,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const Ue={passive:!1},We={capture:!0,passive:!1};function Ye(t){t.stopImmediatePropagation()}function Xe(t){t.preventDefault(),t.stopImmediatePropagation()}function Je(t){var e=t.document.documentElement,n=Fe(t).on("dragstart.drag",Xe,We);"onselectstart"in e?n.on("selectstart.drag",Xe,We):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ge(t,e){var n=t.document.documentElement,i=Fe(t).on("dragstart.drag",null);e&&(i.on("click.drag",Xe,We),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ke=t=>()=>t;function Ze(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:s,x:o,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function Qe(t){return!t.ctrlKey&&!t.button}function tn(){return this.parentNode}function en(t,e){return null==e?{x:t.x,y:t.y}:e}function nn(){return navigator.maxTouchPoints||"ontouchstart"in this}function rn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function on(){}Ze.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var an=.7,ln=1/an,cn="\\s*([+-]?\\d+)\\s*",un="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fn=/^#([0-9a-f]{3,8})$/,dn=new RegExp("^rgb\\("+[cn,cn,cn]+"\\)$"),pn=new RegExp("^rgb\\("+[hn,hn,hn]+"\\)$"),mn=new RegExp("^rgba\\("+[cn,cn,cn,un]+"\\)$"),gn=new RegExp("^rgba\\("+[hn,hn,hn,un]+"\\)$"),_n=new RegExp("^hsl\\("+[un,hn,hn]+"\\)$"),vn=new RegExp("^hsla\\("+[un,hn,hn,un]+"\\)$"),yn={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};function bn(){return this.rgb().formatHex()}function xn(){return this.rgb().formatRgb()}function wn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=fn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kn(e):3===n?
vendor: 29,794 bytes, lines 435-436
435new Cn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Sn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Sn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dn.exec(t))?new Cn(e[1],e[2],e[3],1):(e=pn.exec(t))?new Cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mn.exec(t))?Sn(e[1],e[2],e[3],e[4]):(e=gn.exec(t))?Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=_n.exec(t))?Nn(e[1],e[2]/100,e[3]/100,1):(e=vn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,e[4]):yn.hasOwnProperty(t)?kn(yn[t]):"transparent"===t?new Cn(NaN,NaN,NaN,0):null}function kn(t){return new Cn(t>>16&255,t>>8&255,255&t,1)}function Sn(t,e,n,i){return i<=0&&(t=e=n=NaN),new Cn(t,e,n,i)}function Mn(t){return t instanceof on||(t=wn(t)),t?new Cn((t=t.rgb()).r,t.g,t.b,t.opacity):new Cn}function Tn(t,e,n,i){return 1===arguments.length?Mn(t):new Cn(t,e,n,null==i?1:i)}function Cn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function An(){return"#"+En(this.r)+En(this.g)+En(this.b)}function Dn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function En(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Nn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new jn(t,e,n,i)}function zn(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof on||(t=wn(t)),!t)return new jn
436;if(t instanceof jn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n<i):n===s?(i-e)/a+2:(e-n)/a+4,a/=l<.5?s+r:2-s-r,o*=60):a=l>0&&l<1?0:o,new jn(o,a,l,t.opacity)}function Pn(t,e,n,i){return 1===arguments.length?zn(t):new jn(t,e,n,null==i?1:i)}function jn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function In(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}rn(on,wn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bn,formatHex:bn,formatHsl:function(){return zn(this).formatHsl()},formatRgb:xn,toString:xn}),rn(Cn,Tn,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new Cn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new Cn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:An,formatHex:An,formatRgb:Dn,toString:Dn})),rn(jn,Pn,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new jn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new jn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Cn(In(t>=240?t-240:t+120,r,i),In(t,r,i),In(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const $n=Math.PI/180,Rn=180/Math.PI,Ln=.96422,Fn=.82521,On=4/29,Hn=6/29,Vn=3*Hn*Hn;function qn(t){if(t instanceof Un)return new Un(t.l,t.a,t.b,t.opacity);if(t instanceof Zn)return Qn(t);t instanceof Cn||(t=Mn(t));var e,n,i=Jn(t.r),r=Jn(t.g),s=Jn(t.b),o=Wn((.2225045*i+.7168786*r+.0606169*s)/1);return i===r&&r===s?e=n=o:(e=Wn((.4360747*i+.3850649*r+.1430804*s)/Ln),n=Wn((.0139322*i+.0971045*r+.7141733*s)/Fn)),new Un(116*o-16,500*(e-o),200*(o-n),t.opacity)}function Bn(t,e,n,i){return 1===arguments.length?qn(t):new Un(t,e,n,null==i?1:i)}function Un(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function Wn(t){return t>.008856451679035631?Math.pow(t,1/3):t/Vn+On}function Yn(t){return t>Hn?t*t*t:Vn*(t-On)}function Xn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gn(t){if(t instanceof Zn)return new Zn(t.h,t.c,t.l,t.opacity);if(t instanceof Un||(t=qn(t)),0===t.a&&0===t.b)return new Zn(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Rn;return new Zn(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Kn(t,e,n,i){return 1===arguments.length?Gn(t):new Zn(t,e,n,null==i?1:i)}function Zn(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function Qn(t){if(isNaN(t.h))return new Un(t.l,0,0,t.opacity);var e=t.h*$n;return new Un(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}rn(Un,Bn,sn(on,{brighter:function(t){return new Un(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Un(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Cn(Xn(3.1338561*(e=Ln*Yn(e))-1.6168667*(t=1*Yn(t))-.4906146*(n=Fn*Yn(n))),Xn(-.9787684*e+1.9161415*t+.033454*n),Xn(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),rn(Zn,Kn,sn(on,{brighter:function(t){return new Zn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Zn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Qn(this).rgb()}}));var ti=-.14861,ei=1.78277,ni=-.29227,ii=-.90649,ri=1.97294,si=ri*ii,oi=ri*ei,ai=ei*ni-ii*ti;function li(t){if(t instanceof ui)return new ui(t.h,t.s,t.l,t.opacity);t instanceof Cn||(t=Mn(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(ai*i+si*e-oi*n)/(ai+si-oi),s=i-r,o=(ri*(n-r)-ni*s)/ii,a=Math.sqrt(o*o+s*s)/(ri*r*(1-r)),l=a?Math.atan2(o,s)*Rn-120:NaN;return new ui(l<0?l+360:l,a,r,t.opacity)}function ci(t,e,n,i){return 1===arguments.length?li(t):new ui(t,e,n,null==i?1:i)}function ui(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hi(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}function fi(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1],o=i>0?t[i-1]:2*r-s,a=i<e-1?t[i+2]:2*s-r;return hi((n-i/e)*e,o,r,s,a)}}function di(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],s=t[i%e],o=t[(i+1)%e],a=t[(i+2)%e];return hi((n-i/e)*e,r,s,o,a)}}rn(ui,ci,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new ui(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new ui(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*$n,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new Cn(255*(e+n*(ti*i+ei*r)),255*(e+n*(ni*i+ii*r)),255*(e+n*(ri*i)),this.opacity)}}));var pi=t=>()=>t;function mi(t,e){return function(n){return t+n*e}}function gi(t,e){var n=e-t;return n?mi(t,n>180||n<-180?n-360*Math.round(n/360):n):pi(isNaN(t)?e:t)}function _i(t){return 1==(t=+t)?vi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):pi(isNaN(e)?n:e)}}function vi(t,e){var n=e-t;return n?mi(t,n):pi(isNaN(t)?e:t)}var yi=function Ux(t){var e=_i(t);function n(t,n){var i=e((t=Tn(t)).r,(n=Tn(n)).r),r=e(t.g,n.g),s=e(t.b,n.b),o=vi(t.opacity,n.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return n.gamma=Ux,n}(1);function bi(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=Tn(e[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=t(s),o=t(o),a=t(a),i.opacity=1,function(t){return i.r=s(t),i.g=o(t),i.b=a(t),i+""}}}var xi=bi(fi),wi=bi(di);function ki(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}}function Si(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Mi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,s=new Array(r),o=new Array(i);for(n=0;n<r;++n)s[n]=zi(t[n],e[n]);for(;n<i;++n)o[n]=e[n];return function(t){for(n=0;n<r;++n)o[n]=s[n](t);return o}}function Ti(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ci(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ai(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=zi(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Di=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ei=new RegExp(Di.source,"g");function Ni(t,e){var n,i,r,s=Di.lastIndex=Ei.lastIndex=0,o=-1,a=[],l=[];for(t+="",e+="";(n=Di.exec(t))&&(i=Ei.exec(e));)(r=i.index)>s&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:Ci(n,i)})),s=Ei.lastIndex;return s<e.length&&(r=e.slice(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function zi(t,e){var n,i=typeof e;return null==e||"boolean"===i?pi(e):("number"===i?Ci:"string"===i?(n=wn(e))?(e=n,yi):Ni:e instanceof wn?yi:e instanceof Date?Ti:Si(e)?ki:Array.isArray(e)?Mi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ai:Ci)(t,e)}function Pi(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var ji,Ii=180/Math.PI,$i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ri(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*Ii,skewX:Math.atan(l)*Ii,scaleX:o,scaleY:a}}function Li(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(s,o){var a=[],l=[];return s=t(s),o=t(o),function(t,i,r,s,o,a){if(t!==r||i!==s){var l=o.push("translate(",null,e,null,n);a.push({i:l-4,x:Ci(t,r)},{i:l-2,x:Ci(i,s)})}else(r||s)&&o.push("translate("+r+e+s+n)}(s.translateX,s.translateY,o.translateX,o.translateY,a,l),function(t,e,n,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ci(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ci(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:Ci(t,n)},{i:a-2,x:Ci(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Fi=Li(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?$i:Ri(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Oi=Li(function(t){return null==t?$i:(ji||(ji=document.createElementNS("http://www.w3.org/2000/svg","g")),ji.setAttribute("transform",t),(t=ji.transform.baseVal.consolidate())?Ri((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):$i)},", ",")",")");function Hi(t){return((t=Math.exp(t))+1/t)/2}var Vi=function Wx(t,e,n){function i(i,r){var s,o,a=i[0],l=i[1],c=i[2],u=r[0],h=r[1],f=r[2],d=u-a,p=h-l,m=d*d+p*p;if(m<1e-12)o=Math.log(f/c)/t,s=function(e){return[a+e*d,l+e*p,c*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),_=(f*f-c*c+n*m)/(2*c*e*g),v=(f*f-c*c-n*m)/(2*f*e*g),y=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(v*v+1)-v);o=(b-y)/t,s=function(n){var i=n*o,r=Hi(y),s=c/(e*g)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(t*i+y)-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[a+s*d,l+s*p,c*r/Hi(t*i+y)]}}return s.duration=1e3*o*t/Math.SQRT2,s}return i.rho=function(t){var e=Math.max(.001,+t),n=e*e;return Wx(e,n,n*n)},i}(Math.SQRT2,2,4);function qi(t){return function(e,n){var i=t((e=Pn(e)).h,(n=Pn(n)).h),r=vi(e.s,n.s),s=vi(e.l,n.l),o=vi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=r(t),e.l=s(t),e.opacity=o(t),e+""}}}var Bi=qi(gi),Ui=qi(vi);function Wi(t){return function(e,n){var i=t((e=Kn(e)).h,(n=Kn(n)).h),r=vi(e.c,n.c),s=vi(e.l,n.l),o=vi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=s(t),e.opacity=o(t),e+""}}}var Yi=Wi(gi),Xi=Wi(vi);function Ji(t){return function e(n){function i(e,i){var r=t((e=ci(e)).h,(i=ci(i)).h),s=vi(e.s,i.s),o=vi(e.l,i.l),a=vi(e.opacity,i.opacity);return function(t){return e.h=r(t),e.s=s(t),e.l=o(Math.pow(t,n)),e.opacity=a(t),e+""}}return n=+n,i.gamma=e,i}(1)}var Gi=Ji(gi),Ki=Ji(vi);function Zi(t,e){void 0===e&&(e=t,t=zi);for(var n=0,i=e.length-1,r=e[0],s=new Array(i<0?0:i);n<i;)s[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return s[e](t-e)}}var Qi,tr,er=0,nr=0,ir=0,rr=0,sr=0,or=0,ar="object"==typeof performance&&performance.now?performance:Date,lr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function cr(){return sr||(lr(ur),sr=ar.now()+or)}function ur(){sr=0}function hr(){this._call=this._time=this._next=null}function fr(t,e,n){var i=new hr;return i.restart(t,e,n),i}function dr(){cr(),++er;for(var t,e=Qi;e;)(t=sr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--er}function pr(){sr=(rr=ar.now())+or,er=nr=0;try{dr()}finally{er=0,function(){var t,e,n=Qi,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Qi=e);tr=t,gr(i)}(),sr=0}}function mr(){var t=ar.now(),e=t-rr;e>1e3&&(or-=e,rr=t)}function gr(t){er||(nr&&(nr=clearTimeout(nr)),t-sr>24?(t<1/0&&(nr=setTimeout(pr,t-ar.now()-or)),ir&&(ir=clearInterval(ir))):(ir||(rr=ar.now(),ir=setInterval(mr,1e3)),er=1,lr(pr)))}function _r(t,e,n){var i=new hr;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}hr.prototype=fr.prototype={constructor:hr,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?cr():+n)+(null==e?0:+e),this._next||tr===this||(tr?tr._next=this:Qi=this,tr=this),this._call=t,this._time=n,gr()},stop:function(){this._call&&(this._call=null,this._time=1/0,gr())}};var vr=bt("start","end","cancel","interrupt"),yr=[];function br(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(s){var c,u,h,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return _r(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(_r(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function a(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),s=-1,o=i.length;++s<o;)i[s].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=fr(s,0,n.time)}(t,n,{name:e,index:i,group:r,on:vr,tween:yr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:0})}function xr(t,e){var n=kr(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function wr(t,e){var n=kr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function kr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Sr(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}}function Mr(t,e){var n,i;return function(){var r=wr(this,t),s=r.tween;if(s!==n)for(var o=0,a=(i=n=s).length;o<a;++o)if(i[o].name===e){(i=i.slice()).splice(o,1);break}r.tween=i}}function Tr(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var s=wr(this,t),o=s.tween;if(o!==i){r=(i=o).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}s.tween=r}}function Cr(t,e,n){var i=t._id;return t.each(function(){var t=wr(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return kr(t,i).value[e]}}function Ar(t,e){var n;return("number"==typeof e?Ci:e instanceof wn?yi:(n=wn(e))?(e=n,yi):Ni)(t,e)}function Dr(t){return function(){this.removeAttribute(t)}}function Er(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Nr(t,e,n){var i,r,s=n+"";return function(){var o=this.getAttribute(t);return o===s?null:o===i?r:r=e(i=o,n)}}function zr(t,e,n){var i,r,s=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===s?null:o===i?r:r=e(i=o,n)}}function Pr(t,e,n){var i,r,s;return function(){var o,a,l=n(this);if(null!=l)return(o=this.getAttribute(t))===(a=l+"")?null:o===i&&a===r?s:(r=a,s=e(i=o,l));this.removeAttribute(t)}}function jr(t,e,n){var i,r,s;return function(){var o,a,l=n(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:o===i&&a===r?s:(r=a,s=e(i=o,l));this.removeAttributeNS(t.space,t.local)}}function Ir(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function $r(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Rr(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&$r(t,r)),n}return r._value=e,r}function Lr(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Ir(t,r)),n}return r._value=e,r}function Fr(t,e){return function(){xr(this,t).delay=+e.apply(this,arguments)}}function Or(t,e){return e=+e,function(){xr(this,t).delay=e}}function Hr(t,e){return function(){wr(this,t).duration=+e.apply(this,arguments)}}function Vr(t,e){return e=+e,function(){wr(this,t).duration=e}}function qr(t,e){if("function"!=typeof e)throw new Error;return function(){wr(this,t).ease=e}}function Br(t,e,n){var i,r,s=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?xr:wr;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var Ur=Le.prototype.constructor;function Wr(t){return function(){this.style.removeProperty(t)}}function Yr(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function Xr(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&Yr(t,s,n)),i}return s._value=e,s}function Jr(t){return function(e){this.textContent=t.call(this,e)}}function Gr(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Jr(i)),e}return i._value=t,i}var Kr=0;function Zr(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Qr(t){return Le().transition(t)}function ts(){return++Kr}var es=Le.prototype;Zr.prototype=Qr.prototype={constructor:Zr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=zt(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o<r;++o)for(var a,l,c=i[o],u=c.length,h=s[o]=new Array(u),f=0;f<u;++f)(a=c[f])&&(l=t.call(a,a.__data__,f,c))&&("__data__"in a&&(l.__data__=a.__data__),h[f]=l,br(h[f],e,n,f,h,kr(a,n)));return new Zr(s,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=It(t));for(var i=this._groups,r=i.length,s=[],o=[],a=0;a<r;++a)for(var l,c=i[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var f,d=t.call(l,l.__data__,h,c),p=kr(l,n),m=0,g=d.length;m<g;++m)(f=d[m])&&br(f,e,n,m,d,p);s.push(d),o.push(l)}return new Zr(s,o,e,n)},selectChild:es.selectChild,selectChildren:es.selectChildren,filter:function(t){"function"!=typeof t&&(t=$t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o=e[r],a=o.length,l=i[r]=[],c=0;c<a;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&l.push(s);return new Zr(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),o=new Array(i),a=0;a<s;++a)for(var l,c=e[a],u=n[a],h=c.length,f=o[a]=new Array(h),d=0;d<h;++d)(l=c[d]||u[d])&&(f[d]=l);for(;a<i;++a)o[a]=e[a];return new Zr(o,this._parents,this._name,this._id)},selection:function(){return new Ur(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ts(),i=this._groups,r=i.length,s=0;s<r;++s)for(var o,a=i[s],l=a.length,c=0;c<l;++c)if(o=a[c]){var u=kr(o,e);br(o,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Zr(i,this._parents,t,n)},call:es.call,nodes:es.nodes,node:es.node,size:es.size,empty:es.empty,each:es.each,on:function(t,e){var n=this._id;return arguments.length<2?kr(this.node(),n).on.on(t):this.each(Br(n,t,e))},attr:function(t,e){var n=Ct(t),i="transform"===n?Oi:Ar;return this.attrTween(t,"function"==typeof e?(n.local?jr:Pr)(n,i,Cr(this,"attr."+t,e)):null==e?(n.local?Er:Dr)(n):(n.local?zr:Nr)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Ct(t);return this.tween(n,(i.local?Rr:Lr)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Fi:Ar;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var s=oe(this,t),o=(this.style.removeProperty(t),oe(this,t));return s===o?null:s===n&&o===i?r:r=e(n=s,i=o)}}(t,i)).on("end.style."+t,Wr(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,s;return function(){var o=oe(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=oe(this,t)),o===l?null:o===i&&l===r?s:(r=l,s=e(i=o,a))}}(t,i,Cr(this,"style."+t,e))).each(function(t,e){var n,i,r,s,o="style."+e,a="end."+o;return function(){var l=wr(this,t),c=l.on,u=null==l.value[o]?s||(s=Wr(e)):void 0;c===n&&r===u||(i=(n=c).copy()).on(a,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,s=n+"";return function(){var o=oe(this,t);return o===s?null:o===i?r:r=e(i=o,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,Xr(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Cr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Gr(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=kr(this.node(),n).tween,s=0,o=r.length;s<o;++s)if((i=r[s]).name===t)return i.value;return null}return this.each((null==e?Mr:Tr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Fr:Or)(e,t)):kr(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Hr:Vr)(e,t)):kr(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(qr(e,t)):kr(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;wr(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){0==--r&&s()}};n.each(function(){var n=wr(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}),0===r&&s()})},[Symbol.iterator]:es[Symbol.iterator]};function ns(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function is(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var rs=function Yx(t){function e(e){return Math.pow(e,t)}return t=+t,e.exponent=Yx,e}(3),ss=function Xx(t){function e(e){return 1-Math.pow(1-e,t)}return t=+t,e.exponent=Xx,e}(3),os=function Jx(t){function e(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,e.exponent=Jx,e}(3),as=Math.PI,ls=as/2;function cs(t){return(1-Math.cos(as*t))/2}function us(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function hs(t){return((t*=2)<=1?us(1-t):2-us(t-1))/2}function fs(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var ds=4/11,ps=7.5625;function ms(t){return(t=+t)<ds?ps*t*t:t<.7272727272727273?ps*(t-=.5454545454545454)*t+.75:t<.9090909090909091?ps*(t-=.8181818181818182)*t+.9375:ps*(t-=.9545454545454546)*t+.984375}var gs=1.70158,_s=function Gx(t){function e(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,e.overshoot=Gx,e}(gs),vs=function Kx(t){function e(e){return--e*e*((e+1)*t+e)+1}return t=+t,e.overshoot=Kx,e}(gs),ys=function Zx(t){function e(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,e.overshoot=Zx,e}(gs),bs=2*Math.PI,xs=function Qx(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return t*us(- --i)*Math.sin((n-i)/e)}return i.amplitude=function(t){return Qx(t,e*bs)},i.period=function(e){return Qx(t,e)},i}(1,.3),ws=function tw(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return 1-t*us(i=+i)*Math.sin((i+n)/e)}return i.amplitude=function(t){return tw(t,e*bs)},i.period=function(e){return tw(t,e)},i}(1,.3),ks=function ew(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return((i=2*i-1)<0?t*us(-i)*Math.sin((n-i)/e):2-t*us(i)*Math.sin((n+i)/e))/2}return i.amplitude=function(t){return ew(t,e*bs)},i.period=function(e){return ew(t,e)},i}(1,.3),Ss={time:null,delay:0,duration:250,ease:is};function Ms(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Le.prototype.interrupt=function(t){return this.each(function(){Sr(this,t)})},Le.prototype.transition=function(t){var e,n;t instanceof Zr?(e=t._id,t=t._name):(e=ts(),(n=Ss).time=cr(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var o,a=i[s],l=a.length,c=0;c<l;++c)(o=a[c])&&br(o,t,e,c,a,n||Ms(o,e));return new Zr(i,this._parents,t,e)};var Ts=[null];var Cs=t=>()=>t;function As(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ds(t){t.stopImmediatePropagation()}function Es(t){t.preventDefault(),t.stopImmediatePropagation()}var Ns={name:"drag"},zs={name:"space"},Ps={name:"handle"},js={name:"center"};const{abs:Is,max:$s,min:Rs}=Math;function Ls(t){return[+t[0],+t[1]]}function Fs(t){return[Ls(t[0]),Ls(t[1])]}var Os={name:"x",handles:["w","e"].map(Xs),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Hs={name:"y",handles:["n","s"].map(Xs),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Vs={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Xs),input:function(t){return null==t?null:Fs(t)},output:function(t){return t}},qs={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bs={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Us={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ws={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ys={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xs(t){return{type:t}}function Js(t){return!t.ctrlKey&&!t.button}function Gs(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ks(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zs(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Qs(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function to(t){var e,n=Gs,i=Js,r=Ks,s=!0,o=bt("start","brush","end"),a=6;function l(e){var n=e.property("__brush",m).selectAll(".overlay").data([Xs("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",qs.overlay).merge(n).each(function(){var t=Zs(this).extent;Fe(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Xs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",qs.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});
vendor: 3,121 bytes, line 436
436i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return qs[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Fe(this),e=Zs(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new h(t,e,n):i}function h(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function f(n){if((!e||n.touches)&&i.apply(this,arguments)){var r,o,a,l,h,f,d,p,m,g,_,v=this,y=n.target.__data__.type,b="selection"===(s&&n.metaKey?y="overlay":y)?Ns:s&&n.altKey?js:Ps,x=t===Hs?null:Ws[y],w=t===Os?null:Ys[y],k=Zs(v),S=k.extent,M=k.selection,T=S[0][0],C=S[0][1],A=S[1][0],D=S[1][1],E=0,N=0,z=x&&w&&s&&n.shiftKey,P=Array.from(n.touches||[n],t=>{const e=t.identifier;return(t=Be(t,v)).point0=t.slice(),t.identifier=e,t});Sr(v);var j=u(v,arguments,!0).beforestart();if("overlay"===y){M&&(m=!0);const e=[P[0],P[1]||P[0]];k.selection=M=[[r=t===Hs?T:Rs(e[0][0],e[1][0]),a=t===Os?C:Rs(e[0][1],e[1][1])],[h=t===Hs?A:$s(e[0][0],e[1][0]),d=t===Os?D:$s(e[0][1],e[1][1])]],P.length>1&&F(n)}else r=M[0][0],a=M[0][1],h=M[1][0],d=M[1][1];o=r,l=a,f=h,p=d;var I=Fe(v).attr("pointer-events","none"),$=I.selectAll(".overlay").attr("cursor",qs[y]);if(n.touches)j.moved=L,j.ended=O;else{var R=Fe(n.view).on("mousemove.brush",L,!0).on("mouseup.brush",O,!0);s&&R.on("keydown.brush",H,!0).on("keyup.brush",V,!0),Je(n.view)}c.call(v),j.start(n,b.name)}function L(t){for(const e of t.changedTouches||[t])for(const t of P)t.identifier===e.identifier&&(t.cur=Be(e,v));if(z&&!g&&!_&&1===P.length){const t=P[0];Is(t.cur[0]-t[0])>Is(t.cur[1]-t[1])?_=!0:g=!0}for(const t of P)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,Es(t),F(t)}function F(t){const e=P[0],n=e.point0;var i;switch(E=e[0]-n[0],N=e[1]-n[1],b){case zs:case Ns:x&&(E=$s(T-r,Rs(A-h,E)),o=r+E,f=h+E),w&&(N=$s(C-a,Rs(D-d,N)),l=a+N,p=d+N);break;case Ps:P[1]?(x&&(o=$s(T,Rs(A,P[0][0])),f=$s(T,Rs(A,P[1][0])),x=1),w&&(l=$s(C,Rs(D,P[0][1])),p=$s(C,Rs(D,P[1][1])),w=1)):(x<0?(E=$s(T-r,Rs(A-r,E)),o=r+E,f=h):x>0&&(E=$s(T-h,Rs(A-h,E)),o=r,f=h+E),w<0?(N=$s(C-a,Rs(D-a,N)),l=a+N,p=d):w>0&&(N=$s(C-d,Rs(D-d,N)),l=a,p=d+N));break;case js:x&&(o=$s(T,Rs(A,r-E*x)),f=$s(T,Rs(A,h+E*x))),w&&(l=$s(C,Rs(D,a-N*w)),p=$s(C,Rs(D,d+N*w)))}
vendor: 4,468 bytes, lines 436-437
436f<o&&(x*=-1,i=r,r=h,h=i,i=o,o=f,f=i,y in Bs&&$.attr("cursor",qs[y=Bs[y]])),p<l&&(w*=-1,i=a,a=d,d=i,i=l,l=p,p=i,y in Us&&$.attr("cursor",qs[y=Us[y]])),k.selection&&(M=k.selection),g&&(o=M[0][0],f=M[1][0]),_&&(l=M[0][1],p=M[1][1]),M[0][0]===o&&M[0][1]===l&&M[1][0]===f&&M[1][1]===p||(k.selection=[[o,l],[f,p]],c.call(v),j.brush(t,b.name))}function O(t){if(Ds(t),t.touches){if(t.touches.length)return;e&&clearTimeout(e),e=setTimeout(function(){e=null},500)}else Ge(t.view,m),R.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);I.attr("pointer-events","all"),$.attr("cursor",qs.overlay),k.selection&&(M=k.selection),Qs(M)&&(k.selection=null,c.call(v)),j.end(t,b.name)}function H(t){switch(t.keyCode){case 16:z=x&&w;break;case 18:b===Ps&&(x&&(h=f-E*x,r=o+E*x),w&&(d=p-N*w,a=l+N*w),b=js,F(t));break;case 32:b!==Ps&&b!==js||(x<0?h=f-E:x>0&&(r=o-E),w<0?d=p-N:w>0&&(a=l-N),b=zs,$.attr("cursor",qs.selection),F(t));break;default:return}Es(t)}function V(t){switch(t.keyCode){case 16:z&&(g=_=z=!1,F(t));break;case 18:b===js&&(x<0?h=f:x>0&&(r=o),w<0?d=p:w>0&&(a=l),b=Ps,F(t));break;case 32:b===zs&&(t.altKey?(x&&(h=f-E*x,r=o+E*x),w&&(d=p-N*w,a=l+N*w),b=js):(x<0?h=f:x>0&&(r=o),w<0?d=p:w>0&&(a=l),b=Ps),$.attr("cursor",qs[y]),F(t));break;default:return}Es(t)}}function d(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function m(){var e=this.__brush||{selection:null}
437;return e.extent=Fs(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n,i){e.tween?e.on("start.brush",function(t){u(this,arguments).beforestart().start(t)}).on("interrupt.brush end.brush",function(t){u(this,arguments).end(t)}).tween("brush",function(){var e=this,i=e.__brush,r=u(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=zi(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,r=arguments,s=e.__brush,o=t.input("function"==typeof n?n.apply(e,r):n,s.extent),a=u(e,r).beforestart();Sr(e),s.selection=null===o?null:o,c.call(e),a.start(i).brush(i).end(i)})},l.clear=function(t,e){l.move(t,null,e)},h.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,i){var r=Fe(this.that).datum();o.call(e,this.that,new As(e,{sourceEvent:n,target:l,selection:t.output(this.state.selection),mode:i,dispatch:o}),r)}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Cs(Fs(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Cs(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Cs(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}var eo=Math.abs,no=Math.cos,io=Math.sin,ro=Math.PI,so=ro/2,oo=2*ro,ao=Math.max,lo=1e-12;function co(t,e){return Array.from({length:e-t},(e,n)=>t+n)}function uo(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function ho(t,e){var n=0,i=null,r=null,s=null;function o(o){var a,l=o.length,c=new Array(l),u=co(0,l),h=new Array(l*l),f=new Array(l),d=0;o=Float64Array.from({length:l*l},e?(t,e)=>o[e%l][e/l|0]:(t,e)=>o[e/l|0][e%l]);for(let e=0;e<l;++e){let n=0;for(let i=0;i<l;++i)n+=o[e*l+i]+t*o[i*l+e];d+=c[e]=n}a=(d=ao(0,oo-n*l)/d)?n:oo/l;{let e=0;i&&u.sort((t,e)=>i(c[t],c[e]));for(const n of u){const i=e;if(t){const t=co(1+~l,l).filter(t=>t<0?o[~t*l+n]:o[n*l+t]);r&&t.sort((t,e)=>r(t<0?-o[~t*l+n]:o[n*l+t],e<0?-o[~e*l+n]:o[n*l+e]));for(const i of t)if(i<0){(h[~i*l+n]||(h[~i*l+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=o[~i*l+n]*d,value:o[~i*l+n]}}else{(h[n*l+i]||(h[n*l+i]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]}}f[n]={index:n,startAngle:i,endAngle:e,value:c[n]}}else{const t=co(0,l).filter(t=>o[n*l+t]||o[t*l+n]);r&&t.sort((t,e)=>r(o[n*l+t],o[n*l+e]));for(const i of t){let t;if(n<i?(t=h[n*l+i]||(h[n*l+i]={source:null,target:null}),t.source={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]}
vendor: 5,571 bytes, line 437
437):(t=h[i*l+n]||(h[i*l+n]={source:null,target:null}),t.target={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]},n===i&&(t.source=t.target)),t.source&&t.target&&t.source.value<t.target.value){const e=t.source;t.source=t.target,t.target=e}}f[n]={index:n,startAngle:i,endAngle:e,value:c[n]}}e+=a}}return(h=Object.values(h)).groups=f,s?h.sort(s):h}return o.padAngle=function(t){return arguments.length?(n=ao(0,t),o):n},o.sortGroups=function(t){return arguments.length?(i=t,o):i},o.sortSubgroups=function(t){return arguments.length?(r=t,o):r},o.sortChords=function(t){return arguments.length?(null==t?s=null:(s=uo(t))._=t,o):s&&s._},o}const fo=Math.PI,po=2*fo,mo=1e-6,go=po-mo;function _o(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function vo(){return new _o}_o.prototype=vo.prototype={constructor:_o,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-t,l=i-e,c=s-t,u=o-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>mo)if(Math.abs(u*a-l*c)>mo&&r){var f=n-s,d=i-o,p=a*a+l*l,m=f*f+d*d,g=Math.sqrt(p),_=Math.sqrt(h),v=r*Math.tan((fo-Math.acos((p+h-m)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>mo&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*f>c*d)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,u=1^s,h=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>mo||Math.abs(this._y1-c)>mo)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%po+po),h>go?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>mo&&(this._+="A"+n+","+n+",0,"+ +(h>=fo)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var yo=Array.prototype.slice;function bo(t){return function(){return t}}function xo(t){return t.source}function wo(t){return t.target}function ko(t){return t.radius}function So(t){return t.startAngle}function Mo(t){return t.endAngle}function To(){return 0}function Co(){return 10}function Ao(t){var e=xo,n=wo,i=ko,r=ko,s=So,o=Mo,a=To,l=null;function c(){var c,u=e.apply(this,arguments),h=n.apply(this,arguments),f=a.apply(this,arguments)/2,d=yo.call(arguments),p=+i.apply(this,(d[0]=u,d)),m=s.apply(this,d)-so,g=o.apply(this,d)-so,_=+r.apply(this,(d[0]=h,d)),v=s.apply(this,d)-so,y=o.apply(this,d)-so;if(l||(l=c=vo()),f>lo&&(eo(g-m)>2*f+lo?g>m?(m+=f,g-=f):(m-=f,g+=f):m=g=(m+g)/2,eo(y-v)>2*f+lo?y>v?(v+=f,y-=f):(v-=f,y+=f):v=y=(v+y)/2),l.moveTo(p*no(m),p*io(m)),l.arc(0,0,p,m,g),m!==v||g!==y)if(t){var b=+t.apply(this,arguments),x=_-b,w=(v+y)/2;l.quadraticCurveTo(0,0,x*no(v),x*io(v)),l.lineTo(_*no(w),_*io(w)),l.lineTo(x*no(y),x*io(y))}else l.quadraticCurveTo(0,0,_*no(v),_*io(v)),l.arc(0,0,_,v,y);if(l.quadraticCurveTo(0,0,p*no(m),p*io(m)),l.closePath(),c)return l=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:bo(+e),c):t}),c.radius=function(t){return arguments.length?(i=r="function"==typeof t?t:bo(+t),c):i},c.sourceRadius=function(t){return arguments.length?(i="function"==typeof t?t:bo(+t),c):i},c.targetRadius=function(t){return arguments.length?(r="function"==typeof t?t:bo(+t),c):r},c.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:bo(+t),c):s},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:bo(+t),c):o},c.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:bo(+t),c):a},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(l=null==t?null:t,c):l},c}var Do=Array.prototype.slice;function Eo(t,e){return t-e}var No=t=>()=>t;function zo(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=Po(t,e[i]))return n;return 0}function Po(t,e){for(var n=e[0],i=e[1],r=-1,s=0,o=t.length,a=o-1;s<o;a=s++){var l=t[s],c=l[0],u=l[1],h=t[a],f=h[0],d=h[1];if(jo(l,h,e))return 0;u>i!=d>i&&n<(f-c)*(i-u)/(d-u)+c&&(r=-r)}return r}function jo(t,e,n){var i,r,s,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],s=n[i],o=e[i],r<=s&&s<=o||o<=s&&s<=r)}function Io(){}var $o=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ro(){var t=1,e=1,n=B,i=a;function r(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Eo);else{const n=m(t),i=V(n[0],n[1],e);e=O(Math.floor(n[0]/i)*i,Math.floor(n[1]/i-1)*i,e)}return e.map(e=>s(t,e))}function s(n,r){var s=[],a=[];return function(n,i,r){var s,a,l,c,u,h,f=new Array,d=new Array;s=a=-1,c=n[0]>
437=i,$o[c<<1].forEach(p);for(;++s<t-1;)l=c,c=n[s+1]>=i,$o[l|c<<1].forEach(p);$o[c<<0].forEach(p);for(;++a<e-1;){for(s=-1,c=n[a*t+t]>=i,u=n[a*t]>=i,$o[c<<1|u<<2].forEach(p);++s<t-1;)l=c,c=n[a*t+t+s+1]>=i,h=u,u=n[a*t+s+1]>=i,$o[l|c<<1|u<<2|h<<3].forEach(p);$o[c|u<<3].forEach(p)}s=-1,u=n[a*t]>=i,$o[u<<2].forEach(p);for(;++s<t-1;)h=u,u=n[a*t+s+1]>=i,$o[u<<2|h<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+s,t[0][1]+a],l=[t[1][0]+s,t[1][1]+a],c=o(i),u=o(l);(e=d[c])?(n=f[u])?(delete d[e.end],delete f[n.start],e===n?(e.ring.push(l),r(e.ring)):f[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(l),d[e.end=u]=e):(e=f[u])?(n=d[c])?(delete f[e.start],delete d[n.end],e===n?(e.ring.push(l),r(e.ring)):f[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete f[e.start],e.ring.unshift(i),f[e.start=c]=e):f[c]=d[u]={start:c,end:u,ring:[i,l]}}$o[u<<3].forEach(p)}(n,r,function(t){i(t,n,r),function(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}(t)>0?s.push([t]):a.push(t)}),a.forEach(function(t){for(var e,n=0,i=s.length;n<i;++n)if(-1!==zo((e=s[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:r,coordinates:s}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,i,r){n.forEach(function(n){var s,o=n[0],a=n[1],l=0|o,c=0|a,u=i[c*t+l];o>0&&o<t&&l===o&&(s=i[c*t+l-1],n[0]=o+(r-s)/(u-s)-.5),a>0&&a<e&&c===a&&(s=i[(c-1)*t+l],n[1]=a+(r-s)/(u-s)-.5)})}return r.contour=s,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),s=Math.floor(n[1]);if(!(i>=0&&s>=0))throw new Error("invalid size");return t=i,e=s,r},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?No(Do.call(t)):No(t),r):n},r.smooth=function(t){return arguments.length?(i=t?a:Io,r):i===a},r}function Lo(t,e,n){for(var i=t.width,r=t.height,s=1+(n<<1),o=0;o<r;++o)for(var a=0,l=0;a<i+n;++a)a<i&&(l+=t.data[a+o*i]),a>=n&&(a>=s&&(l-=t.data[a-s+o*i]),e.data[a-n+o*i]=l/Math.min(a+1,i-1+s-a,s))}function Fo(t,e,n){for(var i=t.width,r=t.height,s=1+(n<<1),o=0;o<i;++o)for(var a=0,l=0;a<r+n;++a)a<r&&(l+=t.data[o+a*i]),a>=n&&(a>=s&&(l-=t.data[o+(a-s)*i]),e.data[o+(a-n)*i]=l/Math.min(a+1,r-1+s-a,s))}function Oo(t){return t[0]}function Ho(t){return t[1]}function Vo(){return 1}const qo=134217729;function Bo(t,e,n,i,r){let s,o,a,l,c=e[0],u=i[0],h=0,f=0;u>c==u>-c?(s=c,c=e[++h]):(s=u,u=i[++f]);let d=0;if(h<t&&f<n)for(u>c==u>-c?(o=c+s,a=s-(o-c),c=e[++h]):(o=u+s,a=s-(o-u),u=i[++f]),s=o,0!==a&&(r[d++]=a);h<t&&f<n;)u>c==u>-c?(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++h]):(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=i[++f]),s=o,0!==a&&(r[d++]=a);for(;h<t;)o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++h],s=o,0!==a&&(r[d++]=a);for(;f<n;)o=s+u,l=o-s,a=s-(o-l)+(u-l),u=i[++f],s=o,0!==a&&(r[d++]=a);return 0===s&&0!==d||(r[d++]=s),d}function Uo(t){return new Float64Array(t)}const Wo=Uo(4),Yo=Uo(8),Xo=Uo(12),Jo=Uo(16),Go=Uo(4);function Ko(t,e,n,i,r,s){const o=(e-s)*(n-r),a=(t-r)*(i-s),l=o-a;if(0===o||0===a||o>0!=a>0)return l;const c=Math.abs(o+a);return Math.abs(l)>=3.3306690738754716e-16*c?l:-function(t,e,n,i,r,s,o){let a,l,c,u,h,f,d,p,m,g,_,v,y,b,x,w,k,S;const M=t-r,T=n-r,C=e-s,A=i-s;b=M*A,f=qo*M,d=f-(f-M),p=M-d,f=qo*A,m=f-(f-A),g=A-m,x=p*g-(b-d*m-p*m-d*g),w=C*T,f=qo*C,d=f-(f-C),p=C-d,f=qo*T,m=f-(f-T),g=T-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Wo[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Wo[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Wo[2]=v-(S-h)+(_-h),Wo[3]=S;let D=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,Wo),E=2.2204460492503146e-16*o;if(D>=E||-D>=E)return D;if(h=t-M,a=t-(M+h)+(h-r),h=n-T,c=n-(T+h)+(h-r),h=e-C,l=e-(C+h)+(h-s),h=i-A,u=i-(A+h)+(h-s),0===a&&0===l&&0===c&&0===u)return D;if(E=1.1093356479670487e-31*o+3.3306690738754706e-16*Math.abs(D),D+=M*u+A*a-(C*c+T*l),D>=E||-D>=E)return D;b=a*A,f=qo*a,d=f-(f-a),p=a-d,f=qo*A,m=f-(f-A),g=A-m,x=p*g-(b-d*m-p*m-d*g),w=l*T,f=qo*l,d=f-(f-l),p=l-d,f=qo*T,m=f-(f-T),g=T-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const N=Bo(4,Wo,4,Go,Yo);b=M*u,f=qo*M,d=f-(f-M),p=M-d,f=qo*u,m=f-(f-u),g=u-m,x=p*g-(b-d*m-p*m-d*g),w=C*c,f=qo*C,d=f-(f-C),p=C-d,f=qo*c,m=f-(f-c),g=c-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const z=Bo(N,Yo,4,Go,Xo);b=a*u,f=qo*a,d=f-(f-a),p=a-d,f=qo*u,m=f-(f-u),g=u-m,x=p*g-(b-d*m-p*m-d*g),w=l*c,f=qo*l,d=f-(f-l),p=l-d,f=qo*c,m=f-(f-c),g=c-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const P=Bo(z,Xo,4,Go,Jo);return Jo[P-1]}(t,e,n,i,r,s,c)}const Zo=Math.pow(2,-52),Qo=new Uint32Array(512);class ta{static from(t,e=oa,n=aa){const i=t.length,r=new Float64Array(2*i);for(let s=0;s<i;s++){const i=t[s];r[2*s]=e(i),r[2*s+1]=n(i)}return new ta(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,s=t.length>>1;let o=1/0,a=1/0,l=-1/0,c=-1/0;for(let e=0;e<s;e++){const n=t[2*e],i=t[2*e+1];n<o&&(o=n),i<a&&(a=i),n>l&&(l=n),i>c&&(c=i),this._ids[e]=e}const u=(o+l)/2,h=(a+c)/2;let f,d,p,m=1/0;for(let e=0;e<s;
vendor: 4,697 bytes, line 437
437e++){const n=ea(u,h,t[2*e],t[2*e+1]);n<m&&(f=e,m=n)}const g=t[2*f],_=t[2*f+1];m=1/0;for(let e=0;e<s;e++){if(e===f)continue;const n=ea(g,_,t[2*e],t[2*e+1]);n<m&&n>0&&(d=e,m=n)}let v=t[2*d],y=t[2*d+1],b=1/0;for(let e=0;e<s;e++){if(e===f||e===d)continue;const n=ia(g,_,v,y,t[2*e],t[2*e+1]);n<b&&(p=e,b=n)}let x=t[2*p],w=t[2*p+1];if(b===1/0){for(let e=0;e<s;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];ra(this._ids,this._dists,0,s-1);const e=new Uint32Array(s);let n=0;for(let t=0,i=-1/0;t<s;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ko(g,_,v,y,x,w)<0){const t=d,e=v,n=y;d=p,v=x,y=w,p=t,x=e,w=n}const k=function(t,e,n,i,r,s){const o=n-t,a=i-e,l=r-t,c=s-e,u=o*o+a*a,h=l*l+c*c,f=.5/(o*c-a*l);return{x:t+(c*u-a*h)*f,y:e+(o*h-l*u)*f}}(g,_,v,y,x,w);this._cx=k.x,this._cy=k.y;for(let e=0;e<s;e++)this._dists[e]=ea(t[2*e],t[2*e+1],k.x,k.y);ra(this._ids,this._dists,0,s-1),this._hullStart=f;let S=3;n[f]=e[p]=d,n[d]=e[f]=p,n[p]=e[d]=f,i[f]=0,i[d]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,_)]=f,r[this._hashKey(v,y)]=d,r[this._hashKey(x,w)]=p,this.trianglesLen=0,this._addTriangle(f,d,p,-1,-1,-1);for(let s,o,a=0;a<this._ids.length;a++){const l=this._ids[a],c=t[2*l],u=t[2*l+1];if(a>0&&Math.abs(c-s)<=Zo&&Math.abs(u-o)<=Zo)continue;if(s=c,o=u,l===f||l===d||l===p)continue;let h=0;for(let t=0,e=this._hashKey(c,u);t<this._hashSize&&(h=r[(e+t)%this._hashSize],-1===h||h===n[h]);t++);h=e[h];let m,g=h;for(;m=n[g],Ko(c,u,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===h){g=-1;break}if(-1===g)continue;let _=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(_+2),i[g]=_,S++;let v=n[g];for(;m=n[v],Ko(c,u,t[2*v],t[2*v+1],t[2*m],t[2*m+1])<0;)_=this._addTriangle(v,l,m,i[l],-1,i[v]),i[l]=this._legalize(_+2),n[v]=v,S--,v=m;if(g===h)for(;m=e[g],Ko(c,u,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)_=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(_+2),i[m]=_,n[g]=g,S--,g=m;this._hullStart=e[l]=g,n[g]=e[v]=l,n[l]=v,r[this._hashKey(c,u)]=l,r[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,s=0;for(;;){const o=n[t],a=t-t%3;if(s=a+(t+2)%3,-1===o){if(0===r)break;t=Qo[--r];continue}const l=o-o%3,c=a+(t+1)%3,u=l+(o+2)%3,h=e[s],f=e[t],d=e[c],p=e[u];if(na(i[2*h],i[2*h+1],i[2*f],i[2*f+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1])){e[t]=p,e[o]=h;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(o,n[s]),this._link(s,u);const a=l+(o+1)%3;r<Qo.length&&(Qo[r++]=a)}else{if(0===r)break;t=Qo[--r]}}return s}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,s){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,i),this._link(o+1,r),this._link(o+2,s),this.trianglesLen+=3,o}}function ea(t,e,n,i){const r=t-n,s=e-i;return r*r+s*s}function na(t,e,n,i,r,s,o,a){const l=t-o,c=e-a,u=n-o,h=i-a,f=r-o,d=s-a,p=u*u+h*h,m=f*f+d*d;return l*(h*m-p*d)-c*(u*m-p*f)+(l*l+c*c)*(u*d-h*f)<0}function ia(t,e,n,i,r,s){const o=n-t,a=i-e,l=r-t,c=s-e,u=o*o+a*a,h=l*l+c*c,f=.5/(o*c-a*l),d=(c*u-a*h)*f,p=(o*h-l*u)*f;return d*d+p*p}function ra(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],s=e[i];let o=r-1;for(;o>=n&&e[t[o]]>s;)t[o+1]=t[o--];t[o+1]=i}else{let r=n+1,s=i;sa(t,n+i>>1,r),e[t[n]]>e[t[i]]&&sa(t,n,i),e[t[r]]>e[t[i]]&&sa(t,r,i),e[t[n]]>e[t[r]]&&sa(t,n,r);const o=t[r],a=e[o];for(;;){do{r++}while(e[t[r]]<a);do{s--}while(e[t[s]]>a);if(s<r)break;sa(t,r,s)}t[n+1]=t[s],t[s]=o,i-r+1>=s-n?(ra(t,e,r,i),ra(t,e,n,s-1)):(ra(t,e,n,s-1),ra(t,e,r,i))}}function sa(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function oa(t){return t[0]}function aa(t){return t[1]}const la=1e-6;class ca{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>la||Math.abs(this._y1-r)>la)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n}
437,0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class ua{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class ha{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,i,s=0,o=0,a=n.length;s<a;s+=3,o+=2){const a=2*n[s],l=2*n[s+1],c=2*n[s+2],u=t[a],h=t[a+1],f=t[l],d=t[l+1],p=t[c],m=t[c+1],g=f-u,_=d-h,v=p-u,y=m-h,b=2*(g*y-_*v);if(Math.abs(b)<1e-9){let r=1e9;const s=2*n[0];r*=Math.sign((t[s]-u)*y-(t[s+1]-h)*v),e=(u+p)/2-r*y,i=(h+m)/2+r*v}else{const t=1/b,n=g*g+_*_,r=v*v+y*y;e=u+(y*n-_*r)*t,i=h+(g*r-v*n)*t}r[o]=e,r[o+1]=i}let s,o,a,l=e[e.length-1],c=4*l,u=t[2*l],h=t[2*l+1];i.fill(0);for(let n=0;n<e.length;++n)l=e[n],s=c,o=u,a=h,c=4*l,u=t[2*l],h=t[2*l+1],i[s+2]=i[c]=a-h,i[s+3]=i[c+1]=u-o}render(t){const e=null==t?t=new ca:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:s,vectors:o}=this;if(r.length<=1)return null;for(let e=0,i=n.length;e<i;++e){const i=n[e];if(i<e)continue;const r=2*Math.floor(e/3),o=2*Math.floor(i/3),a=s[r],l=s[r+1],c=s[o],u=s[o+1];this._renderSegment(a,l,c,u,t)}let a,l=r[r.length-1];for(let e=0;e<r.length;++e){a=l,l=r[e];const n=2*Math.floor(i[l]/3),c=s[n],u=s[n+1],h=4*a,f=this._project(c,u,o[h+2],o[h+3]);f&&this._renderSegment(c,u,f[0],f[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new ca:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new ca:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let t=2;t<r;t+=2)i[t]===i[t-2]&&i[t+1]===i[t-1]||e.lineTo(i[t],i[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new ua;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let s;const o=this._regioncode(t,e),a=this._regioncode(n,i);0===o&&0===a?(r.moveTo(t,e),r.lineTo(n,i)):(s=this._clipSegment(t,e,n,i,o,a))&&(r.moveTo(s[0],s[1]),r.lineTo(s[2],s[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let s=0,o=t.length;s<o;s+=2)if(e[i]==t[s]&&e[i+1]==t[s+1]&&e[(i+2)%r]==t[(s+o-2)%o]&&e[(i+3)%r]==t[(s+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,s=n[t];if(-1===s)return null;const o=[];let a=s;do{const n=Math.floor(a/3);if(o.push(e[2*n],e[2*n+1]),a=a%3==2?a-2:a+1,r[a]!==t)break;a=i[a]}while(a!==s&&-1!==a);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let i,r,s,o,a=null,l=e[n-2],c=e[n-1],u=this._regioncode(l,c),h=0;for(let f=0;f<n;f+=2)if(i=l,r=c,l=e[f],c=e[f+1],s=u,u=this._regioncode(l,c),0===s&&0===u)o=h,h=0,a?a.push(l,c):a=[l,c];else{let e,n,f,d,p;if(0===s){if(null===(e=this._clipSegment(i,r,l,c,s,u)))continue;[n,f,d,p]=e}else{if(null===(e=this._clipSegment(l,c,i,r,u,s)))continue;[d,p,n,f]=e,o=h,h=this._edgecode(n,f),o&&h&&this._edge(t,o,h,a,a.length),a?a.push(n,f):a=[n,f]}o=h,h=this._edgecode(d,p),o&&h&&this._edge(t,o,h,a,a.length),a?a.push(d,p):a=[d,p]}if(a)o=h,h=this._edgecode(a[0],a[1]),o&&h&&this._edge(t,o,h,a,a.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return a}_clipSegment(t,e,n,i,r,s){for(;;){if(0===r&&0===s)return[t,e,n,i];if(r&s)return null;let o,a,l=r||s;8&l?(o=t+(n-t)*(this.ymax-e)/(i-e),a=this.ymax):4&l?(o=t+(n-t)*(this.ymin-e)/(i-e),a=this.ymin):2&l?(a=e+(i-e)*(this.xmax-t)/(n-t),o=this.xmax):(a=e+(i-e)*(this.xmin-t)/(n-t),o=this.xmin),r?(t=o,e=a,r=this._regioncode(t,e)):(n=o,i=a,s=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,s){let o,a=Array.from(e);if((o=this._project(a[0],a[1],n,i))&&a.unshift(o[0],o[1]),(o=this._project(a[a.length-2],a[a.length-1],r,s
vendor: 4,158 bytes, line 437
437))&&a.push(o[0],o[1]),a=this._clipFinite(t,a))for(let e,n=0,i=a.length,r=this._edgecode(a[i-2],a[i-1]);n<i;n+=2)e=r,r=this._edgecode(a[n],a[n+1]),e&&r&&(n=this._edge(t,e,r,a,n),i=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,e,n,i,r){for(;e!==n;){let n,s;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,s=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,s=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,s=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,s=this.ymin}i[r]===n&&i[r+1]===s||!this.contains(t,n,s)||(i.splice(r,0,n,s),r+=2)}if(i.length>4)for(let t=0;t<i.length;t+=2){const e=(t+2)%i.length,n=(t+4)%i.length;(i[t]===i[e]&&i[e]===i[n]||i[t+1]===i[e+1]&&i[e+1]===i[n+1])&&(i.splice(e,2),t-=2)}return r}_project(t,e,n,i){let r,s,o,a=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<a&&(o=this.ymin,s=t+(a=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<a&&(o=this.ymax,s=t+(a=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<a&&(s=this.xmax,o=e+(a=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<a&&(s=this.xmin,o=e+(a=r)*i)}return[s,o]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const fa=2*Math.PI,da=Math.pow;function pa(t){return t[0]}function ma(t){return t[1]}function ga(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class _a{static from(t,e=pa,n=ma,i){return new _a("length"in t?function(t,e,n,i){const r=t.length,s=new Float64Array(2*r);for(let o=0;o<r;++o){const r=t[o];s[2*o]=e.call(i,r,o,t),s[2*o+1]=n.call(i,r,o,t)}return s}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const s of t)yield e.call(i,s,r,t),yield n.call(i,s,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new ta(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const i=2*e[t],r=2*e[t+1],s=2*e[t+2];if((n[s]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t<n;++t){const n=ga(e[2*t],e[2*t+1],r);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new ta(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=r[t%3==2?t-2:t+1];-1!==n[t]&&-1!==s[e]||(s[e]=t)}for(let t=0,e=i.length;t<e;++t)o[i[t]]=t;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,2===i.length&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new ha(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const a=e[t];if(-1===a)return;let l=a,c=-1;do{if(yield c=s[l],l=l%3==2?l-2:l+1,s[l]!==t)return;if(l=r[l],-1===l){const e=n[(i[t]+1)%n.length];return void(e!==c&&(yield e))}}while(l!==a)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:o,triangles:a,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let c=t,u=da(e-l[2*t],2)+da(n-l[2*t+1],2);const h=i[t];let f=h;do{let i=a[f];const h=da(e-l[2*i],2)+da(n-l[2*i+1],2);
vendor: 6,759 bytes, lines 437-438
437if(h<u&&(u=h,c=i),f=f%3==2?f-2:f+1,a[f]!==t)break;if(f=o[f],-1===f){if(f=r[(s[t]+1)%r.length],f!==i&&da(e-l[2*f],2)+da(n-l[2*f+1],2)<u)return f;break}}while(f!==h);return c}render(t){const e=null==t?t=new ca:void 0,{points:n,halfedges:i,triangles:r}=this;for(let e=0,s=i.length;e<s;++e){const s=i[e];if(s<e)continue;const o=2*r[e],a=2*r[s];t.moveTo(n[o],n[o+1]),t.lineTo(n[a],n[a+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new ca:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],s=i[n+1];t.moveTo(r+e,s),t.arc(r,s,e,0,fa)}return n&&n.value()}renderHull(t){const e=null==t?t=new ca:void 0,{hull:n,points:i}=this,r=2*n[0],s=n.length;t.moveTo(i[r],i[r+1]);for(let e=1;e<s;++e){const r=2*n[e];t.lineTo(i[r],i[r+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new ua;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new ca:void 0,{points:i,triangles:r}=this,s=2*r[t*=3],o=2*r[t+1],a=2*r[t+2];return e.moveTo(i[s],i[s+1]),e.lineTo(i[o],i[o+1]),e.lineTo(i[a],i[a+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new ua;return this.renderTriangle(t,e),e.value()}}var va={},ya={};function ba(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function xa(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var i in t)i in e||n.push(e[i]=i)}),n}function wa(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function ka(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+wa(-t,6):t>9999?"+"+wa(t,6):wa(t,4)}(t.getUTCFullYear())+"-"+wa(t.getUTCMonth()+1,2)+"-"+wa(t.getUTCDate(),2)+(r?"T"+wa(e,2)+":"+wa(n,2)+":"+wa(i,2)+"."+wa(r,3)+"Z":i?"T"+wa(e,2)+":"+wa(n,2)+":"+wa(i,2)+"Z":n||e?"T"+wa(e,2)+":"+wa(n,2)+"Z":"")}function Sa(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],s=t.length,o=0,a=0,l=s<=0,c=!1;function u(){if(l)return ya;if(c)return c=!1,va;var e,i,r=o;if(34===t.charCodeAt(r)){for(;o++<s&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=s?l=!0:10===(i=t.charCodeAt(o++))?c=!0:13===i&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<s;){if(10===(i=t.charCodeAt(e=o++)))c=!0;else if(13===i)c=!0,10===t.charCodeAt(o)&&++o;else if(i!==n)continue;return t.slice(r,e)}return l=!0,t.slice(r,s)}for(10===t.charCodeAt(s-1)&&--s,13===t.charCodeAt(s-1)&&--s;(i=u())!==ya;){for(var h=[];i!==va&&i!==ya;)h.push(i),i=u();e&&null==(h=e(h,a++))||r.push(h)}return r}function r(e,n){return e.map(function(e){return n.map(function(t){return o(e[t])}).join(t)})}function s(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?ka(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,s=i(t,function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=ba(t);return function(i,r){return e(n(i),r,t)}}(t,e):ba(t)});return s.columns=r||[],s},parseRows:i,format:function(e,n){return null==n&&(n=xa(e)),[n.map(o).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=xa(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(s).join("\n")},formatRow:s,formatValue:o}}var Ma=Sa(","),Ta=Ma.parse,Ca=Ma.parseRows,Aa=Ma.format,Da=Ma.formatBody,Ea=Ma.formatRows,Na=Ma.formatRow,za=Ma.formatValue,Pa=Sa("\t"),ja=Pa.parse,Ia=Pa.parseRows,$a=Pa.format,Ra=Pa.formatBody,La=Pa.formatRows,Fa=Pa.formatRow,Oa=Pa.formatValue;const Ha=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function Va(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function qa(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Ba(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Ua(t,e){return fetch(t,e).then(Ba)}function Wa(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),Ua(e,n).then(function(e){return t(e,i)})}}var Ya=Wa(Ta),Xa=Wa(ja);function Ja(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Ga(t){return(e,n)=>Ua(e,n).then(e=>(new DOMParser).parseFromString(e,t))}
438var Ka=Ga("application/xml"),Za=Ga("text/html"),Qa=Ga("image/svg+xml");function tl(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,s,o,a,l,c,u,h,f,d=t._root,p={data:i},m=t._x0,g=t._y0,_=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(s=(m+_)/2))?m=s:_=s,(u=n>=(o=(g+v)/2))?g=o:v=o,r=d,!(d=d[h=u<<1|c]))return r[h]=p,t;if(a=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===a&&n===l)return p.next=d,r?r[h]=p:t._root=p,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(c=e>=(s=(m+_)/2))?m=s:_=s,(u=n>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|a>=s));return r[f]=d,r[h]=p,t}function el(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function nl(t){return t[0]}function il(t){return t[1]}function rl(t,e,n){var i=new sl(null==e?nl:e,null==n?il:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function sl(t,e,n,i,r,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function ol(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var al=rl.prototype=sl.prototype;function ll(t){return function(){return t}}function cl(t){return 1e-6*(t()-.5)}function ul(t){return t.x+t.vx}function hl(t){return t.y+t.vy}function fl(t){return t.index}function dl(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}al.copy=function(){var t,e,n=new sl(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=ol(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=ol(e));return n},al.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return tl(this.cover(e,n),e,n,t)},al.addAll=function(t){var e,n,i,r,s=t.length,o=new Array(s),a=new Array(s),l=1/0,c=1/0,u=-1/0,h=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(o[n]=i,a[n]=r,i<l&&(l=i),i>u&&(u=i),r<c&&(c=r),r>h&&(h=r));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),n=0;n<s;++n)tl(this,o[n],a[n],t[n]);return this},al.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,s=(i=Math.floor(e))+1;
vendor: 3,234 bytes, line 438
438else{for(var o,a,l=r-n||1,c=this._root;n>t||t>=r||i>e||e>=s;)switch(a=(e<i)<<1|t<n,(o=new Array(4))[a]=c,c=o,l*=2,a){case 0:r=n+l,s=i+l;break;case 1:n=r-l,s=i+l;break;case 2:r=n+l,i=s-l;break;case 3:n=r-l,i=s-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this},al.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},al.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},al.find=function(t,e,n){var i,r,s,o,a,l,c,u=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],m=this._root;for(m&&p.push(new el(m,u,h,f,d)),null==n?n=1/0:(u=t-n,h=e-n,f=t+n,d=e+n,n*=n);l=p.pop();)if(!(!(m=l.node)||(r=l.x0)>f||(s=l.y0)>d||(o=l.x1)<u||(a=l.y1)<h))if(m.length){var g=(r+o)/2,_=(s+a)/2;p.push(new el(m[3],g,_,o,a),new el(m[2],r,_,g,a),new el(m[1],g,s,o,_),new el(m[0],r,s,g,_)),(c=(e>=_)<<1|t>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var v=t-+this._x.call(null,m.data),y=e-+this._y.call(null,m.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);u=t-x,h=e-x,f=t+x,d=e+x,i=m.data}}return i},al.remove=function(t){if(isNaN(s=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,i,r,s,o,a,l,c,u,h,f,d=this._root,p=this._x0,m=this._y0,g=this._x1,_=this._y1;if(!d)return this;if(d.length)for(;;){if((c=s>=(a=(p+g)/2))?p=a:g=a,(u=o>=(l=(m+_)/2))?m=l:_=l,e=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(i=d,!(d=d.next))return this;return(r=d.next)&&delete d.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=r,this)},al.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},al.root=function(){return this._root},al.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},al.visit=function(t){var e,n,i,r,s,o,a=[],l=this._root;for(l&&a.push(new el(l,this._x0,this._y0,this._x1,this._y1));e=a.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,s=e.x1,o=e.y1)&&l.length){var c=(i+s)/2,u=(r+o)/2;(n=l[3])&&a.push(new el(n,c,u,s,o)),(n=l[2])&&a.push(new el(n,i,u,c,o)),(n=l[1])&&a.push(new el(n,c,r,s,u)),(n=l[0])&&a.push(new el(n,i,r,c,u))}return this},al.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new el(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var s,o=e.x0,a=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,h=(a+c)/2;(s=r[0])&&n.push(new el(s,o,a,u,h)),(s=r[1])&&n.push(new el(s,u,a,l,h)),(s=r[2])&&n.push(new el(s,o,h,u,c)),(s=r[3])&&n.push(new el(s,u,h,l,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},al.x=function(t){return arguments.length?(this._x=t,this):this._x},al.y=function(t){return arguments.length?(this._y=t,this):this._y};const pl=4294967296;function ml(t){return t.x}function gl(t){return t.y}var _l=Math.PI*(3-Math.sqrt(5));function vl(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>
vendor: 4,327 bytes, line 438
4381?i[0]+i.slice(2):i,+t.slice(n+1)]}function yl(t){return(t=vl(Math.abs(t)))?t[1]:NaN}var bl,xl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wl(t){if(!(e=xl.exec(t)))throw new Error("invalid format: "+t);var e;return new kl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function kl(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Sl(t,e){var n=vl(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}wl.prototype=kl.prototype,kl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ml={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Sl(100*t,e),r:Sl,s:function(t,e){var n=vl(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(bl=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+vl(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Tl(t){return t}var Cl,Al=Array.prototype.map,Dl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function El(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Tl:(e=Al.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Tl:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(Al.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"\u2212":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=wl(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,m=t.comma,g=t.precision,_=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Ml[v]||(void 0===g&&(g=12),_=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var y="$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===f?s:/[%p]/.test(v)?l:"",x=Ml[v],w=/[defgprs%]/.test(v);function k(t){var r,s,l,f=y,k=b;if("c"===v)k=x(t)+k,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:x(Math.abs(t),g),_&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==h&&(S=!1),f=(S?"("===h?h:c:"-"===h||"("===h?"":h)+f,k=("s"===v?Dl[8+bl/3]:"")+k+(S&&"("===h?")":""),w)for(r=-1,s=t.length;++r<s;)if(48>(l=t.charCodeAt(r))||l>57){k=(46===l?o+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}m&&!d&&(t=i(t,1/0));var M=f.length+t.length+k.length,T=M<p?new Array(p-M+1).join(e):"";switch(m&&d&&(t=i(T+t,T.length?p-k.length:1/0),T=""),n){case"<":t=f+t+k+T;break;case"=":t=f+T+t+k;break;case"^":t=T.slice(0,M=T.length>>1)+f+t+k+T.slice(M);break;default:t=T+f+t+k}return a(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=wl(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(yl(e)/3))),r=Math.pow(10,-i),s=Dl[8+i/3];return function(t){return n(r*t)+s}}}}function Nl(e){return Cl=El(e),t.format=Cl.format,t.formatPrefix=Cl.formatPrefix,Cl}
vendor: 6,923 bytes, line 438
438function zl(t){return Math.max(0,-yl(Math.abs(t)))}function Pl(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(yl(e)/3)))-yl(Math.abs(t)))}function jl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yl(e)-yl(t))+1}t.format=void 0,t.formatPrefix=void 0,Nl({thousands:",",grouping:[3],currency:["$",""]});var Il=1e-6,$l=1e-12,Rl=Math.PI,Ll=Rl/2,Fl=Rl/4,Ol=2*Rl,Hl=180/Rl,Vl=Rl/180,ql=Math.abs,Bl=Math.atan,Ul=Math.atan2,Wl=Math.cos,Yl=Math.ceil,Xl=Math.exp,Jl=Math.hypot,Gl=Math.log,Kl=Math.pow,Zl=Math.sin,Ql=Math.sign||function(t){return t>0?1:t<0?-1:0},tc=Math.sqrt,ec=Math.tan;function nc(t){return t>1?0:t<-1?Rl:Math.acos(t)}function ic(t){return t>1?Ll:t<-1?-Ll:Math.asin(t)}function rc(t){return(t=Zl(t/2))*t}function sc(){}function oc(t,e){t&&lc.hasOwnProperty(t.type)&&lc[t.type](t,e)}var ac={Feature:function(t,e){oc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)oc(n[i].geometry,e)}},lc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){cc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)cc(n[i],e,0)},Polygon:function(t,e){uc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)uc(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)oc(n[i],e)}};function cc(t,e,n){var i,r=-1,s=t.length-n;for(e.lineStart();++r<s;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function uc(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)cc(t[n],e,1);e.polygonEnd()}function hc(t,e){t&&ac.hasOwnProperty(t.type)?ac[t.type](t,e):oc(t,e)}var fc,dc,pc,mc,gc,_c,vc,yc,bc,xc,wc,kc,Sc,Mc,Tc,Cc,Ac=new g,Dc=new g,Ec={point:sc,lineStart:sc,lineEnd:sc,polygonStart:function(){Ac=new g,Ec.lineStart=Nc,Ec.lineEnd=zc},polygonEnd:function(){var t=+Ac;Dc.add(t<0?Ol+t:t),this.lineStart=this.lineEnd=this.point=sc},sphere:function(){Dc.add(Ol)}};function Nc(){Ec.point=Pc}function zc(){jc(fc,dc)}function Pc(t,e){Ec.point=jc,fc=t,dc=e,pc=t*=Vl,mc=Wl(e=(e*=Vl)/2+Fl),gc=Zl(e)}function jc(t,e){var n=(t*=Vl)-pc,i=n>=0?1:-1,r=i*n,s=Wl(e=(e*=Vl)/2+Fl),o=Zl(e),a=gc*o,l=mc*s+a*Wl(r),c=a*i*Zl(r);Ac.add(Ul(c,l)),pc=t,mc=s,gc=o}function Ic(t){return[Ul(t[1],t[0]),ic(t[2])]}function $c(t){var e=t[0],n=t[1],i=Wl(n);return[i*Wl(e),i*Zl(e),Zl(n)]}function Rc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Lc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Fc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Oc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hc(t){var e=tc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Vc,qc,Bc,Uc,Wc,Yc,Xc,Jc,Gc,Kc,Zc,Qc,tu,eu,nu,iu,ru={point:su,lineStart:au,lineEnd:lu,polygonStart:function(){ru.point=cu,ru.lineStart=uu,ru.lineEnd=hu,Mc=new g,Ec.polygonStart()},polygonEnd:function(){Ec.polygonEnd(),ru.point=su,ru.lineStart=au,ru.lineEnd=lu,Ac<0?(_c=-(yc=180),vc=-(bc=90)):Mc>Il?bc=90:Mc<-1e-6&&(vc=-90),Cc[0]=_c,Cc[1]=yc},sphere:function(){_c=-(yc=180),vc=-(bc=90)}};function su(t,e){Tc.push(Cc=[_c=t,yc=t]),e<vc&&(vc=e),e>bc&&(bc=e)}function ou(t,e){var n=$c([t*Vl,e*Vl]);if(Sc){var i=Lc(Sc,n),r=Lc([i[1],-i[0],0],i);Hc(r),r=Ic(r);var s,o=t-xc,a=o>0?1:-1,l=r[0]*Hl*a,c=ql(o)>180;c^(a*xc<l&&l<a*t)?(s=r[1]*Hl)>bc&&(bc=s):c^(a*xc<(l=(l+360)%360-180)&&l<a*t)?(s=-r[1]*Hl)<vc&&(vc=s):(e<vc&&(vc=e),e>bc&&(bc=e)),c?t<xc?fu(_c,t)>fu(_c,yc)&&(yc=t):fu(t,yc)>fu(_c,yc)&&(_c=t):yc>=_c?(t<_c&&(_c=t),t>yc&&(yc=t)):t>xc?fu(_c,t)>fu(_c,yc)&&(yc=t):fu(t,yc)>fu(_c,yc)&&(_c=t)}else Tc.push(Cc=[_c=t,yc=t]);e<vc&&(vc=e),e>bc&&(bc=e),Sc=n,xc=t}function au(){ru.point=ou}function lu(){Cc[0]=_c,Cc[1]=yc,ru.point=su,Sc=null}function cu(t,e){if(Sc){var n=t-xc;Mc.add(ql(n)>180?n+(n>0?360:-360):n)}else wc=t,kc=e;Ec.point(t,e),ou(t,e)}function uu(){Ec.lineStart()}function hu(){cu(wc,kc),Ec.lineEnd(),ql(Mc)>Il&&(_c=-(yc=180)),Cc[0]=_c,Cc[1]=yc,Sc=null}function fu(t,e){return(e-=t)<0?e+360:e}function du(t,e){return t[0]-e[0]}function pu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var mu={sphere:sc,point:gu,lineStart:vu,lineEnd:xu,polygonStart:function(){mu.lineStart=wu,mu.lineEnd=ku},polygonEnd:function(){mu.lineStart=vu,mu.lineEnd=xu}};function gu(t,e){t*=Vl;var n=Wl(e*=Vl);_u(n*Wl(t),n*Zl(t),Zl(e))}function _u(t,e,n){++Vc,Bc+=(t-Bc)/Vc,Uc+=(e-Uc)/Vc,Wc+=(n-Wc)/Vc}function vu(){mu.point=yu}function yu(t,e){t*=Vl;var n=Wl(e*=Vl);eu=n*Wl(t),nu=n*Zl(t),iu=Zl(e),mu.point=bu,_u(eu,nu,iu)}function bu(t,e){t*=Vl;var n=Wl(e*=Vl),i=n*Wl(t),r=n*Zl(t),s=Zl(e),o=Ul(tc((o=nu*s-iu*r)*o+(o=iu*i-eu*s)*o+(o=eu*r-nu*i)*o),eu*i+nu*r+iu*s);qc+=o,Yc+=o*(eu+(eu=i)),Xc+=o*(nu+(nu=r)),Jc+=o*(iu+(iu=s)),_u(eu,nu,iu)}function xu(){mu.point=gu}function wu(){mu.point=Su}function ku(){Mu(Qc,tu),mu.point=gu}function Su(t,e){Qc=t,tu=e,t*=Vl,e*=Vl,mu.point=Mu;var n=Wl(e);eu=n*Wl(t),nu=n*Zl(t),iu=Zl(e),_u(eu,nu,iu)}function Mu(t,e){t*=Vl;var n=Wl(e*=Vl),i=n*Wl(t),r=n*Zl(t),s=Zl(e),o=nu*s-iu*r,a=iu*i-eu*s,l=eu*r-nu*i,c=Jl(o,a,l),u=ic(c),h=c&&-u/c;Gc.add(h*o),Kc.add(h*a),Zc.add(h*l),qc+=u,Yc+=u*(eu+(eu=i)),Xc+=u*(nu+(nu=r)),Jc+=u*(iu+(iu=s)),_u(eu,nu,iu)}function Tu(t){return function(){return t}}function Cu(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Au(t,e){return[ql(t)>Rl?t+Math.round(-t/Ol)*Ol:t,e]}function Du(t,e,n){return(t%=Ol)?e||n?Cu(Nu(t),zu(e,n)):Nu(t):e||n?zu(e,n):Au}function Eu(t){return function(e,n){return[(e+=t)>Rl?e-Ol:e<-Rl?e+Ol:e,n]}}function Nu(t){var e=Eu(t);return e.invert=Eu(-t),e}function zu(t,e){var n=Wl(t),i=Zl(t),r=Wl(e),s=Zl(e);function o(t,e){var o=Wl(e),a=Wl(t)*o,l=Zl(t)*o,c=Zl(e),u=c*n+a*i;return[Ul(l*r-u*s,a*n-c*i),ic(u*r+l*s)]}return o.invert=function(t,e){var o=Wl(e),a=Wl(t)*o,l=Zl(t)*o,c=Zl(e),u=c*r-l*s;return[Ul(l*r+c*s,a*n+u*i),ic(u*n-a*i)]},o}function Pu(t){function e(e){return(e=t(e[0]*Vl,e[1]*Vl))[0]*=Hl,e[1]*=Hl,e}return t=Du(t[0]*Vl,t[1]*Vl,t.length>2?t[2]*Vl:0),e.invert=function(e){return(e=t.invert(e[0]*Vl,e[1]*Vl))[0]*=Hl,e[1]*=Hl,e},e}function ju(t,e,n,i,r,s){if(n){var o=Wl(e),a=Zl(e),l=i*n;null==r?(r=e+i*Ol,s=e-l/2):(r=Iu(o,r),s=Iu(o,s),(i>0?r<s:r>s)&&(r+=i*Ol));for(var c,u=r;i>0?u>s:u<s;u-=l)c=Ic([o,-a*Wl(u),-a*Zl(u)]),t.point(c[0],c[1])}}function Iu(t,e){(e=$c(e))[0]-=t,Hc(e);var n=nc(-e[1]);return((-e[2]<0?-n:n)+Ol-Il)%Ol}function $u(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:sc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ru(t,e){return ql(t[0]-e[0])<Il&&ql(t[1]-e[1])<Il}function Lu(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Fu(t,e,n,i,r){var s,o,a=[],l=[];
vendor: 5,120 bytes, line 438
438if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(Ru(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),s=0;s<e;++s)r.point((i=t[s])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}a.push(n=new Lu(i,t,null,!0)),l.push(n.o=new Lu(i,null,n,!1)),a.push(n=new Lu(o,t,null,!1)),l.push(n.o=new Lu(o,null,n,!0))}}),a.length){for(l.sort(e),Ou(a),Ou(l),s=0,o=l.length;s<o;++s)l[s].e=n=!n;for(var c,u,h=a[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(s=0,o=c.length;s<o;++s)r.point((u=c[s])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(d)for(c=f.p.z,s=c.length-1;s>=0;--s)r.point((u=c[s])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);r.lineEnd()}}}function Ou(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Hu(t){return ql(t[0])<=Rl?t[0]:Ql(t[0])*((ql(t[0])+Rl)%Ol-Rl)}function Vu(t,e){var n=Hu(e),i=e[1],r=Zl(i),s=[Zl(n),-Wl(n),0],o=0,a=0,l=new g;1===r?i=Ll+Il:-1===r&&(i=-Ll-Il);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,d=h[f-1],p=Hu(d),m=d[1]/2+Fl,_=Zl(m),v=Wl(m),y=0;y<f;++y,p=x,_=k,v=S,d=b){var b=h[y],x=Hu(b),w=b[1]/2+Fl,k=Zl(w),S=Wl(w),M=x-p,T=M>=0?1:-1,C=T*M,A=C>Rl,D=_*k;if(l.add(Ul(D*T*Zl(C),v*S+D*Wl(C))),o+=A?M+T*Ol:M,A^p>=n^x>=n){var E=Lc($c(d),$c(b));Hc(E);var N=Lc(s,E);Hc(N);var z=(A^M>=0?-1:1)*ic(N[2]);(i>z||i===z&&(E[0]||E[1]))&&(a+=A^M>=0?1:-1)}}return(o<-1e-6||o<Il&&l<-1e-12)^1&a}function qu(t,e,n,i){return function(r){var s,o,a,l=e(r),c=$u(),u=e(c),h=!1,f={point:d,lineStart:m,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,o=[],s=[]},polygonEnd:function(){f.point=d,f.lineStart=m,f.lineEnd=g,o=Q(o);var t=Vu(s,i);o.length?(h||(r.polygonStart(),h=!0),Fu(o,Uu,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=s=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function d(e,n){t(e,n)&&r.point(e,n)}function p(t,e){l.point(t,e)}function m(){f.point=p,l.lineStart()}function g(){f.point=d,l.lineEnd()}function _(t,e){a.push([t,e]),u.point(t,e)}function v(){u.lineStart(),a=[]}function y(){_(a[0][0],a[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),d=f.length;if(a.pop(),s.push(a),a=null,d)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else d>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(Bu))}return f}}function Bu(t){return t.length>1}function Uu(t,e){return((t=t.x)[0]<0?t[1]-Ll-Il:Ll-t[1])-((e=e.x)[0]<0?e[1]-Ll-Il:Ll-e[1])}Au.invert=Au;var Wu=qu(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(s,o){var a=s>0?Rl:-Rl,l=ql(s-n);ql(l-Rl)<Il?(t.point(n,i=(i+o)/2>0?Ll:-Ll),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(s,i),e=0):r!==a&&l>=Rl&&(ql(n-r)<Il&&(n-=r*Il),ql(s-a)<Il&&(s-=a*Il),i=function(t,e,n,i){var r,s,o=Zl(t-n);return ql(o)>Il?Bl((Zl(e)*(s=Wl(i))*Zl(n)-Zl(i)*(r=Wl(e))*Zl(t))/(r*s*o)):(e+i)/2}(n,i,s,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=s,i=o),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*Ll,i.point(-Rl,r),i.point(0,r),i.point(Rl,r),i.point(Rl,0),i.point(Rl,-r),i.point(0,-r),i.point(-Rl,-r),i.point(-Rl,0),i.point(-Rl,r);else if(ql(t[0]-e[0])>Il){var s=t[0]<e[0]?Rl:-Rl;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(e[0],e[1])},[-Rl,-Ll]);function Yu(t){var e=Wl(t),n=6*Vl,i=e>0,r=ql(e)>Il;function s(t,n){return Wl(t)*Wl(n)>e}function o(t,n,i){var r=[1,0,0],s=Lc($c(t),$c(n)),o=Rc(s,s),a=s[0],l=o-a*a;if(!l)return!i&&t;var c=e*o/l,u=-e*a/l,h=Lc(r,s),f=Oc(r,c);Fc(f,Oc(s,u));var d=h,p=Rc(f,d),m=Rc(d,d),g=p*p-m*(Rc(f,f)-1);if(!(g<0)){var _=tc(g),v=Oc(d,(-p-_)/m);if(Fc(v,f),v=Ic(v),!i)return v;var y,b=t[0],x=n[0],w=t[1],k=n[1];x<b&&(y=b,b=x,x=y);var S=x-b,M=ql(S-Rl)<Il;if(!M&&k<w&&(y=w,w=k,k=y),M||S<Il?M?w+k>0^v[1]<(ql(v[0]-b)<Il?w:k):w<=v[1]&&v[1]<=k:S>Rl^(b<=v[0]&&v[0]<=x)){var T=Oc(d,(-p+_)/m);return Fc(T,f),[v,Ic(T)]}}}function a(e,n){var r=i?t:Rl-t,s=0;return e<-r?s|=1:e>r&&(s|=2),n<-r?s|=4:n>r&&(s|=8),s}return qu(s,function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],m=s(h,f),g=i?m?0:a(h,f):m?a(h+(h<0?Rl:-Rl),f):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(!(d=o(e,p))||Ru(e,d)||Ru(p,d))&&(p[2]=1),m!==l)u=0,m?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(r&&e&&i^m){var _;g&n||!(_=o(p,e,!0))||(u=0,i?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1],3)))}!m||e&&Ru(e,p)||t.point(p[0],p[1]),e=p,l=m,n=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},function(e,i,r,s){ju(s,t,n,r,e,i)},i?[0,-t]:[-Rl,t-Rl])}var Xu,Ju,Gu,Ku,Zu=1e9,Qu=-Zu;function th(t,e,n,i){function r(r,s){return t<=r&&r<=n&&e<=s&&s<=i}function s(r,s,a,c){var u=0,h=0;
vendor: 11,334 bytes, lines 438-439
438if(null==r||(u=o(r,a))!==(h=o(s,a))||l(r,s)<0^a>0){do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+a+4)%4)!==h)}else c.point(s[0],s[1])}function o(i,r){return ql(i[0]-t)<Il?r>0?0:3:ql(i[0]-n)<Il?r>0?2:1:ql(i[1]-e)<Il?r>0?1:0:r>0?3:2}function a(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,d,p,m,g,_,v,y=o,b=$u(),x={point:w,lineStart:function(){x.point=k,c&&c.push(u=[]);_=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(k(h,f),d&&g&&b.rejoin(),l.push(b.result()));x.point=w,g&&y.lineEnd()},polygonStart:function(){y=b,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var s,o,a=c[n],l=1,u=a.length,h=a[0],f=h[0],d=h[1];l<u;++l)s=f,o=d,f=(h=a[l])[0],d=h[1],o<=i?d>i&&(f-s)*(i-o)>(d-o)*(t-s)&&++e:d<=i&&(f-s)*(i-o)<(d-o)*(t-s)&&--e;return e}(),n=v&&e,r=(l=Q(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),r&&Fu(l,a,e,s,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function k(s,o){var a=r(s,o);if(c&&u.push([s,o]),_)h=s,f=o,d=a,_=!1,a&&(y.lineStart(),y.point(s,o));else if(a&&g)y.point(s,o);else{var l=[p=Math.max(Qu,Math.min(Zu,p)),m=Math.max(Qu,Math.min(Zu,m))],b=[s=Math.max(Qu,Math.min(Zu,s)),o=Math.max(Qu,Math.min(Zu,o))];!function(t,e,n,i,r,s){var o,a=t[0],l=t[1],c=0,u=1,h=e[0]-a,f=e[1]-l;if(o=n-a,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-a,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=s-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=a+c*h,t[1]=l+c*f),u<1&&(e[0]=a+u*h,e[1]=l+u*f),!0}}}}}(l,b,t,e,n,i)?a&&(y.lineStart(),y.point(s,o),v=!1):(g||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),a||y.lineEnd(),v=!1)}p=s,m=o,g=a}return x}}var eh={sphere:sc,point:sc,lineStart:function(){eh.point=ih,eh.lineEnd=nh},lineEnd:sc,polygonStart:sc,polygonEnd:sc};function nh(){eh.point=eh.lineEnd=sc}function ih(t,e){Ju=t*=Vl,Gu=Zl(e*=Vl),Ku=Wl(e),eh.point=rh}function rh(t,e){t*=Vl;var n=Zl(e*=Vl),i=Wl(e),r=ql(t-Ju),s=Wl(r),o=i*Zl(r),a=Ku*n-Gu*i*s,l=Gu*n+Ku*i*s;Xu.add(Ul(tc(o*o+a*a),l)),Ju=t,Gu=n,Ku=i}function sh(t){return Xu=new g,hc(t,eh),+Xu}var oh=[null,null],ah={type:"LineString",coordinates:oh};function lh(t,e){return oh[0]=t,oh[1]=e,sh(ah)}var ch={Feature:function(t,e){return hh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(hh(n[i].geometry,e))return!0;return!1}},uh={Sphere:function(){return!0},Point:function(t,e){return fh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(fh(n[i],e))return!0;return!1},LineString:function(t,e){return dh(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(dh(n[i],e))return!0;return!1},Polygon:function(t,e){return ph(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(ph(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(hh(n[i],e))return!0;return!1}};function hh(t,e){return!(!t||!uh.hasOwnProperty(t.type))&&uh[t.type](t,e)}function fh(t,e){return 0===lh(t,e)}function dh(t,e){for(var n,i,r,s=0,o=t.length;s<o;s++){if(0===(i=lh(t[s],e)))return!0;if(s>0&&(r=lh(t[s],t[s-1]))>0&&n<=r&&i<=r&&(n+i-r)*(1-Math.pow((n-i)/r,2))<$l*r)return!0;n=i}return!1}function ph(t,e){return!!Vu(t.map(mh),gh(e))}function mh(t){return(t=t.map(gh)).pop(),t}function gh(t){return[t[0]*Vl,t[1]*Vl]}function _h(t,e,n){var i=nt(t,e-Il,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function vh(t,e,n){var i=nt(t,e-Il,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function yh(){var t,e,n,i,r,s,o,a,l,c,u,h,f=10,d=f,p=90,m=360,g=2.5;function _(){return{type:"MultiLineString",coordinates:v()}}function v(){return nt(Yl(i/p)*p,n,p).map(u).concat(nt(Yl(a/m)*m,o,m).map(h)).concat(nt(Yl(e/f)*f,t,f).filter(function(t){return ql(t%p)>Il}).map(l)).concat(nt(Yl(s/d)*d,r,d).filter(function(t){return ql(t%m)>Il}).map(c))}return _.lines=function(){return v().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(h(o).slice(1),u(n).reverse().slice(1),h(a).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],a=+t[0][1],o=+t[1][1],i>n&&(t=i,i=n,n=t),a>o&&(t=a,a=o,o=t),_.precision(g)):[[i,a],[n,o]]},_.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],s=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),s>r&&(n=s,s=r,r=n),_.precision(g)):[[e,s],[t,r]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],m=+t[1],_):[p,m]},_.stepMinor=function(t){return arguments.length?(f=+t[0],d=+t[1],_):[f,d]},_.precision=function(f){return arguments.length?(g=+f,l=_h(s,r,90),c=vh(e,t,g),u=_h(a,o,90),h=vh(i,n,g),_):g},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var bh,xh,wh,kh,Sh=t=>t,Mh=new g,Th=new g,Ch={point:sc,lineStart:sc,lineEnd:sc,polygonStart:function(){Ch.lineStart=Ah,Ch.lineEnd=Nh},polygonEnd:function(){Ch.lineStart=Ch.lineEnd=Ch.point=sc,Mh.add(ql(Th)),Th=new g},result:function(){var t=Mh/2;return Mh=new g,t}};function Ah(){Ch.point=Dh}function Dh(t,e){Ch.point=Eh,bh=wh=t,xh=kh=e}function Eh(t,e){Th.add(kh*t-wh*e),wh=t,kh=e}function Nh(){Eh(bh,xh)}var zh=Ch,Ph=1/0,jh=Ph,Ih=-Ph,$h=Ih,Rh={point:function(t,e){t<Ph&&(Ph=t);t>Ih&&(Ih=t);e<jh&&(jh=e);e>$h&&($h=e)},lineStart:sc,lineEnd:sc,polygonStart:sc,polygonEnd:sc,result:function(){var t=[[Ph,jh],[Ih,$h]];return Ih=$h=-(jh=Ph=1/0),t}};var Lh,Fh,Oh,Hh,Vh=Rh,qh=0,Bh=0,Uh=0,Wh=0,Yh=0,Xh=0,Jh=0,Gh=0,Kh=0,Zh={point:Qh,lineStart:tf,lineEnd:rf,polygonStart:function(){Zh.lineStart=sf,Zh.lineEnd=of},polygonEnd:function(){Zh.point=Qh,Zh.lineStart=tf,Zh.lineEnd=rf},result:function(){var t=Kh?[Jh/Kh,Gh/Kh]:Xh?[Wh/Xh,Yh/Xh]:Uh?[qh/Uh,Bh/Uh]:[NaN,NaN];return qh=Bh=Uh=Wh=Yh=Xh=Jh=Gh=Kh=0,t}};function Qh(t,e){qh+=t,Bh+=e,++Uh}function tf(){Zh.point=ef}function ef(t,e){Zh.point=nf,Qh(Oh=t,Hh=e)}function nf(t,e){var n=t-Oh,i=e-Hh,r=tc(n*n+i*i);Wh+=r*(Oh+t)/2,Yh+=r*(Hh+e)/2,Xh+=r,Qh(Oh=t,Hh=e)}function rf(){Zh.point=Qh}function sf(){Zh.point=af}function of(){lf(Lh,Fh)}function af(t,e){Zh.point=lf,Qh(Lh=Oh=t,Fh=Hh=e)}function lf(t,e){var n=t-Oh,i=e-Hh,r=tc(n*n+i*i);Wh+=r*(Oh+t)/2,Yh+=r*(Hh+e)/2,Xh+=r,Jh+=(r=Hh*t-Oh*e)*(Oh+t),Gh+=r*(Hh+e),Kh+=3*r,Qh(Oh=t,Hh=e)}var cf=Zh;function uf(t){this._context=t}uf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ol)}},result:sc};var hf,ff,df,pf,mf,gf=new g,_f={point:sc,lineStart:function(){_f.point=vf},lineEnd:function(){hf&&yf(ff,df),_f.point=sc},polygonStart:function(){hf=!0},polygonEnd:function(){hf=null},result:function(){var t=+gf;return gf=new g,t}};function vf(t,e){_f.point=yf,ff=pf=t,df=mf=e}function yf(t,e){pf-=t,mf-=e,gf.add(tc(pf*pf+mf*mf)),pf=t,mf=e}var bf=_f;function xf(){this._string=[]}function wf(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function kf(t){return function(e){var n=new Sf;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Sf(){}function Mf(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),hc(n,t.stream(Vh)),e(Vh.result()),null!=i&&t.clipExtent(i),t}function Tf(t,e,n){return Mf(t,function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([o,a])},n)}function Cf(t,e,n){return Tf(t,[[0,0],e],n)}function Af(t,e,n){return Mf(t,function(n){var i=+e,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([s,o])},n)}function Df(t,e,n){return Mf(t,function(n){var i=+e,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([s,o])},n)}xf.prototype={_radius:4.5,_circle:wf(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=wf(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Sf.prototype={constructor:Sf,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ef=Wl(30*Vl);function Nf(t,e){return+e?function(t,e){function n(i,r,s,o,a,l,c,u,h,f,d,p,m,g){var _=c-i,v=u-r,y=_*_+v*v;if(y>4*e&&m--){var b=o+f,x=a+d,w=l+p,k=tc(b*b+x*x+w*w),S=ic(w/=k),M=ql(ql(w)-1)<Il||ql(s-h)<Il?(s+h)/2:Ul(x,b),T=t(M,S),C=T[0],A=T[1],D=C-i,E=A-r,N=v*D-_*E;(N*N/y>e||ql((_*D+v*E)/y-.5)>.3||o*f+a*d+l*p<Ef)&&(n(i,r,s,o,a,l,C,A,M,b/=k,x/=k,w,m,g),g.point(C,A),n(C,A,M,b,x,w,c,u,h,f,d,p,m,g))}}return function(e){var i,r,s,o,a,l,c,u,h,f,d,p,m={point:g,lineStart:_,lineEnd:y,polygonStart:function(){e.polygonStart(),m.lineStart=b},polygonEnd:function(){e.polygonEnd(),m.lineStart=_}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function _(){u=NaN,m.point=v,e.lineStart()}function v(i,r){var s=$c([i,r]),o=t(i,r);n(u,h,c,f,d,p,u=o[0],h=o[1],c=i,f=s[0],d=s[1],p=s[2],16,e),e.point(u,h)}function y(){m.point=g,e.lineEnd()}function b(){_(),m.point=x,m.lineEnd=w}function x(t,e){v(i=t,e),r=u,s=h,o=f,a=d,l=p,m.point=v}function w(){n(u,h,c,f,d,p,r,s,i,o,a,l,16,e),m.lineEnd=y,y()}return m}}(t,e):function(t){return kf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var zf=kf({point:function(t,e){
439this.stream.point(t*Vl,e*Vl)}});function Pf(t,e,n,i,r,s){if(!s)return function(t,e,n,i,r){function s(s,o){return[e+t*(s*=i),n-t*(o*=r)]}return s.invert=function(s,o){return[(s-e)/t*i,(n-o)/t*r]},s}(t,e,n,i,r);var o=Wl(s),a=Zl(s),l=o*t,c=a*t,u=o/t,h=a/t,f=(a*n-o*e)/t,d=(a*e+o*n)/t;function p(t,s){return[l*(t*=i)-c*(s*=r)+e,n-c*t-l*s]}return p.invert=function(t,e){return[i*(u*t-h*e+f),r*(d-h*t-u*e)]},p}function jf(t){return If(function(){return t})()}
vendor: 4,561 bytes, line 439
439function If(t){var e,n,i,r,s,o,a,l,c,u,h=150,f=480,d=250,p=0,m=0,g=0,_=0,v=0,y=0,b=1,x=1,w=null,k=Wu,S=null,M=Sh,T=.5;function C(t){return l(t[0]*Vl,t[1]*Vl)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Hl,t[1]*Hl]}function D(){var t=Pf(h,0,0,b,x,y).apply(null,e(p,m)),i=Pf(h,f-t[0],d-t[1],b,x,y);return n=Du(g,_,v),a=Cu(e,i),l=Cu(n,a),o=Nf(a,T),E()}function E(){return c=u=null,C}return C.stream=function(t){return c&&u===t?c:c=zf(function(t){return kf({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(k(o(M(u=t)))))},C.preclip=function(t){return arguments.length?(k=t,w=void 0,E()):k},C.postclip=function(t){return arguments.length?(M=t,S=i=r=s=null,E()):M},C.clipAngle=function(t){return arguments.length?(k=+t?Yu(w=t*Vl):(w=null,Wu),E()):w*Hl},C.clipExtent=function(t){return arguments.length?(M=null==t?(S=i=r=s=null,Sh):th(S=+t[0][0],i=+t[0][1],r=+t[1][0],s=+t[1][1]),E()):null==S?null:[[S,i],[r,s]]},C.scale=function(t){return arguments.length?(h=+t,D()):h},C.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],D()):[f,d]},C.center=function(t){return arguments.length?(p=t[0]%360*Vl,m=t[1]%360*Vl,D()):[p*Hl,m*Hl]},C.rotate=function(t){return arguments.length?(g=t[0]%360*Vl,_=t[1]%360*Vl,v=t.length>2?t[2]%360*Vl:0,D()):[g*Hl,_*Hl,v*Hl]},C.angle=function(t){return arguments.length?(y=t%360*Vl,D()):y*Hl},C.reflectX=function(t){return arguments.length?(b=t?-1:1,D()):b<0},C.reflectY=function(t){return arguments.length?(x=t?-1:1,D()):x<0},C.precision=function(t){return arguments.length?(o=Nf(a,T=t*t),E()):tc(T)},C.fitExtent=function(t,e){return Tf(C,t,e)},C.fitSize=function(t,e){return Cf(C,t,e)},C.fitWidth=function(t,e){return Af(C,t,e)},C.fitHeight=function(t,e){return Df(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&A,D()}}function $f(t){var e=0,n=Rl/3,i=If(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Vl,n=t[1]*Vl):[e*Hl,n*Hl]},r}function Rf(t,e){var n=Zl(t),i=(n+Zl(e))/2;if(ql(i)<Il)return function(t){var e=Wl(t);function n(t,n){return[t*e,Zl(n)/e]}return n.invert=function(t,n){return[t/e,ic(n*e)]},n}(t);var r=1+n*(2*i-n),s=tc(r)/i;function o(t,e){var n=tc(r-2*i*Zl(e))/i;return[n*Zl(t*=i),s-n*Wl(t)]}return o.invert=function(t,e){var n=s-e,o=Ul(t,ql(n))*Ql(n);return n*i<0&&(o-=Rl*Ql(t)*Ql(n)),[o/i,ic((r-(t*t+n*n)*i*i)/(2*i))]},o}function Lf(){return $f(Rf).scale(155.424).center([0,33.6442])}function Ff(){return Lf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Of(t){return function(e,n){var i=Wl(e),r=Wl(n),s=t(i*r);return s===1/0?[2,0]:[s*r*Zl(e),s*Zl(n)]}}function Hf(t){return function(e,n){var i=tc(e*e+n*n),r=t(i),s=Zl(r),o=Wl(r);return[Ul(e*s,i*o),ic(i&&n*s/i)]}}var Vf=Of(function(t){return tc(2/(1+t))});Vf.invert=Hf(function(t){return 2*ic(t/2)});var qf=Of(function(t){return(t=nc(t))&&t/Zl(t)});function Bf(t,e){return[t,Gl(ec((Ll+e)/2))]}function Uf(t){var e,n,i,r=jf(t),s=r.center,o=r.scale,a=r.translate,l=r.clipExtent,c=null;function u(){var s=Rl*o(),a=r(Pu(r.rotate()).invert([0,0]));return l(null==c?[[a[0]-s,a[1]-s],[a[0]+s,a[1]+s]]:t===Bf?[[Math.max(a[0]-s,c),e],[Math.min(a[0]+s,n),i]]:[[c,Math.max(a[1]-s,e)],[n,Math.min(a[1]+s,i)]])}return r.scale=function(t){return arguments.length?(o(t),u()):o()},r.translate=function(t){return arguments.length?(a(t),u()):a()},r.center=function(t){return arguments.length?(s(t),u()):s()},r.clipExtent=function(t){return arguments.length?(null==t?c=e=n=i=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==c?null:[[c,e],[n,i]]},u()}function Wf(t){return ec((Ll+t)/2)}function Yf(t,e){var n=Wl(t),i=t===e?Zl(t):Gl(n/Wl(e))/Gl(Wf(e)/Wf(t)),r=n*Kl(Wf(t),i)/i;if(!i)return Bf;function s(t,e){r>0?e<-Ll+Il&&(e=-Ll+Il):e>Ll-Il&&(e=Ll-Il);var n=r/Kl(Wf(e),i);return[n*Zl(i*t),r-n*Wl(i*t)]}return s.invert=function(t,e){var n=r-e,s=Ql(i)*tc(t*t+n*n),o=Ul(t,ql(n))*Ql(n);return n*i<0&&(o-=Rl*Ql(t)*Ql(n)),[o/i,2*Bl(Kl(r/s,1/i))-Ll]},s}function Xf(t,e){return[t,e]}function Jf(t,e){var n=Wl(t),i=t===e?Zl(t):(n-Wl(e))/(e-t),r=n/i+t;if(ql(i)<Il)return Xf;function s(t,e){var n=r-e,s=i*t;return[n*Zl(s),r-n*Wl(s)]}return s.invert=function(t,e){var n=r-e,s=Ul(t,ql(n))*Ql(n);return n*i<0&&(s-=Rl*Ql(t)*Ql(n)),[s/i,r-Ql(i)*tc(t*t+n*n)]},s}qf.invert=Hf(function(t){return t}),Bf.invert=function(t,e){return[t,2*Bl(Xl(e))-Ll]},Xf.invert=Xf;var Gf=1.340264,Kf=-.081106,Zf=893e-6,Qf=.003796,td=tc(3)/2;function ed(t,e){var n=ic(td*Zl(e)),i=n*n,r=i*i*i;return[t*Wl(n)/(td*(Gf+3*Kf*i+r*(7*Zf+9*Qf*i))),n*(Gf+Kf*i+r*(Zf+Qf*i))]}
vendor: 4,134 bytes, line 439
439function nd(t,e){var n=Wl(e),i=Wl(t)*n;return[n*Zl(t)/i,Zl(e)/i]}function id(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function rd(t,e){return[Wl(e)*Zl(t),Zl(e)]}function sd(t,e){var n=Wl(e),i=1+Wl(t)*n;return[n*Zl(t)/i,Zl(e)/i]}function od(t,e){return[Gl(ec((Ll+e)/2)),-t]}function ad(t,e){return t.parent===e.parent?1:2}function ld(t,e){return t+e.x}function cd(t,e){return Math.max(t,e.y)}function ud(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hd(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=dd)):void 0===e&&(e=fd);for(var n,i,r,s,o,a=new gd(t),l=[a];n=l.pop();)if((r=e(n.data))&&(o=(r=Array.from(r)).length))for(n.children=r,s=o-1;s>=0;--s)l.push(i=r[s]=new gd(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(md)}function fd(t){return t.children}function dd(t){return Array.isArray(t)?t[1]:null}function pd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function md(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function gd(t){this.data=t,this.depth=this.height=0,this.parent=null}function _d(t){for(var e,n,i=0,r=(t=function(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(Array.from(t))).length,s=[];i<r;)e=t[i],n&&bd(n,e)?++i:(n=wd(s=vd(s,e)),i=0);return n}function vd(t,e){var n,i;if(xd(e,t))return[e];for(n=0;n<t.length;++n)if(yd(e,t[n])&&xd(kd(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(i=n+1;i<t.length;++i)if(yd(kd(t[n],t[i]),e)&&yd(kd(t[n],e),t[i])&&yd(kd(t[i],e),t[n])&&xd(Sd(t[n],t[i],e),t))return[t[n],t[i],e];throw new Error}function yd(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function bd(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function xd(t,e){for(var n=0;n<e.length;++n)if(!bd(t,e[n]))return!1;return!0}function wd(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return kd(t[0],t[1]);case 3:return Sd(t[0],t[1],t[2])}}function kd(t,e){var n=t.x,i=t.y,r=t.r,s=e.x,o=e.y,a=e.r,l=s-n,c=o-i,u=a-r,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(i+o+c/h*u)/2,r:(h+r+a)/2}}function Sd(t,e,n){var i=t.x,r=t.y,s=t.r,o=e.x,a=e.y,l=e.r,c=n.x,u=n.y,h=n.r,f=i-o,d=i-c,p=r-a,m=r-u,g=l-s,_=h-s,v=i*i+r*r-s*s,y=v-o*o-a*a+l*l,b=v-c*c-u*u+h*h,x=d*p-f*m,w=(p*b-m*y)/(2*x)-i,k=(m*g-p*_)/x,S=(d*y-f*b)/(2*x)-r,M=(f*_-d*g)/x,T=k*k+M*M-1,C=2*(s+w*k+S*M),A=w*w+S*S-s*s,D=-(T?(C+Math.sqrt(C*C-4*T*A))/(2*T):A/C);return{x:i+w+k*D,y:r+S+M*D,r:D}}function Md(t,e,n){var i,r,s,o,a=t.x-e.x,l=t.y-e.y,c=a*a+l*l;c?(r=e.r+n.r,r*=r,o=t.r+n.r,r>(o*=o)?(i=(c+o-r)/(2*c),s=Math.sqrt(Math.max(0,o/c-i*i)),n.x=t.x-i*a-s*l,n.y=t.y-i*l+s*a):(i=(c+r-o)/(2*c),s=Math.sqrt(Math.max(0,r/c-i*i)),n.x=e.x+i*a-s*l,n.y=e.y+i*l+s*a)):(n.x=e.x+n.r,n.y=e.y)}function Td(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Cd(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,s=(e.y*n.r+n.y*e.r)/i;return r*r+s*s}function Ad(t){this._=t,this.next=null,this.previous=null}function Dd(t){if(!(r=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var e,n,i,r,s,o,a,l,c,u,h;if((e=t[0]).x=0,e.y=0,!(r>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(r>2))return e.r+n.r;Md(n,e,i=t[2]),e=new Ad(e),n=new Ad(n),i=new Ad(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(a=3;a<r;++a){Md(e._,n._,i=t[a]),i=new Ad(i),l=n.next,c=e.previous,u=n._.r,h=e._.r;do{if(u<=h){if(Td(l._,i._)){n=l,e.next=n,n.previous=e,--a;continue t}u+=l._.r,l=l.next}else{if(Td(c._,i._)){(e=c).next=n,n.previous=e,--a;continue t}h+=c._.r,c=c.previous}}while(l!==c.next);for(i.previous=e,i.next=n,e.next=n.previous=n=i,s=Cd(e);(i=i.next)!==n;)(o=Cd(i))<s&&(e=i,s=o);n=e.next}for(e=[n._],i=n;(i=i.next)!==n;)e.push(i._);for(i=_d(e),a=0;a<r;++a)(e=t[a]).x-=i.x,e.y-=i.y;return i.r}function Ed(t){return null==t?null:Nd(t)}function Nd(t){if("function"!=typeof t)throw new Error;return t}function zd(){return 0}function Pd(t){return function(){return t}}
vendor: 5,713 bytes, line 439
439function jd(t){return Math.sqrt(t.value)}function Id(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function $d(t,e){return function(n){if(i=n.children){var i,r,s,o=i.length,a=t(n)*e||0;if(a)for(r=0;r<o;++r)i[r].r+=a;if(s=Dd(i),a)for(r=0;r<o;++r)i[r].r-=a;n.r=s+a}}}function Rd(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function Ld(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Fd(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a<l;)(s=o[a]).y0=n,s.y1=r,s.x0=e,s.x1=e+=s.value*c}ed.invert=function(t,e){for(var n,i=e,r=i*i,s=r*r*r,o=0;o<12&&(s=(r=(i-=n=(i*(Gf+Kf*r+s*(Zf+Qf*r))-e)/(Gf+3*Kf*r+s*(7*Zf+9*Qf*r)))*i)*r*r,!(ql(n)<$l));++o);return[td*t*(Gf+3*Kf*r+s*(7*Zf+9*Qf*r))/Wl(i),ic(Zl(i)/td)]},nd.invert=Hf(Bl),id.invert=function(t,e){var n,i=e,r=25;do{var s=i*i,o=s*s;i-=n=(i*(1.007226+s*(.015085+o*(.028874*s-.044475-.005916*o)))-e)/(1.007226+s*(.045255+o*(.259866*s-.311325-.005916*11*o)))}while(ql(n)>Il&&--r>0);return[t/(.8707+(s=i*i)*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979)),i]},rd.invert=Hf(ic),sd.invert=Hf(function(t){return 2*Bl(t)}),od.invert=function(t,e){return[-e,2*Bl(Xl(t))-Ll]},gd.prototype=hd.prototype={constructor:gd,count:function(){return this.eachAfter(ud)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,s=this,o=[s],a=[],l=-1;s=o.pop();)if(a.push(s),n=s.children)for(i=0,r=n.length;i<r;++i)o.push(n[i]);for(;s=a.pop();)t.call(e,s,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,s=[r],o=-1;r=s.pop();)if(t.call(e,r,++o,this),n=r.children)for(i=n.length-1;i>=0;--i)s.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return hd(this).eachBefore(pd)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,s=[r];do{for(t=s.reverse(),s=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)s.push(e[n])}while(s.length)}};var Od={depth:-1},Hd={};function Vd(t){return t.id}function qd(t){return t.parentId}function Bd(t,e){return t.parent===e.parent?1:2}function Ud(t){var e=t.children;return e?e[0]:t.t}function Wd(t){var e=t.children;return e?e[e.length-1]:t.t}function Yd(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function Xd(t,e,n){return t.a.parent===e.parent?t.a:n}function Jd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Gd(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(r-n)/t.value;++a<l;)(s=o[a]).x0=e,s.x1=i,s.y0=n,s.y1=n+=s.value*c}Jd.prototype=Object.create(gd.prototype);var Kd=(1+Math.sqrt(5))/2;function Zd(t,e,n,i,r,s){for(var o,a,l,c,u,h,f,d,p,m,g,_=[],v=e.children,y=0,b=0,x=v.length,w=e.value;y<x;){l=r-n,c=s-i;do{u=v[b++].value}while(!u&&b<x);for(h=f=u,g=u*u*(m=Math.max(c/l,l/c)/(w*t)),p=Math.max(f/g,g/h);b<x;++b){if(u+=a=v[b].value,a<h&&(h=a),a>f&&(f=a),g=u*u*m,(d=Math.max(f/g,g/h))>p){u-=a;break}p=d}_.push(o={value:u,dice:l<c,children:v.slice(y,b)}),o.dice?Fd(o,n,i,r,w?i+=c*u/w:s):Gd(o,n,i,w?n+=l*u/w:r,s),w-=u,y=b}return _}var Qd=function nw(t){function e(e,n,i,r,s){Zd(t,e,n,i,r,s)}return e.ratio=function(t){return nw((t=+t)>1?t:1)},e}(Kd);var tp=function iw(t){function e(e,n,i,r,s){if((o=e._squarify)&&o.ratio===t)for(var o,a,l,c,u,h=-1,f=o.length,d=e.value;++h<f;){for(l=(a=o[h]).children,c=a.value=0,u=l.length;c<u;++c)a.value+=l[c].value;a.dice?Fd(a,n,i,r,d?i+=(s-i)*a.value/d:s):Gd(a,n,i,d?n+=(r-n)*a.value/d:r,s),d-=a.value}else e._squarify=o=Zd(t,e,n,i,r,s),o.ratio=t}return e.ratio=function(t){return iw((t=+t)>1?t:1)},e}(Kd);function ep(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function np(t,e){return t[0]-e[0]||t[1]-e[1]}function ip(t){const e=t.length,n=[0,1];let i,r=2;for(i=2;i<e;++i){for(;r>1&&ep(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}var rp=Math.random,sp=function rw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,1===arguments.length?(n=e,e=0):n-=e,function(){return t()*n+e}}return e.source=rw,e}(rp),op=function sw(t){function e(e,n){return arguments.length<2&&(n=e,e=0),e=Math.floor(e),n=Math.floor(n)-e,function(){return Math.floor(t()*n+e)}}return e.source=sw,e}(rp),ap=function ow(t){function e(e,n){var i,r;return e=null==e?0:+e,n=null==n?1:+n,function(){var s;if(null!=i)s=i,i=null;else do{i=2*t()-1,s=2*t()-1,r=i*i+s*s}while(!r||r>1);return e+n*s*Math.sqrt(-2*Math.log(r)/r)}}return e.source=ow,e}(rp),lp=function aw(t){var e=ap.source(t);function n(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return n.source=aw,n}(rp),cp=function lw(t){function e(e){return(e=+e)<=0?()=>0:function(){for(var n=0,i=e;i>1;--i)n+=t();return n+i*t()}}return e.source=lw,e}(rp),up=function cw(t){var e=cp.source(t);
vendor: 9,454 bytes, line 439
439function n(n){if(0==(n=+n))return t;var i=e(n);return function(){return i()/n}}return n.source=cw,n}(rp),hp=function uw(t){function e(e){return function(){return-Math.log1p(-t())/e}}return e.source=uw,e}(rp),fp=function hw(t){function e(e){if((e=+e)<0)throw new RangeError("invalid alpha");return e=1/-e,function(){return Math.pow(1-t(),e)}}return e.source=hw,e}(rp),dp=function fw(t){function e(e){if((e=+e)<0||e>1)throw new RangeError("invalid p");return function(){return Math.floor(t()+e)}}return e.source=fw,e}(rp),pp=function dw(t){function e(e){if((e=+e)<0||e>1)throw new RangeError("invalid p");return 0===e?()=>1/0:1===e?()=>1:(e=Math.log1p(-e),function(){return 1+Math.floor(Math.log1p(-t())/e)})}return e.source=dw,e}(rp),mp=function pw(t){var e=ap.source(t)();function n(n,i){if((n=+n)<0)throw new RangeError("invalid k");if(0===n)return()=>0;if(i=null==i?1:+i,1===n)return()=>-Math.log1p(-t())*i;var r=(n<1?n+1:n)-1/3,s=1/(3*Math.sqrt(r)),o=n<1?()=>Math.pow(t(),1/n):()=>1;return function(){do{do{var n=e(),a=1+s*n}while(a<=0);a*=a*a;var l=1-t()}while(l>=1-.0331*n*n*n*n&&Math.log(l)>=.5*n*n+r*(1-a+Math.log(a)));return r*a*o()*i}}return n.source=pw,n}(rp),gp=function mw(t){var e=mp.source(t);function n(t,n){var i=e(t),r=e(n);return function(){var t=i();return 0===t?0:t/(t+r())}}return n.source=mw,n}(rp),_p=function gw(t){var e=pp.source(t),n=gp.source(t);function i(t,i){return t=+t,(i=+i)>=1?()=>t:i<=0?()=>0:function(){for(var r=0,s=t,o=i;s*o>16&&s*(1-o)>16;){var a=Math.floor((s+1)*o),l=n(a,s-a+1)();l<=o?(r+=a,s-=a,o=(o-l)/(1-l)):(s=a-1,o/=l)}for(var c=o<.5,u=e(c?o:1-o),h=u(),f=0;h<=s;++f)h+=u();return r+(c?f:s-f)}}return i.source=gw,i}(rp),vp=function _w(t){function e(e,n,i){var r;return 0==(e=+e)?r=(t=>-Math.log(t)):(e=1/e,r=(t=>Math.pow(t,e))),n=null==n?0:+n,i=null==i?1:+i,function(){return n+i*r(-Math.log1p(-t()))}}return e.source=_w,e}(rp),yp=function vw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,function(){return e+n*Math.tan(Math.PI*t())}}return e.source=vw,e}(rp),bp=function yw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,function(){var i=t();return e+n*Math.log(i/(1-i))}}return e.source=yw,e}(rp),xp=function bw(t){var e=mp.source(t),n=_p.source(t);function i(i){return function(){for(var r=0,s=i;s>16;){var o=Math.floor(.875*s),a=e(o)();if(a>s)return r+n(o-1,s/a)();r+=o,s-=a}for(var l=-Math.log1p(-t()),c=0;l<=s;++c)l-=Math.log1p(-t());return r+c}}return i.source=bw,i}(rp);const wp=1/4294967296;function kp(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Sp(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Mp=Symbol("implicit");function Tp(){var t=new _,e=[],n=[],i=Mp;function r(r){let s=t.get(r);if(void 0===s){if(i!==Mp)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new _;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Tp(e,n).unknown(i)},kp.apply(r,arguments),r}function Cp(){var t,e,n=Tp().unknown(void 0),i=n.domain,r=n.range,s=0,o=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=o<s,f=h?o:s,d=h?s:o;t=(d-f)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),f+=(d-f-t*(n-l))*u,e=t*(1-l),a&&(f=Math.round(f),e=Math.round(e));var p=nt(n).map(function(e){return f+t*e});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([s,o]=t,s=+s,o=+o,h()):[s,o]},n.rangeRound=function(t){return[s,o]=t,s=+s,o=+o,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Cp(i(),[s,o]).round(a).paddingInner(l).paddingOuter(c).align(u)},kp.apply(h(),arguments)}function Ap(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ap(e())},t}function Dp(t){return+t}var Ep=[0,1];function Np(t){return t}function zp(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Pp(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r<i?(i=zp(r,i),s=n(o,s)):(i=zp(i,r),s=n(s,o)),function(t){return s(i(t))}}function jp(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=zp(t[o],t[o+1]),s[o]=n(e[o],e[o+1]);return function(e){var n=l(t,e,1,i)-1;return s[n](r[n](e))}}function Ip(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $p(){var t,e,n,i,r,s,o=Ep,a=Ep,l=zi,c=Np;function u(){var t=Math.min(o.length,a.length);return c!==Np&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),i=t>2?jp:Pp,r=s=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((s||(s=i(a,o.map(t),Ci)))(n)))},h.domain=function(t){return arguments.length?(o=Array.from(t,Dp),u()):o.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=Pi,u()},h.clamp=function(t){return arguments.length?(c=!!t||Np,u()):c!==Np},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function Rp(){return $p()(Np,Np)}function Lp(e,n,i,r){var s,o=V(e,n,i);switch((r=wl(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(n));return null!=r.precision||isNaN(s=Pl(o,a))||(r.precision=s),t.formatPrefix(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(s=jl(o,Math.max(Math.abs(e),Math.abs(n))))||(r.precision=s-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(s=zl(o))||(r.precision=s-2*("%"===r.type))}return t.format(r)}function Fp(t){var e=t.domain;return t.ticks=function(t){var n=e();return O(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Lp(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,s=e(),o=0,a=s.length-1,l=s[o],c=s[a],u=10;for(c<l&&(r=l,l=c,c=r,r=o,o=a,a=r);u-- >0;){if((r=H(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function Op(t,e){var n,i=0,r=(t=t.slice()).length-1,s=t[i],o=t[r];return o<s&&(n=i,i=r,r=n,n=s,s=o,o=n),t[i]=e.floor(s),t[r]=e.ceil(o),t}function Hp(t){return Math.log(t)}function Vp(t){return Math.exp(t)}function qp(t){return-Math.log(-t)}function Bp(t){return-Math.exp(-t)}function Up(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Wp(t){return(e,n)=>-t(-e,n)}function Yp(e){const n=e(Hp,Vp),i=n.domain;let r,s,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),s=function(t){return 10===t?Up:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),i()[0]<0?(r=Wp(r),s=Wp(s),e(qp,Bp)):e(Hp,Vp),n}return n.base=function(t){return arguments.length?(o=+t,a()):o},n.domain=function(t){return arguments.length?(i(t),a()):i()},n.ticks=(t=>{const e=i();let n=e[0],a=e[e.length-1];const l=a<n;l&&([n,a]=[a,n]);let c,u,h=r(n),f=r(a);const d=null==t?10:+t;let p=[];if(!(o%1)&&f-h<d){if(h=Math.floor(h),f=Math.ceil(f),n>0){for(;h<=f;++h)for(c=1;c<o;++c)if(u=h<0?c/s(-h):c*s(h),!(u<n)){if(u>a)break;p.push(u)}}else for(;h<=f;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/s(-h):c*s(h),!(u<n)){if(u>a)break;p.push(u)}2*p.length<d&&(p=O(n,a,d))}else p=O(h,f,Math.min(f-h,d)).map(s);return l?p.reverse():p}),n.tickFormat=((e,i)=>{if(null==e&&(e=10),null==i&&(i=10===o?"s":","),"function"!=typeof i&&(o%1||null!=(i=wl(i)).precision||(i.trim=!0),i=t.format(i)),e===1/0)return i;const a=Math.max(1,o*e/n.ticks().length);return t=>{let e=t/s(Math.round(r(t)));return e*o<o-.5&&(e*=o),e<=a?i(t):""}}),n.nice=(()=>i(Op(i(),{floor:t=>s(Math.floor(r(t))),ceil:t=>s(Math.ceil(r(t)))}))),n}function Xp(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Jp(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Gp(t){var e=1,n=t(Xp(e),Jp(e));return n.constant=function(n){return arguments.length?t(Xp(e=+n),Jp(e)):e},Fp(n)}function Kp(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Zp(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Qp(t){return t<0?-t*t:t*t}function tm(t){var e=t(Np,Np),n=1;function i(){return 1===n?t(Np,Np):.5===n?t(Zp,Qp):t(Kp(n),Kp(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,i()):n},Fp(e)}function em(){var t=tm($p());return t.copy=function(){return Ip(t,em()).exponent(t.exponent())},kp.apply(t,arguments),t}function nm(t){return Math.sign(t)*t*t}
439function im(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}var rm=new Date,sm=new Date;function om(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},r.range=function(n,i,s){var o,a=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o<n&&n<i);return a},r.filter=function(n){return om(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rm.setTime(+e),sm.setTime(+i),t(rm),t(sm),Math.floor(n(rm,sm))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var am=om(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});am.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?om(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):am:null};var lm=am,cm=am.range;const um=1e3,hm=6e4,fm=36e5,dm=864e5,pm=6048e5,mm=2592e6,gm=31536e6;var _m=om(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*um)},function(t,e){return(e-t)/um},function(t){return t.getUTCSeconds()}),vm=_m,ym=_m.range,bm=om(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*um)},function(t,e){t.setTime(+t+e*hm)},function(t,e){return(e-t)/hm},function(t){return t.getMinutes()}),xm=bm,wm=bm.range,km=om(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*um-t.getMinutes()*hm)},function(t,e){t.setTime(+t+e*fm)},function(t,e){return(e-t)/fm},function(t){return t.getHours()}),Sm=km,Mm=km.range,Tm=om(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hm)/dm,t=>t.getDate()-1),Cm=Tm,Am=Tm.range;function Dm(t){return om(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hm)/pm})}var Em=Dm(0),Nm=Dm(1),zm=Dm(2),Pm=Dm(3),jm=Dm(4),Im=Dm(5),$m=Dm(6),Rm=Em.range,Lm=Nm.range,Fm=zm.range,Om=Pm.range,Hm=jm.range,Vm=Im.range,qm=$m.range,Bm=om(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Um=Bm,Wm=Bm.range,Ym=om(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Ym.every=function(t){return isFinite(t=Math.floor(t))&&t>0?om(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var Xm=Ym,Jm=Ym.range,Gm=om(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*hm)},function(t,e){return(e-t)/hm},function(t){return t.getUTCMinutes()}),Km=Gm,Zm=Gm.range,Qm=om(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*fm)},function(t,e){return(e-t)/fm},function(t){return t.getUTCHours()}),tg=Qm,eg=Qm.range,ng=om(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/dm},function(t){return t.getUTCDate()-1}),ig=ng,rg=ng.range;function sg(t){return om(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/pm})}var og=sg(0),ag=sg(1),lg=sg(2),cg=sg(3),ug=sg(4),hg=sg(5),fg=sg(6),dg=og.range,pg=ag.range,mg=lg.range,gg=cg.range,_g=ug.range,vg=hg.range,yg=fg.range,bg=om(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),xg=bg,wg=bg.range,kg=om(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});kg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?om(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var Sg=kg,Mg=kg.range;function Tg(t,e,i,r,s,o){const a=[[vm,1,um],[vm,5,5e3],[vm,15,15e3],[vm,30,3e4],[o,1,hm],[o,5,3e5],[o,15,9e5],[o,30,18e5],[s,1,fm],[s,3,108e5],[s,6,216e5],[s,12,432e5],[r,1,dm],[r,2,1728e5],[i,1,pm],[e,1,mm],[e,3,7776e6],[t,1,gm]
vendor: 9,194 bytes, lines 439-440
439];function l(e,i,r){const s=Math.abs(i-e)/r,o=n(([,,t])=>t).right(a,s);if(o===a.length)return t.every(V(e/gm,i/gm,r));if(0===o)return lm.every(Math.max(V(e,i,r),1));const[l,c]=a[s/a[o-1][2]<a[o][2]/s?o-1:o];return l.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:l(t,e,n),s=r?r.range(t,+e+1):[];return i?s.reverse():s},l]}const[Cg,Ag]=Tg(Sg,xg,og,ig,tg,Km),[Dg,Eg]=Tg(Xm,Um,Em,Cm,Sm,xm);function Ng(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function zg(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Pg(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function jg(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=Vg(r),u=qg(r),h=Vg(s),f=qg(s),d=Vg(o),p=qg(o),m=Vg(a),g=qg(a),_=Vg(l),v=qg(l),y={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:u_,e:u_,f:m_,g:T_,G:A_,H:h_,I:f_,j:d_,L:p_,m:g_,M:__,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:K_,s:Z_,S:v_,u:y_,U:b_,V:w_,w:k_,W:S_,x:null,X:null,y:M_,Y:C_,Z:D_,"%":G_},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:E_,e:E_,f:I_,g:W_,G:X_,H:N_,I:z_,j:P_,L:j_,m:$_,M:R_,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:K_,s:Z_,S:L_,u:F_,U:O_,V:V_,w:q_,W:B_,x:null,X:null,y:U_,Y:Y_,Z:J_,"%":G_},x={a:function(t,e,n){var i=d.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=_.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:t_,e:t_,f:o_,g:Gg,G:Jg,H:n_,I:n_,j:e_,L:s_,m:Qg,M:i_,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Zg,Q:l_,s:c_,S:r_,u:Ug,U:Wg,V:Yg,w:Bg,W:Xg,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:Gg,Y:Jg,Z:Kg,"%":a_};function w(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(o.push(t.slice(l,a)),null!=(r=$g[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(s=e[i])&&(i=s(n,r)),o.push(i),l=a+1);return o.push(t.slice(l,a)),o.join("")}}function k(t,e){return function(n){var i,r,s=Pg(1900,void 0,1);if(S(s,t,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(e&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=zg(Pg(s.y,0,1))).getUTCDay(),i=r>4||0===r?ag.ceil(i):ag(i),i=ig.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=Ng(Pg(s.y,0,1))).getDay(),i=r>4||0===r?Nm.ceil(i):Nm(i),i=Cm.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)
440}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?zg(Pg(s.y,0,1)).getUTCDay():Ng(Pg(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,zg(s)):Ng(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in $g?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return y.x=w(n,y),y.X=w(i,y),y.c=w(e,y),b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),{format:function(t){var e=w(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Ig,$g={"-":"",_:" ",0:"0"},Rg=/^\s*\d+/,Lg=/^%/,Fg=/[\\^$*+?|[\]().{}]/g;function Og(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(e)+r:r)}function Hg(t){return t.replace(Fg,"\\$&")}function Vg(t){return new RegExp("^(?:"+t.map(Hg).join("|")+")","i")}function qg(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function Bg(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Ug(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Wg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Yg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Xg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Jg(t,e,n){var i=Rg.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Gg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Kg(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Zg(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Qg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function t_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function e_(t,e,n){var i=Rg.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function n_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function i_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function r_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function s_(t,e,n){var i=Rg.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function o_(t,e,n){var i=Rg.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function a_(t,e,n){var i=Lg.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function l_(t,e,n){var i=Rg.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function c_(t,e,n){var i=Rg.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function u_(t,e){return Og(t.getDate(),e,2)}function h_(t,e){return Og(t.getHours(),e,2)}function f_(t,e){return Og(t.getHours()%12||12,e,2)}function d_(t,e){return Og(1+Cm.count(Xm(t),t),e,3)}function p_(t,e){return Og(t.getMilliseconds(),e,3)}function m_(t,e){return p_(t,e)+"000"}function g_(t,e){return Og(t.getMonth()+1,e,2)}function __(t,e){return Og(t.getMinutes(),e,2)}function v_(t,e){return Og(t.getSeconds(),e,2)}function y_(t){var e=t.getDay();return 0===e?7:e}function b_(t,e){return Og(Em.count(Xm(t)-1,t),e,2)}function x_(t){var e=t.getDay();return e>=4||0===e?jm(t):jm.ceil(t)}function w_(t,e){return t=x_(t),Og(jm.count(Xm(t),t)+(4===Xm(t).getDay()),e,2)}function k_(t){return t.getDay()}function S_(t,e){return Og(Nm.count(Xm(t)-1,t),e,2)}function M_(t,e){return Og(t.getFullYear()%100,e,2)}function T_(t,e){return Og((t=x_(t)).getFullYear()%100,e,2)}function C_(t,e){return Og(t.getFullYear()%1e4,e,4)}function A_(t,e){var n=t.getDay();return Og((t=n>=4||0===n?jm(t):jm.ceil(t)).getFullYear()%1e4,e,4)}function D_(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Og(e/60|0,"0",2)+Og(e%60,"0",2)}function E_(t,e){return Og(t.getUTCDate(),e,2)}function N_(t,e){return Og(t.getUTCHours(),e,2)}function z_(t,e){return Og(t.getUTCHours()%12||12,e,2)}function P_(t,e){return Og(1+ig.count(Sg(t),t),e,3)}function j_(t,e){return Og(t.getUTCMilliseconds(),e,3)}function I_(t,e){return j_(t,e)+"000"}function $_(t,e){return Og(t.getUTCMonth()+1,e,2)}function R_(t,e){return Og(t.getUTCMinutes(),e,2)}function L_(t,e){return Og(t.getUTCSeconds(),e,2)}function F_(t){var e=t.getUTCDay();return 0===e?7:e}function O_(t,e){return Og(og.count(Sg(t)-1,t),e,2)}function H_(t){var e=t.getUTCDay();return e>=4||0===e?ug(t):ug.ceil(t)}function V_(t,e){return t=H_(t),Og(ug.count(Sg(t),t)+(4===Sg(t).getUTCDay()),e,2)}function q_(t){return t.getUTCDay()}function B_(t,e){return Og(ag.count(Sg(t)-1,t),e,2)}function U_(t,e){return Og(t.getUTCFullYear()%100,e,2)}function W_(t,e){return Og((t=H_(t)).getUTCFullYear()%100,e,2)}function Y_(t,e){return Og(t.getUTCFullYear()%1e4,e,4)}function X_(t,e){var n=t.getUTCDay();return Og((t=n>=4||0===n?ug(t):ug.ceil(t)).getUTCFullYear()%1e4,e,4)}function J_(){return"+0000"}function G_(){return"%"}function K_(t){return+t}function Z_(t){return Math.floor(+t/1e3)}function Q_(e){return Ig=jg(e),t.timeFormat=Ig.format,t.timeParse=Ig.parse,t.utcFormat=Ig.utcFormat,t.utcParse=Ig.utcParse,Ig}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,Q_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
440ay","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"]});var tv="%Y-%m-%dT%H:%M:%S.%LZ";var ev=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(tv),nv=ev;var iv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(tv),rv=iv;function sv(t){return new Date(t)}function ov(t){return t instanceof Date?+t:+new Date(+t)}function av(t,e,n,i,r,s,o,a,l,c){var u=Rp(),h=u.invert,f=u.domain,d=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),_=c("%a %d"),v=c("%b %d"),y=c("%B"),b=c("%Y");function x(t){return(l(t)<t?d:a(t)<t?p:o(t)<t?m:s(t)<t?g:i(t)<t?r(t)<t?_:v:n(t)<t?y:b)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?f(Array.from(t,ov)):f().map(sv)},u.ticks=function(e){var n=f();return t(n[0],n[n.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?x:c(e)},u.nice=function(t){var n=f();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?f(Op(n,t)):u},u.copy=function(){return Ip(u,av(t,e,n,i,r,s,o,a,l,c))},u}function lv(){var t,e,n,i,r,s=0,o=1,a=Np,l=!1;function c(e){return null==e||isNaN(e=+e)?r:a(0===n?.5:(e=(i(e)-t)*n,l?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,i;return arguments.length?([n,i]=e,a=t(n,i),c):[a(0),a(1)]}}return c.domain=function(r){return arguments.length?([s,o]=r,t=i(s=+s),e=i(o=+o),n=t===e?0:1/(e-t),c):[s,o]},c.clamp=function(t){return arguments.length?(l=!!t,c):l},c.interpolator=function(t){return arguments.length?(a=t,c):a},c.range=u(zi),c.rangeRound=u(Pi),c.unknown=function(t){return arguments.length?(r=t,c):r},function(r){return i=r,t=r(s),e=r(o),n=t===e?0:1/(e-t),c}}function cv(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function uv(){var t=tm(lv());return t.copy=function(){return cv(t,uv()).exponent(t.exponent())},Sp.apply(t,arguments)}function hv(){var t,e,n,i,r,s,o,a=0,l=.5,c=1,u=1,h=Np,f=!1;function d(t){return isNaN(t=+t)?o:(t=.5+((t=+s(t))-e)*(u*t<u*e?i:r),h(f?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,h=Zi(t,[n,i,r]),d):[h(0),h(.5),h(1)]}}return d.domain=function(o){return arguments.length?([a,l,c]=o,t=s(a=+a),e=s(l=+l),n=s(c=+c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,d):[a,l,c]},d.clamp=function(t){return arguments.length?(f=!!t,d):f},d.interpolator=function(t){return arguments.length?(h=t,d):h},d.range=p(zi),d.rangeRound=p(Pi),d.unknown=function(t){return arguments.length?(o=t,d):o},function(o){return s=o,t=o(a),e=o(l),n=o(c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,d}}function fv(){var t=tm(hv());return t.copy=function(){return cv(t,fv()).exponent(t.exponent())},Sp.apply(t,arguments)}function dv(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}var pv=dv("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),mv=dv("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),gv=dv("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),_v=dv("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),vv=dv("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),yv=dv("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),bv=dv("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),xv=dv("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),wv=dv("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),kv=dv("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),Sv=t=>xi(t[t.length-1]),Mv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dv),Tv=Sv(Mv),Cv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dv),Av=Sv(Cv),Dv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dv),Ev=Sv(Dv),Nv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dv),zv=Sv(Nv),Pv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dv),jv=Sv(Pv),Iv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dv),$v=Sv(Iv),Rv=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dv),Lv=Sv(Rv),Fv=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d
4407191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dv),Ov=Sv(Fv),Hv=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dv),Vv=Sv(Hv),qv=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dv),Bv=Sv(qv),Uv=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dv),Wv=Sv(Uv),Yv=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dv),Xv=Sv(Yv),Jv=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dv),Gv=Sv(Jv),Kv=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dv),Zv=Sv(Kv),Qv=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dv),ty=Sv(Qv),ey=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dv),ny=Sv(ey),iy=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dv),ry=Sv(iy),sy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dv),oy=Sv(sy),ay=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dv),ly=Sv(ay),cy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dv),uy=Sv(cy),hy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dv),fy=Sv(hy),dy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ec
440ae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dv),py=Sv(dy),my=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dv),gy=Sv(my),_y=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dv),vy=Sv(_y),yy=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dv),by=Sv(yy),xy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dv),wy=Sv(xy),ky=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dv),Sy=Sv(ky);var My=Ki(ci(300,.5,0),ci(-240,.5,1)),Ty=Ki(ci(-100,.75,.35),ci(80,1.5,.8)),Cy=Ki(ci(260,.75,.35),ci(80,1.5,.8)),Ay=ci();var Dy=Tn(),Ey=Math.PI/3,Ny=2*Math.PI/3;function zy(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Py=zy(dv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),jy=zy(dv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb8
4401febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Iy=zy(dv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),$y=zy(dv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ry(t){return function(){return t}}var Ly=Math.abs,Fy=Math.atan2,Oy=Math.cos,Hy=Math.max,Vy=Math.min,qy=Math.sin,By=Math.sqrt,Uy=1e-12,Wy=Math.PI,Yy=Wy/2,Xy=2*Wy;function Jy(t){return t>1?0:t<-1?Wy:Math.acos(t)}function Gy(t){return t>=1?Yy:t<=-1?-Yy:Math.asin(t)}function Ky(t){return t.innerRadius}function Zy(t){return t.outerRadius}function Qy(t){return t.startAngle}function tb(t){return t.endAngle}function eb(t){return t&&t.padAngle}function nb(t,e,n,i,r,s,o,a){var l=n-t,c=i-e,u=o-r,h=a-s,f=h*l-u*c;if(!(f*f<Uy))return[t+(f=(u*(e-s)-h*(t-r))/f)*l,e+f*c]}function ib(t,e,n,i,r,s,o){var a=t-n,l=e-i,c=(o?s:-s)/By(a*a+l*l),u=c*l,h=-c*a,f=t+u,d=e+h,p=n+u,m=i+h,g=(f+p)/2,_=(d+m)/2,v=p-f,y=m-d,b=v*v+y*y,x=r-s,w=f*m-p*d,k=(y<0?-1:1)*By(Hy(0,x*x*b-w*w)),S=(w*y-v*k)/b,M=(-w*v-y*k)/b,T=(w*y+v*k)/b,C=(-w*v+y*k)/b,A=S-g,D=M-_,E=T-g,N=C-_;return A*A+D*D>E*E+N*N&&(S=T,M=C),{cx:S,cy:M,x01:-u,y01:-h,x11:S*(r/x-1),y11:M*(r/x-1)}}var rb=Array.prototype.slice;
vendor: 17,300 bytes, lines 440-441
440function sb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ob(t){this._context=t}function ab(t){return new ob(t)}function lb(t){return t[0]}function cb(t){return t[1]}function ub(t,e){var n=Ry(!0),i=null,r=ab,s=null;function o(o){var a,l,c,u=(o=sb(o)).length,h=!1;for(null==i&&(s=r(c=vo())),a=0;a<=u;++a)!(a<u&&n(l=o[a],a,o))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+t(l,a,o),+e(l,a,o));if(c)return s=null,c+""||null}return t="function"==typeof t?t:void 0===t?lb:Ry(t),e="function"==typeof e?e:void 0===e?cb:Ry(e),o.x=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ry(!!t),o):n},o.curve=function(t){return arguments.length?(r=t,null!=i&&(s=r(i)),o):r},o.context=function(t){return arguments.length?(null==t?i=s=null:s=r(i=t),o):i},o}function hb(t,e,n){var i=null,r=Ry(!0),s=null,o=ab,a=null;function l(l){var c,u,h,f,d,p=(l=sb(l)).length,m=!1,g=new Array(p),_=new Array(p);for(null==s&&(a=o(d=vo())),c=0;c<=p;++c){if(!(c<p&&r(f=l[c],c,l))===m)if(m=!m)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(g[h],_[h]);a.lineEnd(),a.areaEnd()}m&&(g[c]=+t(f,c,l),_[c]=+e(f,c,l),a.point(i?+i(f,c,l):g[c],n?+n(f,c,l):_[c]))}if(d)return a=null,d+""||null}function c(){return ub().defined(r).curve(o).context(s)}return t="function"==typeof t?t:void 0===t?lb:Ry(+t),e="function"==typeof e?e:Ry(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?cb:Ry(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ry(+t),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ry(+t),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Ry(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l}function fb(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function db(t){return t}ob.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var pb=gb(ab);function mb(t){this._curve=t}function gb(t){function e(e){return new mb(t(e))}return e._curve=t,e}function _b(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(gb(t)):e()._curve},t}function vb(){return _b(ub().curve(pb))}function yb(){var t=hb().curve(pb),e=t.curve,n=t.lineX0,i=t.lineX1,r=t.lineY0,s=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return _b(n())},delete t.lineX0,t.lineEndAngle=function(){return _b(i())},delete t.lineX1,t.lineInnerRadius=function(){return _b(r())},delete t.lineY0,t.lineOuterRadius=function(){return _b(s())},delete t.lineY1,t.curve=function(t){return arguments.length?e(gb(t)):e()._curve},t}function bb(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}function xb(t){return t.source}function wb(t){return t.target}function kb(t){var e=xb,n=wb,i=lb,r=cb,s=null;function o(){var o,a=rb.call(arguments),l=e.apply(this,a),c=n.apply(this,a);if(s||(s=o=vo()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}function Sb(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function Mb(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+r)/2,i,n,i,r)}function Tb(t,e,n,i,r){var s=bb(e,n),o=bb(e,n=(n+r)/2),a=bb(i,n),l=bb(i,r);t.moveTo(s[0],s[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],l[0],l[1])}mb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var Cb={draw:function(t,e){var n=Math.sqrt(e/Wy);t.moveTo(n,0),t.arc(0,0,n,0,Xy)}},Ab={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Db=Math.sqrt(1/3),Eb=2*Db,Nb={draw:function(t,e){var n=Math.sqrt(e/Eb),i=n*Db;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},zb=Math.sin(Wy/10)/Math.sin(7*Wy/10),Pb=Math.sin(Xy/10)*zb,jb=-Math.cos(Xy/10)*zb,Ib={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=Pb*n,r=jb*n;t.moveTo(0,-n),t.lineTo(i,r);for(var s=1;s<5;++s){var o=Xy*s/5,a=Math.cos(o),l=Math.sin(o);t.lineTo(l*n,-a*n),t.lineTo(a*i-l*r,l*i+a*r)}t.closePath()}},$b={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},Rb=Math.sqrt(3),Lb={draw:function(t,e){var n=-Math.sqrt(e/(3*Rb));t.moveTo(0,2*n),t.lineTo(-Rb*n,-n),t.lineTo(Rb*n,-n),
441t.closePath()}},Fb=-.5,Ob=Math.sqrt(3)/2,Hb=1/Math.sqrt(12),Vb=3*(Hb/2+1),qb={draw:function(t,e){var n=Math.sqrt(e/Vb),i=n/2,r=n*Hb,s=i,o=n*Hb+n,a=-s,l=o;t.moveTo(i,r),t.lineTo(s,o),t.lineTo(a,l),t.lineTo(Fb*i-Ob*r,Ob*i+Fb*r),t.lineTo(Fb*s-Ob*o,Ob*s+Fb*o),t.lineTo(Fb*a-Ob*l,Ob*a+Fb*l),t.lineTo(Fb*i+Ob*r,Fb*r-Ob*i),t.lineTo(Fb*s+Ob*o,Fb*o-Ob*s),t.lineTo(Fb*a+Ob*l,Fb*l-Ob*a),t.closePath()}},Bb=[Cb,Ab,Nb,$b,Ib,Lb,qb];function Ub(){}function Wb(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Yb(t){this._context=t}function Xb(t){this._context=t}function Jb(t){this._context=t}Yb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Wb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xb.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class Gb{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function Kb(t,e){this._basis=new Yb(t),this._beta=e}Kb.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],s=e[0],o=t[n]-r,a=e[n]-s,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*o),this._beta*e[l]+(1-this._beta)*(s+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Zb=function xw(t){function e(e){return 1===t?new Yb(e):new Kb(e,t)}return e.beta=function(t){return xw(+t)},e}(.85);function Qb(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function tx(t,e){this._context=t,this._k=(1-e)/6}tx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Qb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ex=function ww(t){function e(e){return new tx(e,t)}return e.tension=function(t){return ww(+t)},e}(0);function nx(t,e){this._context=t,this._k=(1-e)/6}nx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ix=function kw(t){function e(e){return new nx(e,t)}return e.tension=function(t){return kw(+t)},e}(0);function rx(t,e){this._context=t,this._k=(1-e)/6}rx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var sx=function Sw(t){function e(e){return new rx(e,t)}return e.tension=function(t){return Sw(+t)},e}(0);function ox(t,e,n){var i=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>Uy){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Uy){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,s,o,t._x2,t._y2)}function ax(t,e){this._context=t,this._alpha=e}ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var lx=function Mw(t){function e(e){return t?new ax(e,t):new tx(e,0)}return e.alpha=function(t){return Mw(+t)},e}(.5);function cx(t,e){this._context=t,this._alpha=e}cx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ux=function Tw(t){function e(e){return t?new cx(e,t):new nx(e,0)}return e.alpha=function(t){return Tw(+t)},e}(.5);function hx(t,e){this._context=t,this._alpha=e}hx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fx=function Cw(t){function e(e){return t?new hx(e,t):new rx(e,0)}return e.alpha=function(t){return Cw(+t)},e}(.5);function dx(t){this._context=t}function px(t){return t<0?-1:1}function mx(t,e,n){var i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(px(s)+px(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a)
vendor: 5,855 bytes, line 441
441)||0}function gx(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function _x(t,e,n){var i=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-i)/3;t._context.bezierCurveTo(i+a,r+a*e,s-a,o-a*n,s,o)}function vx(t){this._context=t}function yx(t){this._context=new bx(t)}function bx(t){this._context=t}function xx(t){this._context=t}function wx(t){var e,n,i=t.length-1,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,s[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/s[e-1],s[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/s[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/s[e];for(s[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)s[e]=2*t[e+1]-r[e+1];return[r,s]}function kx(t,e){this._context=t,this._t=e}function Sx(t,e){if((r=t.length)>1)for(var n,i,r,s=1,o=t[e[0]],a=o.length;s<r;++s)for(i=o,o=t[e[s]],n=0;n<a;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Mx(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Tx(t,e){return t[e]}function Cx(t){const e=[];return e.key=t,e}function Ax(t){var e=t.map(Dx);return Mx(t).sort(function(t,n){return e[t]-e[n]})}function Dx(t){for(var e,n=-1,i=0,r=t.length,s=-1/0;++n<r;)(e=+t[n][1])>s&&(s=e,i=n);return i}function Ex(t){var e=t.map(Nx);return Mx(t).sort(function(t,n){return e[t]-e[n]})}function Nx(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}dx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},vx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_x(this,this._t0,gx(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,_x(this,gx(this,n=mx(this,t,e)),n);break;default:_x(this,this._t0,n=mx(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(yx.prototype=Object.create(vx.prototype)).point=function(t,e){vx.prototype.point.call(this,e,t)},bx.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,s){this._context.bezierCurveTo(e,t,i,n,s,r)}},xx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=wx(t),r=wx(e),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var zx=t=>()=>t;function Px(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function jx(t,e,n){this.k=t,this.x=e,this.y=n}jx.prototype={constructor:jx,scale:function(t){return 1===t?this:new jx(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jx(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ix=new jx(1,0,0);function $x(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ix;return t.__zoom}function Rx(t){t.stopImmediatePropagation()}function Lx(t){t.preventDefault(),t.stopImmediatePropagation()}function Fx(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ox(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Hx(){return this.__zoom||Ix}function Vx(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?
vendor: 4,351 bytes, line 441
4411:.002)*(t.ctrlKey?10:1)}function qx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bx(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}$x.prototype=jx.prototype,t.Adder=g,t.Delaunay=_a,t.FormatSpecifier=kl,t.InternMap=_,t.InternSet=v,t.Node=gd,t.Voronoi=ha,t.ZoomTransform=jx,t.active=function(t,e){var n,i,r=t.__transition;if(r)for(i in e=null==e?null:e+"",r)if((n=r[i]).state>1&&n.name===e)return new Zr([[t]],Ts,e,+i);return null},t.arc=function(){var t=Ky,e=Zy,n=Ry(0),i=null,r=Qy,s=tb,o=eb,a=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),f=r.apply(this,arguments)-Yy,d=s.apply(this,arguments)-Yy,p=Ly(d-f),m=d>f;if(a||(a=l=vo()),h<u&&(c=h,h=u,u=c),h>Uy)if(p>Xy-Uy)a.moveTo(h*Oy(f),h*qy(f)),a.arc(0,0,h,f,d,!m),u>Uy&&(a.moveTo(u*Oy(d),u*qy(d)),a.arc(0,0,u,d,f,m));else{var g,_,v=f,y=d,b=f,x=d,w=p,k=p,S=o.apply(this,arguments)/2,M=S>Uy&&(i?+i.apply(this,arguments):By(u*u+h*h)),T=Vy(Ly(h-u)/2,+n.apply(this,arguments)),C=T,A=T;if(M>Uy){var D=Gy(M/u*qy(S)),E=Gy(M/h*qy(S));(w-=2*D)>Uy?(b+=D*=m?1:-1,x-=D):(w=0,b=x=(f+d)/2),(k-=2*E)>Uy?(v+=E*=m?1:-1,y-=E):(k=0,v=y=(f+d)/2)}var N=h*Oy(v),z=h*qy(v),P=u*Oy(x),j=u*qy(x);if(T>Uy){var I,$=h*Oy(y),R=h*qy(y),L=u*Oy(b),F=u*qy(b);if(p<Wy&&(I=nb(N,z,L,F,$,R,P,j))){var O=N-I[0],H=z-I[1],V=$-I[0],q=R-I[1],B=1/qy(Jy((O*V+H*q)/(By(O*O+H*H)*By(V*V+q*q)))/2),U=By(I[0]*I[0]+I[1]*I[1]);C=Vy(T,(u-U)/(B-1)),A=Vy(T,(h-U)/(B+1))}}k>Uy?A>Uy?(g=ib(L,F,N,z,h,A,m),_=ib($,R,P,j,h,A,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),A<T?a.arc(g.cx,g.cy,A,Fy(g.y01,g.x01),Fy(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,A,Fy(g.y01,g.x01),Fy(g.y11,g.x11),!m),a.arc(0,0,h,Fy(g.cy+g.y11,g.cx+g.x11),Fy(_.cy+_.y11,_.cx+_.x11),!m),a.arc(_.cx,_.cy,A,Fy(_.y11,_.x11),Fy(_.y01,_.x01),!m))):(a.moveTo(N,z),a.arc(0,0,h,v,y,!m)):a.moveTo(N,z),u>Uy&&w>Uy?C>Uy?(g=ib(P,j,$,R,u,-C,m),_=ib(N,z,L,F,u,-C,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),C<T?a.arc(g.cx,g.cy,C,Fy(g.y01,g.x01),Fy(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,C,Fy(g.y01,g.x01),Fy(g.y11,g.x11),!m),a.arc(0,0,u,Fy(g.cy+g.y11,g.cx+g.x11),Fy(_.cy+_.y11,_.cx+_.x11),m),a.arc(_.cx,_.cy,C,Fy(_.y11,_.x11),Fy(_.y01,_.x01),!m))):a.arc(0,0,u,x,b,m):a.lineTo(P,j)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Wy/2;return[Oy(i)*n,qy(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ry(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ry(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),l):r},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ry(+t),l):s},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ry(+t),l):o},l.context=function(t){return arguments.length?(a=null==t?null:t,l):a},l},t.area=hb,t.areaRadial=yb,t.ascending=e,t.autoType=function(t){for(var e in t){var n,i,r=t[e].trim();if(r)if("true"===r)r=!0;else if("false"===r)r=!1;else if("NaN"===r)r=NaN;else if(isNaN(n=+r)){if(!(i=r.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;Ha&&i[4]&&!i[7]&&(r=r.replace(/-/g,"/").replace(/T/," ")),r=new Date(r)}else r=n;else r=null;t[e]=r}return t},t.axisBottom=function(t){return vt(3,t)},t.axisLeft=function(t){return vt(4,t)},t.axisRight=function(t){return vt(2,t)},t.axisTop=function(t){return vt(1,t)},t.bin=U,t.bisect=l,t.bisectCenter=a,t.bisectLeft=o,t.bisectRight=s,t.bisector=n,t.blob=function(t,e){return fetch(t,e).then(Va)},t.brush=function(){return to(Vs)},t.brushSelection=function(t){var e=t.__brush;return e?e.dim.output(e.selection):null},t.brushX=function(){return to(Os)},t.brushY=function(){return to(Hs)},t.buffer=function(t,e){return fetch(t,e).then(qa)},t.chord=function(){return ho(!1,!1)},t.chordDirected=function(){return ho(!0,!1)},t.chordTranspose=function(){return ho(!1,!0)}
vendor: 9,300 bytes, line 441
441,t.cluster=function(){var t=ad,e=1,n=1,i=!1;function r(r){var s,o=0;r.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(ld,0)/t.length}(n),e.y=function(t){return 1+t.reduce(cd,0)}(n)):(e.x=s?o+=t(e,s):0,e.y=0,s=e)});var a=function(t){for(var e;e=t.children;)t=e[0];return t}(r),l=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),c=a.x-t(a,l)/2,u=l.x+t(l,a)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-c)/(u-c)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},t.color=wn,t.contourDensity=function(){var t=Oo,e=Ho,n=Vo,i=960,r=500,s=20,o=2,a=3*s,l=i+2*a>>o,c=r+2*a>>o,u=No(20);function h(i){var r=new Float32Array(l*c),h=new Float32Array(l*c),d=Math.pow(2,-o);i.forEach(function(i,s,o){var u=(t(i,s,o)+a)*d,h=(e(i,s,o)+a)*d,f=+n(i,s,o);if(u>=0&&u<l&&h>=0&&h<c){var p=Math.floor(u),m=Math.floor(h),g=u-p-.5,_=h-m-.5;r[p+m*l]+=(1-g)*(1-_)*f,r[p+1+m*l]+=g*(1-_)*f,r[p+1+(m+1)*l]+=g*_*f,r[p+(m+1)*l]+=(1-g)*_*f}}),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o);var p=u(r);if(!Array.isArray(p)){var m=W(r);p=V(0,m,p),(p=nt(0,Math.floor(m/p)*p,p)).shift()}return Ro().thresholds(p).size([l,c])(r).map(f)}function f(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(m)}function m(t){t[0]=t[0]*Math.pow(2,o)-a,t[1]=t[1]*Math.pow(2,o)-a}function g(){return l=i+2*(a=3*s)>>o,c=r+2*a>>o,h}return h.x=function(e){return arguments.length?(t="function"==typeof e?e:No(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:No(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:No(+t),h):n},h.size=function(t){if(!arguments.length)return[i,r];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return i=e,r=n,g()},h.cellSize=function(t){if(!arguments.length)return 1<<o;if(!((t=+t)>=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},h.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?No(Do.call(t)):No(t),h):u},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(s*(s+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return s=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},h},t.contours=Ro,t.count=c,t.create=function(t){return Fe(Et(t).call(document.documentElement))},t.creator=Et,t.cross=function(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(f)).map(u),i=t.length-1,r=new Array(i+1).fill(0),s=[];if(i<0||n.some(h))return s;for(;;){s.push(r.map((e,n)=>t[n][e]));let o=i;for(;++r[o]===n[o];){if(0===o)return e?s.map(e):s;r[o--]=0}}},t.csv=Ya,t.csvFormat=Aa,t.csvFormatBody=Da,t.csvFormatRow=Na,t.csvFormatRows=Ea,t.csvFormatValue=za,t.csvParse=Ta,t.csvParseRows=Ca,t.cubehelix=ci,t.cumsum=function(t,e){var n=0,i=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:r=>n+=+e(r,i++,t)||0)},t.curveBasis=function(t){return new Yb(t)},t.curveBasisClosed=function(t){return new Xb(t)},t.curveBasisOpen=function(t){return new Jb(t)},t.curveBumpX=function(t){return new Gb(t,!0)},t.curveBumpY=function(t){return new Gb(t,!1)},t.curveBundle=Zb,t.curveCardinal=ex,t.curveCardinalClosed=ix,t.curveCardinalOpen=sx,t.curveCatmullRom=lx,t.curveCatmullRomClosed=ux,t.curveCatmullRomOpen=fx,t.curveLinear=ab,t.curveLinearClosed=function(t){return new dx(t)},t.curveMonotoneX=function(t){return new vx(t)},t.curveMonotoneY=function(t){return new yx(t)},t.curveNatural=function(t){return new xx(t)},t.curveStep=function(t){return new kx(t,.5)},t.curveStepAfter=function(t){return new kx(t,1)},t.curveStepBefore=function(t){return new kx(t,0)},t.descending=function(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=p,t.difference=function(t,...e){t=new v(t);for(const n of e)for(const e of n)t["delete"](e);return t},t.disjoint=function(t,e){const n=e[Symbol.iterator](),i=new v;for(const e of t){if(i.has(e))return!1;let t,r;for(;({value:t,done:r}=n.next())&&!r;){if(Object.is(e,t))return!1;i.add(t)}}return!0},t.dispatch=bt,t.drag=function(){var t,e,n,i,r=Qe,s=tn,o=en,a=nn,l={},c=bt("start","drag","end"),u=0,h=0;function f(t){t.on("mousedown.drag",d).filter(a).on("touchstart.drag",g).on("touchmove.drag",_,Ue).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(o,a){if(!i&&r.call(this,o,a)){var l=y(this,s.call(this,o,a),o,a,"mouse");l&&(Fe(o.view).on("mousemove.drag",p,We).on("mouseup.drag",m,We),Je(o.view),Ye(o),n=!1,t=o.clientX,e=o.clientY,l("start",o))}}function p(i){if(Xe(i),!n){var r=i.clientX-t,s=i.clientY-e;n=r*r+s*s>h}l.mouse("drag",i)}function m(t){Fe(t.view).on("mousemove.drag mouseup.drag",null),Ge(t.view,n),Xe(t),l.mouse("end",t)}function g(t,e){if(r.call(this,t,e)){var n,i,o=t.changedTouches,a=s.call(this,t,e),l=o.length;for(n=0;n<l;++n)(i=y(this,a,t,e,o[n].identifier,o[n]))&&(Ye(t),i("start",t,o[n]))}}function _(t){var e,n,i=t.changedTouches,r=i.length;for(e=0;e<r;++e)(n=l[i[e].identifier])&&(Xe(t),n("drag",t,i[e]))}function v(t){var e,n,r=t.changedTouches,s=r.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),e=0;e<s;++e)(n=l[r[e].identifier])&&(Ye(t),n("end",t,r[e]))}function y(t,e,n,i,r,s){var a,h,d,p=c.copy(),m=Be(s||n,e);if(null!=(d=o.call(t,new Ze("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:p}),i)))return a=d.x-m[0]||0,h=d.y-m[1]||0,function g(n,s,o){var c,_=m;switch(n){case"start":l[r]=g,c=u++;break;case"end":delete l[r],--u;case"drag":m=Be(o||s,e),c=u}p.call(n,t,new Ze(n,{sourceEvent:s,subject:d,target:f,identifier:r,active:c,x:m[0]+a,y:m[1]+h,dx:m[0]-_[0],dy:m[1]-_[1],dispatch:p}),i)}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ke(!!t),f):r},f.container=function(t){return arguments.length?(s="function"==typeof t?t:Ke(t),f):s},f.subject=function(t){return arguments.length?(o="function"==typeof t?t:Ke(t),f):o},f.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Ke(!!t),f):a},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f},t.dragDisable=Je,t.dragEnable=Ge,t.dsv=function(t,e,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var r=Sa(t);return Ua(e,n).then(function(t){return r.parse(t,i)})},t.dsvFormat=Sa,t.easeBack=ys,t.easeBackIn=_s,t.easeBackInOut=ys,t.easeBackOut=vs,t.easeBounce=ms,t.easeBounceIn=function(t){return 1-ms(1-t)},t.easeBounceInOut=function(t){return((t*=2)<=1?1-ms(1-t):ms(t-1)+1)/2},t.easeBounceOut=ms,t.easeCircle=fs,t.easeCircleIn=function(t){return 1-Math.sqrt(1-t*t)},t.easeCircleInOut=fs,t.easeCircleOut=function(t){return Math.sqrt(1- --t*t)},t.easeCubic=is,t.easeCubicIn=function(t){return t*t*t},t.easeCubicInOut=is,t.easeCubicOut=function(t){return--t*t*t+1},t.easeElastic=ws,t.easeElasticIn=xs,t.easeElasticInOut=ks,t.easeElasticOut=ws,t.easeExp=hs,t.easeExpIn=function(t){return us(1-+t)},t.easeExpInOut=hs,t.easeExpOut=function(t){return 1-us(t)},t.easeLinear=(t=>+t),t.easePoly=os,t.easePolyIn=rs,t.easePolyInOut=os,t.easePolyOut=ss,t.easeQuad=ns,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=ns,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=cs,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*ls)},t.easeSinInOut=cs,t.easeSinOut=function(t){return Math.sin(t*ls)},t.every=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");let n=-1;for(const i of t)if(!e(i,++n,t))return!1;return!0},t.extent=m,t.fcumsum=function(t,e){const n=new g;let i=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):r=>n.add(+e(r,++i,t)||0))},t.filter=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");const n=[];let i=-1;for(const r of t)e(r,++i,t)&&n.push(r);return n},t.flatGroup=function(t,...e){return T(M(t,...e),e)},t.flatRollup=function(t,e,...n){return T(A(t,e,...n),n)},t.forceCenter=function(t,e){var n,i=1;function r(){var r,s,o=n.length,a=0,l=0;for(r=0;r<o;++r)a+=(s=n[r]).x,l+=s.y;for(a=(a/o-t)*i,l=(l/o-e)*i,r=0;r<o;++r)(s=n[r]).x-=a,s.y-=l}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.strength=function(t){return arguments.length?(i=+t,r):i},r},t.forceCollide=function(t){var e,n,i,r=1,s=1;function o(){for(var t,o,l,c,u,h,f,d=e.length,p=0;p<s;++p)for(o=rl(e,ul,hl).visitAfter(a),t=0;t<d;++t)l=e[t],h=n[l.index],f=h*h,c=l.x+l.vx,u=l.y+l.vy,o.visit(m);function m(t,e,n,s,o){var a=t.data,d=t.r,p=h+d;if(!a)return e>c+p||s<c-p||n>u+p||o<u-p;if(a.index>l.index){var m=c-a.x-a.vx,g=u-a.y-a.vy,_=m*m+g*g;
vendor: 5,567 bytes, lines 441-442
441_<p*p&&(0===m&&(_+=(m=cl(i))*m),0===g&&(_+=(g=cl(i))*g),_=(p-(_=Math.sqrt(_)))/_*r,l.vx+=(m*=_)*(p=(d*=d)/(f+d)),l.vy+=(g*=_)*p,a.vx-=m*(p=1-p),a.vy-=g*p)}}}function a(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var i,r,s=e.length;for(n=new Array(s),i=0;i<s;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!=typeof t&&(t=ll(null==t?1:+t)),o.initialize=function(t,n){e=t,i=n,l()},o.iterations=function(t){return arguments.length?(s=+t,o):s},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),l(),o):t},o},t.forceLink=function(t){var e,n,i,r,s,o,a=fl,l=function(t){return 1/Math.min(r[t.source.index],r[t.target.index])},c=ll(30),u=1;function h(i){for(var r=0,a=t.length;r<u;++r)for(var l,c,h,f,d,p,m,g=0;g<a;++g)c=(l=t[g]).source,f=(h=l.target).x+h.vx-c.x-c.vx||cl(o),d=h.y+h.vy-c.y-c.vy||cl(o),f*=p=((p=Math.sqrt(f*f+d*d))-n[g])/p*i*e[g],d*=p,h.vx-=f*(m=s[g]),h.vy-=d*m,c.vx+=f*(m=1-m),c.vy+=d*m}function f(){if(i){var o,l,c=i.length,u=t.length,h=new Map(i.map((t,e)=>[a(t,e,i),t]));for(o=0,r=new Array(c);o<u;++o)(l=t[o]).index=o,"object"!=typeof l.source&&(l.source=dl(h,l.source)),"object"!=typeof l.target&&(l.target=dl(h,l.target)),r[l.source.index]=(r[l.source.index]||0)+1,r[l.target.index]=(r[l.target.index]||0)+1;for(o=0,s=new Array(u);o<u;++o)l=t[o],s[o]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(i)for(var n=0,r=t.length;n<r;++n)e[n]=+l(t[n],n,t)}function p(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){i=t,o=e,f()},h.links=function(e){return arguments.length?(t=e,f(),h):t},h.id=function(t){return arguments.length?(a=t,h):a},h.iterations=function(t){return arguments.length?(u=+t,h):u},h.strength=function(t){return arguments.length?(l="function"==typeof t?t:ll(+t),d(),h):l},h.distance=function(t){return arguments.length?(c="function"==typeof t?t:ll(+t),p(),h):c},h},t.forceManyBody=function(){
442var t,e,n,i,r,s=ll(-30),o=1,a=1/0,l=.81;function c(n){var r,s=t.length,o=rl(t,ml,gl).visitAfter(h);for(i=n,r=0;r<s;++r)e=t[r],o.visit(f)}function u(){if(t){var e,n,i=t.length;for(r=new Array(i),e=0;e<i;++e)n=t[e],r[n.index]=+s(n,e,t)}}function h(t){var e,n,i,s,o,a=0,l=0;if(t.length){for(i=s=o=0;o<4;++o)(e=t[o])&&(n=Math.abs(e.value))&&(a+=e.value,l+=n,i+=n*e.x,s+=n*e.y);t.x=i/l,t.y=s/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{a+=r[e.data.index]}while(e=e.next)}t.value=a}function f(t,s,c,u){if(!t.value)return!0;var h=t.x-e.x,f=t.y-e.y,d=u-s,p=h*h+f*f;if(d*d/l<p)return p<a&&(0===h&&(p+=(h=cl(n))*h),0===f&&(p+=(f=cl(n))*f),p<o&&(p=Math.sqrt(o*p)),e.vx+=h*t.value*i/p,e.vy+=f*t.value*i/p),!0;if(!(t.length||p>=a)){(t.data!==e||t.next)&&(0===h&&(p+=(h=cl(n))*h),0===f&&(p+=(f=cl(n))*f),p<o&&(p=Math.sqrt(o*p)));do{t.data!==e&&(d=r[t.data.index]*i/p,e.vx+=h*d,e.vy+=f*d)}while(t=t.next)}}return c.initialize=function(e,i){t=e,n=i,u()},c.strength=function(t){return arguments.length?(s="function"==typeof t?t:ll(+t),u(),c):s},c.distanceMin=function(t){return arguments.length?(o=t*t,c):Math.sqrt(o)},c.distanceMax=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c},t.forceRadial=function(t,e,n){var i,r,s,o=ll(.1);function a(t){for(var o=0,a=i.length;o<a;++o){var l=i[o],c=l.x-e||1e-6,u=l.y-n||1e-6,h=Math.sqrt(c*c+u*u),f=(s[o]-h)*r[o]*t/h;l.vx+=c*f,l.vy+=u*f}}function l(){if(i){var e,n=i.length;for(r=new Array(n),s=new Array(n),e=0;e<n;++e)s[e]=+t(i[e],e,i),r[e]=isNaN(s[e])?0:+o(i[e],e,i)}}return"function"!=typeof t&&(t=ll(+t)),null==e&&(e=0),null==n&&(n=0),a.initialize=function(t){i=t,l()},a.strength=function(t){return arguments.length?(o="function"==typeof t?t:ll(+t),l(),a):o},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),l(),a):t},a.x=function(t){return arguments.length?(e=+t,a):e},a.y=function(t){return arguments.length?(n=+t,a):n},a},t.forceSimulation=function(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=fr(h),c=bt("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%pl)/pl}();function h(){f(),c.call("tick",e),n<i&&(l.stop(),c.call("end",e))}function f(i){var l,c,u=t.length;void 0===i&&(i=1);for(var h=0;h<i;++h)for(n+=(s-n)*r,a.forEach(function(t){t(n)}),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=10*Math.sqrt(.5+n),s=n*_l;e.x=r*Math.cos(s),e.y=r*Math.sin(s)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),a.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(s=+t,e):s},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,a.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?a["delete"](t):a.set(t,p(n)),e):a.get(t)},find:function(e,n,i){var r,s,o,a,l,c=0,u=t.length;for(null==i?i=1/0:i*=i,c=0;c<u;
vendor: 4,116 bytes, line 442
442++c)(o=(r=e-(a=t[c]).x)*r+(s=n-a.y)*s)<i&&(l=a,i=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}},t.forceX=function(t){var e,n,i,r=ll(.1);function s(t){for(var r,s=0,o=e.length;s<o;++s)(r=e[s]).vx+=(i[s]-r.x)*n[s]*t}function o(){if(e){var s,o=e.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+t(e[s],s,e))?0:+r(e[s],s,e)}}return"function"!=typeof t&&(t=ll(null==t?0:+t)),s.initialize=function(t){e=t,o()},s.strength=function(t){return arguments.length?(r="function"==typeof t?t:ll(+t),o(),s):r},s.x=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),o(),s):t},s},t.forceY=function(t){var e,n,i,r=ll(.1);function s(t){for(var r,s=0,o=e.length;s<o;++s)(r=e[s]).vy+=(i[s]-r.y)*n[s]*t}function o(){if(e){var s,o=e.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+t(e[s],s,e))?0:+r(e[s],s,e)}}return"function"!=typeof t&&(t=ll(null==t?0:+t)),s.initialize=function(t){e=t,o()},s.strength=function(t){return arguments.length?(r="function"==typeof t?t:ll(+t),o(),s):r},s.y=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),o(),s):t},s},t.formatDefaultLocale=Nl,t.formatLocale=El,t.formatSpecifier=wl,t.fsum=function(t,e){const n=new g;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&n.add(r)}return+n},t.geoAlbers=Ff,t.geoAlbersUsa=function(){var t,e,n,i,r,s,o=Ff(),a=Lf().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=Lf().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){s=[t,e]}};function u(t){var e=t[0],o=t[1];return s=null,n.point(e,o),s||(i.point(e,o),s)||(r.point(e,o),s)}function h(){return t=e=null,u}return u.invert=function(t){var e=o.scale(),n=o.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:o).invert(t)},u.stream=function(n){return t&&e===n?t:(i=[o.stream(e=n),a.stream(n),l.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n<r;)i[n].point(t,e)},sphere:function(){for(var t=-1;++t<r;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<r;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<r;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<r;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<r;)i[t].polygonEnd()}});var i,r},u.precision=function(t){return arguments.length?(o.precision(t),a.precision(t),l.precision(t),h()):o.precision()},u.scale=function(t){return arguments.length?(o.scale(t),a.scale(.35*t),l.scale(t),u.translate(o.translate())):o.scale()},u.translate=function(t){if(!arguments.length)return o.translate();var e=o.scale(),s=+t[0],u=+t[1];return n=o.translate(t).clipExtent([[s-.455*e,u-.238*e],[s+.455*e,u+.238*e]]).stream(c),i=a.translate([s-.307*e,u+.201*e]).clipExtent([[s-.425*e+Il,u+.12*e+Il],[s-.214*e-Il,u+.234*e-Il]]).stream(c),r=l.translate([s-.205*e,u+.212*e]).clipExtent([[s-.214*e+Il,u+.166*e+Il],[s-.115*e-Il,u+.234*e-Il]]).stream(c),h()},u.fitExtent=function(t,e){return Tf(u,t,e)},u.fitSize=function(t,e){return Cf(u,t,e)},u.fitWidth=function(t,e){return Af(u,t,e)},u.fitHeight=function(t,e){return Df(u,t,e)},u.scale(1070)},t.geoArea=function(t){return Dc=new g,hc(t,Ec),2*Dc},t.geoAzimuthalEqualArea=function(){return jf(Vf).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=Vf,t.geoAzimuthalEquidistant=function(){return jf(qf).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=qf,t.geoBounds=function(t){var e,n,i,r,s,o,a;if(bc=yc=-(_c=vc=1/0),Tc=[],hc(t,ru),n=Tc.length){for(Tc.sort(du),e=1,s=[i=Tc[0]];e<n;++e)pu(i,(r=Tc[e])[0])||pu(i,r[1])?(fu(i[0],r[1])>fu(i[0],i[1])&&(i[1]=r[1]),fu(r[0],i[1])>fu(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,e=0,i=s[n=s.length-1];e<=n;i=r,++e)r=s[e],(a=fu(i[1],r[0]))>o&&(o=a,_c=r[0],yc=i[1])}return Tc=Cc=null,_c===1/0||vc===1/0?[[NaN,NaN],[NaN,NaN]]:[[_c,vc],[yc,bc]]},t.geoCentroid=function(t){Vc=qc=Bc=Uc=Wc=Yc=Xc=Jc=0,Gc=new g,Kc=new g,Zc=new g,hc(t,mu);var e=+Gc,n=+Kc,i=+Zc,r=Jl(e,n,i);return r<$l&&(e=Yc,n=Xc,i=Jc,qc<Il&&(e=Bc,n=Uc,i=Wc),(r=Jl(e,n,i))<$l)?[NaN,NaN]:[Ul(n,e)*Hl,ic(i/r)*Hl]}
vendor: 4,358 bytes, line 442
442,t.geoCircle=function(){var t,e,n=Tu([0,0]),i=Tu(90),r=Tu(6),s={point:function(n,i){t.push(n=e(n,i)),n[0]*=Hl,n[1]*=Hl}};function o(){var o=n.apply(this,arguments),a=i.apply(this,arguments)*Vl,l=r.apply(this,arguments)*Vl;return t=[],e=Du(-o[0]*Vl,-o[1]*Vl,0).invert,ju(s,a,l,1),o={type:"Polygon",coordinates:[t]},t=e=null,o}return o.center=function(t){return arguments.length?(n="function"==typeof t?t:Tu([+t[0],+t[1]]),o):n},o.radius=function(t){return arguments.length?(i="function"==typeof t?t:Tu(+t),o):i},o.precision=function(t){return arguments.length?(r="function"==typeof t?t:Tu(+t),o):r},o},t.geoClipAntimeridian=Wu,t.geoClipCircle=Yu,t.geoClipExtent=function(){var t,e,n,i=0,r=0,s=960,o=500;return n={stream:function(n){return t&&e===n?t:t=th(i,r,s,o)(e=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],s=+a[1][0],o=+a[1][1],t=e=null,n):[[i,r],[s,o]]}}},t.geoClipRectangle=th,t.geoConicConformal=function(){return $f(Yf).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=Yf,t.geoConicEqualArea=Lf,t.geoConicEqualAreaRaw=Rf,t.geoConicEquidistant=function(){return $f(Jf).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=Jf,t.geoContains=function(t,e){return(t&&ch.hasOwnProperty(t.type)?ch[t.type]:hh)(t,e)},t.geoDistance=lh,t.geoEqualEarth=function(){return jf(ed).scale(177.158)},t.geoEqualEarthRaw=ed,t.geoEquirectangular=function(){return jf(Xf).scale(152.63)},t.geoEquirectangularRaw=Xf,t.geoGnomonic=function(){return jf(nd).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=nd,t.geoGraticule=yh,t.geoGraticule10=function(){return yh()()},t.geoIdentity=function(){var t,e,n,i,r,s,o,a=1,l=0,c=0,u=1,h=1,f=0,d=null,p=1,m=1,g=kf({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),_=Sh;function v(){return p=a*u,m=a*h,s=o=null,y}function y(n){var i=n[0]*p,r=n[1]*m;if(f){var s=r*t-i*e;i=i*t+r*e,r=s}return[i+l,r+c]}return y.invert=function(n){var i=n[0]-l,r=n[1]-c;if(f){var s=r*t+i*e;i=i*t-r*e,r=s}return[i/p,r/m]},y.stream=function(t){return s&&o===t?s:s=g(_(o=t))},y.postclip=function(t){return arguments.length?(_=t,d=n=i=r=null,v()):_},y.clipExtent=function(t){return arguments.length?(_=null==t?(d=n=i=r=null,Sh):th(d=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),v()):null==d?null:[[d,n],[i,r]]},y.scale=function(t){return arguments.length?(a=+t,v()):a},y.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],v()):[l,c]},y.angle=function(n){return arguments.length?(e=Zl(f=n%360*Vl),t=Wl(f),v()):f*Hl},y.reflectX=function(t){return arguments.length?(u=t?-1:1,v()):u<0},y.reflectY=function(t){return arguments.length?(h=t?-1:1,v()):h<0},y.fitExtent=function(t,e){return Tf(y,t,e)},y.fitSize=function(t,e){return Cf(y,t,e)},y.fitWidth=function(t,e){return Af(y,t,e)},y.fitHeight=function(t,e){return Df(y,t,e)},y},t.geoInterpolate=function(t,e){var n=t[0]*Vl,i=t[1]*Vl,r=e[0]*Vl,s=e[1]*Vl,o=Wl(i),a=Zl(i),l=Wl(s),c=Zl(s),u=o*Wl(n),h=o*Zl(n),f=l*Wl(r),d=l*Zl(r),p=2*ic(tc(rc(s-i)+o*l*rc(r-n))),m=Zl(p),g=p?function(t){var e=Zl(t*=p)/m,n=Zl(p-t)/m,i=n*u+e*f,r=n*h+e*d,s=n*a+e*c;return[Ul(r,i)*Hl,Ul(s,tc(i*i+r*r))*Hl]}:function(){return[n*Hl,i*Hl]};return g.distance=p,g},t.geoLength=sh,t.geoMercator=function(){return Uf(Bf).scale(961/Ol)},t.geoMercatorRaw=Bf,t.geoNaturalEarth1=function(){return jf(id).scale(175.295)},t.geoNaturalEarth1Raw=id,t.geoOrthographic=function(){return jf(rd).scale(249.5).clipAngle(90.000001)},t.geoOrthographicRaw=rd,t.geoPath=function(t,e){var n,i,r=4.5;function s(t){return t&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),hc(t,n(i))),i.result()}return s.area=function(t){return hc(t,n(zh)),zh.result()},s.measure=function(t){return hc(t,n(bf)),bf.result()},s.bounds=function(t){return hc(t,n(Vh)),Vh.result()},s.centroid=function(t){return hc(t,n(cf)),cf.result()},s.projection=function(e){return arguments.length?(n=null==e?(t=null,Sh):(t=e).stream,s):t},s.context=function(t){return arguments.length?(i=null==t?(e=null,new xf):new uf(e=t),"function"!=typeof r&&i.pointRadius(r),s):e},s.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(i.pointRadius(+t),+t),s):r},s.projection(t).context(e)},t.geoProjection=jf,t.geoProjectionMutator=If,t.geoRotation=Pu,t.geoStereographic=function(){return jf(sd).scale(250).clipAngle(142)},t.geoStereographicRaw=sd,t.geoStream=hc,t.geoTransform=function(t){return{stream
vendor: 18,761 bytes, line 442
442:kf(t)}},t.geoTransverseMercator=function(){var t=Uf(od),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=od,t.gray=function(t,e){return new Un(t,0,0,null==e?1:e)},t.greatest=function(t,n=e){let i,r=!1;if(1===n.length){let s;for(const o of t){const t=n(o);(r?e(t,s)>0:0===e(t,t))&&(i=o,s=t,r=!0)}}else for(const e of t)(r?n(e,i)>0:0===n(e,e))&&(i=e,r=!0);return i},t.greatestIndex=function(t,n=e){if(1===n.length)return Z(t,n);let i,r=-1,s=-1;for(const e of t)++s,(r<0?0===n(e,e):n(e,i)>0)&&(i=e,r=s);return r},t.group=S,t.groupSort=function(t,n,i){return(2!==n.length?z(C(t,n,i),([t,n],[i,r])=>e(n,r)||e(t,i)):z(S(t,i),([t,i],[r,s])=>n(i,s)||e(t,r))).map(([t])=>t)},t.groups=M,t.hcl=Kn,t.hierarchy=hd,t.histogram=U,t.hsl=Pn,t.html=Za,t.image=function(t,e){return new Promise(function(n,i){var r=new Image;for(var s in e)r[s]=e[s];r.onerror=i,r.onload=function(){n(r)},r.src=t})},t.index=function(t,...e){return E(t,k,D,e)},t.indexes=function(t,...e){return E(t,Array.from,D,e)},t.interpolate=zi,t.interpolateArray=function(t,e){return(Si(e)?ki:Mi)(t,e)},t.interpolateBasis=fi,t.interpolateBasisClosed=di,t.interpolateBlues=py,t.interpolateBrBG=Tv,t.interpolateBuGn=Bv,t.interpolateBuPu=Wv,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=Cy,t.interpolateCubehelix=Gi,t.interpolateCubehelixDefault=My,t.interpolateCubehelixLong=Ki,t.interpolateDate=Ti,t.interpolateDiscrete=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},t.interpolateGnBu=Xv,t.interpolateGreens=gy,t.interpolateGreys=vy,t.interpolateHcl=Yi,t.interpolateHclLong=Xi,t.interpolateHsl=Bi,t.interpolateHslLong=Ui,t.interpolateHue=function(t,e){var n=gi(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},t.interpolateInferno=Iy,t.interpolateLab=function(t,e){var n=vi((t=Bn(t)).l,(e=Bn(e)).l),i=vi(t.a,e.a),r=vi(t.b,e.b),s=vi(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=s(e),t+""}},t.interpolateMagma=jy,t.interpolateNumber=Ci,t.interpolateNumberArray=ki,t.interpolateObject=Ai,t.interpolateOrRd=Gv,t.interpolateOranges=Sy,t.interpolatePRGn=Av,t.interpolatePiYG=Ev,t.interpolatePlasma=$y,t.interpolatePuBu=ty,t.interpolatePuBuGn=Zv,t.interpolatePuOr=zv,t.interpolatePuRd=ny,t.interpolatePurples=by,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Ay.h=360*t-100,Ay.s=1.5-1.5*e,Ay.l=.8-.9*e,Ay+""},t.interpolateRdBu=jv,t.interpolateRdGy=$v,t.interpolateRdPu=ry,t.interpolateRdYlBu=Lv,t.interpolateRdYlGn=Ov,t.interpolateReds=wy,t.interpolateRgb=yi,t.interpolateRgbBasis=xi,t.interpolateRgbBasisClosed=wi,t.interpolateRound=Pi,t.interpolateSinebow=function(t){var e;return t=(.5-t)*Math.PI,Dy.r=255*(e=Math.sin(t))*e,Dy.g=255*(e=Math.sin(t+Ey))*e,Dy.b=255*(e=Math.sin(t+Ny))*e,Dy+""},t.interpolateSpectral=Vv,t.interpolateString=Ni,t.interpolateTransformCss=Fi,t.interpolateTransformSvg=Oi,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Py,t.interpolateWarm=Ty,t.interpolateYlGn=ly,t.interpolateYlGnBu=oy,t.interpolateYlOrBr=uy,t.interpolateYlOrRd=fy,t.interpolateZoom=Vi,t.interrupt=Sr,t.intersection=function(t,...e){t=new v(t),e=e.map(lt);t:for(const n of t)for(const i of e)if(!i.has(n)){t["delete"](n);continue t}return t},t.interval=function(t,e,n){var i=new hr,r=e;return null==e?(i.restart(t,e,n),i):(i._restart=i.restart,i.restart=function(t,e,n){e=+e,n=null==n?cr():+n,i._restart(function s(o){o+=r,i._restart(s,r+=e,n),t(o)},e,n)},i.restart(t,e,n),i)},t.isoFormat=nv,t.isoParse=rv,t.json=function(t,e){return fetch(t,e).then(Ja)},t.lab=Bn,t.lch=function(t,e,n,i){return 1===arguments.length?Gn(t):new Zn(n,e,t,null==i?1:i)},t.least=function(t,n=e){let i,r=!1;if(1===n.length){let s;for(const o of t){const t=n(o);(r?e(t,s)<0:0===e(t,t))&&(i=o,s=t,r=!0)}}else for(const e of t)(r?n(e,i)<0:0===n(e,e))&&(i=e,r=!0);return i},t.leastIndex=it,t.line=ub,t.lineRadial=vb,t.linkHorizontal=function(){return kb(Sb)},t.linkRadial=function(){var t=kb(Tb);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return kb(Mb)},t.local=He,t.map=function(t,e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof e)throw new TypeError("mapper is not a function");return Array.from(t,(n,i)=>e(n,i,t))},t.matcher=$t,t.max=W,t.maxIndex=Z,t.mean=function(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n},t.median=function(t,e){return G(t,.5,e)},t.merge=Q,t.min=Y,t.minIndex=tt,t.mode=function(t,e){const n=new _;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&r>=r&&n.set(r,(n.get(r)||0)+1)}let i,r=0;for(const[t,e]of n)e>r&&(r=e,i=t);return i},t.namespace=Ct,t.namespaces=Tt,t.nice=q,t.now=cr,t.pack=function(){var t=null,e=1,n=1,i=zd;function r(r){return r.x=e/2,r.y=n/2,t?r.eachBefore(Id(t)).eachAfter($d(i,.5)).eachBefore(Rd(1)):r.eachBefore(Id(jd)).eachAfter($d(zd,1)).eachAfter($d(i,r.r/Math.min(e,n))).eachBefore(Rd(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=Ed(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"==typeof t?t:Pd(+t),r):i},r},t.packEnclose=_d,t.packSiblings=function(t){return Dd(t),t},t.pairs=function(t,e=et){const n=[];let i,r=!1;for(const s of t)r&&n.push(e(i,s)),i=s,r=!0;return n},t.partition=function(){var t=1,e=1,n=0,i=!1;function r(r){var s=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/s,r.eachBefore(function(t,e){return function(i){i.children&&Fd(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,s=i.y0,o=i.x1-n,a=i.y1-n;o<r&&(r=o=(r+o)/2),a<s&&(s=a=(s+a)/2),i.x0=r,i.y0=s,i.x1=o,i.y1=a}}(e,s)),i&&r.eachBefore(Ld),r}return r.round=function(t){return arguments.length?(i=!!t,r):i},r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]},r.padding=function(t){return arguments.length?(n=+t,r):n},r},t.path=vo,t.permute=N,t.pie=function(){var t=db,e=fb,n=null,i=Ry(0),r=Ry(Xy),s=Ry(0);function o(o){var a,l,c,u,h,f=(o=sb(o)).length,d=0,p=new Array(f),m=new Array(f),g=+i.apply(this,arguments),_=Math.min(Xy,Math.max(-Xy,r.apply(this,arguments)-g)),v=Math.min(Math.abs(_)/f,s.apply(this,arguments)),y=v*(_<0?-1:1);for(a=0;a<f;++a)(h=m[p[a]=a]=+t(o[a],a,o))>0&&(d+=h);for(null!=e?p.sort(function(t,n){return e(m[t],m[n])}):null!=n&&p.sort(function(t,e){return n(o[t],o[e])}),a=0,c=d?(_-f*y)/d:0;a<f;++a,g=u)l=p[a],u=g+((h=m[l])>0?h*c:0)+y,m[l]={data:o[l],index:a,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),o):i},o.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),o):r},o.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ry(+t),o):s},o},t.piecewise=Zi,t.pointRadial=bb,t.pointer=Be,t.pointers=function(t,e){return t.target&&(t=qe(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,t=>Be(t,e))},t.polygonArea=function(t){for(var e,n=-1,i=t.length,r=t[i-1],s=0;++n<i;)e=r,r=t[n],s+=e[1]*r[0]-e[0]*r[1];return s/2},t.polygonCentroid=function(t){for(var e,n,i=-1,r=t.length,s=0,o=0,a=t[r-1],l=0;++i<r;)e=a,a=t[i],l+=n=e[0]*a[1]-a[0]*e[1],s+=(e[0]+a[0])*n,o+=(e[1]+a[1])*n;return[s/(l*=3),o/l]},t.polygonContains=function(t,e){for(var n,i,r=t.length,s=t[r-1],o=e[0],a=e[1],l=s[0],c=s[1],u=!1,h=0;h<r;++h)n=(s=t[h])[0],(i=s[1])>a!=c>a&&o<(l-n)*(a-i)/(c-i)+n&&(u=!u),l=n,c=i;return u},t.polygonHull=function(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),r=new Array(n);for(e=0;e<n;++e)i[e]=[+t[e][0],+t[e][1],e];for(i.sort(np),e=0;e<n;++e)r[e]=[i[e][0],-i[e][1]];var s=ip(i),o=ip(r),a=o[0]===s[0],l=o[o.length-1]===s[s.length-1],c=[];for(e=s.length-1;e>=0;--e)c.push(t[i[s[e]][2]]);for(e=+a;e<o.length-l;++e)c.push(t[i[o[e]][2]]);return c},t.polygonLength=function(t){for(var e,n,i=-1,r=t.length,s=t[r-1],o=s[0],a=s[1],l=0;++i<r;)e=o,n=a,e-=o=(s=t[i])[0],n-=a=s[1],l+=Math.hypot(e,n);return l},t.precisionFixed=zl,t.precisionPrefix=Pl,t.precisionRound=jl,t.quadtree=rl,t.quantile=G,t.quantileSorted=K,t.quantize=function(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n},t.quickselect=X,t.radialArea=yb,t.radialLine=vb,t.randomBates=up,t.randomBernoulli=dp,t.randomBeta=gp,t.randomBinomial=_p,t.randomCauchy=yp,t.randomExponential=hp,t.randomGamma=mp,t.randomGeometric=pp,t.randomInt=op,t.randomIrwinHall=cp,t.randomLcg=function(t=Math.random()){let e=0|(0<=t&&t<1?t/wp:Math.abs(t));return()=>(e=1664525*e+1013904223|0,wp*(e>>>0))},t.randomLogNormal=lp,t.randomLogistic=bp,t.randomNormal=ap,t.randomPareto=fp,t.randomPoisson=xp,t.randomUniform=sp,t.randomWeibull=vp,t.range=nt,t.rank=function(t,n=e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let i=Array.from(t);const r=new Float64Array(i.length);2!==n.length&&(i=i.map(n),n=e);const s=(t,e)=>n(i[t],i[e]);let o,a;return Uint32Array.from(i,(t,e)=>e).sort(n===e?(t,e)=>j(i[t],i[e]):P(s)).forEach((t,e)=>{const n=s(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN}),r},t.reduce=function(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const i=t[Symbol.iterator]();let r,s,o=-1;if(arguments.length<3){if(({done:r,value:n}=i.next()),r)return;++o}for(;({done:r,value:s}=i.next()),!r;)n=e(n,s,++o,t);return n},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Tn,t.ribbon=function(){return Ao()},t.ribbonArrow=function(){return Ao(Co)},t.rollup=C,t.rollups=A,t.scaleBand=Cp,t.scaleDiverging=function Aw(){var t=Fp(hv()(Np));return t.copy=function(){return cv(t,Aw())},Sp.apply(t,arguments)},t.scaleDivergingLog=function Dw(){var t=Yp(hv()).domain([.1,1,10]);return t.copy=function(){return cv(t,Dw()).base(t.base())},Sp.apply(t,arguments)},t.scaleDivergingPow=fv,t.scaleDivergingSqrt=function(){return fv.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function Ew(){var t=Gp(hv());return t.copy=function(){return cv(t,Ew()).constant(t.constant())},Sp.apply(t,arguments)},t.scaleIdentity=function Nw(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,Dp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return Nw(t).unknown(e)},t=arguments.length?Array.from(t,Dp):[0,1],Fp(n)},t.scaleImplicit=Mp,t.scaleLinear=function zw(){var t=Rp();return t.copy=function(){return Ip(t,zw())},kp.apply(t,arguments),Fp(t)},t.scaleLog=function Pw(){const t=Yp($p()).domain([1,10]);return t.copy=(()=>Ip(t,Pw()).base(t.base())),kp.apply(t,arguments),t},t.scaleOrdinal=Tp,t.scalePoint=function(){return Ap(Cp.apply(null,arguments).paddingInner(1))},t.scalePow=em,t.scaleQuantile=function jw(){var t,n=[],i=[],r=[];function s(){var t=0,e=Math.max(1,i.length);for(r=new Array(e-1);++t<e;)r[t-1]=K(n,t/e);return o}function o(e){return null==e||isNaN(e=+e)?t:i[l(r,e)]}return o.invertExtent=function(t){var e=i.indexOf(t);return e<0?[NaN,NaN]:[e>0?r[e-1]:n[0],e<r.length?r[e]:n[n.length-1]]},o.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(e),s()},o.range=function(t){return arguments.length?(i=Array.from(t),s()):i.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return jw().domain(n).range(i).unknown(t)},kp.apply(o,arguments)},t.scaleQuantize=function Iw(){var t,e=0,n=1,i=1,r=[.5],s=[0,1];function o(e){return null!=e&&e<=e?s[l(r,e,0,i)]:t}function a(){var t=-1;for(r=new Array(i);++t<i;)r[t]=((t+1)*n-(t-i)*e)/(i+1);return o}return o.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,a()):[e,n]},o.range=function(t){return arguments.length?(i=(s=Array.from(t)).length-1,a()):s.slice()},o.invertExtent=function(t){var o=s.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=i?[r[i-1],n]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return r.slice()},o.copy=function(){return Iw().domain([e,n]).range(s).unknown(t)},kp.apply(Fp(o),arguments)},t.scaleRadial=function $w(){var t,e=Rp(),n=[0,1],i=!1;function r(n){var r=im(e(n));return isNaN(r)?t:i?Math.round(r):r}return r.invert=function(t){return e.invert(nm(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((n=Array.from(t,Dp)).map(nm)),r):n.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(i=!!t,r):i},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return $w(e.domain(),n).round(i).clamp(e.clamp()).unknown(t)},kp.apply(r,arguments),Fp(r)},t.scaleSequential=function Rw(){var t=Fp(lv()(Np));return t.copy=function(){return cv(t,Rw())},Sp.apply(t,arguments)},t.scaleSequentialLog=function Lw(){var t=Yp(lv()).domain([1,10]);return t.copy=function(){return cv(t,Lw()).base(t.base())},Sp.apply(t,arguments)},t.scaleSequentialPow=uv,t.scaleSequentialQuantile=function Fw(){var t=[],n=Np;function i(e){if(null!=e&&!isNaN(e=+e))return n((l(t,e,1)-1)/(t.length-1))}return i.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let e of n)null==e||isNaN(e=+e)||t.push(e);return t.sort(e),i},i.interpolator=function(t){return arguments.length?(n=t,i):n},i.range=function(){return t.map((e,i)=>n(i/(t.length-1)))},i.quantiles=function(e){return Array.from({length:e+1},(n,i)=>G(t,i/e))},i.copy=function(){return Fw(n).domain(t)},Sp.apply(i,arguments)},t.scaleSequentialSqrt=function(){return uv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function Ow(){var t=Gp(lv());return t.copy=function(){return cv(t,Ow()).constant(t.constant())},Sp.apply(t,arguments)},t.scaleSqrt=function(){return em.apply(null,arguments).exponent(.5)},t.scaleSymlog=function Hw(){var t=Gp($p());return t.copy=function(){return Ip(t,Hw()).constant(t.constant())},kp.apply(t,arguments)},t.scaleThreshold=function Vw(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[l(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Vw().domain(e).range(n).unknown(t)},kp.apply(r,arguments)},t.scaleTime=function(){return kp.apply(av(Dg,Eg,Xm,Um,Em,Cm,Sm,xm,vm,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return kp.apply(av(Cg,Ag,Sg,xg,og,ig,tg,Km,vm,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,e){const n=it(t,e);return n<0?void 0:n},t.schemeAccent=mv,t.schemeBlues=dy,t.schemeBrBG=Mv,t.schemeBuGn=qv,t.schemeBuPu=Uv,t.schemeCategory10=pv,t.schemeDark2=gv,t.schemeGnBu=Yv,t.schemeGreens=my,t.schemeGreys=_y,t.schemeOrRd=Jv,t.schemeOranges=ky,t.schemePRGn=Cv,t.schemePaired=_v,t.schemePastel1=vv,t.schemePastel2=yv,t.schemePiYG=Dv,t.schemePuBu=Qv,t.schemePuBuGn=Kv,t.schemePuOr=Nv,t.schemePuRd=ey,t.schemePurples=yy,t.schemeRdBu=Pv,t.schemeRdGy=Iv,t.schemeRdPu=iy,t.schemeRdYlBu=Rv,t.schemeRdYlGn=Fv,t.schemeReds=xy,t.schemeSet1=bv,t.schemeSet2=xv,t.schemeSet3=wv,t.schemeSpectral=Hv,t.schemeTableau10=kv,t.schemeYlGn=ay,t.schemeYlGnBu=sy,t.schemeYlOrBr=cy,t.schemeYlOrRd=hy,t.select=Fe,t.selectAll=function(t){return"string"==typeof t?new Re([document.querySelectorAll(t)],[document.documentElement]):new Re([Pt(t)],$e)},t.selection=Le,t.selector=zt,t.selectorAll=It,t.shuffle=rt,t.shuffler=st,t.some=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");let n=-1;for(const i of t)if(e(i,++n,t))return!0;return!1},t.sort=z,t.stack=function(){var t=Ry([]),e=Mx,n=Sx,i=Tx;function r(r){var s,o,a=Array.from(t.apply(this,arguments),Cx),l=a.length,c=-1;for(const t of r)for(s=0,++c;s<l;++s)(a[s][c]=[0,+i(t,a[s].key,c,r)]).data=t;for(s=0,o=sb(e(a));s<l;++s)a[o[s]].index=s;return n(a,o),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Ry(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Mx:"function"==typeof t?t:Ry(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Sx:t,r):n},r},t.stackOffsetDiverging=function(t,e){if((a=t.length)>0)for(var n,i,r,s,o,a,l=0,c=t[e[0]].length;l<c;++l)for(s=o=0,n=0;n<a;++n)(r=(i=t[e[n]][l])[1]-i[0])>0?(i[0]=s,i[1]=s+=r):r<0?(i[1]=o,i[0]=o+=r):(i[0]=0,i[1]=r)},t.stackOffsetExpand=function(t,e){if((i=t.length)>0){for(var n,i,r,s=0,o=t[0].length;s<o;++s){for(r=n=0;n<i;++n)r+=t[n][s][1]||0;if(r)for(n=0;n<i;++n)t[n][s][1]/=r}Sx(t,e)}},t.stackOffsetNone=Sx,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],s=r.length;i<s;++i){for(var o=0,a=0;o<n;++o)a+=t[o][i][1]||0;r[i][1]+=r[i][0]=-a/2}Sx(t,e)}},t.stackOffsetWiggle=function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,s=0,o=1;o<i;++o){for(var a=0,l=0,c=0;a<r;++a){for(var u=t[e[a]],h=u[o][1]||0,f=(h-(u[o-1][1]||0))/2,d=0;d<a;++d){var p=t[e[d]];
vendor: 4,306 bytes, lines 442-443
442f+=(p[o][1]||0)-(p[o-1][1]||0)}l+=h,c+=f*h}n[o-1][1]+=n[o-1][0]=s,l&&(s-=c/l)}n[o-1][1]+=n[o-1][0]=s,Sx(t,e)}},t.stackOrderAppearance=Ax,t.stackOrderAscending=Ex,t.stackOrderDescending=function(t){return Ex(t).reverse()},t.stackOrderInsideOut=function(t){var e,n,i=t.length,r=t.map(Nx),s=Ax(t),o=0,a=0,l=[],c=[];for(e=0;e<i;++e)n=s[e],o<a?(o+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},t.stackOrderNone=Mx,t.stackOrderReverse=function(t){return Mx(t).reverse()},t.stratify=function(){var t=Vd,e=qd;function n(n){var i,r,s,o,a,l,c,u=Array.from(n),h=u.length,f=new Map;for(r=0;r<h;++r)i=u[r],a=u[r]=new gd(i),null!=(l=t(i,r,n))&&(l+="")&&(c=a.id=l,f.set(c,f.has(c)?Hd:a)),null!=(l=e(i,r,n))&&(l+="")&&(a.parent=l);for(r=0;r<h;++r)if(l=(a=u[r]).parent){if(!(o=f.get(l)))throw new Error("missing: "+l);if(o===Hd)throw new Error("ambiguous: "+l);o.children?o.children.push(a):o.children=[a],a.parent=o}else{if(s)throw new Error("multiple roots");s=a}if(!s)throw new Error("no root");if(s.parent=Od,s.eachBefore(function(t){t.depth=t.parent.depth+1,--h}).eachBefore(md),s.parent=null,h>0)throw new Error("cycle");return s}return n.id=function(e){return arguments.length?(t=Nd(e),n):t},n.parentId=function(t){return arguments.length?(e=Nd(t),n):e},n},t.style=oe,t.subset=function(t,e){return ct(e,t)},t.sum=function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n},t.superset=ct,t.svg=Qa,t.symbol=function(t,e){var n=null;function i(){var i;if(n||(n=i=vo()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:Ry(t||Cb),e="function"==typeof e?e:Ry(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:Ry(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i},t.symbolCircle=Cb,t.symbolCross=Ab,t.symbolDiamond=Nb,t.symbolSquare=$b,t.symbolStar=Ib,t.symbolTriangle=Lb,
443t.symbolWye=qb,t.symbols=Bb,t.text=Ua,t.thresholdFreedmanDiaconis=function(t,e,n){return Math.ceil((n-e)/(2*(G(t,.75)-G(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,e,n){return Math.ceil((n-e)/(3.5*p(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=B,t.tickFormat=Lp,t.tickIncrement=H,t.tickStep=V,t.ticks=O,t.timeDay=Cm,t.timeDays=Am,t.timeFormatDefaultLocale=Q_,t.timeFormatLocale=jg,t.timeFriday=Im,t.timeFridays=Vm,t.timeHour=Sm,t.timeHours=Mm,t.timeInterval=om,t.timeMillisecond=lm,t.timeMilliseconds=cm,t.timeMinute=xm,t.timeMinutes=wm,t.timeMonday=Nm,t.timeMondays=Lm,t.timeMonth=Um,t.timeMonths=Wm,t.timeSaturday=$m,t.timeSaturdays=qm,t.timeSecond=vm,t.timeSeconds=ym,t.timeSunday=Em,t.timeSundays=Rm,t.timeThursday=jm,t.timeThursdays=Hm,t.timeTickInterval=Eg,t.timeTicks=Dg,t.timeTuesday=zm,t.timeTuesdays=Fm,t.timeWednesday=Pm,t.timeWednesdays=Om,t.timeWeek=Em,t.timeWeeks=Rm,t.timeYear=Xm,t.timeYears=Jm,t.timeout=_r,t.timer=fr,t.timerFlush=dr,t.transition=Qr,t.transpose=ot,t.tree=function(){var t=Bd,e=1,n=1,i=null;function r(r){var l=function(t){for(var e,n,i,r,s,o=new Jd(t,0),a=[o];e=a.pop();)if(i=e._.children)for(e.children=new Array(s=i.length),r=s-1;r>=0;--r)a.push(n=e.children[r]=new Jd(i[r],r)),n.parent=e;return(o.parent=new Jd(null,0)).children=[o],o}(r);if(l.eachAfter(s),l.parent.m=-l.z,l.eachBefore(o),i)r.eachBefore(a);else{var c=r,u=r,h=r;r.eachBefore(function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)});var f=c===u?1:t(c,u)/2,d=f-c.x,p=e/(u.x+f+d),m=n/(h.depth||1);r.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*m})}return r}function s(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,s=r.length;--s>=0;)(e=r[s]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var s=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-s):e.z=s}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,s=e,o=e,a=n,l=s.parent.children[0],c=s.m,u=o.m,h=a.m,f=l.m;a=Wd(a),s=Ud(s),a&&s;)l=Ud(l),(o=Wd(o)).a=e,(r=a.z+h-s.z-c+t(a._,s._))>0&&(Yd(Xd(a,e,i),e,r),c+=r,u+=r),h+=a.m,c+=s.m,f+=l.m,u+=o.m;a&&!Wd(o)&&(o.t=a,o.m+=h-u),s&&!Ud(l)&&(l.t=s,l.m+=c-f,i=e)}return i}(e,r,e.parent.A||i[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}
vendor: 4,567 bytes, line 443
443function a(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},t.treemap=function(){var t=Qd,e=!1,n=1,i=1,r=[0],s=zd,o=zd,a=zd,l=zd,c=zd;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(h),r=[0],e&&t.eachBefore(Ld),t}function h(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,h=e.x1-n,f=e.y1-n;h<i&&(i=h=(i+h)/2),f<u&&(u=f=(u+f)/2),e.x0=i,e.y0=u,e.x1=h,e.y1=f,e.children&&(n=r[e.depth+1]=s(e)/2,i+=c(e)-n,u+=o(e)-n,(h-=a(e)-n)<i&&(i=h=(i+h)/2),(f-=l(e)-n)<u&&(u=f=(u+f)/2),t(e,i,u,h,f))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],i=+t[1],u):[n,i]},u.tile=function(e){return arguments.length?(t=Nd(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(s="function"==typeof t?t:Pd(+t),u):s},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:Pd(+t),u):o},u.paddingRight=function(t){return arguments.length?(a="function"==typeof t?t:Pd(+t),u):a},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:Pd(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:Pd(+t),u):c},u},t.treemapBinary=function(t,e,n,i,r){var s,o,a=t.children,l=a.length,c=new Array(l+1);for(c[0]=o=s=0;s<l;++s)c[s+1]=o+=a[s].value;!function u(t,e,n,i,r,s,o){if(t>=e-1){var l=a[t];return l.x0=i,l.y0=r,l.x1=s,void(l.y1=o)}var h=c[t],f=n/2+h,d=t+1,p=e-1;for(;d<p;){var m=d+p>>>1;c[m]<f?d=m+1:p=m}f-c[d-1]<c[d]-f&&t+1<d&&--d;var g=c[d]-h,_=n-g;if(s-i>o-r){var v=n?(i*_+s*g)/n:s;u(t,d,g,i,r,v,o),u(d,e,_,v,r,s,o)}else{var y=n?(r*_+o*g)/n:o;u(t,d,g,i,r,s,y),u(d,e,_,i,y,s,o)}}(0,l,t.value,e,n,i,r)},t.treemapDice=Fd,t.treemapResquarify=tp,t.treemapSlice=Gd,t.treemapSliceDice=function(t,e,n,i,r){(1&t.depth?Gd:Fd)(t,e,n,i,r)},t.treemapSquarify=Qd,t.tsv=Xa,t.tsvFormat=$a,t.tsvFormatBody=Ra,t.tsvFormatRow=Fa,t.tsvFormatRows=La,t.tsvFormatValue=Oa,t.tsvParse=ja,t.tsvParseRows=Ia,t.union=function(...t){const e=new v;for(const n of t)for(const t of n)e.add(t);return e},t.utcDay=ig,t.utcDays=rg,t.utcFriday=hg,t.utcFridays=vg,t.utcHour=tg,t.utcHours=eg,t.utcMillisecond=lm,t.utcMilliseconds=cm,t.utcMinute=Km,t.utcMinutes=Zm,t.utcMonday=ag,t.utcMondays=pg,t.utcMonth=xg,t.utcMonths=wg,t.utcSaturday=fg,t.utcSaturdays=yg,t.utcSecond=vm,t.utcSeconds=ym,t.utcSunday=og,t.utcSundays=dg,t.utcThursday=ug,t.utcThursdays=_g,t.utcTickInterval=Ag,t.utcTicks=Cg,t.utcTuesday=lg,t.utcTuesdays=mg,t.utcWednesday=cg,t.utcWednesdays=gg,t.utcWeek=og,t.utcWeeks=dg,t.utcYear=Sg,t.utcYears=Mg,t.variance=d,t.version="7.1.1",t.window=ne,t.xml=Ka,t.zip=function(){return ot(arguments)},t.zoom=function(){var t,e,n,i=Fx,r=Ox,s=Bx,o=Vx,a=qx,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=Vi,f=bt("start","zoom","end"),d=500,p=0,m=10;function g(t){t.property("__zoom",Hx).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new jx(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new jx(t.k,i,r)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function b(t,e,n,i){t.on("start.zoom",function(){x(this,arguments).event(i).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(i).end()}).tween("zoom",function(){var t=this,s=arguments,o=x(t,s).event(i),a=r.apply(t,s),l=null==n?y(a):"function"==typeof n?n.apply(t,s):n,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,s):e,d=h(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=c/e[2];t=new jx(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}})}function x(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function k(t,...e){if(i.apply(this,arguments)){var n=x(this,e).event(t),r=this.__zoom,a=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,o.apply(this,arguments)))),u=Be(t);
vendor: 4,255 bytes, line 443
443if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===a)return;n.mouse=[u,r.invert(u)],Sr(this),n.start()}Lx(t),n.wheel=setTimeout(h,150),n.zoom("mouse",s(v(_(r,a),n.mouse[0],n.mouse[1]),n.extent,c))}function h(){n.wheel=null,n.end()}}function S(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,o=x(this,e,!0).event(t),a=Fe(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",d,!0),l=Be(t,r),u=t.clientX,h=t.clientY;Je(t.view),Rx(t),o.mouse=[l,this.__zoom.invert(l)],Sr(this),o.start()}function f(t){if(Lx(t),!o.moved){var e=t.clientX-u,n=t.clientY-h;o.moved=e*e+n*n>p}o.event(t).zoom("mouse",s(v(o.that.__zoom,o.mouse[0]=Be(t,r),o.mouse[1]),o.extent,c))}function d(t){a.on("mousemove.zoom mouseup.zoom",null),Ge(t.view,o.moved),Lx(t),o.event(t).end()}}function M(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,o=Be(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(o),l=n.k*(t.shiftKey?.5:2),h=s(v(_(n,l),o,a),r.apply(this,e),c);Lx(t),u>0?Fe(this).transition().duration(u).call(b,h,o,t):Fe(this).call(g.transform,h,o,t)}}function T(n,...r){if(i.apply(this,arguments)){var s,o,a,l,c=n.touches,u=c.length,h=x(this,r,n.changedTouches.length===u).event(n);for(Rx(n),o=0;o<u;++o)l=[l=Be(a=c[o],this),this.__zoom.invert(l),a.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,s=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),s&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},d)),Sr(this),h.start())}}function C(t,...e){if(this.__zooming){var n,i,r,o,a=x(this,e).event(t),l=t.changedTouches,u=l.length;for(Lx(t),n=0;n<u;++n)r=Be(i=l[n],this),a.touch0&&a.touch0[2]===i.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===i.identifier&&(a.touch1[0]=r);if(i=a.that.__zoom,a.touch1){var h=a.touch0[0],f=a.touch0[1],d=a.touch1[0],p=a.touch1[1],m=(m=d[0]-h[0])*m+(m=d[1]-h[1])*m,g=(g=p[0]-f[0])*g+(g=p[1]-f[1])*g;i=_(i,Math.sqrt(m/g)),r=[(h[0]+d[0])/2,(h[1]+d[1])/2],o=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],o=a.touch0[1]}a.zoom("touch",s(v(i,r,o),a.extent,c))}}function A(t,...i){if(this.__zooming){var r,s,o=x(this,i).event(t),a=t.changedTouches,l=a.length;for(Rx(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},d),r=0;r<l;++r)s=a[r],o.touch0&&o.touch0[2]===s.identifier?delete o.touch0:o.touch1&&o.touch1[2]===s.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(s=Be(s,this),Math.hypot(e[0]-s[0],e[1]-s[1])<m)){var c=Fe(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(t,e,n,i){var r=t.selection?t.selection():t;r.property("__zoom",Hx),t!==r?b(t,e,n,i):r.interrupt().each(function(){x(this,arguments).event(i).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e,n,i){g.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,i)},g.scaleTo=function(t,e,n,i){g.transform(t,function(){var t=r.apply(this,arguments),i=this.__zoom,o=null==n?y(t):"function"==typeof n?n.apply(this,arguments):n,a=i.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return s(v(_(i,l),o,a),t,c)},n,i)},g.translateBy=function(t,e,n,i){g.transform(t,function(){return s(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,i)},g.translateTo=function(t,e,n,i,o){g.transform(t,function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==i?y(t):"function"==typeof i?i.apply(this,arguments):i;return s(Ix.translate(a[0],a[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)},i,o)},w.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit
443("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Fe(this.that).datum();f.call(t,this.that,new Px(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:zx(+t),g):o},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:zx(!!t),g):i},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:zx(!!t),g):a},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:zx([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(s=t,g):s},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(m=+t,g):m},g},t.zoomIdentity=Ix,t.zoomTransform=$x,Object.defineProperty(t,"__esModule",{value:!0})});(function(){}).call(this);(function(t){var e,n,i,r;r="quickfit";i={min:8,max:12,tolerance:.02,truncate:false,width:null,sampleNumberOfLetters:10,sampleFontSize:12};n=function(){var e=null;n.instance=function(t){if(!e){e=new n(t)}return e};function n(e){this.options=e;this.item=t('<span id="meassure"></span>');this.item.css({position:"absolute",left:"-1000px",top:"-1000px","font-size":""+this.options.sampleFontSize+"px"});t("body").append(this.item);this.meassures={}}n.prototype.getMeassure=function(t){var e;e=this.meassures[t];if(!e){e=this.setMeassure(t)}return e};n.prototype.setMeassure=function(t){var e,n,i,r,s;r="";i=t===" "?"&nbsp;":t;for(n=0,s=this.options.sampleNumberOfLetters-1;0<=s?n<=s:n>=s;0<=s?n++:n--){r+=i}this.item.html(r);e=this.item.width()/this.options.sampleNumberOfLetters/this.options.sampleFontSize;this.meassures[t]=e;return e};return n}();e=function(){function e(e,s){this.$element=e;this.options=t.extend({},i,s);this.$element=t(this.$element);this._defaults=i;this._name=r;this.quickfitHelper=n.instance(this.options)}e.prototype.fit=function(){var t;if(!this.options.width){t=this.$element.width();this.options.width=t-this.options.tolerance*t}if(this.text=this.$element.attr("data-quickfit")){this.previouslyTruncated=true}else{this.text=this.$element.text()}this.calculateFontSize();if(this.options.truncate)this.truncate();return{$element:this.$element,size:this.fontSize}};e.prototype.calculateFontSize=function(){var t,e,n;e=0;for(n=0;n<this.text.length;++n){t=this.text.charAt(n);e+=this.quickfitHelper.getMeassure(t)}this.targetFontSize=parseInt(this.options.width/e);return this.fontSize=Math.max(this.options.min,Math.min(this.options.max,this.targetFontSize))};e.prototype.truncate=function(){var t,e,n,i,r;if(this.fontSize>this.targetFontSize){i="";r=3*this.quickfitHelper.getMeassure(".")*this.fontSize;t=0;while(r<this.options.width&&t<this.text.length){n=this.text[t++];if(e)i+=e;r+=this.fontSize*this.quickfitHelper.getMeassure(n);e=n}if(i.length+1===this.text.length){i=this.text}else{i+="..."}this.textWasTruncated=true;return this.$element.attr("data-quickfit",this.text).html(i)}else{if(this.previouslyTruncated){return this.$element.html(this.text)}}};return e}();return t.fn.quickfit=function(t){var n=[];var i=this.each(function(){var i=new e(this,t).fit();n.push(i);return i.$element});for(var r=0;r<n.length;r++){var s=n[r];s.$element.css({fontSize:s.size+"px"})}return i}})(jQuery,window);function isPicked(){removeStyle();index=arguments[2]+1;selectAtom(index)}function removeStyle(){var t=document.getElementById("atom_table").rows.length;for(i=1;i<t;i++){let t=`select atomno = ${i}; halos OFF;`;Jmol.script(jmolApplet1,t);var e=document.getElementById("atom_table").rows[i].cells[0];var n=document.getElementById("atom_table").rows[i].cells[1];e.classList.remove("custom-selection");n.classList.remove("custom-selection");e.classList.remove("custom-selection-hydrogen");n.classList.remove("custom-selection-hydrogen");
443e.classList.remove("custom-selection-parent");n.classList.remove("custom-selection-parent")}}function appendHydrogens(t,e,n,i){let r=[];t.forEach(t=>{let e;if(t["atom1"]["atomno"]===n&&t["atom2"]["sym"]==="H"){r.push(t["atom2"]["atomno"])}else if(t["atom2"]["atomno"]===n&&t["atom1"]["sym"]==="H"){r.push(t["atom1"]["atomno"])}});r=r.reverse();e.push({type:i,atomNo:n,hydrogens:r})}function atomOrdering(){const t=Jmol.getPropertyAsArray(jmolApplet0,"bondInfo");let e=Array.prototype.slice.call(document.getElementById("atom_table").rows);e.shift();let n=e.filter(t=>t.cells[0].innerText!=="H");let i=[];let r=1;n.forEach(e=>{const n=parseInt(e.cells[1].innerText);const r=e.cells[0].innerText;appendHydrogens(t,i,n,r)});i.sort((t,e)=>t["atomNo"]>e["atomNo"]?1:e["atomNo"]>t["atomNo"]?-1:0);return i}function selectAtom(t){removeStyle();let e=document.getElementById(`atom-row-${t}`);let n=e.cells[1];let i=e.cells[0];let r=e.cells[2].children[0];n.classList.add("custom-selection");i.classList.add("custom-selection");r.focus();let s=`select atomno = ${t}; halos ON;`;if(i.innerText==="H"){s+=" color halos blue;";let n=atomOrdering().filter(e=>e.hydrogens.includes(t))[0];e=document.getElementById(`atom-row-${n.atomNo}`);e.cells[1].classList.add("custom-selection-parent");e.cells[0].classList.add("custom-selection-parent");s+=` select atomno = ${n.atomNo}; halos ON; color halos green;`;n.hydrogens.forEach(n=>{if(n!==t){e=document.getElementById(`atom-row-${n}`);e.cells[1].classList.add("custom-selection-hydrogen");e.cells[0].classList.add("custom-selection-hydrogen");s+=` select atomno = ${n}; halos ON; color halos red;`}})}else{s+=" color halos blue;";let n=atomOrdering().filter(e=>e.atomNo===t)[0];n.hydrogens.forEach(t=>{e=document.getElementById(`atom-row-${t}`);e.cells[1].classList.add("custom-selection-hydrogen");e.cells[0].classList.add("custom-selection-hydrogen");s+=` select atomno = ${t}; halos ON; color halos red;`})}Jmol.script(jmolApplet1,s)}function updateLabel(t,e,n=false){let i=`select atomno = ${t}; set label "${e}";`;if(n){if(t!==e){let e=Jmol.getPropertyAsArray(jmolApplet0,"atomInfo")[parseInt(t)-1].sym;if(e==="C"){i+="color atoms [x90ee90];"}}else{let e=Jmol.getPropertyAsArray(jmolApplet0,"atomInfo")[parseInt(t)-1].sym;if(e==="C"){i+="color atoms CPK;"}}Jmol.script(jmolApplet1,i)}else{Jmol.script(jmolApplet0,i)}}function resetNumbering(){if(confirm("This will clear all fields inside the Custom Atom Numbering Table."+"\nDo you wish to continue?")){let t=document.getElementById("atom_table").rows.length;for(let e=1;e<t;e++){updateLabel(e.toString(),e.toString(),true);document.getElementById("atom_table").rows[e].cells[2].children[0].value=""}}}function mapHydrogens(){if(confirm("This will auto-populate hydrogens with unused numbers in ascending order."+"\n Do you wish to continue?")){let t=1;let e=atomOrdering();let n=document.getElementById("atom_table");let i=n.rows.length;let r=new Set;for(let t=1;t<i;t++){let e=parseInt(n.rows[t].cells[2].children[0].value);if(!isNaN(e))r.add(e)}e.forEach(e=>{e.hydrogens.reverse().forEach(e=>{let n=document.getElementById(`atom-row-${e}`).cells[2].children[0];while(r.has(t))t++;if(!n.value){updateLabel(e,t.toString(),true);n.value=t++}})})}}function cbOn(t,e){var n="";var i="loadStructCallback pickCallback hoverCallback animFrameCallback".split(" ");for(var r=0;r<i.length;r++){n+="set "+i[r]+' "'+(t==i[r]?e:"")+'"; '}Jmol.script(jmolApplet0,n);Jmol.script(jmolApplet1,n)}function toggleLabels(){let t=$("#toggle-labels");if(t.hasClass("btn-danger")){let e=t.width();if(typeof jmolApplet0=="object"){Jmol.script(jmolApplet0,"select all; labels off")}else{Jmol.script(jmolApplet1,"select all; labels off")}t.removeClass("btn-danger");t.addClass("btn-primary");t.text("Show labels");t.width(e+"px")}else{if(typeof jmolApplet0=="object"){Jmol.script(jmolApplet0,"select all; labels %e")}else{Jmol.script(jmolApplet1,"select all; labels on")}t.removeClass("btn-primary");t.addClass("btn-danger");t.text("Hide labels")}}function toggleHydrogens(){let t=$("#toggle-H");if(t.hasClass("btn-danger")){let e=t.width();Jmol.script(jmolApplet0,"select all;
443 set showHydrogens FALSE");t.removeClass("btn-danger");t.addClass("btn-primary");t.text("Show Hydrogens");t.width(e+"px")}else{Jmol.script(jmolApplet0,"select all; set showHydrogens TRUE");t.removeClass("btn-primary");t.addClass("btn-danger");t.text("Hide Hydrogens")}}function toggleNMR(){let t=$("#toggle-NMR");if(t.hasClass("btn-danger")){let e=t.width();Jmol.script(jmolApplet0,"select all; labels %e; color label black");$("#toggle-labels").attr("disabled",false).removeClass("disabled");t.removeClass("btn-danger");t.addClass("btn-primary");t.text("Show NMR Assignment");t.width(e+"px")}else{if($("#toggle-labels").hasClass("btn-primary")){toggleLabels()}$("#toggle-labels").attr("disabled",true).addClass("disabled");labelCS();t.removeClass("btn-primary");t.addClass("btn-danger");t.text("Hide NMR Assignment")}}function labelCS(){let t=$("#view_3d").data("assignments");fetch(t).then(t=>t.text()).then(t=>{let e=t.split("\n");console.log(e);for(let t=0;t,e.length-1;t++){let n=e[t].split(",");if(n[3]===""){continue}let i=`select atomno = ${n[1]}; set label "%e ${n[2]}";  color label red`;Jmol.script(jmolApplet0,i)}console.log(t)})}function recenter(){Jmol.script(jmolApplet0,"rotate best")}function zoomFit(){Jmol.script(jmolApplet0,"zoom 0")}function downloadJsmol(){Jmol.script(jmolApplet0,'write image png "Structure.png"')}window.JSpectraViewer={};JSpectraViewer.version="0.1";if(window.JSV===undefined)window.JSV=JSpectraViewer;if(window.d3v7===undefined)window.d3v7=d3;(function(t){t.inherits=function(t,e){t.prototype=Object.create(e.prototype)};t.initialize=function(){if(!d3v7.version.match(/^7\./g))throw"JSpectraViewer requires D3 v7";t._viewers=new t.SVSet;t.viewers=function(e){return t._viewers.get(e)}}})(JSpectraViewer);(function(t){const e=function(e,n){const i=this;window.sv=this;this.container=d3v7.select(e);n=n||{};this.title=n.title;this.width=t.default_for(n.width,800);this.height=t.default_for(n.height,400);this.tick_count=t.default_for(n.tick_count,10);this.x_tick_count=t.default_for(n.x_tick_count,10);this.tick_length=t.default_for(n.tick_length,10);this.tick_precision=t.default_for(n.tick_precision,3);this.axis_x_tick_format=d3v7.format(t.default_for(n.axis_x_tick_format,"~g"));this.axis_y_tick_format=d3v7.format(t.default_for(n.axis_y_tick_format,"~g"));this.axis_x_title=t.default_for(n.axis_x_title,"ppm");this.axis_y_title=t.default_for(n.axis_y_title,"Intensity");this.axis_y_show=t.default_for(n.axis_y_show,false);this.axis_x_show=t.default_for(n.axis_x_show,true);this.axis_y_grid=t.default_for(n.axis_y_grid,false);this.axis_x_grid=t.default_for(n.axis_x_grid,false);this.axis_x_reverse=t.default_for(n.axis_x_reverse,true);this.axis_y_lock=t.default_for(n.axis_y_lock,false);this.min_boundaries=n.min_boundaries;this.zoom_max=t.default_for(n.zoom_max,100);this.zoombox_show=t.default_for(n.zoombox_show,true);this.zoombox_size=t.default_for(n.zoombox_size,15);this.legend_show=t.default_for(n.legend_show,true);this.simplify_tolerance=n.simplify_tolerance;this.debug=t.default_for(n.debug,false);this.debug_data={time:{},data:{},drag:{},zoom:{},zbox:{}};const r=t.viewers().map(function(t){return t.id});this.id=t.default_for(n.id,t.unique_id("jsv-",1,r));this.axis_y_gutter=this.axis_y_show?t.default_for(n.axis_y_gutter,60):0;this.axis_x_gutter=this.axis_x_show?t.default_for(n.axis_x_gutter,50):0;const s=this.title?"<h3>"+this.title+"</h3>":"";this.container.html(s).style("width",this.width+2+"px");this.sv_wrapper=this.container.append("div").attr("class","sv-wrapper").style("position","relative");this.container.append("div").attr("class","sv-key-down").style("display","none");this.canvas=this.sv_wrapper.append("canvas").attr("id",this.container.attr("id")).attr("class","spectra-viewer "+this["class"]).style("border","1px solid #DDD").attr("width",this.width).attr("height",this.height).node();if(!this.canvas.getContext){this.container.html("<h3>Spectra Viewer requires Canvas, which is not supported by this browser.</h3>");throw"Canvas not supported"}t.pixel_ratio=t.get_pixel_ratio(this.canvas);t.scale_resolution(this.canvas,t.pixel_ratio);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.context=this.canvas.getContext("2d");if(!this.context.setLineDash){this.context.setLineDash=function(){}}this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale=new t.SVScale;this.scale.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary=new t.SVScale;this.boundary.x.range(this.x_range());this.boundary.y.range([this.scaled_height,0]);this.boundary.clamp(true);if(this.min_boundaries){console.log("UPDATING min_boundaries",this.min_boundaries);this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries)}this._spectra=new t.SVSet;this.svg=this.sv_wrapper.append("svg").attr("width",this.width).attr("height",this.height).attr("class","svg-viewer").style("position","absolute").style("top",0).style("left",0);this.svg.style("cursor","all-scroll");this.drag_drop_load=t.default_for(n.drag_drop_load,true);this.initialize_zooming();this.initialize_dragging();i.legend=new t.SVLegend(i);d3v7.select(window).on("keydown",i.keydown).on("keyup",i.keyup);this.svg.on("mousemove",function(e){const n=d3v7.pointer(e);i.mx=i.scale.x.invert(t.pixel(n[0]));i.my=i.scale.y.invert(t.pixel(n[1]));i.highlight.hover();i.annotation.check_hover()});this.svg.on("mouseover",function(){i.contains_mouse=true;document.activeElement.blur()});this.svg.on("mouseout",function(){i.contains_mouse=false});this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger;if(this.drag_drop_load){this.initialize_drag_drop_load()}this.selection=new t.SVSelection(this,t.default_for(n.select,{}));this.annotation=new t.SVAnnotation(i);this.zoombox=new t.ZoomBox(i);this.zoombox.visible=this.zoombox_show;this.highlight=new t.SVHighlighter(this,t.default_for(n.highlight,{}));this.menu=new t.SVMenu(i);this.menu.open();this.help=new t.SVHelp(i);this.initial_settings();this.cluster_navigation_id=n.cluster_navigation_id;if(n.structure){this.structure=new t.SVStructure(n.structure)}if(n.assignment_table){this.assignment_table=new t.SVAssignments(i,n.assignment_table)}t._viewers.push(this);this.draw()};e.prototype.toString=function(){return"SpectraViewer"};Object.defineProperties(e.prototype,{drag_drop_load:{get:function(){return this._drag_drop_load},set:function(t){this._drag_drop_load=t;if(this._drag_drop_load){this.initialize_drag_drop_load()}else{this.svg.on(".dragndrop",null)}}},cluster_navigation_id:{get:function(){return this._cluster_navigation_id},set:function(e){this._cluster_navigation_id=e;if(this._cluster_navigation_id){this._cluster_navigation=new t.SVClusterNavigator(this,e)}else{if(this._cluster_navigation){this._cluster_navigation.detach();this._cluster_navigation=undefined}}}},structure_viewer_id:{get:function(){return this._structure_viewer_id},set:function(e){this._structure_viewer_id=e;if(this._structure_viewer_id){this._structure_viewer=new t.SVStructure(this,e)}else{if(this._structure_viewer){this._structure_viewer.detach();this._structure_viewer=undefined}}}}});e.prototype.x_range=function(e){e=e||this.width;const n=t.pixel(e-this.axis_y_gutter);return this.axis_x_reverse?[n,0]:[t.pixel(this.axis_y_gutter),t.pixel(e)]};e.prototype.resize=function(e,n,i){this.width=e||this.width;this.height=n||this.height;this.container.style("width",this.width+"px");d3v7.select(this.canvas).attr("width",this.width).attr("height",this.height);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale.y.range([this.scaled_height,0]);this.boundary.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary.x.range(this.x_range());this.svg.attr("width",this.width).attr("height",this.height);t.scale_resolution(this.canvas,t.pixel_ratio);this.zoombox.update();this.legend.update();this.draw(i)};e.prototype.keyval=function(){return d3v7.select(".sv-key-down").html()};d3v7.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})};e.prototype.keydown=function(t){if(t[this.zoom_brush_key]){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","crosshair")}d3v7.selectAll(".sv-key-down").html(t.keyCode)};e.prototype.keyup=function(t){if(t.keyCode==16){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","all-scroll")}d3v7.selectAll(".sv-key-down").html("")};e.prototype.pixels_to_units_of_axis=function(e,n){const i=this;return i.scale[e].invert(t.pixel(n))-i.scale[e].invert(0)};e.prototype.set_zoom_axis=function(t,e){if(t){if(this.zoom_axis!="y"){this.zoom_axis="y";this.set_zoom_cursor(t)}}else{if(this.zoom_axis!="x"){this.zoom_axis="x";this.set_zoom_cursor(t)}}};e.prototype.set_zoom_cursor=function(t){if(t){this.svg.style("cursor","ns-resize")}else{this.svg.style("cursor","ew-resize")}};e.prototype.scale_axis=function(e,n,i){const r=Math.abs(this.boundary[e].domain()[0]-this.boundary[e].domain()[1])/n;const s=e==="x"?0:1;let o=this.scale[e].invert(this.mouse(i,this.canvas)[s]);let a=(o-this.scale[e].domain()[0])/Math.abs(this.scale[e].domain()[0]-this.scale[e].domain()[1]);if(e=="y"){a=0;o=this.scale.y.domain()[0]}const l=[o-r*a,o+r*(1-a)];this.scale[e].domain(l);this.set_domain(e,l);if(this.debug){e=e.toUpperCase();this.debug_data.zoom["d"+e]=t.round(r);this.debug_data.zoom["v"+e]=t.round(o);this.debug_data.zoom["r"+e]=t.round(a)}};e.prototype.mouse=function(e,n){return d3v7.pointer(e,n).map(function(e){return t.pixel(e)})};e.prototype.translate_axis=function(e,n){const i=this.scale[e].range().map(function(e){return e-t.pixel(n)}).map(this.scale[e].invert);this.set_domain(e,i)};e.prototype.move_to=function(t,e){const n=this;e=e||500;if(this.axis_y_lock!==false){t[1][0]=this.axis_y_lock_value(t[1])}let i=[];let r=[];i=i.concat.apply(i,t);r=r.concat.apply(r,[n.scale.x.domain(),n.scale.y.domain()]);d3v7.select(this.canvas).transition().duration(e).tween("move",function(){const t=d3v7.interpolateArray(r,i);return function(e){n.set_domain("x",[t(e)[0],t(e)[1]]);n.set_domain("y",[t(e)[2],t(e)[3]]);n.fast_draw()}}).on("end",function(){n.full_draw()});n.zoom_axis=""};e.prototype.set_domain=function(e,n){const i=this.scale;const r=this.boundary;const s=Math.abs(r[e].domain()[1]-r[e].domain()[0]);let o=Math.abs(n[1]-n[0]);if(e=="y"&&this["axis_y_lock"]!==false){n[0]=this.axis_y_lock_value(n);n[1]=n[0]+o}let a=s/o;if(a>this.zoom_max){a=this.zoom_max;const i=o;o=s/a;const r=(n[0]+n[1])/2;n[0]=r-o/2;n[1]=n[0]+o;if(this.debug){this.debug_data.zoom["center-"+e]=t.round(r);this.debug_data.zoom["domain-diff-"+e]=t.round(o)}}
443if(a<1){a=1;o=s/a;n[0]=r[e].min();n[1]=r[e].max()}if(this["zoom_"+e]!=a){this["zoom_"+e]=a;this.trigger("zoom")}if(n[0]<r[e].domain()[0]){n[0]=r[e].domain()[0];n[1]=n[0]+o}else if(n[1]>r[e].domain()[1]){n[1]=r[e].domain()[1];n[0]=n[1]-o}this.scale[e].domain(n);this.trigger("domain-change")};e.prototype.axis_y_lock_value=function(t){if(this.axis_y_lock===true){return this.boundary.y.domain()[0]}else{const e=Math.abs(t[1]-t[0]);return 0-e*this.axis_y_lock}};e.prototype.zoom_out_completely=function(){this.move_to([this.boundary.x.domain(),this.boundary.y.domain()]);this.scale.x.domain(this.boundary.x.domain());this.scale.y.domain(this.boundary.y.domain());this.zoom_x=1;this.zoom_y=1};e.prototype.add_spectrum=function(e,n,i){const r=(new Date).getTime();let s=d3v7.max(this.spectra().map(function(t){return t.xy_data.length()}));if(!s)s=4e4;this.points_per_ppm=s/(this.boundary.x.domain()[1]-this.boundary.x.domain()[0]);e.tolerance=t.default_for(e.tolerance,this.simplify_tolerance);e.number_of_points=t.default_for(e.number_of_points,s);e.min_x=t.default_for(e.min_x,this.boundary.x.domain()[0]);e.max_x=t.default_for(e.max_x,this.boundary.x.domain()[1]);const o=this.all_spectra().map(function(t){return t.name});e.id=t.default_for(e.id,t.unique_id("Spectrum_",1,o));if(e.xy_line&&typeof e.xy_line.x=="string"){const t=e.xy_line.x;if(this.spectra(t)){e.xy_line.x=this.spectra(t).xy_data.x}else{throw new Error("There is no spectrum with the id provided by '"+e.id+"' xy_line.x:"+t)}}const a=e.toString()=="Spectrum"?e:new t.Spectrum(e,n,i);a._sv=this;this._spectra.push(a);this.boundary.update(a.xy_data);this.scale.update(a.xy_data);this.zoombox.update();this.legend.update();if(this.debug){this.debug_data.time[e.id+"~add"]=t.elapsed_time(r);this.debug_data.data[e.id+"~noise"]=a.noise;this.debug_data.data[e.id+"~points-all"]=a.xy_data.length();this.debug_data.data[e.id+"~points-simple"]=a.simple_xy_data.length()}this.draw()};e.prototype.add_bayesil_data=function(e){this.add_spectrum({id:"Spectrum",xy_line:e.spectrum_xy},undefined,e.meta);this.add_spectrum(t.convert_bayesil_data(e))};e.prototype.replace_bayesil_data=function(t,e){const n=this;const i=[n.scale.x.domain(),n.scale.y.domain()];const r=n.spectra().length>0;n.remove_all_spectra();n.add_bayesil_data(t);if(r&&e){n.set_domain("x",i[0])
444;n.set_domain("y",i[1])}n.draw()};e.prototype.add_nmrml_data=function(e,n="experimental"){const i={x:[],y:[]};if(!["experimental","predicted","simulated"].includes(n)){console.error("Spectra source not recognized")}else{const s=this;if(!window.X2JS){console.log("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const o=e.match(/<spectrumDataArray.*compressed="(true|false)"[^]*>(.*)<\/spectrumDataArray>/);if(o){const e=o[1]=="true";const n=o[2];const r=t.convert_base64_to_float64(n,e);let a=r[1];for(let t=0;t<r.length;t+=2){i.x.push(r[t]);i.y.push(r[t+1]);a=r[t+1]>a?r[t+1]:a}const l=1/a;i.y=i.y.map(function(t){return t*l});s.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:i})}else{console.log("No Spectrum Data Array found")}const a=e.match(/<atomAssignment[^]*<\/atomAssignment>/);let l;if(a){l=a[0]}else{console.log("Could not read nmrML (1). No <atomAssignment> tag found.");return}const c=l.match(/<structure[^]*<\/structure>/);if(s.structure&&c){const t=l.match(/<identifier.*name="(.*?)"/);if(t){s.structure.title=t[1]}s.structure.read_nmrml(c[0])}const u=e.match(/acquisitionNucleus.*name=\"(.*?)\"/);if(s.assignment_table&&u){const t=u[1];if(t.match(/hydrogen/i)||t.match(/1H/i)){s.assignment_table.nmr_nucleus="1H"}else if(t.match(/carbon/i)||t.match(/13C/i)){s.assignment_table.nmr_nucleus="13C"}}const h=new X2JS;const f=h.xml_str2json(l);let d;try{d=f.atomAssignment.chemicalCompound.identifierList.identifier._name}catch(r){console.error("nmrML contains no compound identifier");d="Compound"}const p={name:d};const m=[];let g=f.atomAssignment.atomAssignmentList.multiplet;if(g){g=Array.isArray(g)?g:[g];let t=g.map(t=>{let e=t.peakList.peak;e=Array.isArray(e)?e:[e];return e.map(t=>parseFloat(t._amplitude))});t=t.flat();let e=i.y[0];let n=i.y[0];
444i.y.forEach(function(t){e=Math.min(t,e);n=Math.max(t,n)});let r=d3v7.scaleLinear().domain([Math.min(0,Math.min(...t)),Math.max(...t)]).range([e,n]);g.forEach(function(t,e){const n=[];let i=t.peakList.peak;i=Array.isArray(i)?i:[i];i.forEach(t=>{let e=r(parseFloat(t._amplitude));t={center:parseFloat(t._center),amplitude:e};t.width=parseFloat(t._width)||.005;n.push(t)});m.push({peaks:n,meta:{nmrml_cluster_index:e}})})}p.clusters=m;let _="Simulated";let v=false;if(n==="predicted"){v=true;_="Predicted/Simulated"}else if(n==="simulated"){v=true}s.add_spectrum({id:"Simulated",name:_,display:{color:"blue",visible:v},compounds:[p]});if(s.structure&&g){const t=s.compounds(s.compounds().length).clusters();g.forEach((e,n)=>{const i=t.find(t=>{return t.meta.nmrml_cluster_index===n});if(e.atoms&&i){let t=[];const n=e.atoms._atomRefs;if(n&&n.match(/\w/)){t=n.trim().split(/\s+/)}t.forEach((e,n)=>t[n]=e.replace(/\D/g,""));i.atom_refs=t;i._atoms.merge(s.structure.atoms(t));switch(e.multiplicity._name.toLowerCase()){case"singlet feature":i.multiplet_type="s";break;case"doublet feature":i.multiplet_type="d";break;case"triplet feature":i.multiplet_type="t";break;case"quartet feature":i.multiplet_type="q";break;case"doublet of doublets feature":i.multiplet_type="dd";break;case"doublet of doublet of doublets feature":i.multiplet_type="ddd";break;case"doublet of doublet of doublets of doublets feature":i.multiplet_type="dddd";break;case"triplet of doublets feature":i.multiplet_type="td";break;case"doublet of triplets feature":i.multiplet_type="dt";break;case"triplet of triplets feature":i.multiplet_type="tt";break;case"doublet of quartets feature":i.multiplet_type="dq";break;case"doublet of doublet of triplets feature":i.multiplet_type="ddt";break;case"doublet of triplet of doublets feature":i.multiplet_type="dtd";break;case"triplet of doublets of doublets feature":i.multiplet_type="tdd";break;case"quintet feature":i.multiplet_type="quint";break;case"multiplet feature":i.multiplet_type="m";break}if(!i.hasOwnProperty("multiplet_type")){switch(e.multiplicity._accession){case"NMR:1000194":i.multiplet_type="s";break;case"NMR:1000184":i.multiplet_type="d";break;case"NMR:1000185":i.multiplet_type="t";break;case"NMR:1000186":i.multiplet_type="q";break;case"NMR:1000192":i.multiplet_type="dd";break;case"NMR:1000195":i.multiplet_type="qunit";break;case"NMR:1000196":i.multiplet_type="dt";break;case"NMR:1000197":i.multiplet_type="td";break;case"NMR:1400305":i.multiplet_type="m";break}}}})}if(n!=="experimental"){s.remove_spectra("Experimental")}s.spectra("Simulated").labels.update_peaks();s.trigger("adjust-end")}};e.prototype.add_spin_matrix_data=function(t){const e=this;const n=JSON.parse(t);const i=n.spectrum.spectrum_xy;const r=n.fit.spectrum_xy;e.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:i});e.add_spectrum({id:"Fit",name:"Fit",display:{color:"blue",visible:true},xy_line:r})};e.prototype.add_ir_data=function(t){const e=this;const n=new X2JS;const i=n.xml_str2json(t);if(i.hasOwnProperty("ms-ir")){const t=i["ms-ir"];if(t.hasOwnProperty("x-units"))e.axis_x_title=t["x-units"];if(t.hasOwnProperty("y-units"))e.axis_y_title=t["y-units"];const n=t["ms-ir-spectrum"].split("\n");const r={x:[],y:[]};for(let t of n){t=t.split(" ");r["x"].push(parseFloat(t[0]));r["y"].push(parseFloat(t[1]))}e.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:r});e.full_draw()}else{console.error("Could not find IR data")}};e.prototype.remove_spectra=function(e){this._spectra=new t.SVSet(this._spectra.filter(function(t){return t.id!=e}));this.zoombox.remove_spectra(e);this.legend.update()};e.prototype.remove_all_spectra=function(){const t=this;t.selection.clear();this.all_spectra().forEach(function(e){t.remove_spectra(e.id)});t.reset_boundaries()};e.prototype.reset_boundaries=function(){const t=this;t.selection.clear();t.boundary.initialized=false;t.scale.initialized=false;if(t.min_boundaries){console.log("Resetting boundaries to min_boundaries",t.min_boundaries);t.boundary.update(t.min_boundaries);t.scale.update(t.min_boundaries)}else{t.boundary.update({x:[0,1],y:[0,1]});t.scale.update({x:[0,1],y:[0,1]})}};e.prototype.spectra=function(e){if(e)return this._spectra.get(e);const n=new t.SVSet(this._spectra.filter(function(t){return t.active}));return n.get(e)};e.prototype.all_spectra=function(t){return this._spectra.get(t)};e.prototype.compounds=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].compounds())}return n.get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;
444i++){console.log("Merging Clusters",this._spectra[i],typeof this._spectra[i]);console.log("Prototype",Object.getPrototypeOf(this._spectra[i]));n.merge(this._spectra[i].clusters())}return n.get(e)};e.prototype.peaks=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].peaks())}return n.get(e)};e.prototype.clear=function(){this.context.clearRect(0,0,t.pixel(this.width),t.pixel(this.height))};e.prototype.draw=function(e,n,i){const r=(new Date).getTime();const s=this;e=e||false;const o=this.context;const a=this.scale;this.clear();if(this.axis_y_grid)this.draw_grid_lines("y");if(this.axis_x_grid)this.draw_grid_lines("x");this.spectra().forEach(function(t){t.compounds().draw(o,a,e,n,i);t.clusters().draw(o,a,e,n,i);t.peaks().draw(o,a,e,true,i);t.draw(o,a,e,n,i)});this.selection.draw(o,a,e,n,i);this.zoombox.set_zoom_area(this.scale);this.annotation.draw();if(this.legend_show)this.legend.draw();this.draw_axes();this.selection.draw_bounds(o,a);this.selection.draw_indicators(o,a);if(this.debug){this.debug_data.time["draw"]=t.elapsed_time(r);this.draw_debug(this.legend.bottom())}};e.prototype.full_draw=function(){const t=this.scale.x.domain()[1]-this.scale.x.domain()[0];const e=this.points_per_ppm*t;const n=Math.abs(this.scale.x.range()[1]-this.scale.x.range()[0]);n/e>3?this.draw(false,true,1):this.draw(false,false)};e.prototype.calc_draw=function(){this.draw(false,true,1)};e.prototype.fast_calc_draw=function(){this.draw(false,true,2)};e.prototype.fast_draw=function(){this.zoom_x<10?this.draw(true):this.draw()};e.prototype.flash=function(e){this.context.font=this.adjust_font(1.5);this.context.textAlign="center";this.context.textBaseline="center";const n=t.pixel(this.width)/2;const i=t.pixel(this.height)/2;this.context.fillText(e,n,i)};e.prototype.draw_debug=function(e){if(!this.debug)return;const n=this.context;const i=this.debug_data;n.font=this.adjust_font(1,"monospace");n.fillStyle="black";const r=t.pixel(18);e=e||0;let s;if(this.axis_x_reverse){s=t.pixel(10);n.textAlign="left"}else{s=t.pixel(this.width-10);n.textAlign="right"}const o=this.debug===true?Object.keys(i):this.debug;let a=0;o.forEach(function(t){const o=Object.keys(i[t]);o.forEach(function(o){n.fillText(t+"|"+o+": "+i[t][o],s,e+r*a);a+=1})})};e.prototype.adjust_font=function(e,n,i){e=e||1;n=n||"Sans-Serif";i=i||"";let r=9/1400*e;let s=r*t.pixel(this.width)+t.pixel(5);return i+" "+s+"pt "+n};e.prototype.get_font_size=function(e){let n=9/1400*e;return n*t.pixel(this.width)+t.pixel(5)};e.prototype.draw_axes=function(){const e=this.scale;this.context.strokeStyle="black";this.context.lineWidth=1;this.context.setLineDash([1,0]);const n=t.pixel(this.axis_y_gutter);const i=t.pixel(this.axis_x_gutter);this.context.clearRect(e.x.range_min(),e.y.range_max(),e.x.range_max()+n,i);const r=this.axis_x_reverse?e.x.range_max():0;this.context.clearRect(r,e.y.range_min(),n,e.y.range_max()+i);this.context.fillStyle="black";if(this.axis_y_show)this.draw_y_axis();if(this.axis_x_show)this.draw_x_axis()};e.prototype.draw_x_axis=function(){const e=this;const n=t.pixel(this.tick_length);const i=this.context;const r=this.scale;i.beginPath();i.moveTo(r.x.range()[1],r.y.range()[0]);i.lineTo(r.x.range()[0],r.y.range()[0]);i.stroke();i.textAlign="center";i.textBaseline="top";i.font=this.font;r.x.ticks(this.x_tick_count).forEach(function(t){i.beginPath();i.moveTo(r.x(t),r.y.range()[0]);i.lineTo(r.x(t),r.y.range()[0]+n);i.stroke();const s=parseFloat(t.toFixed(e.tick_precision));i.fillText(s,r.x(t),r.y.range()[0]+n)});if(this.axis_x_title){i.font=this.axis_title_font;const t=r.x.range_diff()/2;const e=r.y.range()[0]+3*n;i.fillText(this.axis_x_title,t,e)}};e.prototype.draw_y_axis=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=this.axis_x_reverse?1:-1;const o=s*t.pixel(this.tick_length);const a=i.x.range()[0]+s*t.pixel(this.tick_length+r);const l=10;n.beginPath();n.moveTo(i.x.range()[0],i.y.range()[1]-l);n.lineTo(i.x.range()[0],i.y.range()[0]-l);n.stroke();n.textAlign=this.axis_x_reverse?"left":"right";n.textBaseline="middle";n.font=this.font;
444let c=0;i.y.ticks(this.tick_count).forEach(function(t){n.beginPath();n.moveTo(i.x.range()[0],i.y(t)-l);n.lineTo(i.x.range()[0]+o,i.y(t)-l);n.stroke();n.fillText(e.axis_y_tick_format(t),a,i.y(t)-l);if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>c)c=e}});if(this.axis_y_title){const e=t.pixel(4);const a=t.pixel(this.axis_y_gutter);const l=/(\d+\.?\d*)pt/.exec(this.axis_title_font)[1];const u=c+Math.abs(o)+Number(l)+e+r;if(u<a){n.save();n.textAlign="center";n.textBaseline="middle";n.font=this.axis_title_font;const t=i.x.range()[0]+(a-e-Number(l)/2)*s;const r=i.y.range()[0]/2;n.translate(t,r);n.rotate(s*Math.PI/2);n.translate(-t,-r);n.fillText(this.axis_y_title,t,r);n.restore()}}};e.prototype.draw_grid_lines=function(e){const n=this;const i=this.context;const r=i;const s=this.scale;s[e].ticks(this.tick_count).forEach(function(n){i.beginPath();if(e=="y"){i.moveTo(s.x.range()[0],s.y(n));i.lineTo(s.x.range()[1],s.y(n))}else if(e=="x"){i.moveTo(s.x(n),s.y.range()[0]);i.lineTo(s.x(n),s.y.range()[1])}i.strokeStyle="rgb(210,210,210)";i.lineWidth=t.pixel(.5);i.stroke()});this.context=r};e.prototype.draw_y_axis2=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=d3v7.min(i.x.range());const o=d3v7.max(i.x.range());const a=d3v7.min(i.y.range());const l=d3v7.max(i.y.range());let c,u,h;if(this.axis_y_left){c=s;u=c-t.pixel(this.tick_length+r);n.textAlign="right";h=-t.pixel(this.tick_length)}else{c=o;u=c+t.pixel(this.tick_length+r);n.textAlign="left";h=t.pixel(this.tick_length)}n.beginPath();n.moveTo(c,a);n.lineTo(c,l);n.stroke();n.textBaseline="middle";n.font=this.font;let f=0;i.y.ticks(this.tick_count).forEach(function(t){n.beginPath();n.moveTo(c,i.y(t));n.lineTo(c+h,i.y(t));n.stroke();n.fillText(t,u,i.y(t));if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>f)f=e}});if(this.axis_y_title){const e=t.pixel(4);const r=t.pixel(this.axis_y_gutter);const s=/(\d+)pt/.exec(this.axis_title_font)[1];const o=f+h+Number(s)+e;if(o<r){n.save();n.textAlign="center";n.textBaseline="hanging";n.font=this.axis_title_font;n.rotate(Math.PI/2);const t=-i.x.range()[0]-r+e;const s=i.y.range()[0]/2;n.fillText(this.axis_y_title,s,t);n.restore()}}};e.prototype.get_peak_domains=function(e,n){const i=.1;let r=e[0];let s=e[0];let o,a;for(let t=1;t<e.length;t++){const n=e[t];if(n.center<r.center)r=n;if(n.center>s.center)s=n}const l=t.xy_from_peaks(e,1e3,r.center,s.center);let c=d3v7.max(l.y);if(n){o=r.center-r.width/2;a=s.center+s.width/2}else{o=r.center-r.width;a=s.center+s.width;const t=(a-o)*i;o-=t;a+=t;c+=c*i}return[[o,a],[0,c]]};e.prototype.move_to_compound=function(t,e,n){const i=this.spectra(t);const r=i&&i.compounds(e);this.move_to_peaks(r.peaks(),n)};e.prototype.move_to_peaks=function(t,e,n){n=n||1;const i=this.get_peak_domains(t);i[1][1]=i[1][1]*n;const r=Math.abs(i[0][1]-i[0][0]);i[0][0]=i[0][0]-(r-r/n);i[0][1]=i[0][1]+(r-r/n);this.move_to(i,e)};e.prototype.set_domain_to_brush_extent=function(t,e){const n=this.domains_from_brush_extent(t,e);this.set_domain("x",n[0]);this.set_domain("y",n[1])};e.prototype.domains_from_brush_extent=function(t,e){const n=[t[0][0],t[1][0]];const i=[t[0][1],t[1][1]];return[n,i]};e.prototype.elements=function(e,n,i,r){const s=this;let o=i;if(!i){n=t.default_for(n,s);if(typeof n=="string"){n=s.spectra(n)}if(!n){o=new t.SVSet}else if(e=="peak"){o=n.peaks()}
444else if(e=="cluster"){o=n.clusters()}else if(e=="compound"){o=n.compounds()}else if(e=="spectrum"){o=n.spectra()}else{o=new t.SVSet}}if(r){o=new t.SVSet(o.filter(function(t){return t.visible}))}return o};e.prototype.find_element_mouse_over=function(e,n,i,r){const s=this;let o;elements=s.elements(e,n,i,r);elements.forEach(function(e){e.y_for_mouse_x=t.sum_of_peaks(s.mx,e.peaks())});elements.order_by("y_for_mouse_x");for(let t=0;t<elements.length;t++){if(s.my<=elements[t].y_for_mouse_x&&s.my>=0){o=elements[t];break}}return o};e.prototype.max_y_in_range=function(t,e){};e.prototype.image=function(e,n){e=e||this.width;n=n||this.height;const i=this.context;const r=this.zoombox.visible;const s=d3v7.select("body").append("canvas").attr("width",e).attr("height",n).node();t.scale_resolution(s,t.pixel_ratio);this.context=s.getContext("2d");const o=t.pixel(n-this.axis_x_gutter);this.scale.x.range(this.x_range(e));this.scale.y.range([o,0]);this.zoombox.visible=false;this.full_draw();image=s.toDataURL();this.scale.x.range(this.x_range());this.scale.y.range([this.scaled_height,0]);this.context=i;this.zoombox.visible=r;d3v7.select(s).remove();return image};e.prototype.initial_settings=function(){const e=this;this.settings=new t.SVSettings(this,{title:"JSV Settings",width:"250",height:"210",settings:[{label:"Grid lines [y-axis]",property:"axis_y_grid",type:"boolean"},{label:"Grid lines [x-axis]",property:"axis_x_grid",type:"boolean"},{label:"Show Zoombox",property:function(t){if(arguments.length==0)return e.zoombox.visible;e.zoombox.visible=t},type:"boolean"},{label:"Show Legend",property:"legend_show",type:"boolean"}]})};t.SpectraViewer=e})(JSpectraViewer);(function(t){const e=function(e,n){let i=this;this.container=d3v7.select(e);n=n||{};this.title=n.title;this.width=t.default_for(n.width,800);this.height=t.default_for(n.height,400);this.tick_count=t.default_for(n.tick_count,10);this.x_tick_count=t.default_for(n.x_tick_count,10);this.tick_length=t.default_for(n.tick_length,10);this.tick_precision=t.default_for(n.tick_precision,3);this.axis_x_tick_format=d3v7.format(t.default_for(n.axis_x_tick_format,"~g"));this.axis_y_tick_format=d3v7.format(t.default_for(n.axis_y_tick_format,"~g"));this.axis_x_title=t.default_for(n.axis_x_title,"ppm");this.axis_y_title=t.default_for(n.axis_y_title,"ppm");this.axis_y_show=t.default_for(n.axis_y_show,"ppm");this.axis_x_show=t.default_for(n.axis_x_show,true);this.axis_y_grid=t.default_for(n.axis_y_grid,false);this.axis_x_grid=t.default_for(n.axis_x_grid,false);this.axis_y_reverse=t.default_for(n.axis_y_reverse,false);this.axis_x_reverse=t.default_for(n.axis_x_reverse,true);this.axis_y_lock=t.default_for(n.axis_y_lock,false);this.min_boundaries=n.min_boundaries;this.zoom_max=t.default_for(n.zoom_max,25);this.zoom_min=t.default_for(n.zoom_min,.25);this.simplify_tolerance=n.simplify_tolerance;this.debug=t.default_for(n.debug,false);this.debug_data={time:{},data:{},drag:{},zoom:{},zbox:{}};const r=t.viewers().map(function(t){return t.id});this.id=t.default_for(n.id,t.unique_id("jsv-",1,r));this.axis_y_gutter=this.axis_y_show?t.default_for(n.axis_y_gutter,.14*this.width):0;this.axis_x_gutter=this.axis_x_show?t.default_for(n.axis_x_gutter,150):0;this.threshold=1;const s=this.title?"<h3>"+this.title+"</h3>":"";this.container.html(s).style("width",this.width+2+"px");this.sv_wrapper=this.container.append("div").attr("class","sv-wrapper").style("position","relative");this.container.append("div").attr("class","sv-key-down").style("display","none");this.canvas=this.sv_wrapper.append("canvas").attr("id",this.container.attr("id")).attr("class","spectra-viewer "+this["class"]).style("border","1px solid #DDD").attr("width",this.width).attr("height",this.height).node();if(!this.canvas.getContext){this.container.html("<h3>Spectra Viewer requires Canvas, which is not supported by this browser.</h3>");throw"Canvas not supported"}t.pixel_ratio=t.get_pixel_ratio(this.canvas);t.scale_resolution(this.canvas,t.pixel_ratio);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.context=this.canvas.getContext("2d");if(!this.context.setLineDash){this.context.setLineDash=function(){}}this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale=new t.SVScale;this.scale.y.range([0,this.scaled_height]);this.scale.x.range(this.x_range());this.boundary=new t.SVScale;this.boundary.x.range(this.x_range());this.boundary.y.range([this.scaled_height,0]);this.boundary.clamp(true);if(this.min_boundaries){this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries)}this._spectra=new t.SVSet;this.shift_plot();this.svg=this.sv_wrapper.append("svg").attr("width",this.width).attr("height",this.height).attr("class","svg-viewer").style("position","absolute").style("top",0).style("left",0);this.svg.style("cursor","crosshair");this.svg.append("text").attr("id","crosshairs_label").attr("x","0.35em").attr("y","1em");this.svg.append("line").attr("id","crosshair_x").style("stroke","blue").style("stroke-width",1);this.svg.append("line").attr("id","crosshair_y").style("stroke","blue").style("stroke-width",1);this.svg.on("mousemove",function(e){const n=d3v7.pointer(e,this);i.mx=i.scale.x.invert(t.pixel(n[0]));i.my=i.scale.y.invert(t.pixel(n[1]));i.annotation.check_hover();d3v7.select("#crosshair_x").attr("x1",0).attr("y1",n[1]).attr("x2",i.width).attr("y2",n[1]);d3v7.select("#crosshair_y").attr("x1",n[0]).attr("y1",0).attr("x2",n[0]).attr("y2",i.height);if(i.debug)d3v7.select("#crosshairs_label").text("x: "+i.mx+" y: "+i.my)});this.zoom_rect={r:null,origin:null,translated_origin:null};i.svg.call(d3v7.drag().on("start",this.drag_zoom().start).on("drag",this.drag_zoom().drag).on("end",this.drag_zoom().end));this.initialize_zooming();d3v7.select(window).on("keydown",i.keydown).on("keyup",i.keyup);this.svg.on("mouseover",function(){i.contains_mouse=true;document.activeElement.blur()});this.svg.on("mouseout",function(){i.contains_mouse=false});this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger;this.selection=new t.SVSelection(this,t.default_for(n.select,{}));this.annotation=new t.SVAnnotation(i);this.menu=new t.SVMenu(i);this.help=new t.SVHelp(i);this.cluster_navigation_id=n.cluster_navigation_id;if(n.structure){this.structure=new t.SVStructure(n.structure)}if(n.assignment_table){console.log("Assignment Table 2D set to",this.assignment_table);this.assignment_table=new t.SVAssignments2D(i,n.assignment_table)}t._viewers.push(this);this.draw()};e.prototype.toString=function(){return"SpectraViewer2D"};Object.defineProperties(e.prototype,{cluster_navigation_id:{get:function(){return this._cluster_navigation_id},set:function(e){console.log("Setting cluster_navigation_id",e);this._cluster_navigation_id=e;if(this._cluster_navigation_id){this._cluster_navigation=new t.SVClusterNavigator(this,e)}else{if(this._cluster_navigation){this._cluster_navigation.detach();this._cluster_navigation=undefined}}}},structure_viewer_id:{get:function(){return this._structure_viewer_id},set:function(e){this._structure_viewer_id=e;if(this._structure_viewer_id){this._structure_viewer=new t.SVStructure(this,e)}else{if(this._structure_viewer){this._structure_viewer.detach();this._structure_viewer=undefined}}}}});e.prototype.x_range=function(e){e=e||this.width;const n=t.pixel(e-this.axis_y_gutter);return this.axis_x_reverse?[n,0]:[t.pixel(this.axis_y_gutter),t.pixel(e)]};e.prototype.resize=function(e,n,i){this.shift_plot(true);this.width=e||this.width;this.height=n||this.height;this.container.style("width",this.width+"px");d3v7.select(this.canvas).attr("width",this.width).attr("height",this.height);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale.y.range([0,this.scaled_height]);this.boundary.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary.x.range(this.x_range());this.svg.attr("width",this.width).attr("height",this.height);t.scale_resolution(this.canvas,t.pixel_ratio);this.shift_plot();this.draw()};e.prototype.keyval=function(){return d3v7.select(".sv-key-down").html()};d3v7.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})};e.prototype.keydown=function(t){if(t[this.zoom_brush_key]){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","crosshair")}d3v7.selectAll(".sv-key-down").html(t.keyCode)};e.prototype.keyup=function(t){if(t.keyCode==16){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","all-scroll")}d3v7.selectAll(".sv-key-down").html("")};e.prototype.pixels_to_units_of_axis=function(e,n){const i=this;return i.scale[e].invert(t.pixel(n))-i.scale[e].invert(0)};e.prototype.set_zoom_axis=function(t){if(t){if(this.zoom_axis!="y"){this.zoom_axis="y";this.zoom_behavior.scale(this.zoom_y);this.set_zoom_cursor(t)}}else{if(this.zoom_axis!="x"){this.zoom_axis="x";this.zoom_behavior.scale(this.zoom_x);this.set_zoom_cursor(t)}}};e.prototype.set_zoom_cursor=function(t){if(t){this.svg.style("cursor","ns-resize")}else{this.svg.style("cursor","ew-resize")}};e.prototype.scale_axis=function(e,n){const i=Math.abs(this.boundary[e].domain()[0]-this.boundary[e].domain()[1])/n;const r=e==="x"?0:1;let s=this.scale[e].invert(this.mouse(this.canvas)[r]);let o=(s-this.scale[e].domain()[0])/Math.abs(this.scale[e].domain()[0]-this.scale[e].domain()[1]);if(e=="y"){o=0;s=this.scale.y.domain()[0]}const a=[s-i*o,s+i*(1-o)];this.scale[e].domain(a);this.set_domain(e,a);if(this.debug){e=e.toUpperCase();this.debug_data.zoom["d"+e]=t.round(i);this.debug_data.zoom["v"+e]=t.round(s);this.debug_data.zoom["r"+e]=t.round(o)}};e.prototype.mouse=function(e){return d3v7.mouse(e).map(function(e){return t.pixel(e)})};e.prototype.translate_axis=function(e,n){const i=this.scale[e].range().map(function(e){return e-t.pixel(n)}).map(this.scale[e].invert);this.set_domain(e,i)};e.prototype.shift_plot=function(t=false){if(t){this.context.translate(-this.x_range()[0]*.08,-this.scaled_height*.12)}
444else{this.context.translate(this.x_range()[0]*.08,this.scaled_height*.12)}};e.prototype.absolute_to_translated_context=function(t,e){let n=this.x_range()[0]*.08;let i=this.scaled_height*.12;let r=this.scale.x.range()[1];let s=this.scale.x.range()[0];let o=this.scale.y.range()[0];let a=this.scale.y.range()[1];t=t-n;e=e-i;t=Math.max(r,Math.min(s,t));e=Math.max(o,Math.min(a,e));return[this.scale.x.invert(t),this.scale.y.invert(e)]};e.prototype.move_to=function(t,e){const n=this;e=e||500;if(this.axis_y_lock!==false){t[1][0]=this.axis_y_lock_value(t[1])}let i=[];let r=[];i=i.concat.apply(i,t);r=r.concat.apply(r,[n.scale.x.domain(),n.scale.y.domain()]);d3v7.select(this.canvas).transition().duration(e).tween("move",function(){const t=d3v7.interpolateArray(r,i);return function(e){n.set_domain("x",[t(e)[0],t(e)[1]]);n.set_domain("y",[t(e)[2],t(e)[3]]);n.fast_draw()}}).on("end",function(){n.full_draw()});n.zoom_axis=""};e.prototype.set_domain=function(e,n){const i=this.scale;const r=this.boundary;const s=Math.abs(r[e].domain()[1]-r[e].domain()[0]);let o=Math.abs(n[1]-n[0]);if(e=="y"&&this["axis_y_lock"]!==false){n[0]=this.axis_y_lock_value(n);n[1]=n[0]+o}let a=s/o;if(a>this.zoom_max){a=this.zoom_max;const i=o;o=s/a;const r=(n[0]+n[1])/2;n[0]=r-o/2;n[1]=n[0]+o;if(this.debug){this.debug_data.zoom["center-"+e]=t.round(r);this.debug_data.zoom["domain-diff-"+e]=t.round(o)}}if(a<1){a=1;o=s/a;n[0]=r[e].min();n[1]=r[e].max()}if(this["zoom_"+e]!=a){this["zoom_"+e]=a;this.trigger("zoom")}if(n[0]<r[e].domain()[0]){n[0]=r[e].domain()[0];n[1]=n[0]+o}else if(n[1]>r[e].domain()[1]){n[1]=r[e].domain()[1];n[0]=n[1]-o}this.scale[e].domain(n);this.trigger("domain-change")};e.prototype.axis_y_lock_value=function(t){if(this.axis_y_lock===true){return this.boundary.y.domain()[0]}else{const e=Math.abs(t[1]-t[0]);return 0-e*this.axis_y_lock}};e.prototype.zoom_out_completely=function(){this.move_to([this.boundary.x.domain(),this.boundary.y.domain()]);this.scale.x.domain(this.boundary.x.domain());this.scale.y.domain(this.boundary.y.domain());this.zoom_x=1;this.zoom_y=1};e.prototype.add_spectrum_2d=function(e,n,i){let r=e.json_data.y.map(t=>e.json_data.y[0]-t);let s=Math.floor(Math.min(...e.json_data.x));let o=Math.ceil(Math.max(...e.json_data.x));let a=Math.floor(Math.min(...r));let l=Math.ceil(Math.max(...r));this.min_boundaries={x:[s,o],y:[a,l]};this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries);e.min_x=t.default_for(e.min_x,this.boundary.x.domain()[0]);e.max_x=t.default_for(e.max_x,this.boundary.x.domain()[1]);const c=this.all_spectra().map(function(t){return t.name});e.id=t.default_for(e.id,t.unique_id("Spectrum2D_",1,c));const u=e.toString()=="Spectrum2D"?e:new t.Spectrum2D(e,n,i);u._sv=this;this._spectra.push(u);this.boundary.update(u.xyz_data);this.scale.update(u.xyz_data);this.draw()};e.prototype.add_nmrml_data=function(e){let n=this;if(!window.X2JS){console.error("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const i={x:/<spectrumDataArray2dDirectDimensionF2.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dDirectDimensionF2>/,y:/<spectrumDataArray2dIndirectDimensionF1.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dIndirectDimensionF1>/,z:/<spectrumDataArray2dIntensities.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dIntensities>/};let r={};Object.entries(i).forEach(function([n,i]){const s=e.match(i);if(s){let e=s[1]==="true";let i=s[2];r[n]=Array.from(t.convert_base64_to_float64(i,e))}else{console.error(`${n} data array not found`)}});if(Object.keys(i).every(t=>t in r)){n.add_spectrum_2d({json_data:r});const t=e.match(/<atomAssignment[^]*<\/atomAssignment>/);let i;if(t){i=t[0]}else{console.log("Could not read nmrML (2). No <atomAssignment> tag found.");return}const s=i.match(/<structure[^]*<\/structure>/);if(n.structure&&s){const t=i.match(/<identifier.*name="(.*?)"/);if(t){n.structure.title=t[1]}n.structure.read_nmrml(s[0])}const o=new X2JS;const a=o.xml_str2json(i);const l={name:a.atomAssignment.chemicalCompound.identifierList.identifier._name};const c=[];let u=a.atomAssignment.atomAssignmentList.multiplet;if(u){u=Array.isArray(u)?u:[u];u.forEach(function(t,e){const n=[t._dir_dim_center,t._indir_dim_center];c.push({peaks:n,meta:{nmrml_cluster_index:e}})});l.clusters=c;if(n.structure&&u){const t=n.compounds(n.compounds().length).cluster
444s();u.forEach((e,i)=>{const r=t.find(t=>{return t.meta.nmrml_cluster_index===i});if(e.atoms&&r){let t=[];let i=[];const s=e.atoms._dir_dim_atomRefs;const o=e.atoms._indir_dim_atomRefs;if(s&&s.match(/\w/)&&o&&o.match(/\w/)){t=s.trim().split(/\s+/);i=o.trim().split(/\s+/)}t.forEach((e,n)=>{t[n]=e.replace(/\D/g,"")});i.forEach((t,e)=>{i[e]=t.replace(/\D/g,"")});r.dir_dim_atom_refs=t;r.indir_dim_atom_refs=o;const a=t.concat(i.filter(e=>t.indexOf(e)<0));r._atoms.merge(n.structure.atoms(a));switch(e.multiplicity._name.toLowerCase()){case"singlet feature":r.multiplet_type="s";break;case"doublet feature":r.multiplet_type="d";break;case"triplet feature":r.multiplet_type="t";break;case"quartet feature":r.multiplet_type="q";break;case"doublet of doublets feature":r.multiplet_type="dd";break;case"doublet of doublet of doublets feature":r.multiplet_type="ddd";break;case"doublet of doublet of doublets of doublets feature":r.multiplet_type="dddd";break;case"triplet of doublets feature":r.multiplet_type="td";break;case"doublet of triplets feature":r.multiplet_type="dt";break;case"triplet of triplets feature":r.multiplet_type="tt";break;case"doublet of quartets feature":r.multiplet_type="dq";break;case"doublet of doublet of triplets feature":r.multiplet_type="ddt";break;case"doublet of triplet of doublets feature":r.multiplet_type="dtd";break;case"triplet of doublets of doublets feature":r.multiplet_type="tdd";break;case"quintet feature":r.multiplet_type="quint";break;case"multiplet feature":r.multiplet_type="m";break}if(!r.hasOwnProperty("multiplet_type")){switch(e.multiplicity._accession){case"NMR:1000194":r.multiplet_type="s";break;case"NMR:1000184":r.multiplet_type="d";break;case"NMR:1000185":r.multiplet_type="t";break;case"NMR:1000186":r.multiplet_type="q";break;case"NMR:1000192":r.multiplet_type="dd";break;case"NMR:1000195":r.multiplet_type="qunit";break;case"NMR:1000196":r.multiplet_type="dt";break;case"NMR:1000197":r.multiplet_type="td";break;case"NMR:1400305":r.multiplet_type="m";break}}}})}}n.trigger("adjust-end")}else{console.error("Could not read in Spectrum Data")}};e.prototype.remove_spectra=function(e){this._spectra=new t.SVSet(this._spectra.filter(function(t){return t.id!=e}))};e.prototype.remove_all_spectra=function(){const t=this;t.selection.clear();this.all_spectra().forEach(function(e){t.remove_spectra(e.id)});t.reset_boundaries()};e.prototype.reset_boundaries=function(){const t=this;t.selection.clear();t.boundary.initialized=false;t.scale.initialized=false;if(t.min_boundaries){t.boundary.update(t.min_boundaries);t.scale.update(t.min_boundaries)}else{t.boundary.update({x:[0,1],y:[0,1]});t.scale.update({x:[0,1],y:[0,1]})}};e.prototype.spectra=function(e){if(e)return this._spectra.get(e);const n=new t.SVSet(this._spectra.filter(function(t){return t.active}));return n.get(e)};e.prototype.all_spectra=function(t){return this._spectra.get(t)};e.prototype.compounds=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].compounds())}return n.get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){console.log("Merging Clusters",this._spectra[i],typeof this._spectra[i]);console.log("Prototype",Object.getPrototypeOf(this._spectra[i]));n.merge(this._spectra[i].clusters())}return n.get(e)};e.prototype.clear=function(e=false){if(e){this.context.clearRect(0,-1,t.pixel(this.width),t.pixel(this.height)+1);this.context.clearRect(-this.x_range()[0]*.08,t.pixel(this.height)-t.pixel(this.axis_x_gutter),t.pixel(this.width),t.pixel(this.height))}else{this.shift_plot(true);this.context.clearRect(0,0,t.pixel(this.width),t.pixel(this.height));this.shift_plot()}};e.prototype.draw=function(e,n,i){const r=(new Date).getTime();const s=this;e=e||false;const o=this.context;const a=this.scale;this.clear(e);if(this.axis_y_grid)this.draw_grid_lines("y");if(this.axis_x_grid)this.draw_grid_lines("x");this.spectra().forEach(function(t){t.draw(o,a,e,s.scaled_height,s.x_range(),s.threshold)});this.draw_axes();if(this.debug){this.debug_data.time["draw"]=t.elapsed_time(r)}}
445;e.prototype.full_draw=function(){const t=this.scale.x.domain()[1]-this.scale.x.domain()[0];const e=this.points_per_ppm*t;const n=Math.abs(this.scale.x.range()[1]-this.scale.x.range()[0]);n/e>3?this.draw(false,true,1):this.draw(false,false)};e.prototype.calc_draw=function(){this.draw(false,true,1)};e.prototype.fast_calc_draw=function(){this.draw(false,true,2)};e.prototype.fast_draw=function(){this.draw(true)};e.prototype.flash=function(e){this.context.font=this.adjust_font(1.5);this.context.textAlign="center";this.context.textBaseline="center";const n=t.pixel(this.width)/2;const i=t.pixel(this.height)/2;this.context.fillText(e,n,i)};e.prototype.draw_debug=function(e){if(!this.debug)return;const n=this.context;const i=this.debug_data;n.font=this.adjust_font(1,"monospace");n.fillStyle="black";const r=t.pixel(18);e=e||0;let s;if(this.axis_x_reverse){s=t.pixel(10);n.textAlign="left"}else{s=t.pixel(this.width-10);n.textAlign="right"}const o=this.debug===true?Object.keys(i):this.debug;let a=0;o.forEach(function(t){const o=Object.keys(i[t]);o.forEach(function(o){n.fillText(t+"|"+o+": "+i[t][o],s,e+r*a);a+=1})})};e.prototype.adjust_font=function(e,n,i){e=e||1;n=n||"Sans-Serif";i=i||"";const r=9/1400*e;const s=r*t.pixel(this.width)+t.pixel(5);return i+" "+s+"pt "+n};e.prototype.draw_axes=function(){const e=this.scale;this.context.strokeStyle="black";this.context.lineWidth=1;this.context.setLineDash([1,0]);const n=t.pixel(this.axis_y_gutter);const i=t.pixel(this.axis_x_gutter);this.context.clearRect(e.x.range_min(),e.y.range_max(),e.x.range_max()+n,i);const r=this.axis_x_reverse?e.x.range_max():0;this.context.clearRect(r,e.y.range_min(),n,e.y.range_max()+i);this.context.fillStyle="black";if(this.axis_y_show)this.draw_y_axis();if(this.axis_x_show)this.draw_x_axis()};e.prototype.draw_x_axis=function(){const e=this;const n=t.pixel(this.tick_length);const i=this.context;const r=this.scale;i.beginPath();i.moveTo(r.x.range()[1],r.y.range()[1]);i.lineTo(r.x.range()[0],r.y.range()[1]);i.stroke();i.textAlign="center";i.textBaseline="top";i.font=this.font;r.x.ticks(this.x_tick_count).forEach(function(t){i.beginPath();i.moveTo(r.x(t),r.y.range()[1]);i.lineTo(r.x(t),r.y.range()[1]+n);i.stroke();let s=+t.toFixed(e.tick_precision);i.fillText(e.axis_x_tick_format(s),r.x(t),r.y.range()[1]+n)});if(this.axis_x_title){i.font=this.axis_title_font;const t=r.x.range_diff()/2;const e=r.y.range()[1]+3*n;i.fillText(this.axis_x_title,t,e)}};e.prototype.draw_y_axis=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=this.axis_x_reverse?1:-1;const o=s*t.pixel(this.tick_length);const a=i.x.range()[0]+s*t.pixel(this.tick_length+r);n.beginPath();n.moveTo(i.x.range()[0],i.y.range()[1]);n.lineTo(i.x.range()[0],i.y.range()[0]);n.stroke();
445n.textAlign=this.axis_x_reverse?"left":"right";n.textBaseline="middle";n.font=this.font;let l=0;let c=i.y.ticks(this.tick_count);c.forEach(function(t){n.beginPath();n.moveTo(i.x.range()[0],i.y(t));n.lineTo(i.x.range()[0]+o,i.y(t));n.stroke();n.fillText(e.axis_y_tick_format(t),a,i.y(t));if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>l)l=e}});if(this.axis_y_title){const e=t.pixel(4);const a=t.pixel(this.axis_y_gutter);const c=/(\d+\.?\d*)pt/.exec(this.axis_title_font)[1];const u=l+Math.abs(o)+Number(c)+e+r;if(u<a){n.save();n.textAlign="center";n.textBaseline="middle";n.font=this.axis_title_font;const t=i.x.range()[0]+7*o*s;const e=i.y.range()[1]/2;n.translate(t,e);n.rotate(s*Math.PI/2);n.translate(-t,-e);n.fillText(this.axis_y_title,t,e);n.restore()}}};e.prototype.draw_grid_lines=function(e){const n=this;const i=this.context;const r=i;const s=this.scale;s[e].ticks(this.tick_count).forEach(function(n){i.beginPath();if(e=="y"){i.moveTo(s.x.range()[0],s.y(n));i.lineTo(s.x.range()[1],s.y(n))}else if(e=="x"){i.moveTo(s.x(n),s.y.range()[0]);i.lineTo(s.x(n),s.y.range()[1])}i.strokeStyle="rgb(210,210,210)";i.lineWidth=t.pixel(.5);i.stroke()});this.context=r};e.prototype.elements=function(e,n,i,r){const s=this;let o=i;if(!i){n=t.default_for(n,s);if(typeof n=="string"){n=s.spectra(n)}if(!n){o=new t.SVSet}else if(e=="peak"){o=n.peaks()}
445else if(e=="cluster"){o=n.clusters()}else if(e=="compound"){o=n.compounds()}else if(e=="spectrum"){o=n.spectra()}else{o=new t.SVSet}}if(r){o=new t.SVSet(o.filter(function(t){return t.visible}))}return o};e.prototype.image=function(e,n){e=e||this.width;n=n||this.height;const i=this.context;const r=d3v7.select("body").append("canvas").attr("width",e).attr("height",n).node();t.scale_resolution(r,t.pixel_ratio);this.context=r.getContext("2d");const s=t.pixel(n-this.axis_x_gutter);this.scale.x.range(this.x_range(e));this.scale.y.range([s,0]);this.full_draw();image=r.toDataURL();this.scale.x.range(this.x_range());this.scale.y.range([this.scaled_height,0]);this.context=i;d3v7.select(r).remove();return image};t.SpectraViewer2D=e})(JSpectraViewer);(function(t){t.SpectraViewer.prototype.initialize_dragging=function(){const e=this;e.drag_event=false;e.drag_behavior=d3v7.drag().on("start",n).on("drag",i).on("end",r);e.svg.call(e.drag_behavior);function n(t){e.drag_event=true;t.sourceEvent.preventDefault();e.svg.style("cursor","all-scroll");e.trigger("drag-start")}function i(n){const i=(new Date).getTime();e.translate_axis("x",n.dx);e.translate_axis("y",n.dy);e.trigger("drag");e.fast_draw();if(e.debug){console.log("dragging");e.debug_data.time["drag"]=t.elapsed_time(i);e.debug_data.drag["dX"]=t.round(n.dx);e.debug_data.drag["dY"]=t.round(n.dy);e.debug_data.drag["zX"]=t.round(e.zoom_x);e.debug_data.drag["zY"]=t.round(e.zoom_y)}}function r(){e.drag_event=false;e.trigger("drag-end");e.full_draw()}};t.SpectraViewer.prototype.initialize_zooming=function(){const e=this;e.zoom_behavior=d3v7.zoom().scaleExtent([1,e.zoom_max]).on("start",n).on("zoom",i).on("end",r);e.svg.call(e.zoom_behavior).on("mousedown.zoom",null).on("dblclick.zoom",null);e.zoom_x=1;e.zoom_y=1;e.zoom_axis="x";e.zoom_y_key="altKey";function n(t){if(e.drag_event)return;const n=t.sourceEvent[e.zoom_y_key];e.set_zoom_axis(n,t);e.set_zoom_cursor(n);e.trigger("zoom-start")}function i(n){if(e.drag_event)return;const i=(new Date).getTime();e.set_zoom_axis(n.sourceEvent[e.zoom_y_key],n);e.scale_axis(e.zoom_axis,n.transform.k,n);e.fast_draw();if(e.debug){console.log("zooming");e.debug_data.time["zoom"]=t.elapsed_time(i);e.debug_data.zoom["zX"]=t.round(e.zoom_x);e.debug_data.zoom["zY"]=t.round(e.zoom_y)}}function r(){if(e.drag_event)return;e.svg.style("cursor","all-scroll");e.trigger("zoom-end");e.full_draw()}};t.SpectraViewer.prototype.initialize_drag_drop_load=function(){const t=this;this.svg.on("dragleave.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw()});this.svg.on("dragover.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw();t.flash("Drop Bayesil JSON File...")});this.svg.on("drop.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw();const n=e.dataTransfer.files[0];t.flash('Loading "'+n.name+'"...');const i=new FileReader;t.json_file=n;i.onload=function(){const e=i.result;try{const i=JSON.parse(e);t.replace_bayesil_data(i,true);t.trigger("drop")}catch(n){t.draw();t.flash("Could not read file: "+n.message)}};i.readAsText(n)})}})(JSpectraViewer);(function(t){t.SpectraViewer2D.prototype.initialize_zooming=function(){const t=this;t.zoom_behavior=d3v7.zoom().scaleExtent([t.zoom_min,t.zoom_max]).on("zoom",e);t.svg.call(t.zoom_behavior).on("dblclick.zoom",null);function e(e){if(t.drag_event)return;t.threshold=e.transform.k;t.fast_draw()}};t.SpectraViewer2D.prototype.drag_zoom=function(){const e=this;const n=e.svg;const i=i=>{e.zoom_rect.origin=[i.x,i.y];e.zoom_rect.translated_origin=e.absolute_to_translated_context(t.pixel(e.zoom_rect.origin[0]),t.pixel(e.zoom_rect.origin[1]));e.zoom_rect.r=n.append("rect").attr("id","zoom-rect").attr("style","fill:blue;fill-opacity:0.1;").attr("x",e.zoom_rect.origin[0]).attr("y",e.zoom_rect.origin[1]).attr("width",1).attr("height",1)};const r=t=>{e.zoom_rect.r.attr("x",Math.min(e.zoom_rect.origin[0],t.x)).attr("y",Math.min(e.zoom_rect.origin[1],t.y)).attr("width",Math.abs(t.x-e.zoom_rect.origin[0])).attr("height",Math.abs(t.y-e.zoom_rect.origin[1]))};const s=n=>{const i=(t,e)=>{return t-e};const r=e.absolute_to_translated_context(t.pixel(n.x),t.pixel(n.y));if(n.x!==e.zoom_rect.origin[0]&&n.y!==e.zoom_rect.origin[1]){e.move_to([[e.zoom_rect.translated_origin[0],r[0]].sort(i),[e.zoom_rect.translated_origin[1],r[1]].sort(i)],500)}e.zoom_rect.r.remove()};return{start:i,drag:r,end:s}}})(JSpectraViewer);(function(t){const e=function(){const t=d3v7.scaleLinear();t.min=function(e){if(!arguments.length)return t.domain()[0];if(e>t.max()){throw new Error("x must be less than domain max: "+t.max())}t.domain([e,t.max()]);return t};t.max=function(e){if(!arguments.length)return t.domain()[1];if(e<t.min()){throw new Error("x must be greater than domain min: "+t.min())}t.domain([t.min(),e]);return t};t.diff=function(){return Math.abs(t.max()-t.min())};t.range_diff=function(){return Math.abs(t.range()[1]-t.range()[0])};t.range_min=function(){return d3v7.min(t.range())};t.range_max=function(){return d3v7.max(t.range())};return t};const n=function(){this.x=t.LinearScale();this.y=t.LinearScale();this.initialized=false};n.prototype.clamp=function(t){this.x.clamp(t);this.y.clamp(t)};n.prototype.update=function(t){const e=this.initialized?this.x.max():null;const n=this.initialized?this.y.max():null;let i=Number.NEGATIVE_INFINITY;let r=Number.POSITIVE_INFINITY;let s=Number.NEGATIVE_INFINITY;let o=Number.POSITIVE_INFINITY;t.x.concat(e).forEach(t=>{if(t>i)i=t});t.x.forEach(t=>{if(t<r)r=t});t.y.concat(e).forEach(t=>{if(t>s)s=t});
445t.y.forEach(t=>{if(t<o)o=t});this.x.domain([r,i]);this.y.domain([o,s]);this.initialized=true};t.LinearScale=e;t.SVScale=n})(JSpectraViewer);(function(t){const e=function(){const t={};this.on=function(r,s){e(r);const o=i(r);if(!t[o])t[o]=[];t[o].push(new n(r,s))};this.off=function(n,s){e(n);const o=i(n);const a=r(n);if(arguments.length==1){if(a){if(o){t[o]=t[o].filter(function(t){return t.namespace!=a})}else{Object.keys(t).forEach(function(e){t[e]=t[e].filter(function(t){return t.namespace!=a})})}}else{t[o]=undefined}}else{t[o]=t[o].filter(function(t){return t.callback!=s})}};this.trigger=function(n,s){e(n);const o=i(n);const a=r(n);if(Array.isArray(t[o])){t[o].forEach(function(t){if(a){if(t.namespace==a)t.callback.call(null,s)}else{t.callback.call(null,s)}})}};var e=function(t){if(typeof t!="string"){throw new Error("Type must be a string")}}};const n=function(t,e){this.callback=e;this.event_type=i(t);this.namespace=r(t)};const i=function(t){return t.replace(/\..*/,"")};const r=function(t){const e=t.match(/\.(.*)/);return e?e[1]:undefined};t.SVEvents=e})(JSpectraViewer);(function(t){const e=function(){if(arguments.length==1&&Array.isArray(arguments[0])){this.push.apply(this,arguments[0])}else if(arguments.length>0){this.push.apply(this,arguments)}};e.prototype=Object.create(Array.prototype);e.prototype.toString=function(){return"SVSet"};e.prototype.merge=function(t){this.push.apply(this,t);return this};e.prototype.attr=function(t){if(arguments.length==1&&typeof t=="object"){const e=Object.keys(t);const n=e.length;let i=0;const r=this.length;for(;i<r;i++){for(let r=0;r<n;r++){this[i][e[r]]=t[e[r]]}}}else if(arguments.length==2){let t=0;const e=this.length;for(;t<e;t++){this[t][arguments[0]]=arguments[1]}}else if(t!=undefined){throw new Error("attr(): must be 2 arguments or a single object")}return this};e.prototype.draw=function(t,e,n,i,r,s=null){let o=0;const a=this.length;for(;o<a;o++){if(s)this[o].draw(t,e,n,i,r);else this[o].draw(t,e,n,i,r,s)}return this};e.prototype.each=function(t){let e=0;const n=this.length;for(;e<n;e++){t.call(this[e],e,this)}return this};e.prototype.contains=function(t){return this.indexOf(t)>=0};e.prototype.remove=function(t){let n=this;n=new e(n.filter(function(e){return e!=t}));return n};e.prototype.empty=function(){return this.length==0};e.prototype.present=function(){return this.length>0};e.prototype.order_by=function(t,e){if(this.length>0){if(typeof this[0][t]==="function"){this.sort(function(e,n){if(e[t]()>n[t]()){return 1}else if(e[t]()<n[t]()){return-1}else{return 0}})}else{this.sort(function(e,n){if(e[t]>n[t]){return 1}else if(e[t]<n[t]){return-1}else{return 0}})}}if(e)this.reverse();return this};e.prototype.lineWidth=function(t){let e=0;const n=this.length;for(;e<n;e++){this[e].lineWidth=t}return this};e.prototype.get=function(t){if(t==undefined){return this}else if(Number.isInteger(t)){return this[t-1]}else if(typeof t=="string"){if(t.match(/^path-id-/)){return this.filter(function(e){return e.path_id()==t})[0]}else if(t.match(/^label-id-/)){return this.filter(function(e){return e.label_id()==t})[0]}else{return this.filter(function(e){return e.id==t})[0]}}else if(Array.isArray(t)){const n=this.filter(function(e){return t.some(function(t){return e.id==t})});const i=new e;i.push.apply(i,n);return i}else{return new e}};e.prototype.equals=function(t){if(t.toString()!="SVSet"&&!Array.isArray(t)){return false}const e=this.unique();const n=t.unique();let i=true;if(e.length!=n.length){return false}e.forEach(function(t){if(!n.contains(t)){i=false;return}});return i};e.prototype.unique=function(){return new e(this.filter(n))};function n(t,e,n){return n.indexOf(t)===e}e.prototype.find=function(t){if(typeof t!=="function"){throw new TypeError("predicate must be a function")}const e=Object(this);const n=e.length>>>0;const i=arguments[1];let r;for(let s=0;s<n;s++){r=e[s];if(t.call(i,r,s,e)){return r}}return undefined};t.SVSet=e})(JSpectraViewer);(function(t){const e=function(t){if(t===undefined){t={x:[],y:[]}}if(t instanceof Array){t=n(t)}if(t.x.length!=t.y.length){throw new Error("x and y must be the same length!")}if(t.yi&&t.yi.length!=t.x.length){throw new Error("If present yi must be the same length as x and y!")}const e=t.x[0]>t.x[t.x.length-1];this.x=e?t.x.reverse():t.x;this.y=e?t.y.reverse():t.y;this.yi=t.yi&&e?t.yi.reverse():t.yi};e.prototype.length=function(){return this.x.length};e.prototype.asArray=function(){const t=[];let e;let n=0;const i=this.length();for(;n<i;n++){e={x:this.x[n],y:this.y[n]};if(this.yi){e.yi=this.yi[n]}t.push(e)}return t};e.prototype.index_of=function(e,n){return t.index_of_value(this.x,e,n)};e.prototype.simplify=function(n,i){return new e(t.simplify(this,n,i))};const n=function(t){const e=[],n=[],i=[];let r=0;const s=t.length;for(;r<s;r++){e.push(t[r].x);n.push(t[r].y);if(t[0].yi){i.push(t[r].yi)}}const o={x:e,y:n};if(t[0]&&t[0].yi){o.yi=i}return o};t.SVData=e})(JSpectraViewer);(function(t){const e=function(t){if(t===undefined){t={x:[],y:[],z:[]}}if(t instanceof Array){t=n(t)}if(t.z.length!=t.x.length*t.y.length){throw new Error("z length must be divisible by x and y length!")}this.x=t.x;this.y=t.y;this.z=t.z};e.prototype.length=function(){return this.x.length};e.prototype.asArray=function(){let t=[];let e;for(let n=0,i=this.length();n<i;n++){e={x:this.x[n],y:this.y[n],z:this.z[n]};t.push(e)}return t};let n=function(t){let e=[],n=[],i=[];let r=0;const s=t.length;for(;r<s;r++){e.push(t[r].x);n.push(t[r].y);i.push(t[r].z)}let o={x:e,y:n,z:i};return o};t.SVData2D=e})(JSpectraViewer);(function(t){path_id=0;const e=function(e,n){e=e||{};this.meta=n||{};this.lineWidth=t.default_for(e.lineWidth,1);this.color=t.default_for(e.color,"black");this.visible=t.default_for(e.visible,true);this.dash=t.default_for(e.dash,[]);this.fill=e.fill;this.path_id()};e.prototype.peaks=function(){return new t.SVSet};e.prototype.path_id=function(){const t=n();this.path_id=function(){return t};return t};const n=function(){return"path-id-"+path_id++};e.prototype.attr=function(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){this[e[n]]=t[e[n]]}return this};e.prototype.display_settings=function(t){if(t){return this.attr(t)}else{return{color:this.color,fill:this.fill,lineWidth:this.lineWidth,visible:this.visible,dash:this.dash}}};e.prototype.data_for_draw=function(e,n,i,r){let s;const o=this.xy_data!=undefined;if(this.phasing&&o&&this.xy_data.yi!=undefined){let t;const e=[];const n=this.xy_data.length();for(let i=0;i<n;i++){t=Math.PI*(1*this.ph0+1*(n-i-1)*this.ph1/n)/180;e.push(Math.cos(t)*this.xy_data.y[i]+Math.sin(t)*this.xy_data.yi[i])}s={x:this.xy_data.x,y:e}}else if(i&&this.peaks().length>0||!o&&this.peaks().length>0){if(!r)r=1;const n=e.x.range_diff()/t.pixel_ratio/r;const i=r>1;s=t.xy_from_peaks(this.peaks(),n,e.x.domain()[0],e.x.domain()[1],i)}else if(o){s=n?this.simple_xy_data:this.xy_data}else{s={x:[0],y:[0]};console.error("No data or Peaks for SVPath:")}return s};e.prototype.draw=function(e,n,i,r,s){if(this.visible){const o=this.data_for_draw(n,i,r,s);const a=10;const l=t.index_of_value(o.x,n.x.domain()[0],false);const c=t.index_of_value(o.x,n.x.domain()[1],true);e.translate(.5,.5);e.beginPath();const u=this.fill?n.y(0)-a:n.y(o.y[l])-a;e.moveTo(n.x(o.x[l]),u);for(let t=l;t<=c;t++){e.lineTo(n.x(o.x[t]),n.y(o.y[t])-a)}if(this.fill){e.lineTo(n.x(o.x[c]),n.y(0)-a);e.fillStyle=this.fill;e.fill()}e.lineWidth=t.default_for(this.lineWidth,1);e.strokeStyle=this.color;e.setLineDash(this.dash);e.stroke();e.translate(-.5,-.5)}};t.SVPath=e})(JSpectraViewer);(function(t){plot_id=0;const e=function(e,n){e=e||{};this.meta=n||{};this.dotSize=t.default_for(e.dotSize,1);this.color=t.default_for(e.color,"black");this.visible=t.default_for(e.visible,true);this.plot_id()};e.prototype.plot_id=function(){let t=n();this.path_id=function(){return t};return t};const n=function(){return"plot-id-"+plot_id++};e.prototype.attr=function(t){const e=Object.keys(t);let n=0;const i=e.length;for(;n<i;n++){this[e[n]]=t[e[n]]}return this};e.prototype.display_settings=function(t){if(t){return this.attr(t)}else{return{color:this.color,fill:this.fill,lineWidth:this.lineWidth,visible:this.visible,dash:this.dash}}};e.prototype.sum=function(t){return t.reduce((t,e)=>t+e)};e.prototype.mean=function(t){return this.sum(t)/t.length};e.prototype.stddev=function(t){const e=this.mean(t);const n=function(t,n){return t+(n-e)*(n-e)};return Math.sqrt(t.reduce(n,0)/t.length)};e.prototype.find_peaks=function(t,e){const n=Array(t.length).fill(0);let i=this.stddev(t);let r=this.mean(t);for(let s=0;s<t.length;s++){if(t[s]>r+i*e){n[s]=1}else if(t[s]<r-i*e){n[s]=-1}}return n};e.prototype.data_for_draw=function(){let t;const e=this.xyz_data!=undefined;if(e){return{x:this.xyz_data.x,y:this.xyz_data.y,z:this.xyz_data.z}}else{t={x:[0],y:[0],z:[0]};console.log("No data or Peaks for SVPath:");console.log(this);return t}};e.prototype.draw=function(e,n,i,r,s,o){let a=t=>{t.forEach(t=>{if(t.coordinates.length==0)return;
445t.coordinates.forEach(t=>{e.beginPath();t.forEach(t=>{t.forEach(t=>{const i=n.x.range();const r=n.y.range();let s=n.x(this.original_scale.x.invert(t[0]));let o=n.y(this.original_scale.y.invert(t[1]));if(s<i[1]){s=i[1]}else if(s>i[0]){s=i[0]}if(o<r[0]){o=r[0]}else if(o>r[1]){o=r[1]}e.lineTo(s,o)})});e.stroke()})})};if(this.visible){let l=this;let c=this.data_for_draw();if(!this.original_scale){this.original_scale=new t.SVScale;this.original_scale.x.domain(n.x.domain());this.original_scale.y.domain(n.y.domain());this.original_scale.x.range(n.x.range());this.original_scale.y.range(n.y.range())}if(!this.old_threshold||this.old_threshold!=o){this.old_threshold=o;const t=l.find_peaks(c.z,o);let e=[];let i=[];for(let r=0;r<c.y.length;r++){for(let s=0;s<c.x.length;s++){if(t[c.x.length*r+s]===-1){i.push([n.x(c.x[s]),n.y(c.y[r])])}else if(t[c.x.length*r+s]===1){e.push([this.original_scale.x(c.x[s]),this.original_scale.y(c.y[r])])}}}this.posContours=d3v7.contourDensity().size([c.x.length*3,c.y.length*3]).bandwidth(10)(e);this.negContours=d3v7.contourDensity().size([c.x.length*3,c.y.length*3]).bandwidth(10)(i)}e.strokeStyle="blue";a(this.posContours);e.strokeStyle="red";a(this.negContours);if(!i){let t={};let i={};for(let e=0;e<c.y.length;e++){let n=c.y[e];for(let r=0;r<c.x.length;r++){let s=c.x[r];let o=c.z[c.x.length*e+r];if(t[s]===undefined){t[s]=0}if(i[n]===undefined){i[n]=0}t[s]+=o;i[n]+=o}}let o=Object.values(i);let a=Object.values(t);let l=Math.max(...a);let u=Math.min(...a);let h=Math.max(...o);let f=Math.min(...o);const d=l-u;const p=h-f;Object.keys(t).map(function(e,n){t[e]=(t[e]-u)/d});Object.keys(i).map(function(t,e){i[t]=(i[t]-f)/p});let m=d3v7.scaleLinear().domain([u,l]).range([0,-(r*.12)+10]);let g=d3v7.scaleLinear().domain([f,h]).range([0,-(s[0]*.08)+10]);e.lineWidth=1;e.strokeStyle="blue";e.beginPath();for(let t=0;t<=c.x.length;t++){const i=n.x(c.x[t]);const r=n.x.range();if(i>=r[1]&&i<=r[0]){e.lineTo(i,m(a[t]))}}e.stroke();e.beginPath();for(let t=0;t<=c.y.length;t++){const i=n.y(c.y[t]);const r=n.y.range();if(i>=r[0]&&i<=r[1]){e.lineTo(g(o[t]),n.y(c.y[t]))}}e.stroke()}}};t.SVDot=e})(JSpectraViewer);(function(t){function e(t,e,n,i){this.x=t;this.y=e;this.width=n;this.height=i}e.prototype.contains_pt=function(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height};function n(e){const n=this;this.sv=e;this.max_label_length=0;this.margin_top=t.pixel(5);this.margin_side=t.pixel(10);this.key_label_space=t.pixel(5);this.key_width=t.pixel(10);this.line_width=t.pixel(3);this.text_height=t.pixel(18);this.items=[];e.svg.on("click.legend",function(t){let i=e.mouse(t,e.canvas);for(let t=0,r=n.items.length;t<r;t++){let r=n.items[t];if(r.rect.contains_pt(i[0],i[1])&&e.legend_show){r.path.visible=!r.path.visible;e.full_draw()}}})}n.prototype.bottom=function(){const e=(this.sv.zoombox.visible?t.pixel(this.sv.zoombox.height):0)+this.margin_top;return this.sv.legend_show?this.offset_y:e};n.prototype.update=function(){const n=this.sv;const i=n.context;this.offset_y=(n.zoombox.visible?t.pixel(n.zoombox.height):0)+this.margin_top;const r=this.margin_side;i.font=n.adjust_font(1,"monospace");this.items=[];for(let s=0;s<n.spectra().length;s++){const o=n.spectra()[s];const a=new t.SVLegendItem(this);const l=new e;l.y=this.offset_y;l.height=this.text_height;l.width=this.key_width+this.key_label_space+i.measureText(o.name).width;l.x=n.axis_x_reverse?r:t.pixel(n.width)-r-l.width;a.rect=l;a.path=o;this.offset_y+=this.text_height;this.items.push(a);this.max_label_length=Math.max(a.path.name.length,this.max_label_length)}};n.prototype.draw=function(){const t=this.sv;const e=t.context;e.save();e.textAlign="left";e.textBaseline="middle";e.font=t.adjust_font(1,"monospace");for(let t=0;t<this.items.length;t++){this.items[t].draw(this.max_label_length)}e.restore()};function i(t,e,n){this.legend=t;this.sv=t.sv;this.path=e;this.rect=n}i.prototype.key_x1=function(){return this.sv.axis_x_reverse?this.rect.x:this.rect.x+this.rect.width-this.legend.key_width};i.prototype.key_x2=function(){return this.key_x1()+this.legend.key_width};i.prototype.key_y=function(){return this.rect.y+this.rect.height/2};i.prototype.label_x=function(){return this.sv.axis_x_reverse?this.rect.x+this.legend.key_width+this.legend.key_label_space:this.rect.x};i.prototype.draw=function(t){let e=this.rect;this.sv.context.clearRect(e.x,e.y,e.width,e.height);if(this.path.visible)this.draw_key();this.draw_label(t)};i.prototype.draw_key=function(){let t=this.sv.context;t.beginPath();t.moveTo(this.key_x1(),this.key_y());t.lineTo(this.key_x2(),this.key_y());t.lineWidth=this.legend.line_width;t.strokeStyle=this.path.color;t.setLineDash(this.path.dash);t.stroke()};i.prototype.draw_label=function(t){this.sv.context.fillStyle=this.path.visible?"black":"#999";let e=this.path.visible?"\u2612":"\u2610";let n=`${this.path.name.padEnd(t)} ${e}`;this.sv.context.fillText(n,this.label_x(),this.key_y())};t.SVLegend=n;t.SVLegendItem=i})(JSpectraViewer);(function(t){function e(e,n={}){const i=this;this.sv=e;this.highlighted_label;this.point_gap=t.default_for(n.point_gap,t.pixel(12));this.label_color=t.default_for(n.label_color,"#5555DD");this.visible=t.default_for(n.visible,true);this.hover=t.default_for(n.hover,true);this.labels=new t.SVSet;this.visible_labels=new t.SVSet;e.svg.on("mousedown.label",function(){if(i.highlighted_label&&i.hover){e.trigger("label-click",i.highlighted_label)}})}e.prototype.get=function(t){return this.labels.get(t)};e.prototype.update=function(){const e=this.sv;const n=e.labels?e.labels.get():new t.SVSet;
445e.spectra().forEach(function(t){if(t.visible&&t.active&&t.labels){n.push.apply(n,t.labels.get())}});this.labels=n;let i=this.reduce_labels_by_view();i=this.reduce_labels_by_height(i);i=this.adjust_labels(i);this.visible_labels=i};e.prototype.rect_for_label=function(e){const n=this.sv;let i,r,o;const a=n.scale.x(e.x);const l=n.scale.y(e.y);const c=n.context.measureText(e.text).width;const u=t.pixel(e.font_size);if(e.vertical){r=a-u/2;o=l-c-this.point_gap;i=new s(r,o,u,c)}else{r=a-c/2;o=l-u-this.point_gap;i=new s(r,o,u,c)}return i};e.prototype.reduce_labels_by_view=function(t){if(!t)t=this.labels;const e=this.sv.scale;return t.filter(function(t){return t.x>e.x.min()&&t.x<e.x.max()&&t.y<e.y.max()})};e.prototype.reduce_labels_by_height=function(e){if(!e)e=this.labels;const n=this.sv.scale;const i=6;const r=new t.SVSet;let s=0;const o=e.length;for(;s<o;s++){label=e[s];label.font_size=i;label.rect=this.rect_for_label(label);label.adjust_rect(r);if(label.stack_level<3){r.push(label)}}return r};e.prototype.adjust_labels=function(e){const n=this.sv;let i,r,s,o;const a=1;const l=t.pixel(2);const c=t.pixel(12);const u=13;const h=8;const f=u-h;let d=u;let p=h;const m=n.scale;const g=n.context;g.save();let _=true;while(_){_=false;adjusted_labels=new t.SVSet;g.font=t.pixel(d)+"px Arial";p=h+Math.round(f*n.zoom_x/n.zoom_max);let i=0;const s=e.length;for(;i<s;i++){r=e[i];r.font_size=d;r.rect=this.rect_for_label(r);r.adjust_rect(adjusted_labels);if(r.stack_level>a&&d>p){_=true;d-=1;break}else{adjusted_labels.push(r)}}}return e};e.prototype.label_over_spectra=function(e,n,i){const r=this.sv;const s=[];for(let t=0,n=e.rect.width;t<n;t++){s.push(r.scale.x.invert(e.rect.x+t))}const o=r.scale.y.invert(e.rect.bottom());let a=false;for(let e=0,i=s.length;e<i;e++){if(o<t.sum_of_peaks(s[e],n)){a=true;break}}return a};e.prototype.draw=function(){if(!this.visible){return}const e=this.sv;const n=e.context;const i=e.scale;let r;const s=t.pixel(2);n.save();this.update();const o=this.visible_labels;for(let e=0,a=o.length;e<a;e++){r=o[e];const a=i.x(r.x);const l=i.y(r.y)-s;const c=r.rect.bottom()+s;n.beginPath();n.moveTo(a,l);n.lineTo(a,c);n.strokeStyle="#999999";n.lineWidth=t.pixel(.5);n.stroke()}n.fillStyle=this.label_color;for(let t=0,e=o.length;t<e;t++){r=o[t];if(r===this.highlighted_label){n.font="bold "+n.font}else{n.font=n.font.replace("bold ","")}n.textBaseline="top";if(r.vertical){n.textAlign="right";n.save();n.translate(r.rect.x,r.rect.y);n.rotate(-Math.PI/2);n.fillText(r.text,0,0);n.restore()}else{n.textAlign="left";n.fillText(r.text,r.rect.x,r.rect.y)}}n.restore()};e.prototype.check_hover=function(){const t=this.sv;let e;if(this.hover){const n=t.scale.x(t.mx);const i=t.scale.y(t.my);const r=this.highlighted_label;let s;let o=0;const a=this.visible_labels.length;for(;o<a;o++){e=this.visible_labels[o];if(e.rect.contains_pt(n,i)){s=e;break}}if(r!=s){this.highlighted_label=s;this.sv.trigger("click-start");t.full_draw()}if(this.highlighted_label){t.svg.style("cursor","pointer")}else{t.svg.style("cursor","move")}}};function n(e){e=e||{};this.spectrum=e.spectrum;this.labels=new t.SVSet}n.prototype.get=function(t){return this.labels.get(t)};n.prototype.add=function(t,e,n){this.labels.push(new i(this,t,e,n))};n.prototype.add_peaks=function(){if(this.spectrum){const e=this.spectrum.peaks();let n=0;const i=e.length;for(;n<i;n++){const i=e[n];const r=t.sum_of_peaks(i.center,i.spectrum().peaks());this.add({x:i.center,y:r,text:i.label()})}}};n.prototype.update_peaks=function(){if(this.spectrum){this.labels=new t.SVSet;this.add_peaks()}};label_id=0;function i(e,n,i,r){n=n||{};display_defaults={vertical:true,font_size:12};i=t.merge(display_defaults,n.display,i);this.meta=t.merge(n.meta,r);this.label_set=e;this.vertical=i.vertical;this.font_size=i.font_size;this.text=n.text;this.x=n.x;this.y=n.y;this.stack_level=0;this.label_id()}i.prototype.label_id=function(){const t=r();this.label_id=function(){return t};return t};const r=function(){return"label-id-"+label_id++};i.prototype.adjust_rect=function(e){const n=true;let i=0;while(this.overlap(e)){this.rect.y-=t.pixel(this.font_size)*2;i+=1}this.stack_level=i};i.prototype.overlap=function(t){return this.rect.overlap(t.map(function(t){return t.rect}))};function s(t,e,n,i){this.x=t;this.y=e;this.width=n;this.height=i}s.prototype.bottom=function(){return this.y+this.height};s.prototype.top=function(){return this.y};s.prototype.left=function(){return this.x};s.prototype.right=function(){return this.x+this.width};s.prototype.overlap=function(e){const n=t.pixel(4);const i=this;let r=false;let s=0;const o=e.length;for(;s<o;s++){const t=e[s];if(i.x<=t.right()&&t.x<=i.right()+n&&i.y<=t.bottom()&&t.y<=i.bottom()){r=true;break}else{r=false}}return r};s.prototype.contains_pt=function(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height};t.SVAnnotation=e;t.SVLabelSet=n;t.SVLabel=i})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this.id=e.id;this.name=e.name||this.id;this.tolerance=e.tolerance;this.noise;this.active=true;this.xy_data=new t.SVData;this.simple_xy_data=new t.SVData;this.labels=new t.SVLabelSet({spectrum:this});this._compounds=new t.SVSet;if(e.compounds){e.compounds.forEach(function(e){r.add_compound(new t.Compound(e))})}else if(e.peak_list){const n={clusters:[{peaks:e.peak_list}]};r.add_compound(new t.Compound(n))}if(r.compounds().present()){const n=t.default_for(e.number_of_points,1e4);const i=t.default_for(e.min_x,-1);const s=t.default_for(e.max_x,10);if(!e.xy_line){const e=t.xy_from_peaks(r.peaks(),n,i,s);r.add_xy_line(e)}}if(e.xy_line){r.add_xy_line(e.xy_line)}
445if(e.labels){e.labels.forEach(function(t){r.labels.add(t)})}}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Spectrum"};e.prototype.add_compound=function(t){this._compounds.push(t);t._spectrum=this};e.prototype.update=function(){const e=this._sv;const n=t.xy_from_peaks(this.peaks(),this.xy_data.length(),e.boundary.x.min(),e.boundary.x.max());this.add_xy_line(n);e.zoombox.update()};e.prototype.compounds=function(t){return this._compounds.get(t)};e.prototype.add_xy_line=function(e){this.xy_data=new t.SVData(e);this.noise=this.calculate_noise();const n=this.tolerance||this.noise;this.simple_xy_data=this.xy_data.simplify(n,true)};e.prototype.calculate_noise=function(){const t=[-.05,-.04];const e=this.xy_data.index_of(t[0]);const n=this.xy_data.index_of(t[1]);const i=this.xy_data.y.slice(e,n);return(d3v7.max(i)-d3v7.min(i)).toPrecision(2)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._compounds.length;for(;i<r;i++){n.merge(this._compounds[i].clusters())}return n.get(e)};e.prototype.peaks=function(e){const n=new t.SVSet;this.compounds().forEach(function(t){t.clusters().forEach(function(t){n.merge(t.peaks())})});return n.get(e)};Object.defineProperties(e.prototype,{active:{get:function(){return this._active},set:function(t){this._active=t;const e=this._sv;if(e){e.reset_boundaries();e.all_spectra().each(function(){if(this.active){e.boundary.update(this.xy_data);e.scale.update(this.xy_data)}});e.zoombox.update();e.legend.update()}}}});t.Spectrum=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVDot.call(this,n,i);this._compounds=new t.SVSet;this.id=e.id;this.name=e.name||this.id;this.active=true;this.xyz_data=new t.SVData2D;if(e.compounds){e.compounds}r.add_xyz_plot(e.json_data);if(e.labels){e.labels.forEach(function(t){r.labels.add(t)})}}t.inherits(e,t.SVDot);e.prototype.toString=function(){return"Spectrum2D"};e.prototype.add_compound=function(t){this._compounds.push(t);t._spectrum=this};e.prototype.add_xyz_plot=function(e){this.xyz_data=new t.SVData2D(e)};e.prototype.compounds=function(t){return this._compounds.get(t)};Object.defineProperties(e.prototype,{active:{get:function(){return this._active},set:function(t){this._active=t;const e=this._sv;if(e){e.reset_boundaries();e.all_spectra().each(function(){if(this.active){e.boundary.update(this.xy_data);e.scale.update(this.xy_data)}});e.zoombox.update();e.legend.update()}}}});t.Spectrum2D=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this._clusters=new t.SVSet;if(e){this.id=e.id;this.name=e.name;this.concentration=e.concentration
446;this.original_concentration=e.concentration;if(e.clusters){e.clusters.forEach(function(e){r.add_cluster(new t.Cluster(e))})}}this.update()}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Compound"};e.prototype.add_cluster=function(t){this._clusters.push(t);t._compound=this};e.prototype.update=function(){this.x_min=t.peak_min(this.peaks());this.x_max=t.peak_max(this.peaks());this.xy_data=new t.SVData(t.xy_from_peaks(this.peaks(),5e3,this.x_min,this.x_max));this.simple_xy_data=this.xy_data.simplify(5e-4,true);this._clusters.order_by("center")};e.prototype.clusters=function(t){return this._clusters.get(t)};e.prototype.peaks=function(e){const n=new t.SVSet;this._clusters.forEach(function(t){n.merge(t.peaks())});return n.get(e)};e.prototype.spectrum=function(){return this._spectrum};e.prototype.intersect=function(e,n,i){const r=t.sum_of_peaks(e,this.peaks());return n<=r&&n>=0};e.prototype.display_concentration=function(){return t.round(this.concentration,1)+" \u03bcM"};e.prototype.center=function(){let t;if(this.peaks().present()){t=d3v7.mean(this.peaks(),function(t){return t.center})}return t};e.prototype.atom_assignment_nmrml=function(){if(!window.X2JS){console.log("X2JS needs to be installed to create nmrML: https://github.com/abdmob/x2js");return}const t=d3v7.format(".2f");const e=new X2JS;const n={atomAssignmentList:{multiplet:[]}};
446this.clusters().forEach(function(e){const i=[];e.peaks().forEach(function(t){i.push({_center:t.center,_amplitude:t.amplitude,_width:t.width})});const r={_center:t(e.center()),atoms:{_atomRefs:e.atom_refs.join(" ")},multiplicity:e.nmrml_multiplet_json(),peakList:{peak:i}};n.atomAssignmentList.multiplet.push(r)});let i=e.json2xml_str(n);i=i.replace(/><\/peak>/g,"/>");return i};t.Compound=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this._peaks=new t.SVSet;this._atoms=new t.SVSet;this.lower_bound=t.number(e.lower_bound);this.upper_bound=t.number(e.upper_bound);this.weight=t.number(e.weight);this.protons=t.number(e.protons);if(e.peaks){e.peaks.forEach(function(e){r.add_peak(new t.Peak(e))})}}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Cluster"};e.prototype.add_peak=function(t){this._peaks.push(t);this.multiplet_type=undefined;t._cluster=this};e.prototype.update=function(){this._peaks.order_by("center")};e.prototype.peaks=function(t){return this._peaks.get(t)};e.prototype.compound=function(){return this._compound};e.prototype.spectrum=function(){return this.compound().spectrum()};e.prototype.center=function(){let t;if(this.peaks().present()){t=d3v7.mean(this.peaks(),function(t){return t.center})}return t};e.prototype.atoms=function(t){return this._atoms.get(t)};e.prototype.determine_multiplet_type=function(){const t=this;const e=t.peaks();let r="m";if(e.length==1){r="s"}else if(e.length==2){r="d"}else if(e.length==3){r="t"}else if(e.length==4){if(n(e)){r="dd"}else{r="q"}}else if(e.length==5){r="quint"}else if(e.length==6){if(i(e)){r="td"}else{r="dt"}}return r};const n=function(t){const e=.1;const n=t.map(function(t){return t.amplitude});const i=d3v7.max(n);const r=i*(1-e);const s=i*(1+e);return n.every(function(t){return t>=r&&t<=s})};const i=function(t){const e=t.map(function(t){return t.amplitude});const n=d3v7.min(e.slice(2,3));const i=e.slice(0,1).concat(e.slice(4,5));return i.every(function(t){return t<=n})};e.prototype.nmrml_multiplet_json=function(){let t;switch(this.multiplet_type){case"s":t={_cvRef:"NMRCV",_accession:"NMR:1000194",_name:"singlet feature"};break;case"d":t={_cvRef:"NMRCV",_accession:"NMR:1000184",_name:"doublet feature"};break;case"t":t={_cvRef:"NMRCV",_accession:"NMR:1000185",_name:"triplet feature"};break;case"q":t={_cvRef:"NMRCV",_accession:"NMR:1000186",_name:"quatruplet feature"};break;case"dd":t={_cvRef:"NMRCV",_accession:"NMR:1000192",_name:"doublet of doublets feature"};break;case"quint":t={_cvRef:"NMRCV",_accession:"NMR:1000195",_name:"quintet feature"};break;case"dt":t={_cvRef:"NMRCV",_accession:"NMR:1000196",_name:"doublet of triplets feature"};break;case"td":t={_cvRef:"NMRCV",_accession:"NMR:1000197",_name:"triplet of doublets feature"};break;case"m":t={_cvRef:"NMRCV",_accession:"NMR:1400305",_name:"multiplet feature"};break;default:t={_cvRef:"NMRCV",_accession:"NMR:1400305",_name:"multiplet feature"}}return t};Object.defineProperties(e.prototype,{multiplet_type:{get:function(){if(!this._multiplet_type){this._multiplet_type=this.determine_multiplet_type()}return this._multiplet_type},set:function(t){this._multiplet_type=t}},atom_refs:{get:function(){if(this.atoms().length>0){return this.atoms().map(function(t){return t.id})}else{return this._atom_refs||[]}},set:function(t){this._atom_refs=t}},dir_dim_atom_refs:{get:function(){return this.dir_dim_atom_refs},set:function(t){this._dir_dim_atom_refs=t}},indir_dim_atom_refs:{get:function(){return this.indir_dim_atom_refs},set:function(t){this._indir_dim_atom_refs=t}}});t.Cluster=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this.center=t.number(e.center);this.original_amplitude=t.number(e.original_amplitude);this.amplitude=t.number(e.amplitude);this.width=t.number(e.width)}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Peak"};e.prototype.set_amplitude=function(t){if(t<=0)t=1e-5;this.amplitude=t};e.prototype.set_center=function(t){this.center=t};e.prototype.update=function(){};e.prototype["delete"]=function(){const e=this;const n=this.cluster();const i=this.compound();const r=this.spectrum();const s=r._sv;const o=n._peaks.filter(function(t){return t!=e});n._peaks=new t.SVSet(o);n.multiplet_type=undefined;
446if(n.peaks().empty()){const e=i._clusters.filter(function(t){return t!=n});i._clusters=new t.SVSet(e)}if(i.peaks().empty()){const e=r._compounds.filter(function(t){return t!=i});r._compounds=new t.SVSet(e)}if(r.peaks().empty()){const e=s._spectra.filter(function(t){return t!=r});s._spectra=new t.SVSet(e)}};e.prototype.peaks=function(){return new t.SVSet(this)};e.prototype.cluster=function(){return this._cluster};e.prototype.compound=function(){return this.cluster().compound()};e.prototype.spectrum=function(){return this.compound().spectrum()};e.prototype.label=function(){return this.center.toFixed(3)};t.Peak=e})(JSpectraViewer);(function(t){function e(n,i){t.SVPath.call(this);const r=this;this.sv=n;this.element_type=i.element_type;this.allow_multiselect=t.default_for(i.allow_multiselect,true);this.allow_adjust=t.default_for(i.allow_adjust,true);this.allow_width_adjust=t.default_for(i.allow_width_adjust,true);this.allow_peak_creation=t.default_for(i.allow_peak_creation,false);this.show_bounds=t.default_for(i.show_bounds,true);this.show_indicators=t.default_for(i.show_indicators,false);this.display_info=t.default_for(i.display_info,true);this.constrain_adjust=i.constrain_adjust;this.restriction_spectrum_id=i.restriction_spectrum_id;this.possible_elements=i.possible_elements;display_defaults={fill:"rgba(150, 150, 150, 0.2)",visible:true};this.display_settings(t.merge(display_defaults,i.display));this.handle_spacer=t.pixel(10);this.handle_size=t.pixel(15);this._elements=new t.SVSet;this.initialize_selection_events();this.popup_box=this.sv.sv_wrapper.append("div").attr("class","jsv-select-popup-box").style("visibility","hidden");this.text_container=this.popup_box.append("div").attr("class","jsv-select-text-container");this.draw=function(){if(r.present()){e.prototype.draw.apply(this,arguments);r.draw_adjust_handles(arguments[0],arguments[1])}r.present()&&r.display_info?r.show_popup_box():r.hide_popup_box()}}t.inherits(e,t.SVPath);e.prototype.peaks=function(e){const n=new t.SVSet;let i=0;const r=this._elements.length;for(;i<r;i++){n.merge(this._elements[i].peaks())}return n.get(e)};e.prototype.elements=function(t){return this._elements.get(t)};e.prototype.clear=function(){this.sv.trigger("selection-clear");this._elements=new t.SVSet;this.sv.trigger("selection-empty");return this};e.prototype.add_element=function(t){this._elements.push(t);this.sv.highlight.remove();this.sv.trigger("selection-add");return this};e.prototype.remove_element=function(e){this._elements=new t.SVSet(this._elements.filter(function(t){return t!=e}));this.sv.trigger("selection-remove");if(this.empty())this.sv.trigger("selection-empty");return this};e.prototype.size=function(){return this._elements.length};e.prototype.present=function(){return this._elements.length>0};e.prototype.empty=function(){return this._elements.length==0};e.prototype.contains=function(t){return this._elements.contains(t)};e.prototype["delete"]=function(){this.peaks().each(function(){this["delete"]()});this.update();this.clear();this.sv.trigger("adjust-end");this.sv.full_draw()};e.prototype.hide_popup_box=function(){this.popup_box.style("visibility","hidden")};e.prototype.show_popup_box=function(){const e=this.highlighted_element;this.popup_box.style("width","100%");const n=this.sv.axis_x_reverse?"right":"left";this.popup_box.style(n,this.sv.axis_y_gutter+t.pixel(2)+"px");this.text_container.html(this.info_text());const i=this.text_container.node().offsetWidth+20;this.popup_box.style("visibility","visible").style("width",i+"px")};e.prototype.info_text=function(){let t="",e="",n="";const i=this.compounds();
446const r=this.clusters();const s=this.peaks();if(i.length==1){const e=i[0];t=e.name;if(e.concentration!==undefined){t+" ["+e.display_concentration()+"]"}}else{t=i.length+" compounds"}if(r.length==1){const t=r[0];e="cluster: "+t.center().toFixed(3)+" ppm"}else{e=r.length+" clusters"}if(s.length==1){const t=s[0];n="peak: "+t.center.toFixed(3)+" ppm"}else{n=s.length+" peaks"}text="<p>"+t+"</p><p>"+e+"</p><p>"+n+"</p>";return text};e.prototype.compounds=function(e){const n=new t.SVSet;this.peaks().forEach(function(t){n.push(t.compound())});return n.unique().get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;this.peaks().forEach(function(t){n.push(t.cluster())});return n.unique().get(e)};e.prototype.adjust_concentration=function(){return this.element_type=="compound"||this.constrain_adjust=="compound"};e.prototype.draw_adjust_handles=function(t,e){const n=this;const i=this.sv;let r;if(n.allow_adjust&&n.allow_width_adjust&&n.present()){const s=this.handle_spacer;const o=this.handle_size;const a=i.get_peak_domains(n.peaks(),true);const l=e.x(d3v7.min(a[0]));const c=e.x(d3v7.max(a[0]));if(i.axis_x_reverse){this.handle_min_x=l+s;this.handle_max_x=c-s-o;r=-1}else{this.handle_min_x=l-s-o;this.handle_max_x=c+s;r=1}const u=e.y(d3v7.max(a[1])/2);this.handle_y=u-o/2;t.translate(.5,.5);t.beginPath();t.strokeStyle="rgba(50, 50, 50, 0.9)";t.rect(this.handle_min_x,this.handle_y,o,o);t.rect(this.handle_max_x,this.handle_y,o,o);t.stroke();t.beginPath();t.strokeStyle="rgba(150, 150, 150, 0.5)";t.moveTo(l,u);t.lineTo(l-s*r,u);t.moveTo(c,u);t.lineTo(c+s*r,u);t.stroke();t.translate(-.5,-.5)}};e.prototype.draw_bounds=function(e,n){const i=this;const r=t.pixel(10);const s=this.sv;if(o()){const t=this.elements(1);const o=s.get_peak_domains(i.peaks(),true);const a=n.y.range()[0];const l=n.x(t.lower_bound);const c=n.x(t.upper_bound);const u=n.x(t.center());e.save();e.translate(.5,.5);e.beginPath();e.lineWidth=2;if(t.center()<t.lower_bound||t.center()>t.upper_bound){e.strokeStyle="red";e.fillStyle="red"}else{e.strokeStyle="blue";e.fillStyle="white"}e.moveTo(l,a);e.lineTo(l+r,a-r);e.lineTo(l+r,a+r);e.lineTo(l,a);e.moveTo(c,a);e.lineTo(c-r,a-r);e.lineTo(c-r,a+r);e.lineTo(c,a);e.moveTo(u,a-r);e.lineTo(u,a+r);e.fill();e.stroke();e.translate(-.5,-.5);e.restore()}function o(){const e=i.elements(1);return i.show_bounds&&i.size()==1&&typeof e.center=="function"&&t.isNumeric(e.center())&&t.isNumeric(e.lower_bound)&&t.isNumeric(e.upper_bound)}};e.prototype.draw_indicators=function(e,n){const i=this;const r=t.pixel(10);const s=this.sv;if(i.show_indicators){const s=n.y.range()[0];e.save();e.translate(.5,.5);i.elements().forEach(function(i){let o;if(typeof i.center=="function"){o=i.center()}else{o=i.center}if(o!==undefined){o=n.x(o);e.beginPath();e.lineWidth=t.pixel(2);e.strokeStyle="green";e.fillStyle="green";e.moveTo(o,s-r);e.lineTo(o,s+r);e.fill();e.stroke()}});e.translate(-.5,-.5);e.restore()}};e.prototype.mouse_in_handle=function(){const t=this;const e=this.sv;let n;if(t.allow_adjust&&t.allow_width_adjust&&t.present()){const t=e.scale.x(e.mx);const i=e.scale.y(e.my);if(i>this.handle_y&&i<this.handle_y+this.handle_size){if(t>this.handle_max_x&&t<this.handle_max_x+this.handle_size)n="left";if(t>this.handle_min_x&&t<this.handle_min_x+this.handle_size)n="right"}}return n};e.prototype.mouse_in_selection=function(){const e=this;const n=this.sv;if(e.present()){const i=n.scale.x(n.mx);const r=n.scale.y(n.my);const s=t.sum_of_peaks(n.mx,e.peaks());return n.my<=s&&n.my>=0}};e.prototype.update=function(){const e=new t.SVSet;this.constrained_peaks().forEach(function(t){e.push(t,t.cluster(),t.compound(),t.spectrum())});e.unique().forEach(function(t){t.update()})};e.prototype.constrained_peaks=function(){const e=this;let n;if(e.constrain_adjust){n=new t.SVSet;e.peaks().forEach(function(t){if(t[e.constrain_adjust]){n.merge(t[e.constrain_adjust]().peaks())}});n=n.unique()}else{n=e.peaks()}return n};e.prototype.initialize_selection_events=function(){const e=this.sv;const n=this;let i,r,s,o,a,l,c;let u,h,f,d,p;let m,g;let _;e.svg.on("mousedown.selection",function(t){_=false;const i=t.x;const r=t.y;if(w(t)&&n.allow_adjust){k();e.svg.on("mousemove.fit",function(){S()});e.svg.on("mouseup.fit",function(){M();e.svg.on("mousemove.fit",null);
446e.svg.on("mouseup.fit",null)})}else if(b(t)&&n.allow_multiselect){T();e.svg.on("mousemove.fit",function(){C()});e.svg.on("mouseup.fit",function(){A();e.svg.on("mousemove.fit",null);e.svg.on("mouseup.fit",null)})}else{e.svg.on("mouseup.selection",function(t){if(i==t.x&&r==t.y){if(v(t)){E()}else if(!_){n.clear()}}e.svg.on("mouseup.selection",null)})}});function v(t){return n.allow_peak_creation&&(e.create_peak_mode||e.keyval()=="65"||t.metaKey)}function y(t){return n.allow_multiselect&&(e.keyval()=="83"||t.shiftKey)}function b(t){return y(t)&&!n.mouse_in_handle()&&!x()}function x(){return e.find_element_mouse_over(n.element_type,n.restriction_spectrum_id,n.possible_elements,n.visible_only)}function w(t){if(n.mouse_in_handle())return true;if(v(t))return false;let i;const r=x();const s=n.mouse_in_selection();if(r||s){if(y(t)){if(n.contains(r)){n.remove_element(r);i=false;_=true}else if(!s){n.add_element(r);i=true}}else if(!s){n.clear();n.add_element(r);i=true;_=true}else{i=true}e.fast_calc_draw()}else{i=false}return i}function k(){i=d3v7.event.x;r=d3v7.event.y;c=n.mouse_in_handle();e.svg.style("cursor","grabbing")}function S(){d3v7.event.stopPropagation();_=true;s=d3v7.event.x-i;o=d3v7.event.y-r;i=d3v7.event.x;r=d3v7.event.y;a=e.pixels_to_units_of_axis("x",s);l=e.pixels_to_units_of_axis("y",o);if(c){const t=c=="right"?1:-1;n.peaks().forEach(function(e){e.width=e.width-t*a*2;if(e.width<1e-5)e.width=1e-5})}else{if(n.adjust_concentration()){n.compounds().forEach(function(t){t.orig_amplitude=d3v7.max(t.peaks(),function(t){return t.amplitude})})}const t=n.constrained_peaks();m=d3v7.max(t,function(t){return t.amplitude});if(m<=0)m=1e-5;t.forEach(function(t){g=t.amplitude+l/m*t.amplitude;t.set_amplitude(g)});n.peaks().forEach(function(t){t.set_center(t.center+a)});if(n.adjust_concentration()){n.compounds().forEach(function(t){const e=d3v7.max(t.peaks(),function(t){return t.amplitude});t.concentration=t.concentration*e/t.orig_amplitude})}}e.trigger("adjust");e.fast_calc_draw()}function M(){n.update();e.svg.style("cursor","grab");e.trigger("adjust-end",n.compounds());e.full_draw()}function T(){h=new t.SVSet;const n=d3v7.mouse(e.canvas);d=n[0];p=n[1];u=e.svg.append("rect").attr("class","select-box").attr("x",d).attr("y",p).attr("width",0).attr("height",0)}function C(){d3v7.event.stopPropagation();_=true;const i=d3v7.mouse(e.canvas);x_new=i[0];y_new=i[1];const r=d3v7.min([d,x_new]);const s=d3v7.min([p,y_new]);const o=Math.abs(x_new-d);const a=Math.abs(y_new-p);u.attr("x",r).attr("y",s).attr("width",o).attr("height",a);const l=D(r,s,o,a);l.forEach(function(t){if(!n.contains(t)){n.add_element(t);h.push(t)}});h=new t.SVSet(h.filter(function(t){if(!l.contains(t)){n.remove_element(t);return false}return true}));e.fast_draw()}function A(){u.remove();e.full_draw()}function D(i,r,s,o){const a=new t.SVSet;let l;const c=e.scale.y.invert(t.pixel(r+o));const u=e.elements(n.element_type,n.restriction_spectrum_id,n.possible_elements,n.visible_only);let h=0;const f=u.length;for(;h<f;h++){const n=u[h];for(let r=0;r<s;r++){l=e.scale.x.invert(t.pixel(i+r));if(c<t.sum_of_peaks(l,n.peaks())){a.push(n);break}}}return a}function E(){let i,r;if(n.present()){i=n.peaks(1).cluster();r=d3v7.mean(n.peaks(),function(t){return t.width})}else{let s;if(n.restriction_spectrum_id){s=e.spectra(n.restriction_spectrum_id)}else{s=e.spectra().filter(function(t){return t.compounds().present()})[0]}i=new t.Cluster;s.compounds(1).add_cluster(i);if(s.peaks().present()){r=d3v7.mean(s.peaks(),function(t){return t.width})}else{r=.003}}const s=new t.Peak({width:r,center:0});i.add_peak(s);const o=e.mouse(e.canvas);s.set_center(e.scale.x.invert(o[0]));s.set_amplitude(e.scale.y.invert(o[1]));e.trigger("adjust-peak-created",s);if(n.element_type=="peak"){n.add_element(s)}else if(n.empty()&&n.element_type=="cluster"){n.add_element(i)}else if(n.empty()&&n.element_type=="compound"){n.add_element(i.compound())}M()}};t.SVSelection=e})(JSpectraViewer);(function(t){function e(e,n){this.sv=e;this.element_type=n.element_type;this.restriction_spectrum_id=n.restriction_spectrum_id;this.possible_elements=n.possible_elements;this.visible_only=t.default_for(n.visible_only,true);this.text_display=t.default_for(n.text_display,true);display_defaults={lineWidth:3,visible:true};this.display=t.merge(display_defaults,n.display);this.popup_box=this.sv.sv_wrapper.append("div").attr("class","jsv-highlight-popup-box").style("visibility","hidden");this.text_container=this.popup_box.append("div").attr("class","jsv-highlight-text-container")}e.prototype.hover=function(){const t=this.sv;if(this.element_type){const e=this.highlighted_element;let n=t.find_element_mouse_over(this.element_type,this.restriction_spectrum_id,this.possible_elements,this.visible_only);if(t.selection.mouse_in_selection()||t.selection.mouse_in_handle()){n=undefined}if(e!=n){this.highlighted_element=n;if(e){e.display_settings(this.saved_display_settings);this.hide_popup_box()}if(n){this.saved_display_settings=n.display_settings();n.display_settings(this.display);this.show_popup_box()}t.full_draw()}}};e.prototype.remove=function(){if(this.highlighted_element){this.highlighted_element.display_settings(this.saved_display_settings);this.highlighted_element=undefined;this.hide_popup_box()}};e.prototype.hide_popup_box=function(){this.sv.trigger("highlight-end");this.popup_box.style("visibility","hidden")};e.prototype.show_popup_box=function(){const t=this.highlighted_element;let e="";if(this.text_display===true){e=this.default_text()}else if(typeof this.text_display=="string"){e=this.parsed_text()}this.sv.trigger("highlight-start");if(this.text_display){this.popup_box.style("width","100%");this.text_container.html(e);const t=this.text_container.node().offsetWidth+20;const n=this.sv.menu.visible()?this.sv.menu.height()+5:15;this.popup_box.style("visibility","visible").style("top",n+"px").style("width",t+"px")}};e.prototype.default_text=function(){let t="";if(this.element_type=="peak"){t="Peak: "+this.highlighted_element.center.toFixed(3)+" ppm"}else if(this.element_type=="cluster"){t="Cluster: "+this.highlighted_element.center().toFixed(3)+" ppm"}else if(this.element_type=="compound"){t=this.highlighted_element.name}else if(this.element_type=="spectrum"){t=this.highlighted_element.name}return t};e.prototype.parsed_text=function(){const t=this.highlighted_element;const e=function(e,n,i){let r;if(n=="p"){r=t[i]}else if(n=="f"){r=t[i]()}else if(n=="m"){r=t.meta[i]}return r};return this.text_display.replace(/#\{(.):(.*?)\}/g,e)};t.SVHighlighter=e})(JSpectraViewer);(function(t){function e(t,e){const n=this;this.sv=t;this.id=e;this.speed=400;this.active_ids=[];this.container=d3v7.select(e);this.static_compounds;this.table=this.container.append("table").style("display","none").attr("class","jsv-cluster-navigator");this.thead=this.table.append("thead");this.tbody=this.table.append("tbody");t.on("selection-add.cluster-navigator",function(){n.table.style("display","block");n.update_table()});if(t.selection.present())t.trigger("selection-add.cluster-navigator");t.on("selection-remove.cluster-navigator",function(){n.update_table()});t.on("adjust-end.cluster-navigator",function(){n.update_table()});t.on("selection-empty.cluster-navigator",function(){if(!n.static_compounds){n.table.style("display","none")}});d3v7.select(".jsv-cluster-navigator").on("click",function(t){const e=d3v7.select(t.target);window.getSelection().removeAllRanges();if(e.classed("cluster-unit")){n.move_to_cluster(e.node())}
446else if(e.classed("jsv-cluster-nav")){n.cycle_clusters(e)}})}e.prototype.update_table=function(){const t=this.static_compounds||this.sv.selection.compounds();this.tbody.html(n(t));if(this.active_ids.length>0){d3v7.selectAll(this.active_ids.join(",")).classed("active",true)}this.sv.trigger("cluster-navigator-updated")};const n=function(t){return t.map(function(t){return i(t)}).join("")};const i=function(t){html="<tr>";if(t.name!==undefined){html+="<td>"+t.name+"</td>"}if(t.concentration!==undefined){html+="<td>"+t.display_concentration()+"</td>"}html+="<td>"+r(t.clusters())+"</td></tr>";return html};const r=function(t){t.order_by("center",true);const e="<span class='jsv-cluster-nav jsv-cluster-nav-left'>&#10094;</span>&nbsp;<span class='jsv-cluster-nav jsv-cluster-nav-right'>&#10095;</span>";return e+t.map(function(t){return s(t)}).join("")};const s=function(t){return'<div class="cluster-unit" style="display: inline-block; text-decoration: underline; text-decoration-style: dashed;" id="'+t.path_id()+'">'+t.center().toFixed(2)+"</div>"};e.prototype.cycle_clusters=function(t){const e=t.classed("jsv-cluster-nav-right");console.log("target",t);const n=d3v7.select(t.node().parentNode);console.log("parent",n);const i=n.select(".active");const r=Array.from(n.selectAll(".cluster-unit"));console.log("cluster_units",r);const s=r.map(function(t){return t.id});let o=i.node()?s.indexOf(i.node().id):-1;if(o<0){o=0}else if(e){o=o+1<s.length?o+1:0}else{o=o-1<0?s.length-1:o-1}const a=n.select("#"+s[o]);this.move_to_cluster(a.node())};e.prototype.move_to_cluster=function(t){const e=sv.clusters(t.id);sv.move_to_peaks(e.peaks(),this.speed,2);d3v7.select(t.parentNode).selectAll(".cluster-unit").classed("active",false);d3v7.select(t).classed("active",true);this.active_ids=d3v7.selectAll(".cluster-unit.active")[0].map(function(t){return"#"+t.id});sv.selection.clear();sv.selection.add_element(e)};e.prototype.detach=function(){this.sv.off(".cluster-navigator");this.table.remove()};Object.defineProperties(e.prototype,{static_compounds:{get:function(){return this._static_compounds},set:function(t){this._static_compounds=t;this.table.style("display","block");this.update_table()}}});t.SVClusterNavigator=e})(JSpectraViewer);(function(t){const e=function(t,e){const n=t.sv_wrapper.select("#jsv-save-height").property("value");const i=t.sv_wrapper.select("#jsv-save-width").property("value");const r=t.image(i,n);const s="JSV-Image-"+i+"x"+n;const o=window.open(r,s);e.close();setTimeout(function(){o.document.title=s},100)};const n=function(t){return""+'<div class="jsv-alert">Display the viewer image in a new window to download or print. Note that you must allow pop-ups!</div>'+'<div><label class="jsv-label">Width</label><div class="jsv-input-group">'+'<input class="jsv-input" id="jsv-save-width" type="text" value="'+t.width+'" /><div class="jsv-input-addon">px</div></div></div>'+'<div><label class="jsv-label">Height</label><div class="jsv-input-group">'+'<input class="jsv-input" id="jsv-save-height" type="text" value="'+t.height+'" /><div class="jsv-input-addon">px</div></div></div>'};const i=d3v7.line().x(function(t){return t.x}).y(function(t){return t.y}).curve(d3v7.curveLinear);const r=function(t,e,n,i,r,s){const o=t.append("g").attr("class","jsv-menu-button");o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r).attr("rx",2).attr("ry",2).style("stroke-width",1);const a=s.remove();o.append("g").attr("class","jsv-button-image").append(function(){return a.node()});o.attr("transform","translate("+e+".5,"+n+".5)");return o};const s=function(t){const e=t.append("g");const n=3;e.append("line").attr("x1",10).attr("y1",0).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",6).attr("y1",7).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",14).attr("y1",7).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",2).attr("y1",16).attr("x2",18).attr("y2",16).attr("stroke-linecap","round").attr("stroke-width",n);return e};const o=function(t){const e=t.append("g");const n=4;e.append("circle").attr("cx",10).attr("cy",10).attr("r",7).style("fill","rgb(75, 75, 75");e.append("line").attr("x1",10).attr("y1",1).attr("x2",10).attr("y2",19).attr("stroke-width",n);e.append("line").attr("x1",1).attr("y1",10).attr("x2",19).attr("y2",10).attr("stroke-width",n);e.append("line").attr("x1",3.5).attr("y1",3.5).attr("x2",16.5).attr("y2",16.5).attr("stroke-width",n);e.append("line").attr("x1",16.5).attr("y1",3.5).attr("x2",3.5).attr("y2",16.5).attr("stroke-width",n);e.append("circle").attr("cx",10).attr("cy",10).attr("r",3).style("fill","white");return e};const a=function(t,e,n,i,r,s){const o=t.append("g");const a=1;const l=2;const c=n+l;const u=n+r-l;const h=2;const f=e+i/2;o.append("line").attr("x1",e).attr("y1",n).attr("x2",e+i).attr("y2",n).attr("stroke-width",a);o.append("line").attr("x1",e).attr("y1",n+r).attr("x2",e+i).attr("y2",n+r).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f).attr("y2",u).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f-h).attr("y2",c+h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f+h).attr("y2",c+h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",u).attr("x2",f-h).attr("y2",u-h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",u).attr("x2",f+h).attr("y2",u-h).attr("stroke-width",a);o.attr("stroke","rgb(150, 150, 150)").attr("transform","rotate("+s+","+e+","+n+")");return o};const l=function(t){return t.append("line").attr("x1",3).attr("y1",8).attr("x2",13).attr("y2",8).attr("stroke-width",3).attr("stroke","black")};const c=function(t){const e=t.append("g");e.append("line").attr("x1",3).attr("y1",8).attr("x2",13).attr("y2",8).attr("stroke-width",3).attr("stroke","black");e.append("line").attr("x1",8).attr("y1",3).attr("x2",8).attr("y2",13).attr("stroke-width",3).attr("stroke","black");return e};const u=function(t,e){return t.append("path").attr("d",i(e)).attr("stroke","black").attr("stroke-width",3).attr("fill","none")};const h=function(t,e,n,i){return setInterval(function(){t.translate_axis(e,n);t.fast_draw()},i)};function f(t){const e=this;this.sv=t;this.slide_time=500;this._visible=true;this.menu=t.sv_wrapper.append("div").style("visibility","visible").attr("class","jsv-menu").on("click",function(){window.getSelection().removeAllRanges()});this.menu_svg=this.menu.append("svg").attr("width",this.width()).attr("height",this.height());
446this.handle=t.sv_wrapper.append("div").attr("class","jsv-menu-handle").on("click",function(){if(e.opened()){e.close()}else{e.open()}}).on("mouseover",function(){e.handle_mouseover()}).on("mouseout",function(){e.handle_mouseout()});const n=40;const i=12;this.handle_svg=this.handle.append("svg").attr("width",n).attr("height",i);this.stroke_width=4;this.handle_data_closed=[{x:0,y:0},{x:n/2,y:i-this.stroke_width},{x:n,y:0}];this.handle_data_opened=[{x:0,y:i},{x:n/2,y:this.stroke_width},{x:n,y:i}];this.draw();t.trigger("domain-change.menu")}f.prototype.visible=function(t){if(arguments.length==0)return this._visible;if(t){this._visible=true;this.handle.style("visibility","visible");this.menu.style("visibility","visible")}else{this._visible=false;this.handle.style("visibility","hidden");this.menu.style("visibility","hidden")}};f.prototype.opened=function(){return this.menu.style("visibility")=="visible"};f.prototype.width=function(){return 300};f.prototype.height=function(){return 41};f.prototype.open=function(e){e=t.default_for(e,this.slide_time);this.menu.style("visibility","visible");this.menu.transition().duration(e).style("top","0px").style("opacity",1);this.handle_path.transition().duration(e).attr("d",i(this.handle_data_opened))};f.prototype.close=function(e){e=t.default_for(e,this.slide_time);this.menu.transition().duration(e).style("top","-50px").style("opacity",0).on("end",function(){d3v7.select(this).style("visibility","hidden")});this.handle_path.transition().duration(e).attr("d",i(this.handle_data_closed))};f.prototype.handle_mouseover=function(){this.handle_path.transition().duration(200).attr("stroke","black")};f.prototype.handle_mouseout=function(){this.handle_path.transition().duration(200).attr("stroke","grey")};f.prototype.draw=function(){const f=this.sv;const p=this;let m;let g=5;let _=4;this.handle_path=this.handle_svg.append("path").attr("d",i(this.handle_data_closed)).attr("stroke","grey").attr("stroke-width",this.stroke_width).attr("fill","none");if(this.sv.constructor.name==="SpectraViewer"){const t=[{x:11,y:4},{x:4,y:15},{x:11,y:26}];const e=[{x:4,y:4},{x:11,y:15},{x:4,y:26}];const n=u(this.menu_svg,t);const i=u(this.menu_svg,e);this.nav_group=this.menu_svg.append("g");this.scroll_left_button=r(this.nav_group,0,0,15,30,n);this.scroll_right_button=r(this.nav_group,17,0,15,30,i);this.nav_group.attr("transform","translate("+7+","+4+")");this.scroll_left_button.on("mousedown",function(){if(d3v7.select(this).classed("disabled"))return;m=h(f,"x",g,_);return false});this.scroll_right_button.on("mousedown",function(){if(d3v7.select(this).classed("disabled"))return;m=h(f,"x",-g,_);return false});$(document).mouseup(function(){if(m){clearInterval(m);f.full_draw()}})}else{this.reset_zoom_button=r(this.menu_svg,10,4,30,30,d(this.menu_svg));this.reset_zoom_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=[[-10,500],[-10,500]];f.move_to(t,1e3)})}this.zoom_group=this.menu_svg.append("g");this.zoom_y_minus_button=r(this.zoom_group,6,18,16,16,l(this.menu_svg));this.zoom_y_plus_button=r(this.zoom_group,6,0,16,16,c(this.menu_svg));this.zoom_x_minus_button=r(this.zoom_group,25,9,16,16,l(this.menu_svg));this.zoom_x_plus_button=r(this.zoom_group,43,9,16,16,c(this.menu_svg));a(this.zoom_group,0,.5,5,34,0);a(this.zoom_group,25.5,32,5,34,-90);this.zoom_group.attr("transform","translate("+55+","+2+")");this.zoom_x_minus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.x.diff()/2;const e=[[f.scale.x.min()-t,f.scale.x.max()+t],f.scale.y.domain()];f.move_to(e)});this.zoom_x_plus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.x.diff()/4;const e=[[f.scale.x.min()+t,f.scale.x.max()-t],f.scale.y.domain()];f.move_to(e)});this.zoom_y_minus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.y.diff()/2;const e=[f.scale.x.domain(),[f.scale.y.min()-t,f.scale.y.max()+t]];f.move_to(e)});this.zoom_y_plus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.y.diff()/4;const e=[f.scale.x.domain(),[f.scale.y.min()+t,f.scale.y.max()-t]];f.move_to(e)});f.on("domain-change.menu",function(){if(f.zoom_x==1){p.zoom_x_minus_button.classed("disabled",true)}else if(f.zoom_x>=f.zoom_max){p.zoom_x_plus_button.classed("disabled",true)}
446else{p.zoom_x_minus_button.classed("disabled",false);p.zoom_x_plus_button.classed("disabled",false)}if(f.zoom_y==1){p.zoom_y_minus_button.classed("disabled",true)}else if(f.zoom_y>=f.zoom_max){p.zoom_y_plus_button.classed("disabled",true)}else{p.zoom_y_minus_button.classed("disabled",false);p.zoom_y_plus_button.classed("disabled",false)}if(f.constructor.name==="SpectraViewer"){if(f.scale.x.min()==f.boundary.x.min()){p.scroll_right_button.classed("disabled",true)}else{p.scroll_right_button.classed("disabled",false)}
447if(f.scale.x.max()==f.boundary.x.max()){p.scroll_left_button.classed("disabled",true)}else{p.scroll_left_button.classed("disabled",false)}}else if(f.zoom_y===1&&f.zoom_x===1){p.reset_zoom_button.classed("disabled",true)}else{p.reset_zoom_button.classed("disabled",false)}});const v=this.menu_svg.append("text").attr("x",15).attr("y",24).attr("font-family","sans-serif").attr("font-size","26px").attr("stroke-width",1).attr("fill","black").attr("class","jsv-button-text").style("text-anchor","middle").text("?");this.help_button=r(this.menu_svg,260,4,30,30,v);this.help_button.on("click",function(){f.help.dialog.open()});const y=s(this.menu_svg).attr("transform","translate(5,7)");this.download_button=r(this.menu_svg,220,4,30,30,y);this.download_dialog=new t.SVDialog(f,{header_text:"Save Image",content_text:n(f),buttons:{Cancel:function(){this.close()},Generate:function(){e(f,this)}},width:400,height:250});this.download_button.on("click",function(){p.download_dialog.open()});const b=o(this.menu_svg).attr("transform","translate(5,5)");this.settings_button=r(this.menu_svg,180,4,30,30,b);this.settings_button.on("click",function(){f.settings.open()});const x=this.menu_svg.append("text").attr("x",149).attr("y",32).attr("font-family","sans-serif").attr("font-size","16px").attr("stroke-width",1).attr("fill","grey").attr("class","jsv-button-text").style("text-anchor","middle").text("JSV")};let d=function(t){let e=t.append("g");e.append("circle").attr("cx",13).attr("cy",12).attr("r",9).style("fill","grey");e.append("circle").attr("cx",13).attr("cy",12).attr("r",7).style("fill","white");e.append("line").attr("x1",17).attr("y1",17).attr("x2",25).attr("y2",25).attr("stroke-width",3).attr("stroke","black");e.append("line").attr("x1",9).attr("y1",12).attr("x2",17).attr("y2",12).attr("stroke-width",3).attr("stroke","black");return e};t.SVMenu=f})(JSpectraViewer);(function(t){function e(e){this.sv=e;const r=e.toString()==="SpectraViewer"?n:i;this.dialog=new t.SVDialog(e,{header_text:"JSpectraViewer (JSV) Help",content_text:r,width:700,height:350})}let n=""+"The view of the spectra can be scrolled around or scaled using the controls in the menu or by using the various mouse and keyboard shortcuts:"+"<h3>Viewer Controls</h3>"+'<table class="jsv-table">'+"<thead><tr><th>Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Zoom In/Out X Axis</td><td>Scroll wheel</td></tr>"+"<tr><td>Zoom In/Out Y Axis</td><td>Option/Alt Key + Scroll wheel</td></tr>"+"<tr><td>Zoom In on Area</td><td>Option/Alt Key + Click and Drag around area</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Option/Alt Key + Click once anywhere on viewer </td></tr>"+"<tr><td>Move Around</td><td>Click and Drag</td></tr></tbody></table>"+"<h3>Zoombox Controls (box in upper left corner)</h3>"+'<table class="jsv-table">'+"<thead><tr><th>Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Move Around</td><td>Click and Drag grey selection box</td></tr>"+"<tr><td>Zoom In on Area</td><td>Click on unselected region and drag around new selection</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Click once anywhere in unselected region</td></tr>"+"<tr><td>Alter Zoomed Area</td><td>Click and Drag on sides of grey selection box</td></tr></tbody></table>"+"<h3>Troubleshooting</h3>"+"<p>If the viewer is not showing any spectra or is slow, try updating to the latest version of your "+'browser. We have found that <a href="https://www.google.com/chrome" target="_blank">Google Chrome</a> is the fastest.</p></div></div>';let i=""+"The view of the spectra can be scaled using the controls in the menu or by using the various mouse and keyboard shortcuts:"+"<h3>Viewer Controls</h3>"+'<table class="jsv-table">'+"<thead><tr><th>
447Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Adjust Peak Sensitivity</td><td>Scroll wheel</td></tr>"+"<tr><td>Zoom In on Area</td><td>Click and Drag around area</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Double click inside viewer</td></tr>"+"<h3>Troubleshooting</h3>"+"<p>If the viewer is not showing any spectra or is slow, try updating to the latest version of your "+'browser. We have found that <a href="https://www.google.com/chrome" target="_blank">Google Chrome</a> is the fastest.</p></div></div>';t.SVHelp=e})(JSpectraViewer);(function(t){function e(e,n){n=n||{};const i=this;this.wrapper=e.sv_wrapper.node();this.fade_time=t.default_for(n.fade_time,500);this.header_text=t.default_for(n.header_text,"");this.content_text=t.default_for(n.content_text,"");this.height=t.default_for(n.height,300);this.width=t.default_for(n.width,300);this.buttons=n.buttons;this.box=d3v7.select(this.wrapper).append("div").style("display","none").attr("class","jsv-dialog");this.header=this.box.append("div").attr("class","jsv-dialog-header").html(this.header_text);this.dismiss=this.box.append("div").attr("class","jsv-dialog-dismiss").html("X").on("click",function(){i.close()});this.contents=this.box.append("div").attr("class","jsv-dialog-contents jsv-scroll");if(this.buttons){this.footer=this.box.append("div").attr("class","jsv-dialog-footer");this.generate_buttons()}this.contents.html(this.content_text);this.adjust_size();return i}e.prototype.visible=function(){return this.box.style("display")!="none"};e.prototype.open=function(){this.adjust_size();this.box.style("display","block");this.box.transition().duration(this.fade_time).style("opacity",1);return this};e.prototype.close=function(){this.box.transition().duration(this.fade_time).style("opacity",0).on("end",function(){d3v7.select(this).style("display","none")});return this};e.prototype.generate_buttons=function(){const t=this;const e=Object.keys(this.buttons);e.forEach(function(e){t.footer.append("button").html(e).attr("class","jsv-button").on("click",function(){t.buttons[e].call(t)})})};e.prototype.adjust_size=function(){const t=50;const e=this.wrapper.offsetWidth;const n=this.wrapper.offsetHeight;let i=this.width;let r=this.height;if(this.height>n-t)r=n-t;if(this.width>e-t)i=e-t;const s=40;const o=this.buttons?35:0;const a=r-s-o;this.box.style("width",i+"px").style("height",r+"px");this.contents.style("height",a+"px")};t.SVDialog=e})(JSpectraViewer);(function(t){function e(e,n){n=n||{};const i=this;this.sv=e;this.object=t.default_for(n.object,e);this.title=t.default_for(n.title,"Settings");this.height=t.default_for(n.height,400);this.width=t.default_for(n.width,400);n.settings=n.settings||[];this.settings=[];n.settings.forEach(function(t){i.settings.push(new r(i.object,t))});this.dialog=new t.SVDialog(e,{header_text:this.title,content_text:this.settings_html(),buttons:{Done:function(){this.close()}},width:this.width,height:this.height});return this}e.prototype.open=function(){const t=this;this.dialog.contents.html(this.settings_html());d3v7.selectAll(".jsv-setting").on("change",function(){const e=d3v7.select(this);const n=t.find(e.attr("id"));const i=e.property("checked");n.value(i);t.sv.full_draw()});this.dialog.open();return this};e.prototype.close=function(){this.dialog.close();return this};e.prototype.find=function(t){return this.settings.filter(function(e){return e.id()==t})[0]};e.prototype.settings_html=function(){html='<div class="jsv-settings">';this.settings.forEach(function(t){html+='<div><label class="jsv-label">'+t.label+"</label>";html+='<div class="jsv-input-group">';if(t.type=="boolean"){html+=n(t)}html+="</div></div>"});html+="</div>";return html};const n=function(t){html="";html+='<input type="checkbox" class="jsv-input jsv-setting" id="'+t.id()+'"';if(t.value()){html+=' checked="true" '}html+=" />";return html};let i=0;function r(e,n){n=n||{};this.object=e;this.label=n.label;this.property=n.property;this.type=t.default_for(n.type,"boolean");this.id()}r.prototype.id=function(){const t=s();this.id=function(){return t};return t};const s=function(){return"jsv-setting-id-"+i++};r.prototype.value=function(t){if(arguments.length==0){if(typeof this.property==="function"){t=this.property.call(this.object)}else{t=this.object[this.property]}}else{if(typeof this.property==="function"){this.property.call(this.object,t)}else{this.object[this.property]=t}self.sv.full_draw()}return t};t.SVSettings=e})(JSpectraViewer);(function(t){function e(e){t.pixel(10);this.sv=e;let n=e.zoombox_size||10;this.width=e.width*n/100;this.height=e.height*n/100;this.adjusting=false;this.svg=e.sv_wrapper.append("svg").attr("width",this.width+1).attr("height",this.height+1).style("position","absolute").style("top",0).style("left",e.width-this.width-1);if(e.axis_x_reverse){this.svg.style("left",0)}this.border=this.svg.append("rect").attr("x",0).attr("y",0).attr("width",this.width).attr("height",this.height).attr("fill","white").attr("stroke","#BBB");this.scale=new t.SVScale;this.scale.y.range([this.height,0]);let i=this.sv.axis_x_reverse?[this.width,0]:[0,this.width];this.scale.x.range(i);this.initialize_brushing();this.spectra_function=d3v7.line().x(t=>this.scale.x(t.x)).y(t=>this.scale.y(t.y))}Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t;if(this._visible){this.svg.style("display","block")}else{this.svg.style("display","none")}this.sv.legend.update();this.sv.draw()}});e.prototype.initialize_brushing=function(){const e=this;const n=e.sv;e.brush=d3v7.brush().extent([[e.scale.x.range()[1],e.scale.y.range()[1]],[e.scale.x.range()[0],e.scale.y.range()[0]]]).on("start",i).on("brush",r).on("end",s);e.select_brush=e.svg.append("g").attr("class","active-brush").call(e.brush);function i(t){if(t.sourceEvent)t.sourceEvent.preventDefault()}function r(i){if(!(i.selection===null)&&!e.adjusting){let t;if(n.axis_y_lock!==false){const n=i.selection;const r=n[0][0];const s=n[1][0];const o=e.scale.y.domain()[0];const a=e.scale.y.invert(d3v7.pointer(i,e.svg.node())[1]);const l=e.scale.y.domain()[1];let c=Math.min(a,l);c=Math.max(o,c);t=[[e.scale.x.invert(s),0],[e.scale.x.invert(r),c]]}if(!t)t=[[e.scale.x.invert(i.selection[1][0]),e.scale.y.invert(i.selection[1][1])],[e.scale.x.invert(i.selection[0][0]),e.scale.y.invert(i.selection[0][1])]];n.set_domain_to_brush_extent(t,false);n.fast_draw()}if(n.debug){n.debug_data.zbox["X1"]=t.round(e.brush.extent()[0][0]);n.debug_data.zbox["Y1"]=t.round(e.brush.extent()[0][1]);n.debug_data.zbox["X2"]=t.round(e.brush.extent()[1][0]);n.debug_data.zbox["Y2"]=t.round(e.brush.extent()[1][1])}}function s(t){if(!e.adjusting){n.zoom_axis="";n.draw()}}};e.prototype.add_spectrum=function(t){const e=this.sv.boundary;this.scale.x.domain(e.x.domain());this.scale.y.domain(e.y.domain());this.svg.append("path").attr("id",t.id).attr("d",this.spectra_function(t.simple_xy_data.asArray())).attr("stroke",t.color).attr("stroke-width",.5).attr("fill","none");this.set_zoom_area(e)};e.prototype.remove_spectra=function(t){this.sv.container.select("path#"+t).remove()};e.prototype.update=function(){const t=this;const e=this.sv;if(e.axis_x_reverse){this.svg.style("left",0)}else{this.svg.style("left",e.width-this.width-1)}
447this.sv.all_spectra().forEach(function(e){t.remove_spectra(e.id);if(e.active){t.add_spectrum(e)}})};e.prototype.set_zoom_area=function(t){let e=this;const n=e.scale.x(t.x.domain()[1]);const i=e.scale.x(t.x.domain()[0]);const r=e.scale.y(t.y.domain()[1]);const s=e.scale.y(t.y.domain()[0]);e.adjusting=true;e.select_brush.call(e.brush.move,[[n,r],[i,s]]);e.adjusting=false};t.ZoomBox=e})(JSpectraViewer);(function(t){t.default_for=function(t,e){return t===undefined?e:t};t.pixel_ratio=1;t.pixel=function(e){return e*t.pixel_ratio};t.get_pixel_ratio=function(t){const e=t.getContext("2d");const n=window.devicePixelRatio||1;const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/i};t.scale_resolution=function(t,e){const n=t.getContext("2d");if(e!=1){const n=t.width;const i=t.height;t.width=n*e;t.height=i*e;t.style.width=n+"px";t.style.height=i+"px"}};Function.prototype.inherits=function(t){this.prototype=Object.create(t.prototype)};t.merge=function(){const t={};let e,n,i;let r=0;const s=arguments.length;for(;r<s;r++){e=arguments[r];if(typeof e==="object"){n=Object.keys(e);let r=0;const s=n.length;for(;r<s;r++){i=n[r];t[i]=e[i]}}}return t};t.unique_id=function(t,e,n){let i;do{i=t+e;e++}while(n.indexOf(i)>-1);return i};t.round=function(t,e=2){return d3v7.round(t,e)};t.elapsed_time=function(t){const e=(new Date).getTime()-t;return e+" ms"};t.index_of_value=function(t,e,n){let i=0;let r=t.length-1;let s,o;if(t[i]>=e)return i;if(t[r]<=e)return r;while(r-i>1){s=(i+r)/2|0;o=t[s];if(o<e){i=s}else if(o>e){r=s}else{return s}}return n?r:i};t.lorentzian=function(t,e,n,i){const r=n*n;const s=t-e;return i*r/(r+4*s*s)};t.sum_of_peaks=function(e,n){let i=0;let r;for(let s=0;s<n.length;s++){r=n[s];i+=t.lorentzian(e,r.center,r.width,r.amplitude)}return i};t.xy_from_peaks=function(e,n,i,r,s){if(s)e=t.peaks_in_range(e,i,r,6);const o=t.peaks_in_range(e,i,r);const a=o.order_by("center").map(function(t){return t.center});let l=i;const c=r;const u=[],h=[];const f=(r-i)/n;while(l<c){u.push(l);h.push(t.sum_of_peaks(l,e));if(a[0]&&a[0]<=l+f){l=a.shift()}else{l+=f}}u.push(r);h.push(t.sum_of_peaks(r,e));return{x:u,y:h}};t.peaks_in_range=function(e,n,i,r){r=r||0;const s=new t.SVSet;e.forEach(function(e){if(t.peak_min([e],r)<i&&t.peak_max([e],r)>n){s.push(e)}});return s};t.peak_min=function(t,e){e=e||3;let n,i;if(t.length>0){i=t[0]}t.forEach(function(t){if(t.center<i.center){i=t}});if(i){n=i.center-e*i.width}return n};t.peak_max=function(t,e){e=e||3;let n,i;if(t.length>0){i=t[0]}t.forEach(function(t){if(t.center>i.center){i=t}});if(i){n=i.center+e*i.width}return n};t.number=function(t){if(t===undefined)return;return Number(t)};t.isNumeric=function(t){return isFinite(t)&&parseFloat(t)==t};t.decimalPlaces=function(t){const e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!e){return 0}return Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0))};t.colors=function(t,e,n,i,r,s,o,a,l,c){const u=[];if(t==undefined)t=50;if(e==undefined)e=200;if(n==undefined)n=30;if(i==undefined)i=1;if(r==undefined)r=2.4;if(s==undefined)s=2.4;if(o==undefined)o=2.4;if(a==undefined)a=0;if(l==undefined)l=2;if(c==undefined)c=4;for(let h=0;h<t;++h){const t=Math.round(Math.sin(r*h+a)*n+e);const f=Math.round(Math.sin(s*h+l)*n+e);const d=Math.round(Math.sin(o*h+c)*n+e);u.push("rgba("+t+","+f+","+d+","+i+")")}return u};t.test_colors=function(t){t.forEach(function(t){document.write('
447<font style="color:'+t+'">&#9608;</font>')});document.write("<br/>")};t.convert_base64_to_float64=function(t,e){if(typeof e==="undefined"){e=false}const n=atob(t);let i=new Int8Array(n.length);if(e){i=new Zlib.Deflate(i)}for(let t=0;t<n.length;t++){i[t]=n.charCodeAt(t)}const r=new Float64Array(i.buffer);return r};t.convert_bayesil_data=function(e){const n={id:t.default_for(e.id,"Fit"),name:t.default_for(e.name,"Fit"),compounds:[],display:t.merge({color:"blue"},e.display),meta:{dss_concentration:e.dss_conc}};e.metabolites.forEach(function(e){const i={concentration:e.concentration,original_concentration:e.concentration,concentration_units:"\u03bcM",id:e.id,name:e.name,clusters:[],display:{visible:false},meta:{dss_ratio:t.default_for(t.number(e.dss_ratio),1),threshold:e.threshold,score:e.score}};i.meta.amplitude_coefficient=i.concentration/i.meta.dss_ratio/n.meta.dss_concentration;e.clusters.forEach(function(e){const n={peaks:[],meta:{shift:e.shift}};e.shift=t.default_for(e.shift,0);n.upper_bound=e.upper_bound;n.lower_bound=e.lower_bound;n.meta.lower_bound_diff=e.lower_bound_diff;n.meta.upper_bound_diff=e.upper_bound_diff;e.peaks.forEach(function(t){const r={center:Number(t.center)+Number(e.shift),width:Number(t.width),original_amplitude:Number(t.amplitude),amplitude:Number(t.amplitude)*Number(i.meta.amplitude_coefficient),meta:{initial_width:t.initial_width}};n.peaks.push(r)});i.clusters.push(n)});n.compounds.push(i)});return n};t.create_bayesil_json=function(t,e){t=t||{xy_data:{x:[],y:[]}};const n={dss_conc:e.meta.dss_concentration,metabolites:[],meta:t.meta};e.compounds().forEach(function(t){const i={name:t.name,id:t.id,concentration:t.concentration,dss_ratio:t.meta.dss_ratio,score:t.meta.score,threshold:t.meta.threshold,clusters:[]};t.meta.amplitude_coefficient=t.concentration/t.meta.dss_ratio/e.meta.dss_concentration;t.clusters().forEach(function(e){const n={center:e.center(),initial_center:e.meta.initial_center,shift:e.center(),lower_bound:e.lower_bound,upper_bound:e.upper_bound,peaks:[]};e.peaks().forEach(function(i){let r;if(t.original_concentration==0){r=i.original_amplitude}else{r=i.amplitude/t.meta.amplitude_coefficient}const s={amplitude:r,center:i.center-e.center(),width:i.width,initial_width:i.meta.initial_width};if(isNaN(s.amplitude))s.amplitude=0;n.peaks.push(s)});i.clusters.push(n)});n.metabolites.push(i)});n.spectrum_xy={x:t.xy_data.x,y:t.xy_data.y};return n};if(!Number.isInteger){Number.isInteger=function t(e){return typeof e==="number"&&isFinite(e)&&e>-9007199254740992&&e<9007199254740992&&Math.floor(e)===e}}})(JSpectraViewer);(function(t){let e=[];function n(t,n){const i=e.x[t]-e.x[n],r=e.y[t]-e.y[n];return i*i+r*r}function i(t,n,i){let r=e.x[n],s=e.y[n],o=e.x[i]-r,a=e.y[i]-s;if(o!==0||a!==0){const n=((e.x[t]-r)*o+(e.y[t]-s)*a)/(o*o+a*a);if(n>1){r=e.x[i];s=e.y[i]}else if(n>0){r+=o*n;s+=a*n}}o=e.x[t]-r;a=e.y[t]-s;return o*o+a*a}function r(t,e){let i=t[0];const r=[i];let s;let o=1;const a=t.length;for(;o<a;o++){s=t[o];if(n(s,i)>e){r.push(s);i=s}}if(i!==s)r.push(s);return r}function s(t,e){const n=t.length,r=typeof Uint8Array!=="undefined"?Uint8Array:Array,s=new r(n);let o=0,a=n-1;const l=[],c=[];let u,h,f,d;s[o]=s[a]=1;while(a){h=0;for(u=o+1;u<a;u++){f=i(t[u],t[o],t[a]);if(f>h){d=u;h=f}}if(h>e){s[d]=1;l.push(o,d,d,a)}a=l.pop();o=l.pop()}for(u=0;u<n;u++){if(s[u])c.push(t[u])}return c}
448/**
449     * Simplify.js is a high-performance JS polyline simplification library by Vladimir Agafonkin.
450     * [Orignal Project](http://mourner.github.io/simplify-js)
451     *
452     * It has been adapted here to work with a different point format.
453     * The format used in JSV is an object of arrays:
454     * ```js
455     * points = { x: [1, 2, 3], y: [10, 20, 30] };
456     * ```
457     * There can also be an optional yi array, to hold the imaginary component of
458     * the line. This is used when incorporating phasing into the viewer.
459     *
460     * The orginal format was an array of points:
461     * ```js
462     * // Do not use this format
463     * points = [ {x:1, y:10}, {x:2, y:20}, {x:3, y:30} ];
464     * ```
465     * ***
466     * Copyright (c) 2012, Vladimir Agafonkin
467     * All rights reserved.
468     *
469     * Redistribution and use in source and binary forms, with or without modification, are
470     * permitted provided that the following conditions are met:
471     *
472     *   1. Redistributions of source code must retain the above copyright notice, this list of
473     *      conditions and the following disclaimer.
474     *
475     *   2. Redistributions in binary form must reproduce the above copyright notice, this list
476     *      of conditions and the following disclaimer in the documentation and/or other materials
477     *      provided with the distribution.
478     *
479     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
480     * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
481     * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
482     * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
483     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
484     * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
485     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
486     * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
487     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
488     *
489     * @param {Object} points An object containing an x and y array of points. There may also be an yi array.
490     * @param {Number} tolerance Affects the amount of simplification. [Default: 1]
491     * @param {Boolean} highestQuality Excludes distance-based preprocessing step which leads to highest quality simplification but runs ~10-20 times slower. [Default: false]
492     */function o(t,n,i){const o=t.x.length;if(o<=1)return t;e=t;let a=new Array(o);for(let t=0;t<o;t++){a[t]=t}const l=n!==undefined?n*n:1;a=i?a:r(a,l);a=s(a,l);const c=new Array(a.length);const u=new Array(a.length);for(let t=0,n=a.length;t<n;t++){c[t]=e.x[a[t]];u[t]=e.y[a[t]]}let h;if(e.yi){h=new Array(a.length);for(let t=0,n=a.length;t<n;t++){h[t]=e.yi[a[t]]}}t={x:c,y:u};if(h){t.yi=h}return t}t.simplify=o})(JSpectraViewer);(function(t){function e(e){this.container_id=e.container_id;this.width=e.width||200,this.height=e.height||200,this.container=d3v7.select(this.container_id);this.container.classed("js-structure",true);this.data=e.data;this.format=e.format||"mol";this.x_scale;this.y_scale;this.avgL=0;this.show_hydrogen=t.default_for(e.show_hydrogen,false);this.show_atom_numbers=t.default_for(e.show_atom_numbers,false);this.use_jsmol=t.default_for(e.use_jsmol,false);this.nmr_nucleus=e.nmr_nucleus;this.interactive_1H=true;this._atoms=new t.SVSet;this._bonds=new t.SVSet;if(this.data){this.read_data(this.data,this.format)}this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.initSVG=function(){const t=this;const e=t.container;const n=d3v7.extent(t.atoms(),function(t){return t.x});const i=d3v7.extent(t.atoms(),function(t){return t.y});const r=[15,15,20,15];t.margins=r;let s=t.width-r[1]-r[3];let o=t.height-r[0]-r[2];const a=s/o;t.structure_ratio=(n[1]-n[0])/(i[1]-i[0]);const l=a>=t.structure_ratio?"height":"width";if(l=="height"){s=o*t.structure_ratio}else{o=s/t.structure_ratio}t.wp=s;t.hp=o;t.x_scale=d3v7.scaleLinear().domain([n[0],n[1]]).range([r[1],s-r[3]]);t.y_scale=d3v7.scaleLinear().domain([i[0],i[1]]).range([o-r[2],r[0]]);e.style({height:t.height+"px",width:t.width+"px"});t.add_menu_bar();if(!this.use_jsmol)t.add_resizer();e.select("div.js-graph-div").remove();let c=null;if(!this.use_jsmol){t.graph_div=e.append("div").attr("class","js-graph-div").style({width:s+"px",height:o+"px",margin:"0 auto","margin-top":(t.height-o-r[0])/2+"px"});c=t.graph_div.append("svg:svg").attr("width","100%").attr("height","100%").append("svg:g")}return c};e.prototype.add_menu_bar=function(){const t=this;t.container.select("div.menubar").remove();const e=t.container.insert("div",":first-child").attr("class","menubar");t.button_toggle_H=e.append("div").attr("class","toggle-hydrogens menu-button button-on").style("width","60px").text("Show H").on("click",function(){t.toggleH();d3v7.event.stopPropagation()});t.button_toggle_numbers=e.append("div").attr("class","toggle-atom-ids menu-button button-on").text("Show #").style("width","60px").on("click",function(){t.toggleAtomNumbers();d3v7.event.stopPropagation()});let n="Click and drag to rotate the structure";t.feedback_div=e.append("p").attr("class","feedback").text(n);t.menu_buttons_width=t.button_toggle_numbers.offsetWidth+t.button_toggle_numbers.offsetWidth};e.prototype.add_resizer=function(){const t=this;const e=t.margins;const n=t.wp;const i=t.hp;const r=d3v7.select("body");t.resizer=t.container.append("div").attr("class","js-structure-resizer").on("mousedown.resizer",function(){let s=d3v7.event.x;let o=d3v7.event.y;d3v7.event.preventDefault();r.on("mousemove.resizer",function(){dx_mouse=d3v7.event.x-s;dy_mouse=d3v7.event.y-o;s=d3v7.event.x;o=d3v7.event.y;t.height=t.height+dy_mouse;t.width=t.width+dx_mouse;t.container.style({height:t.height+"px",width:t.width+"px"});const r=t.width/t.height;const a=r>=t.structure_ratio?"height":"width";let l;if(a=="height"){l=(t.height-e[0]-e[2])/i}else{l=(t.width-e[1]-e[3])/n}t.graph.attr("transform","scale("+l+","+l+")");const c=i*l;const u=(t.height-c-e[0])/2;t.graph_div.style({width:n*l+"px",height:i*l+"px","margin-top":u+"px"});t.menu_title.style("width",t.width-t.menu_buttons_width+"px");t.trigger("structure-resize")});r.on("mouseup.resizer",function(){r.on("mousemove.resizer",null);r.on("mouseup.resizer",null)})}).on("click.resizer",function(){d3v7.event.stopPropagation()});const s=[{x:9,y:4},{x:4,y:4},{x:4,y:9},{x:4,y:4},{x:16,y:16},{x:16,y:11},{x:16,y:16},{x:11,y:16}];const o=d3v7.svg.line().x(function(t){return t.x}).y(function(t){return t.y}).interpolate("linear");const a=t.resizer.append("svg").style({width:"100%",height:"100%"}).append("path").attr("d",o(s)).attr("stroke","grey").attr("stroke-width",1).attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("fill","none")};e.prototype.drawBonds=function(){const t=this;const e=this.graph;const i=this.x_scale;const r=this.y_scale;this.create_bond_functions();
492this.bonds().forEach(function(s){let o;let a;let l;let c;const u=s.a1;const h=s.a2;let f;const d=h.x-u.x,p=h.y-u.y,m=Math.sqrt(d*d+p*p),g=d/m*.2,_=p/m*.2;const v=u.x+g,y=u.y+_,b=h.x-g,x=h.y-_;t.avgL+=n(i(v),r(y),i(b),r(x));let w,k,S,M=[];if(s.order===1){if(s.stereo===1){const i=n(v,y,b,x);w=.1;k=w*(x-y)/i;S=w*(v-b)/i;M=[[v,y],[b+k,x+S],[b-k,x-S]];f=e.append("svg:path").style("fill","black").style("stroke-width",1).attr("d",t.wedgeBond(M))}else if(s.stereo===6){w=.2;k=w*(x-y)/m;S=w*(v-b)/m;o=b+k-v;a=x+S-y;l=b-k-v;c=x-S-y;for(let t=.05;t<=1;t+=.15){M.push([v+o*t,y+a*t],[v+l*t,y+c*t])}f=e.append("svg:path").style("fill","none").style("stroke-width",1).attr("d",t.hashBond(M)).attr("stroke","black")}else if(s.stereo===4){w=.2;k=w*(x-y)/m;S=w*(v-b)/m;o=b+k-v;a=x+S-y;l=b-k-v;c=x-S-y;for(let t=.05;t<=1;t+=.1){if(M.length%2===0){M.push([v+o*t,y+a*t])}else{M.push([v+l*t,y+c*t])}}f=e.append("svg:path").attr("d",t.wigglyBond(M)).attr("fill","none").style("stroke-width",1).attr("stroke","black")}else{M=[[v,y],[b,x]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}}else if(s.order===2){w=.1;k=w*(x-y)/m;S=w*(v-b)/m;M=[[v+k,y+S],[b+k,x+S],[v-k,y-S],[b-k,x-S]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").style("fill","none").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}else if(s.order===3){w=.15;k=w*(x-y)/m;S=w*(v-b)/m;M=[[v,y],[b,x],[v+k,y+S],[b+k,x+S],[v-k,y-S],[b-k,x-S]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}if(u.is("H")||h.is("H")){f.classed("bond-H",true)}});t.avgL/=this.bonds().length};e.prototype.drawAtoms=function(){const t=this.graph;const e=this.avgL;const n=this.x_scale;const i=this.y_scale;this.atoms().forEach(function(r){const s=t.append("svg:g").attr("transform","translate("+n(r.x)+","+i(r.y)+")");s.attr("class","atom");if((r.is("C")||r.is("N"))&&r.bonded_Hs().length>0){s.classed("nmr-1h",true)}if(r.is("C")){s.classed("nmr-13c",true)}if(r.is("H")){s.classed("atom-H",true);if(r.isBondedTo("C")||r.isBondedTo("N")){s.classed("nmr-1h",true)}}s.attr("data-atom-number",r.number);s.attr("data-atom-id",r.id);s.append("svg:circle").attr("r",Math.ceil(e/3)).attr("fill","white").attr("opacity","1");s.append("svg:circle").attr("r",Math.ceil(e/2)).attr("fill-opacity","0").attr("class","overlay");s.append("text").attr("dy",Math.ceil(e/4.5)).attr("text-anchor","middle").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/1.5)).attr("fill",r.color()).text(r.symbol);s.append("text").attr("dy",Math.ceil(e/2)+2).attr("text-anchor","middle").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/2.5)).attr("stroke","#FFF").attr("stroke-width","2px").attr("fill","#595").attr("paint-order","stroke").classed("atom-id",true).text(r.display_id);if(r.charge!==0){let t=r.charge;if(t<0){t=t===-1?"-":t+"-"}else{t=t===+1?"+":t+"+"}s.append("text").attr("dx",+1*Math.ceil(e/3)).attr("dy",-1*Math.ceil(e/4.5)).attr("text-anchor","left").attr("font-family","sans-serif").attr("fill",r.color()).attr("font-size",Math.ceil(e/3)).text(t)}if(r.mass!==0){s.append("text").attr("dx",-2*Math.ceil(e/3)).attr("dy",-1*Math.ceil(e/4.5)).attr("text-anchor","left").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/3)).attr("fill",r.color()).text(r.mass)}})};const n=function(t,e,n,i){return Math.sqrt((n-t)*(n-t)+(i-e)*(i-e))};e.prototype.create_bond_functions=function(){const t=this.x_scale;const e=this.y_scale;this.plainBond=d3v7.svg.line().interpolate(function(t){let e=t[0][0]+","+t[0][1];for(let n=1;n<t.length;n++){if(n%2===0){e+="M"+t[n][0]+","+t[n][1]}else{e+="L"+t[n][0]+","+t[n][1]}}return e}).x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.wedgeBond=d3v7.svg.line().x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.hashBond=d3v7.svg.line().interpolate(function(t){let e=t[0][0]+","+t[0][1];for(let n=1;n<t.length;n++){if(n%2===0){e+="M"+t[n][0]+","+t[n][1]}else{e+="L"+t[n][0]+","+t[n][1]}}return e}).x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.wigglyBond=d3v7.svg.line().interpolate("cardinal").x(function(e){return t(e[0])}).y(function(t){return e(t[1])})};AtomColors={H:"#000000",He:"#FFC0CB",Li:"#B22222",B:"#00FF00",C:"#000000",N:"#8F8FFF",O:"#F00000",F:"#DAA520",Na:"#0000FF",Mg:"#228B22",Al:"#808090",Si:"#DAA520",P:"#FFA500",S:"#FFC832",Cl:"#00FF00",Ca:"#808090",Ti:"#808090",Cr:"#808090",Mn:"#808090",Fe:"#FFA500",Ni:"#A52A2A",Cu:"#A52A2A",Zn:"#A52A2A",Br:"#A52A2A",Ag:"#808090",I:"#A020F0",Ba:"#FFA500",Au:"#DAA520"};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
492n.selectAll(".atom").classed("selected",false);t.forEach(function(t){n.select('.atom[data-atom-id="'+t.id+'"]').classed("selected",true)});e.add_partially_selected_highlighting(t)}}});e.prototype.add_partially_selected_highlighting=function(e){const n=this;const i=this.container;i.selectAll(".atom").classed("selected-partially",false);if(n.nmr_1H()){const r=n.hydrogens_from_atoms(e);let s=r.map(function(t){return t.bonded_atoms(1)});s=new t.SVSet(s).unique();s.forEach(function(t){let e=true;const n=t.bonded_Hs();n.forEach(function(t){if(!r.contains(t)){e=false}});if(!e){i.select('.atom[data-atom-id="'+t.id+'"]').classed("selected-partially",true)}})}};e.prototype.read_data=function(t,e){if(e=="mol"){this.read_mol(t)}else if(e=="nmrml"){this.read_nmrml(t)}else{console.log("Format not recognized: "+e+". Must be one of the following: nmrml, mol")}};e.prototype.read_nmrml=function(e){const n=this;if(!window.X2JS){console.log("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const s=new X2JS;const o=s.xml_str2json(e);this.data=e;this._atoms=new t.SVSet;this._bonds=new t.SVSet;if(!(o.structure&&o.structure.atomList&&o.structure.atomList.atom&&Array.isArray(o.structure.atomList.atom))){console.log("nmrML not formatted correctly: no atoms found");return}if(!(o.structure&&o.structure.bondList&&o.structure.bondList.bond&&Array.isArray(o.structure.bondList.bond))){console.log("nmrML not formatted correctly: no bonds found");return}o.structure.atomList.atom.forEach(function(t,e){const r=new i({id:t._id.replace(/\D/g,""),x:parseFloat(t._x),y:parseFloat(t._y),symbol:t._elementType,number:e+1});r.display_id=r.id;n._atoms.push(r)});
492o.structure.bondList.bond.forEach(function(t){const e=t._atomRefs.split(/\s+/);const i=n.atoms(e[0].replace(/\D/g,""));const s=n.atoms(e[1].replace(/\D/g,""));const o=new r({a1:i,a2:s,order:parseInt(t._order)});n._bonds.push(o);i._bonds.push(o);s._bonds.push(o);i._bonded_atoms.push(s);s._bonded_atoms.push(i)});if(this.use_jsmol)this.generate_molfile(o);n.draw()};e.prototype.generate_molfile=function(t){console.log("Generating molfile...");let e=this;let n=function(t){let e="  ";if(typeof t==="undefined"){e+="  0.0000"}else{t=parseFloat(t).toFixed(4);if(t>=0)e+=" ";if(Math.abs(t)<10)e+=" ";e+=`${t}`}return e};e.mol_file=`\nJSpectraViewer\n\n ${t.structure.atomList.atom.length} ${t.structure.bondList.bond.length} 0 0 0 0 0 0 0 0999 V2000`;t.structure.atomList.atom.forEach(function(t){e.mol_file+=`\n${n(t._x)}${n(t._y)}${n(t._z)}`;e.mol_file+=` ${t._elementType}   0  0  0  0  0  0  0  0  0  0  0  0`});t.structure.bondList.bond.forEach(function(t){let n=t._atomRefs.split(/\s+/);const i=parseInt(n[0].replace(/\D/g,""));const r=parseInt(n[1].replace(/\D/g,""));e.mol_file+=i<10?`\n  ${i}`:`\n ${i}`;e.mol_file+=r<10?`  ${r}`:` ${r}`;e.mol_file+=`  ${t._order}  0  0  0  0`});e.mol_file+="\nM  END";return};e.prototype.read_mol=function(e){let n;const s=this;const o=e.split(/\r\n|\n/),a=o[3].match(/\d+/g),l=parseFloat(a[0]),c=parseFloat(a[1]);const u=4;this.title=o[1];this.data=e;this._atoms=new t.SVSet;this._bonds=new t.SVSet;for(let t=u;t<l+u;t++){let e=o[t].match(/-*\d+\.\d+|\w+/g);e=new i({x:parseFloat(e[0]),y:parseFloat(e[1]),symbol:e[3],number:t-u+1,mass:0,charge:0});e.id=e.number;e.display_id=e.number;this._atoms.push(e)}for(let t=l+u;t<l+c+u;t++){let e=o[t].match(/\d+/g);const n=this.atoms(parseInt(e[0]));const i=this.atoms(parseInt(e[1]));e=new r({a1:n,a2:i,order:parseInt(e[2]),stereo:parseInt(e[3])});this._bonds.push(e);n._bonds.push(e);i._bonds.push(e);n._bonded_atoms.push(i);i._bonded_atoms.push(n)}for(let t=l+c+u;t<o.length;t++){if(o[t].indexOf("M  ISO")!==-1){n=o[t].match(/-*\d+/g);for(let t=0,e=1;t<n[0];t++,e+=2){this.atoms(n[e]).mass=parseInt(n[e+1],10)}}else if(o[t].indexOf("M  CHG")!==-1){n=o[t].match(/-*\d+/g);for(let t=0,e=1;t<n[0];t++,e+=2){atoms[n[e]-1].charge=parseInt(n[e+1],10);this.atoms(n[e]).charge=parseInt(n[e+1],10)}}}s.draw()};e.prototype.loadJsmolScript=function(t,e){let n=document.createElement("script");n.type="text/javascript";if(n.readyState){n.onreadystatechange=function(){if(n.readyState==="loaded"||n.readyState==="complete"){n.onreadystatechange=null;e()}}}else{n.onload=function(){e()}}n.src=t;document.getElementsByTagName("head")[0].appendChild(n)};e.prototype.atom_picked=function(){let e=window.sv;console.log("this",this,window);console.log("sv",e);let n=e.assignment_table;let i=this;console.log("atom_picked",i,this.structure,e);let r=arguments[2]+1;let s=new t.SVSet(i.atoms(r));let o=new t.SVSet;Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${r}; colour halos blue;`);let a=n.cluster_from_atoms(s);if(a){o=a.peaks();s=a.atoms()}e.selection._elements=o.unique();e.draw();n.selected_peaks=o;n.selected_atoms=i.LCA_from_nmr_atoms(s);
492n.table.selectAll("tbody tr").classed("selected",false);if(a){n.table.select("tbody tr[data-cluster-path-id="+a.path_id()+"]").classed("selected",true)}};e.prototype.run_jsmol=function(){let t=this.container;let e=parseFloat(t.style("width"))-10,n=parseFloat(t.style("height"))-30;let i="INLINE";let r=`labels off; select ${this.nmr_nucleus==="13C"?"carbon":"hydrogen"}; label %a;`;let s=this.show_hydrogen?"set showHydrogens TRUE;":"set showHydrogens FALSE;";let o="background white;";let a='set PickCallback "sv.structure.atom_picked";';let l=this.mol_file;let c={width:e,height:n,debug:false,color:"#EAF0F2",use:"HTML5",j2sPath:"/jsmol/j2s",multipleBondSpacing:.9,zoomlarge:true,allowJavaScript:true};c.script="load "+i+' "'+l+'"; color labels black; font labels 20; set antialiasDisplay; wireframe 15; spacefill 55; select carbon; halos on; colour halos grey;'+r+s+o+a;$("#view-3d").html(Jmol.getAppletHtml("jmol_jspectraviewer",c));this.atom_picked()};e.prototype.draw=function(){let t=this;this.graph=this.initSVG();this.avgL=0;if(!this.use_jsmol){this.drawBonds();this.drawAtoms();this.addInteractivity()}else{this.container.append("div").attr("id","view-3d").attr("style","position: relative; z-index: 0;");try{t.run_jsmol()}catch(e){t.loadJsmolScript("/jsmol/JSmol.min.js",function(){t.run_jsmol();t.initialize_jsmol_atom_picking()})}}this.toggleH(this.show_hydrogen);this.toggleAtomNumbers(this.show_atom_numbers)};e.prototype.initialize_jsmol_atom_picking=function(){};e.prototype.atoms=function(t){return this._atoms.get(t)};e.prototype.bonds=function(t){return this._bonds.get(t)};e.prototype.addInteractivity=function(){const t=this;const e=this.container;e.on("mouseenter",function(){e.selectAll(".atom").style("cursor","default");if(t.nmr_1H()){e.selectAll(".atom.nmr-1h").classed("highlight",true).style("cursor","pointer")}else if(t.nmr_13C()){e.selectAll(".atom.nmr-13c").classed("highlight",true).style("cursor","pointer")}});e.on("mouseleave",function(){e.selectAll(".atom").classed("highlight",false)});e.selectAll(".atom").on("click",function(){const e=d3v7.select(this).attr("data-atom-id");let n;if(e){n=t.atoms(e);if(t.nmr_1H()){t.select_clicked_atoms_for_1H_nmr(n,d3v7.event.shiftKey)}else if(t.nmr_13C()){t.select_clicked_atoms_for_13C_nmr(n,d3v7.event.shiftKey)}}t.trigger("structure-click");d3v7.event.stopPropagation()});e.on("click",function(){t.selected_atoms=[];t.trigger("structure-click")})};e.prototype.select_clicked_atoms_for_1H_nmr=function(e,n){const i=this;let r=this.selected_atoms;if(n){window.getSelection().removeAllRanges();if(r.contains(e)){if(e.is("H")){const t=e.bonded_atoms(1);r=r.remove(t).remove(e)}else{e.bonded_Hs().forEach(function(t){r=r.remove(t)});r=r.remove(e)}}else{r.push(e)}}else{r=new t.SVSet(e)}i.selected_atoms=r};e.prototype.select_clicked_atoms_for_13C_nmr=function(e,n){const i=this;let r=this.selected_atoms;if(n){window.getSelection().removeAllRanges();if(r.contains(e)){r=r.remove(e)}else{r.push(e)}}else{r=new t.SVSet(e)}i.selected_atoms=r};e.prototype.toggleH=function(t){this.show_hydrogen=t===undefined?!this.show_hydrogen:t;if(this.show_hydrogen){d3v7.selectAll(".atom-H, .bond-H").style("display","inline");this.button_toggle_H.classed("button-on",true);this.button_toggle_H.text("Hide H");if(typeof Jmol!=="undefined")Jmol.script(jmol_jspectraviewer,"select all; set showHydrogens TRUE;")}else{d3v7.selectAll(".atom-H, .bond-H").style("display","none");this.button_toggle_H.classed("button-on",false);this.button_toggle_H.text("Show H");if(typeof Jmol!=="undefined")Jmol.script(jmol_jspectraviewer,"select all; set showHydrogens FALSE;")}};e.prototype.toggleAtomNumbers=function(t){this.show_atom_numbers=t===undefined?!this.show_atom_numbers:t;if(this.show_atom_numbers){d3v7.selectAll(".atom-id").style("display","inline");this.button_toggle_numbers.classed("button-on",true);this.button_toggle_numbers.text("Hide #");if(typeof Jmol!=="undefined"){if(this.nmr_nucleus==="13C"){Jmol.script(jmol_jspectraviewer,"select carbon; labels %a;")}else{Jmol.script(jmol_jspectraviewer,"select hydrogen; labels %a;")}}}else{d3v7.selectAll(".atom-id").style("display","none");
492this.button_toggle_numbers.classed("button-on",false);this.button_toggle_numbers.text("Show #");if(typeof Jmol!=="undefined"){if(this.nmr_nucleus==="13C"){Jmol.script(jmol_jspectraviewer,"select carbon; labels %e;")}else{Jmol.script(jmol_jspectraviewer,"select hydrogen; labels %e;")}}}};e.prototype.addAtomDisplayIDs=function(){const e=this;const n=new t.SVSet(e.atoms().filter(function(t){return!t.is("H")}));n.each(function(){this.morgan_num=1});let i=new t.SVSet;let r=-1;while(r!=i.unique().length){r=i.unique().length;i=new t.SVSet;n.forEach(function(t){let e=0;t.bonded_atoms().each(function(){if(!this.is("H")){e+=this.morgan_num}});t.morgan_temp=e});n.forEach(function(t){t.morgan_num=t.morgan_temp;i.push(t.morgan_num)})}n.order_by("morgan_num",true);let s=n[0];let o=1;let a;while(s){s.display_id=o;let e=s.bonded_atoms().filter(function(t){return!t.is("H")&&t.display_id==undefined});e=new t.SVSet(e);if(e.length>0){a=e.order_by("morgan_num",true)[0]}else{a=n.find(function(t){return t.display_id==undefined})}s=a;o+=1}this.addHydrogenDisplayIDs()};e.prototype.addHydrogenDisplayIDs=function(){const t=["a","b","c","d"];this.atoms().forEach(function(e){if(e.is("H")){return}e.bonded_Hs().forEach(function(n,i){n.display_id=e.display_id+t[i]})})};e.prototype.hydrogens_from_atoms=function(e){const n=new t.SVSet;e.forEach(function(t){if(t.toString()==="Atom"){if(t.is("H")){n.push(t)}else{n.merge(t.bonded_Hs())}}});return n.unique()};e.prototype.nmr_atoms_from_atoms=function(e){const n=this;if(n.nmr_1H()){return n.hydrogens_from_atoms(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};e.prototype.LCA_from_hydrogens=function(e){const n=new t.SVSet;if(!e||e.empty()){return n}const i=this.hydrogens_from_atoms(e);let r=i.map(function(t){return t.bonded_atoms(1)});r=new t.SVSet(r).unique();r.forEach(function(e){let r=true;const s=new t.SVSet;const o=e.bonded_Hs();o.forEach(function(t){if(i.contains(t)){s.push(t)}else{r=false}});if(r){n.push(e)}else{n.merge(s)}});return n.unique()};e.prototype.LCA_from_nmr_atoms=function(e){const n=this;if(n.nmr_1H()){return n.hydrogens_from_atoms(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};e.prototype.LCA_and_hydrogens=function(t){const e=this.hydrogens_from_atoms(t);const n=this.LCA_from_hydrogens(t);return e.merge(n).unique()};e.prototype.LCA_and_nmr_atoms=function(e){const n=this;if(n.nmr_1H()){return n.LCA_and_hydrogens(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};function i(e){e=e||{};this.x=t.default_for(e.x,0);this.y=t.default_for(e.y,0);this.id=e.id;this.symbol=t.default_for(e.symbol,0);this.index=t.default_for(e.index,0);this.number=t.default_for(e.number,1);this.mass=t.default_for(e.mass,0);this.charge=t.default_for(e.charge,0);this._bonds=new t.SVSet;this._bonded_Hs=new t.SVSet;this._bonded_atoms=new t.SVSet}i.prototype.toString=function(){return"Atom"};i.prototype.bonds=function(t){return this._bonds.get(t)};i.prototype.bonded_atoms=function(t){return this._bonded_atoms.get(t)};i.prototype.bonded_Hs=function(e){const n=this.bonded_atoms().filter(function(t){return t.is("H")});return new t.SVSet(n)};i.prototype.is=function(t){return this.symbol==t};i.prototype.isBondedTo=function(t){return this.bonded_atoms().some(function(e){return e.symbol==t})};i.prototype.color=function(){return d3v7.rgb(AtomColors[this.symbol])};function r(e){e=e||{};this.a1=e.a1;this.a2=e.a2;this.order=t.default_for(e.order,1);this.stereo=t.default_for(e.stereo,0);this._atoms=new t.SVSet([this.a1,this.a2])}r.prototype.toString=function(){return"Bond"};r.prototype.atoms=function(t){return this._atoms.get(t)};t.SVStructure=e})(JSpectraViewer);(function(t){function e(e,n={}){const i=this;this.sv=e;this.struct=e.structure;this.container_id=n.container_id;this.container=d3v7.select(this.container_id);this.table=this.container.append("table").classed("jsv-assignment-table",true);this.nmr_nucleus=t.default_for(n.nmr_nucleus,"1H");if(!window.Sortable){console.log("Sortable needs to be installed to make peaks/atoms dragable: https://github.com/RubaXa/Sortable");this.sortable=false}this.add_sv_events();if(this.struct){this.add_struct_events()}this.edit_mode=n.edit_mode}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.get_columns=function(){const t=this;const e=t.struct;const n=d3v7.format(".2f");const i=function(t,n){let i="";if(t&&t.length>0){const n=e.LCA_from_nmr_atoms(t);i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id='"+t.id+"'>"+t.display_id+"</div>"}).join("")}else if(n&&n.length>0){i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id=''>"+t+"</div>"}).join("")}return i};
492const r=function(t,e){return"<div class='add-atoms-container'><a class='add-atoms jsv-btn' href='javascript:void(0)'>+</a><div>"};const s=function(t){return t.reverse().map(function(t){return"<span class='jsv-badge peak-badge' data-peak-id='"+t.path_id()+"'>"+n(t.center)+"</span>"}).join("")};const o=[{heading:"Row No.","class":"cluster-number center",html:function(t){return t.number}},{heading:"Cluster Midpoint","class":"center",html:function(t){return n(t.center)}},{heading:"No. Peaks","class":"center",html:function(t){return t.peak_num}},{heading:"Coupling Type","class":"center",html:function(t){return t.multiplet_type}},{heading:"No. H's","class":"center",html:function(t){return t.atoms.length}},{heading:"Atom No.","class":"atom-cell",html:function(t){return i(t.atoms,t.atom_refs)}},{heading:"","class":"add-atom-cell",html:function(t,e){return r(t.atoms,e)}},{heading:"Peak Centers (ppm)","class":"peak-cell",html:function(t){return s(t.peaks)}}];if(t.nmr_13C()){o[4].heading="No. C's"}if(!e){o.splice(4,3)}return o};e.prototype.update_table_header=function(){this.table.select("thead").remove();this.table.append("thead").append("tr").append("th").attr("class","center").attr("style","font-size: larger").attr("colspan",this.columns.length).text("Peak Assignment Table");this.table.select("thead").append("tr").selectAll("th").data(this.columns).enter().append("th").attr("class",function(t){return t["class"]}).text(function(t){return t.heading})};e.prototype.update_table=function(){const t=this;const e=this.struct;const n=this.table;const i=this.columns;rows=[];this.sv._cluster_navigation.static_compounds=this.sv.compounds();this.sv.clusters().each(function(t){row={path_id:this.path_id(),number:t+1,center:this.center(),peak_num:this.peaks().length,peaks:this.peaks(),multiplet_type:this.multiplet_type,atoms:this.atoms(),atom_refs:this.atom_refs};rows.push(row)});n.select("tbody").remove();if(rows.length>0){n.append("tbody").selectAll("tr").data(rows).enter().append("tr").attr("data-cluster-path-id",function(t){return t.path_id}).selectAll("td").data(function(t,e){return i.map(function(n){const i={};Object.keys(n).forEach(function(r){i[r]=typeof n[r]=="function"?n[r](t,e):n[r]});return i})}).enter().append("td").html(function(t){return t.html}).attr("class",function(t){return t["class"]})}else{n.append("tbody").append("tr").append("td").attr("colspan",i.length).style("text-align","center").html("No Clusters")}this.add_table_events();d3v7.selectAll(".atom-badge").each(function(){const t=d3v7.select(this);const n=e.atoms(t.text());if(n){t.classed("atom-badge-symbol-"+n.symbol,true)}});if(t.edit_mode){this.make_sortable()}else{n.selectAll(".add-atoms").style("display","none")}};e.prototype.make_sortable=function(){const e=this;const n=this.table;const i=this.struct;n.classed("editable",true);n.selectAll("tbody tr .atom-cell").each(function(){Sortable.create(this,{draggable:".atom-badge",group:"atoms",animation:150,ghostClass:"badge-ghost",onAdd:function(n){let r;const s=e.cluster_from_table_child(n.item);const o=e.cluster_from_table_child(n.from);const a=d3v7.select(n.item).attr("data-atom-id");if(a){r=i.atoms(a)}if(r&&s&&o){const n=i.nmr_atoms_from_atoms([r]);atoms=s.atoms().merge(n).unique();s._atoms=atoms;o._atoms=new t.SVSet(o._atoms.filter(function(t){return!n.contains(t)}));e.update_table()}e.select_peaks_and_atoms(e.selected_atoms)},onEnd:function(n){const r=d3v7.select(n.item).attr("data-atom-id");if(r){atom=i.atoms(r);e.selected_atoms=new t.SVSet(atom);e.select_peaks_and_atoms(e.selected_atoms)}}})});n.selectAll("tbody tr td.peak-cell").each(function(){Sortable.create(this,{draggable:".peak-badge",group:"peaks",animation:150,ghostClass:"badge-ghost",onAdd:function(t){let n;const i=e.cluster_from_table_child(t.item);const r=e.cluster_from_table_child(t.from);const s=d3v7.select(t.item).attr("data-peak-id");if(s){n=sv.peaks(s)}if(n&&i&&r){n["delete"]();i.add_peak(n);i.update();if(sv._cluster_navigation){sv._cluster_navigation.update_table()}e.update_table()}e.select_peaks_and_atoms(e.selected_peaks)},onEnd:function(n){const i=d3v7.select(n.item).attr("data-peak-id");if(i){peak=sv.peaks(i);e.selected_peaks=new t.SVSet(peak);e.select_peaks_and_atoms(e.selected_peaks)}}})})};e.prototype.add_table_events=function(){const e=this;const n=this.table;const i=this.sv;const r=this.struct;n.selectAll("tbody tr").on("click",function(){n.selectAll("tbody tr").classed("selected",fal
492se);d3v7.select(this).classed("selected",true);const t=d3v7.select(this).attr("data-cluster-path-id");const r=i.clusters(t);e.select_peaks_and_atoms(r);i.move_to_peaks(r.peaks(),i._cluster_navigation.speed,2)});n.selectAll("tbody .atom-badge").on("click",function(){let n=e.selected_atoms;const s=d3v7.select(this).attr("data-atom-id");const o=r.atoms(s);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(o)){n=n.remove(o)}else{n.push(o)}}else{n=new t.SVSet(o)}e.selected_atoms=n;e.select_peaks_and_atoms(e.selected_atoms);i.move_to_peaks(e.cluster_from_atoms(e.selected_atoms).peaks(),i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody .peak-badge").on("click",function(){let n=e.selected_peaks;const r=d3v7.select(this).attr("data-peak-id");const s=i.peaks(r);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(s)){n=n.remove(s)}else{n.push(s)}}else{n=new t.SVSet(s)}e.selected_peaks=n;e.select_peaks_and_atoms(e.selected_peaks);i.move_to_peaks(e.selected_peaks,i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody tr .add-atoms").on("click",function(){const t=e.cluster_from_table_child(this);if(t){t._atoms=r.nmr_atoms_from_atoms(r.selected_atoms)}d3v7.event.stopPropagation();e.update_table();e.select_peaks_and_atoms(t);return false})};e.prototype.add_sv_events=function(){const t=this;const e=t.struct;const n=t.sv;n.on("adjust-end.assign",function(){t.update_table();t.select_peaks_and_atoms(n.selection.peaks())});n.on("adjust-peak-created.assign",function(t){const n=t.cluster();if(n.peaks().length==1){n._atoms=e.nmr_atoms_from_atoms(e.selected_atoms)}});n.on("selection-add.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-remove.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-clear.assign",function(){t.select_peaks_and_atoms(undefined)})};e.prototype.add_struct_events=function(){const t=this;const e=this.struct;e.on("structure-click.assign",function(){e.selected_atoms=e.LCA_and_nmr_atoms(e.selected_atoms);t.select_peaks_and_atoms(e.selected_atoms)})};e.prototype.select_peaks_and_atoms=function(e){const n=this;const i=this.sv;const r=this.struct;const s=this.table;let o;let a=new t.SVSet;let l=new t.SVSet;if(e){if(e.toString()=="Cluster"){o=e}else if(e.toString()=="SVSet"||Array.isArray(e)){const t=e[0];if(t){if(e[0].toString()=="Atom"){l=e}else if(e[0].toString()=="Peak"){a=e}}}else{console.log("Unknown Selection")}}if(a.present()){o=this.cluster_from_peaks(a)}if(l.present()){o=this.cluster_from_atoms(l)}if(o){a=o.peaks();l=o.atoms()}if(r){if(r.use_jsmol&&typeof Jmol!=="undefined"){if(r.nmr_1H()){let t=r.LCA_from_hydrogens(l);Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${t[0].id.replace(/\D/g,"")}; colour halos blue;`)}else{Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${l[0].id.replace(/\D/g,"")}; colour halos blue;`)}}else{r.selected_atoms=r.LCA_and_nmr_atoms(l)}}i.selection._elements=a.unique();i.draw();n.selected_peaks=a;if(r){n.selected_atoms=r.LCA_from_nmr_atoms(l)}
492s.selectAll("tbody tr").classed("selected",false);if(o){s.select("tbody tr[data-cluster-path-id="+o.path_id()+"]").classed("selected",true)}};e.prototype.cluster_from_peaks=function(t){let e;this.sv.clusters().forEach(function(n){if(n.peaks().equals(t)){e=n}});return e};e.prototype.cluster_from_atoms=function(t){let e;const n=this.struct;const i=n.nmr_atoms_from_atoms(t);this.sv.clusters().forEach(function(t){const r=n.nmr_atoms_from_atoms(t.atoms());if(r.equals(i)){e=t}});return e};e.prototype.cluster_from_table_child=function(t){if(!t){return}let e;let n=false;let i=t;while(!n){localName=i.localName.toUpperCase();if(localName=="TR"){n=true;const t=d3v7.select(i).attr("data-cluster-path-id");if(t){e=this.sv.clusters(t)}}else if(localName=="TABLE"){n=true}else{i=i.parentNode;if(!i){n=true}}}return e};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom-badge.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.struct.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
492n.selectAll(".atom-badge").classed("selected",false);t.forEach(function(t){n.selectAll('.atom-badge[data-atom-id="'+t.id+'"]').classed("selected",true)})}},selected_peaks:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".peak-badge.selected").each(function(){const t=d3v7.select(this).attr("data-peak-id");n.push(e.sv.peaks(t))});return n},set:function(t){const e=this;const n=this.container
493;n.selectAll(".peak-badge").classed("selected",false);t.forEach(function(t){n.select('.peak-badge[data-peak-id="'+t.path_id()+'"]').classed("selected",true)})}},edit_mode:{get:function(){return this._edit_mode},set:function(t){const e=this;const n=e.sv;e._edit_mode=t;if(e._edit_mode){n.selection.element_type="peak";n.selection.allow_multiselect=true;n.selection.allow_adjust=true;n.selection.allow_width_adjust=true;n.selection.allow_peak_creation=true;if(n.highlight)n.highlight.element_type="peak"}else{n.selection.element_type="cluster";n.selection.allow_multiselect=true;n.selection.allow_adjust=false;n.selection.allow_width_adjust=false;n.selection.allow_peak_creation=false;if(n.highlight)n.highlight.element_type="cluster"}e.update_table();e.select_peaks_and_atoms(n.selection.peaks());n.draw()}},nmr_nucleus:{get:function(){return this._nmr_nucleus},set:function(t){this._nmr_nucleus=t;this.columns=this.get_columns();if(this.struct)this.struct.nmr_nucleus=t;this.update_table_header();this.update_table()}}});t.SVAssignments=e})(JSpectraViewer);(function(t){function e(t,e={}){const n=this;this.sv=t;this.struct=t.structure;this.container_id=e.container_id;this.container=d3v7.select(this.container_id);this.table=this.container.append("table").classed("jsv-assignment-table",true);this.nmr_nucleus="2D";if(!window.Sortable){console.log("Sortable needs to be installed to make peaks/atoms dragable: https://github.com/RubaXa/Sortable");this.sortable=false}this.add_sv_events();if(this.struct){this.add_struct_events()}this.edit_mode=e.edit_mode}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.get_columns=function(){const t=this;const e=t.struct;const n=d3v7.format(".2f");const i=function(t,n){let i="";if(t&&t.length>0){const n=e.LCA_from_nmr_atoms(t);i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id='"+t.id+"'>"+t.display_id+"</div>"}).join("")}else if(n&&n.length>0){i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id=''>"+t+"</div>"}).join("")}return i};const r=function(t,e){return"<div class='add-atoms-container'><a class='add-atoms jsv-btn' href='javascript:void(0)'>+</a><div>"};const s=function(t){return t.reverse().map(function(t){return"<span class='jsv-badge peak-badge' data-peak-id='"+t.path_id()+"'>"+n(t.center)+"</span>"}).join("")};const o=[{heading:"Row No.","class":"cluster-number center",html:function(t){return t.number}},{heading:"Dir. Dim. Center","class":"center",html:function(t){return n(t.peaks[0])}},{heading:"Indir. Dim. Center","class":"center",html:function(t){return n(t.peaks[1])}},{heading:"Coupling Type","class":"center",html:function(t){return t.multiplet_type}},{heading:"Dir. Dim. Atom No.","class":"atom-cell center",html:function(t){return i(t.atoms,t.dir_dim_atom_refs)}},{heading:"Indir. Dim. Atom No.","class":"atom-cell center",html:function(t){return i(t.atoms,t.indir_dim_atom_refs)}}];return o};e.prototype.update_table_header=function(){this.table.select("thead").remove();this.table.append("thead").append("tr").append("th").attr("class","center").attr("style","font-size: larger").attr("colspan",this.columns.length).text("Peak Assignment Table");this.table.select("thead").append("tr").selectAll("th").data(this.columns).enter().append("th").attr("class",function(t){return t["class"]}).text(function(t){return t.heading})};e.prototype.update_table=function(){const t=this;const e=this.struct;const n=this.table;const i=this.columns;rows=[];this.sv._cluster_navigation.static_compounds=this.sv.compounds();this.sv.clusters().each(function(t){row={path_id:this.path_id(),number:t+1,center:this.center(),peak_num:this.peaks().length,peaks:this.peaks(),multiplet_type:this.multiplet_type,atoms:this.atoms(),dir_dim_atom_refs:this.dir_dim_atom_refs(),indir_dim_atom_refs:this.indir_dim_atom_refs()};rows.push(row)});n.select("tbody").remove();if(rows.length>0){n.append("tbody").selectAll("tr").data(rows).enter().append("tr").attr("data-cluster-path-id",function(t){return t.path_id}).selectAll("td").data(function(t,e){return i.map(function(n){const i={};
493Object.keys(n).forEach(function(r){i[r]=typeof n[r]=="function"?n[r](t,e):n[r]});return i})}).enter().append("td").html(function(t){return t.html}).attr("class",function(t){return t["class"]})}else{n.append("tbody").append("tr").append("td").attr("colspan",i.length).style("text-align","center").html("No Clusters")}this.add_table_events();d3v7.selectAll(".atom-badge").each(function(){const t=d3v7.select(this);const n=e.atoms(t.text());if(n){t.classed("atom-badge-symbol-"+n.symbol,true)}});if(t.edit_mode){this.make_sortable()}else{n.selectAll(".add-atoms").style("display","none")}};e.prototype.make_sortable=function(){const e=this;const n=this.table;const i=this.struct;n.classed("editable",true);n.selectAll("tbody tr .atom-cell").each(function(){Sortable.create(this,{draggable:".atom-badge",group:"atoms",animation:150,ghostClass:"badge-ghost",onAdd:function(n){let r;const s=e.cluster_from_table_child(n.item);const o=e.cluster_from_table_child(n.from);const a=d3v7.select(n.item).attr("data-atom-id");if(a){r=i.atoms(a)}if(r&&s&&o){const n=i.nmr_atoms_from_atoms([r]);atoms=s.atoms().merge(n).unique();s._atoms=atoms;o._atoms=new t.SVSet(o._atoms.filter(function(t){return!n.contains(t)}));e.update_table()}e.select_peaks_and_atoms(e.selected_atoms)},onEnd:function(n){const r=d3v7.select(n.item).attr("data-atom-id");if(r){atom=i.atoms(r);e.selected_atoms=new t.SVSet(atom);e.select_peaks_and_atoms(e.selected_atoms)}}})});n.selectAll("tbody tr td.peak-cell").each(function(){Sortable.create(this,{draggable:".peak-badge",group:"peaks",animation:150,ghostClass:"badge-ghost",onAdd:function(t){let n;const i=e.cluster_from_table_child(t.item);const r=e.cluster_from_table_child(t.from);const s=d3v7.select(t.item).attr("data-peak-id");if(s){n=sv.peaks(s)}if(n&&i&&r){n["delete"]();i.add_peak(n);i.update();if(sv._cluster_navigation){sv._cluster_navigation.update_table()}e.update_table()}e.select_peaks_and_atoms(e.selected_peaks)},onEnd:function(n){const i=d3v7.select(n.item).attr("data-peak-id");if(i){peak=sv.peaks(i);e.selected_peaks=new t.SVSet(peak);e.select_peaks_and_atoms(e.selected_peaks)}}})})};e.prototype.add_table_events=function(){const e=this;const n=this.table;const i=this.sv;const r=this.struct;n.selectAll("tbody tr").on("click",function(){n.selectAll("tbody tr").classed("selected",fal
493se);d3v7.select(this).classed("selected",true);const t=d3v7.select(this).attr("data-cluster-path-id");const r=i.clusters(t);e.select_peaks_and_atoms(r);i.move_to_peaks(r.peaks(),i._cluster_navigation.speed,2)});n.selectAll("tbody .atom-badge").on("click",function(){let n=e.selected_atoms;const s=d3v7.select(this).attr("data-atom-id");const o=r.atoms(s);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(o)){n=n.remove(o)}else{n.push(o)}}else{n=new t.SVSet(o)}e.selected_atoms=n;e.select_peaks_and_atoms(e.selected_atoms);i.move_to_peaks(e.cluster_from_atoms(e.selected_atoms).peaks(),i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody .peak-badge").on("click",function(){let n=e.selected_peaks;const r=d3v7.select(this).attr("data-peak-id");const s=i.peaks(r);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(s)){n=n.remove(s)}else{n.push(s)}}else{n=new t.SVSet(s)}e.selected_peaks=n;e.select_peaks_and_atoms(e.selected_peaks);i.move_to_peaks(e.selected_peaks,i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody tr .add-atoms").on("click",function(){const t=e.cluster_from_table_child(this);if(t){t._atoms=r.nmr_atoms_from_atoms(r.selected_atoms)}d3v7.event.stopPropagation();e.update_table();e.select_peaks_and_atoms(t);return false})};e.prototype.add_sv_events=function(){const t=this;const e=t.struct;const n=t.sv;n.on("adjust-end.assign",function(){t.update_table();t.select_peaks_and_atoms(n.selection.peaks())});n.on("adjust-peak-created.assign",function(t){const n=t.cluster();if(n.peaks().length==1){n._atoms=e.nmr_atoms_from_atoms(e.selected_atoms)}});n.on("selection-add.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-remove.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-clear.assign",function(){t.select_peaks_and_atoms(undefined)})};e.prototype.add_struct_events=function(){const t=this;const e=this.struct;e.on("structure-click.assign",function(){e.selected_atoms=e.LCA_and_nmr_atoms(e.selected_atoms);t.select_peaks_and_atoms(e.selected_atoms)})};e.prototype.select_peaks_and_atoms=function(e){const n=this;const i=this.sv;const r=this.struct;const s=this.table;let o;let a=new t.SVSet;let l=new t.SVSet;if(e){if(e.toString()=="Cluster"){o=e}else if(e.toString()=="SVSet"||Array.isArray(e)){const t=e[0];if(t){if(e[0].toString()=="Atom"){l=e}else if(e[0].toString()=="Peak"){a=e}}}else{console.log("Unknown Selection")}}if(a.present()){o=this.cluster_from_peaks(a)}if(l.present()){o=this.cluster_from_atoms(l)}if(o){a=o.peaks();l=o.atoms()}if(r){if(r.use_jsmol&&typeof Jmol!=="undefined"){if(r.nmr_1H()){let t=r.LCA_from_hydrogens(l);Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${t[0].id.replace(/\D/g,"")}; colour halos blue;`)}else{Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${l[0].id.replace(/\D/g,"")}; colour halos blue;`)}}else{r.selected_atoms=r.LCA_and_nmr_atoms(l)}}i.selection._elements=a.unique();i.draw();n.selected_peaks=a;if(r){n.selected_atoms=r.LCA_from_nmr_atoms(l)}
493s.selectAll("tbody tr").classed("selected",false);if(o){s.select("tbody tr[data-cluster-path-id="+o.path_id()+"]").classed("selected",true)}};e.prototype.cluster_from_peaks=function(t){let e;this.sv.clusters().forEach(function(n){if(n.peaks().equals(t)){e=n}});return e};e.prototype.cluster_from_atoms=function(t){let e;const n=this.struct;const i=n.nmr_atoms_from_atoms(t);this.sv.clusters().forEach(function(t){const r=n.nmr_atoms_from_atoms(t.atoms());if(r.equals(i)){e=t}});return e};e.prototype.cluster_from_table_child=function(t){if(!t){return}let e;let n=false;let i=t;while(!n){localName=i.localName.toUpperCase();if(localName=="TR"){n=true;const t=d3v7.select(i).attr("data-cluster-path-id");if(t){e=this.sv.clusters(t)}}else if(localName=="TABLE"){n=true}else{i=i.parentNode;if(!i){n=true}}}return e};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom-badge.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.struct.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
493n.selectAll(".atom-badge").classed("selected",false);t.forEach(function(t){n.selectAll('.atom-badge[data-atom-id="'+t.id+'"]').classed("selected",true)})}},selected_peaks:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".peak-badge.selected").each(function(){const t=d3v7.select(this).attr("data-peak-id");n.push(e.sv.peaks(t))});return n},set:function(t){const e=this;const n=this.container;n.selectAll(".peak-badge").classed("selected",false);t.forEach(function(t){n.select('.peak-badge[data-peak-id="'+t.path_id()+'"]').classed("selected",true)})}},edit_mode:{get:function(){return this._edit_mode},set:function(t){const e=this;const n=e.sv;e._edit_mode=t;if(e._edit_mode){n.selection.element_type="peak";n.selection.allow_multiselect=true;n.selection.allow_adjust=true;n.selection.allow_width_adjust=true;n.selection.allow_peak_creation=true;if(n.highlight)n.highlight.element_type="peak"}else{n.selection.element_type="cluster";n.selection.allow_multiselect=true;n.selection.allow_adjust=false;n.selection.allow_width_adjust=false;n.selection.allow_peak_creation=false;if(n.highlight)n.highlight.element_type="cluster"}e.update_table();n.draw()}},nmr_nucleus:{get:function(){return this._nmr_nucleus},set:function(t){this._nmr_nucleus=t;this.columns=this.get_columns();if(this.struct)this.struct.nmr_nucleus=t;this.update_table_header();this.update_table()}}});t.SVAssignments2D=e})(JSpectraViewer);JSpectraViewer.initialize();$(document).ready(function(){const t=document.getElementById("file-selector");if(typeof t!=="undefined"&&t!=null){t.addEventListener("change",t=>{let e=$("#jspectradim").find(":selected").val();if(e=="2D"){var n=new JSV.SpectraViewer2D("#viewer",{debug:false,width:$("#viewer-container").width(),height:"800",zoom_min:.1,cluster_navigation_id:"#cluster-navigation",simplify_tolerance:.01,highlight:{restriction_spectrum_id:"Assignment",element_type:"peak",display:{fill:"rgba(238, 238, 255, 0.7)"},visible_only:false},assignment_table:{container_id:"#assignments",edit_mode:false}});n.flash("Loading...");const e=t.target.files;const i=new FileReader;i.onload=function(){nmrml=i.result;console.log(nmrml);n.add_nmrml_data(nmrml)};i.readAsText(e[0])}else if(e=="1D"){var i=new JSV.SpectraViewer("#viewer",{width:$("#viewer-container").width(),height:400,drag_drop_load:false,axis_y_show:true,axis_y_lock:.04,axis_x_title:"ppm",axis_y_title:"Intensity",cluster_navigation_id:"#cluster-navigation",simplify_tolerance:.01,min_boundaries:{x:[-1,10],y:[0,1.2]},highlight:{restriction_spectrum_id:"Assignment",element_type:"peak",display:{fill:"rgba(238, 238, 255, 0.7)"},visible_only:false},assignment_table:{container_id:"#assignments",edit_mode:false},select:{element_type:"peak",allow_multiselect:true,allow_adjust:false,allow_peak_creation:false,show_indicators:true,display:{fill:"rgba(208, 208, 255, 0.75)"}},structure:{container_id:"#structure",use_jsmol:true,show_atom_numbers:true,show_hydrogen:true,width:400,height:400}});i.flash("Loading...");const e=t.target.files;const n=new FileReader;n.onload=function(){nmrml=n.result;console.log("adding file data",nmrml);i.add_nmrml_data(nmrml);i.reset_boundaries()};n.readAsText(e[0])}})}});function submit_button_click(){$("#load-screen").show();$.ajax({complete:function(){$("#load-screen").hide()}})}function search_button_click(){$("#load-screen").show()}function submit_button_file_conversion(t){t.preventDefault();$("#load-screen").show();var e=t.target.closest("form");var n=new FormData(e);var i=new XMLHttpRequest;i.open(e.method,e.action,true);i.responseType="blob";i.onload=function(){if(this.status===200){var t=this.response;var e=getFileName(i)||"download.file";var n=document.createElement("a");n.href=window.URL.createObjectURL(t);n.download=e;document.body.appendChild(n);n.click();document.body.removeChild(n)}else{console.error("Request failed. Status:",this.status);alert("An error occurred. Please try again.")}$("#load-screen").hide()};i.onerror=function(){console.error("Request failed. Network error.");alert("A network error occurred. Please try again.");$("#load-screen").hide()};i.send(n)}function getFileName(t){var e="";var n=t.getResponseHeader("Content-Disposition");if(n&&n.indexOf("attachment")!==-1){var i=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;var r=i.exec(n);if(r!=null&&r[1]){e=r[1].replace(/['"]/g,"")}}return e}(function(){$(function(){return $("#test-tooltip").tooltip()})}).call(this);var mz_plot=function(t,e,n,i){const r=20;const s=40;const o=100;let a=250;i=typeof i!=="undefined"?i:{};const l=d3.select(t),c=l[0][0];l.attr("class","chart_container");l.attr("data-query-id",n);l.append("div").attr("class","y_axis_label").text("Relative Intensity");const u=l.append("div").attr("class","y_axis")[0][0],h=l.append("div").attr("class","chart")[0][0],f=l.append("div").attr("class","x_axis")[0][0];l.append("div").attr("class","x_axis_label").text("m/z");const d=function(){return c.offsetWidth-2*r-s};const p=function(t){let e;let n=t[0].y;for(e=0;e<t.length;e++){n=Math.max(n,t[e].y)}for(e=0;e<t.length;e++){t[e].y=t[e].y/n*o}return t};const m=function(t,e){return t.x<e.x?-1:t.x>e.x?1:0};e=p(e);e.sort(m);const g=o;let _=0;if(i.mirror){_=g*-1}let v=Number.MIN_VALUE;let y=Number.MAX_VALUE;for(let t=0;t<e.length;t++){y=Math.min(y,e[t].x);v=Math.max(v,e[t].x)}let b=[],x=[],w;if(window.compareCandidate&&window.compareCandidate){let t=p(window.compareCandidate["peak_list"]);for(let e=0;e<t.length;e++){y=Math.min(y,t[e].x);v=Math.max(v,t[e].x)}if(i.mirror){t=t.map(function(t){return{x:t.x,y:t.y*-1,structure_ids:t.structure_ids,structure_urls:t.structure_urls,scores:t.scores}});l.append("div").attr("class","input_spectra_label").text("Input Spectra");l.append("div").attr("class","candidate_spectra_label").text("Candidate Spectra")}w=[{color:"#E63434",data:t,name:window.compareCandidate.compound},{color:"#52B4FA",data:e}]}else{w=[{color:"#52B4FA",data:e}]}const k=d();if(i.mirror){a=a*2}const S=new Rickshaw.Graph({element:h,width:k,height:a,xmin:0,renderer:"linebar",name:"Predicted Spectra",series:w.map(function(t){t.data=t.data.sort(function(t,e){return t.x-e.x});return t})});S.xMin=i.xMin||0;S.xMax=i.xMax||v+10;S.yMin=i.yMin||(i.mirror?_-10:0);S.yMax=i.yMax||g+10;new Rickshaw.Graph.Axis.Y({graph:S,orientation:"left",tickFormat:Rickshaw.Fixtures.Number.formatKMBT,ticks:i.mirror?10:5,element:u,grid:true,height:a});new Rickshaw.Graph.Axis.X({graph:S,orientation:"bottom",element:f,grid:false});new Rickshaw.Graph.HoverDetail({graph:S,formatter:function(t,e,n,i,r,s){const o=s.value.structure_ids;let a="";let l="";if(o){const t=o[0];a="Fragment unknown<br>";if(t||t===0||s.value.structure_urls[0]){a='<img class="structure" src="'+s.value.structure_urls[0]+'" class="frag-structure" alt="Structure"><br>'}
493if(o.length>1){l=l.concat("<br>"+(o.length-1)+" other possible fragments.")}}let c;if(s.value.adduct_type){c='<div class="hover-box" style="width: 150px;">Adduct: '+s.value.adduct_type+"<br>m/z: "+e+"<br>intensity: "+n.toFixed(1).toString().replace("-","")+"</div>"}else{c='<div class="hover-box" style="width: 150px;">'+a+"m/z: "+e+"<br>intensity: "+n.toFixed(1).toString().replace("-","")+l+"</div>"}return c}});const M=function(){S.configure({width:d()});S.render()};const T=function(){S.configure({width:d()});S.series.splice(0,1);if(window.compareCandidate[t.substring(1)]){let e=p(window.compareCandidate[t.substring(1)]);if(i.mirror){e=e.map(function(t){return{x:t.x,y:t.y*-1,structure_ids:t.structure_ids,structure_urls:t.structure_urls,scores:t.scores}})}S.series.unshift({color:"#E63434",data:e,name:window.compareCandidate.compound});for(let t=0;t<e.length;t++){y=Math.min(S.xMin,e[t].x);v=Math.max(S.xMax,e[t].x)}S.xMin=y;S.xMax=v;window.data[t.substring(1)]=e.concat(S.series[1]);S.render()}};const C=function(){if(i.mirror){d3.selectAll("g.y_ticks text").html(function(){return $(this).html().replace("-","")});$("g.y_ticks g[transform='translate(0,"+a/2+")'] text").html("0");$("g[data-y-value=''] line").css("stroke-dasharray","none")}};window.addEventListener("resize",M);window.addEventListener("compare",T);S.render();C();S.onUpdate(C)};(function(){$(function(){return $(".nmr-preds-example-loader").click(function(t){var e,n;n=$(this).data("smiles");e=document.getElementsByTagName("iframe")[0];load_marvin_instance("#moldbi-new-draw").then(function(t){t.on("molchange",function(){return t.isEmpty().then(function(e){if(e===true){return $("#moldbi-structure-input").text("").trigger("change")}else{return t.exportStructure("smiles").then(function(t){return $("#moldbi-structure-input").text(t).trigger("change")},function(t){return alert("Molecule export failed:"+t)})}},function(t){return alert("Empty canvas check failed:"+t)})});t.importStructure("smiles",n);return e.remove()});$("#nmr_pred_nucleus").val("1H").change();return $("#nmr_pred_solvent").val("D2O").change()})});$(function(){if($("#new_nmr_pred").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for prediction.")}})}})}).call(this);(function(){var t,e;t={};window.bayesil=t;$(function(){var t,e,n;e=$(".filter-list").DataTable({scrollCollapse:true,scrollY:"300px",paging:false,destroy:true,columnDefs:[{targets:0,orderable:false}]});$("#custom-filter-list").on("shown.bs.modal",function(){return e.columns.adjust().draw()});$(".tool-tip").tooltip();$(".btn-disabled").on("click",function(){return false});$(".custom-filter-cancel").on("click",function(){return $("#custom-filter-list").modal("hide")});$("#custom-filter-save").on("click",function(){$("#custom-filter-list input:checkbox").each(function(){return $(this).data("checked-state",this.checked)});return $("#custom-filter-list").modal("hide")});$("#custom-filter-list").on("hide.bs.modal",function(){$("#custom-filter-list input:checkbox").each(function(){return $(this).prop("checked",$(this).data("checked-state"))});return check_custom_list_count()});$("#custom-filter-edit").on("click",function(){$("#custom-filter-list").modal("show");return false});$("#filter-button-all").on("click",function(){$("#custom-filter-list input:checkbox").prop("checked",true).change();return false});$("#filter-button-none").on("click",function(){$("#custom-filter-list input:checkbox").prop("checked",false).change();return false});$(".filter-button-select").on("click",function(){var t;t=$(this).data("hmdb-ids").split(",");$("#custom-filter-list input:checkbox").prop("checked",false).change();$.each(t,function(t,e){return $('#custom-filter-list input:checkbox[value="'+e+'"]').prop("checked",true).change()});return false});$("#custom-filter-list input:checkbox").on("change",function(){return update_custom_list_count()});$("#spectra-viewer-more-info").on("click",function(){if($(this).html()==="Less info..."){$(this).html("More info...");
493$("#spectra-viewer-instructions").slideUp("fast")}else{$(this).html("Less info...");$("#spectra-viewer-instructions").slideDown("fast")}return false});$("#advanced-link").on("click",function(){$("#advanced-section").slideToggle();return false});n=function(t,e,n){return $(t).each(function(){var i,r,s,o,a;e=new JSV.SpectraViewer(t,{width:$("main").width(),height:400,drag_drop_load:false,zoom_max:500,axis_y_show:true,axis_y_lock:.04,axis_x_title:"ppm",axis_y_title:"Intensity",axis_y_gutter:120,axis_x_gutter:80,x_tick_count:15,cluster_navigation_id:"#cluster-navigation",simplify_tolerance:.01,zoom_max:1e3,min_boundaries:{x:[0,1],y:[0,1.19]},highlight:{restriction_spectrum_id:"Assignment",element_type:"peak",display:{fill:"rgba(238, 238, 255, 0.7)"},visible_only:false}});window.SVr=e;s=function(t){if(e.spectra().empty()){e.clear()}e.flash("Loading...");return $.ajax({dataType:"json",url:t,success:function(t){if(t){e.add_bayesil_data(t);return e.draw()}}})};r=function(t){if(e.spectra().empty()){e.clear()}e.flash("Loading...");$("#jsv-phase").removeClass("btn-on");$("#phase-controls").slideUp("fast");return $.ajax({dataType:"text",url:t,success:function(t){var n,r;if(t){n=[e.scale.x.domain(),e.scale.y.domain()];r=e.spectra().length>0;e.remove_all_spectra();e.add_nmrml_data(t);e.reset_boundaries();e.annotation.visible=$("#jsv-show-labels").hasClass("btn-on");$(".jsv-cluster-navigator td:first").html("Multiplets");if(r){e.set_domain("x",n[0]);e.set_domain("y",n[1])}i.trigger("resize");return e.draw()}}})};o=n.search(".json");if(o>0){s(n)}else{r(n)}i=$(window);return a=$("#spectra-container")})};$(window).load(function(){return $("#spectra_list").each(function(){var t,e,i;t=$(this).data("spectra_list");i=[];e=[];return t.forEach(function(t,e){var i,r;r="SV"+e.toString();i="#spectra-viewer-r"+e.toString();return n(i,r,t)})})});t=$(window);return t.resize(function(){return $("#spectra_list").each(function(){var t;t=$(this).data("spectra_list");return t.forEach(function(t,e){var n,i;i="SV"+e.toString();n=$("main").width();return SVr.resize($("main").width()*.95,null,true)})})})});e=function(t){t.on("highlight-start",function(){var e;e=t.highlight.highlighted_element;return e.fill=e.color});t.on("selection-add",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=e.color)}return s});t.on("selection-remove",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=void 0)}return s});return t.on("selection-clear",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=void 0)}return s})};$.fn.mySlideToggle=function(t){if(t){return $(this).slideDown()}else{return $(this).slideUp()}}}).call(this);(function(){var t,e;t={};window.bayesil=t;$(function(){var t;t=$(".filter-list").DataTable({scrollCollapse:true,scrollY:"300px",paging:false,destroy:true,columnDefs:[{targets:0,orderable:false}]});$("#custom-filter-list").on("shown.bs.modal",function(){return t.columns.adjust().draw()});$(".tool-tip").tooltip();$(".btn-disabled").on("click",function(){return false});$(".custom-filter-cancel").on("click",function(){return $("#custom-filter-list").modal("hide")});$("#custom-filter-save").on("click",function(){$("#custom-filter-list input:checkbox").each(function(){return $(this).data("checked-state",this.checked)});return $("#custom-filter-list").modal("hide")});$("#custom-filter-list").on("hide.bs.modal",function(){$("#custom-filter-list input:checkbox").each(function(){return $(this).prop("checked",$(this).data("checked-state"))});return check_custom_list_count()});$("#custom-filter-edit").on("click",function(){$("#custom-filter-list").modal("show");return false});$("#filter-button-all").on("click",function(){$("#custom-filter-list input:checkbox").prop("checked",true).change();return false});$("#filter-button-none").on("click",function(){$("#custom-filter-list input:checkbox").prop("checked",false).change();return false});$(".filter-button-select").on("click",function(){var t;t=$(this).data("hmdb-ids").split(",");$("#custom-filter-list input:checkbox").prop("checked",false).change();$.each(t,function(t,e){return $('#custom-filter-list input:checkbox[value="'+e+'"]').prop("checked",true).change()});return false});$("#custom-filter-list input:checkbox").on("change",function(){return update_custom_list_count()});return $("#advanced-link").on("click",function(){$("#advanced-section").slideToggle();return false})});$(window).load(function(){var t,e;t=$(".panel#spectrum .panel-body").length!==0;e=t?$(".panel#spectrum .panel-body").width():$("#spectra-container").width();return $("#spectra-viewer").each(function(){var n,i,r,s,o,a,l,c,u,h,f,d,p;u=new JSV.SpectraViewer("#spectra-viewer",{width:e+50,height:400,drag_drop_load:false,zoom_max:500,axis_y_show:true,axis_y_lock:.04,axis_x_title:"ppm",axis_y_title:"Intensity",axis_y_gutter:120,axis_x_gutter:80,x_tick_count:15,cluster_navigation_id:"#cluster-navigation",simplify_tolerance:.01,zoom_max:1e3,min_boundaries:{x:[0,1],y:[-1,1.19]},highlight:{restriction_spectrum_id:"Assignment",element_type:"peak",display:{fill:"rgba(238, 238, 255, 0.7)"},visible_only:false},select:{element_type:"peak",allow_multiselect:true,allow_adjust:true,allow_width_adjust:true,allow_peak_creation:true,show_indicators:true,display:{fill:"rgba(208, 208, 255, 0.75)"}},structure:{container_id:"#structure",show_hydrogen:true,show_atom_numbers:true,use_jsmol:true,width:400,height:400},assignment_table:{container_id:"#assignments",edit_mode:false}});window.sv=u;a=$(this).data("spectra_path");s=function(t){if(u.spectra().empty()){u.clear()}u.flash("Loading...");return $.ajax({dataType:"json",url:t,success:function(t){if(t){u.add_bayesil_data(t);return u.draw()}}})};r=function(t){var e;if(u.spectra().empty()){u.clear()}e=d3.select("#spectra-viewer").attr("data-source");u.flash("Loading...");$("#jsv-phase").removeClass("btn-on");
493$("#phase-controls").slideUp("fast");return $.ajax({dataType:"text",url:t,success:function(t){var i,r;if(t){i=[u.scale.x.domain(),u.scale.y.domain()];r=u.spectra().length>0;u.remove_all_spectra();u.add_nmrml_data(t,e);u.annotation.visible=$("#jsv-show-labels").hasClass("btn-on");$(".jsv-cluster-navigator td:first").html("Multiplets");n.trigger("resize");u.reset_boundaries();return u.draw()}}})};l=a.search(".json");if(l>0){s(a)}else{r(a)}n=$(window);f=$("#spectra-container");h=$("#spectra-anchor");d=$("#main-nav").height();p=f.offset().top;o=f.height()+d+30;e=t?$(".panel#spectrum .panel-body").width()-1:$("#spectra-container").width();c=$("#structure").width();i=e-c-4;$("#cluster-navigation").width(i-2);$("#assignments").width(i);n.resize(function(){e=t?$(".panel#spectrum .panel-body").width()-1:$("#spectra-container").width();c=$("#structure").width();u.resize(e,null,true);$("#spectra-header").width(e);$("#spectra-controls").width($("main").width());$("#spectrum-message-section").width($("main").width());i=e-c-4;$("#assignments").width(i);$("#cluster-navigation").width(i-2);if($("#assignment-help").offset().left<50){$("#assignment-help").width(e)}else{$("#assignment-help").width(i)}if(n.height()<=o){$("#lock-viewer").addClass("disabled");$("#lock-viewer").html($("#lock-viewer").data("off-name"));$("#lock-viewer").removeClass("btn-on");return n.scroll()}else{return $("#lock-viewer").removeClass("disabled")}});return u.structure.on("structure-resize",function(){e=e=t?$(".panel#spectrum .panel-body").width():$("#spectra-container").width();c=$("#structure").width();i=e-c-4;$("#assignments").width(i);$("#cluster-navigation").width(i-2);if($("#assignment-help").offset().left<50){return $("#assignment-help").width(e)}else{return $("#assignment-help").width(i)}})})});e=function(t){t.on("highlight-start",function(){var e;e=t.highlight.highlighted_element;return e.fill=e.color});t.on("selection-add",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=e.color)}return s});t.on("selection-remove",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=void 0)}return s});return t.on("selection-clear",function(){var e,n,i,r,s;n=t.selection.compounds();s=[];for(i=0,r=n.length;i<r;i++){e=n[i];s.push(e.fill=void 0)}return s})};$.fn.mySlideToggle=function(t){if(t){return $(this).slideDown()}else{return $(this).slideUp()}};$(window).load(function(){return $("#spectra-viewer-2d").each(function(){var t,e,n,i;e=$(this);n=e.data("spectra_data");i=new JSV.SpectraViewer2D("#spectra-viewer-2d",{debug:false,width:e.parent().width(),height:"800"});i.flash("Loading...");$.ajax({dataType:"text",url:n,success:function(t){if(t){return i.add_nmrml_data(t)}}});t=$(window);return t.resize(function(){var t,n,r;n=e.parent().width()-1;r=$("#structure").width();t=n-r-4;i.resize(n,null,true);return i.draw()})})})}).call(this);(function(){$(function(){return $(".reference-icon-link").tooltip()});$(function(){return $(".tips").tooltip()});$(function(){$(".datatable").dataTable();$(".dataTables_filter label").each(function(){var t;t=$(this).find("input").clone(true);$(this).html("");return t.appendTo($(this))});return $(".dataTables_filter input").attr("placeholder","Search")});$(function(){return $("table").tooltip()});$(function(){return $(document).on("hidden.bs.modal",function(t){return $(t.target).removeData("bs.modal")})});$(function(){$("#load-screen").show();$(window).resize(function(){if($(".link-bar.one .link-text").length){$(".link-bar.one .link-text").quickfit({max:"60",tolerance:.46});$(".link-bar.two .link-text").css("font-size",$(".link-bar.one .link-text").css("font-size"));return $(".link-bar.three .link-text").css("font-size",$(".link-bar.one .link-text").css("font-size"))}});$(window).load(function(){if($(".link-bar.one .link-text").length){$(".link-bar.one .link-text").quickfit({max:"60",tolerance:.46});$(".link-bar.two .link-text").css("font-size",$(".link-bar.one .link-text").css("font-size"));$(".link-bar.three .link-text").css("font-size",$(".link-bar.one .link-text").css("font-size"))}$(".link-bar.one").animate({right:"0%"},2e3);$(".link-bar.two").animate({right:"0%"},2e3);$(".link-bar.three").animate({right:"0%"},2e3);return $("#load-screen").hide()});$("a").filter(function(){return this.href.match(/natural_products$/)}).addClass("show-loader");$("a").filter(function(){return this.href.match(/natural_products\/NP\d{7}$/)}).addClass("show-loader");$(".show-loader").click(function(t){if(!t.metaKey){return $("#load-screen").show()}});return window.onpageshow=function(t){if(t.persisted){return $("#load-screen").hide()}}});$(function(){$(".met-desc").readmore({moreLink:'<a href="#" style="text-align:right;padding-right:10px;font-weight:bold;text-decoration:none;">Read more...</a>',lessLink:'<a href="#" style="text-align:right;padding-right:10px;font-weight:bold;text-decoration:none;">Close</a>',speed:1e3,collapsedHeight:150,heightMargin:150});$(".data-table-container").readmore({
494moreLink:'<a href="#" style="text-align:center;font-weight:bold;text-decoration:none;">Show more...</a>',lessLink:'<a href="#" style="text-align:center;font-weight:bold;text-decoration:none;">Close</a>',speed:1e3,collapsedHeight:200,heightMargin:200});return $(".acc-num").readmore({moreLink:'<a href="#" style="padding-left:10px;font-weight:bold;text-decoration:none;">Show more accession numbers</a>',lessLink:'<a href="#" style="padding-left:10px;font-weight:bold;text-decoration:none;">Close</a>',speed:1e3,collapsedHeight:100})});$(function(){return $(".comment-icon").tooltip()});$(function(){return $(".natural-products > tbody > tr > td:last-child > table").readmore({moreLink:'<a href="#" style="text-align:left;font-weight:bold;text-decoration:none;">Show more...</a>',lessLink:'<a href="#" style="text-align:left;font-weight:bold;text-decoration:none;">Close</a>',speed:1e3,collapsedHeight:100})});window.showMore=function(t,e,n){$("#"+t).hide();$("#"+e).show();$("."+n).css("display","table-row");return false};window.showLess=function(t,e,n){$("#"+t).show();$("#"+e).hide();$("."+n).css("display","none");return false};$(function(){$("#chemical_shift_genus").hide();$("#chemical_shift_species").hide();return $("#chemical_shift_provenance").change(function(t){var e;e=$("#chemical_shift_provenance").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){$("#chemical_shift_genus").show();return $("#chemical_shift_species").show()}else{$("#chemical_shift_genus").hide();return $("#chemical_shift_species").hide()}})});$(function(){console.log("Starting");if(!($("#chemical_shift_provenance_verification").val()==="Other"||$("#chemical_shift_provenance_verification").val()==="Biotransformation"||$("#chemical_shift_provenance_verification").val==="Chemical synthesis")){console.log("INSIDE Verifciaton");$("#chemical_shift_genus_verification").show()}else{console.log("INSIDE Verifciaton hide");$("#chemical_shift_genus_verification").hide()}return $("#chemical_shift_provenance_verification").change(function(t){var e;e=$("#chemical_shift_provenance_verification").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){return $("#chemical_shift_genus_verification").show()}else{return $("#chemical_shift_genus_verification").hide()}})});$(function(){console.log("Starting");if(!($("#chemical_shift_provenance_edit").val()==="Other"||$("#chemical_shift_provenance_edit").val()==="Biotransformation"||$("#chemical_shift_provenance_edit").val()==="Chemical synthesis")){$("#chemical_shift_genus_edit").show();$("#chemical_shift_species_edit").show()}else{$("#chemical_shift_genus_edit").hide();$("#chemical_shift_species_edit").hide()}return $("#chemical_shift_provenance_edit").change(function(t){var e;e=$("#chemical_shift_provenance_edit").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){$("#chemical_shift_genus_edit").show();return $("#chemical_shift_species_edit").show()}else{$("#chemical_shift_genus_edit").hide();return $("#chemical_shift_species_edit").hide()}})});$(function(){$("#submission_genus").hide();$("#submission_species").hide();return $("#submission_provenance").change(function(t){var e;e=$("#submission_provenance").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){$("#submission_genus").show();return $("#submission_species").show()}else{$("#submission_genus").hide();return $("#submission_species").hide()}})});$(function(){console.log("Starting");if(!($("#submission_provenance_verification").val()==="Other"||$("#submission_provenance_verification").val()==="Biotransformation"||$("#submission_provenance_verification").val==="Chemical synthesis")){console.log("INSIDE Verifciaton");$("#submission_genus_verification").show()}else{console.log("INSIDE Verifciaton hide");$("#submission_genus_verification").hide()}return $("#submission_provenance_verification").change(function(t){var e;e=$("#submission_provenance_verification").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){return $("#submission_genus_verification").show()}else{return $("#submission_genus_verification").hide()}})});$(function(){console.log("Starting");if(!($("#submission_provenance_edit").val()==="Other"||$("#submission_provenance_edit").val()==="Biotransformation"||$("#submission_provenance_edit").val()==="Chemical synthesis")){$("#submission_genus_edit").show();$("#submission_species_edit").show()}else{$("#submission_genus_edit").hide();$("#submission_species_edit").hide()}return $("#submission_provenance_edit").change(function(t){var e;e=$("#submission_provenance_edit").val();if(!(e==="Other"||e==="Biotransformation"||e==="Chemical synthesis")){$("#submission_genus_edit").show();return $("#submission_species_edit").show()}else{$("#submission_genus_edit").hide();return $("#submission_species_edit").hide()}})});$(function(){return $("body").on("click","a[data-popup]",function(t){window.open($(this).attr("href"),"Popup","height=600, width=1000");t.preventDefault()})});$(function(){$("body").on("click","button[close-window]",function(t){return window.close()})});$(function(){if($(".lit-text").length===0){return}$(".lit-text").get(0).oninput=function(t){return t.target.setCustomValidity("")};return $(".lit-type").change(function(t){var e,n,i;n=$(".lit-type").val();e="";if(n==="DOI"){$(".lit-text").get(0).pattern="10.\\d{4}.+";i=$(".lit-text").get(0).pattern;e="Please provide a valid DOI"}else if(n==="PMID"){$(".lit-text").get(0).pattern="\\d{7,8}";e="Please provide a valid PMID";i=$(".lit-text").get(0).pattern}else if(n==="Unpublished / Under Review"){$(".lit-text").get(0).value="Unpublished / Under Review";$(".lit-text").prop("disabled",true);return}else{$(".lit-text").pattern=".*"}if($(".lit-text").get(0).value==="Unpublished / Under Review"||$(".lit-text").get(0).value==="Unpublished/Under Review"){$(".lit-text").get(0).value=""}
494$(".lit-text").prop("disabled",false);$(".lit-text").get(0).title=e;return $(".lit-text").get(0).oninvalid=function(t){return t.target.setCustomValidity(e)}})});$(function(){if($("#3d-btn").length!==0){return $('.structure-links > .btn-group a:last-child:not("#3d-btn"):not("#fs-jsmol")').addClass("no-radius")}});$(function(){$('[data-toggle="tooltip"]').tooltip()});$(function(){return $(".species-table").each(function(){var t;t=$(this).data("species_id");return $(this).dataTable({processing:true,serverSide:true,ajax:{url:"/species/"+t+".json"},columns:[{data:"np_links",className:"natural-product-links",render:function(t){return'<a class="btn-card show-loader" href="/natural_products/'+t["np_mrd_id"]+'">'+t["np_mrd_id"]+'</a><div class="cas">'+t["cas"]+"</div>"}},{data:"structure_image",className:"natural-product-structure"},{data:"name",className:"natural-product-name"},{data:"formula",className:"natural-product-formula"}],columnDefs:{targets:1,orderable:false},pageLength:5,lengthMenu:[5,10,25,50,100]})})});$(function(){if($("button[name='filter']").length!==0){return $("button[name='filter']").click(function(){return $("#load-screen").show()})}});$(function(){return $(document).ready(function(){return $("#load-screen").hide()})});$(function(){return $(document).ready(function(){return $("body").on("click.scroll-adjust",'[href^="#"]',function(t){var e,n;if(t&&t.isDefaultPrevented()){return}n=$("nav.navbar");e=$("div#jumper.natural_product");if(e.length!==0){console.log("Jump");if(e.css("position")!=="fixed"){$(window).one("scroll",function(){return window.scrollBy(0,-(e.outerHeight()+2*n.height()))});return}$(window).one("scroll",function(){window.scrollBy(0,-e.outerHeight())})}else{if(n.css("position")!=="fixed"){return}$(window).one("scroll",function(){window.scrollBy(0,-n.height())})}})})})}).call(this);function toggleVisibility(){if($(".show-hide-password input").attr("type")==="text"){$(".show-hide-password input").attr("type","password");
494$(".show-hide-password span").addClass("glyphicon-eye-open");$(".show-hide-password span").removeClass("glyphicon-eye-close")}else if($(".show-hide-password input").attr("type")==="password"){$(".show-hide-password input").attr("type","text");$(".show-hide-password span").removeClass("glyphicon-eye-open");$(".show-hide-password span").addClass("glyphicon-eye-close")}}(function(){$(function(){if($("#new_spin_matirx").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for deposition.")}})}})}).call(this);(function(){$(function(){if($("#new_spin_matirx").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for deposition.")}})}})}).call(this);(function(){$(function(){if($("#new_submission").length){$("#moldbi-structure-input").prop("required",true);return $('[type="submit"]').click(function(t){if(!$("#moldbi-structure-input").val()){return alert("Please add a structure for deposition.")}})}});$(function(){return $("#manual-index-table").DataTable({pageLength:10,ordering:false})});$(function(){return $("#basic-index-table").DataTable({pageLength:10,ordering:false})})}).call(this);(function(t){var e=0;var n=function(){return(new Date).getTime()+e++};var i=function(t){return"["+t+"]$1"};var r=function(t){return"_"+t+"_$1"};var s=function(e,n,i){if(!e){return i.parent()}if(typeof e=="function"){if(n){console.warn("association-insertion-traversal is ignored, because association-insertion-node is given as a function.")}return e(i)}if(typeof e=="string"){if(n){return i[n](e)}else{return e=="this"?i:t(e)}}};t(document).on("click",".add_fields",function(e){e.preventDefault();e.stopPropagation();var o=t(this),a=o.data("association"),l=o.data("associations"),c=o.data("association-insertion-template"),u=o.data("association-insertion-method")||o.data("association-insertion-position")||"before",h=o.data("association-insertion-node"),f=o.data("association-insertion-traversal"),d=parseInt(o.data("count"),10),p=new RegExp("\\[new_"+a+"\\](.*?\\s)","g"),m=new RegExp("_new_"+a+"_(\\w*)","g"),g=n(),_=c.replace(p,i(g)),v=[],y=e;if(_==c){p=new RegExp("\\[new_"+l+"\\](.*?\\s)","g");m=new RegExp("_new_"+l+"_(\\w*)","g");_=c.replace(p,i(g))}_=_.replace(m,r(g));v=[_];d=isNaN(d)?1:Math.max(d,1);d-=1;while(d){g=n();_=c.replace(p,i(g));_=_.replace(m,r(g));v.push(_);d-=1}var b=s(h,f,o);if(!b||b.length==0){console.warn("Couldn't find the element to insert the template. Make sure your `data-association-insertion-*` on `link_to_add_association` is correct.")}t.each(v,function(e,n){var i=t(n);var r=jQuery.Event("cocoon:before-insert");b.trigger(r,[i,y]);if(!r.isDefaultPrevented()){var s=b[u](i);b.trigger("cocoon:after-insert",[i,y])}})});t(document).on("click",".remove_fields.dynamic, .remove_fields.existing",function(e){var n=t(this),i=n.data("wrapper-class")||"nested-fields",r=n.closest("."+i),s=r.parent(),o=e;e.preventDefault();e.stopPropagation();var a=jQuery.Event("cocoon:before-remove");s.trigger(a,[r,o]);if(!a.isDefaultPrevented()){var l=s.data("remove-timeout")||0;setTimeout(function(){if(n.hasClass("dynamic")){r.detach()}else{n.prev("input[type=hidden]").val("1");r.hide()}s.trigger("cocoon:after-remove",[r,o])},l)}});t(document).on("ready page:load turbolinks:load",function(){t(".remove_fields.existing.destroyed").each(function(e,n){var i=t(this),r=i.data("wrapper-class")||"nested-fields";i.closest("."+r).hide()})})})(jQuery);(function(t,e){"use strict";t.ajaxPrefilter(function(t,e,n){if(t.iframe){t.originalURL=t.url;return"iframe"}});t.ajaxTransport("iframe",function(e,n,i){var r=null,s=null,o="iframe-"+t.now(),a=t(e.files).filter(":file:enabled"),l=null,c=null;function u(){a.each(function(e,n){var i=t(n);i.data("clone").replaceWith(i)});r.remove();s.one("load",function(){s.remove()});s.attr("src","about:blank")}e.dataTypes.shift();e.data=n.data;if(a.length){r=t("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:e.originalURL,target:o});if(typeof e.data==="string"&&e.data.length>0){t.error("data must not be serialized")}t.each(e.data||{},function(e,n){if(t.isPlainObject(n)){e=n.name;n=n.value}t("<input type='hidden' />").attr({name:e,value:n}).appendTo(r)});t("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(r);if(e.dataTypes[0]&&e.accepts[e.dataTypes[0]]){c=e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":"")}else{c=e.accepts["*"]}t("<input type='hidden' name='X-HTTP-Accept'>").attr("value",c).appendTo(r);l=a.after(function(e){var n=t(this),i=n.clone().prop("disabled",true);n.data("clone",i);return i}).next();a.appendTo(r);return{send:function(e,n){s=t("<iframe src='about:blank' name='"+o+"' id='"+o+"' style='display:none'></iframe>");s.one("load",function(){s.one("load",function(){var t=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,e=t.documentElement?t.documentElement:t.body,r=e.getElementsByTagName("textarea")[0],s=r&&r.getAttribute("data-type")||null,o=r&&r.getAttribute("data-status")||200,a=r&&r.getAttribute("data-statusText")||"OK",l={text:s?r.value:e?e.textContent||e.innerText:null};u();if(!i.responseText){i.responseText=l.text}n(o,a,l,s?"Content-Type: "+s:null)});r[0].submit()});t("body").append(r,s)},abort:function(){if(s!==null){s.unbind("load").attr("src","about:blank");u()}}}}})})(jQuery);(function(t){var e;t.remotipart=e={setup:function(n){var i=n.data("ujs:submit-button"),r=t('meta[name="csrf-param"]').attr("content"),s=t('meta[name="csrf-token"]').attr("content"),o=n.find('input[name="'+r+'"]').length;n.one("ajax:beforeSend.remotipart",function(a,l,c){delete c.beforeSend;c.iframe=true;c.files=t(t.rails.fileInputSelector,n);c.data=n.serializeArray();if(i)c.data.push(i);c.files.each(function(t,e){for(var n=c.data.length-1;n>=0;n--)if(c.data[n].name==e.name)c.data.splice(n,1)});c.processData=false;if(c.dataType===undefined){c.dataType="script *"}c.data.push({name:"remotipart_submitted",value:true});if(s&&r&&!o){c.data.push({name:r,value:s})}if(t.rails.fire(n,"ajax:remotipartSubmit",[l,c])){t.rails.ajax(c).al
494ways(function(e){t.rails.fire(n,"ajax:remotipartComplete",[e])});setTimeout(function(){t.rails.disableFormElements(n)},20)}e.teardown(n);return false}).data("remotipartSubmitted",true)},teardown:function(t){t.unbind("ajax:beforeSend.remotipart").removeData("remotipartSubmitted")}};t(document).on("ajax:aborted:file","form",function(){var n=t(this);e.setup(n);t.rails.handleRemote(n);return false})})(jQuery);
495/*! DataTables 1.10.9
496 * ©2008-2015 SpryMedia Ltd - datatables.net/license
497 */
498/**
499 * @summary     DataTables
500 * @description Paginate, search and order HTML tables
501 * @version     1.10.9
502 * @file        jquery.dataTables.js
503 * @author      SpryMedia Ltd (www.sprymedia.co.uk)
504 * @contact     www.sprymedia.co.uk/contact
505 * @copyright   Copyright 2008-2015 SpryMedia Ltd.
506 *
507 * This source file is free software, available under the following license:
508 *   MIT license - http://datatables.net/license
509 *
510 * This source file is distributed in the hope that it will be useful, but
511 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
512 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
513 *
514 * For details please refer to: http://www.datatables.net
515 */
516/*! DataTables 1.10.9
517 * ©2008-2015 SpryMedia Ltd - datatables.net/license
518 */
519/**
520 * @summary     DataTables
521 * @description Paginate, search and order HTML tables
522 * @version     1.10.9
523 * @file        jquery.dataTables.js
524 * @author      SpryMedia Ltd (www.sprymedia.co.uk)
525 * @contact     www.sprymedia.co.uk/contact
526 * @copyright   Copyright 2008-2015 SpryMedia Ltd.
527 *
528 * This source file is free software, available under the following license:
529 *   MIT license - http://datatables.net/license
530 *
531 * This source file is distributed in the hope that it will be useful, but
532 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
533 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
534 *
535 * For details please refer to: http://www.datatables.net
536 */
537(function(t,e,n){(function(t){"use strict";if(typeof define==="function"&&define.amd){define("datatables",["jquery"],t)}else if(typeof exports==="object"){module.exports=t(require("jquery"))}else if(jQuery&&!jQuery.fn.dataTable){t(jQuery)}})(function(i){"use strict";var r;var s;var o;var a;var l;var c={};var u=/[\r\n]/g;var h=/<.*?>/g;var f=/^[\w\+\-]/;var d=/[\w\+\-]$/;var p=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g");var m=/[',$\xa3\u20ac\xa5%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi;var g=function(t){return!t||t===true||t==="-"?true:false};var _=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null};var v=function(t,e){if(!c[e]){c[e]=new RegExp(Ct(e),"g")}return typeof t==="string"&&e!=="."?t.replace(/\./g,"").replace(c[e],"."):t};var y=function(t,e,n){var i=typeof t==="string";if(g(t)){return true}if(e&&i){t=v(t,e)}if(n&&i){t=t.replace(m,"")}return!isNaN(parseFloat(t))&&isFinite(t)};var b=function(t){return g(t)||typeof t==="string"};var x=function(t,e,n){if(g(t)){return true}var i=b(t);return!i?null:y(T(t),e,n)?true:null};var w=function(t,e,i){var r=[];var s=0,o=t.length;if(i!==n){for(;s<o;s++){if(t[s]&&t[s][e]){r.push(t[s][e][i])}}}else{for(;s<o;s++){if(t[s]){r.push(t[s][e])}}}return r};var k=function(t,e,i,r){var s=[];var o=0,a=e.length;if(r!==n){for(;o<a;o++){if(t[e[o]][i]){s.push(t[e[o]][i][r])}}}else{for(;o<a;o++){s.push(t[e[o]][i])}}return s};var S=function(t,e){var i=[];var r;if(e===n){e=0;r=t}else{r=e;e=t}for(var s=e;s<r;s++){i.push(s)}return i};var M=function(t){var e=[];for(var n=0,i=t.length;n<i;n++){if(t[n]){e.push(t[n])}}return e};var T=function(t){return t.replace(h,"")};var C=function(t){var e=[],n,i,r=t.length,s,o=0;t:for(i=0;i<r;i++){n=t[i];for(s=0;s<o;s++){if(e[s]===n){continue t}}e.push(n);o++}return e};function A(t){var e="a aa ai ao as b fn i m o s ",n,r,s={};i.each(t,function(i,o){n=i.match(/^([^A-Z]+?)([A-Z])/);if(n&&e.indexOf(n[1]+" ")!==-1){r=i.replace(n[0],n[2].toLowerCase());s[r]=i;if(n[1]==="o"){A(t[i])}}});t._hungarianMap=s}function D(t,e,r){if(!t._hungarianMap){A(t)}var s;i.each(e,function(o,a){s=t._hungarianMap[o];if(s!==n&&(r||e[s]===n)){if(s.charAt(0)==="o"){if(!e[s]){e[s]={}}i.extend(true,e[s],e[o]);D(t[s],e[s],r)}else{e[s]=e[o]}}})}function E(t){var e=r.defaults.oLanguage;var n=t.sZeroRecords;if(!t.sEmptyTable&&n&&e.sEmptyTable==="No data available in table"){he(t,t,"sZeroRecords","sEmptyTable")}if(!t.sLoadingRecords&&n&&e.sLoadingRecords==="Loading..."){he(t,t,"sZeroRecords","sLoadingRecords")}if(t.sInfoThousands){t.sThousands=t.sInfoThousands}var i=t.sDecimal;if(i){Be(i)}}
537var N=function(t,e,i){if(t[e]!==n){t[i]=t[e]}};function z(t){N(t,"ordering","bSort");N(t,"orderMulti","bSortMulti");N(t,"orderClasses","bSortClasses");N(t,"orderCellsTop","bSortCellsTop");N(t,"order","aaSorting");N(t,"orderFixed","aaSortingFixed");N(t,"paging","bPaginate");N(t,"pagingType","sPaginationType");N(t,"pageLength","iDisplayLength");N(t,"searching","bFilter");if(typeof t.sScrollX==="boolean"){t.sScrollX=t.sScrollX?"100%":""}var e=t.aoSearchCols;if(e){for(var n=0,i=e.length;n<i;n++){if(e[n]){D(r.models.oSearch,e[n])}}}}function P(t){N(t,"orderable","bSortable");N(t,"orderData","aDataSort");N(t,"orderSequence","asSorting");N(t,"orderDataType","sortDataType");var e=t.aDataSort;if(e&&!i.isArray(e)){t.aDataSort=[e]}}function j(t){if(!r.__browser){var e={};r.__browser=e;var n=i("<div/>").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(i("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(i("<div/>").css({width:"100%",height:10}))).appendTo("body");var s=n.children();var o=s.children();e.barWidth=s[0].offsetWidth-s[0].clientWidth;e.bScrollOversize=o[0].offsetWidth===100&&s[0].clientWidth!==100;e.bScrollbarLeft=Math.round(o.offset().left)!==1;e.bBounding=n[0].getBoundingClientRect().width?true:false;n.remove()}i.extend(t.oBrowser,r.__browser);t.oScroll.iBarWidth=r.__browser.barWidth}function I(t,e,i,r,s,o){var a=r,l,c=false;if(i!==n){l=i;c=true}while(a!==s){if(!t.hasOwnProperty(a)){continue}l=c?e(l,t[a],a,t):t[a];c=true;a+=o}return l}function $(t,n){var s=r.defaults.column;var o=t.aoColumns.length;var a=i.extend({},r.models.oColumn,s,{nTh:n?n:e.createElement("th"),sTitle:s.sTitle?s.sTitle:n?n.innerHTML:"",aDataSort:s.aDataSort?s.aDataSort:[o],mData:s.mData?s.mData:o,idx:o});t.aoColumns.push(a);var l=t.aoPreSearchCols;l[o]=i.extend({},r.models.oSearch,l[o]);R(t,o,i(n).data())}function R(t,e,s){var o=t.aoColumns[e];var a=t.oClasses;var l=i(o.nTh);if(!o.sWidthOrig){o.sWidthOrig=l.attr("width")||null;var c=(l.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);if(c){o.sWidthOrig=c[1]}}if(s!==n&&s!==null){P(s);D(r.defaults.column,s);if(s.mDataProp!==n&&!s.mData){s.mData=s.mDataProp}if(s.sType){o._sManualType=s.sType}if(s.className&&!s.sClass){s.sClass=s.className}i.extend(o,s);he(o,s,"sWidth","sWidthOrig");if(s.iDataSort!==n){o.aDataSort=[s.iDataSort]}he(o,s,"aDataSort")}var u=o.mData;var h=tt(u);var f=o.mRender?tt(o.mRender):null;var d=function(t){return typeof t==="string"&&t.indexOf("@")!==-1};o._bAttrSrc=i.isPlainObject(u)&&(d(u.sort)||d(u.type)||d(u.filter));o.fnGetData=function(t,e,i){var r=h(t,e,n,i);return f&&e?f(r,e,t,i):r};o.fnSetData=function(t,e,n){return et(u)(t,e,n)};if(typeof u!=="number"){t._rowReadObject=true}if(!t.oFeatures.bSort){o.bSortable=false;l.addClass(a.sSortableNone)}var p=i.inArray("asc",o.asSorting)!==-1;var m=i.inArray("desc",o.asSorting)!==-1;if(!o.bSortable||!p&&!m){o.sSortingClass=a.sSortableNone;o.sSortingClassJUI=""}else if(p&&!m){o.sSortingClass=a.sSortableAsc;o.sSortingClassJUI=a.sSortJUIAscAllowed}else if(!p&&m){o.sSortingClass=a.sSortableDesc;o.sSortingClassJUI=a.sSortJUIDescAllowed}else{o.sSortingClass=a.sSortable;o.sSortingClassJUI=a.sSortJUI}}function L(t){if(t.oFeatures.bAutoWidth!==false){var e=t.aoColumns;Xt(t);for(var n=0,i=e.length;n<i;n++){e[n].nTh.style.width=e[n].sWidth}}var r=t.oScroll;if(r.sY!==""||r.sX!==""){Ut(t)}me(t,null,"column-sizing",[t])}function F(t,e){var n=V(t,"bVisible");return typeof n[e]==="number"?n[e]:null}function O(t,e){var n=V(t,"bVisible");var r=i.inArray(e,n);return r!==-1?r:null}function H(t){return V(t,"bVisible").length}function V(t,e){var n=[];i.map(t.aoColumns,function(t,i){if(t[e]){n.push(i)}});return n}function q(t){var e=t.aoColumns;var i=t.aoData;var s=r.ext.type.detect;var o,a,l,c,u,h;var f,d,p,m;for(o=0,a=e.length;o<a;o++){f=e[o];m=[];if(!f.sType&&f._sManualType){f.sType=f._sManualType}else if(!f.sType){for(l=0,c=s.length;l<c;l++){for(u=0,h=i.length;u<h;u++){if(m[u]===n){m[u]=J(t,u,o,"type")}p=s[l](m[u],t);if(!p&&l!==s.length-1){break}if(p==="html"){break}}if(p){f.sType=p;break}}if(!f.sType){f.sType="string"}}}}function B(t,e,r,s){var o,a,l,c,u,h,f;var d=t.aoColumns;if(e){for(o=e.length-1;o>=0;o--){f=e[o];var p=f.targets!==n?f.targets:f.aTargets;if(!i.isArray(p)){p=[p]}for(l=0,c=p.length;l<c;l++){if(typeof p[l]==="number"&&p[l]>=0){while(d.length<=p[l]){$(t)}s(p[l],f)}else if(typeof p[l]==="number"&&p[l]<0){s(d.length+p[l],f)}else if(typeof p[l]==="string"){for(u=0,h=d.length;u<h;u++){if(p[l]=="_all"||i(d[u].nTh).hasClass(p[l])){s(u,f)}}}}}}if(r){for(o=0,a=r.length;o<a;o++){s(o,r[o])}}}function U(t,e,s,o){var a=t.aoData.length;var l=i.extend(true,{},r.models.oRow,{src:s?"dom":"data",idx:a});l._aData=e;t.aoData.push(l);var c,u;var h=t.aoColumns;for(var f=0,d=h.length;f<d;f++){h[f].sType=null}t.aiDisplayMaster.push(a);var p=t.rowIdFn(e);if(p!==n){t.aIds[p]=l}if(s||!t.oFeatures.bDeferRender){at(t,a,s,o)}return a}function W(t,e){var n;if(!(e instanceof i)){e=i(e)}return e.map(function(e,i){n=ot(t,i);return U(t,n.data,i,n.cells)})}function Y(t,e){return e._DT_RowIndex!==n?e._DT_RowIndex:null}function X(t,e,n){return i.inArray(n,t.aoData[e].anCells)}function J(t,e,i,r){var s=t.iDraw;var o=t.aoColumns[i];var a=t.aoData[e]._aData;var l=o.sDefaultContent;var c=o.fnGetData(a,r,{settings:t,row:e,col:i});if(c===n){if(t.iDrawError!=s&&l===null){ue(t,0,"Requested unknown parameter "+(typeof o.mData=="function"?"{function}":"'"+o.mData+"'")+" for row "+e,4);t.iDrawError=s}return l}if((c===a||c===null)&&l!==null){c=l}else if(typeof c==="function"){return c.call(a)}if(c===null&&r=="display"){return""}return c}function G(t,e,n,i){var r=t.aoColumns[n];var s=t.aoData[e]._aData;r.fnSetData(s,i,{settings:t,row:e,col:n})}var K=/\[.*?\]$/;var Z=/\(\)$/;function Q(t){return i.map(t.match(/(\\.|[^\.])+/g)||[""],function(t){return t.replace(/\\./g,".")})}function tt(t){if(i.isPlainObject(t)){var e={};i.each(t,function(t,n){if(n){e[t]=tt(n)}});return function(t,i,r,s){var o=e[i]||e._;return o!==n?o(t,i,r,s):t}}else if(t===null){return function(t){return t}}else if(typeof t==="function"){return function(e,n,i,r){return t(e,n,i,r)}}else if(typeof t==="string"&&(t.indexOf(".")!==-1||t.indexOf("[")!==-1||t.indexOf("(")!==-1)){var r=function(t,e,s){var o,a,l,c;if(s!==""){var u=Q(s);for(var h=0,f=u.length;h<f;h++){o=u[h].match(K);a=u[h].match(Z);if(o){u[h]=u[h].replace(K,"");if(u[h]!==""){t=t[u[h]]}l=[];u.splice(0,h+1);c=u.join(".");if(i.isArray(t)){for(var d=0,p=t.length;d<p;d++){l.push(r(t[d],e,c))}}var m=o[0].substring(1,o[0].length-1);t=m===""?l:l.join(m);break}else if(a){u[h]=u[h].replace(Z,"");t=t[u[h]]();continue}if(t===null||t[u[h]]===n){return n}t=t[u[h]]}}return t};return function(e,n){return r(e,n,t)}}else{return function(e,n){return e[t]}}}function et(t){if(i.isPlainObject(t)){return et(t._)}else if(t===null){return function(){}}else if(typeof t==="function"){return function(e,n,i){t(e,"set",n,i)}}else if(typeof t==="string"&&(t.indexOf(".")!==-1||t.indexOf("[")!==-1||t.indexOf("(")!==-1)){var e=function(t,r,s){var o=Q(s),a;var l=o[o.length-1];var c,u,h,f;for(var d=0,p=o.length-1;d<p;d++){c=o[d].match(K);u=o[d].match(Z);if(c){o[d]=o[d].replace(K,"");t[o[d]]=[];a=o.slice();a.splice(0,d+1);f=a.join(".");if(i.isArray(r)){for(var m=0,g=r.length;m<g;m++){h={};e(h,r[m],f);t[o[d]].push(h)}}else{t[o[d]]=r}return}else if(u){o[d]=o[d].replace(Z,"");t=t[o[d]](r)}if(t[o[d]]===null||t[o[d]]===n){t[o[d]]={}}
537t=t[o[d]]}if(l.match(Z)){t=t[l.replace(Z,"")](r)}else{t[l.replace(K,"")]=r}};return function(n,i){return e(n,i,t)}}else{return function(e,n){e[t]=n}}}function nt(t){return w(t.aoData,"_aData")}function it(t){t.aoData.length=0;t.aiDisplayMaster.length=0;t.aiDisplay.length=0;t.aIds={}}function rt(t,e,i){var r=-1;for(var s=0,o=t.length;s<o;s++){if(t[s]==e){r=s}else if(t[s]>e){t[s]--}}if(r!=-1&&i===n){t.splice(r,1)}}function st(t,e,i,r){var s=t.aoData[e];var o,a;var l=function(n,i){while(n.childNodes.length){n.removeChild(n.firstChild)}n.innerHTML=J(t,e,i,"display")};if(i==="dom"||(!i||i==="auto")&&s.src==="dom"){s._aData=ot(t,s,r,r===n?n:s._aData).data}else{var c=s.anCells;if(c){if(r!==n){l(c[r],r)}else{for(o=0,a=c.length;o<a;o++){l(c[o],o)}}}}s._aSortData=null;s._aFilterData=null;var u=t.aoColumns;if(r!==n){u[r].sType=null}else{for(o=0,a=u.length;o<a;o++){u[o].sType=null}lt(t,s)}}function ot(t,e,r,s){var o=[],a=e.firstChild,l,c,u,h=0,f,d=t.aoColumns,p=t._rowReadObject;s=s!==n?s:p?{}:[];var m=function(t,e){if(typeof t==="string"){var n=t.indexOf("@");if(n!==-1){var i=t.substring(n+1);var r=et(t);r(s,e.getAttribute(i))}}};var g=function(t){if(r===n||r===h){c=d[h];f=i.trim(t.innerHTML);if(c&&c._bAttrSrc){var e=et(c.mData._);e(s,f);m(c.mData.sort,t);m(c.mData.type,t);m(c.mData.filter,t)}else{if(p){if(!c._setter){c._setter=et(c.mData)}c._setter(s,f)}else{s[h]=f}}}h++};if(a){while(a){l=a.nodeName.toUpperCase();if(l=="TD"||l=="TH"){g(a);o.push(a)}a=a.nextSibling}}else{o=e.anCells;for(var _=0,v=o.length;_<v;_++){g(o[_])}}var y=a?e:e.nTr;if(y){var b=y.getAttribute("id");if(b){et(t.rowId)(s,b)}}return{data:s,cells:o}}function at(t,n,i,r){var s=t.aoData[n],o=s._aData,a=[],l,c,u,h,f;if(s.nTr===null){l=i||e.createElement("tr");s.nTr=l;s.anCells=a;l._DT_RowIndex=n;lt(t,s);for(h=0,f=t.aoColumns.length;h<f;h++){u=t.aoColumns[h];c=i?r[h]:e.createElement(u.sCellType);a.push(c);if(!i||u.mRender||u.mData!==h){c.innerHTML=J(t,n,h,"display")}if(u.sClass){c.className+=" "+u.sClass}if(u.bVisible&&!i){l.appendChild(c)}else if(!u.bVisible&&i){c.parentNode.removeChild(c)}if(u.fnCreatedCell){u.fnCreatedCell.call(t.oInstance,c,J(t,n,h),o,n,h)}}me(t,"aoRowCreatedCallback",null,[l,o,n])}s.nTr.setAttribute("role","row")}function lt(t,e){var n=e.nTr;var r=e._aData;if(n){var s=t.rowIdFn(r);if(s){n.id=s}if(r.DT_RowClass){var o=r.DT_RowClass.split(" ");e.__rowc=e.__rowc?C(e.__rowc.concat(o)):o;i(n).removeClass(e.__rowc.join(" ")).addClass(r.DT_RowClass)}if(r.DT_RowAttr){i(n).attr(r.DT_RowAttr)}if(r.DT_RowData){i(n).data(r.DT_RowData)}}}function ct(t){var e,n,r,s,o;var a=t.nTHead;var l=t.nTFoot;var c=i("th, td",a).length===0;var u=t.oClasses;var h=t.aoColumns;if(c){s=i("<tr/>").appendTo(a)}for(e=0,n=h.length;e<n;e++){o=h[e];r=i(o.nTh).addClass(o.sClass);if(c){r.appendTo(s)}if(t.oFeatures.bSort){r.addClass(o.sSortingClass);if(o.bSortable!==false){r.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId);re(t,o.nTh,e)}}if(o.sTitle!=r[0].innerHTML){r.html(o.sTitle)}_e(t,"header")(t,r,o,u)}if(c){pt(t.aoHeader,a)}i(a).find(">tr").attr("role","row");i(a).find(">tr>th, >tr>td").addClass(u.sHeaderTH);i(l).find(">tr>th, >tr>td").addClass(u.sFooterTH);if(l!==null){var f=t.aoFooter[0];for(e=0,n=f.length;e<n;e++){o=h[e];o.nTf=f[e].cell;if(o.sClass){i(o.nTf).addClass(o.sClass)}}}}function ut(t,e,r){var s,o,a,l,c,u,h,f;var d=[];var p=[];var m=t.aoColumns.length;var g,_;if(!e){return}if(r===n){r=false}for(s=0,o=e.length;s<o;s++){d[s]=e[s].slice();d[s].nTr=e[s].nTr;for(a=m-1;a>=0;a--){if(!t.aoColumns[a].bVisible&&!r){d[s].splice(a,1)}}p.push([])}for(s=0,o=d.length;s<o;s++){f=d[s].nTr;if(f){while(h=f.firstChild){f.removeChild(h)}}for(a=0,l=d[s].length;a<l;a++){g=1;_=1;if(p[s][a]===n){f.appendChild(d[s][a].cell);p[s][a]=1;while(d[s+g]!==n&&d[s][a].cell==d[s+g][a].cell){p[s+g][a]=1;g++}while(d[s][a+_]!==n&&d[s][a].cell==d[s][a+_].cell){for(c=0;c<g;c++){p[s+c][a+_]=1}_++}i(d[s][a].cell).attr("rowspan",g).attr("colspan",_)}}}}function ht(t){var e=me(t,"aoPreDrawCallback","preDraw",[t]);if(i.inArray(false,e)!==-1){qt(t,false);return}var r,s,o;var a=[];var l=0;var c=t.asStripeClasses;var u=c.length;var h=t.aoOpenRows.length;var f=t.oLanguage;var d=t.iInitDisplayStart;var p=ve(t)=="ssp";var m=t.aiDisplay;t.bDrawing=true;if(d!==n&&d!==-1){t._iDisplayStart=p?d:d>=t.fnRecordsDisplay()?0:d;t.iInitDisplayStart=-1}var g=t._iDisplayStart;var _=t.fnDisplayEnd();if(t.bDeferLoading){t.bDeferLoading=false;t.iDraw++;qt(t,false)}else if(!p){t.iDraw++}else if(!t.bDestroying&&!_t(t)){return}if(m.length!==0){var v=p?0:g;var y=p?t.aoData.length:_;for(var b=v;b<y;b++){var x=m[b];var w=t.aoData[x];if(w.nTr===null){at(t,x)}var k=w.nTr;if(u!==0){var S=c[l%u];if(w._sRowStripe!=S){i(k).removeClass(w._sRowStripe).addClass(S);w._sRowStripe=S}}me(t,"aoRowCallback",null,[k,w._aData,l,b]);a.push(k);l++}}else{var M=f.sZeroRecords;if(t.iDraw==1&&ve(t)=="ajax"){M=f.sLoadingRecords}else if(f.sEmptyTable&&t.fnRecordsTotal()===0){M=f.sEmptyTable}a[0]=i("<tr/>",{"class":u?c[0]:""}).append(i("<td />
537",{valign:"top",colSpan:H(t),"class":t.oClasses.sRowEmpty}).html(M))[0]}me(t,"aoHeaderCallback","header",[i(t.nTHead).children("tr")[0],nt(t),g,_,m]);me(t,"aoFooterCallback","footer",[i(t.nTFoot).children("tr")[0],nt(t),g,_,m]);var T=i(t.nTBody);T.children().detach();T.append(i(a));me(t,"aoDrawCallback","draw",[t]);t.bSorted=false;t.bFiltered=false;t.bDrawing=false}function ft(t,e){var n=t.oFeatures,i=n.bSort,r=n.bFilter;if(i){ee(t)}if(r){wt(t,t.oPreviousSearch)}else{t.aiDisplay=t.aiDisplayMaster.slice()}if(e!==true){t._iDisplayStart=0}t._drawHold=e;ht(t);t._drawHold=false}function dt(t){var e=t.oClasses;var n=i(t.nTable);var s=i("<div/>").insertBefore(n);var o=t.oFeatures;var a=i("<div/>",{id:t.sTableId+"_wrapper","class":e.sWrapper+(t.nTFoot?"":" "+e.sNoFooter)});t.nHolding=s[0];t.nTableWrapper=a[0];t.nTableReinsertBefore=t.nTable.nextSibling;var l=t.sDom.split("");var c,u,h,f,d,p;for(var m=0;m<l.length;m++){c=null;u=l[m];if(u=="<"){h=i("<div/>")[0];f=l[m+1];if(f=="'"||f=='"'){d="";p=2;while(l[m+p]!=f){d+=l[m+p];p++}if(d=="H"){d=e.sJUIHeader}else if(d=="F"){d=e.sJUIFooter}if(d.indexOf(".")!=-1){var g=d.split(".");h.id=g[0].substr(1,g[0].length-1);h.className=g[1]}else if(d.charAt(0)=="#"){h.id=d.substr(1,d.length-1)}else{h.className=d}m+=p}a.append(h);a=i(h)}else if(u==">"){a=a.parent()}else if(u=="l"&&o.bPaginate&&o.bLengthChange){c=Ft(t)}else if(u=="f"&&o.bFilter){c=xt(t)}else if(u=="r"&&o.bProcessing){c=Vt(t)}else if(u=="t"){c=Bt(t)}else if(u=="i"&&o.bInfo){c=Pt(t)}else if(u=="p"&&o.bPaginate){c=Ot(t)}else if(r.ext.feature.length!==0){var _=r.ext.feature;for(var v=0,y=_.length;v<y;v++){if(u==_[v].cFeature){c=_[v].fnInit(t);break}}}if(c){var b=t.aanFeatures;if(!b[u]){b[u]=[]}b[u].push(c);a.append(c)}}s.replaceWith(a);t.nHolding=null}function pt(t,e){var n=i(e).children("tr");var r,s;var o,a,l,c,u,h,f,d,p;var m;var g=function(t,e,n){var i=t[e];while(i[n]){n++}return n};t.splice(0,t.length);for(o=0,c=n.length;o<c;o++){t.push([])}for(o=0,c=n.length;o<c;o++){r=n[o];f=0;s=r.firstChild;while(s){if(s.nodeName.toUpperCase()=="TD"||s.nodeName.toUpperCase()=="TH"){d=s.getAttribute("colspan")*1;p=s.getAttribute("rowspan")*1;d=!d||d===0||d===1?1:d;p=!p||p===0||p===1?1:p;h=g(t,o,f);m=d===1?true:false;for(l=0;l<d;l++){for(a=0;a<p;a++){t[o+a][h+l]={cell:s,unique:m};t[o+a].nTr=r}}}s=s.nextSibling}}}function mt(t,e,n){var i=[];if(!n){n=t.aoHeader;if(e){n=[];pt(n,e)}}for(var r=0,s=n.length;r<s;r++){for(var o=0,a=n[r].length;o<a;o++){if(n[r][o].unique&&(!i[o]||!t.bSortCellsTop)){i[o]=n[r][o].cell}}}return i}function gt(t,e,n){me(t,"aoServerParams","serverParams",[e]);if(e&&i.isArray(e)){var r={};var s=/(.*?)\[\]$/;i.each(e,function(t,e){var n=e.name.match(s);if(n){var i=n[0];if(!r[i]){r[i]=[]}r[i].push(e.value)}else{r[e.name]=e.value}});e=r}var o;var a=t.ajax;var l=t.oInstance;var c=function(e){me(t,null,"xhr",[t,e,t.jqXHR]);n(e)};if(i.isPlainObject(a)&&a.data){o=a.data;var u=i.isFunction(o)?o(e,t):o;e=i.isFunction(o)&&u?u:i.extend(true,e,u);delete a.data}var h={data:e,success:function(e){var n=e.error||e.sError;if(n){ue(t,0,n)}t.json=e;c(e)},dataType:"json",cache:false,type:t.sServerMethod,error:function(e,n,r){var s=me(t,null,"xhr",[t,null,t.jqXHR]);if(i.inArray(true,s)===-1){if(n=="parsererror"){ue(t,0,"Invalid JSON response",1)}else if(e.readyState===4){ue(t,0,"Ajax error",7)}}qt(t,false)}};t.oAjaxData=e;me(t,null,"preXhr",[t,e]);if(t.fnServerData){t.fnServerData.call(l,t.sAjaxSource,i.map(e,function(t,e){return{name:e,value:t}}),c,t)}else if(t.sAjaxSource||typeof a==="string"){t.jqXHR=i.ajax(i.extend(h,{url:a||t.sAjaxSource}))}else if(i.isFunction(a)){t.jqXHR=a.call(l,e,c,t)}else{t.jqXHR=i.ajax(i.extend(h,a));a.data=o}}function _t(t){if(t.bAjaxDataGet){t.iDraw++;qt(t,true);gt(t,vt(t),function(e){yt(t,e)});return false}return true}function vt(t){var e=t.aoColumns,n=e.length,s=t.oFeatures,o=t.oPreviousSearch,a=t.aoPreSearchCols,l,c=[],u,h,f,d=te(t),p=t._iDisplayStart,m=s.bPaginate!==false?t._iDisplayLength:-1;var g=function(t,e){c.push({name:t,value:e})};g("sEcho",t.iDraw);g("iColumns",n);g("sColumns",w(e,"sName").join(","));g("iDisplayStart",p);g("iDisplayLength",m);var _={draw:t.iDraw,columns:[],order:[],start:p,length:m,search:{value:o.sSearch,regex:o.bRegex}};for(l=0;l<n;l++){h=e[l];
537f=a[l];u=typeof h.mData=="function"?"function":h.mData;_.columns.push({data:u,name:h.sName,searchable:h.bSearchable,orderable:h.bSortable,search:{value:f.sSearch,regex:f.bRegex}});g("mDataProp_"+l,u);if(s.bFilter){g("sSearch_"+l,f.sSearch);g("bRegex_"+l,f.bRegex);g("bSearchable_"+l,h.bSearchable)}if(s.bSort){g("bSortable_"+l,h.bSortable)}}if(s.bFilter){g("sSearch",o.sSearch);g("bRegex",o.bRegex)}if(s.bSort){i.each(d,function(t,e){_.order.push({column:e.col,dir:e.dir});g("iSortCol_"+t,e.col);g("sSortDir_"+t,e.dir)});g("iSortingCols",d.length)}var v=r.ext.legacy.ajax;if(v===null){return t.sAjaxSource?c:_}return v?c:_}function yt(t,e){var i=function(t,i){return e[t]!==n?e[t]:e[i]};var r=bt(t,e);var s=i("sEcho","draw");var o=i("iTotalRecords","recordsTotal");var a=i("iTotalDisplayRecords","recordsFiltered");if(s){if(s*1<t.iDraw){return}t.iDraw=s*1}it(t);t._iRecordsTotal=parseInt(o,10);t._iRecordsDisplay=parseInt(a,10);for(var l=0,c=r.length;l<c;l++){U(t,r[l])}t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=false;ht(t);if(!t._bInitComplete){Rt(t,e)}t.bAjaxDataGet=true;qt(t,false)}function bt(t,e){var r=i.isPlainObject(t.ajax)&&t.ajax.dataSrc!==n?t.ajax.dataSrc:t.sAjaxDataProp;if(r==="data"){return e.aaData||e[r]}return r!==""?tt(r)(e):e}function xt(t){var n=t.oClasses;var r=t.sTableId;var s=t.oLanguage;var o=t.oPreviousSearch;var a=t.aanFeatures;var l='<input type="search" class="'+n.sFilterInput+'"/>';var c=s.sSearch;c=c.match(/_INPUT_/)?c.replace("_INPUT_",l):c+l;var u=i("<div/>",{id:!a.f?r+"_filter":null,"class":n.sFilter}).append(i("<label/>").append(c));var h=function(){var e=a.f;var n=!this.value?"":this.value;if(n!=o.sSearch){wt(t,{sSearch:n,bRegex:o.bRegex,bSmart:o.bSmart,bCaseInsensitive:o.bCaseInsensitive});t._iDisplayStart=0;ht(t)}};var f=t.searchDelay!==null?t.searchDelay:ve(t)==="ssp"?400:0;var d=i("input",u).val(o.sSearch).attr("placeholder",s.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",f?Jt(h,f):h).bind("keypress.DT",function(t){if(t.keyCode==13){return false}}).attr("aria-controls",r);i(t.nTable).on("search.dt.DT",function(n,i){if(t===i){try{if(d[0]!==e.activeElement){d.val(o.sSearch)}}catch(r){}}});return u[0]}function wt(t,e,i){var r=t.oPreviousSearch;var s=t.aoPreSearchCols;var o=function(t){r.sSearch=t.sSearch;r.bRegex=t.bRegex;r.bSmart=t.bSmart;r.bCaseInsensitive=t.bCaseInsensitive};var a=function(t){return t.bEscapeRegex!==n?!t.bEscapeRegex:t.bRegex};q(t);if(ve(t)!="ssp"){Mt(t,e.sSearch,i,a(e),e.bSmart,e.bCaseInsensitive);o(e);for(var l=0;l<s.length;l++){St(t,s[l].sSearch,l,a(s[l]),s[l].bSmart,s[l].bCaseInsensitive)}kt(t)}else{o(e)}t.bFiltered=true;me(t,null,"search",[t])}function kt(t){var e=r.ext.search;var n=t.aiDisplay;var s,o;for(var a=0,l=e.length;a<l;a++){var c=[];for(var u=0,h=n.length;u<h;u++){o=n[u];s=t.aoData[o];if(e[a](t,s._aFilterData,o,s._aData,u)){c.push(o)}}n.length=0;i.merge(n,c)}}function St(t,e,n,i,r,s){if(e===""){return}var o;var a=t.aiDisplay;var l=Tt(e,i,r,s);for(var c=a.length-1;c>=0;c--){o=t.aoData[a[c]]._aFilterData[n];if(!l.test(o)){a.splice(c,1)}}}function Mt(t,e,n,i,s,o){var a=Tt(e,i,s,o);var l=t.oPreviousSearch.sSearch;var c=t.aiDisplayMaster;var u,h,f;if(r.ext.search.length!==0){n=true}h=Et(t);if(e.length<=0){t.aiDisplay=c.slice()}else{if(h||n||l.length>e.length||e.indexOf(l)!==0||t.bSorted){t.aiDisplay=c.slice()}u=t.aiDisplay;for(f=u.length-1;f>=0;f--){if(!a.test(t.aoData[u[f]]._sFilterRow)){u.splice(f,1)}}}}function Tt(t,e,n,r){t=e?t:Ct(t);if(n){var s=i.map(t.match(/"[^"]+"|[^ ]+/g)||[""],function(t){if(t.charAt(0)==='"'){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")});t="^(?=.*?"+s.join(")(?=.*?")+").*$"}return new RegExp(t,r?"i":"")}function Ct(t){return t.replace(p,"\\$1")}var At=i("<div>")[0];var Dt=At.textContent!==n;function Et(t){var e=t.aoColumns;var n;var i,s,o,a,l,c,u;var h=r.ext.type.search;var f=false;for(i=0,o=t.aoData.length;i<o;i++){u=t.aoData[i];if(!u._aFilterData){l=[];for(s=0,a=e.length;s<a;s++){n=e[s];if(n.bSearchable){c=J(t,i,s,"filter");if(h[n.sType]){c=h[n.sType](c)}if(c===null){c=""}if(typeof c!=="string"&&c.toString){c=c.toString()}}else{c=""}if(c.indexOf&&c.indexOf("&")!==-1){At.innerHTML=c;c=Dt?At.textContent:At.innerText}if(c.replace){c=c.replace(/[\r\n]/g,"")}l.push(c)}u._aFilterData=l;u._sFilterRow=l.join("  ");f=true}}return f}function Nt(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function zt(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function Pt(t){var e=t.sTableId,n=t.aanFeatures.i,r=i("<div/>
537",{"class":t.oClasses.sInfo,id:!n?e+"_info":null});if(!n){t.aoDrawCallback.push({fn:jt,sName:"information"});r.attr("role","status").attr("aria-live","polite");i(t.nTable).attr("aria-describedby",e+"_info")}return r[0]}function jt(t){var e=t.aanFeatures.i;if(e.length===0){return}var n=t.oLanguage,r=t._iDisplayStart+1,s=t.fnDisplayEnd(),o=t.fnRecordsTotal(),a=t.fnRecordsDisplay(),l=a?n.sInfo:n.sInfoEmpty;if(a!==o){l+=" "+n.sInfoFiltered}l+=n.sInfoPostFix;l=It(t,l);var c=n.fnInfoCallback;if(c!==null){l=c.call(t.oInstance,t,r,s,o,a,l)}i(e).html(l)}function It(t,e){var n=t.fnFormatNumber,i=t._iDisplayStart+1,r=t._iDisplayLength,s=t.fnRecordsDisplay(),o=r===-1;return e.replace(/_START_/g,n.call(t,i)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,s)).replace(/_PAGE_/g,n.call(t,o?1:Math.ceil(i/r))).replace(/_PAGES_/g,n.call(t,o?1:Math.ceil(s/r)))}function $t(t){var e,n,i=t.iInitDisplayStart;var r=t.aoColumns,s;var o=t.oFeatures;var a=t.bDeferLoading;if(!t.bInitialised){setTimeout(function(){$t(t)},200);return}dt(t);ct(t);ut(t,t.aoHeader);ut(t,t.aoFooter);qt(t,true);if(o.bAutoWidth){Xt(t)}for(e=0,n=r.length;e<n;e++){s=r[e];if(s.sWidth){s.nTh.style.width=Qt(s.sWidth)}}me(t,null,"preInit",[t]);ft(t);var l=ve(t);if(l!="ssp"||a){if(l=="ajax"){gt(t,[],function(n){var r=bt(t,n);for(e=0;e<r.length;e++){U(t,r[e])}t.iInitDisplayStart=i;ft(t);qt(t,false);Rt(t,n)},t)}else{qt(t,false);Rt(t)}}}function Rt(t,e){t._bInitComplete=true;if(e||t.oInit.aaData){L(t)}me(t,"aoInitComplete","init",[t,e])}function Lt(t,e){var n=parseInt(e,10);t._iDisplayLength=n;ge(t);me(t,null,"length",[t,n])}function Ft(t){var e=t.oClasses,n=t.sTableId,r=t.aLengthMenu,s=i.isArray(r[0]),o=s?r[0]:r,a=s?r[1]:r;var l=i("<select/>",{name:n+"_length","aria-controls":n,"class":e.sLengthSelect});for(var c=0,u=o.length;c<u;c++){l[0][c]=new Option(a[c],o[c])}var h=i("<div><label/></div>").addClass(e.sLength);if(!t.aanFeatures.l){h[0].id=n+"_length"}h.children().append(t.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML));i("select",h).val(t._iDisplayLength).bind("change.DT",function(e){Lt(t,i(this).val());ht(t)});i(t.nTable).bind("length.dt.DT",function(e,n,r){if(t===n){i("select",h).val(r)}});return h[0]}function Ot(t){var e=t.sPaginationType,n=r.ext.pager[e],s=typeof n==="function",o=function(t){ht(t)},a=i("<div/>").addClass(t.oClasses.sPaging+e)[0],l=t.aanFeatures;if(!s){n.fnInit(t,a,o)}if(!l.p){a.id=t.sTableId+"_paginate";t.aoDrawCallback.push({fn:function(t){if(s){var e=t._iDisplayStart,i=t._iDisplayLength,r=t.fnRecordsDisplay(),a=i===-1,c=a?0:Math.ceil(e/i),u=a?1:Math.ceil(r/i),h=n(c,u),f,d;for(f=0,d=l.p.length;f<d;f++){_e(t,"pageButton")(t,l.p[f],f,h,c,u)}}else{n.fnUpdate(t,o)}},sName:"pagination"})}return a}function Ht(t,e,n){var i=t._iDisplayStart,r=t._iDisplayLength,s=t.fnRecordsDisplay();if(s===0||r===-1){i=0}else if(typeof e==="number"){i=e*r;if(i>s){i=0}}else if(e=="first"){i=0}else if(e=="previous"){i=r>=0?i-r:0;if(i<0){i=0}}else if(e=="next"){if(i+r<s){i+=r}}else if(e=="last"){i=Math.floor((s-1)/r)*r}else{ue(t,0,"Unknown paging action: "+e,5)}var o=t._iDisplayStart!==i;t._iDisplayStart=i;if(o){me(t,null,"page",[t]);if(n){ht(t)}}return o}function Vt(t){return i("<div/>",{id:!t.aanFeatures.r?t.sTableId+"_processing":null,"class":t.oClasses.sProcessing}).html(t.oLanguage.sProcessing).insertBefore(t.nTable)[0]}function qt(t,e){if(t.oFeatures.bProcessing){i(t.aanFeatures.r).css("display",e?"block":"none")}me(t,null,"processing",[t,e])}function Bt(t){var e=i(t.nTable);e.attr("role","grid");var n=t.oScroll;if(n.sX===""&&n.sY===""){return t.nTable}var r=n.sX;var s=n.sY;var o=t.oClasses;var a=e.children("caption");var l=a.length?a[0]._captionSide:null;var c=i(e[0].cloneNode(false));var u=i(e[0].cloneNode(false));var h=e.children("tfoot");var f="<div/>";var d=function(t){return!t?null:Qt(t)};if(n.sX&&e.attr("width")==="100%"){e.removeAttr("width")}if(!h.length){h=null}var p=i(f,{"class":o.sScrollWrapper}).append(i(f,{"class":o.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:r?d(r):"100%"}).append(i(f,{"class":o.sScrollHeadInner}).css({"box-sizing":"content-box",width:n.sXInner||"100%"}).append(c.removeAttr("id").css("margin-left",0).append(l==="top"?a:null).append(e.children("thead"))))).append(i(f,{"class":o.sScrollBody}).css({position:"relative",overflow:"auto",width:d(r)}).append(e));if(h){p.append(i(f,{"class":o.sScrollFoot}).css({overflow:"hidden",border:0,width:r?d(r):"100%"}).append(i(f,{"class":o.sScrollFootInner}).append(u.removeAttr("id").css("margin-left",0).append(l==="bottom"?a:null).append(e.children("tfoot")))))}var m=p.children();var g=m[0];var _=m[1];var v=h?m[2]:null;if(r){i(_).on("scroll.DT",function(t){var e=this.scrollLeft;g.scrollLeft=e;if(h){v.scrollLeft=e}})}i(_).css(s&&n.bCollapse?"max-height":"height",s);t.nScrollHead=g;t.nScrollBody=_;t.nScrollFoot=v;t.aoDrawCallback.push({fn:Ut,sName:"scrolling"});return p[0]}function Ut(t){var e=t.oScroll,n=e.sX,r=e.sXInner,s=e.sY,o=e.iBarWidth,a=i(t.nScrollHead),l=a[0].style,c=a.children("div"),u=c[0].style,h=c.children("table"),f=t.nScrollBody,d=i(f),p=f.style,m=i(t.nScrollFoot),g=m.children("div"),_=g.children("table"),v=i(t.nTHead),y=i(t.nTable),b=y[0],x=b.style,w=t.nTFoot?i(t.nTFoot):null,k=t.oBrowser,S=k.bScrollOversize,M,T,C,A,D,E,N=[],z=[],P=[],j,I,$,R=function(t){var e=t.style;e.paddingTop="0";e.paddingBottom="0";e.borderTopWidth="0";e.borderBottomWidth="0";e.height=0};y.children("thead, tfoot").remove();D=v.clone().prependTo(y);M=v.find("tr");C=D.find("tr");D.find("th, td").removeAttr("tabindex");if(w){E=w.clone().prependTo(y);T=w.find("tr");A=E.find("tr")}if(!n){p.width="100%";a[0].style.width="100%"}
537i.each(mt(t,D),function(e,n){j=F(t,e);n.style.width=t.aoColumns[j].sWidth});if(w){Wt(function(t){t.style.width=""},A)}$=y.outerWidth();if(n===""){x.width="100%";if(S&&(y.find("tbody").height()>f.offsetHeight||d.css("overflow-y")=="scroll")){x.width=Qt(y.outerWidth()-o)}$=y.outerWidth()}else if(r!==""){x.width=Qt(r);$=y.outerWidth()}Wt(R,C);Wt(function(t){P.push(t.innerHTML);N.push(Qt(i(t).css("width")))},C);Wt(function(t,e){t.style.width=N[e]},M);i(C).height(0);if(w){Wt(R,A);Wt(function(t){z.push(Qt(i(t).css("width")))},A);Wt(function(t,e){t.style.width=z[e]},T);i(A).height(0)}Wt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+P[e]+"</div>";t.style.width=N[e]},C);if(w){Wt(function(t,e){t.innerHTML="";t.style.width=z[e]},A)}if(y.outerWidth()<$){I=f.scrollHeight>f.offsetHeight||d.css("overflow-y")=="scroll"?$+o:$;if(S&&(f.scrollHeight>f.offsetHeight||d.css("overflow-y")=="scroll")){x.width=Qt(I-o)}if(n===""||r!==""){ue(t,1,"Possible column misalignment",6)}}else{I="100%"}p.width=Qt(I);l.width=Qt(I);if(w){t.nScrollFoot.style.width=Qt(I)}if(!s){if(S){p.height=Qt(b.offsetHeight+o)}}var L=y.outerWidth();h[0].style.width=Qt(L);u.width=Qt(L);var O=y.height()>f.clientHeight||d.css("overflow-y")=="scroll";var H="padding"+(k.bScrollbarLeft?"Left":"Right");u[H]=O?o+"px":"0px";if(w){_[0].style.width=Qt(L);g[0].style.width=Qt(L);g[0].style[H]=O?o+"px":"0px"}d.scroll();if((t.bSorted||t.bFiltered)&&!t._drawHold){f.scrollTop=0}}function Wt(t,e,n){var i=0,r=0,s=e.length;var o,a;while(r<s){o=e[r].firstChild;a=n?n[r].firstChild:null;while(o){if(o.nodeType===1){if(n){t(o,a,i)}else{t(o,i)}i++}o=o.nextSibling;a=n?a.nextSibling:null}r++}}var Yt=/<.*?>/g;function Xt(e){var n=e.nTable,r=e.aoColumns,s=e.oScroll,o=s.sY,a=s.sX,l=s.sXInner,c=r.length,u=V(e,"bVisible"),h=i("th",e.nTHead),f=n.getAttribute("width"),d=n.parentNode,p=false,m,g,_,v,y,b=e.oBrowser,x=b.bScrollOversize;var w=n.style.width;if(w&&w.indexOf("%")!==-1){f=w}for(m=0;m<u.length;m++){g=r[u[m]];if(g.sWidth!==null){g.sWidth=Gt(g.sWidthOrig,d);p=true}}if(x||!p&&!a&&!o&&c==H(e)&&c==h.length){for(m=0;m<c;m++){var k=F(e,m);if(k){r[k].sWidth=Qt(h.eq(m).width())}}}else{var S=i(n).clone().css("visibility","hidden").removeAttr("id");S.find("tbody tr").remove();var M=i("<tr/>").appendTo(S.find("tbody"));S.find("thead, tfoot").remove();S.append(i(e.nTHead).clone()).append(i(e.nTFoot).clone());S.find("tfoot th, tfoot td").css("width","");h=mt(e,S.find("thead")[0]);for(m=0;m<u.length;m++){g=r[u[m]];h[m].style.width=g.sWidthOrig!==null&&g.sWidthOrig!==""?Qt(g.sWidthOrig):""}if(e.aoData.length){for(m=0;m<u.length;m++){_=u[m];g=r[_];i(Kt(e,_)).clone(false).append(g.sContentPadding).appendTo(M)}}var T=i("<div/>").css(a||o?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(S).appendTo(d);if(a&&l){S.width(l)}else if(a){S.css("width","auto");if(S.width()<d.clientWidth){S.width(d.clientWidth)}}else if(o){S.width(d.clientWidth)}else if(f){S.width(f)}if(a){var C=0;for(m=0;m<u.length;m++){g=r[u[m]]
538;y=b.bBounding?h[m].getBoundingClientRect().width:i(h[m]).outerWidth();C+=g.sWidthOrig===null?y:parseInt(g.sWidth,10)+y-i(h[m]).width()}S.width(Qt(C));n.style.width=Qt(C)}for(m=0;m<u.length;m++){g=r[u[m]];v=i(h[m]).width();if(v){g.sWidth=Qt(v)}}n.style.width=Qt(S.css("width"));T.remove()}if(f){n.style.width=Qt(f)}if((f||a)&&!e._reszEvt){var A=function(){i(t).bind("resize.DT-"+e.sInstance,Jt(function(){L(e)}))};if(x){setTimeout(A,1e3)}else{A()}e._reszEvt=true}}function Jt(t,e){var i=e!==n?e:200,r,s;return function(){var e=this,o=+new Date,a=arguments;if(r&&o<r+i){clearTimeout(s);s=setTimeout(function(){r=n;t.apply(e,a)},i)}else{r=o;t.apply(e,a)}}}function Gt(t,n){if(!t){return 0}var r=i("<div/>").css("width",Qt(t)).appendTo(n||e.body);var s=r[0].offsetWidth;r.remove();return s}function Kt(t,e){var n=Zt(t,e);if(n<0){return null}var r=t.aoData[n];return!r.nTr?i("<td/>").html(J(t,n,e,"display"))[0]:r.anCells[e]}function Zt(t,e){var n,i=-1,r=-1;for(var s=0,o=t.aoData.length;s<o;s++){n=J(t,s,e,"display")+"";n=n.replace(Yt,"");if(n.length>i){i=n.length;r=s}}return r}function Qt(t){if(t===null){return"0px"}if(typeof t=="number"){return t<0?"0px":t+"px"}return t.match(/\d$/)?t+"px":t}function te(t){var e,s,o,a,l=[],c=[],u=t.aoColumns,h,f,d,p,m=t.aaSortingFixed,g=i.isPlainObject(m),_=[],v=function(t){if(t.length&&!i.isArray(t[0])){_.push(t)}else{i.merge(_,t)}};if(i.isArray(m)){v(m)}if(g&&m.pre){v(m.pre)}v(t.aaSorting);if(g&&m.post){v(m.post)}for(e=0;e<_.length;e++){p=_[e][0];h=u[p].aDataSort;for(o=0,a=h.length;o<a;o++){f=h[o];d=u[f].sType||"string";if(_[e]._idx===n){_[e]._idx=i.inArray(_[e][1],u[f].asSorting)}
538l.push({src:p,col:f,dir:_[e][1],index:_[e]._idx,type:d,formatter:r.ext.type.order[d+"-pre"]})}}return l}function ee(t){var e,n,i,s,o,a,l,c,u,h=[],f=r.ext.type.order,d=t.aoData,p=t.aoColumns,m,g,_,v,y,b=0,x,w=t.aiDisplayMaster,k;q(t);k=te(t);for(e=0,n=k.length;e<n;e++){x=k[e];if(x.formatter){b++}oe(t,x.col)}if(ve(t)!="ssp"&&k.length!==0){for(e=0,i=w.length;e<i;e++){h[w[e]]=e}if(b===k.length){w.sort(function(t,e){var n,i,r,s,o,a=k.length,l=d[t]._aSortData,c=d[e]._aSortData;for(r=0;r<a;r++){o=k[r];n=l[o.col];i=c[o.col];s=n<i?-1:n>i?1:0;if(s!==0){return o.dir==="asc"?s:-s}}n=h[t];i=h[e];return n<i?-1:n>i?1:0})}else{w.sort(function(t,e){var n,i,r,s,o,a,l,c=k.length,u=d[t]._aSortData,p=d[e]._aSortData;for(r=0;r<c;r++){a=k[r];n=u[a.col];i=p[a.col];l=f[a.type+"-"+a.dir]||f["string-"+a.dir];o=l(n,i);if(o!==0){return o}}n=h[t];i=h[e];return n<i?-1:n>i?1:0})}}t.bSorted=true}function ne(t){var e;var n;var i=t.aoColumns;var r=te(t);var s=t.oLanguage.oAria;for(var o=0,a=i.length;o<a;o++){var l=i[o];var c=l.asSorting;var u=l.sTitle.replace(/<.*?>/g,"");var h=l.nTh;h.removeAttribute("aria-sort");if(l.bSortable){if(r.length>0&&r[0].col==o){h.setAttribute("aria-sort",r[0].dir=="asc"?"ascending":"descending");n=c[r[0].index+1]||c[0]}else{n=c[0]}e=u+(n==="asc"?s.sSortAscending:s.sSortDescending)}else{e=u}h.setAttribute("aria-label",e)}}function ie(t,e,r,s){var o=t.aoColumns[e];var a=t.aaSorting;var l=o.asSorting;var c;var u=function(t,e){var r=t._idx;if(r===n){r=i.inArray(t[1],l)}return r+1<l.length?r+1:e?null:0};if(typeof a[0]==="number"){a=t.aaSorting=[a]}if(r&&t.oFeatures.bSortMulti){var h=i.inArray(e,w(a,"0"));if(h!==-1){c=u(a[h],true);if(c===null&&a.length===1){c=0}if(c===null){a.splice(h,1)}else{a[h][1]=l[c];a[h]._idx=c}}else{a.push([e,l[0],0]);a[a.length-1]._idx=0}}else if(a.length&&a[0][0]==e){c=u(a[0]);a.length=1;a[0][1]=l[c];a[0]._idx=c}else{a.length=0;a.push([e,l[0]]);a[0]._idx=0}ft(t);if(typeof s=="function"){s(t)}}function re(t,e,n,i){var r=t.aoColumns[n];de(e,{},function(e){if(r.bSortable===false){return}if(t.oFeatures.bProcessing){qt(t,true);setTimeout(function(){ie(t,n,e.shiftKey,i);if(ve(t)!=="ssp"){qt(t,false)}},0)}else{ie(t,n,e.shiftKey,i)}})}function se(t){var e=t.aLastSort;var n=t.oClasses.sSortColumn;var r=te(t);var s=t.oFeatures;var o,a,l;if(s.bSort&&s.bSortClasses){for(o=0,a=e.length;o<a;o++){l=e[o].src;i(w(t.aoData,"anCells",l)).removeClass(n+(o<2?o+1:3))}for(o=0,a=r.length;o<a;o++){l=r[o].src;i(w(t.aoData,"anCells",l)).addClass(n+(o<2?o+1:3))}}t.aLastSort=r}function oe(t,e){var n=t.aoColumns[e];var i=r.ext.order[n.sSortDataType];var s;if(i){s=i.call(t.oInstance,t,e,O(t,e))}var o,a;var l=r.ext.type.order[n.sType+"-pre"];for(var c=0,u=t.aoData.length;c<u;c++){o=t.aoData[c];if(!o._aSortData){o._aSortData=[]}if(!o._aSortData[e]||i){a=i?s[c]:J(t,c,e,"sort");o._aSortData[e]=l?l(a):a}}}function ae(t){if(!t.oFeatures.bStateSave||t.bDestroying){return}var e={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:i.extend(true,[],t.aaSorting),search:Nt(t.oPreviousSearch),columns:i.map(t.aoColumns,function(e,n){return{visible:e.bVisible,search:Nt(t.aoPreSearchCols[n])}})};me(t,"aoStateSaveParams","stateSaveParams",[t,e]);t.oSavedState=e;t.fnStateSaveCallback.call(t.oInstance,t,e)}function le(t,e){var r,s;var o=t.aoColumns;if(!t.oFeatures.bStateSave){return}var a=t.fnStateLoadCallback.call(t.oInstance,t);if(!a||!a.time){return}var l=me(t,"aoStateLoadParams","stateLoadParams",[t,a]);if(i.inArray(false,l)!==-1){return}var c=t.iStateDuration;if(c>0&&a.time<+new Date-c*1e3){return}if(o.length!==a.columns.length){return}t.oLoadedState=i.extend(true,{},a);if(a.start!==n){t._iDisplayStart=a.start;t.iInitDisplayStart=a.start}if(a.length!==n){t._iDisplayLength=a.length}if(a.order!==n){t.aaSorting=[];i.each(a.order,function(e,n){t.aaSorting.push(n[0]>=o.length?[0,n[1]]:n)})}if(a.search!==n){i.extend(t.oPreviousSearch,zt(a.search))}for(r=0,s=a.columns.length;r<s;r++){var u=a.columns[r];if(u.visible!==n){o[r].bVisible=u.visible}if(u.search!==n){i.extend(t.aoPreSearchCols[r],zt(u.search))}}me(t,"aoStateLoaded","stateLoaded",[t,a])}function ce(t){var e=r.settings;var n=i.inArray(t,w(e,"nTable"));return n!==-1?e[n]:null}function ue(e,n,i,s){i="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+i;
538if(s){i+=". For more information about this error, please see "+"http://datatables.net/tn/"+s}if(!n){var o=r.ext;var a=o.sErrMode||o.errMode;if(e){me(e,null,"error",[e,s,i])}if(a=="alert"){alert(i)}else if(a=="throw"){throw new Error(i)}else if(typeof a=="function"){a(e,s,i)}}else if(t.console&&console.log){console.log(i)}}function he(t,e,r,s){if(i.isArray(r)){i.each(r,function(n,r){if(i.isArray(r)){he(t,e,r[0],r[1])}else{he(t,e,r)}});return}if(s===n){s=r}if(e[r]!==n){t[s]=e[r]}}function fe(t,e,n){var r;for(var s in e){if(e.hasOwnProperty(s)){r=e[s];if(i.isPlainObject(r)){if(!i.isPlainObject(t[s])){t[s]={}}i.extend(true,t[s],r)}else if(n&&s!=="data"&&s!=="aaData"&&i.isArray(r)){t[s]=r.slice()}else{t[s]=r}}}return t}function de(t,e,n){i(t).bind("click.DT",e,function(e){t.blur();n(e)}).bind("keypress.DT",e,function(t){if(t.which===13){t.preventDefault();n(t)}}).bind("selectstart.DT",function(){return false})}function pe(t,e,n,i){if(n){t[e].push({fn:n,sName:i})}}function me(t,e,n,r){var s=[];if(e){s=i.map(t[e].slice().reverse(),function(e,n){return e.fn.apply(t.oInstance,r)})}if(n!==null){var o=i.Event(n+".dt");i(t.nTable).trigger(o,r);s.push(o.result)}return s}function ge(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),i=t._iDisplayLength;if(e>=n){e=n-i}e-=e%i;if(i===-1||e<0){e=0}t._iDisplayStart=e}function _e(t,e){var n=t.renderer;var s=r.ext.renderer[e];
538if(i.isPlainObject(n)&&n[e]){return s[n[e]]||s._}else if(typeof n==="string"){return s[n]||s._}return s._}function ve(t){if(t.oFeatures.bServerSide){return"ssp"}else if(t.ajax||t.sAjaxSource){return"ajax"}return"dom"}r=function(t){this.$=function(t,e){return this.api(true).$(t,e)};this._=function(t,e){return this.api(true).rows(t,e).data()};this.api=function(t){return t?new o(ce(this[s.iApiIndex])):new o(this)};this.fnAddData=function(t,e){var r=this.api(true);var s=i.isArray(t)&&(i.isArray(t[0])||i.isPlainObject(t[0]))?r.rows.add(t):r.row.add(t);if(e===n||e){r.draw()}return s.flatten().toArray()};this.fnAdjustColumnSizing=function(t){var e=this.api(true).columns.adjust();var i=e.settings()[0];var r=i.oScroll;if(t===n||t){e.draw(false)}else if(r.sX!==""||r.sY!==""){Ut(i)}};this.fnClearTable=function(t){var e=this.api(true).clear();if(t===n||t){e.draw()}};this.fnClose=function(t){this.api(true).row(t).child.hide()};this.fnDeleteRow=function(t,e,i){var r=this.api(true);var s=r.rows(t);var o=s.settings()[0];var a=o.aoData[s[0][0]];s.remove();if(e){e.call(this,o,a)}if(i===n||i){r.draw()}return a};this.fnDestroy=function(t){this.api(true).destroy(t)};this.fnDraw=function(t){this.api(true).draw(t)};this.fnFilter=function(t,e,i,r,s,o){var a=this.api(true);if(e===null||e===n){a.search(t,i,r,o)}else{a.column(e).search(t,i,r,o)}a.draw()};this.fnGetData=function(t,e){var i=this.api(true);if(t!==n){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==n||r=="td"||r=="th"?i.cell(t,e).data():i.row(t).data()||null}return i.data().toArray()};this.fnGetNodes=function(t){var e=this.api(true);return t!==n?e.row(t).node():e.rows().nodes().flatten().toArray()};this.fnGetPosition=function(t){var e=this.api(true);var n=t.nodeName.toUpperCase();if(n=="TR"){return e.row(t).index()}else if(n=="TD"||n=="TH"){var i=e.cell(t).index();return[i.row,i.columnVisible,i.column]}return null};this.fnIsOpen=function(t){return this.api(true).row(t).child.isShown()};this.fnOpen=function(t,e,n){return this.api(true).row(t).child(e,n).show().child()[0]};this.fnPageChange=function(t,e){var i=this.api(true).page(t);if(e===n||e){i.draw(false)}};this.fnSetColumnVis=function(t,e,i){var r=this.api(true).column(t).visible(e);if(i===n||i){r.columns.adjust().draw()}};this.fnSettings=function(){return ce(this[s.iApiIndex])};this.fnSort=function(t){this.api(true).order(t).draw()};this.fnSortListener=function(t,e,n){this.api(true).order.listener(t,e,n)};this.fnUpdate=function(t,e,i,r,s){var o=this.api(true);if(i===n||i===null){o.row(e).data(t)}else{o.cell(e,i).data(t)}if(s===n||s){o.columns.adjust()}if(r===n||r){o.draw()}return 0};this.fnVersionCheck=s.fnVersionCheck;var e=this;var a=t===n;var l=this.length;if(a){t={}}this.oApi=this.internal=s.internal;for(var c in r.ext.internal){if(c){this[c]=Ue(c)}}this.each(function(){var s={};var o=l>1?fe(s,t,true):t;var c=0,u,h,f,d,p;var m=this.getAttribute("id");var g=false;var _=r.defaults;var v=i(this);if(this.nodeName.toLowerCase()!="table"){ue(null,0,"Non-table node initialisation ("+this.nodeName+")",2);return}z(_);P(_.column);D(_,_,true);D(_.column,_.column,true);D(_,i.extend(o,v.data()));var y=r.settings;for(c=0,u=y.length;c<u;c++){var b=y[c];if(b.nTable==this||b.nTHead.parentNode==this||b.nTFoot&&b.nTFoot.parentNode==this){var x=o.bRetrieve!==n?o.bRetrieve:_.bRetrieve;var w=o.bDestroy!==n?o.bDestroy:_.bDestroy;if(a||x){return b.oInstance}else if(w){b.oInstance.fnDestroy();break}else{ue(b,0,"Cannot reinitialise DataTable",3);return}}if(b.sTableId==this.id){y.splice(c,1);break}}if(m===null||m===""){m="DataTables_Table_"+r.ext._unique++;this.id=m}var k=i.extend(true,{},r.models.oSettings,{sDestroyWidth:v[0].style.width,sInstance:m,sTableId:m});k.nTable=this;k.oApi=e.internal;k.oInit=o;y.push(k);k.oInstance=e.length===1?e:v.dataTable();z(o);if(o.oLanguage){E(o.oLanguage)}if(o.aLengthMenu&&!o.iDisplayLength){o.iDisplayLength=i.isArray(o.aLengthMenu[0])?o.aLengthMenu[0][0]:o.aLengthMenu[0]}o=fe(i.extend(true,{},_),o);he(k.oFeatures,o,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]);
538he(k,o,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);he(k.oScroll,o,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);he(k.oLanguage,o,"fnInfoCallback");pe(k,"aoDrawCallback",o.fnDrawCallback,"user");pe(k,"aoServerParams",o.fnServerParams,"user");pe(k,"aoStateSaveParams",o.fnStateSaveParams,"user");pe(k,"aoStateLoadParams",o.fnStateLoadParams,"user");pe(k,"aoStateLoaded",o.fnStateLoaded,"user");pe(k,"aoRowCallback",o.fnRowCallback,"user");pe(k,"aoRowCreatedCallback",o.fnCreatedRow,"user");pe(k,"aoHeaderCallback",o.fnHeaderCallback,"user");pe(k,"aoFooterCallback",o.fnFooterCallback,"user");pe(k,"aoInitComplete",o.fnInitComplete,"user");pe(k,"aoPreDrawCallback",o.fnPreDrawCallback,"user");k.rowIdFn=tt(o.rowId);j(k);var S=k.oClasses;if(o.bJQueryUI){i.extend(S,r.ext.oJUIClasses,o.oClasses);if(o.sDom===_.sDom&&_.sDom==="lfrtip"){k.sDom='<"H"lfr>t<"F"ip>'}if(!k.renderer){k.renderer="jqueryui"}else if(i.isPlainObject(k.renderer)&&!k.renderer.header){k.renderer.header="jqueryui"}}else{i.extend(S,r.ext.classes,o.oClasses)}v.addClass(S.sTable);if(k.iInitDisplayStart===n){k.iInitDisplayStart=o.iDisplayStart;k._iDisplayStart=o.iDisplayStart}if(o.iDeferLoading!==null){k.bDeferLoading=true;var M=i.isArray(o.iDeferLoading);k._iRecordsDisplay=M?o.iDeferLoading[0]:o.iDeferLoading;k._iRecordsTotal=M?o.iDeferLoading[1]:o.iDeferLoading}var T=k.oLanguage;i.extend(true,T,o.oLanguage);if(T.sUrl!==""){i.ajax({dataType:"json",url:T.sUrl,success:function(t){E(t);D(_.oLanguage,t);i.extend(true,T,t);$t(k)},error:function(){$t(k)}});g=true}if(o.asStripeClasses===null){k.asStripeClasses=[S.sStripeOdd,S.sStripeEven]}var C=k.asStripeClasses;var A=v.children("tbody").find("tr").eq(0);if(i.inArray(true,i.map(C,function(t,e){return A.hasClass(t)}))!==-1){i("tbody tr",this).removeClass(C.join(" "));k.asDestroyStripes=C.slice()}var N=[];var I;var L=this.getElementsByTagName("thead");if(L.length!==0){pt(k.aoHeader,L[0]);N=mt(k)}if(o.aoColumns===null){I=[];for(c=0,u=N.length;c<u;c++){I.push(null)}}else{I=o.aoColumns}for(c=0,u=I.length;c<u;c++){$(k,N?N[c]:null)}B(k,o.aoColumnDefs,I,function(t,e){R(k,t,e)});if(A.length){var F=function(t,e){return t.getAttribute("data-"+e)!==null?e:null};i(A[0]).children("th, td").each(function(t,e){var i=k.aoColumns[t];if(i.mData===t){var r=F(e,"sort")||F(e,"order");var s=F(e,"filter")||F(e,"search");if(r!==null||s!==null){i.mData={_:t+".display",sort:r!==null?t+".@data-"+r:n,type:r!==null?t+".@data-"+r:n,filter:s!==null?t+".@data-"+s:n};R(k,t)}}})}var O=k.oFeatures;if(o.bStateSave){O.bStateSave=true;le(k,o);pe(k,"aoDrawCallback",ae,"state_save")}if(o.aaSorting===n){var H=k.aaSorting;for(c=0,u=H.length;c<u;c++){H[c][1]=k.aoColumns[c].asSorting[0]}}se(k);if(O.bSort){pe(k,"aoDrawCallback",function(){if(k.bSorted){var t=te(k);var e={};i.each(t,function(t,n){e[n.src]=n.dir});me(k,null,"order",[k,t,e]);ne(k)}})}pe(k,"aoDrawCallback",function(){if(k.bSorted||ve(k)==="ssp"||O.bDeferRender){se(k)}},"sc");var V=v.children("caption").each(function(){this._captionSide=v.css("caption-side")});var q=v.children("thead");if(q.length===0){q=i("<thead/>").appendTo(this)}k.nTHead=q[0];var Y=v.children("tbody");if(Y.length===0){Y=i("<tbody/>").appendTo(this)}k.nTBody=Y[0];var X=v.children("tfoot");if(X.length===0&&V.length>0&&(k.oScroll.sX!==""||k.oScroll.sY!=="")){X=i("<tfoot/>").appendTo(this)}if(X.length===0||X.children().length===0){v.addClass(S.sNoFooter)}else if(X.length>0){k.nTFoot=X[0];pt(k.aoFooter,k.nTFoot)}if(o.aaData){for(c=0;c<o.aaData.length;c++){U(k,o.aaData[c])}}else if(k.bDeferLoading||ve(k)=="dom"){W(k,i(k.nTBody).children("tr"))}k.aiDisplay=k.aiDisplayMaster.slice();k.bInitialised=true;if(g===false){$t(k)}});e=null;return this};var ye=[];var be=Array.prototype;var xe=function(t){var e,n;var s=r.settings;var o=i.map(s,function(t,e){return t.nTable});if(!t){return[]}else if(t.nTable&&t.oApi){return[t]}else if(t.nodeName&&t.nodeName.toLowerCase()==="table"){e=i.inArray(t,o);return e!==-1?[s[e]]:null}else if(t&&typeof t.settings==="function"){return t.settings().toArray()}else if(typeof t==="string"){n=i(t)}else if(t instanceof i){n=t}if(n){return n.map(function(t){e=i.inArray(this,o);return e!==-1?s[e]:null}).toArray()}};o=function(t,e){if(!(this instanceof o)){return new o(t,e)}var n=[];var r=function(t){var e=xe(t);if(e){n=n.concat(e)}};if(i.isArray(t)){for(var s=0,a=t.length;s<a;s++){r(t[s])}}else{r(t)}this.context=C(n);if(e){i.merge(this,e)}this.selector={rows:null,cols:null,opts:null};o.extend(this,this,ye)};r.Api=o;i.extend(o.prototype,{any:function(){return this.count()!==0},concat:be.concat,context:[],count:function(){return this.flatten().length},each:function(t){for(var e=0,n=this.length;e<n;e++){t.call(this,this[e],e,this)}return this},eq:function(t){var e=this.context;return e.length>t?new o(e[t],this[t]):null},filter:function(t){var e=[];
538if(be.filter){e=be.filter.call(this,t,this)}else{for(var n=0,i=this.length;n<i;n++){if(t.call(this,this[n],n,this)){e.push(this[n])}}}return new o(this.context,e)},flatten:function(){var t=[];return new o(this.context,t.concat.apply(t,this.toArray()))},join:be.join,indexOf:be.indexOf||function(t,e){for(var n=e||0,i=this.length;n<i;n++){if(this[n]===t){return n}}return-1},iterator:function(t,e,i,r){var s=[],a,l,c,u,h,f=this.context,d,p,m,g=this.selector;if(typeof t==="string"){r=i;i=e;e=t;t=false}for(l=0,c=f.length;l<c;l++){var _=new o(f[l]);if(e==="table"){a=i.call(_,f[l],l);if(a!==n){s.push(a)}}else if(e==="columns"||e==="rows"){a=i.call(_,f[l],this[l],l);if(a!==n){s.push(a)}}else if(e==="column"||e==="column-rows"||e==="row"||e==="cell"){p=this[l];if(e==="column-rows"){d=Ce(f[l],g.opts)}for(u=0,h=p.length;u<h;u++){m=p[u];if(e==="cell"){a=i.call(_,f[l],m.row,m.column,l,u)}else{a=i.call(_,f[l],m,l,u,d)}if(a!==n){s.push(a)}}}}if(s.length||r){var v=new o(f,t?s.concat.apply([],s):s);var y=v.selector;y.rows=g.rows;y.cols=g.cols;y.opts=g.opts;return v}return this},lastIndexOf:be.lastIndexOf||function(t,e){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(be.map){e=be.map.call(this,t,this)}else{for(var n=0,i=this.length;n<i;n++){e.push(t.call(this,this[n],n))}}return new o(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:be.pop,push:be.push,reduce:be.reduce||function(t,e){return I(this,t,e,0,this.length,1)},reduceRight:be.reduceRight||function(t,e){return I(this,t,e,this.length-1,-1,-1)},reverse:be.reverse,selector:null,shift:be.shift,sort:be.sort,splice:be.splice,toArray:function(){return be.slice.call(this)},to$:function(){return i(this)},toJQuery:function(){return i(this)},unique:function(){return new o(this.context,C(this))},unshift:be.unshift});o.extend=function(t,e,n){if(!n.length||!e||!(e instanceof o)&&!e.__dt_wrapper){return}var r,s,a,l,c,u,h=function(t,e,n){return function(){var i=e.apply(t,arguments);o.extend(i,i,n.methodExt);return i}};for(r=0,s=n.length;r<s;r++){c=n[r];e[c.name]=typeof c.val==="function"?h(t,c.val,c):i.isPlainObject(c.val)?{}:c.val;e[c.name].__dt_wrapper=true;o.extend(t,e[c.name],c.propExt)}};o.register=a=function(t,e){if(i.isArray(t)){for(var n=0,r=t.length;n<r;n++){o.register(t[n],e)}return}var s,a,l=t.split("."),c=ye,u,h;var f=function(t,e){for(var n=0,i=t.length;n<i;n++){if(t[n].name===e){return t[n]}}return null};for(s=0,a=l.length;s<a;s++){h=l[s].indexOf("()")!==-1;u=h?l[s].replace("()",""):l[s];var d=f(c,u);if(!d){d={name:u,val:{},methodExt:[],propExt:[]};c.push(d)}if(s===a-1){d.val=e}else{c=h?d.methodExt:d.propExt}}};o.registerPlural=l=function(t,e,r){o.register(t,r);o.register(e,function(){var t=r.apply(this,arguments);if(t===this){return this}else if(t instanceof o){return t.length?i.isArray(t[0])?new o(t.context,t[0]):t[0]:n}return t})};var we=function(t,e){if(typeof t==="number"){return[e[t]]}var n=i.map(e,function(t,e){return t.nTable});return i(n).filter(t).map(function(t){var r=i.inArray(this,n);return e[r]}).toArray()};a("tables()",function(t){return t?new o(we(t,this.context)):this});a("table()",function(t){var e=this.tables(t);var n=e.context;return n.length?new o(n[0]):e});l("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable},1)});l("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody},1)});l("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead},1)});l("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot},1)});l("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper},1)});a("draw()",function(t){return this.iterator("table",function(e){if(t==="page"){ht(e)}else{if(typeof t==="string"){t=t==="full-hold"?false:true}ft(e,t===false)}})});a("page()",function(t){if(t===n){return this.page.info().page}return this.iterator("table",function(e){Ht(e,t)})});a("page.info()",function(t){if(this.context.length===0){return n}var e=this.context[0],i=e._iDisplayStart,r=e._iDisplayLength,s=e.fnRecordsDisplay(),o=r===-1;return{page:o?0:Math.floor(i/r),pages:o?1:Math.ceil(s/r),start:i,end:e.fnDisplayEnd(),length:r,recordsTotal:e.fnRecordsTotal(),recordsDisplay:s,serverSide:ve(e)==="ssp"}});a("page.len()",function(t){if(t===n){return this.context.length!==0?this.context[0]._iDisplayLength:n}return this.iterator("table",function(e){Lt(e,t)})});var ke=function(t,e,n){if(n){var i=new o(t);i.one("draw",function(){n(i.ajax.json())})}if(ve(t)=="ssp"){ft(t,e)}else{qt(t,true);var r=t.jqXHR;if(r&&r.readyState!==4){r.abort()}gt(t,[],function(n){it(t);var i=bt(t,n);for(var r=0,s=i.length;r<s;r++){U(t,i[r])}ft(t,e);qt(t,false)})}};a("ajax.json()",function(){var t=this.context;if(t.length>0){return t[0].json}});a("ajax.params()",function(){var t=this.context;if(t.length>0){return t[0].oAjaxData}});a("ajax.reload()",function(t,e){return this.iterator("table",function(n){ke(n,e===false,t)})});a("ajax.url()",function(t){var e=this.context;if(t===n){if(e.length===0){return n}e=e[0];return e.ajax?i.isPlainObject(e.ajax)?e.ajax.url:e.ajax:e.sAjaxSource}return this.iterator("table",function(e){if(i.isPlainObject(e.ajax)){e.ajax.url=t}else{e.ajax=t}})});a("ajax.url().load()",function(t,e){return this.iterator("table",function(n){ke(n,e===false,t)})});var Se=function(t,e,r,o,a){var l=[],c,u,h,f,d,p,m=typeof e;if(!e||m==="string"||m==="function"||e.length===n){e=[e]}for(h=0,f=e.length;h<f;h++){u=e[h]&&e[h].split?e[h].split(","):[e[h]];for(d=0,p=u.length;d<p;
538d++){c=r(typeof u[d]==="string"?i.trim(u[d]):u[d]);if(c&&c.length){l=l.concat(c)}}}var g=s.selector[t];if(g.length){for(h=0,f=g.length;h<f;h++){l=g[h](o,a,l)}}return C(l)};var Me=function(t){if(!t){t={}}if(t.filter&&t.search===n){t.search=t.filter}return i.extend({search:"none",order:"current",page:"all"},t)};var Te=function(t){for(var e=0,n=t.length;e<n;e++){if(t[e].length>0){t[0]=t[e];t[0].length=1;t.length=1;t.context=[t.context[e]];return t}}t.length=0;return t};var Ce=function(t,e){var n,r,s,o=[],a=t.aiDisplay,l=t.aiDisplayMaster;var c=e.search,u=e.order,h=e.page;if(ve(t)=="ssp"){return c==="removed"?[]:S(0,l.length)}else if(h=="current"){for(n=t._iDisplayStart,r=t.fnDisplayEnd();n<r;n++){o.push(a[n])}}else if(u=="current"||u=="applied"){o=c=="none"?l.slice():c=="applied"?a.slice():i.map(l,function(t,e){return i.inArray(t,a)===-1?t:null})}else if(u=="index"||u=="original"){for(n=0,r=t.aoData.length;n<r;n++){if(c=="none"){o.push(n)}else{s=i.inArray(n,a);if(s===-1&&c=="removed"||s>=0&&c=="applied"){o.push(n)}}}}return o};var Ae=function(t,e,r){var s=function(e){var s=_(e);var o,a;if(s!==null&&!r){return[s]}var l=Ce(t,r);if(s!==null&&i.inArray(s,l)!==-1){return[s]}else if(!e){return l}if(typeof e==="function"){return i.map(l,function(n){var i=t.aoData[n];return e(n,i._aData,i.nTr)?n:null})}var c=M(k(t.aoData,l,"nTr"));if(e.nodeName){if(i.inArray(e,c)!==-1){return[e._DT_RowIndex]}}if(typeof e==="string"&&e.charAt(0)==="#"){var u=t.aIds[e.replace(/^#/,"")];if(u!==n){return[u.idx]}}return i(c).filter(e).map(function(){return this._DT_RowIndex}).toArray()};return Se("row",e,s,t,r)};a("rows()",function(t,e){if(t===n){t=""}else if(i.isPlainObject(t)){e=t;t=""}e=Me(e);var r=this.iterator("table",function(n){return Ae(n,t,e)},1);r.selector.rows=t;r.selector.opts=e;return r});a("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||n},1)});a("rows().data()",function(){return this.iterator(true,"rows",function(t,e){return k(t.aoData,e,"_aData")},1)});l("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var i=e.aoData[n];return t==="search"?i._aFilterData:i._aSortData},1)});l("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){st(e,n,t)})});l("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e},1)});l("rows().ids()","row().id()",function(t){var e=[];var n=this.context;for(var i=0,r=n.length;i<r;i++){for(var s=0,a=this[i].length;s<a;s++){var l=n[i].rowIdFn(n[i].aoData[this[i][s]]._aData);e.push((t===true?"#":"")+l)}}return new o(n,e)});l("rows().remove()","row().remove()",function(){var t=this;this.iterator("row",function(e,i,r){var s=e.aoData;var o=s[i];s.splice(i,1);for(var a=0,l=s.length;a<l;a++){if(s[a].nTr!==null){s[a].nTr._DT_RowIndex=a}}rt(e.aiDisplayMaster,i);rt(e.aiDisplay,i);rt(t[r],i,false);ge(e);var c=e.rowIdFn(o._aData);if(c!==n){delete e.aIds[c]}});this.iterator("table",function(t){for(var e=0,n=t.aoData.length;e<n;e++){t.aoData[e].idx=e}});return this});a("rows.add()",function(t){var e=this.iterator("table",function(e){var n,i,r;var s=[];for(i=0,r=t.length;i<r;i++){n=t[i];if(n.nodeName&&n.nodeName.toUpperCase()==="TR"){s.push(W(e,n)[0])}else{s.push(U(e,n))}}return s},1);var n=this.rows(-1);n.pop();i.merge(n,e);return n});a("row()",function(t,e){return Te(this.rows(t,e))});a("row().data()",function(t){var e=this.context;if(t===n){return e.length&&this.length?e[0].aoData[this[0]]._aData:n}e[0].aoData[this[0]]._aData=t;st(e[0],this[0],"data");return this});a("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null});a("row.add()",function(t){if(t instanceof i&&t.length){t=t[0]}var e=this.iterator("table",function(e){if(t.nodeName&&t.nodeName.toUpperCase()==="TR"){return W(e,t)[0]}return U(e,t)});return this.row(e[0])});var De=function(t,e,n,r){var s=[];var o=function(e,n){if(i.isArray(e)||e instanceof i){for(var r=0,a=e.length;r<a;r++){o(e[r],n)}return}if(e.nodeName&&e.nodeName.toLowerCase()==="tr"){s.push(e)}else{var l=i("<tr><td/></tr>").addClass(n);i("td",l).addClass(n).html(e)[0].colSpan=H(t);s.push(l[0])}};o(n,r);if(e._details){e._details.remove()}e._details=i(s);if(e._detailsShow){e._details.insertAfter(e.nTr)}};var Ee=function(t,e){var i=t.context;if(i.length){var r=i[0].aoData[e!==n?e:t[0]];if(r&&r._details){r._details.remove();r._detailsShow=n;r._details=n}}};var Ne=function(t,e){var n=t.context;if(n.length&&t.length){var i=n[0].aoData[t[0]];if(i._details){i._detailsShow=e;if(e){i._details.insertAfter(i.nTr)}else{i._details.detach()}ze(n[0])}}};var ze=function(t){var e=new o(t);var n=".dt.DT_details";var i="draw"+n;var r="column-visibility"+n;var s="destroy"+n;var a=t.aoData;e.off(i+" "+r+" "+s);if(w(a,"_details").length>
5380){e.on(i,function(n,i){if(t!==i){return}e.rows({page:"current"}).eq(0).each(function(t){var e=a[t];if(e._detailsShow){e._details.insertAfter(e.nTr)}})});e.on(r,function(e,n,i,r){if(t!==n){return}var s,o=H(n);for(var l=0,c=a.length;l<c;l++){s=a[l];if(s._details){s._details.children("td[colspan]").attr("colspan",o)}}});e.on(s,function(n,i){if(t!==i){return}for(var r=0,s=a.length;r<s;r++){if(a[r]._details){Ee(e,r)}}})}};var Pe="";var je=Pe+"row().child";var Ie=je+"()";a(Ie,function(t,e){var i=this.context;if(t===n){return i.length&&this.length?i[0].aoData[this[0]]._details:n}else if(t===true){this.child.show()}else if(t===false){Ee(this)}else if(i.length&&this.length){De(i[0],i[0].aoData[this[0]],t,e)}return this});a([je+".show()",Ie+".show()"],function(t){Ne(this,true);return this});a([je+".hide()",Ie+".hide()"],function(){Ne(this,false);return this});a([je+".remove()",Ie+".remove()"],function(){Ee(this);return this});a(je+".isShown()",function(){var t=this.context;if(t.length&&this.length){return t[0].aoData[this[0]]._detailsShow||false}return false});var $e=/^(.+):(name|visIdx|visible)$/;var Re=function(t,e,n,i,r){var s=[];for(var o=0,a=r.length;o<a;o++){s.push(J(t,r[o],e))}return s};var Le=function(t,e,n){var r=t.aoColumns,s=w(r,"sName"),o=w(r,"nTh");var a=function(e){var a=_(e);if(e===""){return S(r.length)}if(a!==null){return[a>=0?a:r.length+a]}if(typeof e==="function"){var l=Ce(t,n);return i.map(r,function(n,i){return e(i,Re(t,i,0,0,l),o[i])?i:null})}var c=typeof e==="string"?e.match($e):"";if(c){switch(c[2]){case"visIdx":case"visible":var u=parseInt(c[1],10);if(u<0){var h=i.map(r,function(t,e){return t.bVisible?e:null});return[h[h.length+u]]}return[F(t,u)];case"name":return i.map(s,function(t,e){return t===c[1]?e:null})}}else{return i(o).filter(e).map(function(){return i.inArray(this,o)}).toArray()}};return Se("column",e,a,t,n)};var Fe=function(t,e,r,s){var o=t.aoColumns,a=o[e],l=t.aoData,c,u,h,f,d;if(r===n){return a.bVisible}if(a.bVisible===r){return}if(r){var p=i.inArray(true,w(o,"bVisible"),e+1);for(h=0,f=l.length;h<f;h++){d=l[h].nTr;u=l[h].anCells;if(d){d.insertBefore(u[e],u[p]||null)}}}else{i(w(t.aoData,"anCells",e)).detach()}a.bVisible=r;ut(t,t.aoHeader);ut(t,t.aoFooter);if(s===n||s){L(t);if(t.oScroll.sX||t.oScroll.sY){Ut(t)}}me(t,null,"column-visibility",[t,e,r]);ae(t)};a("columns()",function(t,e){if(t===n){t=""}else if(i.isPlainObject(t)){e=t;t=""}e=Me(e);var r=this.iterator("table",function(n){return Le(n,t,e)},1);r.selector.cols=t;r.selector.opts=e;return r});l("columns().header()","column().header()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh},1)});l("columns().footer()","column().footer()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf},1)});l("columns().data()","column().data()",function(){return this.iterator("column-rows",Re,1)});l("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData},1)});l("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,i,r,s){return k(e.aoData,s,t==="search"?"_aFilterData":"_aSortData",n)},1)});l("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,i,r){return k(t.aoData,r,"anCells",e)},1)});l("columns().visible()","column().visible()",function(t,e){return this.iterator("column",function(i,r){if(t===n){return i.aoColumns[r].bVisible}Fe(i,r,t,e)})});l("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return t==="visible"?O(e,n):n},1)});a("columns.adjust()",function(){return this.iterator("table",function(t){L(t)},1)});a("column.index()",function(t,e){if(this.context.length!==0){var n=this.context[0];if(t==="fromVisible"||t==="toData"){return F(n,e)}else if(t==="fromData"||t==="toVisible"){return O(n,e)}}});a("column()",function(t,e){return Te(this.columns(t,e))});var Oe=function(t,e,r){var s=t.aoData;var o=Ce(t,r);var a=M(k(s,o,"anCells"));var l=i([].concat.apply([],a));var c;var u=t.aoColumns.length;var h,f,d,p,m,g;var _=function(e){var r=typeof e==="function";if(e===null||e===n||r){h=[];for(f=0,d=o.length;f<d;f++){c=o[f];for(p=0;p<u;p++){m={row:c,column:p};if(r){g=s[c];if(e(m,J(t,c,p),g.anCells?g.anCells[p]:null)){h.push(m)}}else{h.push(m)}}}return h}if(i.isPlainObject(e)){return[e]}return l.filter(e).map(function(t,e){if(e.parentNode){c=e.parentNode._DT_RowIndex}else{for(t=0,d=s.length;t<d;t++){if(i.inArray(e,s[t].anCells)!==-1){c=t;break}}}return{row:c,column:i.inArray(e,s[c].anCells)}}).toArray()};return Se("cell",e,_,t,r)};a("cells()",function(t,e,r){if(i.isPlainObject(t)){if(t.row===n){r=t;t=null}else{r=e;e=null}}if(i.isPlainObject(e)){r=e;e=null}if(e===null||e===n){return this.iterator("table",function(e){return Oe(e,t,Me(r))})}var s=this.columns(e,r);var o=this.rows(t,r);var a,l,c,u,h;var f=this.iterator("table",function(t,e){a=[];for(l=0,c=o[e].length;l<c;l++){for(u=0,h=s[e].length;u<h;u++){a.push({row:o[e][l],column:s[e][u]})}}return a},1);i.extend(f.selector,{cols:e,rows:t,opts:r});return f});l("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,
538i){var r=t.aoData[e].anCells;return r?r[i]:n},1)});a("cells().data()",function(){return this.iterator("cell",function(t,e,n){return J(t,e,n)},1)});l("cells().cache()","cell().cache()",function(t){t=t==="search"?"_aFilterData":"_aSortData";return this.iterator("cell",function(e,n,i){
539return e.aoData[n][t][i]},1)});l("cells().render()","cell().render()",function(t){return this.iterator("cell",function(e,n,i){return J(e,n,i,t)},1)});l("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:O(t,n)}},1)});l("cells().invalidate()","cell().invalidate()",function(t){return this.iterator("cell",function(e,n,i){st(e,n,t,i)})});a("cell()",function(t,e,n){return Te(this.cells(t,e,n))});a("cell().data()",function(t){var e=this.context;var i=this[0];if(t===n){return e.length&&i.length?J(e[0],i[0].row,i[0].column):n}G(e[0],i[0].row,i[0].column,t);st(e[0],i[0].row,"data",i[0].column);return this});a("order()",function(t,e){var r=this.context;if(t===n){return r.length!==0?r[0].aaSorting:n}if(typeof t==="number"){t=[[t,e]]}else if(!i.isArray(t[0])){t=Array.prototype.slice.call(arguments)}return this.iterator("table",function(e){e.aaSorting=t.slice()})});a("order.listener()",function(t,e,n){return this.iterator("table",function(i){re(i,t,e,n)})});a(["columns().order()","column().order()"],function(t){var e=this;return this.iterator("table",function(n,r){var s=[];i.each(e[r],function(e,n){s.push([n,t])});n.aaSorting=s})});a("search()",function(t,e,r,s){var o=this.context;if(t===n){return o.length!==0?o[0].oPreviousSearch.sSearch:n}return this.iterator("table",function(n){if(!n.oFeatures.bFilter){return}wt(n,i.extend({},n.oPreviousSearch,{sSearch:t+"",bRegex:e===null?false:e,bSmart:r===null?true:r,bCaseInsensitive:s===null?true:s}),1)})});l("columns().search()","column().search()",function(t,e,r,s){return this.iterator("column",function(o,a){var l=o.aoPreSearchCols;if(t===n){return l[a].sSearch}if(!o.oFeatures.bFilter){return}i.extend(l[a],{sSearch:t+"",bRegex:e===null?false:e,bSmart:r===null?true:r,bCaseInsensitive:s===null?true:s});wt(o,o.oPreviousSearch,1)})});a("state()",function(){return this.context.length?this.context[0].oSavedState:null});a("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})});a("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});a("state.save()",function(){return this.iterator("table",function(t){ae(t)})});r.versionCheck=r.fnVersionCheck=function(t){var e=r.version.split(".");var n=t.split(".");var i,s;for(var o=0,a=n.length;o<a;o++){i=parseInt(e[o],10)||0;s=parseInt(n[o],10)||0;if(i===s){continue}return i>s}return true};r.isDataTable=r.fnIsDataTable=function(t){var e=i(t).get(0);var n=false;i.each(r.settings,function(t,r){var s=r.nScrollHead?i("table",r.nScrollHead)[0]:null;var o=r.nScrollFoot?i("table",r.nScrollFoot)[0]:null;if(r.nTable===e||s===e||o===e){n=true}});return n};r.tables=r.fnTables=function(t){var e=false;if(i.isPlainObject(t)){e=t.api;t=t.visible}var n=i.map(r.settings,function(e){if(!t||t&&i(e.nTable).is(":visible")){return e.nTable}});return e?new o(n):n};r.util={throttle:Jt,escapeRegex:Ct};r.camelToHungarian=D;a("$()",function(t,e){var n=this.rows(e).nodes(),r=i(n);return i([].concat(r.filter(t).toArray(),r.find(t).toArray()))});i.each(["on","one","off"],function(t,e){a(e+"()",function(){var t=Array.prototype.slice.call(arguments);if(!t[0].match(/\.dt\b/)){t[0]+=".dt"}var n=i(this.tables().nodes());n[e].apply(n,t);return this})});a("clear()",function(){return this.iterator("table",function(t){it(t)})});a("settings()",function(){return new o(this.context,this.context)});a("init()",function(){var t=this.context;return t.length?t[0].oInit:null});a("data()",function(){return this.iterator("table",function(t){return w(t.aoData,"_aData")}).flatten()});a("destroy()",function(e){e=e||false;return this.iterator("table",function(n){var s=n.nTableWrapper.parentNode;var a=n.oClasses;var l=n.nTable;var c=n.nTBody;var u=n.nTHead;var h=n.nTFoot;var f=i(l);var d=i(c);var p=i(n.nTableWrapper);var m=i.map(n.aoData,function(t){return t.nTr});var g,_;n.bDestroying=true;me(n,"aoDestroyCallback","destroy",[n]);if(!e){new o(n).columns().visible(true)}p.unbind(".DT").find(":not(tbody *)").unbind(".DT");i(t).unbind(".DT-"+n.sInstance);if(l!=u.parentNode){f.children("thead").detach();f.append(u)}if(h&&l!=h.parentNode){f.children("tfoot").detach();f.append(h)}n.aaSorting=[];n.aaSortingFixed=[];se(n);i(m).removeClass(n.asStripeClasses.join(" "));i("th, td",u).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone);if(n.bJUI){i("th span."+a.sSortIcon+", td span."+a.sSortIcon,u).detach();i("th, td",u).each(function(){var t=i("div."+a.sSortJUIWrapper,this);i(this).append(t.contents());t.detach()})}d.children().detach();d.append(m);var v=e?"remove":"detach";f[v]();p[v]();
539if(!e&&s){s.insertBefore(l,n.nTableReinsertBefore);f.css("width",n.sDestroyWidth).removeClass(a.sTable);_=n.asDestroyStripes.length;if(_){d.children().each(function(t){i(this).addClass(n.asDestroyStripes[t%_])})}}var y=i.inArray(n,r.settings);if(y!==-1){r.settings.splice(y,1)}})});i.each(["column","row","cell"],function(t,e){a(e+"s().every()",function(t){return this.iterator(e,function(i,r,s,a,l){t.call(new o(i)[e](r,e==="cell"?s:n),r,s,a,l)})})});a("i18n()",function(t,e,r){var s=this.context[0];var o=tt(t)(s.oLanguage);if(o===n){o=e}if(r!==n&&i.isPlainObject(o)){o=o[r]!==n?o[r]:o._}return o.replace("%d",r)});r.version="1.10.9";r.settings=[];r.models={};r.models.oSearch={bCaseInsensitive:true,sSearch:"",bRegex:false,bSmart:true};r.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};r.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:false,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};r.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:true,bDeferRender:false,bDestroy:false,bFilter:true,bInfo:true,bJQueryUI:false,bLengthChange:true,bPaginate:true,bProcessing:false,bRetrieve:false,bScrollCollapse:false,bServerSide:false,bSort:true,bSortMulti:true,bSortCellsTop:false,bSortClasses:true,bStateSave:false,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((t.iStateDuration===-1?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(e){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(t.iStateDuration===-1?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:i.extend({},r.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};A(r.defaults);r.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:true,bSortable:true,bVisible:true,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};A(r.defaults.column);r.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:false,bScrollbarLeft:false,bBounding:false,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:false,bInitialised:false,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:true,jqXHR:null,json:n,oAjaxD
539ata:n,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:false,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:false,bSorted:false,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return ve(this)=="ssp"?this._iRecordsTotal*1:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return ve(this)=="ssp"?this._iRecordsDisplay*1:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,i=this.aiDisplay.length,r=this.oFeatures,s=r.bPaginate;if(r.bServerSide){return s===false||t===-1?e+i:Math.min(e+t,this._iRecordsDisplay)}else{return!s||n>i||t===-1?i:n}},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};r.ext=s={buttons:{},classes:{},errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:r.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:r.version};i.extend(s,{afnFiltering:s.search,aTypes:s.type.detect,ofnSearch:s.type.search,oSort:s.type.order,afnSortData:s.order,aoFeatures:s.feature,oApi:s.internal,oStdClasses:s.classes,oPagination:s.pager});i.extend(r.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});(function(){var t="";t="";var e=t+"ui-state-default";var n=t+"css_right ui-icon ui-icon-";var s=t+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";i.extend(r.ext.oJUIClasses,r.ext.classes,{sPageButton:"fg-button ui-button "+e,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi "+"ui-buttonset-multi paging_",sSortAsc:e+" sorting_asc",sSortDesc:e+" sorting_desc",sSortable:e+" sorting",sSortableAsc:e+" sorting_asc_disabled",sSortableDesc:e+" sorting_desc_disabled",sSortableNone:e+" sorting_disabled",sSortJUIAsc:n+"triangle-1-n",sSortJUIDesc:n+"triangle-1-s",sSortJUI:n+"carat-2-n-s",sSortJUIAscAllowed:n+"carat-1-n",sSortJUIDescAllowed:n+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+e,sScrollFoot:"dataTables_scrollFoot "+e,sHeaderTH:e,sFooterTH:e,sJUIHeader:s+" ui-corner-tl ui-corner-tr",sJUIFooter:s+" ui-corner-bl ui-corner-br"})})();var He=r.ext.pager;function Ve(t,e){var n=[],i=He.numbers_length,r=Math.floor(i/2),s=1;if(e<=i){n=S(0,e)}else if(t<=r){n=S(0,i-2);n.push("ellipsis");n.push(e-1)}else if(t>=e-1-r){n=S(e-(i-2),e);n.splice(0,0,"ellipsis");n.splice(0,0,0)}else{n=S(t-r+2,t+r-1);n.push("ellipsis");n.push(e-1);n.splice(0,0,"ellipsis");n.splice(0,0,0)}n.DT_el="span";return n}i.extend(He,{simple:function(t,e){return["previous","next"]},full:function(t,e){return["first","previous","next","last"]},numbers:function(t,e){return[Ve(t,e)]},simple_numbers:function(t,e){return["previous",Ve(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Ve(t,e),"next","last"]},_numbers:Ve,numbers_length:7});i.extend(true,r.ext.renderer,{pageButton:{_:function(t,n,r,s,o,a){var l=t.oClasse
539s;var c=t.oLanguage.oPaginate;var u,h,f=0;var d=function(e,n){var s,p,m,g;var _=function(e){Ht(t,e.data.action,true)};for(s=0,p=n.length;s<p;s++){g=n[s];if(i.isArray(g)){var v=i("<"+(g.DT_el||"div")+"/>").appendTo(e);d(v,g)}else{u=null;h="";switch(g){case"ellipsis":e.append('<span class="ellipsis">&#x2026;</span>');break;case"first":u=c.sFirst;h=g+(o>0?"":" "+l.sPageButtonDisabled);break;case"previous":u=c.sPrevious;h=g+(o>0?"":" "+l.sPageButtonDisabled);break;case"next":u=c.sNext;h=g+(o<a-1?"":" "+l.sPageButtonDisabled);break;case"last":u=c.sLast;h=g+(o<a-1?"":" "+l.sPageButtonDisabled);break;default:u=g+1;h=o===g?l.sPageButtonActive:"";break}if(u!==null){m=i("<a>",{"class":l.sPageButton+" "+h,"aria-controls":t.sTableId,"data-dt-idx":f,tabindex:t.iTabIndex,id:r===0&&typeof g==="string"?t.sTableId+"_"+g:null}).html(u).appendTo(e);de(m,{action:g},_);f++}}}};var p;try{p=i(n).find(e.activeElement).data("dt-idx")}catch(m){}d(i(n).empty(),s);if(p){i(n).find("[data-dt-idx="+p+"]").focus()}}}});i.extend(r.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return y(t,n)?"num"+n:null},function(t,e){if(t&&!(t instanceof Date)&&(!f.test(t)||!d.test(t))){return null}var n=Date.parse(t);return n!==null&&!isNaN(n)||g(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return y(t,n,true)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return x(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return x(t,n,true)?"html-num-fmt"+n:null},function(t,e){return g(t)||typeof t==="string"&&t.indexOf("<")!==-1?"html":null}]);i.extend(r.ext.type.search,{html:function(t){return g(t)?t:typeof t==="string"?t.replace(u," ").replace(h,""):""},string:function(t){return g(t)?t:typeof t==="string"?t.replace(u," "):t}});var qe=function(t,e,n,i){if(t!==0&&(!t||t==="-")){return-Infinity}if(e){t=v(t,e)}if(t.replace){if(n){t=t.replace(n,"")}if(i){t=t.replace(i,"")}}return t*1};function Be(t){i.each({num:function(e){return qe(e,t)},"num-fmt":function(e){return qe(e,t,m)},"html-num":function(e){return qe(e,t,h)},"html-num-fmt":function(e){return qe(e,t,h,m)}},function(e,n){s.type.order[e+t+"-pre"]=n;
539if(e.match(/^html\-/)){s.type.search[e+t]=s.type.search.html}})}i.extend(s.type.order,{"date-pre":function(t){return Date.parse(t)||0},"html-pre":function(t){return g(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return g(t)?"":typeof t==="string"?t.toLowerCase():!t.toString?"":t.toString()},"string-asc":function(t,e){return t<e?-1:t>e?1:0},"string-desc":function(t,e){return t<e?1:t>e?-1:0}});Be("");i.extend(true,r.ext.renderer,{header:{_:function(t,e,n,r){i(t.nTable).on("order.dt.DT",function(i,s,o,a){if(t!==s){return}var l=n.idx;e.removeClass(n.sSortingClass+" "+r.sSortAsc+" "+r.sSortDesc).addClass(a[l]=="asc"?r.sSortAsc:a[l]=="desc"?r.sSortDesc:n.sSortingClass)})},jqueryui:function(t,e,n,r){i("<div/>").addClass(r.sSortJUIWrapper).append(e.contents()).append(i("<span/>").addClass(r.sSortIcon+" "+n.sSortingClassJUI)).appendTo(e);i(t.nTable).on("order.dt.DT",function(i,s,o,a){if(t!==s){return}var l=n.idx;e.removeClass(r.sSortAsc+" "+r.sSortDesc).addClass(a[l]=="asc"?r.sSortAsc:a[l]=="desc"?r.sSortDesc:n.sSortingClass);e.find("span."+r.sSortIcon).removeClass(r.sSortJUIAsc+" "+r.sSortJUIDesc+" "+r.sSortJUI+" "+r.sSortJUIAscAllowed+" "+r.sSortJUIDescAllowed).addClass(a[l]=="asc"?r.sSortJUIAsc:a[l]=="desc"?r.sSortJUIDesc:n.sSortingClassJUI)})}}});r.render={number:function(t,e,n,i,r){return{display:function(s){if(typeof s!=="number"&&typeof s!=="string"){return s}var o=s<0?"-":"";s=Math.abs(parseFloat(s));var a=parseInt(s,10);var l=n?e+(s-a).toFixed(n).substring(2):"";return o+(i||"")+a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+l+(r||"")}}}};function Ue(t){return function(){var e=[ce(this[r.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return r.ext.internal[t].apply(this,e)}}i.extend(r.ext.internal,{_fnExternApiFunc:Ue,_fnBuildAjax:gt,_fnAjaxUpdate:_t,_fnAjaxParameters:vt,_fnAjaxUpdateDraw:yt,_fnAjaxDataSrc:bt,_fnAddColumn:$,_fnColumnOptions:R,_fnAdjustColumnSizing:L,_fnVisibleToColumnIndex:F,_fnColumnIndexToVisible:O,_fnVisbleColumns:H,_fnGetColumns:V,_fnColumnTypes:q,_fnApplyColumnDefs:B,_fnHungarianMap:A,_fnCamelToHungarian:D,_fnLanguageCompat:E,_fnBrowserDetect:j,_fnAddData:U,_fnAddTr:W,_fnNodeToDataIndex:Y,_fnNodeToColumnIndex:X,_fnGetCellData:J,_fnSetCellData:G,_fnSplitObjNotation:Q,_fnGetObjectDataFn:tt,_fnSetObjectDataFn:et,_fnGetDataMaster:nt,_fnClearTable:it,_fnDeleteIndex:rt,_fnInvalidate:st,_fnGetRowElements:ot,_fnCreateTr:at,_fnBuildHead:ct,_fnDrawHead:ut,_fnDraw:ht,_fnReDraw:ft,_fnAddOptionsHtml:dt,_fnDetectHeader:pt,_fnGetUniqueThs:mt,_fnFeatureHtmlFilter:xt,_fnFilterComplete:wt,_fnFilterCustom:kt,_fnFilterColumn:St,_fnFilter:Mt,_fnFilterCreateSearch:Tt,_fnEscapeRegex:Ct,_fnFilterData:Et,_fnFeatureHtmlInfo:Pt,_fnUpdateInfo:jt,_fnInfoMacros:It,_fnInitialise:$t,_fnInitComplete:Rt,_fnLengthChange:Lt,_fnFeatureHtmlLength:Ft,_fnFeatureHtmlPaginate:Ot,_fnPageChange:Ht,_fnFeatureHtmlProcessing:Vt,_fnProcessingDisplay:qt,_fnFeatureHtmlTable:Bt,_fnScrollDraw:Ut,_fnApplyToChildren:Wt,_fnCalculateColumnWidths:Xt,_fnThrottle:Jt,_fnConvertToWidth:Gt,_fnGetWidestNode:Kt,_fnGetMaxLenString:Zt,_fnStringToCss:Qt,_fnSortFlatten:te,_fnSort:ee,_fnSortAria:ne,_fnSortListener:ie,_fnSortAttachListener:re,_fnSortingClasses:se,_fnSortData:oe,_fnSaveState:ae,_fnLoadState:le,_fnSettingsFromNode:ce,_fnLog:ue,_fnMap:he,_fnBindAction:de,_fnCallbackReg:pe,_fnCallbackFire:me,_fnLengthOverflow:ge,_fnRenderer:_e,_fnDataSource:ve,_fnRowAttributes:lt,_fnCalculateEnd:function(){}});i.fn.dataTable=r;i.fn.dataTableSettings=r.settings;i.fn.dataTableExt=r.ext;i.fn.DataTable=function(t){return i(this).dataTable(t).api()};i.each(r,function(t,e){i.fn.DataTable[t]=e});return i.fn.dataTable})})(window,document);
540/*!
541 * @preserve
542 *
543 * Readmore.js jQuery plugin
544 * Author: @jed_foster
545 * Project home: http://jedfoster.github.io/Readmore.js
546 * Licensed under the MIT license
547 *
548 * Debounce function from http://davidwalsh.name/javascript-debounce-function
549 */
550/*!
551 * @preserve
552 *
553 * Readmore.js jQuery plugin
554 * Author: @jed_foster
555 * Project home: http://jedfoster.github.io/Readmore.js
556 * Licensed under the MIT license
557 *
558 * Debounce function from http://davidwalsh.name/javascript-debounce-function
559 */
560(function(t){"use strict";var e="readmore",n={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:true,blockCSS:"display: block; width: 100%;",startOpen:false,beforeToggle:function(){},afterToggle:function(){}},i={},r=0;function s(t,e,n){var i;return function(){var r=this,s=arguments;var o=function(){i=null;if(!n){t.apply(r,s)}};var a=n&&!i;clearTimeout(i);i=setTimeout(o,e);if(a){t.apply(r,s)}}}function o(t){var e=++r;return String(t==null?"rmjs-":t)+e}function a(t){var e=t.clone().css({height:"auto",width:t.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(t),n=e.outerHeight(),i=parseInt(e.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),r=t.data("defaultHeight");e.remove();var s=i||t.data("collapsedHeight")||r;t.data({expandedHeight:n,maxHeight:i,collapsedHeight:s}).css({maxHeight:"none"})}var l=s(function(){t("[data-readmore]").each(function(){var e=t(this),n=e.attr("aria-expanded")==="true";a(e);e.css({height:e.data(n?"expandedHeight":"collapsedHeight")})})},100);function c(t){if(!i[t.selector]){var e=" ";if(t.embedCSS&&t.blockCSS!==""){e+=t.selector+" + [data-readmore-toggle], "+t.selector+"[data-readmore]{"+t.blockCSS+"}"}e+=t.selector+"[data-readmore]{"+"transition: height "+t.speed+"ms;"+"overflow: hidden;"+"}";(function(t,e){var n=t.createElement("style");n.type="text/css";if(n.styleSheet){n.styleSheet.cssText=e}else{n.appendChild(t.createTextNode(e))}t.getElementsByTagName("head")[0].appendChild(n)})(document,e);i[t.selector]=true}}function u(i,r){var s=this;this.element=i;this.options=t.extend({},n,r);c(this.options);this._defaults=n;this._name=e;this.init();if(window.addEventListener){window.addEventListener("load",l);window.addEventListener("resize",l)}else{window.attachEvent("load",l);window.attachEvent("resize",l)}}u.prototype={init:function(){var e=this,n=t(this.element);n.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin});a(n);
560var i=n.data("collapsedHeight"),r=n.data("heightMargin");if(n.outerHeight(true)<=i+r){return true}else{var s=n.attr("id")||o(),l=e.options.startOpen?e.options.lessLink:e.options.moreLink;n.attr({"data-readmore":"","aria-expanded":false,id:s});n.after(t(l).on("click",function(t){e.toggle(this,n[0],t)}).attr({"data-readmore-toggle":"","aria-controls":s}));if(!e.options.startOpen){n.css({height:i})}}},toggle:function(e,n,i){if(i){i.preventDefault()}if(!e){e=t('[aria-controls="'+this.element.id+'"]')[0]}if(!n){n=this.element}var r=this,s=t(n),o="",a="",l=false,c=s.data("collapsedHeight");if(s.height()<=c){o=s.data("expandedHeight")+"px";a="lessLink";l=true}else{o=c;a="moreLink"}r.options.beforeToggle(e,n,!l);s.css({height:o});s.on("transitionend",function(){r.options.afterToggle(e,n,l);t(this).attr({"aria-expanded":l}).off("transitionend")});t(e).replaceWith(t(r.options[a]).on("click",function(t){r.toggle(this,n,t)}).attr({"data-readmore-toggle":"","aria-controls":s.attr("id")}))},destroy:function(){t(this.element).each(function(){var e=t(this);e.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove();e.removeData()})}};t.fn.readmore=function(n){var i=arguments,r=this.selector;n=n||{};if(typeof n==="object"){return this.each(function(){if(t.data(this,"plugin_"+e)){var i=t.data(this,"plugin_"+e);i.destroy.apply(i)}n.selector=r;t.data(this,"plugin_"+e,new u(this,n))})}else if(typeof n==="string"&&n[0]!=="_"&&n!=="init"){return this.each(function(){var r=t.data(this,"plugin_"+e);if(r instanceof u&&typeof r[n]==="function"){r[n].apply(r,Array.prototype.slice.call(i,1))}})}}})(jQuery);
561/*
562jQuery.Turbolinks ~ https://github.com/kossnocorp/jquery.turbolinks
563jQuery plugin for drop-in fix binded events problem caused by Turbolinks
564
565The MIT License
566Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
567 */
568/*
569jQuery.Turbolinks ~ https://github.com/kossnocorp/jquery.turbolinks
570jQuery plugin for drop-in fix binded events problem caused by Turbolinks
571
572The MIT License
573Copyright (c) 2012-2013 Sasha Koss & Rico Sta. Cruz
574 */
575(function(){var t,e;t=window.jQuery||(typeof require==="function"?require("jquery"):void 0);e=t(document);t.turbo={version:"2.1.0",isReady:false,use:function(t,n){return e.off(".turbo").on(""+t+".turbo",this.onLoad).on(""+n+".turbo",this.onFetch)},addCallback:function(n){if(t.turbo.isReady){n(t)}return e.on("turbo:ready",function(){return n(t)})},onLoad:function(){t.turbo.isReady=true;return e.trigger("turbo:ready")},onFetch:function(){return t.turbo.isReady=false},register:function(){t(this.onLoad);return t.fn.ready=this.addCallback}};t.turbo.register();t.turbo.use("page:load","page:fetch")}).call(this);
576/* ========================================================================
577 * Bootstrap: transition.js v3.3.7
578 * http://getbootstrap.com/javascript/#transitions
579 * ========================================================================
580 * Copyright 2011-2016 Twitter, Inc.
581 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
582 * ======================================================================== */+function(t){"use strict";function e(){var t=document.createElement("bootstrap");var e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e){if(t.style[n]!==undefined){return{end:e[n]}}}return false}t.fn.emulateTransitionEnd=function(e){var n=false;var i=this;t(this).one("bsTransitionEnd",function(){n=true});var r=function(){if(!n)t(i).trigger(t.support.transition.end)};setTimeout(r,e);return this};t(function(){t.support.transition=e();if(!t.support.transition)return;t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);
583/* ========================================================================
584 * Bootstrap: alert.js v3.3.7
585 * http://getbootstrap.com/javascript/#alerts
586 * ========================================================================
587 * Copyright 2011-2016 Twitter, Inc.
588 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
589 * ======================================================================== */+function(t){"use strict";var e='[data-dismiss="alert"]';var n=function(n){t(n).on("click",e,this.close)};n.VERSION="3.3.7";n.TRANSITION_DURATION=150;n.prototype.close=function(e){var i=t(this);var r=i.attr("data-target");if(!r){r=i.attr("href");r=r&&r.replace(/.*(?=#[^\s]*$)/,"")}var s=t(r==="#"?[]:r);if(e)e.preventDefault();if(!s.length){s=i.closest(".alert")}s.trigger(e=t.Event("close.bs.alert"));if(e.isDefaultPrevented())return;s.removeClass("in");function o(){s.detach().trigger("closed.bs.alert").remove()}t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(n.TRANSITION_DURATION):o()};function i(e){return this.each(function(){var i=t(this);var r=i.data("bs.alert");if(!r)i.data("bs.alert",r=new n(this));if(typeof e=="string")r[e].call(i)})}var r=t.fn.alert;t.fn.alert=i;t.fn.alert.Constructor=n;t.fn.alert.noConflict=function(){t.fn.alert=r;return this};t(document).on("click.bs.alert.data-api",e,n.prototype.close)}(jQuery);
590/* ========================================================================
591 * Bootstrap: button.js v3.3.7
592 * http://getbootstrap.com/javascript/#buttons
593 * ========================================================================
594 * Copyright 2011-2016 Twitter, Inc.
595 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
596 * ======================================================================== */+function(t){"use strict";var e=function(n,i){this.$element=t(n);this.options=t.extend({},e.DEFAULTS,i);this.isLoading=false};e.VERSION="3.3.7";e.DEFAULTS={loadingText:"loading..."};e.prototype.setState=function(e){var n="disabled";var i=this.$element;var r=i.is("input")?"val":"html";var s=i.data();e+="Text";if(s.resetText==null)i.data("resetText",i[r]());setTimeout(t.proxy(function(){i[r](s[e]==null?this.options[e]:s[e]);if(e=="loadingText"){this.isLoading=true;i.addClass(n).attr(n,n).prop(n,true)}else if(this.isLoading){this.isLoading=false;i.removeClass(n).removeAttr(n).prop(n,false)}},this),0)};e.prototype.toggle=function(){var t=true;var e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");if(n.prop("type")=="radio"){if(n.prop("checked"))t=false;e.find(".active").removeClass("active");this.$element.addClass("active")}else if(n.prop("type")=="checkbox"){if(n.prop("checked")!==this.$element.hasClass("active"))t=false;this.$element.toggleClass("active")}n.prop("checked",this.$element.hasClass("active"));if(t)n.trigger("change")}else{this.$element.attr("aria-pressed",!this.$element.hasClass("active"));this.$element.toggleClass("active")}};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.button");var s=typeof n=="object"&&n;if(!r)i.data("bs.button",r=new e(this,s));
vendor: 35,163 bytes, lines 596-653
596if(n=="toggle")r.toggle();else if(n)r.setState(n)})}var i=t.fn.button;t.fn.button=n;t.fn.button.Constructor=e;t.fn.button.noConflict=function(){t.fn.button=i;return this};t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var i=t(e.target).closest(".btn");n.call(i,"toggle");if(!t(e.target).is('input[type="radio"], input[type="checkbox"]')){e.preventDefault();if(i.is("input,button"))i.trigger("focus");else i.find("input:visible,button:visible").first().trigger("focus")}}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery);
597/* ========================================================================
598 * Bootstrap: carousel.js v3.3.7
599 * http://getbootstrap.com/javascript/#carousel
600 * ========================================================================
601 * Copyright 2011-2016 Twitter, Inc.
602 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
603 * ======================================================================== */+function(t){"use strict";var e=function(e,n){this.$element=t(e);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",t.proxy(this.keydown,this));this.options.pause=="hover"&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};e.VERSION="3.3.7";e.TRANSITION_DURATION=600;e.DEFAULTS={interval:5e3,pause:"hover",wrap:true,keyboard:true};e.prototype.keydown=function(t){if(/input|textarea/i.test(t.target.tagName))return;switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()};e.prototype.cycle=function(e){e||(this.paused=false);this.interval&&clearInterval(this.interval);this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval));return this};e.prototype.getItemIndex=function(t){this.$items=t.parent().children(".item");return this.$items.index(t||this.$active)};e.prototype.getItemForDirection=function(t,e){var n=this.getItemIndex(e);var i=t=="prev"&&n===0||t=="next"&&n==this.$items.length-1;if(i&&!this.options.wrap)return e;var r=t=="prev"?-1:1;var s=(n+r)%this.$items.length;return this.$items.eq(s)};e.prototype.to=function(t){var e=this;var n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(t>this.$items.length-1||t<0)return;if(this.sliding)return this.$element.one("slid.bs.carousel",function(){e.to(t)});if(n==t)return this.pause().cycle();return this.slide(t>n?"next":"prev",this.$items.eq(t))};e.prototype.pause=function(e){e||(this.paused=true);if(this.$element.find(".next, .prev").length&&t.support.transition){this.$element.trigger(t.support.transition.end);this.cycle(true)}this.interval=clearInterval(this.interval);return this};e.prototype.next=function(){if(this.sliding)return;return this.slide("next")};e.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")};e.prototype.slide=function(n,i){var r=this.$element.find(".item.active");var s=i||this.getItemForDirection(n,r);var o=this.interval;var a=n=="next"?"left":"right";var l=this;if(s.hasClass("active"))return this.sliding=false;var c=s[0];var u=t.Event("slide.bs.carousel",{relatedTarget:c,direction:a});this.$element.trigger(u);if(u.isDefaultPrevented())return;this.sliding=true;o&&this.pause();if(this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=t(this.$indicators.children()[this.getItemIndex(s)]);h&&h.addClass("active")}var f=t.Event("slid.bs.carousel",{relatedTarget:c,direction:a});if(t.support.transition&&this.$element.hasClass("slide")){s.addClass(n);s[0].offsetWidth;r.addClass(a);s.addClass(a);r.one("bsTransitionEnd",function(){s.removeClass([n,a].join(" ")).addClass("active");r.removeClass(["active",a].join(" "));l.sliding=false;setTimeout(function(){l.$element.trigger(f)},0)}).emulateTransitionEnd(e.TRANSITION_DURATION)}else{r.removeClass("active");s.addClass("active");this.sliding=false;this.$element.trigger(f)}o&&this.cycle();return this};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.carousel");var s=t.extend({},e.DEFAULTS,i.data(),typeof n=="object"&&n);var o=typeof n=="string"?n:s.slide;if(!r)i.data("bs.carousel",r=new e(this,s));if(typeof n=="number")r.to(n);else if(o)r[o]();else if(s.interval)r.pause().cycle()})}var i=t.fn.carousel;t.fn.carousel=n;t.fn.carousel.Constructor=e;t.fn.carousel.noConflict=function(){t.fn.carousel=i;return this};var r=function(e){var i;var r=t(this);var s=t(r.attr("data-target")||(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""));if(!s.hasClass("carousel"))return;var o=t.extend({},s.data(),r.data());var a=r.attr("data-slide-to");if(a)o.interval=false;n.call(s,o);if(a){s.data("bs.carousel").to(a)}e.preventDefault()};t(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);n.call(e,e.data())})})}(jQuery);
604/* ========================================================================
605 * Bootstrap: collapse.js v3.3.7
606 * http://getbootstrap.com/javascript/#collapse
607 * ========================================================================
608 * Copyright 2011-2016 Twitter, Inc.
609 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
610 * ======================================================================== */+function(t){"use strict";var e=function(n,i){this.$element=t(n);this.options=t.extend({},e.DEFAULTS,i);this.$trigger=t('[data-toggle="collapse"][href="#'+n.id+'"],'+'[data-toggle="collapse"][data-target="#'+n.id+'"]');this.transitioning=null;if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)}if(this.options.toggle)this.toggle()};e.VERSION="3.3.7";e.TRANSITION_DURATION=350;e.DEFAULTS={toggle:true};e.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"};e.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var n;var r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(r&&r.length){n=r.data("bs.collapse");if(n&&n.transitioning)return}var s=t.Event("show.bs.collapse");this.$element.trigger(s);if(s.isDefaultPrevented())return;if(r&&r.length){i.call(r,"hide");n||r.data("bs.collapse",null)}var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",true);this.$trigger.removeClass("collapsed").attr("aria-expanded",true);this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var l=t.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(e.TRANSITION_DURATION)[o](this.$element[0][l])};e.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var n=t.Event("hide.bs.collapse");this.$element.trigger(n);if(n.isDefaultPrevented())return;var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight;this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",false);this.$trigger.addClass("collapsed").attr("aria-expanded",false);this.transitioning=1;var r=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return r.call(this);this.$element[i](0).one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(e.TRANSITION_DURATION)};e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};e.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(e,i){var r=t(i);this.addAriaAndCollapsedClass(n(r),r)},this)).end()};e.prototype.addAriaAndCollapsedClass=function(t,e){var n=t.hasClass("in");t.attr("aria-expanded",n);e.toggleClass("collapsed",!n).attr("aria-expanded",n)};function n(e){var n;var i=e.attr("data-target")||(n=e.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return t(i)}function i(n){return this.each(function(){var i=t(this);var r=i.data("bs.collapse");var s=t.extend({},e.DEFAULTS,i.data(),typeof n=="object"&&n);if(!r&&s.toggle&&/show|hide/.test(n))s.toggle=false;if(!r)i.data("bs.collapse",r=new e(this,s));if(typeof n=="string")r[n]()})}var r=t.fn.collapse;t.fn.collapse=i;t.fn.collapse.Constructor=e;t.fn.collapse.noConflict=function(){t.fn.collapse=r;return this};t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var r=t(this);if(!r.attr("data-target"))e.preventDefault();var s=n(r);var o=s.data("bs.collapse");var a=o?"toggle":r.data();i.call(s,a)})}(jQuery);
611/* ========================================================================
612 * Bootstrap: dropdown.js v3.3.7
613 * http://getbootstrap.com/javascript/#dropdowns
614 * ========================================================================
615 * Copyright 2011-2016 Twitter, Inc.
616 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
617 * ======================================================================== */+function(t){"use strict";var e=".dropdown-backdrop";var n='[data-toggle="dropdown"]';var i=function(e){t(e).on("click.bs.dropdown",this.toggle)};i.VERSION="3.3.7";function r(e){var n=e.attr("data-target");if(!n){n=e.attr("href");n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")}var i=n&&t(n);return i&&i.length?i:e.parent()}function s(i){if(i&&i.which===3)return;t(e).remove();t(n).each(function(){var e=t(this);var n=r(e);var s={relatedTarget:this};if(!n.hasClass("open"))return;if(i&&i.type=="click"&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target))return;n.trigger(i=t.Event("hide.bs.dropdown",s));if(i.isDefaultPrevented())return;e.attr("aria-expanded","false");n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s))})}i.prototype.toggle=function(e){var n=t(this);if(n.is(".disabled, :disabled"))return;var i=r(n);var o=i.hasClass("open");s();if(!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length){t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s)}var a={relatedTarget:this};i.trigger(e=t.Event("show.bs.dropdown",a));if(e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger(t.Event("shown.bs.dropdown",a))}return false};i.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return;var i=t(this);e.preventDefault();e.stopPropagation();if(i.is(".disabled, :disabled"))return;var s=r(i);var o=s.hasClass("open");if(!o&&e.which!=27||o&&e.which==27){if(e.which==27)s.find(n).trigger("focus");return i.trigger("click")}var a=" li:not(.disabled):visible a";var l=s.find(".dropdown-menu"+a);if(!l.length)return;var c=l.index(e.target);if(e.which==38&&c>0)c--;if(e.which==40&&c<l.length-1)c++;if(!~c)c=0;l.eq(c).trigger("focus")};function o(e){return this.each(function(){var n=t(this);var r=n.data("bs.dropdown");if(!r)n.data("bs.dropdown",r=new i(this));if(typeof e=="string")r[e].call(n)})}var a=t.fn.dropdown;t.fn.dropdown=o;t.fn.dropdown.Constructor=i;t.fn.dropdown.noConflict=function(){t.fn.dropdown=a;return this};t(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",n,i.prototype.toggle).on("keydown.bs.dropdown.data-api",n,i.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",i.prototype.keydown)}(jQuery);
618/* ========================================================================
619 * Bootstrap: modal.js v3.3.7
620 * http://getbootstrap.com/javascript/#modals
621 * ========================================================================
622 * Copyright 2011-2016 Twitter, Inc.
623 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
624 * ======================================================================== */+function(t){"use strict";var e=function(e,n){this.options=n;this.$body=t(document.body);this.$element=t(e);this.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=false;if(this.options.remote){this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))}};e.VERSION="3.3.7";e.TRANSITION_DURATION=300;e.BACKDROP_TRANSITION_DURATION=150;e.DEFAULTS={backdrop:true,keyboard:true,show:true};e.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)};e.prototype.show=function(n){var i=this;var r=t.Event("show.bs.modal",{relatedTarget:n});this.$element.trigger(r);if(this.isShown||r.isDefaultPrevented())return;this.isShown=true;this.checkScrollbar();this.setScrollbar();this.$body.addClass("modal-open");this.escape();this.resize();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this));this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(e){if(t(e.target).is(i.$element))i.ignoreBackdropClick=true})});this.backdrop(function(){var r=t.support.transition&&i.$element.hasClass("fade");if(!i.$element.parent().length){i.$element.appendTo(i.$body)}i.$element.show().scrollTop(0);i.adjustDialog();if(r){i.$element[0].offsetWidth}i.$element.addClass("in");i.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:n});r?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(e.TRANSITION_DURATION):i.$element.trigger("focus").trigger(s)})};e.prototype.hide=function(n){if(n)n.preventDefault();n=t.Event("hide.bs.modal");this.$element.trigger(n);if(!this.isShown||n.isDefaultPrevented())return;this.isShown=false;this.escape();this.resize();t(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");t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(e.TRANSITION_DURATION):this.hideModal()};e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){if(document!==t.target&&this.$element[0]!==t.target&&!this.$element.has(t.target).length){this.$element.trigger("focus")}},this))};e.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){t.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off("keydown.dismiss.bs.modal")}};e.prototype.resize=function(){if(this.isShown){t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this))}else{t(window).off("resize.bs.modal")}};e.prototype.hideModal=function(){var t=this;this.$element.hide();this.backdrop(function(){t.$body.removeClass("modal-open");t.resetAdjustments();t.resetScrollbar();t.$element.trigger("hidden.bs.modal")})};e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};e.prototype.backdrop=function(n){var i=this;var r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&r;this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+r).appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){if(this.ignoreBackdropClick){this.ignoreBackdropClick=false;return}if(t.target!==t.currentTarget)return;this.options.backdrop=="static"?this.$element[0].focus():this.hide()},this));if(s)this.$backdrop[0].offsetWidth;this.$backdrop.addClass("in");if(!n)return;s?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):n()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var o=function(){i.removeBackdrop();n&&n()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):o()}else if(n){n()}};e.prototype.handleUpdate=function(){this.adjustDialog()};e.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})};e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t;this.scrollbarWidth=this.measureScrollbar()};e.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";if(this.bodyIsOverflowing)this.$body.css("padding-right",t+this.scrollbarWidth)};e.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};e.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure";this.$body.append(t);var e=t.offsetWidth-t.clientWidth;this.$body[0].removeChild(t);return e};function n(n,i){return this.each(function(){var r=t(this);var s=r.data("bs.modal");var o=t.extend({},e.DEFAULTS,r.data(),typeof n=="object"&&n);if(!s)r.data("bs.modal",s=new e(this,o));if(typeof n=="string")s[n](i);else if(o.show)s.show(i)})}var i=t.fn.modal;t.fn.modal=n;t.fn.modal.Constructor=e;t.fn.modal.noConflict=function(){t.fn.modal=i;return this};t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var i=t(this);var r=i.attr("href");var s=t(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,""));var o=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(r)&&r},s.data(),i.data());if(i.is("a"))e.preventDefault();s.one("show.bs.modal",function(t){if(t.isDefaultPrevented())return;s.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})});n.call(s,o,this)})}(jQuery);
625/* ========================================================================
626 * Bootstrap: tab.js v3.3.7
627 * http://getbootstrap.com/javascript/#tabs
628 * ========================================================================
629 * Copyright 2011-2016 Twitter, Inc.
630 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
631 * ======================================================================== */+function(t){"use strict";var e=function(e){this.element=t(e)};e.VERSION="3.3.7";e.TRANSITION_DURATION=150;e.prototype.show=function(){var e=this.element;var n=e.closest("ul:not(.dropdown-menu)");var i=e.data("target");if(!i){i=e.attr("href");i=i&&i.replace(/.*(?=#[^\s]*$)/,"")}if(e.parent("li").hasClass("active"))return;var r=n.find(".active:last a");var s=t.Event("hide.bs.tab",{relatedTarget:e[0]});var o=t.Event("show.bs.tab",{relatedTarget:r[0]});r.trigger(s);e.trigger(o);if(o.isDefaultPrevented()||s.isDefaultPrevented())return;var a=t(i);this.activate(e.closest("li"),n);this.activate(a,a.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:e[0]});e.trigger({type:"shown.bs.tab",relatedTarget:r[0]})})};e.prototype.activate=function(n,i,r){var s=i.find("> .active");var o=r&&t.support.transition&&(s.length&&s.hasClass("fade")||!!i.find("> .fade").length);function a(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",false);n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",true);if(o){n[0].offsetWidth;n.addClass("in")}else{n.removeClass("fade")}if(n.parent(".dropdown-menu").length){n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",true)}r&&r()}s.length&&o?s.one("bsTransitionEnd",a).emulateTransitionEnd(e.TRANSITION_DURATION):a();s.removeClass("in")};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.tab");if(!r)i.data("bs.tab",r=new e(this));if(typeof n=="string")r[n]()})}var i=t.fn.tab;t.fn.tab=n;t.fn.tab.Constructor=e;t.fn.tab.noConflict=function(){t.fn.tab=i;return this};var r=function(e){e.preventDefault();n.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery);
632/* ========================================================================
633 * Bootstrap: affix.js v3.3.7
634 * http://getbootstrap.com/javascript/#affix
635 * ========================================================================
636 * Copyright 2011-2016 Twitter, Inc.
637 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
638 * ======================================================================== */+function(t){"use strict";var e=function(n,i){this.options=t.extend({},e.DEFAULTS,i);this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this));this.$element=t(n);this.affixed=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()};e.VERSION="3.3.7";e.RESET="affix affix-top affix-bottom";e.DEFAULTS={offset:0,target:window};e.prototype.getState=function(t,e,n,i){var r=this.$target.scrollTop();var s=this.$element.offset();var o=this.$target.height();if(n!=null&&this.affixed=="top")return r<n?"top":false;if(this.affixed=="bottom"){if(n!=null)return r+this.unpin<=s.top?false:"bottom";return r+o<=t-i?false:"bottom"}var a=this.affixed==null;var l=a?r:s.top;var c=a?o:e;if(n!=null&&r<=n)return"top";if(i!=null&&l+c>=t-i)return"bottom";return false};e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop();var n=this.$element.offset();return this.pinnedOffset=n.top-t};e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)};e.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var n=this.$element.height();var i=this.options.offset;var r=i.top;var s=i.bottom;var o=Math.max(t(document).height(),t(document.body).height());if(typeof i!="object")s=r=i;if(typeof r=="function")r=i.top(this.$element);if(typeof s=="function")s=i.bottom(this.$element);var a=this.getState(o,n,r,s);if(this.affixed!=a){if(this.unpin!=null)this.$element.css("top","");var l="affix"+(a?"-"+a:"");var c=t.Event(l+".bs.affix");this.$element.trigger(c);if(c.isDefaultPrevented())return;this.affixed=a;this.unpin=a=="bottom"?this.getPinnedOffset():null;this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}if(a=="bottom"){this.$element.offset({top:o-n-s})}};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.affix");var s=typeof n=="object"&&n;if(!r)i.data("bs.affix",r=new e(this,s));if(typeof n=="string")r[n]()})}var i=t.fn.affix;t.fn.affix=n;t.fn.affix.Constructor=e;t.fn.affix.noConflict=function(){t.fn.affix=i;return this};t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var e=t(this);var i=e.data();i.offset=i.offset||{};if(i.offsetBottom!=null)i.offset.bottom=i.offsetBottom;if(i.offsetTop!=null)i.offset.top=i.offsetTop;n.call(e,i)})})}(jQuery);
639/* ========================================================================
640 * Bootstrap: scrollspy.js v3.3.7
641 * http://getbootstrap.com/javascript/#scrollspy
642 * ========================================================================
643 * Copyright 2011-2016 Twitter, Inc.
644 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
645 * ======================================================================== */+function(t){"use strict";function e(n,i){this.$body=t(document.body);this.$scrollElement=t(n).is(document.body)?t(window):t(n);this.options=t.extend({},e.DEFAULTS,i);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this));this.refresh();this.process()}e.VERSION="3.3.7";e.DEFAULTS={offset:10};e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};e.prototype.refresh=function(){var e=this;var n="offset";var i=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();if(!t.isWindow(this.$scrollElement[0])){n="position";i=this.$scrollElement.scrollTop()}this.$body.find(this.selector).map(function(){var e=t(this);var r=e.data("target")||e.attr("href");var s=/^#./.test(r)&&t(r);return s&&s.length&&s.is(":visible")&&[[s[n]().top+i,r]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]);e.targets.push(this[1])})};e.prototype.process=function(){var t=this.$scrollElement.scrollTop()+this.options.offset;var e=this.getScrollHeight();var n=this.options.offset+e-this.$scrollElement.height();var i=this.offsets;var r=this.targets;var s=this.activeTarget;var o;if(this.scrollHeight!=e){this.refresh()}if(t>=n){return s!=(o=r[r.length-1])&&this.activate(o)}if(s&&t<i[0]){this.activeTarget=null;return this.clear()}for(o=i.length;o--;){s!=r[o]&&t>=i[o]&&(i[o+1]===undefined||t<i[o+1])&&this.activate(r[o])}};e.prototype.activate=function(e){this.activeTarget=e;this.clear();var n=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]';var i=t(n).parents("li").addClass("active");if(i.parent(".dropdown-menu").length){i=i.closest("li.dropdown").addClass("active")}i.trigger("activate.bs.scrollspy")};e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.scrollspy");var s=typeof n=="object"&&n;if(!r)i.data("bs.scrollspy",r=new e(this,s));if(typeof n=="string")r[n]()})}var i=t.fn.scrollspy;t.fn.scrollspy=n;t.fn.scrollspy.Constructor=e;t.fn.scrollspy.noConflict=function(){t.fn.scrollspy=i;return this};t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);n.call(e,e.data())})})}(jQuery);
646/* ========================================================================
647 * Bootstrap: tooltip.js v3.3.7
648 * http://getbootstrap.com/javascript/#tooltip
649 * Inspired by the original jQuery.tipsy by Jason Frame
650 * ========================================================================
651 * Copyright 2011-2016 Twitter, Inc.
652 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
653 * ======================================================================== */+function(t){"use strict";var e=function(t,e){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",t,e)};e.VERSION="3.3.7";e.TRANSITION_DURATION=150;e.DEFAULTS={animation:true,placement:"top",selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:false,container:false,viewport:{selector:"body",padding:0}};e.prototype.init=function(e,n,i){this.enabled=true;this.type=e;this.$element=t(n);this.options=this.getOptions(i);this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport);this.inState={click:false,hover:false,focus:false};if(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!")}var r=this.options.trigger.split(" ");for(var s=r.length;s--;){var o=r[s];if(o=="click"){this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this))}else if(o!="manual"){var a=o=="hover"?"mouseenter":"focusin";var l=o=="hover"?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this));this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};e.prototype.getDefaults=function(){return e.DEFAULTS};e.prototype.getOptions=function(e){e=t.extend({},this.getDefaults(),this.$element.data(),e);if(e.delay&&typeof e.delay=="number"){e.delay={show:e.delay,hide:e.delay}}return e};e.prototype.getDelegateOptions=function(){var e={};var n=this.getDefaults();this._options&&t.each(this._options,function(t,i){if(n[t]!=i)e[t]=i});return e};e.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(!n){n=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data("bs."+this.type,n)}if(e instanceof t.Event){n.inState[e.type=="focusin"?"focus":"hover"]=true}if(n.tip().hasClass("in")||n.hoverState=="in"){n.hoverState="in";return}clearTimeout(n.timeout);n.hoverState="in";if(!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout(function(){if(n.hoverState=="in")n.show()},n.options.delay.show)};e.prototype.isInStateTrue=function(){for(var t in this.inState){if(this.inState[t])return true}return false};e.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(!n){n=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data("bs."+this.type,n)}if(e instanceof t.Event){n.inState[e.type=="focusout"?"focus":"hover"]=false}if(n.isInStateTrue())return;clearTimeout(n.timeout);n.hoverState="out";if(!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){if(n.hoverState=="out")n.hide()},n.options.delay.hide)};e.prototype.show=function(){var n=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(n);var i=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(n.isDefaultPrevented()||!i)return;var r=this;var s=this.tip();var o=this.getUID(this.type);this.setContent();s.attr("id",o);this.$element.attr("aria-describedby",o);if(this.options.animation)s.addClass("fade");var a=typeof this.options.placement=="function"?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement;var l=/\s?auto?\s?/i;var c=l.test(a);if(c)a=a.replace(l,"")||"top";s.detach().css({top:0,left:0,display:"block"}).addClass(a).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 u=this.getPosition();var h=s[0].offsetWidth;var f=s[0].offsetHeight;if(c){var d=a;var p=this.getPosition(this.$viewport);a=a=="bottom"&&u.bottom+f>p.bottom?"top":a=="top"&&u.top-f<p.top?"bottom":a=="right"&&u.right+h>p.width?"left":a=="left"&&u.left-h<p.left?"right":a;s.removeClass(d).addClass(a)}var m=this.getCalculatedOffset(a,u,h,f);this.applyPlacement(m,a);var g=function(){var t=r.hoverState;r.$element.trigger("shown.bs."+r.type);r.hoverState=null;if(t=="out")r.leave(r)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",g).emulateTransitionEnd(e.TRANSITION_DURATION):g()}};e.prototype.applyPlacement=function(e,n){var i=this.tip();var r=i[0].offsetWidth;var s=i[0].offsetHeight;var o=parseInt(i.css("margin-top"),10);var a=parseInt(i.css("margin-left"),10);if(isNaN(o))o=0;if(isNaN(a))a=0;e.top+=o;e.left+=a;t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0);i.addClass("in");var l=i[0].offsetWidth;var c=i[0].offsetHeight;if(n=="top"&&c!=s){e.top=e.top+s-c}var u=this.getViewportAdjustedDelta(n,e,l,c);if(u.left)e.left+=u.left;else e.top+=u.top;var h=/top|bottom/.test(n);var f=h?u.left*2-r+l:u.top*2-s+c;var d=h?"offsetWidth":"offsetHeight";i.offset(e);this.replaceArrow(f,i[0][d],h)};e.prototype.replaceArrow=function(t,e,n){this.arrow().css(n?"left":"top",50*(1-t/e)+"%").css(n?"top":"left","")};e.prototype.setContent=function(){var t=this.tip();var e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e);t.removeClass("fade in top bottom left right")};e.prototype.hide=function(n){var i=this;var r=t(this.$tip);var s=t.Event("hide.bs."+this.type);function o(){if(i.hoverState!="in")r.detach();if(i.$element){i.$element.removeAttr("aria-describedby").trigger("hidden.bs."+i.type)}n&&n()}this.$element.trigger(s);if(s.isDefaultPrevented())return;r.removeClass("in");t.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",o).emulateTransitionEnd(e.TRANSITION_DURATION):o();this.hoverState=null;return this};e.prototype.fixTitle=function(){var t=this.$element;if(t.attr("title")||typeof t.attr("data-original-title")!="string"){t.attr("data-original-title",t.attr("title")||"").attr("title","")}};e.prototype.hasContent=function(){return this.getTitle()};e.prototype.getPosition=function(e){e=e||this.$element;var n=e[0];var i=n.tagName=="BODY";var r=n.getBoundingClientRect();if(r.width==null){r=t.extend({},r,{width:r.right-r.left,height:r.bottom-r.top})}var s=window.SVGElement&&n instanceof window.SVGElement;var o=i?{top:0,left:0}:s?null:e.offset();var a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()};var l=i?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},r,a,l,o)};e.prototype.getCalculatedOffset=function(t,e,n,i){return t=="bottom"?{top:e.top+e.height,left:e.left+e.width/2-n/2}:t=="top"?{top:e.top-i,left:e.left+e.width/2-n/2}:t=="left"?{top:e.top+e.height/2-i/2,left:e.left-n}:{top:e.top+e.height/2-i/2,left:e.left+e.width}};e.prototype.getViewportAdjustedDelta=function(t,e,n,i){var r={top:0,left:0};if(!this.$viewport)return r;var s=this.options.viewport&&this.options.viewport.padding||0;var o=this.getPosition(this.$viewport);if(/right|left/.test(t)){var a=e.top-s-o.scroll;var l=e.top+s-o.scroll+i;if(a<o.top){r.top=o.top-a}else if(l>o.top+o.height){r.top=o.top+o.height-l}}else{var c=e.left-s;var u=e.left+s+n;if(c<o.left){r.left=o.left-c}else if(u>o.right){r.left=o.left+o.width-u}}return r};e.prototype.getTitle=function(){var t;var e=this.$element;var n=this.options;t=e.attr("data-original-title")||(typeof n.title=="function"?n.title.call(e[0]):n.title);return t};e.prototype.getUID=function(t){do{t+=~~(Math.random()*1e6)}while(document.getElementById(t));return t};e.prototype.tip=function(){if(!this.$tip){this.$tip=t(this.options.template);
653if(this.$tip.length!=1){throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!")}}return this.$tip};e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};e.prototype.enable=function(){this.enabled=true};e.prototype.disable=function(){this.enabled=false};e.prototype.toggleEnabled=function(){this.enabled=!this.enabled};e.prototype.toggle=function(e){var n=this;if(e){n=t(e.currentTarget).data("bs."+this.type);if(!n){n=new this.constructor(e.currentTarget,this.getDelegateOptions());t(e.currentTarget).data("bs."+this.type,n)}}if(e){n.inState.click=!n.inState.click;if(n.isInStateTrue())n.enter(n);else n.leave(n)}else{n.tip().hasClass("in")?n.leave(n):n.enter(n)}};e.prototype.destroy=function(){var t=this;clearTimeout(this.timeout);this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type);if(t.$tip){t.$tip.detach()}t.$tip=null;t.$arrow=null;t.$viewport=null;t.$element=null})};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.tooltip");var s=typeof n=="object"&&n;if(!r&&/destroy|hide/.test(n))return;if(!r)i.data("bs.tooltip",r=new e(this,s));if(typeof n=="string")r[n]()})}var i=t.fn.tooltip;t.fn.tooltip=n;t.fn.tooltip.Constructor=e;t.fn.tooltip.noConflict=function(){t.fn.tooltip=i;return this}}(jQuery);
654/* ========================================================================
655 * Bootstrap: popover.js v3.3.7
656 * http://getbootstrap.com/javascript/#popovers
657 * ========================================================================
658 * Copyright 2011-2016 Twitter, Inc.
659 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
660 * ======================================================================== */+function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.3.7";e.DEFAULTS=t.extend({},t.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>'});e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype);e.prototype.constructor=e;e.prototype.getDefaults=function(){return e.DEFAULTS};e.prototype.setContent=function(){var t=this.tip();var e=this.getTitle();var n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e);t.find(".popover-content").children().detach().end()[this.options.html?typeof n=="string"?"html":"append":"text"](n);t.removeClass("fade top bottom left right in");if(!t.find(".popover-title").html())t.find(".popover-title").hide()};e.prototype.hasContent=function(){return this.getTitle()||this.getContent()};e.prototype.getContent=function(){var t=this.$element;var e=this.options;return t.attr("data-content")||(typeof e.content=="function"?e.content.call(t[0]):e.content)};e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};function n(n){return this.each(function(){var i=t(this);var r=i.data("bs.popover");var s=typeof n=="object"&&n;if(!r&&/destroy|hide/.test(n))return;if(!r)i.data("bs.popover",r=new e(this,s));if(typeof n=="string")r[n]()})}var i=t.fn.popover;t.fn.popover=n;t.fn.popover.Constructor=e;t.fn.popover.noConflict=function(){t.fn.popover=i;return this}}(jQuery);
661/*! DataTables Bootstrap 3 integration
662 * ©2011-2014 SpryMedia Ltd - datatables.net/license
663 */
664/*! DataTables Bootstrap 3 integration
665 * ©2011-2014 SpryMedia Ltd - datatables.net/license
666 */
667(function(t,e,n){var i=function(t,n){"use strict";t.extend(true,n.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>>"+"<'row'<'col-sm-12'tr>>"+"<'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});t.extend(n.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});n.ext.renderer.pageButton.bootstrap=function(i,r,s,o,a,l){var c=new n.Api(i);var u=i.oClasses;var h=i.oLanguage.oPaginate;var f,d,p=0;var m=function(e,n){var r,o,g,_;var v=function(e){e.preventDefault();if(!t(e.currentTarget).hasClass("disabled")){c.page(e.data.action).draw("page")}};for(r=0,o=n.length;r<o;r++){_=n[r];if(t.isArray(_)){m(e,_)}
667else{f="";d="";switch(_){case"ellipsis":f="&hellip;";d="disabled";break;case"first":f=h.sFirst;d=_+(a>0?"":" disabled");break;case"previous":f=h.sPrevious;d=_+(a>0?"":" disabled");break;case"next":f=h.sNext;d=_+(a<l-1?"":" disabled");break;case"last":f=h.sLast;d=_+(a<l-1?"":" disabled");break;default:f=_+1;d=a===_?"active":"";break}if(f){g=t("<li>",{"class":u.sPageButton+" "+d,id:s===0&&typeof _==="string"?i.sTableId+"_"+_:null}).append(t("<a>",{href:"#","aria-controls":i.sTableId,"data-dt-idx":p,tabindex:i.iTabIndex}).html(f)).appendTo(e);i.oApi._fnBindAction(g,{action:_},v);p++}}}};var g;try{g=t(r).find(e.activeElement).data("dt-idx")}catch(_){}m(t(r).empty().html('<ul class="pagination"/>').children("ul"),o);if(g){t(r).find("[data-dt-idx="+g+"]").focus()}};if(n.TableTools){t.extend(true,n.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}});t.extend(true,n.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}})}};if(typeof define==="function"&&define.amd){define(["jquery","datatables"],i)}else if(typeof exports==="object"){i(require("jquery"),require("datatables"))}else if(jQuery){i(jQuery,jQuery.fn.dataTable)}})(window,document);
668/*! Responsive 1.0.7
669 * 2014-2015 SpryMedia Ltd - datatables.net/license
670 */
671/**
672 * @summary     Responsive
673 * @description Responsive tables plug-in for DataTables
674 * @version     1.0.7
675 * @file        dataTables.responsive.js
676 * @author      SpryMedia Ltd (www.sprymedia.co.uk)
677 * @contact     www.sprymedia.co.uk/contact
678 * @copyright   Copyright 2014-2015 SpryMedia Ltd.
679 *
680 * This source file is free software, available under the following license:
681 *   MIT license - http://datatables.net/license/mit
682 *
683 * This source file is distributed in the hope that it will be useful, but
684 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
685 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
686 *
687 * For details please refer to: http://www.datatables.net
688 */
689/*! Responsive 1.0.7
690 * 2014-2015 SpryMedia Ltd - datatables.net/license
691 */
692/**
693 * @summary     Responsive
694 * @description Responsive tables plug-in for DataTables
695 * @version     1.0.7
696 * @file        dataTables.responsive.js
697 * @author      SpryMedia Ltd (www.sprymedia.co.uk)
698 * @contact     www.sprymedia.co.uk/contact
699 * @copyright   Copyright 2014-2015 SpryMedia Ltd.
700 *
701 * This source file is free software, available under the following license:
702 *   MIT license - http://datatables.net/license/mit
703 *
704 * This source file is distributed in the hope that it will be useful, but
705 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
706 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
707 *
708 * For details please refer to: http://www.datatables.net
709 */
710(function(t,e,n){var i=function(n,i){"use strict";var r=function(t,e){if(!i.versionCheck||!i.versionCheck("1.10.1")){throw"DataTables Responsive requires DataTables 1.10.1 or newer"}this.s={dt:new i.Api(t),columns:[]};if(this.s.dt.settings()[0].responsive){return}if(e&&typeof e.details==="string"){e.details={type:e.details}}this.c=n.extend(true,{},r.defaults,i.defaults.responsive,e);t.responsive=this;this._constructor()};r.prototype={_constructor:function(){var e=this;var i=this.s.dt;i.settings()[0]._responsive=this;n(t).on("resize.dtr orientationchange.dtr",i.settings()[0].oApi._fnThrottle(function(){e._resize()}));i.on("destroy.dtr",function(){n(t).off("resize.dtr orientationchange.dtr draw.dtr")});this.c.breakpoints.sort(function(t,e){return t.width<e.width?1:t.width>e.width?-1:0});this._classLogic();this._resizeAuto();var r=this.c.details;if(r.type){e._detailsInit();this._detailsVis();i.on("column-visibility.dtr",function(){e._detailsVis()});i.on("draw.dtr",function(){i.rows({page:"current"}).iterator("row",function(t,n){var r=i.row(n);if(r.child.isShown()){var s=e.c.details.renderer(i,n);r.child(s,"child").show()}})});n(i.table().node()).addClass("dtr-"+r.type)}this._resize()},_columnsVisiblity:function(t){var e=this.s.dt;var i=this.s.columns;var r,s;var o=n.map(i,function(e){return e.auto&&e.minWidth===null?false:e.auto===true?"-":n.inArray(t,e.includeIn)!==-1});var a=0;for(r=0,s=o.length;r<s;r++){if(o[r]===true){a+=i[r].minWidth}}var l=e.settings()[0].oScroll;var c=l.sY||l.sX?l.iBarWidth:0;var u=e.table().container().offsetWidth-c;var h=u-a;for(r=0,s=o.length;r<s;r++){if(i[r].control){h-=i[r].minWidth}}var f=false;for(r=0,s=o.length;r<s;r++){if(o[r]==="-"&&!i[r].control){if(f||h-i[r].minWidth<0){f=true;o[r]=false}else{o[r]=true}h-=i[r].minWidth}}var d=false;for(r=0,s=i.length;r<s;r++){if(!i[r].control&&!i[r].never&&!o[r]){d=true;break}}for(r=0,s=i.length;r<s;r++){if(i[r].control){o[r]=d}}if(n.inArray(true,o)===-1){o[0]=true}return o},_classLogic:function(){var t=this;var e={};var i=this.c.breakpoints;var r=this.s.dt.columns().eq(0).map(function(t){var e=this.column(t).header().className;return{className:e,includeIn:[],auto:false,control:false,never:e.match(/\bnever\b/)?true:false}});var s=function(t,e){var i=r[t].includeIn;if(n.inArray(e,i)===-1){i.push(e)}};var o=function(e,n,o,a){var l,c,u;if(!o){r[e].includeIn.push(n)}else if(o==="max-"){l=t._find(n).width;for(c=0,u=i.length;c<u;c++){if(i[c].width<=l){s(e,i[c].name)}}}else if(o==="min-"){l=t._find(n).width;for(c=0,u=i.length;c<u;c++){if(i[c].width>=l){s(e,i[c].name)}}}else if(o==="not-"){for(c=0,u=i.length;c<u;
710c++){if(i[c].name.indexOf(a)===-1){s(e,i[c].name)}}}};r.each(function(t,e){var r=t.className.split(" ");var s=false;for(var a=0,l=r.length;a<l;a++){var c=n.trim(r[a]);if(c==="all"){s=true;t.includeIn=n.map(i,function(t){return t.name});return}else if(c==="none"||c==="never"){s=true;return}else if(c==="control"){s=true;t.control=true;return}n.each(i,function(t,n){var i=n.name.split("-");var r=new RegExp("(min\\-|max\\-|not\\-)?("+i[0]+")(\\-[_a-zA-Z0-9])?");var a=c.match(r);if(a){s=true;if(a[2]===i[0]&&a[3]==="-"+i[1]){o(e,n.name,a[1],a[2]+a[3])}else if(a[2]===i[0]&&!a[3]){o(e,n.name,a[1],a[2])}}})}if(!s){t.auto=true}});this.s.columns=r},_detailsInit:function(){var t=this;var e=this.s.dt;var i=this.c.details;if(i.type==="inline"){i.target="td:first-child"}var r=i.target;var s=typeof r==="string"?r:"td";n(e.table().body()).on("click",s,function(i){if(!n(e.table().node()).hasClass("collapsed")){return}if(!e.row(n(this).closest("tr")).length){return}if(typeof r==="number"){var s=r<0?e.columns().eq(0).length+r:r;if(e.cell(this).index().column!==s){return}}var o=e.row(n(this).closest("tr"));if(o.child.isShown()){o.child(false);n(o.node()).removeClass("parent")}else{var a=t.c.details.renderer(e,o[0]);o.child(a,"child").show();n(o.node()).addClass("parent")}})},_detailsVis:function(){var t=this;var e=this.s.dt;var i=e.columns().indexes().filter(function(t){var i=e.column(t);if(i.visible()){return null}return n(i.header()).hasClass("never")?null:t});var r=true;if(i.length===0||i.length===1&&this.s.columns[i[0]].control){r=false}if(r){e.rows({page:"current"}).eq(0).each(function(n){var i=e.row(n);if(i.child()){var r=t.c.details.renderer(e,i[0]);if(r===false){i.child.hide()}else{i.child(r,"child").show()}}})}else{e.rows({page:"current"}).eq(0).each(function(t){e.row(t).child.hide()})}},_find:function(t){var e=this.c.breakpoints;for(var n=0,i=e.length;n<i;n++){if(e[n].name===t){return e[n]}}},_resize:function(){var e=this.s.dt;var i=n(t).width();var r=this.c.breakpoints;var s=r[0].name;var o=this.s.columns;var a,l;for(a=r.length-1;a>=0;a--){if(i<=r[a].width){s=r[a].name;break}}var c=this._columnsVisiblity(s);var u=false;for(a=0,l=o.length;a<l;a++){if(c[a]===false&&!o[a].never){u=true;break}}n(e.table().node()).toggleClass("collapsed",u);e.columns().eq(0).each(function(t,n){e.column(t).visible(c[n])})},_resizeAuto:function(){var t=this.s.dt;var e=this.s.columns;if(!this.c.auto){return}if(n.inArray(true,n.map(e,function(t){return t.auto}))===-1){return}var i=t.table().node().offsetWidth;var r=t.columns;var s=t.table().node().cloneNode(false);var o=n(t.table().header().cloneNode(false)).appendTo(s);var a=n(t.table().body().cloneNode(false)).appendTo(s);n(t.table().footer()).clone(false).appendTo(s);t.rows({page:"current"}).indexes().flatten().each(function(e){var i=t.row(e).node().cloneNode(true);if(t.columns(":hidden").flatten().length){n(i).append(t.cells(e,":hidden").nodes().to$().clone())}n(i).appendTo(a)});var l=t.columns().header().to$().clone(false);n("<tr/>").append(l).appendTo(o);if(this.c.details.type==="inline"){n(s).addClass("dtr-inline collapsed")}var c=n("<div/>").css({width:1,height:1,overflow:"hidden"}).append(s);c.find("th.never, td.never").remove();c.insertBefore(t.table().node());t.columns().eq(0).each(function(t){e[t].minWidth=l[t].offsetWidth||0});c.remove()}};r.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];r.defaults={breakpoints:r.breakpoints,auto:true,details:{renderer:function(t,e){var i=t.cells(e,":hidden").eq(0).map(function(e){var i=n(t.column(e.column).header());var r=t.cell(e).index();if(i.hasClass("control")||i.hasClass("never")){return""}var s=t.settings()[0];var o=s.oApi._fnGetCellData(s,r.row,r.column,"display");var a=i.text();if(a){a=a+":"}return'<li data-dtr-index="'+r.column+'">'+'<span class="dtr-title">'+a+"</span> "+'<span class="dtr-data">'+o+"</span>"+"</li>"}).toArray().join("");return i?n('<ul data-dtr-index="'+e+'"/>').append(i):false},target:0,type:"inline"}};var s=n.fn.dataTable.Api;s.register("responsive()",function(){return this});s.register("responsive.index()",function(t){t=n(t);return{column:t.data("dtr-index"),row:t.parent().data("dtr-index")}});s.register("responsive.rebuild()",function(){return this.iterator("table",function(t){if(t._responsive){t._responsive._classLogic()}})});s.register("responsive.recalc()",function(){return this.iterator("table",function(t){if(t._responsive){t._responsive._resizeAuto();t._responsive._resize()}})});r.version="1.0.7";n.fn.dataTable.Responsive=r;n.fn.DataTable.Responsive=r;n(e).on("init.dt.dtr",function(t,e,s){if(t.namespace!=="dt"){return}if(n(e.nTable).hasClass("responsive")||n(e.nTable).hasClass("dt-responsive")||e.oInit.responsive||i.defaults.responsive){var o=e.oInit.responsive;if(o!==false){new r(e,n.isPlainObject(o)?o:{})}}});return r};if(typeof define==="function"&&define.amd){define(["jquery","datatables"],i)}else if(typeof exports==="object"){i(require("jquery"),require("datatables"))}else if(jQuery&&!jQuery.fn.dataTable.Responsive){i(jQuery,jQuery.fn.dataTable)}})(window,document);(function(){$(function(){$(".wishart-tip").tooltip();return $(".wishart-popover").popover()});$(function(){return $("#jumper").affix({offset:{top:200}})})}).call(this);(function(){this.on_ready=function(t){$(document).ready(t);
vendor: 4,585 bytes, lines 710-712
710$(document).on("page:load",t)};this.on_change=function(t){$(document).on("page:change",t)}}).call(this);
711// https://d3js.org v7.1.1 Copyright 2010-2021 Mike Bostock
712!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).d3v7=t.d3||{})}(this,function(t){"use strict";function e(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function n(t){let n=t,i=t,r=t;function s(t,e,n=0,s=t.length){if(n<s){if(0!==i(e,e))return s;do{const i=n+s>>>1;r(t[i],e)<0?n=i+1:s=i}while(n<s)}return n}return 2!==t.length&&(n=((e,n)=>t(e)-n),i=e,r=((n,i)=>e(t(n),i))),{left:s,center:function(t,e,i=0,r=t.length){const o=s(t,e,i,r-1);return o>i&&n(t[o-1],e)>-n(t[o],e)?o-1:o},right:function(t,e,n=0,s=t.length){if(n<s){if(0!==i(e,e))return s;do{const i=n+s>>>1;r(t[i],e)<=0?n=i+1:s=i}while(n<s)}return n}}}function i(t){return null===t?NaN:+t}const r=n(e),s=r.right,o=r.left,a=n(i).center;var l=s;function c(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(r=+r)>=r&&++n}return n}function u(t){return 0|t.length}function h(t){return!(t>0)}function f(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function d(t,e){let n,i=0,r=0,s=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-r,r+=n/++i,s+=n*(e-r));else{let o=-1;for(let a of t)null!=(a=e(a,++o,t))&&(a=+a)>=a&&(n=a-r,r+=n/++i,s+=n*(a-r))}if(i>1)return s/(i-1)}function p(t,e){const n=d(t,e);return n?Math.sqrt(n):n}function m(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(void 0===n?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class g{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],s=t+r,o=Math.abs(t)<Math.abs(r)?t-(s-r):r-(s-t);o&&(e[n++]=o),t=s}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,s=0;if(r>0){for(s=t[--r];r>0&&(e=s,n=t[--r],s=e+n,i=n-(s-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=s+n,n==e-s&&(s=e))}return s}}class _ extends Map{constructor(t,e=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(y(this,t))}has(t){return super.has(y(this,t))}set(t,e){return super.set(b(this,t),e)}"delete"(t){return super["delete"](x(this,t))}}class v extends Set{constructor(t,e=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(y(this,t))}add(t){return super.add(b(this,t))}"delete"(t){return super["delete"](x(this,t))}}function y({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function b({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function x({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t["delete"](i)),n}function w(t){return null!==t&&"object"==typeof t?t.valueOf():t}function k(t){return t}function S(t,...e){return E(t,k,k,e)}function M(t,...e){return E(t,Array.from,k,e)}function T(t,e){for(let n=1,i=e.length;n<i;++n)t=t.flatMap(t=>t.pop().map(([e,n])=>[...t,e,n]));return t}function C(t,e,...n){return E(t,k,e,n)}function A(t,e,...n){return E(t,Array.from,e,n)}function D(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function E(t,e,n,i){return function r(t,s){if(s>=i.length)return n(t);const o=new _,a=i[s++];let l=-1;for(const e of t){const n=a(e,++l,t),i=o.get(n);i?i.push(e):o.set(n,[e])}for(const[t,e]of o)o.set(t,r(e,s));return e(o)}(t,0)}function N(t,e){return Array.from(e,e=>t[e])}function z(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const i=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),i.sort((t,n)=>{for(const i of e){const e=j(i[t],i[n]);if(e)return e}})):(n=t.map(n),i.sort((t,e)=>j(n[t],n[e]))),N(t,i)}return t.sort(P(n))}function P(t=e){if(t===e)return j;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||0===i?i:(0===t(n,n))-(0===t(e,e))}}function j(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var I=Array.prototype.slice;function $(t){return()=>t}var R=Math.sqrt(50),L=Math.sqrt(10),F=Math.sqrt(2);function O(t,e,n){var i,r,s,o,a=-1;
vendor: 10,770 bytes, line 712
712if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),0===(o=H(t,e,n))||!isFinite(o))return[];if(o>0){let n=Math.round(t/o),i=Math.round(e/o);for(n*o<t&&++n,i*o>e&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)*o}else{o=-o;let n=Math.round(t*o),i=Math.round(e*o);for(n/o<t&&++n,i/o>e&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)/o}return i&&s.reverse(),s}function H(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=R?10:s>=L?5:s>=F?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=R?10:s>=L?5:s>=F?2:1)}function V(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=R?r*=10:s>=L?r*=5:s>=F&&(r*=2),e<t?-r:r}function q(t,e,n){let i;for(;;){const r=H(t,e,n);if(r===i||0===r||!isFinite(r))return[t,e];r>0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function B(t){return Math.ceil(Math.log(c(t))/Math.LN2)+1}function U(){var t=k,e=m,n=B;function i(i){Array.isArray(i)||(i=Array.from(i));var r,s,o=i.length,a=new Array(o);for(r=0;r<o;++r)a[r]=t(i[r],r,i);var c=e(a),u=c[0],h=c[1],f=n(a,u,h);if(!Array.isArray(f)){const t=h,n=+f;if(e===m&&([u,h]=q(u,h,n)),(f=O(u,h,n))[f.length-1]>=h)if(t>=h&&e===m){const t=H(u,h,n);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else f.pop()}for(var d=f.length;f[0]<=u;)f.shift(),--d;for(;f[d-1]>h;)f.pop(),--d;var p,g=new Array(d+1);for(r=0;r<=d;++r)(p=g[r]=[]).x0=r>0?f[r-1]:u,p.x1=r<d?f[r]:h;for(r=0;r<o;++r)null!=(s=a[r])&&u<=s&&s<=h&&g[l(f,s,0,d)].push(i[r]);return g}return i.value=function(e){return arguments.length?(t="function"==typeof e?e:$(e),i):t},i.domain=function(t){return arguments.length?(e="function"==typeof t?t:$([t[0],t[1]]),i):e},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?$(I.call(t)):$(t),i):n},i}function W(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Y(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function X(t,e,n=0,i=t.length-1,r){for(r=void 0===r?j:P(r);i>n;){if(i-n>600){const s=i-n+1,o=e-n+1,a=Math.log(s),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);X(t,e,Math.max(n,Math.floor(e-o*l/s+c)),Math.min(i,Math.floor(e+(s-o)*l/s+c)),r)}const s=t[e];let o=n,a=i;for(J(t,n,e),r(t[i],s)>0&&J(t,n,i);o<a;){for(J(t,o,a),++o,--a;r(t[o],s)<0;)++o;for(;r(t[a],s)>0;)--a}0===r(t[n],s)?J(t,n,a):(++a,J(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function J(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function G(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let i of t)null!=(i=e(i,++n,t))&&(i=+i)>=i&&(yield i)}}(t,n)),i=t.length){if((e=+e)<=0||i<2)return Y(t);if(e>=1)return W(t);var i,r=(i-1)*e,s=Math.floor(r),o=W(X(t,s).subarray(0,s+1));return o+(Y(t.subarray(s+1))-o)*(r-s)}}function K(t,e,n=i){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,s=(r-1)*e,o=Math.floor(s),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(s-o)}}function Z(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,i=r);else for(let s of t)null!=(s=e(s,++r,t))&&(n<s||void 0===n&&s>=s)&&(n=s,i=r);return i}function Q(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function tt(t,e){let n,i=-1,r=-1;if(void 0===e)for(const e of t)++r,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,i=r);else for(let s of t)null!=(s=e(s,++r,t))&&(n>s||void 0===n&&s>=s)&&(n=s,i=r);return i}function et(t,e){return[t,e]}function nt(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i<r;)s[i]=t+i*n;return s}function it(t,n=e){if(1===n.length)return tt(t,n);let i,r=-1,s=-1;for(const e of t)++s,(r<0?0===n(e,e):n(e,i)<0)&&(i=e,r=s);return r}var rt=st(Math.random);function st(t){return function(e,n=0,i=e.length){let r=i-(n=+n);for(;r;){const i=t()*r--|0,s=e[r+n];e[r+n]=e[i+n],e[i+n]=s}return e}}function ot(t){if(!(r=t.length))return[];for(var e=-1,n=Y(t,at),i=new Array(n);++e<n;)for(var r,s=-1,o=i[e]=new Array(r);++s<r;)o[s]=t[s][e];return i}function at(t){return t.length}function lt(t){return t instanceof v?t:new v(t)}function ct(t,e){const n=t[Symbol.iterator](),i=new Set;for(const t of e){const e=ut(t);if(i.has(e))continue;let r,s;for(;({value:r,done:s}=n.next());){if(s)return!1;const t=ut(r);if(i.add(t),Object.is(e,t))break}}return!0}function ut(t){return null!==t&&"object"==typeof t?t.valueOf():t}function ht(t){return t}var ft=1e-6;function dt(t){return"translate("+t+",0)"}function pt(t){return"translate(0,"+t+")"}function mt(t){return e=>+t(e)}function gt(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function _t(){return!this.__axis}function vt(t,e){var n=[],i=null,r=null,s=6,o=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?dt:pt;function f(f){var d=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,p=null==r?e.tickFormat?e.tickFormat.apply(e,n):ht:r,m=Math.max(s,0)+a,g=e.range(),_=+g[0]+l,v=+g[g.length-1]+l,y=(e.bandwidth?gt:mt)(e.copy(),l),b=f.selection?f.selection():f,x=b.selectAll(".domain").data([null]),w=b.selectAll(".tick").data(d,e).order(),k=w.exit(),S=w.enter().append("g").attr("class","tick"),M=w.select("line"),T=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(S),M=M.merge(S.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),T=T.merge(S.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==b&&(x=x.transition(f),w=w.transition(f),M=M.transition(f),T=T.transition(f),k=k.transition(f).attr("opacity",ft).attr("transform",function(t){return isFinite(t=y(t))?h(t+l):this.getAttribute("transform")}),S.attr("opacity",ft).attr("transform",function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:y(t))+l)})),k.remove(),x.attr("d",4===t||2===t?o?"M"+c*o+","+_+"H"+l+"V"+v+"H"+c*o:"M"+l+","+_+"V"+v:o?"M"+_+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+_+","+l+"H"+v),w.attr("opacity",1).attr("transform",function(t){return h(y(t)+l)}),M.attr(u+"2",c*s),T.attr(u,c*m).text(p),b.filter(_t).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each(function(){this.__axis=y})}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),f):i&&i.slice()},f.tickFormat=function(t){return arguments.length?(r=t,f):r},f.tickSize=function(t){return arguments.length?(s=o=+t,f):s},f.tickSizeInner=function(t){return arguments.length?(s=+t,f):s},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(a=+t,f):a},f.offset=function(t){return arguments.length?(l=+t,f):l},f}var yt={value:()=>{}};function bt(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new xt(i)}function xt(t){this._=t}function wt(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function kt(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function St(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=yt,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}xt.prototype=bt.prototype={constructor:xt,on:function(t,e){var n,i=this._,r=wt(t+"",i),s=-1,o=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<o;)if(n=(t=r[s]).type)i[n]=St(i[n],t.name,e);else if(null==e)for(n in i)i[n]=St(i[n],t.name,null);return this}for(;++s<o;)if((n=(t=r[s]).type)&&(n=kt(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new xt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),s=0;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=0,n=(i=this._[t]).length;s<n;++s)i[s].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};var Mt="http://www.w3.org/1999/xhtml",Tt={svg:"http://www.w3.org/2000/svg",xhtml:Mt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ct(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Tt.hasOwnProperty(e)?{space:Tt[e],local:t}:t}function At(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Mt&&e.documentElement.namespaceURI===Mt?e.createElement(t):e.createElementNS(n,t)}}function Dt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Et(t){var e=Ct(t);return(e.local?Dt:At)(e)}function Nt(){}function zt(t){return null==t?Nt:function(){return this.querySelector(t)}}function Pt(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function jt(){return[]}function It(t){return null==t?jt:function(){return this.querySelectorAll(t)}}function $t(t){return function(){return this.matches(t)}}function Rt(t){return function(e){return e.matches(t)}}var Lt=Array.prototype.find;function Ft(){return this.firstElementChild}var Ot=Array.prototype.filter;function Ht(){return Array.from(this.children)}function Vt(t){return new Array(t.length)}function qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function Bt(t){return function(){return t}}function Ut(t,e,n,i,r,s){for(var o,a=0,l=e.length,c=s.length;a<c;++a)(o=e[a])?(o.__data__=s[a],i[a]=o):n[a]=new qt(t,s[a]);for(;a<l;++a)(o=e[a])&&(r[a]=o)}function Wt(t,e,n,i,r,s,o){var a,l,c,u=new Map,h=e.length,f=s.length,d=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(d[a]=c=o.call(l,l.__data__,a,e)+"",u.has(c)?r[a]=l:u.set(c,l));for(a=0;a<f;++a)c=o.call(t,s[a],a,s)+"",(l=u.get(c))?(i[a]=l,l.__data__=s[a],u["delete"](c)):n[a]=new qt(t,s[a]);for(a=0;a<h;
vendor: 8,656 bytes, line 712
712++a)(l=e[a])&&u.get(d[a])===l&&(r[a]=l)}function Yt(t){return t.__data__}function Xt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Jt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Gt(t){return function(){this.removeAttribute(t)}}function Kt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zt(t,e){return function(){this.setAttribute(t,e)}}function Qt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function te(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function ee(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ne(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ie(t){return function(){this.style.removeProperty(t)}}function re(t,e,n){return function(){this.style.setProperty(t,e,n)}}function se(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function oe(t,e){return t.style.getPropertyValue(e)||ne(t).getComputedStyle(t,null).getPropertyValue(e)}function ae(t){return function(){delete this[t]}}function le(t,e){return function(){this[t]=e}}function ce(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function ue(t){return t.trim().split(/^|\s+/)}function he(t){return t.classList||new fe(t)}function fe(t){this._node=t,this._names=ue(t.getAttribute("class")||"")}function de(t,e){for(var n=he(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function pe(t,e){for(var n=he(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function me(t){return function(){de(this,t)}}function ge(t){return function(){pe(this,t)}}function _e(t,e){return function(){(e.apply(this,arguments)?de:pe)(this,t)}}function ve(){this.textContent=""}function ye(t){return function(){this.textContent=t}}function be(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function xe(){this.innerHTML=""}function we(t){return function(){this.innerHTML=t}}function ke(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Se(){this.nextSibling&&this.parentNode.appendChild(this)}function Me(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return null}function Ce(){var t=this.parentNode;t&&t.removeChild(this)}function Ae(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function De(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ee(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function Ne(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,s=e.length;i<s;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function ze(t,e,n){return function(){var i,r=this.__on,s=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),void(i.value=e);this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Pe(t,e,n){var i=ne(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function je(t,e){return function(){return Pe(this,t,e)}}function Ie(t,e){return function(){return Pe(this,t,e.apply(this,arguments))}}qt.prototype={constructor:qt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},fe.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var $e=[null];function Re(t,e){this._groups=t,this._parents=e}function Le(){return new Re([[document.documentElement]],$e)}function Fe(t){return"string"==typeof t?new Re([[document.querySelector(t)]],[document.documentElement]):new Re([[t]],$e)}Re.prototype=Le.prototype={constructor:Re,select:function(t){"function"!=typeof t&&(t=zt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o,a=e[r],l=a.length,c=i[r]=new Array(l),u=0;u<l;++u)(s=a[u])&&(o=t.call(s,s.__data__,u,a))&&("__data__"in s&&(o.__data__=s.__data__),c[u]=o);return new Re(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return Pt(t.apply(this,arguments))}}(t):It(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var o,a=e[s],l=a.length,c=0;c<l;++c)(o=a[c])&&(i.push(t.call(o,o.__data__,c,a)),r.push(o));return new Re(i,r)},selectChild:function(t){return this.select(null==t?Ft:function(t){return function(){return Lt.call(this.children,t)}}("function"==typeof t?t:Rt(t)))},selectChildren:function(t){return this.selectAll(null==t?Ht:function(t){return function(){return Ot.call(this.children,t)}}("function"==typeof t?t:Rt(t)))},filter:function(t){"function"!=typeof t&&(t=$t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o=e[r],a=o.length,l=i[r]=[],c=0;c<a;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&l.push(s);return new Re(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,Yt);var n=e?Wt:Ut,i=this._parents,r=this._groups;"function"!=typeof t&&(t=Bt(t));for(var s=r.length,o=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],h=r[c],f=h.length,d=Xt(t.call(u,u&&u.__data__,c,i)),p=d.length,m=a[c]=new Array(p),g=o[c]=new Array(p),_=l[c]=new Array(f);n(u,h,m,g,_,d,e);for(var v,y,b=0,x=0;b<p;++b)if(v=m[b]){for(b>=x&&(x=b+1);!(y=g[x])&&++x<p;);v._next=y||null}}return(o=new Re(o,i))._enter=a,o._exit=l,o},enter:function(){return new Re(this._enter||this._groups.map(Vt),this._parents)},exit:function(){return new Re(this._exit||this._groups.map(Vt),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,s=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?s.remove():n(s),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,o=Math.min(r,s),a=new Array(r),l=0;l<o;++l)for(var c,u=n[l],h=i[l],f=u.length,d=a[l]=new Array(f),p=0;p<f;++p)(c=u[p]||h[p])&&(d[p]=c);for(;l<r;++l)a[l]=n[l];return new Re(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],s=r.length-1,o=r[s];--s>=0;)(i=r[s])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Jt);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var o,a=n[s],l=a.length,c=r[s]=new Array(l),u=0;u<l;++u)(o=a[u])&&(c[u]=o);c.sort(e)}return new Re(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var o=i[r];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,s=e[n],o=0,a=s.length;o<a;++o)(r=s[o])&&t.call(r,r.__data__,o,s);return this},attr:function(t,e){var n=Ct(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?Kt:Gt:"function"==typeof e?n.local?ee:te:n.local?Qt:Zt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?ie:"function"==typeof e?se:re)(t,e,null==n?"":n)):oe(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?ae:"function"==typeof e?ce:le)(t,e)):this.node()[t]},classed:function(t,e){var n=ue(t+"");
vendor: 7,334 bytes, line 712
712if(arguments.length<2){for(var i=he(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?_e:e?me:ge)(n,e))},text:function(t){return arguments.length?this.each(null==t?ve:("function"==typeof t?be:ye)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?xe:("function"==typeof t?ke:we)(t)):this.node().innerHTML},raise:function(){return this.each(Se)},lower:function(){return this.each(Me)},append:function(t){var e="function"==typeof t?t:Et(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Et(t),i=null==e?Te:"function"==typeof e?e:zt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(Ce)},clone:function(t){return this.select(t?De:Ae)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,s=Ee(t+""),o=s.length;if(!(arguments.length<2)){for(a=e?ze:Ne,i=0;i<o;++i)this.each(a(s[i],e,n));return this}var a=this.node().__on;if(a)for(var l,c=0,u=a.length;c<u;++c)for(i=0,l=a[c];i<o;++i)if((r=s[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?Ie:je)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],s=0,o=r.length;s<o;++s)(i=r[s])&&(yield i)}};var Oe=0;function He(){return new Ve}function Ve(){this._="@"+(++Oe).toString(36)}function qe(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Be(t,e){if(t=qe(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Ve.prototype=He.prototype={constructor:Ve,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const Ue={passive:!1},We={capture:!0,passive:!1};function Ye(t){t.stopImmediatePropagation()}function Xe(t){t.preventDefault(),t.stopImmediatePropagation()}function Je(t){var e=t.document.documentElement,n=Fe(t).on("dragstart.drag",Xe,We);"onselectstart"in e?n.on("selectstart.drag",Xe,We):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Ge(t,e){var n=t.document.documentElement,i=Fe(t).on("dragstart.drag",null);e&&(i.on("click.drag",Xe,We),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ke=t=>()=>t;function Ze(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:s,x:o,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function Qe(t){return!t.ctrlKey&&!t.button}function tn(){return this.parentNode}function en(t,e){return null==e?{x:t.x,y:t.y}:e}function nn(){return navigator.maxTouchPoints||"ontouchstart"in this}function rn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function on(){}Ze.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var an=.7,ln=1/an,cn="\\s*([+-]?\\d+)\\s*",un="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fn=/^#([0-9a-f]{3,8})$/,dn=new RegExp("^rgb\\("+[cn,cn,cn]+"\\)$"),pn=new RegExp("^rgb\\("+[hn,hn,hn]+"\\)$"),mn=new RegExp("^rgba\\("+[cn,cn,cn,un]+"\\)$"),gn=new RegExp("^rgba\\("+[hn,hn,hn,un]+"\\)$"),_n=new RegExp("^hsl\\("+[un,hn,hn]+"\\)$"),vn=new RegExp("^hsla\\("+[un,hn,hn,un]+"\\)$"),yn={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};function bn(){return this.rgb().formatHex()}function xn(){return this.rgb().formatRgb()}function wn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=fn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kn(e):3===n?
vendor: 29,794 bytes, lines 712-713
712new Cn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Sn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Sn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dn.exec(t))?new Cn(e[1],e[2],e[3],1):(e=pn.exec(t))?new Cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=mn.exec(t))?Sn(e[1],e[2],e[3],e[4]):(e=gn.exec(t))?Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=_n.exec(t))?Nn(e[1],e[2]/100,e[3]/100,1):(e=vn.exec(t))?Nn(e[1],e[2]/100,e[3]/100,e[4]):yn.hasOwnProperty(t)?kn(yn[t]):"transparent"===t?new Cn(NaN,NaN,NaN,0):null}function kn(t){return new Cn(t>>16&255,t>>8&255,255&t,1)}function Sn(t,e,n,i){return i<=0&&(t=e=n=NaN),new Cn(t,e,n,i)}function Mn(t){return t instanceof on||(t=wn(t)),t?new Cn((t=t.rgb()).r,t.g,t.b,t.opacity):new Cn}function Tn(t,e,n,i){return 1===arguments.length?Mn(t):new Cn(t,e,n,null==i?1:i)}function Cn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function An(){return"#"+En(this.r)+En(this.g)+En(this.b)}function Dn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function En(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Nn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new jn(t,e,n,i)}function zn(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof on||(t=wn(t)),!t)return new jn
713;if(t instanceof jn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=e===s?(n-i)/a+6*(n<i):n===s?(i-e)/a+2:(e-n)/a+4,a/=l<.5?s+r:2-s-r,o*=60):a=l>0&&l<1?0:o,new jn(o,a,l,t.opacity)}function Pn(t,e,n,i){return 1===arguments.length?zn(t):new jn(t,e,n,null==i?1:i)}function jn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function In(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}rn(on,wn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bn,formatHex:bn,formatHsl:function(){return zn(this).formatHsl()},formatRgb:xn,toString:xn}),rn(Cn,Tn,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new Cn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new Cn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:An,formatHex:An,formatRgb:Dn,toString:Dn})),rn(jn,Pn,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new jn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new jn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Cn(In(t>=240?t-240:t+120,r,i),In(t,r,i),In(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const $n=Math.PI/180,Rn=180/Math.PI,Ln=.96422,Fn=.82521,On=4/29,Hn=6/29,Vn=3*Hn*Hn;function qn(t){if(t instanceof Un)return new Un(t.l,t.a,t.b,t.opacity);if(t instanceof Zn)return Qn(t);t instanceof Cn||(t=Mn(t));var e,n,i=Jn(t.r),r=Jn(t.g),s=Jn(t.b),o=Wn((.2225045*i+.7168786*r+.0606169*s)/1);return i===r&&r===s?e=n=o:(e=Wn((.4360747*i+.3850649*r+.1430804*s)/Ln),n=Wn((.0139322*i+.0971045*r+.7141733*s)/Fn)),new Un(116*o-16,500*(e-o),200*(o-n),t.opacity)}function Bn(t,e,n,i){return 1===arguments.length?qn(t):new Un(t,e,n,null==i?1:i)}function Un(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function Wn(t){return t>.008856451679035631?Math.pow(t,1/3):t/Vn+On}function Yn(t){return t>Hn?t*t*t:Vn*(t-On)}function Xn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Jn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gn(t){if(t instanceof Zn)return new Zn(t.h,t.c,t.l,t.opacity);if(t instanceof Un||(t=qn(t)),0===t.a&&0===t.b)return new Zn(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Rn;return new Zn(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Kn(t,e,n,i){return 1===arguments.length?Gn(t):new Zn(t,e,n,null==i?1:i)}function Zn(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function Qn(t){if(isNaN(t.h))return new Un(t.l,0,0,t.opacity);var e=t.h*$n;return new Un(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}rn(Un,Bn,sn(on,{brighter:function(t){return new Un(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Un(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Cn(Xn(3.1338561*(e=Ln*Yn(e))-1.6168667*(t=1*Yn(t))-.4906146*(n=Fn*Yn(n))),Xn(-.9787684*e+1.9161415*t+.033454*n),Xn(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),rn(Zn,Kn,sn(on,{brighter:function(t){return new Zn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Zn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Qn(this).rgb()}}));var ti=-.14861,ei=1.78277,ni=-.29227,ii=-.90649,ri=1.97294,si=ri*ii,oi=ri*ei,ai=ei*ni-ii*ti;function li(t){if(t instanceof ui)return new ui(t.h,t.s,t.l,t.opacity);t instanceof Cn||(t=Mn(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(ai*i+si*e-oi*n)/(ai+si-oi),s=i-r,o=(ri*(n-r)-ni*s)/ii,a=Math.sqrt(o*o+s*s)/(ri*r*(1-r)),l=a?Math.atan2(o,s)*Rn-120:NaN;return new ui(l<0?l+360:l,a,r,t.opacity)}function ci(t,e,n,i){return 1===arguments.length?li(t):new ui(t,e,n,null==i?1:i)}function ui(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hi(t,e,n,i,r){var s=t*t,o=s*t;return((1-3*t+3*s-o)*e+(4-6*s+3*o)*n+(1+3*t+3*s-3*o)*i+o*r)/6}function fi(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],s=t[i+1],o=i>0?t[i-1]:2*r-s,a=i<e-1?t[i+2]:2*s-r;return hi((n-i/e)*e,o,r,s,a)}}function di(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],s=t[i%e],o=t[(i+1)%e],a=t[(i+2)%e];return hi((n-i/e)*e,r,s,o,a)}}rn(ui,ci,sn(on,{brighter:function(t){return t=null==t?ln:Math.pow(ln,t),new ui(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?an:Math.pow(an,t),new ui(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*$n,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new Cn(255*(e+n*(ti*i+ei*r)),255*(e+n*(ni*i+ii*r)),255*(e+n*(ri*i)),this.opacity)}}));var pi=t=>()=>t;function mi(t,e){return function(n){return t+n*e}}function gi(t,e){var n=e-t;return n?mi(t,n>180||n<-180?n-360*Math.round(n/360):n):pi(isNaN(t)?e:t)}function _i(t){return 1==(t=+t)?vi:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):pi(isNaN(e)?n:e)}}function vi(t,e){var n=e-t;return n?mi(t,n):pi(isNaN(t)?e:t)}var yi=function Ux(t){var e=_i(t);function n(t,n){var i=e((t=Tn(t)).r,(n=Tn(n)).r),r=e(t.g,n.g),s=e(t.b,n.b),o=vi(t.opacity,n.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=o(e),t+""}}return n.gamma=Ux,n}(1);function bi(t){return function(e){var n,i,r=e.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=Tn(e[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=t(s),o=t(o),a=t(a),i.opacity=1,function(t){return i.r=s(t),i.g=o(t),i.b=a(t),i+""}}}var xi=bi(fi),wi=bi(di);function ki(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}}function Si(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Mi(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,s=new Array(r),o=new Array(i);for(n=0;n<r;++n)s[n]=zi(t[n],e[n]);for(;n<i;++n)o[n]=e[n];return function(t){for(n=0;n<r;++n)o[n]=s[n](t);return o}}function Ti(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ci(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ai(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=zi(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Di=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ei=new RegExp(Di.source,"g");function Ni(t,e){var n,i,r,s=Di.lastIndex=Ei.lastIndex=0,o=-1,a=[],l=[];for(t+="",e+="";(n=Di.exec(t))&&(i=Ei.exec(e));)(r=i.index)>s&&(r=e.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:Ci(n,i)})),s=Ei.lastIndex;return s<e.length&&(r=e.slice(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function zi(t,e){var n,i=typeof e;return null==e||"boolean"===i?pi(e):("number"===i?Ci:"string"===i?(n=wn(e))?(e=n,yi):Ni:e instanceof wn?yi:e instanceof Date?Ti:Si(e)?ki:Array.isArray(e)?Mi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ai:Ci)(t,e)}function Pi(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var ji,Ii=180/Math.PI,$i={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ri(t,e,n,i,r,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),t*i<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*Ii,skewX:Math.atan(l)*Ii,scaleX:o,scaleY:a}}function Li(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(s,o){var a=[],l=[];return s=t(s),o=t(o),function(t,i,r,s,o,a){if(t!==r||i!==s){var l=o.push("translate(",null,e,null,n);a.push({i:l-4,x:Ci(t,r)},{i:l-2,x:Ci(i,s)})}else(r||s)&&o.push("translate("+r+e+s+n)}(s.translateX,s.translateY,o.translateX,o.translateY,a,l),function(t,e,n,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ci(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(s.rotate,o.rotate,a,l),function(t,e,n,s){t!==e?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ci(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(s.skewX,o.skewX,a,l),function(t,e,n,i,s,o){if(t!==n||e!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:Ci(t,n)},{i:a-2,x:Ci(e,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(t){for(var e,n=-1,i=l.length;++n<i;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var Fi=Li(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?$i:Ri(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),Oi=Li(function(t){return null==t?$i:(ji||(ji=document.createElementNS("http://www.w3.org/2000/svg","g")),ji.setAttribute("transform",t),(t=ji.transform.baseVal.consolidate())?Ri((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):$i)},", ",")",")");function Hi(t){return((t=Math.exp(t))+1/t)/2}var Vi=function Wx(t,e,n){function i(i,r){var s,o,a=i[0],l=i[1],c=i[2],u=r[0],h=r[1],f=r[2],d=u-a,p=h-l,m=d*d+p*p;if(m<1e-12)o=Math.log(f/c)/t,s=function(e){return[a+e*d,l+e*p,c*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),_=(f*f-c*c+n*m)/(2*c*e*g),v=(f*f-c*c-n*m)/(2*f*e*g),y=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(v*v+1)-v);o=(b-y)/t,s=function(n){var i=n*o,r=Hi(y),s=c/(e*g)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(t*i+y)-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[a+s*d,l+s*p,c*r/Hi(t*i+y)]}}return s.duration=1e3*o*t/Math.SQRT2,s}return i.rho=function(t){var e=Math.max(.001,+t),n=e*e;return Wx(e,n,n*n)},i}(Math.SQRT2,2,4);function qi(t){return function(e,n){var i=t((e=Pn(e)).h,(n=Pn(n)).h),r=vi(e.s,n.s),s=vi(e.l,n.l),o=vi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=r(t),e.l=s(t),e.opacity=o(t),e+""}}}var Bi=qi(gi),Ui=qi(vi);function Wi(t){return function(e,n){var i=t((e=Kn(e)).h,(n=Kn(n)).h),r=vi(e.c,n.c),s=vi(e.l,n.l),o=vi(e.opacity,n.opacity);return function(t){return e.h=i(t),e.c=r(t),e.l=s(t),e.opacity=o(t),e+""}}}var Yi=Wi(gi),Xi=Wi(vi);function Ji(t){return function e(n){function i(e,i){var r=t((e=ci(e)).h,(i=ci(i)).h),s=vi(e.s,i.s),o=vi(e.l,i.l),a=vi(e.opacity,i.opacity);return function(t){return e.h=r(t),e.s=s(t),e.l=o(Math.pow(t,n)),e.opacity=a(t),e+""}}return n=+n,i.gamma=e,i}(1)}var Gi=Ji(gi),Ki=Ji(vi);function Zi(t,e){void 0===e&&(e=t,t=zi);for(var n=0,i=e.length-1,r=e[0],s=new Array(i<0?0:i);n<i;)s[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return s[e](t-e)}}var Qi,tr,er=0,nr=0,ir=0,rr=0,sr=0,or=0,ar="object"==typeof performance&&performance.now?performance:Date,lr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function cr(){return sr||(lr(ur),sr=ar.now()+or)}function ur(){sr=0}function hr(){this._call=this._time=this._next=null}function fr(t,e,n){var i=new hr;return i.restart(t,e,n),i}function dr(){cr(),++er;for(var t,e=Qi;e;)(t=sr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--er}function pr(){sr=(rr=ar.now())+or,er=nr=0;try{dr()}finally{er=0,function(){var t,e,n=Qi,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Qi=e);tr=t,gr(i)}(),sr=0}}function mr(){var t=ar.now(),e=t-rr;e>1e3&&(or-=e,rr=t)}function gr(t){er||(nr&&(nr=clearTimeout(nr)),t-sr>24?(t<1/0&&(nr=setTimeout(pr,t-ar.now()-or)),ir&&(ir=clearInterval(ir))):(ir||(rr=ar.now(),ir=setInterval(mr,1e3)),er=1,lr(pr)))}function _r(t,e,n){var i=new hr;return e=null==e?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,n),i}hr.prototype=fr.prototype={constructor:hr,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?cr():+n)+(null==e?0:+e),this._next||tr===this||(tr?tr._next=this:Qi=this,tr=this),this._call=t,this._time=n,gr()},stop:function(){this._call&&(this._call=null,this._time=1/0,gr())}};var vr=bt("start","end","cancel","interrupt"),yr=[];function br(t,e,n,i,r,s){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function s(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(s){var c,u,h,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return _r(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(_r(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function a(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),s=-1,o=i.length;++s<o;)i[s].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=fr(s,0,n.time)}(t,n,{name:e,index:i,group:r,on:vr,tween:yr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:0})}function xr(t,e){var n=kr(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function wr(t,e){var n=kr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function kr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Sr(t,e){var n,i,r,s=t.__transition,o=!0;if(s){for(r in e=null==e?null:e+"",s)(n=s[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[r]):o=!1;o&&delete t.__transition}}function Mr(t,e){var n,i;return function(){var r=wr(this,t),s=r.tween;if(s!==n)for(var o=0,a=(i=n=s).length;o<a;++o)if(i[o].name===e){(i=i.slice()).splice(o,1);break}r.tween=i}}function Tr(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var s=wr(this,t),o=s.tween;if(o!==i){r=(i=o).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}s.tween=r}}function Cr(t,e,n){var i=t._id;return t.each(function(){var t=wr(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return kr(t,i).value[e]}}function Ar(t,e){var n;return("number"==typeof e?Ci:e instanceof wn?yi:(n=wn(e))?(e=n,yi):Ni)(t,e)}function Dr(t){return function(){this.removeAttribute(t)}}function Er(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Nr(t,e,n){var i,r,s=n+"";return function(){var o=this.getAttribute(t);return o===s?null:o===i?r:r=e(i=o,n)}}function zr(t,e,n){var i,r,s=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===s?null:o===i?r:r=e(i=o,n)}}function Pr(t,e,n){var i,r,s;return function(){var o,a,l=n(this);if(null!=l)return(o=this.getAttribute(t))===(a=l+"")?null:o===i&&a===r?s:(r=a,s=e(i=o,l));this.removeAttribute(t)}}function jr(t,e,n){var i,r,s;return function(){var o,a,l=n(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:o===i&&a===r?s:(r=a,s=e(i=o,l));this.removeAttributeNS(t.space,t.local)}}function Ir(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function $r(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Rr(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&$r(t,r)),n}return r._value=e,r}function Lr(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&Ir(t,r)),n}return r._value=e,r}function Fr(t,e){return function(){xr(this,t).delay=+e.apply(this,arguments)}}function Or(t,e){return e=+e,function(){xr(this,t).delay=e}}function Hr(t,e){return function(){wr(this,t).duration=+e.apply(this,arguments)}}function Vr(t,e){return e=+e,function(){wr(this,t).duration=e}}function qr(t,e){if("function"!=typeof e)throw new Error;return function(){wr(this,t).ease=e}}function Br(t,e,n){var i,r,s=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?xr:wr;return function(){var o=s(this,t),a=o.on;a!==i&&(r=(i=a).copy()).on(e,n),o.on=r}}var Ur=Le.prototype.constructor;function Wr(t){return function(){this.style.removeProperty(t)}}function Yr(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function Xr(t,e,n){var i,r;function s(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&Yr(t,s,n)),i}return s._value=e,s}function Jr(t){return function(e){this.textContent=t.call(this,e)}}function Gr(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Jr(i)),e}return i._value=t,i}var Kr=0;function Zr(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Qr(t){return Le().transition(t)}function ts(){return++Kr}var es=Le.prototype;Zr.prototype=Qr.prototype={constructor:Zr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=zt(t));for(var i=this._groups,r=i.length,s=new Array(r),o=0;o<r;++o)for(var a,l,c=i[o],u=c.length,h=s[o]=new Array(u),f=0;f<u;++f)(a=c[f])&&(l=t.call(a,a.__data__,f,c))&&("__data__"in a&&(l.__data__=a.__data__),h[f]=l,br(h[f],e,n,f,h,kr(a,n)));return new Zr(s,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=It(t));for(var i=this._groups,r=i.length,s=[],o=[],a=0;a<r;++a)for(var l,c=i[a],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var f,d=t.call(l,l.__data__,h,c),p=kr(l,n),m=0,g=d.length;m<g;++m)(f=d[m])&&br(f,e,n,m,d,p);s.push(d),o.push(l)}return new Zr(s,o,e,n)},selectChild:es.selectChild,selectChildren:es.selectChildren,filter:function(t){"function"!=typeof t&&(t=$t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s,o=e[r],a=o.length,l=i[r]=[],c=0;c<a;++c)(s=o[c])&&t.call(s,s.__data__,c,o)&&l.push(s);return new Zr(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),o=new Array(i),a=0;a<s;++a)for(var l,c=e[a],u=n[a],h=c.length,f=o[a]=new Array(h),d=0;d<h;++d)(l=c[d]||u[d])&&(f[d]=l);for(;a<i;++a)o[a]=e[a];return new Zr(o,this._parents,this._name,this._id)},selection:function(){return new Ur(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=ts(),i=this._groups,r=i.length,s=0;s<r;++s)for(var o,a=i[s],l=a.length,c=0;c<l;++c)if(o=a[c]){var u=kr(o,e);br(o,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Zr(i,this._parents,t,n)},call:es.call,nodes:es.nodes,node:es.node,size:es.size,empty:es.empty,each:es.each,on:function(t,e){var n=this._id;return arguments.length<2?kr(this.node(),n).on.on(t):this.each(Br(n,t,e))},attr:function(t,e){var n=Ct(t),i="transform"===n?Oi:Ar;return this.attrTween(t,"function"==typeof e?(n.local?jr:Pr)(n,i,Cr(this,"attr."+t,e)):null==e?(n.local?Er:Dr)(n):(n.local?zr:Nr)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Ct(t);return this.tween(n,(i.local?Rr:Lr)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Fi:Ar;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var s=oe(this,t),o=(this.style.removeProperty(t),oe(this,t));return s===o?null:s===n&&o===i?r:r=e(n=s,i=o)}}(t,i)).on("end.style."+t,Wr(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,s;return function(){var o=oe(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=oe(this,t)),o===l?null:o===i&&l===r?s:(r=l,s=e(i=o,a))}}(t,i,Cr(this,"style."+t,e))).each(function(t,e){var n,i,r,s,o="style."+e,a="end."+o;return function(){var l=wr(this,t),c=l.on,u=null==l.value[o]?s||(s=Wr(e)):void 0;c===n&&r===u||(i=(n=c).copy()).on(a,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,s=n+"";return function(){var o=oe(this,t);return o===s?null:o===i?r:r=e(i=o,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,Xr(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Cr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Gr(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=kr(this.node(),n).tween,s=0,o=r.length;s<o;++s)if((i=r[s]).name===t)return i.value;return null}return this.each((null==e?Mr:Tr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Fr:Or)(e,t)):kr(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Hr:Vr)(e,t)):kr(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(qr(e,t)):kr(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;wr(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){0==--r&&s()}};n.each(function(){var n=wr(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}),0===r&&s()})},[Symbol.iterator]:es[Symbol.iterator]};function ns(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function is(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var rs=function Yx(t){function e(e){return Math.pow(e,t)}return t=+t,e.exponent=Yx,e}(3),ss=function Xx(t){function e(e){return 1-Math.pow(1-e,t)}return t=+t,e.exponent=Xx,e}(3),os=function Jx(t){function e(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,e.exponent=Jx,e}(3),as=Math.PI,ls=as/2;function cs(t){return(1-Math.cos(as*t))/2}function us(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function hs(t){return((t*=2)<=1?us(1-t):2-us(t-1))/2}function fs(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var ds=4/11,ps=7.5625;function ms(t){return(t=+t)<ds?ps*t*t:t<.7272727272727273?ps*(t-=.5454545454545454)*t+.75:t<.9090909090909091?ps*(t-=.8181818181818182)*t+.9375:ps*(t-=.9545454545454546)*t+.984375}var gs=1.70158,_s=function Gx(t){function e(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,e.overshoot=Gx,e}(gs),vs=function Kx(t){function e(e){return--e*e*((e+1)*t+e)+1}return t=+t,e.overshoot=Kx,e}(gs),ys=function Zx(t){function e(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,e.overshoot=Zx,e}(gs),bs=2*Math.PI,xs=function Qx(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return t*us(- --i)*Math.sin((n-i)/e)}return i.amplitude=function(t){return Qx(t,e*bs)},i.period=function(e){return Qx(t,e)},i}(1,.3),ws=function tw(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return 1-t*us(i=+i)*Math.sin((i+n)/e)}return i.amplitude=function(t){return tw(t,e*bs)},i.period=function(e){return tw(t,e)},i}(1,.3),ks=function ew(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=bs);function i(i){return((i=2*i-1)<0?t*us(-i)*Math.sin((n-i)/e):2-t*us(i)*Math.sin((n+i)/e))/2}return i.amplitude=function(t){return ew(t,e*bs)},i.period=function(e){return ew(t,e)},i}(1,.3),Ss={time:null,delay:0,duration:250,ease:is};function Ms(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Le.prototype.interrupt=function(t){return this.each(function(){Sr(this,t)})},Le.prototype.transition=function(t){var e,n;t instanceof Zr?(e=t._id,t=t._name):(e=ts(),(n=Ss).time=cr(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var o,a=i[s],l=a.length,c=0;c<l;++c)(o=a[c])&&br(o,t,e,c,a,n||Ms(o,e));return new Zr(i,this._parents,t,e)};var Ts=[null];var Cs=t=>()=>t;function As(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Ds(t){t.stopImmediatePropagation()}function Es(t){t.preventDefault(),t.stopImmediatePropagation()}var Ns={name:"drag"},zs={name:"space"},Ps={name:"handle"},js={name:"center"};const{abs:Is,max:$s,min:Rs}=Math;function Ls(t){return[+t[0],+t[1]]}function Fs(t){return[Ls(t[0]),Ls(t[1])]}var Os={name:"x",handles:["w","e"].map(Xs),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Hs={name:"y",handles:["n","s"].map(Xs),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Vs={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Xs),input:function(t){return null==t?null:Fs(t)},output:function(t){return t}},qs={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bs={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Us={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ws={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ys={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xs(t){return{type:t}}function Js(t){return!t.ctrlKey&&!t.button}function Gs(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ks(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zs(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Qs(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function to(t){var e,n=Gs,i=Js,r=Ks,s=!0,o=bt("start","brush","end"),a=6;function l(e){var n=e.property("__brush",m).selectAll(".overlay").data([Xs("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",qs.overlay).merge(n).each(function(){var t=Zs(this).extent;Fe(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),e.selectAll(".selection").data([Xs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",qs.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=e.selectAll(".handle").data(t.handles,function(t){return t.type});
vendor: 3,121 bytes, line 713
713i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return qs[t.type]}),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Fe(this),e=Zs(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-a/2:e[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-a/2:e[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,e,n){var i=t.__brush.emitter;return!i||n&&i.clean?new h(t,e,n):i}function h(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function f(n){if((!e||n.touches)&&i.apply(this,arguments)){var r,o,a,l,h,f,d,p,m,g,_,v=this,y=n.target.__data__.type,b="selection"===(s&&n.metaKey?y="overlay":y)?Ns:s&&n.altKey?js:Ps,x=t===Hs?null:Ws[y],w=t===Os?null:Ys[y],k=Zs(v),S=k.extent,M=k.selection,T=S[0][0],C=S[0][1],A=S[1][0],D=S[1][1],E=0,N=0,z=x&&w&&s&&n.shiftKey,P=Array.from(n.touches||[n],t=>{const e=t.identifier;return(t=Be(t,v)).point0=t.slice(),t.identifier=e,t});Sr(v);var j=u(v,arguments,!0).beforestart();if("overlay"===y){M&&(m=!0);const e=[P[0],P[1]||P[0]];k.selection=M=[[r=t===Hs?T:Rs(e[0][0],e[1][0]),a=t===Os?C:Rs(e[0][1],e[1][1])],[h=t===Hs?A:$s(e[0][0],e[1][0]),d=t===Os?D:$s(e[0][1],e[1][1])]],P.length>1&&F(n)}else r=M[0][0],a=M[0][1],h=M[1][0],d=M[1][1];o=r,l=a,f=h,p=d;var I=Fe(v).attr("pointer-events","none"),$=I.selectAll(".overlay").attr("cursor",qs[y]);if(n.touches)j.moved=L,j.ended=O;else{var R=Fe(n.view).on("mousemove.brush",L,!0).on("mouseup.brush",O,!0);s&&R.on("keydown.brush",H,!0).on("keyup.brush",V,!0),Je(n.view)}c.call(v),j.start(n,b.name)}function L(t){for(const e of t.changedTouches||[t])for(const t of P)t.identifier===e.identifier&&(t.cur=Be(e,v));if(z&&!g&&!_&&1===P.length){const t=P[0];Is(t.cur[0]-t[0])>Is(t.cur[1]-t[1])?_=!0:g=!0}for(const t of P)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,Es(t),F(t)}function F(t){const e=P[0],n=e.point0;var i;switch(E=e[0]-n[0],N=e[1]-n[1],b){case zs:case Ns:x&&(E=$s(T-r,Rs(A-h,E)),o=r+E,f=h+E),w&&(N=$s(C-a,Rs(D-d,N)),l=a+N,p=d+N);break;case Ps:P[1]?(x&&(o=$s(T,Rs(A,P[0][0])),f=$s(T,Rs(A,P[1][0])),x=1),w&&(l=$s(C,Rs(D,P[0][1])),p=$s(C,Rs(D,P[1][1])),w=1)):(x<0?(E=$s(T-r,Rs(A-r,E)),o=r+E,f=h):x>0&&(E=$s(T-h,Rs(A-h,E)),o=r,f=h+E),w<0?(N=$s(C-a,Rs(D-a,N)),l=a+N,p=d):w>0&&(N=$s(C-d,Rs(D-d,N)),l=a,p=d+N));break;case js:x&&(o=$s(T,Rs(A,r-E*x)),f=$s(T,Rs(A,h+E*x))),w&&(l=$s(C,Rs(D,a-N*w)),p=$s(C,Rs(D,d+N*w)))}
vendor: 4,468 bytes, lines 713-714
713f<o&&(x*=-1,i=r,r=h,h=i,i=o,o=f,f=i,y in Bs&&$.attr("cursor",qs[y=Bs[y]])),p<l&&(w*=-1,i=a,a=d,d=i,i=l,l=p,p=i,y in Us&&$.attr("cursor",qs[y=Us[y]])),k.selection&&(M=k.selection),g&&(o=M[0][0],f=M[1][0]),_&&(l=M[0][1],p=M[1][1]),M[0][0]===o&&M[0][1]===l&&M[1][0]===f&&M[1][1]===p||(k.selection=[[o,l],[f,p]],c.call(v),j.brush(t,b.name))}function O(t){if(Ds(t),t.touches){if(t.touches.length)return;e&&clearTimeout(e),e=setTimeout(function(){e=null},500)}else Ge(t.view,m),R.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);I.attr("pointer-events","all"),$.attr("cursor",qs.overlay),k.selection&&(M=k.selection),Qs(M)&&(k.selection=null,c.call(v)),j.end(t,b.name)}function H(t){switch(t.keyCode){case 16:z=x&&w;break;case 18:b===Ps&&(x&&(h=f-E*x,r=o+E*x),w&&(d=p-N*w,a=l+N*w),b=js,F(t));break;case 32:b!==Ps&&b!==js||(x<0?h=f-E:x>0&&(r=o-E),w<0?d=p-N:w>0&&(a=l-N),b=zs,$.attr("cursor",qs.selection),F(t));break;default:return}Es(t)}function V(t){switch(t.keyCode){case 16:z&&(g=_=z=!1,F(t));break;case 18:b===js&&(x<0?h=f:x>0&&(r=o),w<0?d=p:w>0&&(a=l),b=Ps,F(t));break;case 32:b===zs&&(t.altKey?(x&&(h=f-E*x,r=o+E*x),w&&(d=p-N*w,a=l+N*w),b=js):(x<0?h=f:x>0&&(r=o),w<0?d=p:w>0&&(a=l),b=Ps),$.attr("cursor",qs[y]),F(t));break;default:return}Es(t)}}function d(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function m(){var e=this.__brush||{selection:null}
714;return e.extent=Fs(n.apply(this,arguments)),e.dim=t,e}return l.move=function(e,n,i){e.tween?e.on("start.brush",function(t){u(this,arguments).beforestart().start(t)}).on("interrupt.brush end.brush",function(t){u(this,arguments).end(t)}).tween("brush",function(){var e=this,i=e.__brush,r=u(e,arguments),s=i.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,i.extent),a=zi(s,o);function l(t){i.selection=1===t&&null===o?null:a(t),c.call(e),r.brush()}return null!==s&&null!==o?l:l(1)}):e.each(function(){var e=this,r=arguments,s=e.__brush,o=t.input("function"==typeof n?n.apply(e,r):n,s.extent),a=u(e,r).beforestart();Sr(e),s.selection=null===o?null:o,c.call(e),a.start(i).brush(i).end(i)})},l.clear=function(t,e){l.move(t,null,e)},h.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,i){var r=Fe(this.that).datum();o.call(e,this.that,new As(e,{sourceEvent:n,target:l,selection:t.output(this.state.selection),mode:i,dispatch:o}),r)}},l.extent=function(t){return arguments.length?(n="function"==typeof t?t:Cs(Fs(t)),l):n},l.filter=function(t){return arguments.length?(i="function"==typeof t?t:Cs(!!t),l):i},l.touchable=function(t){return arguments.length?(r="function"==typeof t?t:Cs(!!t),l):r},l.handleSize=function(t){return arguments.length?(a=+t,l):a},l.keyModifiers=function(t){return arguments.length?(s=!!t,l):s},l.on=function(){var t=o.on.apply(o,arguments);return t===o?l:t},l}var eo=Math.abs,no=Math.cos,io=Math.sin,ro=Math.PI,so=ro/2,oo=2*ro,ao=Math.max,lo=1e-12;function co(t,e){return Array.from({length:e-t},(e,n)=>t+n)}function uo(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function ho(t,e){var n=0,i=null,r=null,s=null;function o(o){var a,l=o.length,c=new Array(l),u=co(0,l),h=new Array(l*l),f=new Array(l),d=0;o=Float64Array.from({length:l*l},e?(t,e)=>o[e%l][e/l|0]:(t,e)=>o[e/l|0][e%l]);for(let e=0;e<l;++e){let n=0;for(let i=0;i<l;++i)n+=o[e*l+i]+t*o[i*l+e];d+=c[e]=n}a=(d=ao(0,oo-n*l)/d)?n:oo/l;{let e=0;i&&u.sort((t,e)=>i(c[t],c[e]));for(const n of u){const i=e;if(t){const t=co(1+~l,l).filter(t=>t<0?o[~t*l+n]:o[n*l+t]);r&&t.sort((t,e)=>r(t<0?-o[~t*l+n]:o[n*l+t],e<0?-o[~e*l+n]:o[n*l+e]));for(const i of t)if(i<0){(h[~i*l+n]||(h[~i*l+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=o[~i*l+n]*d,value:o[~i*l+n]}}else{(h[n*l+i]||(h[n*l+i]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]}}f[n]={index:n,startAngle:i,endAngle:e,value:c[n]}}else{const t=co(0,l).filter(t=>o[n*l+t]||o[t*l+n]);r&&t.sort((t,e)=>r(o[n*l+t],o[n*l+e]));for(const i of t){let t;if(n<i?(t=h[n*l+i]||(h[n*l+i]={source:null,target:null}),t.source={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]}
vendor: 5,571 bytes, line 714
714):(t=h[i*l+n]||(h[i*l+n]={source:null,target:null}),t.target={index:n,startAngle:e,endAngle:e+=o[n*l+i]*d,value:o[n*l+i]},n===i&&(t.source=t.target)),t.source&&t.target&&t.source.value<t.target.value){const e=t.source;t.source=t.target,t.target=e}}f[n]={index:n,startAngle:i,endAngle:e,value:c[n]}}e+=a}}return(h=Object.values(h)).groups=f,s?h.sort(s):h}return o.padAngle=function(t){return arguments.length?(n=ao(0,t),o):n},o.sortGroups=function(t){return arguments.length?(i=t,o):i},o.sortSubgroups=function(t){return arguments.length?(r=t,o):r},o.sortChords=function(t){return arguments.length?(null==t?s=null:(s=uo(t))._=t,o):s&&s._},o}const fo=Math.PI,po=2*fo,mo=1e-6,go=po-mo;function _o(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function vo(){return new _o}_o.prototype=vo.prototype={constructor:_o,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,s){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-t,l=i-e,c=s-t,u=o-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>mo)if(Math.abs(u*a-l*c)>mo&&r){var f=n-s,d=i-o,p=a*a+l*l,m=f*f+d*d,g=Math.sqrt(p),_=Math.sqrt(h),v=r*Math.tan((fo-Math.acos((p+h-m)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>mo&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*f>c*d)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,s){t=+t,e=+e,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=t+o,c=e+a,u=1^s,h=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>mo||Math.abs(this._y1-c)>mo)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%po+po),h>go?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>mo&&(this._+="A"+n+","+n+",0,"+ +(h>=fo)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var yo=Array.prototype.slice;function bo(t){return function(){return t}}function xo(t){return t.source}function wo(t){return t.target}function ko(t){return t.radius}function So(t){return t.startAngle}function Mo(t){return t.endAngle}function To(){return 0}function Co(){return 10}function Ao(t){var e=xo,n=wo,i=ko,r=ko,s=So,o=Mo,a=To,l=null;function c(){var c,u=e.apply(this,arguments),h=n.apply(this,arguments),f=a.apply(this,arguments)/2,d=yo.call(arguments),p=+i.apply(this,(d[0]=u,d)),m=s.apply(this,d)-so,g=o.apply(this,d)-so,_=+r.apply(this,(d[0]=h,d)),v=s.apply(this,d)-so,y=o.apply(this,d)-so;if(l||(l=c=vo()),f>lo&&(eo(g-m)>2*f+lo?g>m?(m+=f,g-=f):(m-=f,g+=f):m=g=(m+g)/2,eo(y-v)>2*f+lo?y>v?(v+=f,y-=f):(v-=f,y+=f):v=y=(v+y)/2),l.moveTo(p*no(m),p*io(m)),l.arc(0,0,p,m,g),m!==v||g!==y)if(t){var b=+t.apply(this,arguments),x=_-b,w=(v+y)/2;l.quadraticCurveTo(0,0,x*no(v),x*io(v)),l.lineTo(_*no(w),_*io(w)),l.lineTo(x*no(y),x*io(y))}else l.quadraticCurveTo(0,0,_*no(v),_*io(v)),l.arc(0,0,_,v,y);if(l.quadraticCurveTo(0,0,p*no(m),p*io(m)),l.closePath(),c)return l=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:bo(+e),c):t}),c.radius=function(t){return arguments.length?(i=r="function"==typeof t?t:bo(+t),c):i},c.sourceRadius=function(t){return arguments.length?(i="function"==typeof t?t:bo(+t),c):i},c.targetRadius=function(t){return arguments.length?(r="function"==typeof t?t:bo(+t),c):r},c.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:bo(+t),c):s},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:bo(+t),c):o},c.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:bo(+t),c):a},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(l=null==t?null:t,c):l},c}var Do=Array.prototype.slice;function Eo(t,e){return t-e}var No=t=>()=>t;function zo(t,e){for(var n,i=-1,r=e.length;++i<r;)if(n=Po(t,e[i]))return n;return 0}function Po(t,e){for(var n=e[0],i=e[1],r=-1,s=0,o=t.length,a=o-1;s<o;a=s++){var l=t[s],c=l[0],u=l[1],h=t[a],f=h[0],d=h[1];if(jo(l,h,e))return 0;u>i!=d>i&&n<(f-c)*(i-u)/(d-u)+c&&(r=-r)}return r}function jo(t,e,n){var i,r,s,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(r=t[i=+(t[0]===e[0])],s=n[i],o=e[i],r<=s&&s<=o||o<=s&&s<=r)}function Io(){}var $o=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Ro(){var t=1,e=1,n=B,i=a;function r(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Eo);else{const n=m(t),i=V(n[0],n[1],e);e=O(Math.floor(n[0]/i)*i,Math.floor(n[1]/i-1)*i,e)}return e.map(e=>s(t,e))}function s(n,r){var s=[],a=[];return function(n,i,r){var s,a,l,c,u,h,f=new Array,d=new Array;s=a=-1,c=n[0]>
714=i,$o[c<<1].forEach(p);for(;++s<t-1;)l=c,c=n[s+1]>=i,$o[l|c<<1].forEach(p);$o[c<<0].forEach(p);for(;++a<e-1;){for(s=-1,c=n[a*t+t]>=i,u=n[a*t]>=i,$o[c<<1|u<<2].forEach(p);++s<t-1;)l=c,c=n[a*t+t+s+1]>=i,h=u,u=n[a*t+s+1]>=i,$o[l|c<<1|u<<2|h<<3].forEach(p);$o[c|u<<3].forEach(p)}s=-1,u=n[a*t]>=i,$o[u<<2].forEach(p);for(;++s<t-1;)h=u,u=n[a*t+s+1]>=i,$o[u<<2|h<<3].forEach(p);function p(t){var e,n,i=[t[0][0]+s,t[0][1]+a],l=[t[1][0]+s,t[1][1]+a],c=o(i),u=o(l);(e=d[c])?(n=f[u])?(delete d[e.end],delete f[n.start],e===n?(e.ring.push(l),r(e.ring)):f[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(l),d[e.end=u]=e):(e=f[u])?(n=d[c])?(delete f[e.start],delete d[n.end],e===n?(e.ring.push(l),r(e.ring)):f[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete f[e.start],e.ring.unshift(i),f[e.start=c]=e):f[c]=d[u]={start:c,end:u,ring:[i,l]}}$o[u<<3].forEach(p)}(n,r,function(t){i(t,n,r),function(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)i+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return i}(t)>0?s.push([t]):a.push(t)}),a.forEach(function(t){for(var e,n=0,i=s.length;n<i;++n)if(-1!==zo((e=s[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:r,coordinates:s}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,i,r){n.forEach(function(n){var s,o=n[0],a=n[1],l=0|o,c=0|a,u=i[c*t+l];o>0&&o<t&&l===o&&(s=i[c*t+l-1],n[0]=o+(r-s)/(u-s)-.5),a>0&&a<e&&c===a&&(s=i[(c-1)*t+l],n[1]=a+(r-s)/(u-s)-.5)})}return r.contour=s,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),s=Math.floor(n[1]);if(!(i>=0&&s>=0))throw new Error("invalid size");return t=i,e=s,r},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?No(Do.call(t)):No(t),r):n},r.smooth=function(t){return arguments.length?(i=t?a:Io,r):i===a},r}function Lo(t,e,n){for(var i=t.width,r=t.height,s=1+(n<<1),o=0;o<r;++o)for(var a=0,l=0;a<i+n;++a)a<i&&(l+=t.data[a+o*i]),a>=n&&(a>=s&&(l-=t.data[a-s+o*i]),e.data[a-n+o*i]=l/Math.min(a+1,i-1+s-a,s))}function Fo(t,e,n){for(var i=t.width,r=t.height,s=1+(n<<1),o=0;o<i;++o)for(var a=0,l=0;a<r+n;++a)a<r&&(l+=t.data[o+a*i]),a>=n&&(a>=s&&(l-=t.data[o+(a-s)*i]),e.data[o+(a-n)*i]=l/Math.min(a+1,r-1+s-a,s))}function Oo(t){return t[0]}function Ho(t){return t[1]}function Vo(){return 1}const qo=134217729;function Bo(t,e,n,i,r){let s,o,a,l,c=e[0],u=i[0],h=0,f=0;u>c==u>-c?(s=c,c=e[++h]):(s=u,u=i[++f]);let d=0;if(h<t&&f<n)for(u>c==u>-c?(o=c+s,a=s-(o-c),c=e[++h]):(o=u+s,a=s-(o-u),u=i[++f]),s=o,0!==a&&(r[d++]=a);h<t&&f<n;)u>c==u>-c?(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++h]):(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=i[++f]),s=o,0!==a&&(r[d++]=a);for(;h<t;)o=s+c,l=o-s,a=s-(o-l)+(c-l),c=e[++h],s=o,0!==a&&(r[d++]=a);for(;f<n;)o=s+u,l=o-s,a=s-(o-l)+(u-l),u=i[++f],s=o,0!==a&&(r[d++]=a);return 0===s&&0!==d||(r[d++]=s),d}function Uo(t){return new Float64Array(t)}const Wo=Uo(4),Yo=Uo(8),Xo=Uo(12),Jo=Uo(16),Go=Uo(4);function Ko(t,e,n,i,r,s){const o=(e-s)*(n-r),a=(t-r)*(i-s),l=o-a;if(0===o||0===a||o>0!=a>0)return l;const c=Math.abs(o+a);return Math.abs(l)>=3.3306690738754716e-16*c?l:-function(t,e,n,i,r,s,o){let a,l,c,u,h,f,d,p,m,g,_,v,y,b,x,w,k,S;const M=t-r,T=n-r,C=e-s,A=i-s;b=M*A,f=qo*M,d=f-(f-M),p=M-d,f=qo*A,m=f-(f-A),g=A-m,x=p*g-(b-d*m-p*m-d*g),w=C*T,f=qo*C,d=f-(f-C),p=C-d,f=qo*T,m=f-(f-T),g=T-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Wo[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Wo[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Wo[2]=v-(S-h)+(_-h),Wo[3]=S;let D=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,Wo),E=2.2204460492503146e-16*o;if(D>=E||-D>=E)return D;if(h=t-M,a=t-(M+h)+(h-r),h=n-T,c=n-(T+h)+(h-r),h=e-C,l=e-(C+h)+(h-s),h=i-A,u=i-(A+h)+(h-s),0===a&&0===l&&0===c&&0===u)return D;if(E=1.1093356479670487e-31*o+3.3306690738754706e-16*Math.abs(D),D+=M*u+A*a-(C*c+T*l),D>=E||-D>=E)return D;b=a*A,f=qo*a,d=f-(f-a),p=a-d,f=qo*A,m=f-(f-A),g=A-m,x=p*g-(b-d*m-p*m-d*g),w=l*T,f=qo*l,d=f-(f-l),p=l-d,f=qo*T,m=f-(f-T),g=T-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const N=Bo(4,Wo,4,Go,Yo);b=M*u,f=qo*M,d=f-(f-M),p=M-d,f=qo*u,m=f-(f-u),g=u-m,x=p*g-(b-d*m-p*m-d*g),w=C*c,f=qo*C,d=f-(f-C),p=C-d,f=qo*c,m=f-(f-c),g=c-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const z=Bo(N,Yo,4,Go,Xo);b=a*u,f=qo*a,d=f-(f-a),p=a-d,f=qo*u,m=f-(f-u),g=u-m,x=p*g-(b-d*m-p*m-d*g),w=l*c,f=qo*l,d=f-(f-l),p=l-d,f=qo*c,m=f-(f-c),g=c-m,k=p*g-(w-d*m-p*m-d*g),_=x-k,h=x-_,Go[0]=x-(_+h)+(h-k),v=b+_,h=v-b,y=b-(v-h)+(_-h),_=y-w,h=y-_,Go[1]=y-(_+h)+(h-w),S=v+_,h=S-v,Go[2]=v-(S-h)+(_-h),Go[3]=S;const P=Bo(z,Xo,4,Go,Jo);return Jo[P-1]}(t,e,n,i,r,s,c)}const Zo=Math.pow(2,-52),Qo=new Uint32Array(512);class ta{static from(t,e=oa,n=aa){const i=t.length,r=new Float64Array(2*i);for(let s=0;s<i;s++){const i=t[s];r[2*s]=e(i),r[2*s+1]=n(i)}return new ta(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,s=t.length>>1;let o=1/0,a=1/0,l=-1/0,c=-1/0;for(let e=0;e<s;e++){const n=t[2*e],i=t[2*e+1];n<o&&(o=n),i<a&&(a=i),n>l&&(l=n),i>c&&(c=i),this._ids[e]=e}const u=(o+l)/2,h=(a+c)/2;let f,d,p,m=1/0;for(let e=0;e<s;
vendor: 4,697 bytes, line 714
714e++){const n=ea(u,h,t[2*e],t[2*e+1]);n<m&&(f=e,m=n)}const g=t[2*f],_=t[2*f+1];m=1/0;for(let e=0;e<s;e++){if(e===f)continue;const n=ea(g,_,t[2*e],t[2*e+1]);n<m&&n>0&&(d=e,m=n)}let v=t[2*d],y=t[2*d+1],b=1/0;for(let e=0;e<s;e++){if(e===f||e===d)continue;const n=ia(g,_,v,y,t[2*e],t[2*e+1]);n<b&&(p=e,b=n)}let x=t[2*p],w=t[2*p+1];if(b===1/0){for(let e=0;e<s;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];ra(this._ids,this._dists,0,s-1);const e=new Uint32Array(s);let n=0;for(let t=0,i=-1/0;t<s;t++){const r=this._ids[t];this._dists[r]>i&&(e[n++]=r,i=this._dists[r])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ko(g,_,v,y,x,w)<0){const t=d,e=v,n=y;d=p,v=x,y=w,p=t,x=e,w=n}const k=function(t,e,n,i,r,s){const o=n-t,a=i-e,l=r-t,c=s-e,u=o*o+a*a,h=l*l+c*c,f=.5/(o*c-a*l);return{x:t+(c*u-a*h)*f,y:e+(o*h-l*u)*f}}(g,_,v,y,x,w);this._cx=k.x,this._cy=k.y;for(let e=0;e<s;e++)this._dists[e]=ea(t[2*e],t[2*e+1],k.x,k.y);ra(this._ids,this._dists,0,s-1),this._hullStart=f;let S=3;n[f]=e[p]=d,n[d]=e[f]=p,n[p]=e[d]=f,i[f]=0,i[d]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,_)]=f,r[this._hashKey(v,y)]=d,r[this._hashKey(x,w)]=p,this.trianglesLen=0,this._addTriangle(f,d,p,-1,-1,-1);for(let s,o,a=0;a<this._ids.length;a++){const l=this._ids[a],c=t[2*l],u=t[2*l+1];if(a>0&&Math.abs(c-s)<=Zo&&Math.abs(u-o)<=Zo)continue;if(s=c,o=u,l===f||l===d||l===p)continue;let h=0;for(let t=0,e=this._hashKey(c,u);t<this._hashSize&&(h=r[(e+t)%this._hashSize],-1===h||h===n[h]);t++);h=e[h];let m,g=h;for(;m=n[g],Ko(c,u,t[2*g],t[2*g+1],t[2*m],t[2*m+1])>=0;)if(g=m,g===h){g=-1;break}if(-1===g)continue;let _=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(_+2),i[g]=_,S++;let v=n[g];for(;m=n[v],Ko(c,u,t[2*v],t[2*v+1],t[2*m],t[2*m+1])<0;)_=this._addTriangle(v,l,m,i[l],-1,i[v]),i[l]=this._legalize(_+2),n[v]=v,S--,v=m;if(g===h)for(;m=e[g],Ko(c,u,t[2*m],t[2*m+1],t[2*g],t[2*g+1])<0;)_=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(_+2),i[m]=_,n[g]=g,S--,g=m;this._hullStart=e[l]=g,n[g]=e[v]=l,n[l]=v,r[this._hashKey(c,u)]=l,r[this._hashKey(t[2*g],t[2*g+1])]=g}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,s=0;for(;;){const o=n[t],a=t-t%3;if(s=a+(t+2)%3,-1===o){if(0===r)break;t=Qo[--r];continue}const l=o-o%3,c=a+(t+1)%3,u=l+(o+2)%3,h=e[s],f=e[t],d=e[c],p=e[u];if(na(i[2*h],i[2*h+1],i[2*f],i[2*f+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1])){e[t]=p,e[o]=h;const i=n[u];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===u){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(o,n[s]),this._link(s,u);const a=l+(o+1)%3;r<Qo.length&&(Qo[r++]=a)}else{if(0===r)break;t=Qo[--r]}}return s}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,s){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,i),this._link(o+1,r),this._link(o+2,s),this.trianglesLen+=3,o}}function ea(t,e,n,i){const r=t-n,s=e-i;return r*r+s*s}function na(t,e,n,i,r,s,o,a){const l=t-o,c=e-a,u=n-o,h=i-a,f=r-o,d=s-a,p=u*u+h*h,m=f*f+d*d;return l*(h*m-p*d)-c*(u*m-p*f)+(l*l+c*c)*(u*d-h*f)<0}function ia(t,e,n,i,r,s){const o=n-t,a=i-e,l=r-t,c=s-e,u=o*o+a*a,h=l*l+c*c,f=.5/(o*c-a*l),d=(c*u-a*h)*f,p=(o*h-l*u)*f;return d*d+p*p}function ra(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],s=e[i];let o=r-1;for(;o>=n&&e[t[o]]>s;)t[o+1]=t[o--];t[o+1]=i}else{let r=n+1,s=i;sa(t,n+i>>1,r),e[t[n]]>e[t[i]]&&sa(t,n,i),e[t[r]]>e[t[i]]&&sa(t,r,i),e[t[n]]>e[t[r]]&&sa(t,n,r);const o=t[r],a=e[o];for(;;){do{r++}while(e[t[r]]<a);do{s--}while(e[t[s]]>a);if(s<r)break;sa(t,r,s)}t[n+1]=t[s],t[s]=o,i-r+1>=s-n?(ra(t,e,r,i),ra(t,e,n,s-1)):(ra(t,e,n,s-1),ra(t,e,r,i))}}function sa(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function oa(t){return t[0]}function aa(t){return t[1]}const la=1e-6;class ca{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>la||Math.abs(this._y1-r)>la)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n}
714,0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class ua{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class ha{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,i,s=0,o=0,a=n.length;s<a;s+=3,o+=2){const a=2*n[s],l=2*n[s+1],c=2*n[s+2],u=t[a],h=t[a+1],f=t[l],d=t[l+1],p=t[c],m=t[c+1],g=f-u,_=d-h,v=p-u,y=m-h,b=2*(g*y-_*v);if(Math.abs(b)<1e-9){let r=1e9;const s=2*n[0];r*=Math.sign((t[s]-u)*y-(t[s+1]-h)*v),e=(u+p)/2-r*y,i=(h+m)/2+r*v}else{const t=1/b,n=g*g+_*_,r=v*v+y*y;e=u+(y*n-_*r)*t,i=h+(g*r-v*n)*t}r[o]=e,r[o+1]=i}let s,o,a,l=e[e.length-1],c=4*l,u=t[2*l],h=t[2*l+1];i.fill(0);for(let n=0;n<e.length;++n)l=e[n],s=c,o=u,a=h,c=4*l,u=t[2*l],h=t[2*l+1],i[s+2]=i[c]=a-h,i[s+3]=i[c+1]=u-o}render(t){const e=null==t?t=new ca:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:s,vectors:o}=this;if(r.length<=1)return null;for(let e=0,i=n.length;e<i;++e){const i=n[e];if(i<e)continue;const r=2*Math.floor(e/3),o=2*Math.floor(i/3),a=s[r],l=s[r+1],c=s[o],u=s[o+1];this._renderSegment(a,l,c,u,t)}let a,l=r[r.length-1];for(let e=0;e<r.length;++e){a=l,l=r[e];const n=2*Math.floor(i[l]/3),c=s[n],u=s[n+1],h=4*a,f=this._project(c,u,o[h+2],o[h+3]);f&&this._renderSegment(c,u,f[0],f[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new ca:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new ca:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let t=2;t<r;t+=2)i[t]===i[t-2]&&i[t+1]===i[t-1]||e.lineTo(i[t],i[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new ua;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let s;const o=this._regioncode(t,e),a=this._regioncode(n,i);0===o&&0===a?(r.moveTo(t,e),r.lineTo(n,i)):(s=this._clipSegment(t,e,n,i,o,a))&&(r.moveTo(s[0],s[1]),r.lineTo(s[2],s[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let s=0,o=t.length;s<o;s+=2)if(e[i]==t[s]&&e[i+1]==t[s+1]&&e[(i+2)%r]==t[(s+o-2)%o]&&e[(i+3)%r]==t[(s+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,s=n[t];if(-1===s)return null;const o=[];let a=s;do{const n=Math.floor(a/3);if(o.push(e[2*n],e[2*n+1]),a=a%3==2?a-2:a+1,r[a]!==t)break;a=i[a]}while(a!==s&&-1!==a);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let i,r,s,o,a=null,l=e[n-2],c=e[n-1],u=this._regioncode(l,c),h=0;for(let f=0;f<n;f+=2)if(i=l,r=c,l=e[f],c=e[f+1],s=u,u=this._regioncode(l,c),0===s&&0===u)o=h,h=0,a?a.push(l,c):a=[l,c];else{let e,n,f,d,p;if(0===s){if(null===(e=this._clipSegment(i,r,l,c,s,u)))continue;[n,f,d,p]=e}else{if(null===(e=this._clipSegment(l,c,i,r,u,s)))continue;[d,p,n,f]=e,o=h,h=this._edgecode(n,f),o&&h&&this._edge(t,o,h,a,a.length),a?a.push(n,f):a=[n,f]}o=h,h=this._edgecode(d,p),o&&h&&this._edge(t,o,h,a,a.length),a?a.push(d,p):a=[d,p]}if(a)o=h,h=this._edgecode(a[0],a[1]),o&&h&&this._edge(t,o,h,a,a.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return a}_clipSegment(t,e,n,i,r,s){for(;;){if(0===r&&0===s)return[t,e,n,i];if(r&s)return null;let o,a,l=r||s;8&l?(o=t+(n-t)*(this.ymax-e)/(i-e),a=this.ymax):4&l?(o=t+(n-t)*(this.ymin-e)/(i-e),a=this.ymin):2&l?(a=e+(i-e)*(this.xmax-t)/(n-t),o=this.xmax):(a=e+(i-e)*(this.xmin-t)/(n-t),o=this.xmin),r?(t=o,e=a,r=this._regioncode(t,e)):(n=o,i=a,s=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,s){let o,a=Array.from(e);if((o=this._project(a[0],a[1],n,i))&&a.unshift(o[0],o[1]),(o=this._project(a[a.length-2],a[a.length-1],r,s
vendor: 4,158 bytes, line 714
714))&&a.push(o[0],o[1]),a=this._clipFinite(t,a))for(let e,n=0,i=a.length,r=this._edgecode(a[i-2],a[i-1]);n<i;n+=2)e=r,r=this._edgecode(a[n],a[n+1]),e&&r&&(n=this._edge(t,e,r,a,n),i=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,e,n,i,r){for(;e!==n;){let n,s;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,s=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,s=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,s=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,s=this.ymin}i[r]===n&&i[r+1]===s||!this.contains(t,n,s)||(i.splice(r,0,n,s),r+=2)}if(i.length>4)for(let t=0;t<i.length;t+=2){const e=(t+2)%i.length,n=(t+4)%i.length;(i[t]===i[e]&&i[e]===i[n]||i[t+1]===i[e+1]&&i[e+1]===i[n+1])&&(i.splice(e,2),t-=2)}return r}_project(t,e,n,i){let r,s,o,a=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<a&&(o=this.ymin,s=t+(a=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<a&&(o=this.ymax,s=t+(a=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<a&&(s=this.xmax,o=e+(a=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<a&&(s=this.xmin,o=e+(a=r)*i)}return[s,o]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const fa=2*Math.PI,da=Math.pow;function pa(t){return t[0]}function ma(t){return t[1]}function ga(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class _a{static from(t,e=pa,n=ma,i){return new _a("length"in t?function(t,e,n,i){const r=t.length,s=new Float64Array(2*r);for(let o=0;o<r;++o){const r=t[o];s[2*o]=e.call(i,r,o,t),s[2*o+1]=n.call(i,r,o,t)}return s}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const s of t)yield e.call(i,s,r,t),yield n.call(i,s,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new ta(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const i=2*e[t],r=2*e[t+1],s=2*e[t+2];if((n[s]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(t,e)=>e).sort((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]);const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t<n;++t){const n=ga(e[2*t],e[2*t+1],r);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new ta(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=r[t%3==2?t-2:t+1];-1!==n[t]&&-1!==s[e]||(s[e]=t)}for(let t=0,e=i.length;t<e;++t)o[i[t]]=t;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,2===i.length&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new ha(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const a=e[t];if(-1===a)return;let l=a,c=-1;do{if(yield c=s[l],l=l%3==2?l-2:l+1,s[l]!==t)return;if(l=r[l],-1===l){const e=n[(i[t]+1)%n.length];return void(e!==c&&(yield e))}}while(l!==a)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:o,triangles:a,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let c=t,u=da(e-l[2*t],2)+da(n-l[2*t+1],2);const h=i[t];let f=h;do{let i=a[f];const h=da(e-l[2*i],2)+da(n-l[2*i+1],2);
vendor: 6,759 bytes, lines 714-715
714if(h<u&&(u=h,c=i),f=f%3==2?f-2:f+1,a[f]!==t)break;if(f=o[f],-1===f){if(f=r[(s[t]+1)%r.length],f!==i&&da(e-l[2*f],2)+da(n-l[2*f+1],2)<u)return f;break}}while(f!==h);return c}render(t){const e=null==t?t=new ca:void 0,{points:n,halfedges:i,triangles:r}=this;for(let e=0,s=i.length;e<s;++e){const s=i[e];if(s<e)continue;const o=2*r[e],a=2*r[s];t.moveTo(n[o],n[o+1]),t.lineTo(n[a],n[a+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new ca:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],s=i[n+1];t.moveTo(r+e,s),t.arc(r,s,e,0,fa)}return n&&n.value()}renderHull(t){const e=null==t?t=new ca:void 0,{hull:n,points:i}=this,r=2*n[0],s=n.length;t.moveTo(i[r],i[r+1]);for(let e=1;e<s;++e){const r=2*n[e];t.lineTo(i[r],i[r+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new ua;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new ca:void 0,{points:i,triangles:r}=this,s=2*r[t*=3],o=2*r[t+1],a=2*r[t+2];return e.moveTo(i[s],i[s+1]),e.lineTo(i[o],i[o+1]),e.lineTo(i[a],i[a+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new ua;return this.renderTriangle(t,e),e.value()}}var va={},ya={};function ba(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function xa(t){var e=Object.create(null),n=[];return t.forEach(function(t){for(var i in t)i in e||n.push(e[i]=i)}),n}function wa(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function ka(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+wa(-t,6):t>9999?"+"+wa(t,6):wa(t,4)}(t.getUTCFullYear())+"-"+wa(t.getUTCMonth()+1,2)+"-"+wa(t.getUTCDate(),2)+(r?"T"+wa(e,2)+":"+wa(n,2)+":"+wa(i,2)+"."+wa(r,3)+"Z":i?"T"+wa(e,2)+":"+wa(n,2)+":"+wa(i,2)+"Z":n||e?"T"+wa(e,2)+":"+wa(n,2)+"Z":"")}function Sa(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],s=t.length,o=0,a=0,l=s<=0,c=!1;function u(){if(l)return ya;if(c)return c=!1,va;var e,i,r=o;if(34===t.charCodeAt(r)){for(;o++<s&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=s?l=!0:10===(i=t.charCodeAt(o++))?c=!0:13===i&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<s;){if(10===(i=t.charCodeAt(e=o++)))c=!0;else if(13===i)c=!0,10===t.charCodeAt(o)&&++o;else if(i!==n)continue;return t.slice(r,e)}return l=!0,t.slice(r,s)}for(10===t.charCodeAt(s-1)&&--s,13===t.charCodeAt(s-1)&&--s;(i=u())!==ya;){for(var h=[];i!==va&&i!==ya;)h.push(i),i=u();e&&null==(h=e(h,a++))||r.push(h)}return r}function r(e,n){return e.map(function(e){return n.map(function(t){return o(e[t])}).join(t)})}function s(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?ka(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,s=i(t,function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=ba(t);return function(i,r){return e(n(i),r,t)}}(t,e):ba(t)});return s.columns=r||[],s},parseRows:i,format:function(e,n){return null==n&&(n=xa(e)),[n.map(o).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=xa(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(s).join("\n")},formatRow:s,formatValue:o}}var Ma=Sa(","),Ta=Ma.parse,Ca=Ma.parseRows,Aa=Ma.format,Da=Ma.formatBody,Ea=Ma.formatRows,Na=Ma.formatRow,za=Ma.formatValue,Pa=Sa("\t"),ja=Pa.parse,Ia=Pa.parseRows,$a=Pa.format,Ra=Pa.formatBody,La=Pa.formatRows,Fa=Pa.formatRow,Oa=Pa.formatValue;const Ha=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function Va(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function qa(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Ba(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Ua(t,e){return fetch(t,e).then(Ba)}function Wa(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),Ua(e,n).then(function(e){return t(e,i)})}}var Ya=Wa(Ta),Xa=Wa(ja);function Ja(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Ga(t){return(e,n)=>Ua(e,n).then(e=>(new DOMParser).parseFromString(e,t))}
715var Ka=Ga("application/xml"),Za=Ga("text/html"),Qa=Ga("image/svg+xml");function tl(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,s,o,a,l,c,u,h,f,d=t._root,p={data:i},m=t._x0,g=t._y0,_=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(s=(m+_)/2))?m=s:_=s,(u=n>=(o=(g+v)/2))?g=o:v=o,r=d,!(d=d[h=u<<1|c]))return r[h]=p,t;if(a=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===a&&n===l)return p.next=d,r?r[h]=p:t._root=p,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(c=e>=(s=(m+_)/2))?m=s:_=s,(u=n>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|a>=s));return r[f]=d,r[h]=p,t}function el(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function nl(t){return t[0]}function il(t){return t[1]}function rl(t,e,n){var i=new sl(null==e?nl:e,null==n?il:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function sl(t,e,n,i,r,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function ol(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var al=rl.prototype=sl.prototype;function ll(t){return function(){return t}}function cl(t){return 1e-6*(t()-.5)}function ul(t){return t.x+t.vx}function hl(t){return t.y+t.vy}function fl(t){return t.index}function dl(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}al.copy=function(){var t,e,n=new sl(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=ol(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=ol(e));return n},al.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return tl(this.cover(e,n),e,n,t)},al.addAll=function(t){var e,n,i,r,s=t.length,o=new Array(s),a=new Array(s),l=1/0,c=1/0,u=-1/0,h=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(o[n]=i,a[n]=r,i<l&&(l=i),i>u&&(u=i),r<c&&(c=r),r>h&&(h=r));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),n=0;n<s;++n)tl(this,o[n],a[n],t[n]);return this},al.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,s=(i=Math.floor(e))+1;
vendor: 3,234 bytes, line 715
715else{for(var o,a,l=r-n||1,c=this._root;n>t||t>=r||i>e||e>=s;)switch(a=(e<i)<<1|t<n,(o=new Array(4))[a]=c,c=o,l*=2,a){case 0:r=n+l,s=i+l;break;case 1:n=r-l,s=i+l;break;case 2:r=n+l,i=s-l;break;case 3:n=r-l,i=s-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this},al.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},al.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},al.find=function(t,e,n){var i,r,s,o,a,l,c,u=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],m=this._root;for(m&&p.push(new el(m,u,h,f,d)),null==n?n=1/0:(u=t-n,h=e-n,f=t+n,d=e+n,n*=n);l=p.pop();)if(!(!(m=l.node)||(r=l.x0)>f||(s=l.y0)>d||(o=l.x1)<u||(a=l.y1)<h))if(m.length){var g=(r+o)/2,_=(s+a)/2;p.push(new el(m[3],g,_,o,a),new el(m[2],r,_,g,a),new el(m[1],g,s,o,_),new el(m[0],r,s,g,_)),(c=(e>=_)<<1|t>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=l)}else{var v=t-+this._x.call(null,m.data),y=e-+this._y.call(null,m.data),b=v*v+y*y;if(b<n){var x=Math.sqrt(n=b);u=t-x,h=e-x,f=t+x,d=e+x,i=m.data}}return i},al.remove=function(t){if(isNaN(s=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,i,r,s,o,a,l,c,u,h,f,d=this._root,p=this._x0,m=this._y0,g=this._x1,_=this._y1;if(!d)return this;if(d.length)for(;;){if((c=s>=(a=(p+g)/2))?p=a:g=a,(u=o>=(l=(m+_)/2))?m=l:_=l,e=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(i=d,!(d=d.next))return this;return(r=d.next)&&delete d.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=r,this)},al.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},al.root=function(){return this._root},al.size=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},al.visit=function(t){var e,n,i,r,s,o,a=[],l=this._root;for(l&&a.push(new el(l,this._x0,this._y0,this._x1,this._y1));e=a.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,s=e.x1,o=e.y1)&&l.length){var c=(i+s)/2,u=(r+o)/2;(n=l[3])&&a.push(new el(n,c,u,s,o)),(n=l[2])&&a.push(new el(n,i,u,c,o)),(n=l[1])&&a.push(new el(n,c,r,s,u)),(n=l[0])&&a.push(new el(n,i,r,c,u))}return this},al.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new el(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var s,o=e.x0,a=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,h=(a+c)/2;(s=r[0])&&n.push(new el(s,o,a,u,h)),(s=r[1])&&n.push(new el(s,u,a,l,h)),(s=r[2])&&n.push(new el(s,o,h,u,c)),(s=r[3])&&n.push(new el(s,u,h,l,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},al.x=function(t){return arguments.length?(this._x=t,this):this._x},al.y=function(t){return arguments.length?(this._y=t,this):this._y};const pl=4294967296;function ml(t){return t.x}function gl(t){return t.y}var _l=Math.PI*(3-Math.sqrt(5));function vl(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>
vendor: 4,327 bytes, line 715
7151?i[0]+i.slice(2):i,+t.slice(n+1)]}function yl(t){return(t=vl(Math.abs(t)))?t[1]:NaN}var bl,xl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wl(t){if(!(e=xl.exec(t)))throw new Error("invalid format: "+t);var e;return new kl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function kl(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Sl(t,e){var n=vl(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}wl.prototype=kl.prototype,kl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ml={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Sl(100*t,e),r:Sl,s:function(t,e){var n=vl(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(bl=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+vl(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Tl(t){return t}var Cl,Al=Array.prototype.map,Dl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function El(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Tl:(e=Al.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(t.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Tl:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(Al.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"\u2212":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=wl(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,m=t.comma,g=t.precision,_=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Ml[v]||(void 0===g&&(g=12),_=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var y="$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===f?s:/[%p]/.test(v)?l:"",x=Ml[v],w=/[defgprs%]/.test(v);function k(t){var r,s,l,f=y,k=b;if("c"===v)k=x(t)+k,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:x(Math.abs(t),g),_&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==h&&(S=!1),f=(S?"("===h?h:c:"-"===h||"("===h?"":h)+f,k=("s"===v?Dl[8+bl/3]:"")+k+(S&&"("===h?")":""),w)for(r=-1,s=t.length;++r<s;)if(48>(l=t.charCodeAt(r))||l>57){k=(46===l?o+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}m&&!d&&(t=i(t,1/0));var M=f.length+t.length+k.length,T=M<p?new Array(p-M+1).join(e):"";switch(m&&d&&(t=i(T+t,T.length?p-k.length:1/0),T=""),n){case"<":t=f+t+k+T;break;case"=":t=f+T+t+k;break;case"^":t=T.slice(0,M=T.length>>1)+f+t+k+T.slice(M);break;default:t=T+f+t+k}return a(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=wl(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(yl(e)/3))),r=Math.pow(10,-i),s=Dl[8+i/3];return function(t){return n(r*t)+s}}}}function Nl(e){return Cl=El(e),t.format=Cl.format,t.formatPrefix=Cl.formatPrefix,Cl}
vendor: 6,923 bytes, line 715
715function zl(t){return Math.max(0,-yl(Math.abs(t)))}function Pl(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(yl(e)/3)))-yl(Math.abs(t)))}function jl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yl(e)-yl(t))+1}t.format=void 0,t.formatPrefix=void 0,Nl({thousands:",",grouping:[3],currency:["$",""]});var Il=1e-6,$l=1e-12,Rl=Math.PI,Ll=Rl/2,Fl=Rl/4,Ol=2*Rl,Hl=180/Rl,Vl=Rl/180,ql=Math.abs,Bl=Math.atan,Ul=Math.atan2,Wl=Math.cos,Yl=Math.ceil,Xl=Math.exp,Jl=Math.hypot,Gl=Math.log,Kl=Math.pow,Zl=Math.sin,Ql=Math.sign||function(t){return t>0?1:t<0?-1:0},tc=Math.sqrt,ec=Math.tan;function nc(t){return t>1?0:t<-1?Rl:Math.acos(t)}function ic(t){return t>1?Ll:t<-1?-Ll:Math.asin(t)}function rc(t){return(t=Zl(t/2))*t}function sc(){}function oc(t,e){t&&lc.hasOwnProperty(t.type)&&lc[t.type](t,e)}var ac={Feature:function(t,e){oc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)oc(n[i].geometry,e)}},lc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){cc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)cc(n[i],e,0)},Polygon:function(t,e){uc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)uc(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)oc(n[i],e)}};function cc(t,e,n){var i,r=-1,s=t.length-n;for(e.lineStart();++r<s;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function uc(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)cc(t[n],e,1);e.polygonEnd()}function hc(t,e){t&&ac.hasOwnProperty(t.type)?ac[t.type](t,e):oc(t,e)}var fc,dc,pc,mc,gc,_c,vc,yc,bc,xc,wc,kc,Sc,Mc,Tc,Cc,Ac=new g,Dc=new g,Ec={point:sc,lineStart:sc,lineEnd:sc,polygonStart:function(){Ac=new g,Ec.lineStart=Nc,Ec.lineEnd=zc},polygonEnd:function(){var t=+Ac;Dc.add(t<0?Ol+t:t),this.lineStart=this.lineEnd=this.point=sc},sphere:function(){Dc.add(Ol)}};function Nc(){Ec.point=Pc}function zc(){jc(fc,dc)}function Pc(t,e){Ec.point=jc,fc=t,dc=e,pc=t*=Vl,mc=Wl(e=(e*=Vl)/2+Fl),gc=Zl(e)}function jc(t,e){var n=(t*=Vl)-pc,i=n>=0?1:-1,r=i*n,s=Wl(e=(e*=Vl)/2+Fl),o=Zl(e),a=gc*o,l=mc*s+a*Wl(r),c=a*i*Zl(r);Ac.add(Ul(c,l)),pc=t,mc=s,gc=o}function Ic(t){return[Ul(t[1],t[0]),ic(t[2])]}function $c(t){var e=t[0],n=t[1],i=Wl(n);return[i*Wl(e),i*Zl(e),Zl(n)]}function Rc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Lc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Fc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Oc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Hc(t){var e=tc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Vc,qc,Bc,Uc,Wc,Yc,Xc,Jc,Gc,Kc,Zc,Qc,tu,eu,nu,iu,ru={point:su,lineStart:au,lineEnd:lu,polygonStart:function(){ru.point=cu,ru.lineStart=uu,ru.lineEnd=hu,Mc=new g,Ec.polygonStart()},polygonEnd:function(){Ec.polygonEnd(),ru.point=su,ru.lineStart=au,ru.lineEnd=lu,Ac<0?(_c=-(yc=180),vc=-(bc=90)):Mc>Il?bc=90:Mc<-1e-6&&(vc=-90),Cc[0]=_c,Cc[1]=yc},sphere:function(){_c=-(yc=180),vc=-(bc=90)}};function su(t,e){Tc.push(Cc=[_c=t,yc=t]),e<vc&&(vc=e),e>bc&&(bc=e)}function ou(t,e){var n=$c([t*Vl,e*Vl]);if(Sc){var i=Lc(Sc,n),r=Lc([i[1],-i[0],0],i);Hc(r),r=Ic(r);var s,o=t-xc,a=o>0?1:-1,l=r[0]*Hl*a,c=ql(o)>180;c^(a*xc<l&&l<a*t)?(s=r[1]*Hl)>bc&&(bc=s):c^(a*xc<(l=(l+360)%360-180)&&l<a*t)?(s=-r[1]*Hl)<vc&&(vc=s):(e<vc&&(vc=e),e>bc&&(bc=e)),c?t<xc?fu(_c,t)>fu(_c,yc)&&(yc=t):fu(t,yc)>fu(_c,yc)&&(_c=t):yc>=_c?(t<_c&&(_c=t),t>yc&&(yc=t)):t>xc?fu(_c,t)>fu(_c,yc)&&(yc=t):fu(t,yc)>fu(_c,yc)&&(_c=t)}else Tc.push(Cc=[_c=t,yc=t]);e<vc&&(vc=e),e>bc&&(bc=e),Sc=n,xc=t}function au(){ru.point=ou}function lu(){Cc[0]=_c,Cc[1]=yc,ru.point=su,Sc=null}function cu(t,e){if(Sc){var n=t-xc;Mc.add(ql(n)>180?n+(n>0?360:-360):n)}else wc=t,kc=e;Ec.point(t,e),ou(t,e)}function uu(){Ec.lineStart()}function hu(){cu(wc,kc),Ec.lineEnd(),ql(Mc)>Il&&(_c=-(yc=180)),Cc[0]=_c,Cc[1]=yc,Sc=null}function fu(t,e){return(e-=t)<0?e+360:e}function du(t,e){return t[0]-e[0]}function pu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var mu={sphere:sc,point:gu,lineStart:vu,lineEnd:xu,polygonStart:function(){mu.lineStart=wu,mu.lineEnd=ku},polygonEnd:function(){mu.lineStart=vu,mu.lineEnd=xu}};function gu(t,e){t*=Vl;var n=Wl(e*=Vl);_u(n*Wl(t),n*Zl(t),Zl(e))}function _u(t,e,n){++Vc,Bc+=(t-Bc)/Vc,Uc+=(e-Uc)/Vc,Wc+=(n-Wc)/Vc}function vu(){mu.point=yu}function yu(t,e){t*=Vl;var n=Wl(e*=Vl);eu=n*Wl(t),nu=n*Zl(t),iu=Zl(e),mu.point=bu,_u(eu,nu,iu)}function bu(t,e){t*=Vl;var n=Wl(e*=Vl),i=n*Wl(t),r=n*Zl(t),s=Zl(e),o=Ul(tc((o=nu*s-iu*r)*o+(o=iu*i-eu*s)*o+(o=eu*r-nu*i)*o),eu*i+nu*r+iu*s);qc+=o,Yc+=o*(eu+(eu=i)),Xc+=o*(nu+(nu=r)),Jc+=o*(iu+(iu=s)),_u(eu,nu,iu)}function xu(){mu.point=gu}function wu(){mu.point=Su}function ku(){Mu(Qc,tu),mu.point=gu}function Su(t,e){Qc=t,tu=e,t*=Vl,e*=Vl,mu.point=Mu;var n=Wl(e);eu=n*Wl(t),nu=n*Zl(t),iu=Zl(e),_u(eu,nu,iu)}function Mu(t,e){t*=Vl;var n=Wl(e*=Vl),i=n*Wl(t),r=n*Zl(t),s=Zl(e),o=nu*s-iu*r,a=iu*i-eu*s,l=eu*r-nu*i,c=Jl(o,a,l),u=ic(c),h=c&&-u/c;Gc.add(h*o),Kc.add(h*a),Zc.add(h*l),qc+=u,Yc+=u*(eu+(eu=i)),Xc+=u*(nu+(nu=r)),Jc+=u*(iu+(iu=s)),_u(eu,nu,iu)}function Tu(t){return function(){return t}}function Cu(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Au(t,e){return[ql(t)>Rl?t+Math.round(-t/Ol)*Ol:t,e]}function Du(t,e,n){return(t%=Ol)?e||n?Cu(Nu(t),zu(e,n)):Nu(t):e||n?zu(e,n):Au}function Eu(t){return function(e,n){return[(e+=t)>Rl?e-Ol:e<-Rl?e+Ol:e,n]}}function Nu(t){var e=Eu(t);return e.invert=Eu(-t),e}function zu(t,e){var n=Wl(t),i=Zl(t),r=Wl(e),s=Zl(e);function o(t,e){var o=Wl(e),a=Wl(t)*o,l=Zl(t)*o,c=Zl(e),u=c*n+a*i;return[Ul(l*r-u*s,a*n-c*i),ic(u*r+l*s)]}return o.invert=function(t,e){var o=Wl(e),a=Wl(t)*o,l=Zl(t)*o,c=Zl(e),u=c*r-l*s;return[Ul(l*r+c*s,a*n+u*i),ic(u*n-a*i)]},o}function Pu(t){function e(e){return(e=t(e[0]*Vl,e[1]*Vl))[0]*=Hl,e[1]*=Hl,e}return t=Du(t[0]*Vl,t[1]*Vl,t.length>2?t[2]*Vl:0),e.invert=function(e){return(e=t.invert(e[0]*Vl,e[1]*Vl))[0]*=Hl,e[1]*=Hl,e},e}function ju(t,e,n,i,r,s){if(n){var o=Wl(e),a=Zl(e),l=i*n;null==r?(r=e+i*Ol,s=e-l/2):(r=Iu(o,r),s=Iu(o,s),(i>0?r<s:r>s)&&(r+=i*Ol));for(var c,u=r;i>0?u>s:u<s;u-=l)c=Ic([o,-a*Wl(u),-a*Zl(u)]),t.point(c[0],c[1])}}function Iu(t,e){(e=$c(e))[0]-=t,Hc(e);var n=nc(-e[1]);return((-e[2]<0?-n:n)+Ol-Il)%Ol}function $u(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:sc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ru(t,e){return ql(t[0]-e[0])<Il&&ql(t[1]-e[1])<Il}function Lu(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Fu(t,e,n,i,r){var s,o,a=[],l=[];
vendor: 5,120 bytes, line 715
715if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(Ru(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),s=0;s<e;++s)r.point((i=t[s])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}a.push(n=new Lu(i,t,null,!0)),l.push(n.o=new Lu(i,null,n,!1)),a.push(n=new Lu(o,t,null,!1)),l.push(n.o=new Lu(o,null,n,!0))}}),a.length){for(l.sort(e),Ou(a),Ou(l),s=0,o=l.length;s<o;++s)l[s].e=n=!n;for(var c,u,h=a[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(s=0,o=c.length;s<o;++s)r.point((u=c[s])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(d)for(c=f.p.z,s=c.length-1;s>=0;--s)r.point((u=c[s])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);r.lineEnd()}}}function Ou(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Hu(t){return ql(t[0])<=Rl?t[0]:Ql(t[0])*((ql(t[0])+Rl)%Ol-Rl)}function Vu(t,e){var n=Hu(e),i=e[1],r=Zl(i),s=[Zl(n),-Wl(n),0],o=0,a=0,l=new g;1===r?i=Ll+Il:-1===r&&(i=-Ll-Il);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,d=h[f-1],p=Hu(d),m=d[1]/2+Fl,_=Zl(m),v=Wl(m),y=0;y<f;++y,p=x,_=k,v=S,d=b){var b=h[y],x=Hu(b),w=b[1]/2+Fl,k=Zl(w),S=Wl(w),M=x-p,T=M>=0?1:-1,C=T*M,A=C>Rl,D=_*k;if(l.add(Ul(D*T*Zl(C),v*S+D*Wl(C))),o+=A?M+T*Ol:M,A^p>=n^x>=n){var E=Lc($c(d),$c(b));Hc(E);var N=Lc(s,E);Hc(N);var z=(A^M>=0?-1:1)*ic(N[2]);(i>z||i===z&&(E[0]||E[1]))&&(a+=A^M>=0?1:-1)}}return(o<-1e-6||o<Il&&l<-1e-12)^1&a}function qu(t,e,n,i){return function(r){var s,o,a,l=e(r),c=$u(),u=e(c),h=!1,f={point:d,lineStart:m,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,o=[],s=[]},polygonEnd:function(){f.point=d,f.lineStart=m,f.lineEnd=g,o=Q(o);var t=Vu(s,i);o.length?(h||(r.polygonStart(),h=!0),Fu(o,Uu,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=s=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function d(e,n){t(e,n)&&r.point(e,n)}function p(t,e){l.point(t,e)}function m(){f.point=p,l.lineStart()}function g(){f.point=d,l.lineEnd()}function _(t,e){a.push([t,e]),u.point(t,e)}function v(){u.lineStart(),a=[]}function y(){_(a[0][0],a[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),d=f.length;if(a.pop(),s.push(a),a=null,d)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else d>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(Bu))}return f}}function Bu(t){return t.length>1}function Uu(t,e){return((t=t.x)[0]<0?t[1]-Ll-Il:Ll-t[1])-((e=e.x)[0]<0?e[1]-Ll-Il:Ll-e[1])}Au.invert=Au;var Wu=qu(function(){return!0},function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(s,o){var a=s>0?Rl:-Rl,l=ql(s-n);ql(l-Rl)<Il?(t.point(n,i=(i+o)/2>0?Ll:-Ll),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(s,i),e=0):r!==a&&l>=Rl&&(ql(n-r)<Il&&(n-=r*Il),ql(s-a)<Il&&(s-=a*Il),i=function(t,e,n,i){var r,s,o=Zl(t-n);return ql(o)>Il?Bl((Zl(e)*(s=Wl(i))*Zl(n)-Zl(i)*(r=Wl(e))*Zl(t))/(r*s*o)):(e+i)/2}(n,i,s,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=s,i=o),r=a},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}},function(t,e,n,i){var r;if(null==t)r=n*Ll,i.point(-Rl,r),i.point(0,r),i.point(Rl,r),i.point(Rl,0),i.point(Rl,-r),i.point(0,-r),i.point(-Rl,-r),i.point(-Rl,0),i.point(-Rl,r);else if(ql(t[0]-e[0])>Il){var s=t[0]<e[0]?Rl:-Rl;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(e[0],e[1])},[-Rl,-Ll]);function Yu(t){var e=Wl(t),n=6*Vl,i=e>0,r=ql(e)>Il;function s(t,n){return Wl(t)*Wl(n)>e}function o(t,n,i){var r=[1,0,0],s=Lc($c(t),$c(n)),o=Rc(s,s),a=s[0],l=o-a*a;if(!l)return!i&&t;var c=e*o/l,u=-e*a/l,h=Lc(r,s),f=Oc(r,c);Fc(f,Oc(s,u));var d=h,p=Rc(f,d),m=Rc(d,d),g=p*p-m*(Rc(f,f)-1);if(!(g<0)){var _=tc(g),v=Oc(d,(-p-_)/m);if(Fc(v,f),v=Ic(v),!i)return v;var y,b=t[0],x=n[0],w=t[1],k=n[1];x<b&&(y=b,b=x,x=y);var S=x-b,M=ql(S-Rl)<Il;if(!M&&k<w&&(y=w,w=k,k=y),M||S<Il?M?w+k>0^v[1]<(ql(v[0]-b)<Il?w:k):w<=v[1]&&v[1]<=k:S>Rl^(b<=v[0]&&v[0]<=x)){var T=Oc(d,(-p+_)/m);return Fc(T,f),[v,Ic(T)]}}}function a(e,n){var r=i?t:Rl-t,s=0;return e<-r?s|=1:e>r&&(s|=2),n<-r?s|=4:n>r&&(s|=8),s}return qu(s,function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],m=s(h,f),g=i?m?0:a(h,f):m?a(h+(h<0?Rl:-Rl),f):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(!(d=o(e,p))||Ru(e,d)||Ru(p,d))&&(p[2]=1),m!==l)u=0,m?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(r&&e&&i^m){var _;g&n||!(_=o(p,e,!0))||(u=0,i?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1],3)))}!m||e&&Ru(e,p)||t.point(p[0],p[1]),e=p,l=m,n=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}},function(e,i,r,s){ju(s,t,n,r,e,i)},i?[0,-t]:[-Rl,t-Rl])}var Xu,Ju,Gu,Ku,Zu=1e9,Qu=-Zu;function th(t,e,n,i){function r(r,s){return t<=r&&r<=n&&e<=s&&s<=i}function s(r,s,a,c){var u=0,h=0;
vendor: 11,334 bytes, lines 715-716
715if(null==r||(u=o(r,a))!==(h=o(s,a))||l(r,s)<0^a>0){do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+a+4)%4)!==h)}else c.point(s[0],s[1])}function o(i,r){return ql(i[0]-t)<Il?r>0?0:3:ql(i[0]-n)<Il?r>0?2:1:ql(i[1]-e)<Il?r>0?1:0:r>0?3:2}function a(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,d,p,m,g,_,v,y=o,b=$u(),x={point:w,lineStart:function(){x.point=k,c&&c.push(u=[]);_=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(k(h,f),d&&g&&b.rejoin(),l.push(b.result()));x.point=w,g&&y.lineEnd()},polygonStart:function(){y=b,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var s,o,a=c[n],l=1,u=a.length,h=a[0],f=h[0],d=h[1];l<u;++l)s=f,o=d,f=(h=a[l])[0],d=h[1],o<=i?d>i&&(f-s)*(i-o)>(d-o)*(t-s)&&++e:d<=i&&(f-s)*(i-o)<(d-o)*(t-s)&&--e;return e}(),n=v&&e,r=(l=Q(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),r&&Fu(l,a,e,s,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function k(s,o){var a=r(s,o);if(c&&u.push([s,o]),_)h=s,f=o,d=a,_=!1,a&&(y.lineStart(),y.point(s,o));else if(a&&g)y.point(s,o);else{var l=[p=Math.max(Qu,Math.min(Zu,p)),m=Math.max(Qu,Math.min(Zu,m))],b=[s=Math.max(Qu,Math.min(Zu,s)),o=Math.max(Qu,Math.min(Zu,o))];!function(t,e,n,i,r,s){var o,a=t[0],l=t[1],c=0,u=1,h=e[0]-a,f=e[1]-l;if(o=n-a,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-a,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=s-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=a+c*h,t[1]=l+c*f),u<1&&(e[0]=a+u*h,e[1]=l+u*f),!0}}}}}(l,b,t,e,n,i)?a&&(y.lineStart(),y.point(s,o),v=!1):(g||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),a||y.lineEnd(),v=!1)}p=s,m=o,g=a}return x}}var eh={sphere:sc,point:sc,lineStart:function(){eh.point=ih,eh.lineEnd=nh},lineEnd:sc,polygonStart:sc,polygonEnd:sc};function nh(){eh.point=eh.lineEnd=sc}function ih(t,e){Ju=t*=Vl,Gu=Zl(e*=Vl),Ku=Wl(e),eh.point=rh}function rh(t,e){t*=Vl;var n=Zl(e*=Vl),i=Wl(e),r=ql(t-Ju),s=Wl(r),o=i*Zl(r),a=Ku*n-Gu*i*s,l=Gu*n+Ku*i*s;Xu.add(Ul(tc(o*o+a*a),l)),Ju=t,Gu=n,Ku=i}function sh(t){return Xu=new g,hc(t,eh),+Xu}var oh=[null,null],ah={type:"LineString",coordinates:oh};function lh(t,e){return oh[0]=t,oh[1]=e,sh(ah)}var ch={Feature:function(t,e){return hh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(hh(n[i].geometry,e))return!0;return!1}},uh={Sphere:function(){return!0},Point:function(t,e){return fh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(fh(n[i],e))return!0;return!1},LineString:function(t,e){return dh(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(dh(n[i],e))return!0;return!1},Polygon:function(t,e){return ph(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(ph(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(hh(n[i],e))return!0;return!1}};function hh(t,e){return!(!t||!uh.hasOwnProperty(t.type))&&uh[t.type](t,e)}function fh(t,e){return 0===lh(t,e)}function dh(t,e){for(var n,i,r,s=0,o=t.length;s<o;s++){if(0===(i=lh(t[s],e)))return!0;if(s>0&&(r=lh(t[s],t[s-1]))>0&&n<=r&&i<=r&&(n+i-r)*(1-Math.pow((n-i)/r,2))<$l*r)return!0;n=i}return!1}function ph(t,e){return!!Vu(t.map(mh),gh(e))}function mh(t){return(t=t.map(gh)).pop(),t}function gh(t){return[t[0]*Vl,t[1]*Vl]}function _h(t,e,n){var i=nt(t,e-Il,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function vh(t,e,n){var i=nt(t,e-Il,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function yh(){var t,e,n,i,r,s,o,a,l,c,u,h,f=10,d=f,p=90,m=360,g=2.5;function _(){return{type:"MultiLineString",coordinates:v()}}function v(){return nt(Yl(i/p)*p,n,p).map(u).concat(nt(Yl(a/m)*m,o,m).map(h)).concat(nt(Yl(e/f)*f,t,f).filter(function(t){return ql(t%p)>Il}).map(l)).concat(nt(Yl(s/d)*d,r,d).filter(function(t){return ql(t%m)>Il}).map(c))}return _.lines=function(){return v().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(h(o).slice(1),u(n).reverse().slice(1),h(a).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],a=+t[0][1],o=+t[1][1],i>n&&(t=i,i=n,n=t),a>o&&(t=a,a=o,o=t),_.precision(g)):[[i,a],[n,o]]},_.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],s=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),s>r&&(n=s,s=r,r=n),_.precision(g)):[[e,s],[t,r]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],m=+t[1],_):[p,m]},_.stepMinor=function(t){return arguments.length?(f=+t[0],d=+t[1],_):[f,d]},_.precision=function(f){return arguments.length?(g=+f,l=_h(s,r,90),c=vh(e,t,g),u=_h(a,o,90),h=vh(i,n,g),_):g},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var bh,xh,wh,kh,Sh=t=>t,Mh=new g,Th=new g,Ch={point:sc,lineStart:sc,lineEnd:sc,polygonStart:function(){Ch.lineStart=Ah,Ch.lineEnd=Nh},polygonEnd:function(){Ch.lineStart=Ch.lineEnd=Ch.point=sc,Mh.add(ql(Th)),Th=new g},result:function(){var t=Mh/2;return Mh=new g,t}};function Ah(){Ch.point=Dh}function Dh(t,e){Ch.point=Eh,bh=wh=t,xh=kh=e}function Eh(t,e){Th.add(kh*t-wh*e),wh=t,kh=e}function Nh(){Eh(bh,xh)}var zh=Ch,Ph=1/0,jh=Ph,Ih=-Ph,$h=Ih,Rh={point:function(t,e){t<Ph&&(Ph=t);t>Ih&&(Ih=t);e<jh&&(jh=e);e>$h&&($h=e)},lineStart:sc,lineEnd:sc,polygonStart:sc,polygonEnd:sc,result:function(){var t=[[Ph,jh],[Ih,$h]];return Ih=$h=-(jh=Ph=1/0),t}};var Lh,Fh,Oh,Hh,Vh=Rh,qh=0,Bh=0,Uh=0,Wh=0,Yh=0,Xh=0,Jh=0,Gh=0,Kh=0,Zh={point:Qh,lineStart:tf,lineEnd:rf,polygonStart:function(){Zh.lineStart=sf,Zh.lineEnd=of},polygonEnd:function(){Zh.point=Qh,Zh.lineStart=tf,Zh.lineEnd=rf},result:function(){var t=Kh?[Jh/Kh,Gh/Kh]:Xh?[Wh/Xh,Yh/Xh]:Uh?[qh/Uh,Bh/Uh]:[NaN,NaN];return qh=Bh=Uh=Wh=Yh=Xh=Jh=Gh=Kh=0,t}};function Qh(t,e){qh+=t,Bh+=e,++Uh}function tf(){Zh.point=ef}function ef(t,e){Zh.point=nf,Qh(Oh=t,Hh=e)}function nf(t,e){var n=t-Oh,i=e-Hh,r=tc(n*n+i*i);Wh+=r*(Oh+t)/2,Yh+=r*(Hh+e)/2,Xh+=r,Qh(Oh=t,Hh=e)}function rf(){Zh.point=Qh}function sf(){Zh.point=af}function of(){lf(Lh,Fh)}function af(t,e){Zh.point=lf,Qh(Lh=Oh=t,Fh=Hh=e)}function lf(t,e){var n=t-Oh,i=e-Hh,r=tc(n*n+i*i);Wh+=r*(Oh+t)/2,Yh+=r*(Hh+e)/2,Xh+=r,Jh+=(r=Hh*t-Oh*e)*(Oh+t),Gh+=r*(Hh+e),Kh+=3*r,Qh(Oh=t,Hh=e)}var cf=Zh;function uf(t){this._context=t}uf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ol)}},result:sc};var hf,ff,df,pf,mf,gf=new g,_f={point:sc,lineStart:function(){_f.point=vf},lineEnd:function(){hf&&yf(ff,df),_f.point=sc},polygonStart:function(){hf=!0},polygonEnd:function(){hf=null},result:function(){var t=+gf;return gf=new g,t}};function vf(t,e){_f.point=yf,ff=pf=t,df=mf=e}function yf(t,e){pf-=t,mf-=e,gf.add(tc(pf*pf+mf*mf)),pf=t,mf=e}var bf=_f;function xf(){this._string=[]}function wf(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function kf(t){return function(e){var n=new Sf;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Sf(){}function Mf(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),hc(n,t.stream(Vh)),e(Vh.result()),null!=i&&t.clipExtent(i),t}function Tf(t,e,n){return Mf(t,function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,a=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([o,a])},n)}function Cf(t,e,n){return Tf(t,[[0,0],e],n)}function Af(t,e,n){return Mf(t,function(n){var i=+e,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([s,o])},n)}function Df(t,e,n){return Mf(t,function(n){var i=+e,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([s,o])},n)}xf.prototype={_radius:4.5,_circle:wf(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=wf(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Sf.prototype={constructor:Sf,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ef=Wl(30*Vl);function Nf(t,e){return+e?function(t,e){function n(i,r,s,o,a,l,c,u,h,f,d,p,m,g){var _=c-i,v=u-r,y=_*_+v*v;if(y>4*e&&m--){var b=o+f,x=a+d,w=l+p,k=tc(b*b+x*x+w*w),S=ic(w/=k),M=ql(ql(w)-1)<Il||ql(s-h)<Il?(s+h)/2:Ul(x,b),T=t(M,S),C=T[0],A=T[1],D=C-i,E=A-r,N=v*D-_*E;(N*N/y>e||ql((_*D+v*E)/y-.5)>.3||o*f+a*d+l*p<Ef)&&(n(i,r,s,o,a,l,C,A,M,b/=k,x/=k,w,m,g),g.point(C,A),n(C,A,M,b,x,w,c,u,h,f,d,p,m,g))}}return function(e){var i,r,s,o,a,l,c,u,h,f,d,p,m={point:g,lineStart:_,lineEnd:y,polygonStart:function(){e.polygonStart(),m.lineStart=b},polygonEnd:function(){e.polygonEnd(),m.lineStart=_}};function g(n,i){n=t(n,i),e.point(n[0],n[1])}function _(){u=NaN,m.point=v,e.lineStart()}function v(i,r){var s=$c([i,r]),o=t(i,r);n(u,h,c,f,d,p,u=o[0],h=o[1],c=i,f=s[0],d=s[1],p=s[2],16,e),e.point(u,h)}function y(){m.point=g,e.lineEnd()}function b(){_(),m.point=x,m.lineEnd=w}function x(t,e){v(i=t,e),r=u,s=h,o=f,a=d,l=p,m.point=v}function w(){n(u,h,c,f,d,p,r,s,i,o,a,l,16,e),m.lineEnd=y,y()}return m}}(t,e):function(t){return kf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var zf=kf({point:function(t,e){
716this.stream.point(t*Vl,e*Vl)}});function Pf(t,e,n,i,r,s){if(!s)return function(t,e,n,i,r){function s(s,o){return[e+t*(s*=i),n-t*(o*=r)]}return s.invert=function(s,o){return[(s-e)/t*i,(n-o)/t*r]},s}(t,e,n,i,r);var o=Wl(s),a=Zl(s),l=o*t,c=a*t,u=o/t,h=a/t,f=(a*n-o*e)/t,d=(a*e+o*n)/t;function p(t,s){return[l*(t*=i)-c*(s*=r)+e,n-c*t-l*s]}return p.invert=function(t,e){return[i*(u*t-h*e+f),r*(d-h*t-u*e)]},p}function jf(t){return If(function(){return t})()}
vendor: 4,561 bytes, line 716
716function If(t){var e,n,i,r,s,o,a,l,c,u,h=150,f=480,d=250,p=0,m=0,g=0,_=0,v=0,y=0,b=1,x=1,w=null,k=Wu,S=null,M=Sh,T=.5;function C(t){return l(t[0]*Vl,t[1]*Vl)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Hl,t[1]*Hl]}function D(){var t=Pf(h,0,0,b,x,y).apply(null,e(p,m)),i=Pf(h,f-t[0],d-t[1],b,x,y);return n=Du(g,_,v),a=Cu(e,i),l=Cu(n,a),o=Nf(a,T),E()}function E(){return c=u=null,C}return C.stream=function(t){return c&&u===t?c:c=zf(function(t){return kf({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(k(o(M(u=t)))))},C.preclip=function(t){return arguments.length?(k=t,w=void 0,E()):k},C.postclip=function(t){return arguments.length?(M=t,S=i=r=s=null,E()):M},C.clipAngle=function(t){return arguments.length?(k=+t?Yu(w=t*Vl):(w=null,Wu),E()):w*Hl},C.clipExtent=function(t){return arguments.length?(M=null==t?(S=i=r=s=null,Sh):th(S=+t[0][0],i=+t[0][1],r=+t[1][0],s=+t[1][1]),E()):null==S?null:[[S,i],[r,s]]},C.scale=function(t){return arguments.length?(h=+t,D()):h},C.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],D()):[f,d]},C.center=function(t){return arguments.length?(p=t[0]%360*Vl,m=t[1]%360*Vl,D()):[p*Hl,m*Hl]},C.rotate=function(t){return arguments.length?(g=t[0]%360*Vl,_=t[1]%360*Vl,v=t.length>2?t[2]%360*Vl:0,D()):[g*Hl,_*Hl,v*Hl]},C.angle=function(t){return arguments.length?(y=t%360*Vl,D()):y*Hl},C.reflectX=function(t){return arguments.length?(b=t?-1:1,D()):b<0},C.reflectY=function(t){return arguments.length?(x=t?-1:1,D()):x<0},C.precision=function(t){return arguments.length?(o=Nf(a,T=t*t),E()):tc(T)},C.fitExtent=function(t,e){return Tf(C,t,e)},C.fitSize=function(t,e){return Cf(C,t,e)},C.fitWidth=function(t,e){return Af(C,t,e)},C.fitHeight=function(t,e){return Df(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&A,D()}}function $f(t){var e=0,n=Rl/3,i=If(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Vl,n=t[1]*Vl):[e*Hl,n*Hl]},r}function Rf(t,e){var n=Zl(t),i=(n+Zl(e))/2;if(ql(i)<Il)return function(t){var e=Wl(t);function n(t,n){return[t*e,Zl(n)/e]}return n.invert=function(t,n){return[t/e,ic(n*e)]},n}(t);var r=1+n*(2*i-n),s=tc(r)/i;function o(t,e){var n=tc(r-2*i*Zl(e))/i;return[n*Zl(t*=i),s-n*Wl(t)]}return o.invert=function(t,e){var n=s-e,o=Ul(t,ql(n))*Ql(n);return n*i<0&&(o-=Rl*Ql(t)*Ql(n)),[o/i,ic((r-(t*t+n*n)*i*i)/(2*i))]},o}function Lf(){return $f(Rf).scale(155.424).center([0,33.6442])}function Ff(){return Lf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Of(t){return function(e,n){var i=Wl(e),r=Wl(n),s=t(i*r);return s===1/0?[2,0]:[s*r*Zl(e),s*Zl(n)]}}function Hf(t){return function(e,n){var i=tc(e*e+n*n),r=t(i),s=Zl(r),o=Wl(r);return[Ul(e*s,i*o),ic(i&&n*s/i)]}}var Vf=Of(function(t){return tc(2/(1+t))});Vf.invert=Hf(function(t){return 2*ic(t/2)});var qf=Of(function(t){return(t=nc(t))&&t/Zl(t)});function Bf(t,e){return[t,Gl(ec((Ll+e)/2))]}function Uf(t){var e,n,i,r=jf(t),s=r.center,o=r.scale,a=r.translate,l=r.clipExtent,c=null;function u(){var s=Rl*o(),a=r(Pu(r.rotate()).invert([0,0]));return l(null==c?[[a[0]-s,a[1]-s],[a[0]+s,a[1]+s]]:t===Bf?[[Math.max(a[0]-s,c),e],[Math.min(a[0]+s,n),i]]:[[c,Math.max(a[1]-s,e)],[n,Math.min(a[1]+s,i)]])}return r.scale=function(t){return arguments.length?(o(t),u()):o()},r.translate=function(t){return arguments.length?(a(t),u()):a()},r.center=function(t){return arguments.length?(s(t),u()):s()},r.clipExtent=function(t){return arguments.length?(null==t?c=e=n=i=null:(c=+t[0][0],e=+t[0][1],n=+t[1][0],i=+t[1][1]),u()):null==c?null:[[c,e],[n,i]]},u()}function Wf(t){return ec((Ll+t)/2)}function Yf(t,e){var n=Wl(t),i=t===e?Zl(t):Gl(n/Wl(e))/Gl(Wf(e)/Wf(t)),r=n*Kl(Wf(t),i)/i;if(!i)return Bf;function s(t,e){r>0?e<-Ll+Il&&(e=-Ll+Il):e>Ll-Il&&(e=Ll-Il);var n=r/Kl(Wf(e),i);return[n*Zl(i*t),r-n*Wl(i*t)]}return s.invert=function(t,e){var n=r-e,s=Ql(i)*tc(t*t+n*n),o=Ul(t,ql(n))*Ql(n);return n*i<0&&(o-=Rl*Ql(t)*Ql(n)),[o/i,2*Bl(Kl(r/s,1/i))-Ll]},s}function Xf(t,e){return[t,e]}function Jf(t,e){var n=Wl(t),i=t===e?Zl(t):(n-Wl(e))/(e-t),r=n/i+t;if(ql(i)<Il)return Xf;function s(t,e){var n=r-e,s=i*t;return[n*Zl(s),r-n*Wl(s)]}return s.invert=function(t,e){var n=r-e,s=Ul(t,ql(n))*Ql(n);return n*i<0&&(s-=Rl*Ql(t)*Ql(n)),[s/i,r-Ql(i)*tc(t*t+n*n)]},s}qf.invert=Hf(function(t){return t}),Bf.invert=function(t,e){return[t,2*Bl(Xl(e))-Ll]},Xf.invert=Xf;var Gf=1.340264,Kf=-.081106,Zf=893e-6,Qf=.003796,td=tc(3)/2;function ed(t,e){var n=ic(td*Zl(e)),i=n*n,r=i*i*i;return[t*Wl(n)/(td*(Gf+3*Kf*i+r*(7*Zf+9*Qf*i))),n*(Gf+Kf*i+r*(Zf+Qf*i))]}
vendor: 4,134 bytes, line 716
716function nd(t,e){var n=Wl(e),i=Wl(t)*n;return[n*Zl(t)/i,Zl(e)/i]}function id(t,e){var n=e*e,i=n*n;return[t*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),e*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function rd(t,e){return[Wl(e)*Zl(t),Zl(e)]}function sd(t,e){var n=Wl(e),i=1+Wl(t)*n;return[n*Zl(t)/i,Zl(e)/i]}function od(t,e){return[Gl(ec((Ll+e)/2)),-t]}function ad(t,e){return t.parent===e.parent?1:2}function ld(t,e){return t+e.x}function cd(t,e){return Math.max(t,e.y)}function ud(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hd(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=dd)):void 0===e&&(e=fd);for(var n,i,r,s,o,a=new gd(t),l=[a];n=l.pop();)if((r=e(n.data))&&(o=(r=Array.from(r)).length))for(n.children=r,s=o-1;s>=0;--s)l.push(i=r[s]=new gd(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(md)}function fd(t){return t.children}function dd(t){return Array.isArray(t)?t[1]:null}function pd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function md(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function gd(t){this.data=t,this.depth=this.height=0,this.parent=null}function _d(t){for(var e,n,i=0,r=(t=function(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(Array.from(t))).length,s=[];i<r;)e=t[i],n&&bd(n,e)?++i:(n=wd(s=vd(s,e)),i=0);return n}function vd(t,e){var n,i;if(xd(e,t))return[e];for(n=0;n<t.length;++n)if(yd(e,t[n])&&xd(kd(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(i=n+1;i<t.length;++i)if(yd(kd(t[n],t[i]),e)&&yd(kd(t[n],e),t[i])&&yd(kd(t[i],e),t[n])&&xd(Sd(t[n],t[i],e),t))return[t[n],t[i],e];throw new Error}function yd(t,e){var n=t.r-e.r,i=e.x-t.x,r=e.y-t.y;return n<0||n*n<i*i+r*r}function bd(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function xd(t,e){for(var n=0;n<e.length;++n)if(!bd(t,e[n]))return!1;return!0}function wd(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return kd(t[0],t[1]);case 3:return Sd(t[0],t[1],t[2])}}function kd(t,e){var n=t.x,i=t.y,r=t.r,s=e.x,o=e.y,a=e.r,l=s-n,c=o-i,u=a-r,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(i+o+c/h*u)/2,r:(h+r+a)/2}}function Sd(t,e,n){var i=t.x,r=t.y,s=t.r,o=e.x,a=e.y,l=e.r,c=n.x,u=n.y,h=n.r,f=i-o,d=i-c,p=r-a,m=r-u,g=l-s,_=h-s,v=i*i+r*r-s*s,y=v-o*o-a*a+l*l,b=v-c*c-u*u+h*h,x=d*p-f*m,w=(p*b-m*y)/(2*x)-i,k=(m*g-p*_)/x,S=(d*y-f*b)/(2*x)-r,M=(f*_-d*g)/x,T=k*k+M*M-1,C=2*(s+w*k+S*M),A=w*w+S*S-s*s,D=-(T?(C+Math.sqrt(C*C-4*T*A))/(2*T):A/C);return{x:i+w+k*D,y:r+S+M*D,r:D}}function Md(t,e,n){var i,r,s,o,a=t.x-e.x,l=t.y-e.y,c=a*a+l*l;c?(r=e.r+n.r,r*=r,o=t.r+n.r,r>(o*=o)?(i=(c+o-r)/(2*c),s=Math.sqrt(Math.max(0,o/c-i*i)),n.x=t.x-i*a-s*l,n.y=t.y-i*l+s*a):(i=(c+r-o)/(2*c),s=Math.sqrt(Math.max(0,r/c-i*i)),n.x=e.x+i*a-s*l,n.y=e.y+i*l+s*a)):(n.x=e.x+n.r,n.y=e.y)}function Td(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Cd(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,s=(e.y*n.r+n.y*e.r)/i;return r*r+s*s}function Ad(t){this._=t,this.next=null,this.previous=null}function Dd(t){if(!(r=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var e,n,i,r,s,o,a,l,c,u,h;if((e=t[0]).x=0,e.y=0,!(r>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(r>2))return e.r+n.r;Md(n,e,i=t[2]),e=new Ad(e),n=new Ad(n),i=new Ad(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(a=3;a<r;++a){Md(e._,n._,i=t[a]),i=new Ad(i),l=n.next,c=e.previous,u=n._.r,h=e._.r;do{if(u<=h){if(Td(l._,i._)){n=l,e.next=n,n.previous=e,--a;continue t}u+=l._.r,l=l.next}else{if(Td(c._,i._)){(e=c).next=n,n.previous=e,--a;continue t}h+=c._.r,c=c.previous}}while(l!==c.next);for(i.previous=e,i.next=n,e.next=n.previous=n=i,s=Cd(e);(i=i.next)!==n;)(o=Cd(i))<s&&(e=i,s=o);n=e.next}for(e=[n._],i=n;(i=i.next)!==n;)e.push(i._);for(i=_d(e),a=0;a<r;++a)(e=t[a]).x-=i.x,e.y-=i.y;return i.r}function Ed(t){return null==t?null:Nd(t)}function Nd(t){if("function"!=typeof t)throw new Error;return t}function zd(){return 0}function Pd(t){return function(){return t}}
vendor: 5,713 bytes, line 716
716function jd(t){return Math.sqrt(t.value)}function Id(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function $d(t,e){return function(n){if(i=n.children){var i,r,s,o=i.length,a=t(n)*e||0;if(a)for(r=0;r<o;++r)i[r].r+=a;if(s=Dd(i),a)for(r=0;r<o;++r)i[r].r-=a;n.r=s+a}}}function Rd(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function Ld(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Fd(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(i-e)/t.value;++a<l;)(s=o[a]).y0=n,s.y1=r,s.x0=e,s.x1=e+=s.value*c}ed.invert=function(t,e){for(var n,i=e,r=i*i,s=r*r*r,o=0;o<12&&(s=(r=(i-=n=(i*(Gf+Kf*r+s*(Zf+Qf*r))-e)/(Gf+3*Kf*r+s*(7*Zf+9*Qf*r)))*i)*r*r,!(ql(n)<$l));++o);return[td*t*(Gf+3*Kf*r+s*(7*Zf+9*Qf*r))/Wl(i),ic(Zl(i)/td)]},nd.invert=Hf(Bl),id.invert=function(t,e){var n,i=e,r=25;do{var s=i*i,o=s*s;i-=n=(i*(1.007226+s*(.015085+o*(.028874*s-.044475-.005916*o)))-e)/(1.007226+s*(.045255+o*(.259866*s-.311325-.005916*11*o)))}while(ql(n)>Il&&--r>0);return[t/(.8707+(s=i*i)*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979)),i]},rd.invert=Hf(ic),sd.invert=Hf(function(t){return 2*Bl(t)}),od.invert=function(t,e){return[-e,2*Bl(Xl(t))-Ll]},gd.prototype=hd.prototype={constructor:gd,count:function(){return this.eachAfter(ud)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,s=this,o=[s],a=[],l=-1;s=o.pop();)if(a.push(s),n=s.children)for(i=0,r=n.length;i<r;++i)o.push(n[i]);for(;s=a.pop();)t.call(e,s,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,s=[r],o=-1;r=s.pop();)if(t.call(e,r,++o,this),n=r.children)for(i=n.length-1;i>=0;--i)s.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return hd(this).eachBefore(pd)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,s=[r];do{for(t=s.reverse(),s=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)s.push(e[n])}while(s.length)}};var Od={depth:-1},Hd={};function Vd(t){return t.id}function qd(t){return t.parentId}function Bd(t,e){return t.parent===e.parent?1:2}function Ud(t){var e=t.children;return e?e[0]:t.t}function Wd(t){var e=t.children;return e?e[e.length-1]:t.t}function Yd(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function Xd(t,e,n){return t.a.parent===e.parent?t.a:n}function Jd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Gd(t,e,n,i,r){for(var s,o=t.children,a=-1,l=o.length,c=t.value&&(r-n)/t.value;++a<l;)(s=o[a]).x0=e,s.x1=i,s.y0=n,s.y1=n+=s.value*c}Jd.prototype=Object.create(gd.prototype);var Kd=(1+Math.sqrt(5))/2;function Zd(t,e,n,i,r,s){for(var o,a,l,c,u,h,f,d,p,m,g,_=[],v=e.children,y=0,b=0,x=v.length,w=e.value;y<x;){l=r-n,c=s-i;do{u=v[b++].value}while(!u&&b<x);for(h=f=u,g=u*u*(m=Math.max(c/l,l/c)/(w*t)),p=Math.max(f/g,g/h);b<x;++b){if(u+=a=v[b].value,a<h&&(h=a),a>f&&(f=a),g=u*u*m,(d=Math.max(f/g,g/h))>p){u-=a;break}p=d}_.push(o={value:u,dice:l<c,children:v.slice(y,b)}),o.dice?Fd(o,n,i,r,w?i+=c*u/w:s):Gd(o,n,i,w?n+=l*u/w:r,s),w-=u,y=b}return _}var Qd=function nw(t){function e(e,n,i,r,s){Zd(t,e,n,i,r,s)}return e.ratio=function(t){return nw((t=+t)>1?t:1)},e}(Kd);var tp=function iw(t){function e(e,n,i,r,s){if((o=e._squarify)&&o.ratio===t)for(var o,a,l,c,u,h=-1,f=o.length,d=e.value;++h<f;){for(l=(a=o[h]).children,c=a.value=0,u=l.length;c<u;++c)a.value+=l[c].value;a.dice?Fd(a,n,i,r,d?i+=(s-i)*a.value/d:s):Gd(a,n,i,d?n+=(r-n)*a.value/d:r,s),d-=a.value}else e._squarify=o=Zd(t,e,n,i,r,s),o.ratio=t}return e.ratio=function(t){return iw((t=+t)>1?t:1)},e}(Kd);function ep(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function np(t,e){return t[0]-e[0]||t[1]-e[1]}function ip(t){const e=t.length,n=[0,1];let i,r=2;for(i=2;i<e;++i){for(;r>1&&ep(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}var rp=Math.random,sp=function rw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,1===arguments.length?(n=e,e=0):n-=e,function(){return t()*n+e}}return e.source=rw,e}(rp),op=function sw(t){function e(e,n){return arguments.length<2&&(n=e,e=0),e=Math.floor(e),n=Math.floor(n)-e,function(){return Math.floor(t()*n+e)}}return e.source=sw,e}(rp),ap=function ow(t){function e(e,n){var i,r;return e=null==e?0:+e,n=null==n?1:+n,function(){var s;if(null!=i)s=i,i=null;else do{i=2*t()-1,s=2*t()-1,r=i*i+s*s}while(!r||r>1);return e+n*s*Math.sqrt(-2*Math.log(r)/r)}}return e.source=ow,e}(rp),lp=function aw(t){var e=ap.source(t);function n(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return n.source=aw,n}(rp),cp=function lw(t){function e(e){return(e=+e)<=0?()=>0:function(){for(var n=0,i=e;i>1;--i)n+=t();return n+i*t()}}return e.source=lw,e}(rp),up=function cw(t){var e=cp.source(t);
vendor: 9,454 bytes, line 716
716function n(n){if(0==(n=+n))return t;var i=e(n);return function(){return i()/n}}return n.source=cw,n}(rp),hp=function uw(t){function e(e){return function(){return-Math.log1p(-t())/e}}return e.source=uw,e}(rp),fp=function hw(t){function e(e){if((e=+e)<0)throw new RangeError("invalid alpha");return e=1/-e,function(){return Math.pow(1-t(),e)}}return e.source=hw,e}(rp),dp=function fw(t){function e(e){if((e=+e)<0||e>1)throw new RangeError("invalid p");return function(){return Math.floor(t()+e)}}return e.source=fw,e}(rp),pp=function dw(t){function e(e){if((e=+e)<0||e>1)throw new RangeError("invalid p");return 0===e?()=>1/0:1===e?()=>1:(e=Math.log1p(-e),function(){return 1+Math.floor(Math.log1p(-t())/e)})}return e.source=dw,e}(rp),mp=function pw(t){var e=ap.source(t)();function n(n,i){if((n=+n)<0)throw new RangeError("invalid k");if(0===n)return()=>0;if(i=null==i?1:+i,1===n)return()=>-Math.log1p(-t())*i;var r=(n<1?n+1:n)-1/3,s=1/(3*Math.sqrt(r)),o=n<1?()=>Math.pow(t(),1/n):()=>1;return function(){do{do{var n=e(),a=1+s*n}while(a<=0);a*=a*a;var l=1-t()}while(l>=1-.0331*n*n*n*n&&Math.log(l)>=.5*n*n+r*(1-a+Math.log(a)));return r*a*o()*i}}return n.source=pw,n}(rp),gp=function mw(t){var e=mp.source(t);function n(t,n){var i=e(t),r=e(n);return function(){var t=i();return 0===t?0:t/(t+r())}}return n.source=mw,n}(rp),_p=function gw(t){var e=pp.source(t),n=gp.source(t);function i(t,i){return t=+t,(i=+i)>=1?()=>t:i<=0?()=>0:function(){for(var r=0,s=t,o=i;s*o>16&&s*(1-o)>16;){var a=Math.floor((s+1)*o),l=n(a,s-a+1)();l<=o?(r+=a,s-=a,o=(o-l)/(1-l)):(s=a-1,o/=l)}for(var c=o<.5,u=e(c?o:1-o),h=u(),f=0;h<=s;++f)h+=u();return r+(c?f:s-f)}}return i.source=gw,i}(rp),vp=function _w(t){function e(e,n,i){var r;return 0==(e=+e)?r=(t=>-Math.log(t)):(e=1/e,r=(t=>Math.pow(t,e))),n=null==n?0:+n,i=null==i?1:+i,function(){return n+i*r(-Math.log1p(-t()))}}return e.source=_w,e}(rp),yp=function vw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,function(){return e+n*Math.tan(Math.PI*t())}}return e.source=vw,e}(rp),bp=function yw(t){function e(e,n){return e=null==e?0:+e,n=null==n?1:+n,function(){var i=t();return e+n*Math.log(i/(1-i))}}return e.source=yw,e}(rp),xp=function bw(t){var e=mp.source(t),n=_p.source(t);function i(i){return function(){for(var r=0,s=i;s>16;){var o=Math.floor(.875*s),a=e(o)();if(a>s)return r+n(o-1,s/a)();r+=o,s-=a}for(var l=-Math.log1p(-t()),c=0;l<=s;++c)l-=Math.log1p(-t());return r+c}}return i.source=bw,i}(rp);const wp=1/4294967296;function kp(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Sp(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Mp=Symbol("implicit");function Tp(){var t=new _,e=[],n=[],i=Mp;function r(r){let s=t.get(r);if(void 0===s){if(i!==Mp)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new _;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Tp(e,n).unknown(i)},kp.apply(r,arguments),r}function Cp(){var t,e,n=Tp().unknown(void 0),i=n.domain,r=n.range,s=0,o=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=o<s,f=h?o:s,d=h?s:o;t=(d-f)/Math.max(1,n-l+2*c),a&&(t=Math.floor(t)),f+=(d-f-t*(n-l))*u,e=t*(1-l),a&&(f=Math.round(f),e=Math.round(e));var p=nt(n).map(function(e){return f+t*e});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([s,o]=t,s=+s,o=+o,h()):[s,o]},n.rangeRound=function(t){return[s,o]=t,s=+s,o=+o,a=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(a=!!t,h()):a},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Cp(i(),[s,o]).round(a).paddingInner(l).paddingOuter(c).align(u)},kp.apply(h(),arguments)}function Ap(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ap(e())},t}function Dp(t){return+t}var Ep=[0,1];function Np(t){return t}function zp(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Pp(t,e,n){var i=t[0],r=t[1],s=e[0],o=e[1];return r<i?(i=zp(r,i),s=n(o,s)):(i=zp(i,r),s=n(s,o)),function(t){return s(i(t))}}function jp(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=zp(t[o],t[o+1]),s[o]=n(e[o],e[o+1]);return function(e){var n=l(t,e,1,i)-1;return s[n](r[n](e))}}function Ip(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $p(){var t,e,n,i,r,s,o=Ep,a=Ep,l=zi,c=Np;function u(){var t=Math.min(o.length,a.length);return c!==Np&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),i=t>2?jp:Pp,r=s=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),a,l)))(t(c(e)))}return h.invert=function(n){return c(e((s||(s=i(a,o.map(t),Ci)))(n)))},h.domain=function(t){return arguments.length?(o=Array.from(t,Dp),u()):o.slice()},h.range=function(t){return arguments.length?(a=Array.from(t),u()):a.slice()},h.rangeRound=function(t){return a=Array.from(t),l=Pi,u()},h.clamp=function(t){return arguments.length?(c=!!t||Np,u()):c!==Np},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function Rp(){return $p()(Np,Np)}function Lp(e,n,i,r){var s,o=V(e,n,i);switch((r=wl(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(n));return null!=r.precision||isNaN(s=Pl(o,a))||(r.precision=s),t.formatPrefix(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(s=jl(o,Math.max(Math.abs(e),Math.abs(n))))||(r.precision=s-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(s=zl(o))||(r.precision=s-2*("%"===r.type))}return t.format(r)}function Fp(t){var e=t.domain;return t.ticks=function(t){var n=e();return O(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Lp(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,s=e(),o=0,a=s.length-1,l=s[o],c=s[a],u=10;for(c<l&&(r=l,l=c,c=r,r=o,o=a,a=r);u-- >0;){if((r=H(l,c,n))===i)return s[o]=l,s[a]=c,e(s);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function Op(t,e){var n,i=0,r=(t=t.slice()).length-1,s=t[i],o=t[r];return o<s&&(n=i,i=r,r=n,n=s,s=o,o=n),t[i]=e.floor(s),t[r]=e.ceil(o),t}function Hp(t){return Math.log(t)}function Vp(t){return Math.exp(t)}function qp(t){return-Math.log(-t)}function Bp(t){return-Math.exp(-t)}function Up(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Wp(t){return(e,n)=>-t(-e,n)}function Yp(e){const n=e(Hp,Vp),i=n.domain;let r,s,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),s=function(t){return 10===t?Up:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),i()[0]<0?(r=Wp(r),s=Wp(s),e(qp,Bp)):e(Hp,Vp),n}return n.base=function(t){return arguments.length?(o=+t,a()):o},n.domain=function(t){return arguments.length?(i(t),a()):i()},n.ticks=(t=>{const e=i();let n=e[0],a=e[e.length-1];const l=a<n;l&&([n,a]=[a,n]);let c,u,h=r(n),f=r(a);const d=null==t?10:+t;let p=[];if(!(o%1)&&f-h<d){if(h=Math.floor(h),f=Math.ceil(f),n>0){for(;h<=f;++h)for(c=1;c<o;++c)if(u=h<0?c/s(-h):c*s(h),!(u<n)){if(u>a)break;p.push(u)}}else for(;h<=f;++h)for(c=o-1;c>=1;--c)if(u=h>0?c/s(-h):c*s(h),!(u<n)){if(u>a)break;p.push(u)}2*p.length<d&&(p=O(n,a,d))}else p=O(h,f,Math.min(f-h,d)).map(s);return l?p.reverse():p}),n.tickFormat=((e,i)=>{if(null==e&&(e=10),null==i&&(i=10===o?"s":","),"function"!=typeof i&&(o%1||null!=(i=wl(i)).precision||(i.trim=!0),i=t.format(i)),e===1/0)return i;const a=Math.max(1,o*e/n.ticks().length);return t=>{let e=t/s(Math.round(r(t)));return e*o<o-.5&&(e*=o),e<=a?i(t):""}}),n.nice=(()=>i(Op(i(),{floor:t=>s(Math.floor(r(t))),ceil:t=>s(Math.ceil(r(t)))}))),n}function Xp(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Jp(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Gp(t){var e=1,n=t(Xp(e),Jp(e));return n.constant=function(n){return arguments.length?t(Xp(e=+n),Jp(e)):e},Fp(n)}function Kp(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Zp(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Qp(t){return t<0?-t*t:t*t}function tm(t){var e=t(Np,Np),n=1;function i(){return 1===n?t(Np,Np):.5===n?t(Zp,Qp):t(Kp(n),Kp(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,i()):n},Fp(e)}function em(){var t=tm($p());return t.copy=function(){return Ip(t,em()).exponent(t.exponent())},kp.apply(t,arguments),t}function nm(t){return Math.sign(t)*t*t}
716function im(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}var rm=new Date,sm=new Date;function om(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=function(e){return t(e=new Date(+e)),e},r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},r.range=function(n,i,s){var o,a=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return a;do{a.push(o=new Date(+n)),e(n,s),t(n)}while(o<n&&n<i);return a},r.filter=function(n){return om(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})},n&&(r.count=function(e,i){return rm.setTime(+e),sm.setTime(+i),t(rm),t(sm),Math.floor(n(rm,sm))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var am=om(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});am.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?om(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):am:null};var lm=am,cm=am.range;const um=1e3,hm=6e4,fm=36e5,dm=864e5,pm=6048e5,mm=2592e6,gm=31536e6;var _m=om(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+e*um)},function(t,e){return(e-t)/um},function(t){return t.getUTCSeconds()}),vm=_m,ym=_m.range,bm=om(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*um)},function(t,e){t.setTime(+t+e*hm)},function(t,e){return(e-t)/hm},function(t){return t.getMinutes()}),xm=bm,wm=bm.range,km=om(function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*um-t.getMinutes()*hm)},function(t,e){t.setTime(+t+e*fm)},function(t,e){return(e-t)/fm},function(t){return t.getHours()}),Sm=km,Mm=km.range,Tm=om(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hm)/dm,t=>t.getDate()-1),Cm=Tm,Am=Tm.range;function Dm(t){return om(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*hm)/pm})}var Em=Dm(0),Nm=Dm(1),zm=Dm(2),Pm=Dm(3),jm=Dm(4),Im=Dm(5),$m=Dm(6),Rm=Em.range,Lm=Nm.range,Fm=zm.range,Om=Pm.range,Hm=jm.range,Vm=Im.range,qm=$m.range,Bm=om(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Um=Bm,Wm=Bm.range,Ym=om(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Ym.every=function(t){return isFinite(t=Math.floor(t))&&t>0?om(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var Xm=Ym,Jm=Ym.range,Gm=om(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*hm)},function(t,e){return(e-t)/hm},function(t){return t.getUTCMinutes()}),Km=Gm,Zm=Gm.range,Qm=om(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*fm)},function(t,e){return(e-t)/fm},function(t){return t.getUTCHours()}),tg=Qm,eg=Qm.range,ng=om(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/dm},function(t){return t.getUTCDate()-1}),ig=ng,rg=ng.range;function sg(t){return om(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/pm})}var og=sg(0),ag=sg(1),lg=sg(2),cg=sg(3),ug=sg(4),hg=sg(5),fg=sg(6),dg=og.range,pg=ag.range,mg=lg.range,gg=cg.range,_g=ug.range,vg=hg.range,yg=fg.range,bg=om(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),xg=bg,wg=bg.range,kg=om(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});kg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?om(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var Sg=kg,Mg=kg.range;function Tg(t,e,i,r,s,o){const a=[[vm,1,um],[vm,5,5e3],[vm,15,15e3],[vm,30,3e4],[o,1,hm],[o,5,3e5],[o,15,9e5],[o,30,18e5],[s,1,fm],[s,3,108e5],[s,6,216e5],[s,12,432e5],[r,1,dm],[r,2,1728e5],[i,1,pm],[e,1,mm],[e,3,7776e6],[t,1,gm]
vendor: 9,194 bytes, lines 716-717
716];function l(e,i,r){const s=Math.abs(i-e)/r,o=n(([,,t])=>t).right(a,s);if(o===a.length)return t.every(V(e/gm,i/gm,r));if(0===o)return lm.every(Math.max(V(e,i,r),1));const[l,c]=a[s/a[o-1][2]<a[o][2]/s?o-1:o];return l.every(c)}return[function(t,e,n){const i=e<t;i&&([t,e]=[e,t]);const r=n&&"function"==typeof n.range?n:l(t,e,n),s=r?r.range(t,+e+1):[];return i?s.reverse():s},l]}const[Cg,Ag]=Tg(Sg,xg,og,ig,tg,Km),[Dg,Eg]=Tg(Xm,Um,Em,Cm,Sm,xm);function Ng(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function zg(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Pg(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function jg(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,s=t.days,o=t.shortDays,a=t.months,l=t.shortMonths,c=Vg(r),u=qg(r),h=Vg(s),f=qg(s),d=Vg(o),p=qg(o),m=Vg(a),g=qg(a),_=Vg(l),v=qg(l),y={a:function(t){return o[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:u_,e:u_,f:m_,g:T_,G:A_,H:h_,I:f_,j:d_,L:p_,m:g_,M:__,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:K_,s:Z_,S:v_,u:y_,U:b_,V:w_,w:k_,W:S_,x:null,X:null,y:M_,Y:C_,Z:D_,"%":G_},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return s[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:E_,e:E_,f:I_,g:W_,G:X_,H:N_,I:z_,j:P_,L:j_,m:$_,M:R_,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:K_,s:Z_,S:L_,u:F_,U:O_,V:V_,w:q_,W:B_,x:null,X:null,y:U_,Y:Y_,Z:J_,"%":G_},x={a:function(t,e,n){var i=d.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=_.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return S(t,e,n,i)},d:t_,e:t_,f:o_,g:Gg,G:Jg,H:n_,I:n_,j:e_,L:s_,m:Qg,M:i_,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Zg,Q:l_,s:c_,S:r_,u:Ug,U:Wg,V:Yg,w:Bg,W:Xg,x:function(t,e,i){return S(t,n,e,i)},X:function(t,e,n){return S(t,i,e,n)},y:Gg,Y:Jg,Z:Kg,"%":a_};function w(t,e){return function(n){var i,r,s,o=[],a=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===t.charCodeAt(a)&&(o.push(t.slice(l,a)),null!=(r=$g[i=t.charAt(++a)])?i=t.charAt(++a):r="e"===i?" ":"0",(s=e[i])&&(i=s(n,r)),o.push(i),l=a+1);return o.push(t.slice(l,a)),o.join("")}}function k(t,e){return function(n){var i,r,s=Pg(1900,void 0,1);if(S(s,t,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(e&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=zg(Pg(s.y,0,1))).getUTCDay(),i=r>4||0===r?ag.ceil(i):ag(i),i=ig.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=Ng(Pg(s.y,0,1))).getDay(),i=r>4||0===r?Nm.ceil(i):Nm(i),i=Cm.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)
717}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?zg(Pg(s.y,0,1)).getUTCDay():Ng(Pg(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,zg(s)):Ng(s)}}function S(t,e,n,i){for(var r,s,o=0,a=e.length,l=n.length;o<a;){if(i>=l)return-1;if(37===(r=e.charCodeAt(o++))){if(r=e.charAt(o++),!(s=x[r in $g?e.charAt(o++):r])||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return y.x=w(n,y),y.X=w(i,y),y.c=w(e,y),b.x=w(n,b),b.X=w(i,b),b.c=w(e,b),{format:function(t){var e=w(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var Ig,$g={"-":"",_:" ",0:"0"},Rg=/^\s*\d+/,Lg=/^%/,Fg=/[\\^$*+?|[\]().{}]/g;function Og(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(e)+r:r)}function Hg(t){return t.replace(Fg,"\\$&")}function Vg(t){return new RegExp("^(?:"+t.map(Hg).join("|")+")","i")}function qg(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function Bg(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Ug(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Wg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Yg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Xg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Jg(t,e,n){var i=Rg.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Gg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Kg(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Zg(t,e,n){var i=Rg.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function Qg(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function t_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function e_(t,e,n){var i=Rg.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function n_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function i_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function r_(t,e,n){var i=Rg.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function s_(t,e,n){var i=Rg.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function o_(t,e,n){var i=Rg.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function a_(t,e,n){var i=Lg.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function l_(t,e,n){var i=Rg.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function c_(t,e,n){var i=Rg.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function u_(t,e){return Og(t.getDate(),e,2)}function h_(t,e){return Og(t.getHours(),e,2)}function f_(t,e){return Og(t.getHours()%12||12,e,2)}function d_(t,e){return Og(1+Cm.count(Xm(t),t),e,3)}function p_(t,e){return Og(t.getMilliseconds(),e,3)}function m_(t,e){return p_(t,e)+"000"}function g_(t,e){return Og(t.getMonth()+1,e,2)}function __(t,e){return Og(t.getMinutes(),e,2)}function v_(t,e){return Og(t.getSeconds(),e,2)}function y_(t){var e=t.getDay();return 0===e?7:e}function b_(t,e){return Og(Em.count(Xm(t)-1,t),e,2)}function x_(t){var e=t.getDay();return e>=4||0===e?jm(t):jm.ceil(t)}function w_(t,e){return t=x_(t),Og(jm.count(Xm(t),t)+(4===Xm(t).getDay()),e,2)}function k_(t){return t.getDay()}function S_(t,e){return Og(Nm.count(Xm(t)-1,t),e,2)}function M_(t,e){return Og(t.getFullYear()%100,e,2)}function T_(t,e){return Og((t=x_(t)).getFullYear()%100,e,2)}function C_(t,e){return Og(t.getFullYear()%1e4,e,4)}function A_(t,e){var n=t.getDay();return Og((t=n>=4||0===n?jm(t):jm.ceil(t)).getFullYear()%1e4,e,4)}function D_(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Og(e/60|0,"0",2)+Og(e%60,"0",2)}function E_(t,e){return Og(t.getUTCDate(),e,2)}function N_(t,e){return Og(t.getUTCHours(),e,2)}function z_(t,e){return Og(t.getUTCHours()%12||12,e,2)}function P_(t,e){return Og(1+ig.count(Sg(t),t),e,3)}function j_(t,e){return Og(t.getUTCMilliseconds(),e,3)}function I_(t,e){return j_(t,e)+"000"}function $_(t,e){return Og(t.getUTCMonth()+1,e,2)}function R_(t,e){return Og(t.getUTCMinutes(),e,2)}function L_(t,e){return Og(t.getUTCSeconds(),e,2)}function F_(t){var e=t.getUTCDay();return 0===e?7:e}function O_(t,e){return Og(og.count(Sg(t)-1,t),e,2)}function H_(t){var e=t.getUTCDay();return e>=4||0===e?ug(t):ug.ceil(t)}function V_(t,e){return t=H_(t),Og(ug.count(Sg(t),t)+(4===Sg(t).getUTCDay()),e,2)}function q_(t){return t.getUTCDay()}function B_(t,e){return Og(ag.count(Sg(t)-1,t),e,2)}function U_(t,e){return Og(t.getUTCFullYear()%100,e,2)}function W_(t,e){return Og((t=H_(t)).getUTCFullYear()%100,e,2)}function Y_(t,e){return Og(t.getUTCFullYear()%1e4,e,4)}function X_(t,e){var n=t.getUTCDay();return Og((t=n>=4||0===n?ug(t):ug.ceil(t)).getUTCFullYear()%1e4,e,4)}function J_(){return"+0000"}function G_(){return"%"}function K_(t){return+t}function Z_(t){return Math.floor(+t/1e3)}function Q_(e){return Ig=jg(e),t.timeFormat=Ig.format,t.timeParse=Ig.parse,t.utcFormat=Ig.utcFormat,t.utcParse=Ig.utcParse,Ig}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,Q_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
717ay","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"]});var tv="%Y-%m-%dT%H:%M:%S.%LZ";var ev=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(tv),nv=ev;var iv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(tv),rv=iv;function sv(t){return new Date(t)}function ov(t){return t instanceof Date?+t:+new Date(+t)}function av(t,e,n,i,r,s,o,a,l,c){var u=Rp(),h=u.invert,f=u.domain,d=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),_=c("%a %d"),v=c("%b %d"),y=c("%B"),b=c("%Y");function x(t){return(l(t)<t?d:a(t)<t?p:o(t)<t?m:s(t)<t?g:i(t)<t?r(t)<t?_:v:n(t)<t?y:b)(t)}return u.invert=function(t){return new Date(h(t))},u.domain=function(t){return arguments.length?f(Array.from(t,ov)):f().map(sv)},u.ticks=function(e){var n=f();return t(n[0],n[n.length-1],null==e?10:e)},u.tickFormat=function(t,e){return null==e?x:c(e)},u.nice=function(t){var n=f();return t&&"function"==typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?f(Op(n,t)):u},u.copy=function(){return Ip(u,av(t,e,n,i,r,s,o,a,l,c))},u}function lv(){var t,e,n,i,r,s=0,o=1,a=Np,l=!1;function c(e){return null==e||isNaN(e=+e)?r:a(0===n?.5:(e=(i(e)-t)*n,l?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,i;return arguments.length?([n,i]=e,a=t(n,i),c):[a(0),a(1)]}}return c.domain=function(r){return arguments.length?([s,o]=r,t=i(s=+s),e=i(o=+o),n=t===e?0:1/(e-t),c):[s,o]},c.clamp=function(t){return arguments.length?(l=!!t,c):l},c.interpolator=function(t){return arguments.length?(a=t,c):a},c.range=u(zi),c.rangeRound=u(Pi),c.unknown=function(t){return arguments.length?(r=t,c):r},function(r){return i=r,t=r(s),e=r(o),n=t===e?0:1/(e-t),c}}function cv(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function uv(){var t=tm(lv());return t.copy=function(){return cv(t,uv()).exponent(t.exponent())},Sp.apply(t,arguments)}function hv(){var t,e,n,i,r,s,o,a=0,l=.5,c=1,u=1,h=Np,f=!1;function d(t){return isNaN(t=+t)?o:(t=.5+((t=+s(t))-e)*(u*t<u*e?i:r),h(f?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,i,r;return arguments.length?([n,i,r]=e,h=Zi(t,[n,i,r]),d):[h(0),h(.5),h(1)]}}return d.domain=function(o){return arguments.length?([a,l,c]=o,t=s(a=+a),e=s(l=+l),n=s(c=+c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,d):[a,l,c]},d.clamp=function(t){return arguments.length?(f=!!t,d):f},d.interpolator=function(t){return arguments.length?(h=t,d):h},d.range=p(zi),d.rangeRound=p(Pi),d.unknown=function(t){return arguments.length?(o=t,d):o},function(o){return s=o,t=o(a),e=o(l),n=o(c),i=t===e?0:.5/(e-t),r=e===n?0:.5/(n-e),u=e<t?-1:1,d}}function fv(){var t=tm(hv());return t.copy=function(){return cv(t,fv()).exponent(t.exponent())},Sp.apply(t,arguments)}function dv(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}var pv=dv("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),mv=dv("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),gv=dv("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),_v=dv("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),vv=dv("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),yv=dv("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),bv=dv("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),xv=dv("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),wv=dv("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),kv=dv("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),Sv=t=>xi(t[t.length-1]),Mv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(dv),Tv=Sv(Mv),Cv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(dv),Av=Sv(Cv),Dv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(dv),Ev=Sv(Dv),Nv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(dv),zv=Sv(Nv),Pv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(dv),jv=Sv(Pv),Iv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(dv),$v=Sv(Iv),Rv=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(dv),Lv=Sv(Rv),Fv=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d
7177191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(dv),Ov=Sv(Fv),Hv=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(dv),Vv=Sv(Hv),qv=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(dv),Bv=Sv(qv),Uv=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(dv),Wv=Sv(Uv),Yv=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(dv),Xv=Sv(Yv),Jv=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(dv),Gv=Sv(Jv),Kv=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(dv),Zv=Sv(Kv),Qv=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(dv),ty=Sv(Qv),ey=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(dv),ny=Sv(ey),iy=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(dv),ry=Sv(iy),sy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(dv),oy=Sv(sy),ay=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(dv),ly=Sv(ay),cy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(dv),uy=Sv(cy),hy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(dv),fy=Sv(hy),dy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ec
717ae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(dv),py=Sv(dy),my=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(dv),gy=Sv(my),_y=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(dv),vy=Sv(_y),yy=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(dv),by=Sv(yy),xy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(dv),wy=Sv(xy),ky=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(dv),Sy=Sv(ky);var My=Ki(ci(300,.5,0),ci(-240,.5,1)),Ty=Ki(ci(-100,.75,.35),ci(80,1.5,.8)),Cy=Ki(ci(260,.75,.35),ci(80,1.5,.8)),Ay=ci();var Dy=Tn(),Ey=Math.PI/3,Ny=2*Math.PI/3;function zy(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Py=zy(dv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),jy=zy(dv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb8
7171febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Iy=zy(dv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),$y=zy(dv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ry(t){return function(){return t}}var Ly=Math.abs,Fy=Math.atan2,Oy=Math.cos,Hy=Math.max,Vy=Math.min,qy=Math.sin,By=Math.sqrt,Uy=1e-12,Wy=Math.PI,Yy=Wy/2,Xy=2*Wy;function Jy(t){return t>1?0:t<-1?Wy:Math.acos(t)}function Gy(t){return t>=1?Yy:t<=-1?-Yy:Math.asin(t)}function Ky(t){return t.innerRadius}function Zy(t){return t.outerRadius}function Qy(t){return t.startAngle}function tb(t){return t.endAngle}function eb(t){return t&&t.padAngle}function nb(t,e,n,i,r,s,o,a){var l=n-t,c=i-e,u=o-r,h=a-s,f=h*l-u*c;if(!(f*f<Uy))return[t+(f=(u*(e-s)-h*(t-r))/f)*l,e+f*c]}function ib(t,e,n,i,r,s,o){var a=t-n,l=e-i,c=(o?s:-s)/By(a*a+l*l),u=c*l,h=-c*a,f=t+u,d=e+h,p=n+u,m=i+h,g=(f+p)/2,_=(d+m)/2,v=p-f,y=m-d,b=v*v+y*y,x=r-s,w=f*m-p*d,k=(y<0?-1:1)*By(Hy(0,x*x*b-w*w)),S=(w*y-v*k)/b,M=(-w*v-y*k)/b,T=(w*y+v*k)/b,C=(-w*v+y*k)/b,A=S-g,D=M-_,E=T-g,N=C-_;return A*A+D*D>E*E+N*N&&(S=T,M=C),{cx:S,cy:M,x01:-u,y01:-h,x11:S*(r/x-1),y11:M*(r/x-1)}}var rb=Array.prototype.slice;
vendor: 17,300 bytes, lines 717-718
717function sb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ob(t){this._context=t}function ab(t){return new ob(t)}function lb(t){return t[0]}function cb(t){return t[1]}function ub(t,e){var n=Ry(!0),i=null,r=ab,s=null;function o(o){var a,l,c,u=(o=sb(o)).length,h=!1;for(null==i&&(s=r(c=vo())),a=0;a<=u;++a)!(a<u&&n(l=o[a],a,o))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+t(l,a,o),+e(l,a,o));if(c)return s=null,c+""||null}return t="function"==typeof t?t:void 0===t?lb:Ry(t),e="function"==typeof e?e:void 0===e?cb:Ry(e),o.x=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ry(!!t),o):n},o.curve=function(t){return arguments.length?(r=t,null!=i&&(s=r(i)),o):r},o.context=function(t){return arguments.length?(null==t?i=s=null:s=r(i=t),o):i},o}function hb(t,e,n){var i=null,r=Ry(!0),s=null,o=ab,a=null;function l(l){var c,u,h,f,d,p=(l=sb(l)).length,m=!1,g=new Array(p),_=new Array(p);for(null==s&&(a=o(d=vo())),c=0;c<=p;++c){if(!(c<p&&r(f=l[c],c,l))===m)if(m=!m)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(g[h],_[h]);a.lineEnd(),a.areaEnd()}m&&(g[c]=+t(f,c,l),_[c]=+e(f,c,l),a.point(i?+i(f,c,l):g[c],n?+n(f,c,l):_[c]))}if(d)return a=null,d+""||null}function c(){return ub().defined(r).curve(o).context(s)}return t="function"==typeof t?t:void 0===t?lb:Ry(+t),e="function"==typeof e?e:Ry(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?cb:Ry(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),i=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),l):t},l.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ry(+t),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ry(+t),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(i).y(e)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Ry(!!t),l):r},l.curve=function(t){return arguments.length?(o=t,null!=s&&(a=o(s)),l):o},l.context=function(t){return arguments.length?(null==t?s=a=null:a=o(s=t),l):s},l}function fb(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function db(t){return t}ob.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var pb=gb(ab);function mb(t){this._curve=t}function gb(t){function e(e){return new mb(t(e))}return e._curve=t,e}function _b(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(gb(t)):e()._curve},t}function vb(){return _b(ub().curve(pb))}function yb(){var t=hb().curve(pb),e=t.curve,n=t.lineX0,i=t.lineX1,r=t.lineY0,s=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return _b(n())},delete t.lineX0,t.lineEndAngle=function(){return _b(i())},delete t.lineX1,t.lineInnerRadius=function(){return _b(r())},delete t.lineY0,t.lineOuterRadius=function(){return _b(s())},delete t.lineY1,t.curve=function(t){return arguments.length?e(gb(t)):e()._curve},t}function bb(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}function xb(t){return t.source}function wb(t){return t.target}function kb(t){var e=xb,n=wb,i=lb,r=cb,s=null;function o(){var o,a=rb.call(arguments),l=e.apply(this,a),c=n.apply(this,a);if(s||(s=o=vo()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}function Sb(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function Mb(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+r)/2,i,n,i,r)}function Tb(t,e,n,i,r){var s=bb(e,n),o=bb(e,n=(n+r)/2),a=bb(i,n),l=bb(i,r);t.moveTo(s[0],s[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],l[0],l[1])}mb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var Cb={draw:function(t,e){var n=Math.sqrt(e/Wy);t.moveTo(n,0),t.arc(0,0,n,0,Xy)}},Ab={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},Db=Math.sqrt(1/3),Eb=2*Db,Nb={draw:function(t,e){var n=Math.sqrt(e/Eb),i=n*Db;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},zb=Math.sin(Wy/10)/Math.sin(7*Wy/10),Pb=Math.sin(Xy/10)*zb,jb=-Math.cos(Xy/10)*zb,Ib={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=Pb*n,r=jb*n;t.moveTo(0,-n),t.lineTo(i,r);for(var s=1;s<5;++s){var o=Xy*s/5,a=Math.cos(o),l=Math.sin(o);t.lineTo(l*n,-a*n),t.lineTo(a*i-l*r,l*i+a*r)}t.closePath()}},$b={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},Rb=Math.sqrt(3),Lb={draw:function(t,e){var n=-Math.sqrt(e/(3*Rb));t.moveTo(0,2*n),t.lineTo(-Rb*n,-n),t.lineTo(Rb*n,-n),
718t.closePath()}},Fb=-.5,Ob=Math.sqrt(3)/2,Hb=1/Math.sqrt(12),Vb=3*(Hb/2+1),qb={draw:function(t,e){var n=Math.sqrt(e/Vb),i=n/2,r=n*Hb,s=i,o=n*Hb+n,a=-s,l=o;t.moveTo(i,r),t.lineTo(s,o),t.lineTo(a,l),t.lineTo(Fb*i-Ob*r,Ob*i+Fb*r),t.lineTo(Fb*s-Ob*o,Ob*s+Fb*o),t.lineTo(Fb*a-Ob*l,Ob*a+Fb*l),t.lineTo(Fb*i+Ob*r,Fb*r-Ob*i),t.lineTo(Fb*s+Ob*o,Fb*o-Ob*s),t.lineTo(Fb*a+Ob*l,Fb*l-Ob*a),t.closePath()}},Bb=[Cb,Ab,Nb,$b,Ib,Lb,qb];function Ub(){}function Wb(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Yb(t){this._context=t}function Xb(t){this._context=t}function Jb(t){this._context=t}Yb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Wb(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Xb.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Wb(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class Gb{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function Kb(t,e){this._basis=new Yb(t),this._beta=e}Kb.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],s=e[0],o=t[n]-r,a=e[n]-s,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*o),this._beta*e[l]+(1-this._beta)*(s+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Zb=function xw(t){function e(e){return 1===t?new Yb(e):new Kb(e,t)}return e.beta=function(t){return xw(+t)},e}(.85);function Qb(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function tx(t,e){this._context=t,this._k=(1-e)/6}tx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Qb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ex=function ww(t){function e(e){return new tx(e,t)}return e.tension=function(t){return ww(+t)},e}(0);function nx(t,e){this._context=t,this._k=(1-e)/6}nx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ix=function kw(t){function e(e){return new nx(e,t)}return e.tension=function(t){return kw(+t)},e}(0);function rx(t,e){this._context=t,this._k=(1-e)/6}rx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var sx=function Sw(t){function e(e){return new rx(e,t)}return e.tension=function(t){return Sw(+t)},e}(0);function ox(t,e,n){var i=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>Uy){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Uy){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,s,o,t._x2,t._y2)}function ax(t,e){this._context=t,this._alpha=e}ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var lx=function Mw(t){function e(e){return t?new ax(e,t):new tx(e,0)}return e.alpha=function(t){return Mw(+t)},e}(.5);function cx(t,e){this._context=t,this._alpha=e}cx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ux=function Tw(t){function e(e){return t?new cx(e,t):new nx(e,0)}return e.alpha=function(t){return Tw(+t)},e}(.5);function hx(t,e){this._context=t,this._alpha=e}hx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ox(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fx=function Cw(t){function e(e){return t?new hx(e,t):new rx(e,0)}return e.alpha=function(t){return Cw(+t)},e}(.5);function dx(t){this._context=t}function px(t){return t<0?-1:1}function mx(t,e,n){var i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(px(s)+px(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a)
vendor: 5,855 bytes, line 718
718)||0}function gx(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function _x(t,e,n){var i=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-i)/3;t._context.bezierCurveTo(i+a,r+a*e,s-a,o-a*n,s,o)}function vx(t){this._context=t}function yx(t){this._context=new bx(t)}function bx(t){this._context=t}function xx(t){this._context=t}function wx(t){var e,n,i=t.length-1,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,s[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/s[e-1],s[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/s[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/s[e];for(s[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)s[e]=2*t[e+1]-r[e+1];return[r,s]}function kx(t,e){this._context=t,this._t=e}function Sx(t,e){if((r=t.length)>1)for(var n,i,r,s=1,o=t[e[0]],a=o.length;s<r;++s)for(i=o,o=t[e[s]],n=0;n<a;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Mx(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Tx(t,e){return t[e]}function Cx(t){const e=[];return e.key=t,e}function Ax(t){var e=t.map(Dx);return Mx(t).sort(function(t,n){return e[t]-e[n]})}function Dx(t){for(var e,n=-1,i=0,r=t.length,s=-1/0;++n<r;)(e=+t[n][1])>s&&(s=e,i=n);return i}function Ex(t){var e=t.map(Nx);return Mx(t).sort(function(t,n){return e[t]-e[n]})}function Nx(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}dx.prototype={areaStart:Ub,areaEnd:Ub,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},vx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_x(this,this._t0,gx(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,_x(this,gx(this,n=mx(this,t,e)),n);break;default:_x(this,this._t0,n=mx(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(yx.prototype=Object.create(vx.prototype)).point=function(t,e){vx.prototype.point.call(this,e,t)},bx.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,s){this._context.bezierCurveTo(e,t,i,n,s,r)}},xx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=wx(t),r=wx(e),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var zx=t=>()=>t;function Px(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function jx(t,e,n){this.k=t,this.x=e,this.y=n}jx.prototype={constructor:jx,scale:function(t){return 1===t?this:new jx(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jx(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ix=new jx(1,0,0);function $x(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Ix;return t.__zoom}function Rx(t){t.stopImmediatePropagation()}function Lx(t){t.preventDefault(),t.stopImmediatePropagation()}function Fx(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Ox(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Hx(){return this.__zoom||Ix}function Vx(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?
vendor: 4,351 bytes, line 718
7181:.002)*(t.ctrlKey?10:1)}function qx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bx(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}$x.prototype=jx.prototype,t.Adder=g,t.Delaunay=_a,t.FormatSpecifier=kl,t.InternMap=_,t.InternSet=v,t.Node=gd,t.Voronoi=ha,t.ZoomTransform=jx,t.active=function(t,e){var n,i,r=t.__transition;if(r)for(i in e=null==e?null:e+"",r)if((n=r[i]).state>1&&n.name===e)return new Zr([[t]],Ts,e,+i);return null},t.arc=function(){var t=Ky,e=Zy,n=Ry(0),i=null,r=Qy,s=tb,o=eb,a=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),f=r.apply(this,arguments)-Yy,d=s.apply(this,arguments)-Yy,p=Ly(d-f),m=d>f;if(a||(a=l=vo()),h<u&&(c=h,h=u,u=c),h>Uy)if(p>Xy-Uy)a.moveTo(h*Oy(f),h*qy(f)),a.arc(0,0,h,f,d,!m),u>Uy&&(a.moveTo(u*Oy(d),u*qy(d)),a.arc(0,0,u,d,f,m));else{var g,_,v=f,y=d,b=f,x=d,w=p,k=p,S=o.apply(this,arguments)/2,M=S>Uy&&(i?+i.apply(this,arguments):By(u*u+h*h)),T=Vy(Ly(h-u)/2,+n.apply(this,arguments)),C=T,A=T;if(M>Uy){var D=Gy(M/u*qy(S)),E=Gy(M/h*qy(S));(w-=2*D)>Uy?(b+=D*=m?1:-1,x-=D):(w=0,b=x=(f+d)/2),(k-=2*E)>Uy?(v+=E*=m?1:-1,y-=E):(k=0,v=y=(f+d)/2)}var N=h*Oy(v),z=h*qy(v),P=u*Oy(x),j=u*qy(x);if(T>Uy){var I,$=h*Oy(y),R=h*qy(y),L=u*Oy(b),F=u*qy(b);if(p<Wy&&(I=nb(N,z,L,F,$,R,P,j))){var O=N-I[0],H=z-I[1],V=$-I[0],q=R-I[1],B=1/qy(Jy((O*V+H*q)/(By(O*O+H*H)*By(V*V+q*q)))/2),U=By(I[0]*I[0]+I[1]*I[1]);C=Vy(T,(u-U)/(B-1)),A=Vy(T,(h-U)/(B+1))}}k>Uy?A>Uy?(g=ib(L,F,N,z,h,A,m),_=ib($,R,P,j,h,A,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),A<T?a.arc(g.cx,g.cy,A,Fy(g.y01,g.x01),Fy(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,A,Fy(g.y01,g.x01),Fy(g.y11,g.x11),!m),a.arc(0,0,h,Fy(g.cy+g.y11,g.cx+g.x11),Fy(_.cy+_.y11,_.cx+_.x11),!m),a.arc(_.cx,_.cy,A,Fy(_.y11,_.x11),Fy(_.y01,_.x01),!m))):(a.moveTo(N,z),a.arc(0,0,h,v,y,!m)):a.moveTo(N,z),u>Uy&&w>Uy?C>Uy?(g=ib(P,j,$,R,u,-C,m),_=ib(N,z,L,F,u,-C,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),C<T?a.arc(g.cx,g.cy,C,Fy(g.y01,g.x01),Fy(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,C,Fy(g.y01,g.x01),Fy(g.y11,g.x11),!m),a.arc(0,0,u,Fy(g.cy+g.y11,g.cx+g.x11),Fy(_.cy+_.y11,_.cx+_.x11),m),a.arc(_.cx,_.cy,C,Fy(_.y11,_.x11),Fy(_.y01,_.x01),!m))):a.arc(0,0,u,x,b,m):a.lineTo(P,j)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Wy/2;return[Oy(i)*n,qy(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ry(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ry(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),l):r},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ry(+t),l):s},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ry(+t),l):o},l.context=function(t){return arguments.length?(a=null==t?null:t,l):a},l},t.area=hb,t.areaRadial=yb,t.ascending=e,t.autoType=function(t){for(var e in t){var n,i,r=t[e].trim();if(r)if("true"===r)r=!0;else if("false"===r)r=!1;else if("NaN"===r)r=NaN;else if(isNaN(n=+r)){if(!(i=r.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;Ha&&i[4]&&!i[7]&&(r=r.replace(/-/g,"/").replace(/T/," ")),r=new Date(r)}else r=n;else r=null;t[e]=r}return t},t.axisBottom=function(t){return vt(3,t)},t.axisLeft=function(t){return vt(4,t)},t.axisRight=function(t){return vt(2,t)},t.axisTop=function(t){return vt(1,t)},t.bin=U,t.bisect=l,t.bisectCenter=a,t.bisectLeft=o,t.bisectRight=s,t.bisector=n,t.blob=function(t,e){return fetch(t,e).then(Va)},t.brush=function(){return to(Vs)},t.brushSelection=function(t){var e=t.__brush;return e?e.dim.output(e.selection):null},t.brushX=function(){return to(Os)},t.brushY=function(){return to(Hs)},t.buffer=function(t,e){return fetch(t,e).then(qa)},t.chord=function(){return ho(!1,!1)},t.chordDirected=function(){return ho(!0,!1)},t.chordTranspose=function(){return ho(!1,!0)}
vendor: 9,300 bytes, line 718
718,t.cluster=function(){var t=ad,e=1,n=1,i=!1;function r(r){var s,o=0;r.eachAfter(function(e){var n=e.children;n?(e.x=function(t){return t.reduce(ld,0)/t.length}(n),e.y=function(t){return 1+t.reduce(cd,0)}(n)):(e.x=s?o+=t(e,s):0,e.y=0,s=e)});var a=function(t){for(var e;e=t.children;)t=e[0];return t}(r),l=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),c=a.x-t(a,l)/2,u=l.x+t(l,a)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-c)/(u-c)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},t.color=wn,t.contourDensity=function(){var t=Oo,e=Ho,n=Vo,i=960,r=500,s=20,o=2,a=3*s,l=i+2*a>>o,c=r+2*a>>o,u=No(20);function h(i){var r=new Float32Array(l*c),h=new Float32Array(l*c),d=Math.pow(2,-o);i.forEach(function(i,s,o){var u=(t(i,s,o)+a)*d,h=(e(i,s,o)+a)*d,f=+n(i,s,o);if(u>=0&&u<l&&h>=0&&h<c){var p=Math.floor(u),m=Math.floor(h),g=u-p-.5,_=h-m-.5;r[p+m*l]+=(1-g)*(1-_)*f,r[p+1+m*l]+=g*(1-_)*f,r[p+1+(m+1)*l]+=g*_*f,r[p+(m+1)*l]+=(1-g)*_*f}}),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o),Lo({width:l,height:c,data:r},{width:l,height:c,data:h},s>>o),Fo({width:l,height:c,data:h},{width:l,height:c,data:r},s>>o);var p=u(r);if(!Array.isArray(p)){var m=W(r);p=V(0,m,p),(p=nt(0,Math.floor(m/p)*p,p)).shift()}return Ro().thresholds(p).size([l,c])(r).map(f)}function f(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(m)}function m(t){t[0]=t[0]*Math.pow(2,o)-a,t[1]=t[1]*Math.pow(2,o)-a}function g(){return l=i+2*(a=3*s)>>o,c=r+2*a>>o,h}return h.x=function(e){return arguments.length?(t="function"==typeof e?e:No(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:No(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:No(+t),h):n},h.size=function(t){if(!arguments.length)return[i,r];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return i=e,r=n,g()},h.cellSize=function(t){if(!arguments.length)return 1<<o;if(!((t=+t)>=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},h.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?No(Do.call(t)):No(t),h):u},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(s*(s+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return s=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},h},t.contours=Ro,t.count=c,t.create=function(t){return Fe(Et(t).call(document.documentElement))},t.creator=Et,t.cross=function(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(f)).map(u),i=t.length-1,r=new Array(i+1).fill(0),s=[];if(i<0||n.some(h))return s;for(;;){s.push(r.map((e,n)=>t[n][e]));let o=i;for(;++r[o]===n[o];){if(0===o)return e?s.map(e):s;r[o--]=0}}},t.csv=Ya,t.csvFormat=Aa,t.csvFormatBody=Da,t.csvFormatRow=Na,t.csvFormatRows=Ea,t.csvFormatValue=za,t.csvParse=Ta,t.csvParseRows=Ca,t.cubehelix=ci,t.cumsum=function(t,e){var n=0,i=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:r=>n+=+e(r,i++,t)||0)},t.curveBasis=function(t){return new Yb(t)},t.curveBasisClosed=function(t){return new Xb(t)},t.curveBasisOpen=function(t){return new Jb(t)},t.curveBumpX=function(t){return new Gb(t,!0)},t.curveBumpY=function(t){return new Gb(t,!1)},t.curveBundle=Zb,t.curveCardinal=ex,t.curveCardinalClosed=ix,t.curveCardinalOpen=sx,t.curveCatmullRom=lx,t.curveCatmullRomClosed=ux,t.curveCatmullRomOpen=fx,t.curveLinear=ab,t.curveLinearClosed=function(t){return new dx(t)},t.curveMonotoneX=function(t){return new vx(t)},t.curveMonotoneY=function(t){return new yx(t)},t.curveNatural=function(t){return new xx(t)},t.curveStep=function(t){return new kx(t,.5)},t.curveStepAfter=function(t){return new kx(t,1)},t.curveStepBefore=function(t){return new kx(t,0)},t.descending=function(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN},t.deviation=p,t.difference=function(t,...e){t=new v(t);for(const n of e)for(const e of n)t["delete"](e);return t},t.disjoint=function(t,e){const n=e[Symbol.iterator](),i=new v;for(const e of t){if(i.has(e))return!1;let t,r;for(;({value:t,done:r}=n.next())&&!r;){if(Object.is(e,t))return!1;i.add(t)}}return!0},t.dispatch=bt,t.drag=function(){var t,e,n,i,r=Qe,s=tn,o=en,a=nn,l={},c=bt("start","drag","end"),u=0,h=0;function f(t){t.on("mousedown.drag",d).filter(a).on("touchstart.drag",g).on("touchmove.drag",_,Ue).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(o,a){if(!i&&r.call(this,o,a)){var l=y(this,s.call(this,o,a),o,a,"mouse");l&&(Fe(o.view).on("mousemove.drag",p,We).on("mouseup.drag",m,We),Je(o.view),Ye(o),n=!1,t=o.clientX,e=o.clientY,l("start",o))}}function p(i){if(Xe(i),!n){var r=i.clientX-t,s=i.clientY-e;n=r*r+s*s>h}l.mouse("drag",i)}function m(t){Fe(t.view).on("mousemove.drag mouseup.drag",null),Ge(t.view,n),Xe(t),l.mouse("end",t)}function g(t,e){if(r.call(this,t,e)){var n,i,o=t.changedTouches,a=s.call(this,t,e),l=o.length;for(n=0;n<l;++n)(i=y(this,a,t,e,o[n].identifier,o[n]))&&(Ye(t),i("start",t,o[n]))}}function _(t){var e,n,i=t.changedTouches,r=i.length;for(e=0;e<r;++e)(n=l[i[e].identifier])&&(Xe(t),n("drag",t,i[e]))}function v(t){var e,n,r=t.changedTouches,s=r.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),e=0;e<s;++e)(n=l[r[e].identifier])&&(Ye(t),n("end",t,r[e]))}function y(t,e,n,i,r,s){var a,h,d,p=c.copy(),m=Be(s||n,e);if(null!=(d=o.call(t,new Ze("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:p}),i)))return a=d.x-m[0]||0,h=d.y-m[1]||0,function g(n,s,o){var c,_=m;switch(n){case"start":l[r]=g,c=u++;break;case"end":delete l[r],--u;case"drag":m=Be(o||s,e),c=u}p.call(n,t,new Ze(n,{sourceEvent:s,subject:d,target:f,identifier:r,active:c,x:m[0]+a,y:m[1]+h,dx:m[0]-_[0],dy:m[1]-_[1],dispatch:p}),i)}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ke(!!t),f):r},f.container=function(t){return arguments.length?(s="function"==typeof t?t:Ke(t),f):s},f.subject=function(t){return arguments.length?(o="function"==typeof t?t:Ke(t),f):o},f.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Ke(!!t),f):a},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f},t.dragDisable=Je,t.dragEnable=Ge,t.dsv=function(t,e,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var r=Sa(t);return Ua(e,n).then(function(t){return r.parse(t,i)})},t.dsvFormat=Sa,t.easeBack=ys,t.easeBackIn=_s,t.easeBackInOut=ys,t.easeBackOut=vs,t.easeBounce=ms,t.easeBounceIn=function(t){return 1-ms(1-t)},t.easeBounceInOut=function(t){return((t*=2)<=1?1-ms(1-t):ms(t-1)+1)/2},t.easeBounceOut=ms,t.easeCircle=fs,t.easeCircleIn=function(t){return 1-Math.sqrt(1-t*t)},t.easeCircleInOut=fs,t.easeCircleOut=function(t){return Math.sqrt(1- --t*t)},t.easeCubic=is,t.easeCubicIn=function(t){return t*t*t},t.easeCubicInOut=is,t.easeCubicOut=function(t){return--t*t*t+1},t.easeElastic=ws,t.easeElasticIn=xs,t.easeElasticInOut=ks,t.easeElasticOut=ws,t.easeExp=hs,t.easeExpIn=function(t){return us(1-+t)},t.easeExpInOut=hs,t.easeExpOut=function(t){return 1-us(t)},t.easeLinear=(t=>+t),t.easePoly=os,t.easePolyIn=rs,t.easePolyInOut=os,t.easePolyOut=ss,t.easeQuad=ns,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=ns,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=cs,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*ls)},t.easeSinInOut=cs,t.easeSinOut=function(t){return Math.sin(t*ls)},t.every=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");let n=-1;for(const i of t)if(!e(i,++n,t))return!1;return!0},t.extent=m,t.fcumsum=function(t,e){const n=new g;let i=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):r=>n.add(+e(r,++i,t)||0))},t.filter=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");const n=[];let i=-1;for(const r of t)e(r,++i,t)&&n.push(r);return n},t.flatGroup=function(t,...e){return T(M(t,...e),e)},t.flatRollup=function(t,e,...n){return T(A(t,e,...n),n)},t.forceCenter=function(t,e){var n,i=1;function r(){var r,s,o=n.length,a=0,l=0;for(r=0;r<o;++r)a+=(s=n[r]).x,l+=s.y;for(a=(a/o-t)*i,l=(l/o-e)*i,r=0;r<o;++r)(s=n[r]).x-=a,s.y-=l}return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.strength=function(t){return arguments.length?(i=+t,r):i},r},t.forceCollide=function(t){var e,n,i,r=1,s=1;function o(){for(var t,o,l,c,u,h,f,d=e.length,p=0;p<s;++p)for(o=rl(e,ul,hl).visitAfter(a),t=0;t<d;++t)l=e[t],h=n[l.index],f=h*h,c=l.x+l.vx,u=l.y+l.vy,o.visit(m);function m(t,e,n,s,o){var a=t.data,d=t.r,p=h+d;if(!a)return e>c+p||s<c-p||n>u+p||o<u-p;if(a.index>l.index){var m=c-a.x-a.vx,g=u-a.y-a.vy,_=m*m+g*g;
vendor: 5,567 bytes, lines 718-719
718_<p*p&&(0===m&&(_+=(m=cl(i))*m),0===g&&(_+=(g=cl(i))*g),_=(p-(_=Math.sqrt(_)))/_*r,l.vx+=(m*=_)*(p=(d*=d)/(f+d)),l.vy+=(g*=_)*p,a.vx-=m*(p=1-p),a.vy-=g*p)}}}function a(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var i,r,s=e.length;for(n=new Array(s),i=0;i<s;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!=typeof t&&(t=ll(null==t?1:+t)),o.initialize=function(t,n){e=t,i=n,l()},o.iterations=function(t){return arguments.length?(s=+t,o):s},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),l(),o):t},o},t.forceLink=function(t){var e,n,i,r,s,o,a=fl,l=function(t){return 1/Math.min(r[t.source.index],r[t.target.index])},c=ll(30),u=1;function h(i){for(var r=0,a=t.length;r<u;++r)for(var l,c,h,f,d,p,m,g=0;g<a;++g)c=(l=t[g]).source,f=(h=l.target).x+h.vx-c.x-c.vx||cl(o),d=h.y+h.vy-c.y-c.vy||cl(o),f*=p=((p=Math.sqrt(f*f+d*d))-n[g])/p*i*e[g],d*=p,h.vx-=f*(m=s[g]),h.vy-=d*m,c.vx+=f*(m=1-m),c.vy+=d*m}function f(){if(i){var o,l,c=i.length,u=t.length,h=new Map(i.map((t,e)=>[a(t,e,i),t]));for(o=0,r=new Array(c);o<u;++o)(l=t[o]).index=o,"object"!=typeof l.source&&(l.source=dl(h,l.source)),"object"!=typeof l.target&&(l.target=dl(h,l.target)),r[l.source.index]=(r[l.source.index]||0)+1,r[l.target.index]=(r[l.target.index]||0)+1;for(o=0,s=new Array(u);o<u;++o)l=t[o],s[o]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(i)for(var n=0,r=t.length;n<r;++n)e[n]=+l(t[n],n,t)}function p(){if(i)for(var e=0,r=t.length;e<r;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){i=t,o=e,f()},h.links=function(e){return arguments.length?(t=e,f(),h):t},h.id=function(t){return arguments.length?(a=t,h):a},h.iterations=function(t){return arguments.length?(u=+t,h):u},h.strength=function(t){return arguments.length?(l="function"==typeof t?t:ll(+t),d(),h):l},h.distance=function(t){return arguments.length?(c="function"==typeof t?t:ll(+t),p(),h):c},h},t.forceManyBody=function(){
719var t,e,n,i,r,s=ll(-30),o=1,a=1/0,l=.81;function c(n){var r,s=t.length,o=rl(t,ml,gl).visitAfter(h);for(i=n,r=0;r<s;++r)e=t[r],o.visit(f)}function u(){if(t){var e,n,i=t.length;for(r=new Array(i),e=0;e<i;++e)n=t[e],r[n.index]=+s(n,e,t)}}function h(t){var e,n,i,s,o,a=0,l=0;if(t.length){for(i=s=o=0;o<4;++o)(e=t[o])&&(n=Math.abs(e.value))&&(a+=e.value,l+=n,i+=n*e.x,s+=n*e.y);t.x=i/l,t.y=s/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{a+=r[e.data.index]}while(e=e.next)}t.value=a}function f(t,s,c,u){if(!t.value)return!0;var h=t.x-e.x,f=t.y-e.y,d=u-s,p=h*h+f*f;if(d*d/l<p)return p<a&&(0===h&&(p+=(h=cl(n))*h),0===f&&(p+=(f=cl(n))*f),p<o&&(p=Math.sqrt(o*p)),e.vx+=h*t.value*i/p,e.vy+=f*t.value*i/p),!0;if(!(t.length||p>=a)){(t.data!==e||t.next)&&(0===h&&(p+=(h=cl(n))*h),0===f&&(p+=(f=cl(n))*f),p<o&&(p=Math.sqrt(o*p)));do{t.data!==e&&(d=r[t.data.index]*i/p,e.vx+=h*d,e.vy+=f*d)}while(t=t.next)}}return c.initialize=function(e,i){t=e,n=i,u()},c.strength=function(t){return arguments.length?(s="function"==typeof t?t:ll(+t),u(),c):s},c.distanceMin=function(t){return arguments.length?(o=t*t,c):Math.sqrt(o)},c.distanceMax=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c},t.forceRadial=function(t,e,n){var i,r,s,o=ll(.1);function a(t){for(var o=0,a=i.length;o<a;++o){var l=i[o],c=l.x-e||1e-6,u=l.y-n||1e-6,h=Math.sqrt(c*c+u*u),f=(s[o]-h)*r[o]*t/h;l.vx+=c*f,l.vy+=u*f}}function l(){if(i){var e,n=i.length;for(r=new Array(n),s=new Array(n),e=0;e<n;++e)s[e]=+t(i[e],e,i),r[e]=isNaN(s[e])?0:+o(i[e],e,i)}}return"function"!=typeof t&&(t=ll(+t)),null==e&&(e=0),null==n&&(n=0),a.initialize=function(t){i=t,l()},a.strength=function(t){return arguments.length?(o="function"==typeof t?t:ll(+t),l(),a):o},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),l(),a):t},a.x=function(t){return arguments.length?(e=+t,a):e},a.y=function(t){return arguments.length?(n=+t,a):n},a},t.forceSimulation=function(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=fr(h),c=bt("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%pl)/pl}();function h(){f(),c.call("tick",e),n<i&&(l.stop(),c.call("end",e))}function f(i){var l,c,u=t.length;void 0===i&&(i=1);for(var h=0;h<i;++h)for(n+=(s-n)*r,a.forEach(function(t){t(n)}),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=10*Math.sqrt(.5+n),s=n*_l;e.x=r*Math.cos(s),e.y=r*Math.sin(s)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),a.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(s=+t,e):s},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,a.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?a["delete"](t):a.set(t,p(n)),e):a.get(t)},find:function(e,n,i){var r,s,o,a,l,c=0,u=t.length;for(null==i?i=1/0:i*=i,c=0;c<u;
vendor: 4,116 bytes, line 719
719++c)(o=(r=e-(a=t[c]).x)*r+(s=n-a.y)*s)<i&&(l=a,i=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}},t.forceX=function(t){var e,n,i,r=ll(.1);function s(t){for(var r,s=0,o=e.length;s<o;++s)(r=e[s]).vx+=(i[s]-r.x)*n[s]*t}function o(){if(e){var s,o=e.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+t(e[s],s,e))?0:+r(e[s],s,e)}}return"function"!=typeof t&&(t=ll(null==t?0:+t)),s.initialize=function(t){e=t,o()},s.strength=function(t){return arguments.length?(r="function"==typeof t?t:ll(+t),o(),s):r},s.x=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),o(),s):t},s},t.forceY=function(t){var e,n,i,r=ll(.1);function s(t){for(var r,s=0,o=e.length;s<o;++s)(r=e[s]).vy+=(i[s]-r.y)*n[s]*t}function o(){if(e){var s,o=e.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+t(e[s],s,e))?0:+r(e[s],s,e)}}return"function"!=typeof t&&(t=ll(null==t?0:+t)),s.initialize=function(t){e=t,o()},s.strength=function(t){return arguments.length?(r="function"==typeof t?t:ll(+t),o(),s):r},s.y=function(e){return arguments.length?(t="function"==typeof e?e:ll(+e),o(),s):t},s},t.formatDefaultLocale=Nl,t.formatLocale=El,t.formatSpecifier=wl,t.fsum=function(t,e){const n=new g;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&n.add(r)}return+n},t.geoAlbers=Ff,t.geoAlbersUsa=function(){var t,e,n,i,r,s,o=Ff(),a=Lf().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=Lf().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,e){s=[t,e]}};function u(t){var e=t[0],o=t[1];return s=null,n.point(e,o),s||(i.point(e,o),s)||(r.point(e,o),s)}function h(){return t=e=null,u}return u.invert=function(t){var e=o.scale(),n=o.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:o).invert(t)},u.stream=function(n){return t&&e===n?t:(i=[o.stream(e=n),a.stream(n),l.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n<r;)i[n].point(t,e)},sphere:function(){for(var t=-1;++t<r;)i[t].sphere()},lineStart:function(){for(var t=-1;++t<r;)i[t].lineStart()},lineEnd:function(){for(var t=-1;++t<r;)i[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<r;)i[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<r;)i[t].polygonEnd()}});var i,r},u.precision=function(t){return arguments.length?(o.precision(t),a.precision(t),l.precision(t),h()):o.precision()},u.scale=function(t){return arguments.length?(o.scale(t),a.scale(.35*t),l.scale(t),u.translate(o.translate())):o.scale()},u.translate=function(t){if(!arguments.length)return o.translate();var e=o.scale(),s=+t[0],u=+t[1];return n=o.translate(t).clipExtent([[s-.455*e,u-.238*e],[s+.455*e,u+.238*e]]).stream(c),i=a.translate([s-.307*e,u+.201*e]).clipExtent([[s-.425*e+Il,u+.12*e+Il],[s-.214*e-Il,u+.234*e-Il]]).stream(c),r=l.translate([s-.205*e,u+.212*e]).clipExtent([[s-.214*e+Il,u+.166*e+Il],[s-.115*e-Il,u+.234*e-Il]]).stream(c),h()},u.fitExtent=function(t,e){return Tf(u,t,e)},u.fitSize=function(t,e){return Cf(u,t,e)},u.fitWidth=function(t,e){return Af(u,t,e)},u.fitHeight=function(t,e){return Df(u,t,e)},u.scale(1070)},t.geoArea=function(t){return Dc=new g,hc(t,Ec),2*Dc},t.geoAzimuthalEqualArea=function(){return jf(Vf).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=Vf,t.geoAzimuthalEquidistant=function(){return jf(qf).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=qf,t.geoBounds=function(t){var e,n,i,r,s,o,a;if(bc=yc=-(_c=vc=1/0),Tc=[],hc(t,ru),n=Tc.length){for(Tc.sort(du),e=1,s=[i=Tc[0]];e<n;++e)pu(i,(r=Tc[e])[0])||pu(i,r[1])?(fu(i[0],r[1])>fu(i[0],i[1])&&(i[1]=r[1]),fu(r[0],i[1])>fu(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,e=0,i=s[n=s.length-1];e<=n;i=r,++e)r=s[e],(a=fu(i[1],r[0]))>o&&(o=a,_c=r[0],yc=i[1])}return Tc=Cc=null,_c===1/0||vc===1/0?[[NaN,NaN],[NaN,NaN]]:[[_c,vc],[yc,bc]]},t.geoCentroid=function(t){Vc=qc=Bc=Uc=Wc=Yc=Xc=Jc=0,Gc=new g,Kc=new g,Zc=new g,hc(t,mu);var e=+Gc,n=+Kc,i=+Zc,r=Jl(e,n,i);return r<$l&&(e=Yc,n=Xc,i=Jc,qc<Il&&(e=Bc,n=Uc,i=Wc),(r=Jl(e,n,i))<$l)?[NaN,NaN]:[Ul(n,e)*Hl,ic(i/r)*Hl]}
vendor: 4,358 bytes, line 719
719,t.geoCircle=function(){var t,e,n=Tu([0,0]),i=Tu(90),r=Tu(6),s={point:function(n,i){t.push(n=e(n,i)),n[0]*=Hl,n[1]*=Hl}};function o(){var o=n.apply(this,arguments),a=i.apply(this,arguments)*Vl,l=r.apply(this,arguments)*Vl;return t=[],e=Du(-o[0]*Vl,-o[1]*Vl,0).invert,ju(s,a,l,1),o={type:"Polygon",coordinates:[t]},t=e=null,o}return o.center=function(t){return arguments.length?(n="function"==typeof t?t:Tu([+t[0],+t[1]]),o):n},o.radius=function(t){return arguments.length?(i="function"==typeof t?t:Tu(+t),o):i},o.precision=function(t){return arguments.length?(r="function"==typeof t?t:Tu(+t),o):r},o},t.geoClipAntimeridian=Wu,t.geoClipCircle=Yu,t.geoClipExtent=function(){var t,e,n,i=0,r=0,s=960,o=500;return n={stream:function(n){return t&&e===n?t:t=th(i,r,s,o)(e=n)},extent:function(a){return arguments.length?(i=+a[0][0],r=+a[0][1],s=+a[1][0],o=+a[1][1],t=e=null,n):[[i,r],[s,o]]}}},t.geoClipRectangle=th,t.geoConicConformal=function(){return $f(Yf).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=Yf,t.geoConicEqualArea=Lf,t.geoConicEqualAreaRaw=Rf,t.geoConicEquidistant=function(){return $f(Jf).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=Jf,t.geoContains=function(t,e){return(t&&ch.hasOwnProperty(t.type)?ch[t.type]:hh)(t,e)},t.geoDistance=lh,t.geoEqualEarth=function(){return jf(ed).scale(177.158)},t.geoEqualEarthRaw=ed,t.geoEquirectangular=function(){return jf(Xf).scale(152.63)},t.geoEquirectangularRaw=Xf,t.geoGnomonic=function(){return jf(nd).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=nd,t.geoGraticule=yh,t.geoGraticule10=function(){return yh()()},t.geoIdentity=function(){var t,e,n,i,r,s,o,a=1,l=0,c=0,u=1,h=1,f=0,d=null,p=1,m=1,g=kf({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),_=Sh;function v(){return p=a*u,m=a*h,s=o=null,y}function y(n){var i=n[0]*p,r=n[1]*m;if(f){var s=r*t-i*e;i=i*t+r*e,r=s}return[i+l,r+c]}return y.invert=function(n){var i=n[0]-l,r=n[1]-c;if(f){var s=r*t+i*e;i=i*t-r*e,r=s}return[i/p,r/m]},y.stream=function(t){return s&&o===t?s:s=g(_(o=t))},y.postclip=function(t){return arguments.length?(_=t,d=n=i=r=null,v()):_},y.clipExtent=function(t){return arguments.length?(_=null==t?(d=n=i=r=null,Sh):th(d=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),v()):null==d?null:[[d,n],[i,r]]},y.scale=function(t){return arguments.length?(a=+t,v()):a},y.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],v()):[l,c]},y.angle=function(n){return arguments.length?(e=Zl(f=n%360*Vl),t=Wl(f),v()):f*Hl},y.reflectX=function(t){return arguments.length?(u=t?-1:1,v()):u<0},y.reflectY=function(t){return arguments.length?(h=t?-1:1,v()):h<0},y.fitExtent=function(t,e){return Tf(y,t,e)},y.fitSize=function(t,e){return Cf(y,t,e)},y.fitWidth=function(t,e){return Af(y,t,e)},y.fitHeight=function(t,e){return Df(y,t,e)},y},t.geoInterpolate=function(t,e){var n=t[0]*Vl,i=t[1]*Vl,r=e[0]*Vl,s=e[1]*Vl,o=Wl(i),a=Zl(i),l=Wl(s),c=Zl(s),u=o*Wl(n),h=o*Zl(n),f=l*Wl(r),d=l*Zl(r),p=2*ic(tc(rc(s-i)+o*l*rc(r-n))),m=Zl(p),g=p?function(t){var e=Zl(t*=p)/m,n=Zl(p-t)/m,i=n*u+e*f,r=n*h+e*d,s=n*a+e*c;return[Ul(r,i)*Hl,Ul(s,tc(i*i+r*r))*Hl]}:function(){return[n*Hl,i*Hl]};return g.distance=p,g},t.geoLength=sh,t.geoMercator=function(){return Uf(Bf).scale(961/Ol)},t.geoMercatorRaw=Bf,t.geoNaturalEarth1=function(){return jf(id).scale(175.295)},t.geoNaturalEarth1Raw=id,t.geoOrthographic=function(){return jf(rd).scale(249.5).clipAngle(90.000001)},t.geoOrthographicRaw=rd,t.geoPath=function(t,e){var n,i,r=4.5;function s(t){return t&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),hc(t,n(i))),i.result()}return s.area=function(t){return hc(t,n(zh)),zh.result()},s.measure=function(t){return hc(t,n(bf)),bf.result()},s.bounds=function(t){return hc(t,n(Vh)),Vh.result()},s.centroid=function(t){return hc(t,n(cf)),cf.result()},s.projection=function(e){return arguments.length?(n=null==e?(t=null,Sh):(t=e).stream,s):t},s.context=function(t){return arguments.length?(i=null==t?(e=null,new xf):new uf(e=t),"function"!=typeof r&&i.pointRadius(r),s):e},s.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(i.pointRadius(+t),+t),s):r},s.projection(t).context(e)},t.geoProjection=jf,t.geoProjectionMutator=If,t.geoRotation=Pu,t.geoStereographic=function(){return jf(sd).scale(250).clipAngle(142)},t.geoStereographicRaw=sd,t.geoStream=hc,t.geoTransform=function(t){return{stream
vendor: 18,761 bytes, line 719
719:kf(t)}},t.geoTransverseMercator=function(){var t=Uf(od),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=od,t.gray=function(t,e){return new Un(t,0,0,null==e?1:e)},t.greatest=function(t,n=e){let i,r=!1;if(1===n.length){let s;for(const o of t){const t=n(o);(r?e(t,s)>0:0===e(t,t))&&(i=o,s=t,r=!0)}}else for(const e of t)(r?n(e,i)>0:0===n(e,e))&&(i=e,r=!0);return i},t.greatestIndex=function(t,n=e){if(1===n.length)return Z(t,n);let i,r=-1,s=-1;for(const e of t)++s,(r<0?0===n(e,e):n(e,i)>0)&&(i=e,r=s);return r},t.group=S,t.groupSort=function(t,n,i){return(2!==n.length?z(C(t,n,i),([t,n],[i,r])=>e(n,r)||e(t,i)):z(S(t,i),([t,i],[r,s])=>n(i,s)||e(t,r))).map(([t])=>t)},t.groups=M,t.hcl=Kn,t.hierarchy=hd,t.histogram=U,t.hsl=Pn,t.html=Za,t.image=function(t,e){return new Promise(function(n,i){var r=new Image;for(var s in e)r[s]=e[s];r.onerror=i,r.onload=function(){n(r)},r.src=t})},t.index=function(t,...e){return E(t,k,D,e)},t.indexes=function(t,...e){return E(t,Array.from,D,e)},t.interpolate=zi,t.interpolateArray=function(t,e){return(Si(e)?ki:Mi)(t,e)},t.interpolateBasis=fi,t.interpolateBasisClosed=di,t.interpolateBlues=py,t.interpolateBrBG=Tv,t.interpolateBuGn=Bv,t.interpolateBuPu=Wv,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=Cy,t.interpolateCubehelix=Gi,t.interpolateCubehelixDefault=My,t.interpolateCubehelixLong=Ki,t.interpolateDate=Ti,t.interpolateDiscrete=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},t.interpolateGnBu=Xv,t.interpolateGreens=gy,t.interpolateGreys=vy,t.interpolateHcl=Yi,t.interpolateHclLong=Xi,t.interpolateHsl=Bi,t.interpolateHslLong=Ui,t.interpolateHue=function(t,e){var n=gi(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},t.interpolateInferno=Iy,t.interpolateLab=function(t,e){var n=vi((t=Bn(t)).l,(e=Bn(e)).l),i=vi(t.a,e.a),r=vi(t.b,e.b),s=vi(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=s(e),t+""}},t.interpolateMagma=jy,t.interpolateNumber=Ci,t.interpolateNumberArray=ki,t.interpolateObject=Ai,t.interpolateOrRd=Gv,t.interpolateOranges=Sy,t.interpolatePRGn=Av,t.interpolatePiYG=Ev,t.interpolatePlasma=$y,t.interpolatePuBu=ty,t.interpolatePuBuGn=Zv,t.interpolatePuOr=zv,t.interpolatePuRd=ny,t.interpolatePurples=by,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Ay.h=360*t-100,Ay.s=1.5-1.5*e,Ay.l=.8-.9*e,Ay+""},t.interpolateRdBu=jv,t.interpolateRdGy=$v,t.interpolateRdPu=ry,t.interpolateRdYlBu=Lv,t.interpolateRdYlGn=Ov,t.interpolateReds=wy,t.interpolateRgb=yi,t.interpolateRgbBasis=xi,t.interpolateRgbBasisClosed=wi,t.interpolateRound=Pi,t.interpolateSinebow=function(t){var e;return t=(.5-t)*Math.PI,Dy.r=255*(e=Math.sin(t))*e,Dy.g=255*(e=Math.sin(t+Ey))*e,Dy.b=255*(e=Math.sin(t+Ny))*e,Dy+""},t.interpolateSpectral=Vv,t.interpolateString=Ni,t.interpolateTransformCss=Fi,t.interpolateTransformSvg=Oi,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Py,t.interpolateWarm=Ty,t.interpolateYlGn=ly,t.interpolateYlGnBu=oy,t.interpolateYlOrBr=uy,t.interpolateYlOrRd=fy,t.interpolateZoom=Vi,t.interrupt=Sr,t.intersection=function(t,...e){t=new v(t),e=e.map(lt);t:for(const n of t)for(const i of e)if(!i.has(n)){t["delete"](n);continue t}return t},t.interval=function(t,e,n){var i=new hr,r=e;return null==e?(i.restart(t,e,n),i):(i._restart=i.restart,i.restart=function(t,e,n){e=+e,n=null==n?cr():+n,i._restart(function s(o){o+=r,i._restart(s,r+=e,n),t(o)},e,n)},i.restart(t,e,n),i)},t.isoFormat=nv,t.isoParse=rv,t.json=function(t,e){return fetch(t,e).then(Ja)},t.lab=Bn,t.lch=function(t,e,n,i){return 1===arguments.length?Gn(t):new Zn(n,e,t,null==i?1:i)},t.least=function(t,n=e){let i,r=!1;if(1===n.length){let s;for(const o of t){const t=n(o);(r?e(t,s)<0:0===e(t,t))&&(i=o,s=t,r=!0)}}else for(const e of t)(r?n(e,i)<0:0===n(e,e))&&(i=e,r=!0);return i},t.leastIndex=it,t.line=ub,t.lineRadial=vb,t.linkHorizontal=function(){return kb(Sb)},t.linkRadial=function(){var t=kb(Tb);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return kb(Mb)},t.local=He,t.map=function(t,e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof e)throw new TypeError("mapper is not a function");return Array.from(t,(n,i)=>e(n,i,t))},t.matcher=$t,t.max=W,t.maxIndex=Z,t.mean=function(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n},t.median=function(t,e){return G(t,.5,e)},t.merge=Q,t.min=Y,t.minIndex=tt,t.mode=function(t,e){const n=new _;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&r>=r&&n.set(r,(n.get(r)||0)+1)}let i,r=0;for(const[t,e]of n)e>r&&(r=e,i=t);return i},t.namespace=Ct,t.namespaces=Tt,t.nice=q,t.now=cr,t.pack=function(){var t=null,e=1,n=1,i=zd;function r(r){return r.x=e/2,r.y=n/2,t?r.eachBefore(Id(t)).eachAfter($d(i,.5)).eachBefore(Rd(1)):r.eachBefore(Id(jd)).eachAfter($d(zd,1)).eachAfter($d(i,r.r/Math.min(e,n))).eachBefore(Rd(Math.min(e,n)/(2*r.r))),r}return r.radius=function(e){return arguments.length?(t=Ed(e),r):t},r.size=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.padding=function(t){return arguments.length?(i="function"==typeof t?t:Pd(+t),r):i},r},t.packEnclose=_d,t.packSiblings=function(t){return Dd(t),t},t.pairs=function(t,e=et){const n=[];let i,r=!1;for(const s of t)r&&n.push(e(i,s)),i=s,r=!0;return n},t.partition=function(){var t=1,e=1,n=0,i=!1;function r(r){var s=r.height+1;return r.x0=r.y0=n,r.x1=t,r.y1=e/s,r.eachBefore(function(t,e){return function(i){i.children&&Fd(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var r=i.x0,s=i.y0,o=i.x1-n,a=i.y1-n;o<r&&(r=o=(r+o)/2),a<s&&(s=a=(s+a)/2),i.x0=r,i.y0=s,i.x1=o,i.y1=a}}(e,s)),i&&r.eachBefore(Ld),r}return r.round=function(t){return arguments.length?(i=!!t,r):i},r.size=function(n){return arguments.length?(t=+n[0],e=+n[1],r):[t,e]},r.padding=function(t){return arguments.length?(n=+t,r):n},r},t.path=vo,t.permute=N,t.pie=function(){var t=db,e=fb,n=null,i=Ry(0),r=Ry(Xy),s=Ry(0);function o(o){var a,l,c,u,h,f=(o=sb(o)).length,d=0,p=new Array(f),m=new Array(f),g=+i.apply(this,arguments),_=Math.min(Xy,Math.max(-Xy,r.apply(this,arguments)-g)),v=Math.min(Math.abs(_)/f,s.apply(this,arguments)),y=v*(_<0?-1:1);for(a=0;a<f;++a)(h=m[p[a]=a]=+t(o[a],a,o))>0&&(d+=h);for(null!=e?p.sort(function(t,n){return e(m[t],m[n])}):null!=n&&p.sort(function(t,e){return n(o[t],o[e])}),a=0,c=d?(_-f*y)/d:0;a<f;++a,g=u)l=p[a],u=g+((h=m[l])>0?h*c:0)+y,m[l]={data:o[l],index:a,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:Ry(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),o):i},o.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ry(+t),o):r},o.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Ry(+t),o):s},o},t.piecewise=Zi,t.pointRadial=bb,t.pointer=Be,t.pointers=function(t,e){return t.target&&(t=qe(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,t=>Be(t,e))},t.polygonArea=function(t){for(var e,n=-1,i=t.length,r=t[i-1],s=0;++n<i;)e=r,r=t[n],s+=e[1]*r[0]-e[0]*r[1];return s/2},t.polygonCentroid=function(t){for(var e,n,i=-1,r=t.length,s=0,o=0,a=t[r-1],l=0;++i<r;)e=a,a=t[i],l+=n=e[0]*a[1]-a[0]*e[1],s+=(e[0]+a[0])*n,o+=(e[1]+a[1])*n;return[s/(l*=3),o/l]},t.polygonContains=function(t,e){for(var n,i,r=t.length,s=t[r-1],o=e[0],a=e[1],l=s[0],c=s[1],u=!1,h=0;h<r;++h)n=(s=t[h])[0],(i=s[1])>a!=c>a&&o<(l-n)*(a-i)/(c-i)+n&&(u=!u),l=n,c=i;return u},t.polygonHull=function(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),r=new Array(n);for(e=0;e<n;++e)i[e]=[+t[e][0],+t[e][1],e];for(i.sort(np),e=0;e<n;++e)r[e]=[i[e][0],-i[e][1]];var s=ip(i),o=ip(r),a=o[0]===s[0],l=o[o.length-1]===s[s.length-1],c=[];for(e=s.length-1;e>=0;--e)c.push(t[i[s[e]][2]]);for(e=+a;e<o.length-l;++e)c.push(t[i[o[e]][2]]);return c},t.polygonLength=function(t){for(var e,n,i=-1,r=t.length,s=t[r-1],o=s[0],a=s[1],l=0;++i<r;)e=o,n=a,e-=o=(s=t[i])[0],n-=a=s[1],l+=Math.hypot(e,n);return l},t.precisionFixed=zl,t.precisionPrefix=Pl,t.precisionRound=jl,t.quadtree=rl,t.quantile=G,t.quantileSorted=K,t.quantize=function(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t(i/(e-1));return n},t.quickselect=X,t.radialArea=yb,t.radialLine=vb,t.randomBates=up,t.randomBernoulli=dp,t.randomBeta=gp,t.randomBinomial=_p,t.randomCauchy=yp,t.randomExponential=hp,t.randomGamma=mp,t.randomGeometric=pp,t.randomInt=op,t.randomIrwinHall=cp,t.randomLcg=function(t=Math.random()){let e=0|(0<=t&&t<1?t/wp:Math.abs(t));return()=>(e=1664525*e+1013904223|0,wp*(e>>>0))},t.randomLogNormal=lp,t.randomLogistic=bp,t.randomNormal=ap,t.randomPareto=fp,t.randomPoisson=xp,t.randomUniform=sp,t.randomWeibull=vp,t.range=nt,t.rank=function(t,n=e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let i=Array.from(t);const r=new Float64Array(i.length);2!==n.length&&(i=i.map(n),n=e);const s=(t,e)=>n(i[t],i[e]);let o,a;return Uint32Array.from(i,(t,e)=>e).sort(n===e?(t,e)=>j(i[t],i[e]):P(s)).forEach((t,e)=>{const n=s(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN}),r},t.reduce=function(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const i=t[Symbol.iterator]();let r,s,o=-1;if(arguments.length<3){if(({done:r,value:n}=i.next()),r)return;++o}for(;({done:r,value:s}=i.next()),!r;)n=e(n,s,++o,t);return n},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Tn,t.ribbon=function(){return Ao()},t.ribbonArrow=function(){return Ao(Co)},t.rollup=C,t.rollups=A,t.scaleBand=Cp,t.scaleDiverging=function Aw(){var t=Fp(hv()(Np));return t.copy=function(){return cv(t,Aw())},Sp.apply(t,arguments)},t.scaleDivergingLog=function Dw(){var t=Yp(hv()).domain([.1,1,10]);return t.copy=function(){return cv(t,Dw()).base(t.base())},Sp.apply(t,arguments)},t.scaleDivergingPow=fv,t.scaleDivergingSqrt=function(){return fv.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function Ew(){var t=Gp(hv());return t.copy=function(){return cv(t,Ew()).constant(t.constant())},Sp.apply(t,arguments)},t.scaleIdentity=function Nw(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,Dp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return Nw(t).unknown(e)},t=arguments.length?Array.from(t,Dp):[0,1],Fp(n)},t.scaleImplicit=Mp,t.scaleLinear=function zw(){var t=Rp();return t.copy=function(){return Ip(t,zw())},kp.apply(t,arguments),Fp(t)},t.scaleLog=function Pw(){const t=Yp($p()).domain([1,10]);return t.copy=(()=>Ip(t,Pw()).base(t.base())),kp.apply(t,arguments),t},t.scaleOrdinal=Tp,t.scalePoint=function(){return Ap(Cp.apply(null,arguments).paddingInner(1))},t.scalePow=em,t.scaleQuantile=function jw(){var t,n=[],i=[],r=[];function s(){var t=0,e=Math.max(1,i.length);for(r=new Array(e-1);++t<e;)r[t-1]=K(n,t/e);return o}function o(e){return null==e||isNaN(e=+e)?t:i[l(r,e)]}return o.invertExtent=function(t){var e=i.indexOf(t);return e<0?[NaN,NaN]:[e>0?r[e-1]:n[0],e<r.length?r[e]:n[n.length-1]]},o.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(e),s()},o.range=function(t){return arguments.length?(i=Array.from(t),s()):i.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return jw().domain(n).range(i).unknown(t)},kp.apply(o,arguments)},t.scaleQuantize=function Iw(){var t,e=0,n=1,i=1,r=[.5],s=[0,1];function o(e){return null!=e&&e<=e?s[l(r,e,0,i)]:t}function a(){var t=-1;for(r=new Array(i);++t<i;)r[t]=((t+1)*n-(t-i)*e)/(i+1);return o}return o.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,a()):[e,n]},o.range=function(t){return arguments.length?(i=(s=Array.from(t)).length-1,a()):s.slice()},o.invertExtent=function(t){var o=s.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=i?[r[i-1],n]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return r.slice()},o.copy=function(){return Iw().domain([e,n]).range(s).unknown(t)},kp.apply(Fp(o),arguments)},t.scaleRadial=function $w(){var t,e=Rp(),n=[0,1],i=!1;function r(n){var r=im(e(n));return isNaN(r)?t:i?Math.round(r):r}return r.invert=function(t){return e.invert(nm(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((n=Array.from(t,Dp)).map(nm)),r):n.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(i=!!t,r):i},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return $w(e.domain(),n).round(i).clamp(e.clamp()).unknown(t)},kp.apply(r,arguments),Fp(r)},t.scaleSequential=function Rw(){var t=Fp(lv()(Np));return t.copy=function(){return cv(t,Rw())},Sp.apply(t,arguments)},t.scaleSequentialLog=function Lw(){var t=Yp(lv()).domain([1,10]);return t.copy=function(){return cv(t,Lw()).base(t.base())},Sp.apply(t,arguments)},t.scaleSequentialPow=uv,t.scaleSequentialQuantile=function Fw(){var t=[],n=Np;function i(e){if(null!=e&&!isNaN(e=+e))return n((l(t,e,1)-1)/(t.length-1))}return i.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let e of n)null==e||isNaN(e=+e)||t.push(e);return t.sort(e),i},i.interpolator=function(t){return arguments.length?(n=t,i):n},i.range=function(){return t.map((e,i)=>n(i/(t.length-1)))},i.quantiles=function(e){return Array.from({length:e+1},(n,i)=>G(t,i/e))},i.copy=function(){return Fw(n).domain(t)},Sp.apply(i,arguments)},t.scaleSequentialSqrt=function(){return uv.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function Ow(){var t=Gp(lv());return t.copy=function(){return cv(t,Ow()).constant(t.constant())},Sp.apply(t,arguments)},t.scaleSqrt=function(){return em.apply(null,arguments).exponent(.5)},t.scaleSymlog=function Hw(){var t=Gp($p());return t.copy=function(){return Ip(t,Hw()).constant(t.constant())},kp.apply(t,arguments)},t.scaleThreshold=function Vw(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[l(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Vw().domain(e).range(n).unknown(t)},kp.apply(r,arguments)},t.scaleTime=function(){return kp.apply(av(Dg,Eg,Xm,Um,Em,Cm,Sm,xm,vm,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return kp.apply(av(Cg,Ag,Sg,xg,og,ig,tg,Km,vm,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,e){const n=it(t,e);return n<0?void 0:n},t.schemeAccent=mv,t.schemeBlues=dy,t.schemeBrBG=Mv,t.schemeBuGn=qv,t.schemeBuPu=Uv,t.schemeCategory10=pv,t.schemeDark2=gv,t.schemeGnBu=Yv,t.schemeGreens=my,t.schemeGreys=_y,t.schemeOrRd=Jv,t.schemeOranges=ky,t.schemePRGn=Cv,t.schemePaired=_v,t.schemePastel1=vv,t.schemePastel2=yv,t.schemePiYG=Dv,t.schemePuBu=Qv,t.schemePuBuGn=Kv,t.schemePuOr=Nv,t.schemePuRd=ey,t.schemePurples=yy,t.schemeRdBu=Pv,t.schemeRdGy=Iv,t.schemeRdPu=iy,t.schemeRdYlBu=Rv,t.schemeRdYlGn=Fv,t.schemeReds=xy,t.schemeSet1=bv,t.schemeSet2=xv,t.schemeSet3=wv,t.schemeSpectral=Hv,t.schemeTableau10=kv,t.schemeYlGn=ay,t.schemeYlGnBu=sy,t.schemeYlOrBr=cy,t.schemeYlOrRd=hy,t.select=Fe,t.selectAll=function(t){return"string"==typeof t?new Re([document.querySelectorAll(t)],[document.documentElement]):new Re([Pt(t)],$e)},t.selection=Le,t.selector=zt,t.selectorAll=It,t.shuffle=rt,t.shuffler=st,t.some=function(t,e){if("function"!=typeof e)throw new TypeError("test is not a function");let n=-1;for(const i of t)if(e(i,++n,t))return!0;return!1},t.sort=z,t.stack=function(){var t=Ry([]),e=Mx,n=Sx,i=Tx;function r(r){var s,o,a=Array.from(t.apply(this,arguments),Cx),l=a.length,c=-1;for(const t of r)for(s=0,++c;s<l;++s)(a[s][c]=[0,+i(t,a[s].key,c,r)]).data=t;for(s=0,o=sb(e(a));s<l;++s)a[o[s]].index=s;return n(a,o),a}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Ry(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Ry(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Mx:"function"==typeof t?t:Ry(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Sx:t,r):n},r},t.stackOffsetDiverging=function(t,e){if((a=t.length)>0)for(var n,i,r,s,o,a,l=0,c=t[e[0]].length;l<c;++l)for(s=o=0,n=0;n<a;++n)(r=(i=t[e[n]][l])[1]-i[0])>0?(i[0]=s,i[1]=s+=r):r<0?(i[1]=o,i[0]=o+=r):(i[0]=0,i[1]=r)},t.stackOffsetExpand=function(t,e){if((i=t.length)>0){for(var n,i,r,s=0,o=t[0].length;s<o;++s){for(r=n=0;n<i;++n)r+=t[n][s][1]||0;if(r)for(n=0;n<i;++n)t[n][s][1]/=r}Sx(t,e)}},t.stackOffsetNone=Sx,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],s=r.length;i<s;++i){for(var o=0,a=0;o<n;++o)a+=t[o][i][1]||0;r[i][1]+=r[i][0]=-a/2}Sx(t,e)}},t.stackOffsetWiggle=function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,s=0,o=1;o<i;++o){for(var a=0,l=0,c=0;a<r;++a){for(var u=t[e[a]],h=u[o][1]||0,f=(h-(u[o-1][1]||0))/2,d=0;d<a;++d){var p=t[e[d]];
vendor: 4,306 bytes, lines 719-720
719f+=(p[o][1]||0)-(p[o-1][1]||0)}l+=h,c+=f*h}n[o-1][1]+=n[o-1][0]=s,l&&(s-=c/l)}n[o-1][1]+=n[o-1][0]=s,Sx(t,e)}},t.stackOrderAppearance=Ax,t.stackOrderAscending=Ex,t.stackOrderDescending=function(t){return Ex(t).reverse()},t.stackOrderInsideOut=function(t){var e,n,i=t.length,r=t.map(Nx),s=Ax(t),o=0,a=0,l=[],c=[];for(e=0;e<i;++e)n=s[e],o<a?(o+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},t.stackOrderNone=Mx,t.stackOrderReverse=function(t){return Mx(t).reverse()},t.stratify=function(){var t=Vd,e=qd;function n(n){var i,r,s,o,a,l,c,u=Array.from(n),h=u.length,f=new Map;for(r=0;r<h;++r)i=u[r],a=u[r]=new gd(i),null!=(l=t(i,r,n))&&(l+="")&&(c=a.id=l,f.set(c,f.has(c)?Hd:a)),null!=(l=e(i,r,n))&&(l+="")&&(a.parent=l);for(r=0;r<h;++r)if(l=(a=u[r]).parent){if(!(o=f.get(l)))throw new Error("missing: "+l);if(o===Hd)throw new Error("ambiguous: "+l);o.children?o.children.push(a):o.children=[a],a.parent=o}else{if(s)throw new Error("multiple roots");s=a}if(!s)throw new Error("no root");if(s.parent=Od,s.eachBefore(function(t){t.depth=t.parent.depth+1,--h}).eachBefore(md),s.parent=null,h>0)throw new Error("cycle");return s}return n.id=function(e){return arguments.length?(t=Nd(e),n):t},n.parentId=function(t){return arguments.length?(e=Nd(t),n):e},n},t.style=oe,t.subset=function(t,e){return ct(e,t)},t.sum=function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n},t.superset=ct,t.svg=Qa,t.symbol=function(t,e){var n=null;function i(){var i;if(n||(n=i=vo()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:Ry(t||Cb),e="function"==typeof e?e:Ry(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:Ry(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:Ry(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i},t.symbolCircle=Cb,t.symbolCross=Ab,t.symbolDiamond=Nb,t.symbolSquare=$b,t.symbolStar=Ib,t.symbolTriangle=Lb,
720t.symbolWye=qb,t.symbols=Bb,t.text=Ua,t.thresholdFreedmanDiaconis=function(t,e,n){return Math.ceil((n-e)/(2*(G(t,.75)-G(t,.25))*Math.pow(c(t),-1/3)))},t.thresholdScott=function(t,e,n){return Math.ceil((n-e)/(3.5*p(t)*Math.pow(c(t),-1/3)))},t.thresholdSturges=B,t.tickFormat=Lp,t.tickIncrement=H,t.tickStep=V,t.ticks=O,t.timeDay=Cm,t.timeDays=Am,t.timeFormatDefaultLocale=Q_,t.timeFormatLocale=jg,t.timeFriday=Im,t.timeFridays=Vm,t.timeHour=Sm,t.timeHours=Mm,t.timeInterval=om,t.timeMillisecond=lm,t.timeMilliseconds=cm,t.timeMinute=xm,t.timeMinutes=wm,t.timeMonday=Nm,t.timeMondays=Lm,t.timeMonth=Um,t.timeMonths=Wm,t.timeSaturday=$m,t.timeSaturdays=qm,t.timeSecond=vm,t.timeSeconds=ym,t.timeSunday=Em,t.timeSundays=Rm,t.timeThursday=jm,t.timeThursdays=Hm,t.timeTickInterval=Eg,t.timeTicks=Dg,t.timeTuesday=zm,t.timeTuesdays=Fm,t.timeWednesday=Pm,t.timeWednesdays=Om,t.timeWeek=Em,t.timeWeeks=Rm,t.timeYear=Xm,t.timeYears=Jm,t.timeout=_r,t.timer=fr,t.timerFlush=dr,t.transition=Qr,t.transpose=ot,t.tree=function(){var t=Bd,e=1,n=1,i=null;function r(r){var l=function(t){for(var e,n,i,r,s,o=new Jd(t,0),a=[o];e=a.pop();)if(i=e._.children)for(e.children=new Array(s=i.length),r=s-1;r>=0;--r)a.push(n=e.children[r]=new Jd(i[r],r)),n.parent=e;return(o.parent=new Jd(null,0)).children=[o],o}(r);if(l.eachAfter(s),l.parent.m=-l.z,l.eachBefore(o),i)r.eachBefore(a);else{var c=r,u=r,h=r;r.eachBefore(function(t){t.x<c.x&&(c=t),t.x>u.x&&(u=t),t.depth>h.depth&&(h=t)});var f=c===u?1:t(c,u)/2,d=f-c.x,p=e/(u.x+f+d),m=n/(h.depth||1);r.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*m})}return r}function s(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,s=r.length;--s>=0;)(e=r[s]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var s=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-s):e.z=s}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,s=e,o=e,a=n,l=s.parent.children[0],c=s.m,u=o.m,h=a.m,f=l.m;a=Wd(a),s=Ud(s),a&&s;)l=Ud(l),(o=Wd(o)).a=e,(r=a.z+h-s.z-c+t(a._,s._))>0&&(Yd(Xd(a,e,i),e,r),c+=r,u+=r),h+=a.m,c+=s.m,f+=l.m,u+=o.m;a&&!Wd(o)&&(o.t=a,o.m+=h-u),s&&!Ud(l)&&(l.t=s,l.m+=c-f,i=e)}return i}(e,r,e.parent.A||i[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}
vendor: 4,567 bytes, line 720
720function a(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},t.treemap=function(){var t=Qd,e=!1,n=1,i=1,r=[0],s=zd,o=zd,a=zd,l=zd,c=zd;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(h),r=[0],e&&t.eachBefore(Ld),t}function h(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,h=e.x1-n,f=e.y1-n;h<i&&(i=h=(i+h)/2),f<u&&(u=f=(u+f)/2),e.x0=i,e.y0=u,e.x1=h,e.y1=f,e.children&&(n=r[e.depth+1]=s(e)/2,i+=c(e)-n,u+=o(e)-n,(h-=a(e)-n)<i&&(i=h=(i+h)/2),(f-=l(e)-n)<u&&(u=f=(u+f)/2),t(e,i,u,h,f))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],i=+t[1],u):[n,i]},u.tile=function(e){return arguments.length?(t=Nd(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(s="function"==typeof t?t:Pd(+t),u):s},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:Pd(+t),u):o},u.paddingRight=function(t){return arguments.length?(a="function"==typeof t?t:Pd(+t),u):a},u.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:Pd(+t),u):l},u.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:Pd(+t),u):c},u},t.treemapBinary=function(t,e,n,i,r){var s,o,a=t.children,l=a.length,c=new Array(l+1);for(c[0]=o=s=0;s<l;++s)c[s+1]=o+=a[s].value;!function u(t,e,n,i,r,s,o){if(t>=e-1){var l=a[t];return l.x0=i,l.y0=r,l.x1=s,void(l.y1=o)}var h=c[t],f=n/2+h,d=t+1,p=e-1;for(;d<p;){var m=d+p>>>1;c[m]<f?d=m+1:p=m}f-c[d-1]<c[d]-f&&t+1<d&&--d;var g=c[d]-h,_=n-g;if(s-i>o-r){var v=n?(i*_+s*g)/n:s;u(t,d,g,i,r,v,o),u(d,e,_,v,r,s,o)}else{var y=n?(r*_+o*g)/n:o;u(t,d,g,i,r,s,y),u(d,e,_,i,y,s,o)}}(0,l,t.value,e,n,i,r)},t.treemapDice=Fd,t.treemapResquarify=tp,t.treemapSlice=Gd,t.treemapSliceDice=function(t,e,n,i,r){(1&t.depth?Gd:Fd)(t,e,n,i,r)},t.treemapSquarify=Qd,t.tsv=Xa,t.tsvFormat=$a,t.tsvFormatBody=Ra,t.tsvFormatRow=Fa,t.tsvFormatRows=La,t.tsvFormatValue=Oa,t.tsvParse=ja,t.tsvParseRows=Ia,t.union=function(...t){const e=new v;for(const n of t)for(const t of n)e.add(t);return e},t.utcDay=ig,t.utcDays=rg,t.utcFriday=hg,t.utcFridays=vg,t.utcHour=tg,t.utcHours=eg,t.utcMillisecond=lm,t.utcMilliseconds=cm,t.utcMinute=Km,t.utcMinutes=Zm,t.utcMonday=ag,t.utcMondays=pg,t.utcMonth=xg,t.utcMonths=wg,t.utcSaturday=fg,t.utcSaturdays=yg,t.utcSecond=vm,t.utcSeconds=ym,t.utcSunday=og,t.utcSundays=dg,t.utcThursday=ug,t.utcThursdays=_g,t.utcTickInterval=Ag,t.utcTicks=Cg,t.utcTuesday=lg,t.utcTuesdays=mg,t.utcWednesday=cg,t.utcWednesdays=gg,t.utcWeek=og,t.utcWeeks=dg,t.utcYear=Sg,t.utcYears=Mg,t.variance=d,t.version="7.1.1",t.window=ne,t.xml=Ka,t.zip=function(){return ot(arguments)},t.zoom=function(){var t,e,n,i=Fx,r=Ox,s=Bx,o=Vx,a=qx,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=Vi,f=bt("start","zoom","end"),d=500,p=0,m=10;function g(t){t.property("__zoom",Hx).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new jx(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new jx(t.k,i,r)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function b(t,e,n,i){t.on("start.zoom",function(){x(this,arguments).event(i).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(i).end()}).tween("zoom",function(){var t=this,s=arguments,o=x(t,s).event(i),a=r.apply(t,s),l=null==n?y(a):"function"==typeof n?n.apply(t,s):n,c=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,s):e,d=h(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=c/e[2];t=new jx(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}})}function x(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function k(t,...e){if(i.apply(this,arguments)){var n=x(this,e).event(t),r=this.__zoom,a=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,o.apply(this,arguments)))),u=Be(t);
vendor: 4,255 bytes, line 720
720if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===a)return;n.mouse=[u,r.invert(u)],Sr(this),n.start()}Lx(t),n.wheel=setTimeout(h,150),n.zoom("mouse",s(v(_(r,a),n.mouse[0],n.mouse[1]),n.extent,c))}function h(){n.wheel=null,n.end()}}function S(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,o=x(this,e,!0).event(t),a=Fe(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",d,!0),l=Be(t,r),u=t.clientX,h=t.clientY;Je(t.view),Rx(t),o.mouse=[l,this.__zoom.invert(l)],Sr(this),o.start()}function f(t){if(Lx(t),!o.moved){var e=t.clientX-u,n=t.clientY-h;o.moved=e*e+n*n>p}o.event(t).zoom("mouse",s(v(o.that.__zoom,o.mouse[0]=Be(t,r),o.mouse[1]),o.extent,c))}function d(t){a.on("mousemove.zoom mouseup.zoom",null),Ge(t.view,o.moved),Lx(t),o.event(t).end()}}function M(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,o=Be(t.changedTouches?t.changedTouches[0]:t,this),a=n.invert(o),l=n.k*(t.shiftKey?.5:2),h=s(v(_(n,l),o,a),r.apply(this,e),c);Lx(t),u>0?Fe(this).transition().duration(u).call(b,h,o,t):Fe(this).call(g.transform,h,o,t)}}function T(n,...r){if(i.apply(this,arguments)){var s,o,a,l,c=n.touches,u=c.length,h=x(this,r,n.changedTouches.length===u).event(n);for(Rx(n),o=0;o<u;++o)l=[l=Be(a=c[o],this),this.__zoom.invert(l),a.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,s=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),s&&(h.taps<2&&(e=l[0],t=setTimeout(function(){t=null},d)),Sr(this),h.start())}}function C(t,...e){if(this.__zooming){var n,i,r,o,a=x(this,e).event(t),l=t.changedTouches,u=l.length;for(Lx(t),n=0;n<u;++n)r=Be(i=l[n],this),a.touch0&&a.touch0[2]===i.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===i.identifier&&(a.touch1[0]=r);if(i=a.that.__zoom,a.touch1){var h=a.touch0[0],f=a.touch0[1],d=a.touch1[0],p=a.touch1[1],m=(m=d[0]-h[0])*m+(m=d[1]-h[1])*m,g=(g=p[0]-f[0])*g+(g=p[1]-f[1])*g;i=_(i,Math.sqrt(m/g)),r=[(h[0]+d[0])/2,(h[1]+d[1])/2],o=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],o=a.touch0[1]}a.zoom("touch",s(v(i,r,o),a.extent,c))}}function A(t,...i){if(this.__zooming){var r,s,o=x(this,i).event(t),a=t.changedTouches,l=a.length;for(Rx(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},d),r=0;r<l;++r)s=a[r],o.touch0&&o.touch0[2]===s.identifier?delete o.touch0:o.touch1&&o.touch1[2]===s.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(s=Be(s,this),Math.hypot(e[0]-s[0],e[1]-s[1])<m)){var c=Fe(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(t,e,n,i){var r=t.selection?t.selection():t;r.property("__zoom",Hx),t!==r?b(t,e,n,i):r.interrupt().each(function(){x(this,arguments).event(i).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e,n,i){g.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,i)},g.scaleTo=function(t,e,n,i){g.transform(t,function(){var t=r.apply(this,arguments),i=this.__zoom,o=null==n?y(t):"function"==typeof n?n.apply(this,arguments):n,a=i.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return s(v(_(i,l),o,a),t,c)},n,i)},g.translateBy=function(t,e,n,i){g.transform(t,function(){return s(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,i)},g.translateTo=function(t,e,n,i,o){g.transform(t,function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==i?y(t):"function"==typeof i?i.apply(this,arguments):i;return s(Ix.translate(a[0],a[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)},i,o)},w.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit
720("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Fe(this.that).datum();f.call(t,this.that,new Px(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:zx(+t),g):o},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:zx(!!t),g):i},g.touchable=function(t){return arguments.length?(a="function"==typeof t?t:zx(!!t),g):a},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:zx([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(s=t,g):s},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(m=+t,g):m},g},t.zoomIdentity=Ix,t.zoomTransform=$x,Object.defineProperty(t,"__esModule",{value:!0})});!function(){function t(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function e(t){return null!=t&&!isNaN(t)}function n(t){return{left:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);r>i;){var s=i+r>>>1;t(e[s],n)<0?i=s+1:r=s}return i},right:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);r>i;){var s=i+r>>>1;t(e[s],n)>0?r=s:i=s+1}return i}}}function i(t){return t.length}function r(t){for(var e=1;t*e%1;)e*=10;return e}function s(t,e){try{for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}catch(i){t.prototype=e}}function o(){}function a(t){return uo+t in this}function l(t){return t=uo+t,t in this&&delete this[t]}function c(){var t=[];return this.forEach(function(e){t.push(e)}),t}function u(){var t=0;for(var e in this)e.charCodeAt(0)===ho&&++t;return t}function h(){for(var t in this)if(t.charCodeAt(0)===ho)return!1;return!0}function f(){}function d(t,e,n){return function(){var i=n.apply(e,arguments);return i===e?t:i}}function p(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.substring(1);for(var n=0,i=fo.length;i>n;++n){var r=fo[n]+e;if(r in t)return r}}function m(){}function g(){}function _(t){function e(){for(var e,i=n,r=-1,s=i.length;++r<s;)(e=i[r].on)&&e.apply(this,arguments);return t}var n=[],i=new o;return e.on=function(e,r){var s,o=i.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,n=n.slice(0,s=n.indexOf(o)).concat(n.slice(s+1)),i.remove(e)),r&&n.push(i.set(e,{on:r})),t)},e}function v(){Ks.event.preventDefault()}function y(){for(var t,e=Ks.event;t=e.sourceEvent;)e=t;return e}function b(t){for(var e=new g,n=0,i=arguments.length;++n<i;)e[arguments[n]]=_(e);return e.of=function(n,i){return function(r){try{var s=r.sourceEvent=Ks.event;r.target=t,Ks.event=r,e[r.type].apply(n,i)}finally{Ks.event=s}}},e}function x(t){return mo(t,bo),t}function w(t){return"function"==typeof t?t:function(){return go(t,this)}}function k(t){return"function"==typeof t?t:function(){return _o(t,this)}}function S(t,e){function n(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function r(){this.setAttribute(t,e)}function s(){this.setAttributeNS(t.space,t.local,e)}function o(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=Ks.ns.qualify(t),null==e?t.local?i:n:"function"==typeof e?t.local?a:o:t.local?s:r}function M(t){return t.trim().replace(/\s+/g," ")}function T(t){return new RegExp("(?:^|\\s+)"+Ks.requote(t)+"(?:\\s+|$)","g")}function C(t){return t.trim().split(/^|\s+/)}function A(t,e){function n(){for(var n=-1;++n<r;)t[n](this,e)}function i(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}t=C(t).map(D);var r=t.length;return"function"==typeof e?i:n}function D(t){var e=T(t);
vendor: 16,209 bytes, line 720
720return function(n,i){if(r=n.classList)return i?r.add(t):r.remove(t);var r=n.getAttribute("class")||"";i?(e.lastIndex=0,e.test(r)||n.setAttribute("class",M(r+" "+t))):n.setAttribute("class",M(r.replace(e," ")))}}function E(t,e,n){function i(){this.style.removeProperty(t)}function r(){this.style.setProperty(t,e,n)}function s(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}return null==e?i:"function"==typeof e?s:r}function N(t,e){function n(){delete this[t]}function i(){this[t]=e}function r(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?r:i}function z(t){return"function"==typeof t?t:(t=Ks.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,t)}}function P(t){return{__data__:t}}function j(t){return function(){return yo(this,t)}}function I(e){return arguments.length||(e=t),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function $(t,e){for(var n=0,i=t.length;i>n;n++)for(var r,s=t[n],o=0,a=s.length;a>o;o++)(r=s[o])&&e(r,o,n);return t}function R(t){return mo(t,wo),t}function L(t){var e,n;return function(i,r,s){var o,a=t[s].update,l=a.length;for(s!=n&&(n=s,e=0),r>=e&&(e=r+1);!(o=a[e])&&++e<l;);return o}}function F(){var t=this.__transition__;t&&++t.active}function O(t,e,n){function i(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function r(){var r=l(e,Qs(arguments));i.call(this),this.addEventListener(t,this[o]=r,r.$=n),r._=e}function s(){var e,n=new RegExp("^__on([^.]+)"+Ks.requote(t)+"$");for(var i in this)if(e=i.match(n)){var r=this[i];this.removeEventListener(e[1],r,r.$),delete this[i]}}var o="__on"+t,a=t.indexOf("."),l=H;a>0&&(t=t.substring(0,a));var c=So.get(t);return c&&(t=c,l=V),a?e?r:i:e?m:s}function H(t,e){return function(n){var i=Ks.event;Ks.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{Ks.event=i}}}function V(t,e){var n=H(t,e);return function(t){var e=this,i=t.relatedTarget;i&&(i===e||8&i.compareDocumentPosition(e))||n.call(e,t)}}function q(){var t=".dragsuppress-"+ ++To,e="click"+t,n=Ks.select(no).on("touchmove"+t,v).on("dragstart"+t,v).on("selectstart"+t,v);if(Mo){var i=eo.style,r=i[Mo];i[Mo]="none"}return function(s){function o(){n.on(e,null)}n.on(t,null),Mo&&(i[Mo]=r),s&&(n.on(e,function(){v(),o()},!0),setTimeout(o,0))}}function B(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}function U(){return Ks.event.changedTouches[0].identifier}function W(){return Ks.event.target}function Y(){return no}function X(t){return t>0?1:0>t?-1:0}function J(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function G(t){return t>1?0:-1>t?Co:Math.acos(t)}function K(t){return t>1?Do:-1>t?-Do:Math.asin(t)}function Z(t){return((t=Math.exp(t))-1/t)/2}function Q(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return((t=Math.exp(2*t))-1)/(t+1)}function et(t){return(t=Math.sin(t/2))*t}function nt(){}function it(t,e,n){return new rt(t,e,n)}function rt(t,e,n){this.h=t,this.s=e,this.l=n}function st(t,e,n){function i(t){return t>360?t-=360:0>t&&(t+=360),60>t?s+(o-s)*t/60:180>t?o:240>t?s+(o-s)*(240-t)/60:s}function r(t){return Math.round(255*i(t))}var s,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,o=.5>=n?n*(1+e):n+e-n*e,s=2*n-o,vt(r(t+120),r(t),r(t-120))}function ot(t,e,n){return new at(t,e,n)}function at(t,e,n){this.h=t,this.c=e,this.l=n}function lt(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),ct(n,Math.cos(t*=zo)*e,Math.sin(t)*e)}function ct(t,e,n){return new ut(t,e,n)}function ut(t,e,n){this.l=t,this.a=e,this.b=n}function ht(t,e,n){var i=(t+16)/116,r=i+e/500,s=i-n/200;return r=dt(r)*qo,i=dt(i)*Bo,s=dt(s)*Uo,vt(mt(3.2404542*r-1.5371385*i-.4985314*s),mt(-.969266*r+1.8760108*i+.041556*s),mt(.0556434*r-.2040259*i+1.0572252*s))}function ft(t,e,n){return t>0?ot(Math.atan2(n,e)*Po,Math.sqrt(e*e+n*n),t):ot(0/0,0/0,t)}function dt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function pt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function mt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function gt(t){return vt(t>>16,255&t>>8,255&t)}function _t(t){return gt(t)+""}function vt(t,e,n){return new yt(t,e,n)}function yt(t,e,n){this.r=t,this.g=e,this.b=n}function bt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function xt(t,e,n){var i,r,s,o=0,a=0,l=0;if(i=/([a-z]+)\((.*)\)/i.exec(t))switch(r=i[2].split(","),i[1]){case"hsl":return n(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100);case"rgb":return e(Mt(r[0]),Mt(r[1]),Mt(r[2]))}return(s=Xo.get(t))?e(s.r,s.g,s.b):(null==t||"#"!==t.charAt(0)||isNaN(s=parseInt(t.substring(1),16))||(4===t.length?(o=(3840&s)>>4,o=o>>4|o,a=240&s,a=a>>4|a,l=15&s,l=l<<4|l):7===t.length&&(o=(16711680&s)>>16,a=(65280&s)>>8,l=255&s)),e(o,a,l))}function wt(t,e,n){var i,r,s=Math.min(t/=255,e/=255,n/=255),o=Math.max(t,e,n),a=o-s,l=(o+s)/2;return a?(r=.5>l?a/(o+s):a/(2-o-s),i=t==o?(e-n)/a+(n>e?6:0):e==o?(n-t)/a+2:(t-e)/a+4,i*=60):(i=0/0,r=l>0&&1>l?0:i),it(i,r,l)}function kt(t,e,n){t=St(t),e=St(e),n=St(n);var i=pt((.4124564*t+.3575761*e+.1804375*n)/qo),r=pt((.2126729*t+.7151522*e+.072175*n)/Bo),s=pt((.0193339*t+.119192*e+.9503041*n)/Uo);return ct(116*r-16,500*(i-r),200*(r-s))}function St(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Mt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Tt(t){return"function"==typeof t?t:function(){return t}}function Ct(t){return t}function At(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=null),Dt(e,n,t,i)}}function Dt(t,e,n,i){function r(){var t,e=l.status;if(!e&&l.responseText||e>=200&&300>e||304===e){try{t=n.call(s,l)}catch(i){return o.error.call(s,i),void 0}o.load.call(s,t)}else o.error.call(s,l)}var s={},o=Ks.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!no.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=r:l.onreadystatechange=function(){l.readyState>3&&r()},l.onprogress=function(t){var e=Ks.event;Ks.event=t;try{o.progress.call(s,l)}finally{Ks.event=e}},s.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?a[t]:(null==e?delete a[t]:a[t]=e+"",s)},s.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",s):e},s.responseType=function(t){return arguments.length?(c=t,s):c},s.response=function(t){return n=t,s},["get","post"].forEach(function(t){s[t]=function(){return s.send.apply(s,[t].concat(Qs(arguments)))}}),s.send=function(n,i,r){if(2===arguments.length&&"function"==typeof i&&(r=i,i=null),l.open(n,t,!0),null==e||"accept"in a||(a.accept=e+",*/*"),l.setRequestHeader)for(var u in a)l.setRequestHeader(u,a[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=r&&s.on("error",r).on("load",function(t){r(null,t)}),o.beforesend.call(s,l),l.send(null==i?null:i),s},s.abort=function(){return l.abort(),s},Ks.rebind(s,o,"on"),null==i?s:s.get(Et(i))}function Et(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Nt(){var t=zt(),e=Pt()-t;e>24?(isFinite(e)&&(clearTimeout(Zo),Zo=setTimeout(Nt,e)),Ko=0):(Ko=1,ta(Nt))}function zt(){var t=Date.now();for(Qo=Jo;Qo;)t>=Qo.t&&(Qo.f=Qo.c(t-Qo.t)),Qo=Qo.n;return t}function Pt(){for(var t,e=Jo,n=1/0;e;)e.f?e=t?t.n=e.n:Jo=e.n:(e.t<n&&(n=e.t),e=(t=e).n);return Go=t,n}function jt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function It(t,e){var n=Math.pow(10,3*co(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function $t(t){var e=t.decimal,n=t.thousands,i=t.grouping,r=t.currency,s=i?function(t){for(var e=t.length,r=[],s=0,o=i[0];e>0&&o>0;)r.push(t.substring(e-=o,e+o)),o=i[s=(s+1)%i.length];return r.reverse().join(n)}:Ct;return function(t){var n=na.exec(t),i=n[1]||" ",o=n[2]||">",a=n[3]||"",l=n[4]||"",c=n[5],u=+n[6],h=n[7],f=n[8],d=n[9],p=1,m="",g="",_=!1;switch(f&&(f=+f.substring(1)),(c||"0"===i&&"="===o)&&(c=i="0",o="=",h&&(u-=Math.floor((u-1)/4))),d){case"n":h=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":case"d":_=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=r[0],g=r[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):("e"==d||"f"==d)&&(f=Math.max(0,Math.min(20,f)))),d=ia.get(d)||Rt;var v=c&&h;return function(t){var n=g;if(_&&t%1)return"";var r=0>t||0===t&&0>1/t?(t=-t,"-"):a;if(0>p){var l=Ks.formatPrefix(t,f);t=l.scale(t),n=l.symbol+g}else t*=p;t=d(t,f);var y=t.lastIndexOf("."),b=0>y?t:t.substring(0,y),x=0>y?"":e+t.substring(y+1);!c&&h&&(b=s(b));var w=m.length+b.length+x.length+(v?0:r.length),k=u>w?new Array(w=u-w+1).join(i):"";return v&&(b=s(k+b)),r+=m,t=b+x,("<"===o?r+t+k:">"===o?k+r+t:"^"===o?k.substring(0,w>>=1)+r+t+k.substring(w):r+(v?t:k+t))+n}}}function Rt(t){return t+""}function Lt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(t,e,n){function i(e){var n=t(e),i=s(n,1);return i-e>e-n?n:i}function r(n){return e(n=t(new sa(n-1)),1),n}function s(t,n){return e(t=new sa(+t),n),t}function o(t,i,s){var o=r(t),a=[];if(s>1)for(;i>o;)n(o)%s||a.push(new Date(+o)),e(o,1);else for(;i>o;)a.push(new Date(+o)),e(o,1);return a}function a(t,e,n){try{sa=Lt;var i=new Lt;return i._=t,o(i,e,n)}finally{sa=Date}}t.floor=t,t.round=i,t.ceil=r,t.offset=s,t.range=o;var l=t.utc=Ot(t);return l.floor=l,l.round=Ot(i),l.ceil=Ot(r),l.offset=Ot(s),l.range=a,t}function Ot(t){return function(e,n){try{sa=Lt;var i=new Lt;return i._=e,t(i,n)._}finally{sa=Date}}}function Ht(t){function e(t){function e(e){for(var n,r,s,o=[],a=-1,l=0;++a<i;)37===t.charCodeAt(a)&&(o.push(t.substring(l,a)),null!=(r=aa[n=t.charAt(++a)])&&(n=t.charAt(++a)),(s=A[n])&&(n=s(e,null==r?"e"===n?" ":"0":r)),o.push(n),l=a+1);return o.push(t.substring(l,a)),o.join("")}var i=t.length;return e.parse=function(e){var i={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},r=n(i,t,e,0);if(r!=e.length)return null;"p"in i&&(i.H=i.H%12+12*i.p);var s=null!=i.Z&&sa!==Lt,o=new(s?Lt:sa);return"j"in i?o.setFullYear(i.y,0,i.j):"w"in i&&("W"in i||"U"in i)?(o.setFullYear(i.y,0,1),o.setFullYear(i.y,0,"W"in i?(i.w+6)%7+7*i.W-(o.getDay()+5)%7:i.w+7*i.U-(o.getDay()+6)%7)):o.setFullYear(i.y,i.m,i.d),o.setHours(i.H+Math.floor(i.Z/100),i.M+i.Z%100,i.S,i.L),s?o._:o},e.toString=function(){return t},e}function n(t,e,n,i){for(var r,s,o,a=0,l=e.length,c=n.length;l>a;){if(i>=c)return-1;if(r=e.charCodeAt(a++),37===r){if(o=e.charAt(a++),s=D[o in aa?e.charAt(a++):o],!s||(i=s(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}function i(t,e,n){w.lastIndex=0;var i=w.exec(e.substring(n));return i?(t.w=k.get(i[0].toLowerCase()),n+i[0].length):-1}function r(t,e,n){b.lastIndex=0;var i=b.exec(e.substring(n));return i?(t.w=x.get(i[0].toLowerCase()),n+i[0].length):-1}function s(t,e,n){T.lastIndex=0;var i=T.exec(e.substring(n));return i?(t.m=C.get(i[0].toLowerCase()),n+i[0].length):-1}function o(t,e,n){S.lastIndex=0;var i=S.exec(e.substring(n));return i?(t.m=M.get(i[0].toLowerCase()),n+i[0].length):-1}function a(t,e,i){return n(t,A.c.toString(),e,i)}function l(t,e,i){return n(t,A.x.toString(),e,i)}function c(t,e,i){return n(t,A.X.toString(),e,i)}function u(t,e,n){var i=y.get(e.substring(n,n+=2).toLowerCase());return null==i?-1:(t.p=i,n)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,g=t.shortDays,_=t.months,v=t.shortMonths;e.utc=function(t){function n(t){try{sa=Lt;var e=new sa;return e._=t,i(e)}finally{sa=Date}}var i=e(t);return n.parse=function(t){try{sa=Lt;var e=i.parse(t);return e&&e._}finally{sa=Date}},n.toString=i.toString,n},e.multi=e.utc.multi=ae;var y=Ks.map(),b=qt(m),x=Bt(m),w=qt(g),k=Bt(g),S=qt(_),M=Bt(_),T=qt(v),C=Bt(v);p.forEach(function(t,e){y.set(t.toLowerCase(),e)});var A={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return v[t.getMonth()]},B:function(t){return _[t.getMonth()]},c:e(h),d:function(t,e){return Vt(t.getDate(),e,2)},e:function(t,e){return Vt(t.getDate(),e,2)},H:function(t,e){return Vt(t.getHours(),e,2)},I:function(t,e){return Vt(t.getHours()%12||12,e,2)},j:function(t,e){return Vt(1+ra.dayOfYear(t),e,3)},L:function(t,e){return Vt(t.getMilliseconds(),e,3)},m:function(t,e){return Vt(t.getMonth()+1,e,2)},M:function(t,e){return Vt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Vt(t.getSeconds(),e,2)},U:function(t,e){return Vt(ra.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Vt(ra.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Vt(t.getFullYear()%100,e,2)},Y:function(t,e){return Vt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},D={a:i,A:r,b:s,B:o,c:a,d:Qt,e:Qt,H:ee,I:ee,j:te,L:re,m:Zt,M:ne,p:u,S:ie,U:Wt,w:Ut,W:Yt,x:l,X:c,y:Jt,Y:Xt,Z:Gt,"%":oe};return e}function Vt(t,e,n){var i=0>t?"-":"",r=(i?-t:t)+"",s=r.length;return i+(n>s?new Array(n-s+1).join(e)+r:r)}function qt(t){return new RegExp("^(?:"+t.map(Ks.requote).join("|")+")","i")}function Bt(t){for(var e=new o,n=-1,i=t.length;++n<i;)e.set(t[n].toLowerCase(),n);return e}function Ut(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Wt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n));return i?(t.U=+i[0],n+i[0].length):-1}function Yt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n));return i?(t.W=+i[0],n+i[0].length):-1}function Xt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Jt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.y=Kt(+i[0]),n+i[0].length):-1}function Gt(t,e,n){return/^[+-]\d{4}$/.test(e=e.substring(n,n+5))?(t.Z=-e,n+5):-1}function Kt(t){return t+(t>68?1900:2e3)}function Zt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Qt(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function te(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+3));return i?(t.j=+i[0],n+i[0].length):-1}function ee(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function ne(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function ie(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function re(t,e,n){la.lastIndex=0;var i=la.exec(e.substring(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function se(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",i=~~(co(e)/60),r=co(e)%60;return n+Vt(i,"0",2)+Vt(r,"0",2)}function oe(t,e,n){ca.lastIndex=0;var i=ca.exec(e.substring(n,n+1));return i?n+i[0].length:-1}function ae(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,i=t[n];!i[1](e);)i=t[++n];return i[0](e)}}function le(){}function ce(t,e,n){var i=n.s=t+e,r=i-t,s=i-r;n.t=t-s+(e-r)}function ue(t,e){t&&da.hasOwnProperty(t.type)&&da[t.type](t,e)}function he(t,e,n){var i,r=-1,s=t.length-n;for(e.lineStart();++r<s;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function fe(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)he(t[n],e,1);e.polygonEnd()}function de(){function t(t,e){t*=zo,e=e*zo/2+Co/4;var n=t-i,o=n>=0?1:-1,a=o*n,l=Math.cos(e),c=Math.sin(e),u=s*c,h=r*l+u*Math.cos(a),f=u*o*Math.sin(a);ma.add(Math.atan2(f,h)),i=t,r=l,s=c}var e,n,i,r,s;ga.point=function(o,a){ga.point=t,i=(e=o)*zo,r=Math.cos(a=(n=a)*zo/2+Co/4),s=Math.sin(a)},ga.lineEnd=function(){t(e,n)}}function pe(t){var e=t[0],n=t[1],i=Math.cos(n);return[i*Math.cos(e),i*Math.sin(e),Math.sin(n)]}function me(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ge(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function _e(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}
vendor: 4,629 bytes, lines 720-721
720function ve(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ye(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function be(t){return[Math.atan2(t[1],t[0]),K(t[2])]}function xe(t,e){return co(t[0]-e[0])<Eo&&co(t[1]-e[1])<Eo}function we(t,e){t*=zo;var n=Math.cos(e*=zo);ke(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function ke(t,e,n){++_a,ya+=(t-ya)/_a,ba+=(e-ba)/_a,xa+=(n-xa)/_a}function Se(){function t(t,r){t*=zo;var s=Math.cos(r*=zo),o=s*Math.cos(t),a=s*Math.sin(t),l=Math.sin(r),c=Math.atan2(Math.sqrt((c=n*l-i*a)*c+(c=i*o-e*l)*c+(c=e*a-n*o)*c),e*o+n*a+i*l);va+=c,wa+=c*(e+(e=o)),ka+=c*(n+(n=a)),Sa+=c*(i+(i=l)),ke(e,n,i)}var e,n,i;Aa.point=function(r,s){r*=zo;var o=Math.cos(s*=zo);e=o*Math.cos(r),n=o*Math.sin(r),i=Math.sin(s),Aa.point=t,ke(e,n,i)}}function Me(){Aa.point=we}function Te(){function t(t,e){t*=zo;var n=Math.cos(e*=zo),o=n*Math.cos(t),a=n*Math.sin(t),l=Math.sin(e),c=r*l-s*a,u=s*o-i*l,h=i*a-r*o,f=Math.sqrt(c*c+u*u+h*h),d=i*o+r*a+s*l,p=f&&-G(d)/f,m=Math.atan2(f,d);Ma+=p*c,Ta+=p*u,Ca+=p*h,va+=m,wa+=m*(i+(i=o)),ka+=m*(r+(r=a)),Sa+=m*(s+(s=l)),ke(i,r,s)}var e,n,i,r,s;Aa.point=function(o,a){e=o,n=a,Aa.point=t,o*=zo;var l=Math.cos(a*=zo);i=l*Math.cos(o),
721r=l*Math.sin(o),s=Math.sin(a),ke(i,r,s)},Aa.lineEnd=function(){t(e,n),Aa.lineEnd=Me,Aa.point=we}}function Ce(){return!0}function Ae(t,e,n,i,r){var s=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],i=t[e];if(xe(n,i)){r.lineStart();for(var a=0;e>a;++a)r.point((n=t[a])[0],n[1]);return r.lineEnd(),void 0}var l=new Ee(n,t,null,!0),c=new Ee(n,null,l,!1);l.o=c,s.push(l),o.push(c),l=new Ee(i,t,null,!1),c=new Ee(i,null,l,!0),l.o=c,s.push(l),o.push(c)}}),o.sort(e),De(s),De(o),s.length){for(var a=0,l=n,c=o.length;c>a;++a)o[a].e=l=!l;for(var u,h,f=s[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var a=0,c=u.length;c>a;++a)r.point((h=u[a])[0],h[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(p){u=d.p.z;for(var a=u.length-1;a>=0;--a)r.point((h=u[a])[0],h[1])}else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,u=d.z,p=!p}while(!d.v);r.lineEnd()}}}function De(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Ee(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Ne(t,e,n,i){return function(r,s){function o(e,n){var i=r(e,n);t(e=i[0],n=i[1])&&s.point(e,n)}function a(t,e){var n=r(t,e);g.point(n[0],n[1])}function l(){v.point=a,g.lineStart()}function c(){v.point=o,g.lineEnd()}function u(t,e){m.push([t,e]);var n=r(t,e);b.point(n[0],n[1])}function h(){b.lineStart(),m=[]}function f(){u(m[0][0],m[0][1]),b.lineEnd();var t,e=b.clean(),n=y.buffer(),i=n.length;if(m.pop(),p.push(m),m=null,i)if(1&e){t=n[0];var r,i=t.length-1,o=-1;if(i>0){for(x||(s.polygonStart(),x=!0),s.lineStart();++o<i;)s.point((r=t[o])[0],r[1]);s.lineEnd()}}else i>1&&2&e&&n.push(n.pop().concat(n.shift())),d.push(n.filter(ze))}var d,p,m,g=e(s),_=r.invert(i[0],i[1]),v={point:o,lineStart:l,lineEnd:c,polygonStart:function(){v.point=u,v.lineStart=h,v.lineEnd=f,d=[],p=[]},polygonEnd:function(){v.point=o,v.lineStart=l,v.lineEnd=c,d=Ks.merge(d);var t=Ie(_,p);d.length?(x||(s.polygonStart(),x=!0),Ae(d,je,t,n,s)):t&&(x||(s.polygonStart(),x=!0),s.lineStart(),n(null,null,1,s),s.lineEnd()),x&&(s.polygonEnd(),x=!1),d=p=null},sphere:function(){s.polygonStart(),s.lineStart(),n(null,null,1,s),s.lineEnd(),s.polygonEnd()}},y=Pe(),b=e(y),x=!1;return v}}function ze(t){return t.length>1}function Pe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:m,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Do-Eo:Do-t[1])-((e=e.x)[0]<0?e[1]-Do-Eo:Do-e[1])}function Ie(t,e){var n=t[0],i=t[1],r=[Math.sin(n),-Math.cos(n),0],s=0,o=0;ma.reset();for(var a=0,l=e.length;l>a;++a){var c=e[a],u=c.length;if(u)for(var h=c[0],f=h[0],d=h[1]/2+Co/4,p=Math.sin(d),m=Math.cos(d),g=1;;){g===u&&(g=0),t=c[g];var _=t[0],v=t[1]/2+Co/4,y=Math.sin(v),b=Math.cos(v),x=_-f,w=x>=0?1:-1,k=w*x,S=k>Co,M=p*y;if(ma.add(Math.atan2(M*w*Math.sin(k),m*b+M*Math.cos(k))),s+=S?x+w*Ao:x,S^f>=n^_>=n){var T=ge(pe(h),pe(t));ye(T);var C=ge(r,T);ye(C);var A=(S^x>=0?-1:1)*K(C[2]);(i>A||i===A&&(T[0]||T[1]))&&(o+=S^x>=0?1:-1)}if(!g++)break;f=_,p=y,m=b,h=t}}return(-Eo>s||Eo>s&&0>ma)^1&o}function $e(t){var e,n=0/0,i=0/0,r=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(s,o){var a=s>0?Co:-Co,l=co(s-n);co(l-Co)<Eo?(t.point(n,i=(i+o)/2>0?Do:-Do),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),t.point(s,i),e=0):r!==a&&l>
vendor: 8,393 bytes, line 721
721=Co&&(co(n-r)<Eo&&(n-=r*Eo),co(s-a)<Eo&&(s-=a*Eo),i=Re(n,i,s,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(a,i),e=0),t.point(n=s,i=o),r=a},lineEnd:function(){t.lineEnd(),n=i=0/0},clean:function(){return 2-e}}}function Re(t,e,n,i){var r,s,o=Math.sin(t-n);return co(o)>Eo?Math.atan((Math.sin(e)*(s=Math.cos(i))*Math.sin(n)-Math.sin(i)*(r=Math.cos(e))*Math.sin(t))/(r*s*o)):(e+i)/2}function Le(t,e,n,i){var r;if(null==t)r=n*Do,i.point(-Co,r),i.point(0,r),i.point(Co,r),i.point(Co,0),i.point(Co,-r),i.point(0,-r),i.point(-Co,-r),i.point(-Co,0),i.point(-Co,r);else if(co(t[0]-e[0])>Eo){var s=t[0]<e[0]?Co:-Co;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(e[0],e[1])}function Fe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>s}function n(t){var n,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=o?m?0:r(h,f):m?r(h+(0>h?Co:-Co),f):0;if(!n&&(c=l=m)&&t.lineStart(),m!==l&&(d=i(n,p),(xe(n,d)||xe(p,d))&&(p[0]+=Eo,p[1]+=Eo,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=i(p,n),t.point(d[0],d[1])):(d=i(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(a&&n&&o^m){var _;g&s||!(_=i(p,n,!0))||(u=0,o?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!m||n&&xe(n,p)||t.point(p[0],p[1]),n=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),n=null},clean:function(){return u|(c&&l)<<1}}}function i(t,e,n){var i=pe(t),r=pe(e),o=[1,0,0],a=ge(i,r),l=me(a,a),c=a[0],u=l-c*c;if(!u)return!n&&t;var h=s*l/u,f=-s*c/u,d=ge(o,a),p=ve(o,h),m=ve(a,f);_e(p,m);var g=d,_=me(p,g),v=me(g,g),y=_*_-v*(me(p,p)-1);if(!(0>y)){var b=Math.sqrt(y),x=ve(g,(-_-b)/v);if(_e(x,p),x=be(x),!n)return x;var w,k=t[0],S=e[0],M=t[1],T=e[1];k>S&&(w=k,k=S,S=w);var C=S-k,A=co(C-Co)<Eo,D=A||Eo>C;if(!A&&M>T&&(w=M,M=T,T=w),D?A?M+T>0^x[1]<(co(x[0]-k)<Eo?M:T):M<=x[1]&&x[1]<=T:C>Co^(k<=x[0]&&x[0]<=S)){var E=ve(g,(-_+b)/v);return _e(E,p),[x,be(E)]}}}function r(e,n){var i=o?t:Co-t,r=0;return-i>e?r|=1:e>i&&(r|=2),-i>n?r|=4:n>i&&(r|=8),r}var s=Math.cos(t),o=s>0,a=co(s)>Eo,l=pn(t,6*zo);return Ne(e,n,l,o?[0,-t]:[-Co,t-Co])}function Oe(t,e,n,i){return function(r){var s,o=r.a,a=r.b,l=o.x,c=o.y,u=a.x,h=a.y,f=0,d=1,p=u-l,m=h-c;if(s=t-l,p||!(s>0)){if(s/=p,0>p){if(f>s)return;d>s&&(d=s)}else if(p>0){if(s>d)return;s>f&&(f=s)}if(s=n-l,p||!(0>s)){if(s/=p,0>p){if(s>d)return;s>f&&(f=s)}else if(p>0){if(f>s)return;d>s&&(d=s)}if(s=e-c,m||!(s>0)){if(s/=m,0>m){if(f>s)return;d>s&&(d=s)}else if(m>0){if(s>d)return;s>f&&(f=s)}if(s=i-c,m||!(0>s)){if(s/=m,0>m){if(s>d)return;s>f&&(f=s)}else if(m>0){if(f>s)return;d>s&&(d=s)}return f>0&&(r.a={x:l+f*p,y:c+f*m}),1>d&&(r.b={x:l+d*p,y:c+d*m}),r}}}}}}function He(t,e,n,i){function r(i,r){return co(i[0]-t)<Eo?r>0?0:3:co(i[0]-n)<Eo?r>0?2:1:co(i[1]-e)<Eo?r>0?1:0:r>0?3:2}function s(t,e){return o(t.x,e.x)}function o(t,e){var n=r(t,1),i=r(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){function l(t){for(var e=0,n=g.length,i=t[1],r=0;n>r;++r)for(var s,o=1,a=g[r],l=a.length,c=a[0];l>o;++o)s=a[o],c[1]<=i?s[1]>i&&J(c,s,t)>0&&++e:s[1]<=i&&J(c,s,t)<0&&--e,c=s;return 0!==e}function c(s,a,l,c){var u=0,h=0;if(null==s||(u=r(s,l))!==(h=r(a,l))||o(s,a)<0^l>0){do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+l+4)%4)!==h)}else c.point(a[0],a[1])}function u(r,s){return r>=t&&n>=r&&s>=e&&i>=s}function h(t,e){u(t,e)&&a.point(t,e)}function f(){D.point=p,g&&g.push(_=[]),S=!0,k=!1,x=w=0/0}function d(){m&&(p(v,y),b&&k&&C.rejoin(),m.push(C.buffer())),D.point=h,k&&a.lineEnd()}function p(t,e){t=Math.max(-Ea,Math.min(Ea,t)),e=Math.max(-Ea,Math.min(Ea,e));var n=u(t,e);if(g&&_.push([t,e]),S)v=t,y=e,b=n,S=!1,n&&(a.lineStart(),a.point(t,e));else if(n&&k)a.point(t,e);else{var i={a:{x:x,y:w},b:{x:t,y:e}};A(i)?(k||(a.lineStart(),a.point(i.a.x,i.a.y)),a.point(i.b.x,i.b.y),n||a.lineEnd(),M=!1):n&&(a.lineStart(),a.point(t,e),M=!1)}x=t,w=e,k=n}var m,g,_,v,y,b,x,w,k,S,M,T=a,C=Pe(),A=Oe(t,e,n,i),D={point:h,lineStart:f,lineEnd:d,polygonStart:function(){a=C,m=[],g=[],M=!0},polygonEnd:function(){a=T,m=Ks.merge(m);var e=l([t,i]),n=M&&e,r=m.length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),r&&Ae(m,s,e,c,a),a.polygonEnd()),m=g=_=null}};return D}}function Ve(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return n=e.invert(n,i),n&&t.invert(n[0],n[1])}),n}function qe(t){var e=0,n=Co/3,i=on(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Co/180,n=t[1]*Co/180):[180*(e/Co),180*(n/Co)]},r}function Be(t,e){function n(t,e){var n=Math.sqrt(s-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),o-n*Math.cos(t)]}var i=Math.sin(t),r=(i+Math.sin(e))/2,s=1+i*(2*r-i),o=Math.sqrt(s)/r;return n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/r,K((s-(t*t+n*n)*r*r)/(2*r))]},n}function Ue(){function t(t,e){za+=r*t-i*e,i=t,r=e}var e,n,i,r;Ra.point=function(s,o){Ra.point=t,e=i=s,n=r=o},Ra.lineEnd=function(){t(e,n)}}function We(t,e){Pa>t&&(Pa=t),t>Ia&&(Ia=t),ja>e&&(ja=e),e>$a&&($a=e)}function Ye(){function t(t,e){o.push("M",t,",",e,s)}function e(t,e){o.push("M",t,",",e),a.point=n}function n(t,e){o.push("L",t,",",e)}function i(){a.point=t}function r(){o.push("Z")}var s=Xe(4.5),o=[],a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=r},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(t){return s=Xe(t),a},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return a}function Xe(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Je(t,e){ya+=t,ba+=e,++xa}function Ge(){function t(t,i){var r=t-e,s=i-n,o=Math.sqrt(r*r+s*s);wa+=o*(e+t)/2,ka+=o*(n+i)/2,Sa+=o,Je(e=t,n=i)}var e,n;Fa.point=function(i,r){Fa.point=t,Je(e=i,n=r)}}function Ke(){Fa.point=Je}function Ze(){function t(t,e){var n=t-i,s=e-r,o=Math.sqrt(n*n+s*s);wa+=o*(i+t)/2,ka+=o*(r+e)/2,Sa+=o,o=r*t-i*e,Ma+=o*(i+t),Ta+=o*(r+e),Ca+=3*o,Je(i=t,r=e)}var e,n,i,r;Fa.point=function(s,o){Fa.point=t,Je(e=i=s,n=r=o)},Fa.lineEnd=function(){t(e,n)}}function Qe(t){function e(e,n){t.moveTo(e,n),t.arc(e,n,o,0,Ao)}function n(e,n){t.moveTo(e,n),a.point=i}function i(e,n){t.lineTo(e,n)}function r(){a.point=e}function s(){t.closePath()}var o=4.5,a={point:e,lineStart:function(){a.point=n},lineEnd:r,polygonStart:function(){a.lineEnd=s},polygonEnd:function(){a.lineEnd=r,a.point=e},pointRadius:function(t){return o=t,a},result:m};return a}function tn(t){function e(t){return(a?i:n)(t)}function n(e){return rn(e,function(n,i){n=t(n,i),e.point(n[0],n[1])})}function i(e){function n(n,i){n=t(n,i),e.point(n[0],n[1])}function i(){y=0/0,S.point=s,e.lineStart()}function s(n,i){var s=pe([n,i]),o=t(n,i);r(y,b,v,x,w,k,y=o[0],b=o[1],v=n,x=s[0],w=s[1],k=s[2],a,e),e.point(y,b)}function o(){S.point=n,e.lineEnd()}function l(){i(),S.point=c,S.lineEnd=u}function c(t,e){s(h=t,f=e),d=y,p=b,m=x,g=w,_=k,S.point=s}function u(){r(y,b,v,x,w,k,d,p,h,m,g,_,a,e),S.lineEnd=o,o()}var h,f,d,p,m,g,_,v,y,b,x,w,k,S={point:n,lineStart:i,lineEnd:o,polygonStart:function(){e.polygonStart(),S.lineStart=l},polygonEnd:function(){e.polygonEnd(),S.lineStart=i}};return S}function r(e,n,i,a,l,c,u,h,f,d,p,m,g,_){var v=u-e,y=h-n,b=v*v+y*y;if(b>4*s&&g--){var x=a+d,w=l+p,k=c+m,S=Math.sqrt(x*x+w*w+k*k),M=Math.asin(k/=S),T=co(co(k)-1)<Eo||co(i-f)<Eo?(i+f)/2:Math.atan2(w,x),C=t(T,M),A=C[0],D=C[1],E=A-e,N=D-n,z=y*E-v*N;(z*z/b>s||co((v*E+y*N)/b-.5)>.3||o>a*d+l*p+c*m)&&(r(e,n,i,a,l,c,A,D,T,x/=S,w/=S,k,g,_),_.point(A,D),r(A,D,T,x,w,k,u,h,f,d,p,m,g,_))}}var s=.5,o=Math.cos(30*zo),a=16;return e.precision=function(t){return arguments.length?(a=(s=t*t)>0&&16,e):Math.sqrt(s)},e}function en(t){var e=tn(function(e,n){return t([e*Po,n*Po])});return function(t){return an(e(t))}}function nn(t){this.stream=t}function rn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sn(t){return on(function(){return t})()}function on(t){function e(t){return t=a(t[0]*zo,t[1]*zo),[t[0]*f+l,c-t[1]*f]}function n(t){return t=a.invert((t[0]-l)/f,(c-t[1])/f),t&&[t[0]*Po,t[1]*Po]}function i(){a=Ve(o=un(_,v,y),s);var t=s(m,g);return l=d-t[0]*f,c=p+t[1]*f,r()}function r(){return u&&(u.valid=!1,u=null),e}var s,o,a,l,c,u,h=tn(function(t,e){return t=s(t,e),[t[0]*f+l,c-t[1]*f]}
vendor: 13,647 bytes, line 721
721),f=150,d=480,p=250,m=0,g=0,_=0,v=0,y=0,b=Da,x=Ct,w=null,k=null;return e.stream=function(t){return u&&(u.valid=!1),u=an(b(o,h(x(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,Da):Fe((w=+t)*zo),r()):w},e.clipExtent=function(t){return arguments.length?(k=t,x=t?He(t[0][0],t[0][1],t[1][0],t[1][1]):Ct,r()):k},e.scale=function(t){return arguments.length?(f=+t,i()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],i()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*zo,g=t[1]%360*zo,i()):[m*Po,g*Po]},e.rotate=function(t){return arguments.length?(_=t[0]%360*zo,v=t[1]%360*zo,y=t.length>2?t[2]%360*zo:0,i()):[_*Po,v*Po,y*Po]},Ks.rebind(e,h,"precision"),function(){return s=t.apply(this,arguments),e.invert=s.invert&&n,i()}}function an(t){return rn(t,function(e,n){t.point(e*zo,n*zo)})}function ln(t,e){return[t,e]}function cn(t,e){return[t>Co?t-Ao:-Co>t?t+Ao:t,e]}function un(t,e,n){return t?e||n?Ve(fn(t),dn(e,n)):fn(t):e||n?dn(e,n):cn}function hn(t){return function(e,n){return e+=t,[e>Co?e-Ao:-Co>e?e+Ao:e,n]}}function fn(t){var e=hn(t);return e.invert=hn(-t),e}function dn(t,e){function n(t,e){var n=Math.cos(e),a=Math.cos(t)*n,l=Math.sin(t)*n,c=Math.sin(e),u=c*i+a*r;return[Math.atan2(l*s-u*o,a*i-c*r),K(u*s+l*o)]}var i=Math.cos(t),r=Math.sin(t),s=Math.cos(e),o=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),a=Math.cos(t)*n,l=Math.sin(t)*n,c=Math.sin(e),u=c*s-l*o;return[Math.atan2(l*s+c*o,a*i+u*r),K(u*i-a*r)]},n}function pn(t,e){var n=Math.cos(t),i=Math.sin(t);return function(r,s,o,a){var l=o*e;null!=r?(r=mn(n,r),s=mn(n,s),(o>0?s>r:r>s)&&(r+=o*Ao)):(r=t+o*Ao,s=t-.5*l);for(var c,u=r;o>0?u>s:s>u;u-=l)a.point((c=be([n,-i*Math.cos(u),-i*Math.sin(u)]))[0],c[1])}}function mn(t,e){var n=pe(e);n[0]-=t,ye(n);var i=G(-n[1]);return((-n[2]<0?-i:i)+2*Math.PI-Eo)%(2*Math.PI)}function gn(t,e,n){var i=Ks.range(t,e-Eo,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function _n(t,e,n){var i=Ks.range(t,e-Eo,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function vn(t){return t.source}function yn(t){return t.target}function bn(t,e,n,i){var r=Math.cos(e),s=Math.sin(e),o=Math.cos(i),a=Math.sin(i),l=r*Math.cos(t),c=r*Math.sin(t),u=o*Math.cos(n),h=o*Math.sin(n),f=2*Math.asin(Math.sqrt(et(i-e)+r*o*et(n-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,n=Math.sin(f-t)*d,i=n*l+e*u,r=n*c+e*h,o=n*s+e*a;return[Math.atan2(r,i)*Po,Math.atan2(o,Math.sqrt(i*i+r*r))*Po]}:function(){return[t*Po,e*Po]};return p.distance=f,p}function xn(){function t(t,r){var s=Math.sin(r*=zo),o=Math.cos(r),a=co((t*=zo)-e),l=Math.cos(a);Oa+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=i*s-n*o*l)*a),n*s+i*o*l),e=t,n=s,i=o}var e,n,i;Ha.point=function(r,s){e=r*zo,n=Math.sin(s*=zo),i=Math.cos(s),Ha.point=t},Ha.lineEnd=function(){Ha.point=Ha.lineEnd=m}}function wn(t,e){function n(e,n){var i=Math.cos(e),r=Math.cos(n),s=t(i*r);return[s*r*Math.sin(e),s*Math.sin(n)]}return n.invert=function(t,n){var i=Math.sqrt(t*t+n*n),r=e(i),s=Math.sin(r),o=Math.cos(r);return[Math.atan2(t*s,i*o),Math.asin(i&&n*s/i)]},n}function kn(t,e){function n(t,e){o>0?-Do+Eo>e&&(e=-Do+Eo):e>Do-Eo&&(e=Do-Eo);var n=o/Math.pow(r(e),s);return[n*Math.sin(s*t),o-n*Math.cos(s*t)]}var i=Math.cos(t),r=function(t){return Math.tan(Co/4+t/2)},s=t===e?Math.sin(t):Math.log(i/Math.cos(e))/Math.log(r(e)/r(t)),o=i*Math.pow(r(t),s)/s;return s?(n.invert=function(t,e){var n=o-e,i=X(s)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/s,2*Math.atan(Math.pow(o/i,1/s))-Do]},n):Mn}function Sn(t,e){function n(t,e){var n=s-e;return[n*Math.sin(r*t),s-n*Math.cos(r*t)]}var i=Math.cos(t),r=t===e?Math.sin(t):(i-Math.cos(e))/(e-t),s=i/r+t;return co(r)<Eo?ln:(n.invert=function(t,e){var n=s-e;return[Math.atan2(t,n)/r,s-X(r)*Math.sqrt(t*t+n*n)]},n)}function Mn(t,e){return[t,Math.log(Math.tan(Co/4+e/2))]}function Tn(t){var e,n=sn(t),i=n.scale,r=n.translate,s=n.clipExtent;return n.scale=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var o=s.apply(n,arguments);if(o===n){if(e=null==t){var a=Co*i(),l=r();s([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else e&&(o=null);return o},n.clipExtent(null)}function Cn(t,e){return[Math.log(Math.tan(Co/4+e/2)),-t]}function An(t){return t[0]}function Dn(t){return t[1]}function En(t){for(var e=t.length,n=[0,1],i=2,r=2;e>r;r++){for(;i>1&&J(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function Nn(t,e){return t[0]-e[0]||t[1]-e[1]}function zn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Pn(t,e,n,i){var r=t[0],s=n[0],o=e[0]-r,a=i[0]-s,l=t[1],c=n[1],u=e[1]-l,h=i[1]-c,f=(a*(l-c)-h*(r-s))/(h*o-a*u);return[r+f*o,l+f*u]}function jn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function In(){ni(this),this.edge=this.site=this.circle=null}function $n(t){var e=Qa.pop()||new In;return e.site=t,e}function Rn(t){Yn(t),Ga.remove(t),Qa.push(t),ni(t)}function Ln(t){var e=t.circle,n=e.x,i=e.cy,r={x:n,y:i},s=t.P,o=t.N,a=[t];Rn(t);for(var l=s;l.circle&&co(n-l.circle.x)<Eo&&co(i-l.circle.cy)<Eo;)s=l.P,a.unshift(l),Rn(l),l=s;a.unshift(l),Yn(l);for(var c=o;c.circle&&co(n-c.circle.x)<Eo&&co(i-c.circle.cy)<Eo;)o=c.N,a.push(c),Rn(c),c=o;a.push(c),Yn(c);var u,h=a.length;for(u=1;h>u;++u)c=a[u],l=a[u-1],Qn(c.edge,l.site,c.site,r);l=a[0],c=a[h-1],c.edge=Kn(l.site,c.site,null,r),Wn(l),Wn(c)}function Fn(t){for(var e,n,i,r,s=t.x,o=t.y,a=Ga._;a;)if(i=On(a,o)-s,i>Eo)a=a.L;else{if(r=s-Hn(a,o),!(r>Eo)){i>-Eo?(e=a.P,n=a):r>-Eo?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}var l=$n(t);if(Ga.insert(e,l),e||n){if(e===n)return Yn(e),n=$n(e.site),Ga.insert(l,n),l.edge=n.edge=Kn(e.site,l.site),Wn(e),Wn(n),void 0;if(!n)return l.edge=Kn(e.site,l.site),void 0;Yn(e),Yn(n);var c=e.site,u=c.x,h=c.y,f=t.x-u,d=t.y-h,p=n.site,m=p.x-u,g=p.y-h,_=2*(f*g-d*m),v=f*f+d*d,y=m*m+g*g,b={x:(g*v-d*y)/_+u,y:(f*y-m*v)/_+h};Qn(n.edge,c,p,b),l.edge=Kn(c,t,null,b),n.edge=Kn(t,p,null,b),Wn(e),Wn(n)}}function On(t,e){var n=t.site,i=n.x,r=n.y,s=r-e;if(!s)return i;var o=t.P;if(!o)return-1/0;n=o.site;var a=n.x,l=n.y,c=l-e;if(!c)return a;var u=a-i,h=1/s-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+r-s/2)))/h+i:(i+a)/2}function Hn(t,e){var n=t.N;if(n)return On(n,e);var i=t.site;return i.y===e?i.x:1/0}function Vn(t){this.site=t,this.edges=[]}function qn(t){for(var e,n,i,r,s,o,a,l,c,u,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=Ja,g=m.length;g--;)if(s=m[g],s&&s.prepare())for(a=s.edges,l=a.length,o=0;l>o;)u=a[o].end(),i=u.x,r=u.y,c=a[++o%l].start(),e=c.x,n=c.y,(co(i-e)>Eo||co(r-n)>Eo)&&(a.splice(o,0,new ti(Zn(s.site,u,co(i-h)<Eo&&p-r>Eo?{x:h,y:co(e-h)<Eo?n:p}:co(r-p)<Eo&&f-i>Eo?{x:co(n-p)<Eo?e:f,y:p}:co(i-f)<Eo&&r-d>Eo?{x:f,y:co(e-f)<Eo?n:d}:co(r-d)<Eo&&i-h>Eo?{x:co(n-d)<Eo?e:h,y:d}:null),s.site,null)),++l)}function Bn(t,e){return e.angle-t.angle}function Un(){ni(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wn(t){var e=t.P,n=t.N;if(e&&n){var i=e.site,r=t.site,s=n.site;if(i!==s){var o=r.x,a=r.y,l=i.x-o,c=i.y-a,u=s.x-o,h=s.y-a,f=2*(l*h-c*u);if(!(f>=-No)){var d=l*l+c*c,p=u*u+h*h,m=(h*d-c*p)/f,g=(l*p-u*d)/f,h=g+a,_=tl.pop()||new Un;_.arc=t,_.site=r,_.x=m+o,_.y=h+Math.sqrt(m*m+g*g),_.cy=h,t.circle=_;for(var v=null,y=Za._;y;)if(_.y<y.y||_.y===y.y&&_.x<=y.x){if(!y.L){v=y.P;break}y=y.L}else{if(!y.R){v=y;break}y=y.R}Za.insert(v,_),v||(Ka=_)}}}}function Yn(t){var e=t.circle;e&&(e.P||(Ka=e.N),Za.remove(e),tl.push(e),ni(e),t.circle=null)}function Xn(t){for(var e,n=Xa,i=Oe(t[0][0],t[0][1],t[1][0],t[1][1]),r=n.length;r--;)e=n[r],(!Jn(e,t)||!i(e)||co(e.a.x-e.b.x)<Eo&&co(e.a.y-e.b.y)<Eo)&&(e.a=e.b=null,n.splice(r,1))}function Jn(t,e){var n=t.b;if(n)return!0;var i,r,s=t.a,o=e[0][0],a=e[1][0],l=e[0][1],c=e[1][1],u=t.l,h=t.r,f=u.x,d=u.y,p=h.x,m=h.y,g=(f+p)/2,_=(d+m)/2;if(m===d){if(o>g||g>=a)return;if(f>p){if(s){if(s.y>=c)return}else s={x:g,y:l};n={x:g,y:c}}else{if(s){if(s.y<l)return}else s={x:g,y:c};n={x:g,y:l}}}else if(i=(f-p)/(m-d),r=_-i*g,-1>i||i>1)if(f>p){if(s){if(s.y>=c)return}else s={x:(l-r)/i,y:l};n={x:(c-r)/i,y:c}}else{if(s){if(s.y<l)return}else s={x:(c-r)/i,y:c};n={x:(l-r)/i,y:l}}else if(m>d){if(s){if(s.x>=a)return}else s={x:o,y:i*o+r};n={x:a,y:i*a+r}}else{if(s){if(s.x<o)return}else s={x:a,y:i*a+r};n={x:o,y:i*o+r}}return t.a=s,t.b=n,!0}function Gn(t,e){this.l=t,this.r=e,this.a=this.b=null}function Kn(t,e,n,i){var r=new Gn(t,e);return Xa.push(r),n&&Qn(r,t,e,n),i&&Qn(r,e,t,i),Ja[t.i].edges.push(new ti(r,t,e)),Ja[e.i].edges.push(new ti(r,e,t)),r}function Zn(t,e,n){var i=new Gn(t,null);return i.a=e,i.b=n,Xa.push(i),i}function Qn(t,e,n,i){t.a||t.b?t.l===n?t.b=i:t.a=i:(t.a=i,t.l=e,t.r=n)}function ti(t,e,n){var i=t.a,r=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(r.x-i.x,i.y-r.y):Math.atan2(i.x-r.x,r.y-i.y)}function ei(){this._=null}function ni(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ii(t,e){var n=e,i=e.R,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function ri(t,e){var n=e,i=e.L,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function si(t){for(;t.L;)t=t.L;return t}function oi(t,e){var n,i,r,s=t.sort(ai).pop();for(Xa=[],Ja=new Array(t.length),Ga=new ei,Za=new ei;;)if(r=Ka,s&&(!r||s.y<r.y||s.y===r.y&&s.x<r.x))(s.x!==n||s.y!==i)&&(Ja[s.i]=new Vn(s),Fn(s),n=s.x,i=s.y),s=t.pop();else{if(!r)break;Ln(r.arc)}e&&(Xn(e),qn(e));var o={cells:Ja,edges:Xa};return Ga=Za=Xa=Ja=null,o}function ai(t,e){return e.y-t.y||e.x-t.x}function li(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function ci(t){return t.x}function ui(t){return t.y}function hi(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function fi(t,e,n,i,r,s){if(!t(e,n,i,r,s)){var o=.5*(n+r),a=.5*(i+s),l=e.nodes;l[0]&&fi(t,l[0],n,i,o,a),l[1]&&fi(t,l[1],o,i,r,a),l[2]&&fi(t,l[2],n,a,o,s),l[3]&&fi(t,l[3],o,a,r,s)}}function di(t,e){t=Ks.rgb(t),e=Ks.rgb(e);var n=t.r,i=t.g,r=t.b,s=e.r-n,o=e.g-i,a=e.b-r;return function(t){return"#"+bt(Math.round(n+s*t))+bt(Math.round(i+o*t))+bt(Math.round(r+a*t))}}function pi(t,e){var n,i={},r={};for(n in t)n in e?i[n]=_i(t[n],e[n]):r[n]=t[n];for(n in e)n in t||(r[n]=e[n]);return function(t){for(n in i)r[n]=i[n](t);return r}}function mi(t,e){return e-=t=+t,function(n){return t+e*n}}function gi(t,e){var n,i,r,s=nl.lastIndex=il.lastIndex=0,o=-1,a=[],l=[];for(t+="",e+="";(n=nl.exec(t))&&(i=il.exec(e));)(r=i.index)>s&&(r=e.substring(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:mi(n,i)})),s=il.lastIndex;return s<e.length&&(r=e.substring(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var n,i=0;e>i;++i)a[(n=l[i]).i]=n.x(t);return a.join("")})}function _i(t,e){for(var n,i=Ks.interpolators.length;--i>=0&&!(n=Ks.interpolators[i](t,e)););return n}function vi(t,e){var n,i=[],r=[],s=t.length,o=e.length,a=Math.min(t.length,e.length);for(n=0;a>n;++n)i.push(_i(t[n],e[n]));for(;s>n;++n)r[n]=t[n];for(;o>n;++n)r[n]=e[n];return function(t){for(n=0;a>n;++n)r[n]=i[n](t);return r}}function yi(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function bi(t){return function(e){return 1-t(1-e)}}function xi(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function wi(t){return t*t}function ki(t){return t*t*t}function Si(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Mi(t){return function(e){return Math.pow(e,t)}}function Ti(t){return 1-Math.cos(t*Do)}function Ci(t){return Math.pow(2,10*(t-1))}function Ai(t){return 1-Math.sqrt(1-t*t)}function Di(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Ao*Math.asin(1/t):(t=1,n=e/4),function(i){return 1+t*Math.pow(2,-10*i)*Math.sin((i-n)*Ao/e)}}function Ei(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Ni(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function zi(t,e){t=Ks.hcl(t),e=Ks.hcl(e);var n=t.h,i=t.c,r=t.l,s=e.h-n,o=e.c-i,a=e.l-r;return isNaN(o)&&(o=0,i=isNaN(i)?e.c:i),isNaN(s)?(s=0,n=isNaN(n)?e.h:n):s>180?s-=360:-180>s&&(s+=360),function(t){return lt(n+s*t,i+o*t,r+a*t)+""}}function Pi(t,e){t=Ks.hsl(t),e=Ks.hsl(e);var n=t.h,i=t.s,r=t.l,s=e.h-n,o=e.s-i,a=e.l-r;return isNaN(o)&&(o=0,i=isNaN(i)?e.s:i),isNaN(s)?(s=0,n=isNaN(n)?e.h:n):s>180?s-=360:-180>s&&(s+=360),function(t){return st(n+s*t,i+o*t,r+a*t)+""}}function ji(t,e){t=Ks.lab(t),e=Ks.lab(e);var n=t.l,i=t.a,r=t.b,s=e.l-n,o=e.a-i,a=e.b-r;return function(t){return ht(n+s*t,i+o*t,r+a*t)+""}}function Ii(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function $i(t){var e=[t.a,t.b],n=[t.c,t.d],i=Li(e),r=Ri(e,n),s=Li(Fi(n,e,-r))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,i*=-1,r*=-1),this.rotate=(i?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Po,this.translate=[t.e,t.f],this.scale=[i,s],this.skew=s?Math.atan2(r,s)*Po:0}function Ri(t,e){return t[0]*e[0]+t[1]*e[1]}function Li(t){var e=Math.sqrt(Ri(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Fi(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function Oi(t,e){var n,i=[],r=[],s=Ks.transform(t),o=Ks.transform(e),a=s.translate,l=o.translate,c=s.rotate,u=o.rotate,h=s.skew,f=o.skew,d=s.scale,p=o.scale;return a[0]!=l[0]||a[1]!=l[1]?(i.push("translate(",null,",",null,")"),r.push({i:1,x:mi(a[0],l[0])},{i:3,x:mi(a[1],l[1])})):l[0]||l[1]?i.push("translate("+l+")"):i.push(""),c!=u?(c-u>180?u+=360:u-c>180&&(c+=360),r.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:mi(c,u)})):u&&i.push(i.pop()+"rotate("+u+")"),h!=f?r.push({i:i.push(i.pop()+"skewX(",
vendor: 47,245 bytes, lines 721-723
721null,")")-2,x:mi(h,f)}):f&&i.push(i.pop()+"skewX("+f+")"),d[0]!=p[0]||d[1]!=p[1]?(n=i.push(i.pop()+"scale(",null,",",null,")"),r.push({i:n-4,x:mi(d[0],p[0])},{i:n-2,x:mi(d[1],p[1])})):(1!=p[0]||1!=p[1])&&i.push(i.pop()+"scale("+p+")"),n=r.length,function(t){for(var e,s=-1;++s<n;)i[(e=r[s]).i]=e.x(t);return i.join("")}}function Hi(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function Vi(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function qi(t){for(var e=t.source,n=t.target,i=Ui(e,n),r=[e];e!==i;)e=e.parent,r.push(e);for(var s=r.length;n!==i;)r.splice(s,0,n),n=n.parent;return r}function Bi(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Ui(t,e){if(t===e)return t;for(var n=Bi(t),i=Bi(e),r=n.pop(),s=i.pop(),o=null;r===s;)o=r,r=n.pop(),s=i.pop();return o}function Wi(t){t.fixed|=2}function Yi(t){t.fixed&=-7}function Xi(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ji(t){t.fixed&=-5}function Gi(t,e,n){var i=0,r=0;if(t.charge=0,!t.leaf)for(var s,o=t.nodes,a=o.length,l=-1;++l<a;)s=o[l],null!=s&&(Gi(s,e,n),t.charge+=s.charge,i+=s.charge*s.cx,r+=s.charge*s.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*n[t.point.index];t.charge+=t.pointCharge=c,i+=c*t.point.x,r+=c*t.point.y}t.cx=i/t.charge,t.cy=r/t.charge}function Ki(t,e){return Ks.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=er,t}function Zi(t){return t.children}function Qi(t){return t.value}function tr(t,e){return e.value-t.value}function er(t){return Ks.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function nr(t){return t.x}function ir(t){return t.y}function rr(t,e,n){t.y0=e,t.y=n}function sr(t){return Ks.range(t.length)}function or(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function ar(t){for(var e,n=1,i=0,r=t[0][1],s=t.length;s>n;++n)(e=t[n][1])>r&&(i=n,r=e);return i}function lr(t){return t.reduce(cr,0)}function cr(t,e){return t+e[1]}function ur(t,e){return hr(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function hr(t,e){for(var n=-1,i=+t[0],r=(t[1]-i)/e,s=[];++n<=e;)s[n]=r*n+i;return s}function fr(t){return[Ks.min(t),Ks.max(t)]}function dr(t,e){return t.parent==e.parent?1:2}function pr(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function mr(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function gr(t,e){var n=t.children;if(n&&(r=n.length))for(var i,r,s=-1;++s<r;)e(i=gr(n[s],e),t)>0&&(t=i);return t}function _r(t,e){return t.x-e.x}function vr(t,e){return e.x-t.x}function yr(t,e){return t.depth-e.depth}function br(t,e){function n(t,i){var r=t.children;if(r&&(o=r.length))for(var s,o,a=null,l=-1;++l<o;)s=r[l],n(s,a),a=s;e(t,i)}n(t,null)}function xr(t){for(var e,n=0,i=0,r=t.children,s=r.length;--s>=0;)e=r[s]._tree,e.prelim+=n,e.mod+=n,n+=e.shift+(i+=e.change)}function wr(t,e,n){t=t._tree,e=e._tree;var i=n/(e.number-t.number);t.change+=i,e.change-=i,e.shift+=n,e.prelim+=n,e.mod+=n}function kr(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}function Sr(t,e){return t.value-e.value}function Mr(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Tr(t,e){t._pack_next=e,e._pack_prev=t}function Cr(t,e){var n=e.x-t.x,i=e.y-t.y,r=t.r+e.r;return.999*r*r>n*n+i*i}function Ar(t){function e(t){u=Math.min(t.x-t.r,u),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((n=t.children)&&(c=n.length)){var n,i,r,s,o,a,l,c,u=1/0,h=-1/0,f=1/0,d=-1/0;if(n.forEach(Dr),i=n[0],i.x=-i.r,i.y=0,e(i),c>1&&(r=n[1],r.x=r.r,r.y=0,e(r),c>2))for(s=n[2],zr(i,r,s),e(s),Mr(i,s),i._pack_prev=s,Mr(s,r),r=i._pack_next,o=3;c>o;o++){zr(i,r,s=n[o]);var p=0,m=1,g=1;for(a=r._pack_next;a!==r;a=a._pack_next,m++)if(Cr(a,s)){p=1;break}if(1==p)for(l=i._pack_prev;l!==a._pack_prev&&!Cr(l,s);l=l._pack_prev,g++);p?(g>m||m==g&&r.r<i.r?Tr(i,r=a):Tr(i=l,r),o--):(Mr(i,s),r=s,e(s))}var _=(u+h)/2,v=(f+d)/2,y=0;for(o=0;c>o;o++)s=n[o],s.x-=_,s.y-=v,y=Math.max(y,s.r+Math.sqrt(s.x*s.x+s.y*s.y));t.r=y,n.forEach(Er)}}function Dr(t){t._pack_next=t._pack_prev=t}function Er(t){delete t._pack_next,delete t._pack_prev}function Nr(t,e,n,i){var r=t.children;if(t.x=e+=i*t.x,t.y=n+=i*t.y,t.r*=i,r)for(var s=-1,o=r.length;++s<o;)Nr(r[s],e,n,i)}function zr(t,e,n){var i=t.r+n.r,r=e.x-t.x,s=e.y-t.y;if(i&&(r||s)){var o=e.r+n.r,a=r*r+s*s;o*=o,i*=i;var l=.5+(i-o)/(2*a),c=Math.sqrt(Math.max(0,2*o*(i+a)-(i-=a)*i-o*o))/(2*a);n.x=t.x+l*r+c*s,n.y=t.y+l*s-c*r}else n.x=t.x+i,n.y=t.y}function Pr(t){return 1+Ks.max(t,function(t){return t.y})}function jr(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ir(t){var e=t.children;return e&&e.length?Ir(e[0]):t}function $r(t){var e,n=t.children;return n&&(e=n.length)?$r(n[e-1]):t}function Rr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Lr(t,e){var n=t.x+e[3],i=t.y+e[0],r=t.dx-e[1]-e[3],s=t.dy-e[0]-e[2];return 0>r&&(n+=r/2,r=0),0>s&&(i+=s/2,s=0),{x:n,y:i,dx:r,dy:s}}function Fr(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Or(t){return t.rangeExtent?t.rangeExtent():Fr(t.range())}function Hr(t,e,n,i){var r=n(t[0],t[1]),s=i(e[0],e[1]);return function(t){return s(r(t))}}function Vr(t,e){var n,i=0,r=t.length-1,s=t[i],o=t[r];return s>o&&(n=i,i=r,r=n,n=s,s=o,o=n),t[i]=e.floor(s),t[r]=e.ceil(o),t}function qr(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:pl}function Br(t,e,n,i){var r=[],s=[],o=0,a=Math.min(t.length,e.length)-1;for(t[a]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=a;)r.push(n(t[o-1],t[o])),s.push(i(e[o-1],e[o]));return function(e){var n=Ks.bisect(t,e,1,a)-1;return s[n](r[n](e))}}function Ur(t,e,n,i){function r(){var r=Math.min(t.length,e.length)>2?Br:Hr,l=i?Vi:Hi;return o=r(t,e,l,n),a=r(e,t,l,_i),s}function s(t){return o(t)}var o,a;return s.invert=function(t){return a(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),r()):t},s.range=function(t){return arguments.length?(e=t,r()):e},s.rangeRound=function(t){return s.range(t).interpolate(Ii)},s.clamp=function(t){return arguments.length?(i=t,r()):i},s.interpolate=function(t){return arguments.length?(n=t,r()):n},s.ticks=function(e){return Jr(t,e)},s.tickFormat=function(e,n){return Gr(t,e,n)},s.nice=function(e){return Yr(t,e),r()},s.copy=function(){return Ur(t,e,n,i)},r()}function Wr(t,e){return Ks.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Yr(t,e){return Vr(t,qr(Xr(t,e)[2]))}function Xr(t,e){null==e&&(e=10);var n=Fr(t),i=n[1]-n[0],r=Math.pow(10,Math.floor(Math.log(i/e)/Math.LN10)),s=e/i*r;return.15>=s?r*=10:.35>=s?r*=5:.75>=s&&(r*=2),n[0]=Math.ceil(n[0]/r)*r,n[1]=Math.floor(n[1]/r)*r+.5*r,n[2]=r,n}function Jr(t,e){return Ks.range.apply(Ks,Xr(t,e))}function Gr(t,e,n){var i=Xr(t,e);if(n){var r=na.exec(n);if(r.shift(),"s"===r[8]){var s=Ks.formatPrefix(Math.max(co(i[0]),co(i[1])));return r[7]||(r[7]="."+Kr(s.scale(i[2]))),r[8]="f",n=Ks.format(r.join("")),function(t){return n(s.scale(t))+s.symbol}}r[7]||(r[7]="."+Zr(r[8],i)),n=r.join("")}else n=",."+Kr(i[2])+"f";return Ks.format(n)}function Kr(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Zr(t,e){var n=Kr(e[2]);return t in ml?Math.abs(n-Kr(Math.max(co(e[0]),co(e[1]))))+ +("e"!==t):n-2*("%"===t)}
722function Qr(t,e,n,i){function r(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function s(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(r(e))}return o.invert=function(e){return s(t.invert(e))},o.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((i=e.map(Number)).map(r)),o):i},o.base=function(n){return arguments.length?(e=+n,t.domain(i.map(r)),o):e},o.nice=function(){var e=Vr(i.map(r),n?Math:_l);return t.domain(e),i=e.map(s),o},o.ticks=function(){var t=Fr(i),o=[],a=t[0],l=t[1],c=Math.floor(r(a)),u=Math.ceil(r(l)),h=e%1?2:e;if(isFinite(u-c)){if(n){for(;u>c;c++)for(var f=1;h>f;f++)o.push(s(c)*f);o.push(s(c))}else for(o.push(s(c));c++<u;)for(var f=h-1;f>0;f--)o.push(s(c)*f);for(c=0;o[c]<a;c++);for(u=o.length;o[u-1]>l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,e){if(!arguments.length)return gl;arguments.length<2?e=gl:"function"!=typeof e&&(e=Ks.format(e));var i,a=Math.max(.1,t/o.ticks().length),l=n?(i=1e-12,Math.ceil):(i=-1e-12,Math.floor);return function(t){return t/s(l(r(t)+i))<=a?e(t):""}},o.copy=function(){return Qr(t.copy(),e,n,i)},Wr(o,t)}function ts(t,e,n){function i(e){return t(r(e))}var r=es(e),s=es(1/e);return i.invert=function(e){return s(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(r)),i):n},i.ticks=function(t){return Jr(n,t)},i.tickFormat=function(t,e){return Gr(n,t,e)},i.nice=function(t){return i.domain(Yr(n,t))},i.exponent=function(o){return arguments.length?(r=es(e=o),s=es(1/e),t.domain(n.map(r)),i):e},i.copy=function(){return ts(t.copy(),e,n)},Wr(i,t)}function es(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ns(t,e){function n(n){return s[((r.get(n)||("range"===e.t?r.set(n,t.push(n)):0/0))-1)%s.length]}function i(e,n){return Ks.range(t.length).map(function(t){return e+n*t})}var r,s,a;return n.domain=function(i){if(!arguments.length)return t;t=[],r=new o;for(var s,a=-1,l=i.length;++a<l;)r.has(s=i[a])||r.set(s,t.push(s));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(s=t,a=0,e={t:"range",a:arguments},n):s},n.rangePoints=function(r,o){arguments.length<2&&(o=0);var l=r[0],c=r[1],u=(c-l)/(Math.max(1,t.length-1)+o);return s=i(t.length<2?(l+c)/2:l+u*o/2,u),a=0,e={t:"rangePoints",a:arguments},n},n.rangeBands=function(r,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=r[1]<r[0],u=r[c-0],h=r[1-c],f=(h-u)/(t.length-o+2*l);return s=i(u+f*l,f),c&&s.reverse(),a=f*(1-o),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(r,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=r[1]<r[0],u=r[c-0],h=r[1-c],f=Math.floor((h-u)/(t.length-o+2*l)),d=h-u-(t.length-o)*f;return s=i(u+Math.round(d/2),f),c&&s.reverse(),a=Math.round(f*(1-o)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return a},n.rangeExtent=function(){return Fr(e.a[0])},n.copy=function(){return ns(t,e)},n.domain(t)}function is(n,i){function r(){var t=0,e=i.length;for(o=[];++t<e;)o[t-1]=Ks.quantile(n,t/e);return s}function s(t){return isNaN(t=+t)?void 0:i[Ks.bisect(o,t)]}var o;return s.domain=function(i){return arguments.length?(n=i.filter(e).sort(t),r()):n},s.range=function(t){return arguments.length?(i=t,r()):i},s.quantiles=function(){return o},s.invertExtent=function(t){return t=i.indexOf(t),0>t?[0/0,0/0]:[t>0?o[t-1]:n[0],t<o.length?o[t]:n[n.length-1]]},s.copy=function(){return is(n,i)},r()}function rs(t,e,n){function i(e){return n[Math.max(0,Math.min(o,Math.floor(s*(e-t))))]}function r(){return s=n.length/(e-t),o=n.length-1,i}var s,o;return i.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],r()):[t,e]},i.range=function(t){return arguments.length?(n=t,r()):n},i.invertExtent=function(e){return e=n.indexOf(e),e=0>e?0/0:e/s+t,[e,e+1/s]},i.copy=function(){return rs(t,e,n)},r()}function ss(t,e){function n(n){return n>=n?e[Ks.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ss(t,e)},n}function os(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Jr(t,e)},e.tickFormat=function(e,n){return Gr(t,e,n)},e.copy=function(){return os(t)},e}function as(t){return t.innerRadius}function ls(t){return t.outerRadius}function cs(t){return t.startAngle}function us(t){return t.endAngle}function hs(t){function e(e){function o(){c.push("M",s(t(u),a))}for(var l,c=[],u=[],h=-1,f=e.length,d=Tt(n),p=Tt(i);++h<f;)r.call(this,l=e[h],h)?u.push([+d.call(this,l,h),+p.call(this,l,h)]):u.length&&(o(),u=[]);return u.length&&o(),c.length?c.join(""):null}var n=An,i=Dn,r=Ce,s=fs,o=s.key,a=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e.defined=function(t){return arguments.length?(r=t,e):r},e.interpolate=function(t){return arguments.length?(o="function"==typeof t?s=t:(s=Sl.get(t)||fs).key,e):o},e.tension=function(t){return arguments.length?(a=t,e):a},e}function fs(t){return t.join("L")}function ds(t){return fs(t)+"Z"}function ps(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i[0]+(i=t[e])[0])/2,"V",i[1]);return n>1&&r.push("H",i[0]),r.join("")}function ms(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("V",(i=t[e])[1],"H",i[0]);return r.join("")}function gs(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i=t[e])[0],"V",i[1]);return r.join("")}function _s(t,e){return t.length<4?fs(t):t[1]+bs(t.slice(1,t.length-1),xs(t,e))}function vs(t,e){return t.length<3?fs(t):t[0]+bs((t.push(t[0]),t),xs([t[t.length-2]].concat(t,[t[1]]),e))}function ys(t,e){return t.length<3?fs(t):t[0]+bs(t,xs(t,e))}function bs(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return fs(t);var n=t.length!=e.length,i="",r=t[0],s=t[1],o=e[0],a=o,l=1;if(n&&(i+="Q"+(s[0]-2*o[0]/3)+","+(s[1]-2*o[1]/3)+","+s[0]+","+s[1],r=t[1],l=2),e.length>1){a=e[1],s=t[l],l++,i+="C"+(r[0]+o[0])+","+(r[1]+o[1])+","+(s[0]-a[0])+","+(s[1]-a[1])+","+s[0]+","+s[1];for(var c=2;c<e.length;c++,l++)s=t[l],a=e[c],i+="S"+(s[0]-a[0])+","+(s[1]-a[1])+","+s[0]+","+s[1]}if(n){var u=t[l];i+="Q"+(s[0]+2*a[0]/3)+","+(s[1]+2*a[1]/3)+","+u[0]+","+u[1]}return i}function xs(t,e){for(var n,i=[],r=(1-e)/2,s=t[0],o=t[1],a=1,l=t.length;++a<l;)n=s,s=o,o=t[a],i.push([r*(o[0]-n[0]),r*(o[1]-n[1])]);return i}function ws(t){if(t.length<3)return fs(t);var e=1,n=t.length,i=t[0],r=i[0],s=i[1],o=[r,r,r,(i=t[1])[0]],a=[s,s,s,i[1]],l=[r,",",s,"L",Ts(Cl,o),",",Ts(Cl,a)];for(t.push(t[n-1]);++e<=n;)i=t[e],o.shift(),o.push(i[0]),a.shift(),a.push(i[1]),Cs(l,o,a);return t.pop(),l.push("L",i),l.join("")}function ks(t){if(t.length<4)return fs(t);for(var e,n=[],i=-1,r=t.length,s=[0],o=[0];++i<3;)e=t[i],s.push(e[0]),o.push(e[1]);for(n.push(Ts(Cl,s)+","+Ts(Cl,o)),--i;++i<r;)e=t[i],s.shift(),s.push(e[0]),o.shift(),o.push(e[1]),Cs(n,s,o);return n.join("")}function Ss(t){for(var e,n,i=-1,r=t.length,s=r+4,o=[],a=[];++i<4;)n=t[i%r],o.push(n[0]),a.push(n[1]);for(e=[Ts(Cl,o),",",Ts(Cl,a)],--i;++i<s;)n=t[i%r],o.shift(),o.push(n[0]),a.shift(),a.push(n[1]),Cs(e,o,a);return e.join("")}function Ms(t,e){var n=t.length-1;if(n)for(var i,r,s=t[0][0],o=t[0][1],a=t[n][0]-s,l=t[n][1]-o,c=-1;++c<=n;)i=t[c],r=c/n,i[0]=e*i[0]+(1-e)*(s+r*a),i[1]=e*i[1]+(1-e)*(o+r*l);return ws(t)}function Ts(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Cs(t,e,n){t.push("C",Ts(Ml,e),",",Ts(Ml,n),",",Ts(Tl,e),",",Ts(Tl,n),",",Ts(Cl,e),",",Ts(Cl,n))}function As(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Ds(t){for(var e=0,n=t.length-1,i=[],r=t[0],s=t[1],o=i[0]=As(r,s);++e<n;)i[e]=(o+(o=As(r=s,s=t[e+1])))/2;return i[e]=o,i}function Es(t){for(var e,n,i,r,s=[],o=Ds(t),a=-1,l=t.length-1;++a<l;)e=As(t[a],t[a+1]),co(e)<Eo?o[a]=o[a+1]=0:(n=o[a]/e,i=o[a+1]/e,r=n*n+i*i,r>9&&(r=3*e/Math.sqrt(r),o[a]=r*n,o[a+1]=r*i));for(a=-1;++a<=l;)r=(t[Math.min(l,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),s.push([r||0,o[a]*r||0]);return s}function Ns(t){return t.length<3?fs(t):t[0]+bs(t,Es(t))}function zs(t){for(var e,n,i,r=-1,s=t.length;++r<s;)e=t[r],n=e[0],i=e[1]+wl,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function Ps(t){function e(e){function l(){m.push("M",a(t(_),h),u,c(t(g.reverse()),h),"Z")}for(var f,d,p,m=[],g=[],_=[],v=-1,y=e.length,b=Tt(n),x=Tt(r),w=n===i?function(){return d}:Tt(i),k=r===s?function(){return p}:Tt(s);++v<y;)o.call(this,f=e[v],v)?(g.push([d=+b.call(this,f,v),p=+x.call(this,f,v)]),_.push([+w.call(this,f,v),+k.call(this,f,v)])):g.length&&(l(),g=[],_=[]);return g.length&&l(),m.length?m.join(""):null}var n=An,i=An,r=0,s=Dn,o=Ce,a=fs,l=a.key,c=a,u="L",h=.7;return e.x=function(t){return arguments.length?(n=i=t,e):i},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(r=s=t,e):s},e.y0=function(t){return arguments.length?(r=t,e):r},e.y1=function(t){return arguments.length?(s=t,e):s},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?a=t:(a=Sl.get(t)||fs).key,c=a.reverse||a,u=a.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function js(t){return t.radius}function Is(t){return[t.x,t.y]}function $s(t){return function(){var e=t.apply(this,arguments),n=e[0],i=e[1]+wl;return[n*Math.cos(i),n*Math.sin(i)]}}function Rs(){return 64}function Ls(){return"circle"}function Fs(t){var e=Math.sqrt(t/Co);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Os(t,e){return mo(t,Pl),t.id=e,t}function Hs(t,e,n,i){var r=t.id;return $(t,"function"==typeof n?function(t,s,o){t.__transition__[r].tween.set(e,i(n.call(t,t.__data__,s,o)))}:(n=i(n),function(t){t.__transition__[r].tween.set(e,n)}))}function Vs(t){return null==t&&(t=""),function(){this.textContent=t}}function qs(t,e,n,i){var r=t.__transition__||(t.__transition__={active:0,count:0}),s=r[n];if(!s){var a=i.time;s=r[n]={tween:new o,time:a,ease:i.ease,delay:i.delay,duration:i.duration},++r.count,Ks.timer(function(i){function o(i){return r.active>n?c():(r.active=n,s.event&&s.event.start.call(t,u,e),s.tween.forEach(function(n,i){(i=i.call(t,u,e))&&m.push(i)}),Ks.timer(function(){return p.c=l(i||1)?Ce:l,1},0,a),void 0)}function l(i){if(r.active!==n)return c();for(var o=i/d,a=h(o),l=m.length;l>0;)m[--l].call(t,a);return o>=1?(s.event&&s.event.end.call(t,u,e),c()):void 0}function c(){return--r.count?delete r[n]:delete t.__transition__,1}var u=t.__data__,h=s.ease,f=s.delay,d=s.duration,p=Qo,m=[];return p.t=f+a,i>=f?o(i-f):(p.c=o,void 0)},0,a)}}function Bs(t,e){t.attr("transform",function(t){return"translate("+e(t)+",0)"})}function Us(t,e){t.attr("transform",function(t){return"translate(0,"+e(t)+")"})}function Ws(t){return t.toISOString()}function Ys(t,e,n){function i(e){return t(e)}function r(t,n){var i=t[1]-t[0],r=i/n,s=Ks.bisect(Vl,r);return s==Vl.length?[e.year,Xr(t.map(function(t){return t/31536e6}),n)[2]]:s?e[r/Vl[s-1]<Vl[s]/r?s-1:s]:[Ul,Xr(t,n)[2]]}return i.invert=function(e){return Xs(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(Xs)},i.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,Xs(+n+1),e).length}var s=i.domain(),o=Fr(s),a=null==t?r(o,10):"number"==typeof t&&r(o,t);return a&&(t=a[0],e=a[1]),i.domain(Vr(s,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=Xs(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=Xs(+e+1);return e}}:t))},i.ticks=function(t,e){var n=Fr(i.domain()),s=null==t?r(n,10):"number"==typeof t?r(n,t):!t.range&&[{range:t},e];return s&&(t=s[0],e=s[1]),t.range(n[0],Xs(+n[1]+1),1>e?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Ys(t.copy(),e,n)},Wr(i,t)}function Xs(t){return new Date(t)}function Js(t){return JSON.parse(t.responseText)}function Gs(t){var e=to.createRange();return e.selectNode(to.body),e.createContextualFragment(t.responseText)}var Ks={version:"3.4.6"};Date.now||(Date.now=function(){return+new Date});var Zs=[].slice,Qs=function(t){return Zs.call(t)},to=document,eo=to.documentElement,no=window;try{Qs(eo.childNodes)[0].nodeType}catch(Xl){Qs=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}try{to.createElement("div").style.setProperty("opacity",0,"")}catch(Jl){var io=no.Element.prototype,ro=io.setAttribute,so=io.setAttributeNS,oo=no.CSSStyleDeclaration.prototype,ao=oo.setProperty;io.setAttribute=function(t,e){ro.call(this,t,e+"")},io.setAttributeNS=function(t,e,n){so.call(this,t,e,n+"")},oo.setProperty=function(t,e,n){ao.call(this,t,e+"",n)}}Ks.ascending=t,Ks.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},Ks.min=function(t,e){var n,i,r=-1,s=t.length;if(1===arguments.length){for(;++r<s&&!(null!=(n=t[r])&&n>=n);)n=void 0;for(;++r<s;)null!=(i=t[r])&&n>i&&(n=i)}else{for(;++r<s&&!(null!=(n=e.call(t,t[r],r))&&n>=n);)n=void 0;for(;++r<s;)null!=(i=e.call(t,t[r],r))&&n>i&&(n=i)}return n},Ks.max=function(t,e){var n,i,r=-1,s=t.length;if(1===arguments.length){for(;++r<s&&!(null!=(n=t[r])&&n>=n);)n=void 0;for(;++r<s;)null!=(i=t[r])&&i>n&&(n=i)}else{for(;++r<s&&!(null!=(n=e.call(t,t[r],r))&&n>=n);)n=void 0;for(;++r<s;)null!=(i=e.call(t,t[r],r))&&i>n&&(n=i)}return n},Ks.extent=function(t,e){var n,i,r,s=-1,o=t.length;if(1===arguments.length){for(;++s<o&&!(null!=(n=r=t[s])&&n>=n);)n=r=void 0;for(;++s<o;)null!=(i=t[s])&&(n>i&&(n=i),i>r&&(r=i))}else{for(;++s<o&&!(null!=(n=r=e.call(t,t[s],s))&&n>=n);)n=void 0;for(;++s<o;)null!=(i=e.call(t,t[s],s))&&(n>i&&(n=i),i>r&&(r=i))}return[n,r]},Ks.sum=function(t,e){var n,i=0,r=t.length,s=-1;if(1===arguments.length)for(;++s<r;)isNaN(n=+t[s])||(i+=n);else for(;++s<r;)isNaN(n=+e.call(t,t[s],s))||(i+=n);return i},Ks.mean=function(t,n){var i,r=0,s=t.length,o=-1,a=s;if(1===arguments.length)for(;++o<s;)e(i=t[o])?r+=i:--a;else for(;++o<s;)e(i=n.call(t,t[o],o))?r+=i:--a;return a?r/a:void 0},Ks.quantile=function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],s=n-i;return s?r+s*(t[i]-r):r},Ks.median=function(n,i){return arguments.length>1&&(n=n.map(i)),n=n.filter(e),n.length?Ks.quantile(n.sort(t),.5):void 0};var lo=n(t);Ks.bisectLeft=lo.left,Ks.bisect=Ks.bisectRight=lo.right,Ks.bisector=function(e){return n(1===e.length?function(n,i){return t(e(n),i)}:e)},Ks.shuffle=function(t){for(var e,n,i=t.length;i;)n=0|Math.random()*i--,e=t[i],t[i]=t[n],t[n]=e;return t},Ks.permute=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},Ks.pairs=function(t){for(var e,n=0,i=t.length-1,r=t[0],s=new Array(0>i?0:i);i>n;)s[n]=[e=r,r=t[++n]];return s},Ks.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=Ks.min(arguments,i),n=new Array(e);++t<e;)for(var r,s=-1,o=n[t]=new Array(r);++s<r;)o[s]=arguments[s][t];return n},Ks.transpose=function(t){return Ks.zip.apply(Ks,t)},Ks.keys=function(t){var e=[];for(var n in t)e.push(n);return e},Ks.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},Ks.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Ks.merge=function(t){for(var e,n,i,r=t.length,s=-1,o=0;++s<r;)o+=t[s].length;for(n=new Array(o);--r>=0;)for(i=t[r],e=i.length;--e>=0;)n[--o]=i[e];return n};var co=Math.abs;Ks.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),1/0===(e-t)/n)throw new Error("infinite range");var i,s=[],o=r(co(n)),a=-1;if(t*=o,e*=o,n*=o,0>n)for(;(i=t+n*++a)>e;)s.push(i/o);else for(;(i=t+n*++a)<e;)s.push(i/o);return s},Ks.map=function(t){var e=new o;if(t instanceof o)t.forEach(function(t,n){e.set(t,n)});else for(var n in t)e.set(n,t[n]);return e},s(o,{has:a,get:function(t){return this[uo+t]},set:function(t,e){return this[uo+t]=e},remove:l,keys:c,values:function(){var t=[];return this.forEach(function(e,n){t.push(n)}),t},entries:function(){var t=[];return this.forEach(function(e,n){t.push({key:e,value:n})}),t},size:u,empty:h,forEach:function(t){for(var e in this)e.charCodeAt(0)===ho&&t.call(this,e.substring(1),this[e])}});var uo="\0",ho=uo.charCodeAt(0);Ks.nest=function(){function t(e,a,l){if(l>=s.length)return i?i.call(r,a):n?a.sort(n):a;for(var c,u,h,f,d=-1,p=a.length,m=s[l++],g=new o;++d<p;)(f=g.get(c=m(u=a[d])))?f.push(u):g.set(c,[u]);return e?(u=e(),h=function(n,i){u.set(n,t(e,i,l))}):(u={},h=function(n,i){u[n]=t(e,i,l)}),g.forEach(h),u}function e(t,n){if(n>=s.length)return t;var i=[],r=a[n++];return t.forEach(function(t,r){i.push({key:t,values:e(r,n)})}),r?i.sort(function(t,e){return r(t.key,e.key)}):i}var n,i,r={},s=[],a=[];return r.map=function(e,n){return t(n,e,0)},r.entries=function(n){return e(t(Ks.map,n,0),0)},r.key=function(t){return s.push(t),r},r.sortKeys=function(t){return a[s.length-1]=t,r},r.sortValues=function(t){return n=t,r},r.rollup=function(t){return i=t,r},r},Ks.set=function(t){var e=new f;if(t)for(var n=0,i=t.length;i>n;++n)e.add(t[n]);return e},s(f,{has:a,add:function(t){return this[uo+t]=!0,t},remove:function(t){return t=uo+t,t in this&&delete this[t]},values:c,size:u,empty:h,forEach:function(t){for(var e in this)e.charCodeAt(0)===ho&&t.call(this,e.substring(1))}}),Ks.behavior={},Ks.rebind=function(t,e){for(var n,i=1,r=arguments.length;++i<r;)t[n=arguments[i]]=d(t,e,e[n]);return t};var fo=["webkit","ms","moz","Moz","o","O"];Ks.dispatch=function(){for(var t=new g,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=_(t);return t},g.prototype.on=function(t,e){var n=t.indexOf("."),i="";if(n>=0&&(i=t.substring(n+1),t=t.substring(0,n)),t)return arguments.length<2?this[t].on(i):this[t].on(i,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(i,null);return this}},Ks.event=null,Ks.requote=function(t){return t.replace(po,"\\$&")};var po=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,mo={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},go=function(t,e){return e.querySelector(t)},_o=function(t,e){return e.querySelectorAll(t)},vo=eo[p(eo,"matchesSelector")],yo=function(t,e){return vo.call(t,e)};"function"==typeof Sizzle&&(go=function(t,e){return Sizzle(t,e)[0]||null},_o=Sizzle,yo=Sizzle.matchesSelector),Ks.selection=function(){return ko};var bo=Ks.selection.prototype=[];bo.select=function(t){var e,n,i,r,s=[];t=w(t);for(var o=-1,a=this.length;++o<a;){s.push(e=[]),e.parentNode=(i=this[o]).parentNode;for(var l=-1,c=i.length;++l<c;)(r=i[l])?(e.push(n=t.call(r,r.__data__,l,o)),n&&"__data__"in r&&(n.__data__=r.__data__)):e.push(null)}return x(s)},bo.selectAll=function(t){var e,n,i=[];t=k(t);for(var r=-1,s=this.length;++r<s;)for(var o=this[r],a=-1,l=o.length;++a<l;)(n=o[a])&&(i.push(e=Qs(t.call(n,n.__data__,a,r))),e.parentNode=n);return x(i)};var xo={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Ks.ns={prefix:xo,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.substring(0,e),t=t.substring(e+1)),xo.hasOwnProperty(n)?{space:xo[n],local:t}:t}},bo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=Ks.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(S(e,t[e]));return this}return this.each(S(t,e))},bo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),i=(t=C(t)).length,r=-1;if(e=n.classList){for(;++r<i;)if(!e.contains(t[r]))return!1}else for(e=n.getAttribute("class");++r<i;)if(!T(t[r]).test(e))return!1;return!0}for(e in t)this.each(A(e,t[e]));return this}return this.each(A(t,e))},bo.style=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(E(n,t[n],e));return this}if(2>i)return no.getComputedStyle(this.node(),null).getPropertyValue(t);n=""}return this.each(E(t,e,n))},bo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},bo.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},bo.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},bo.append=function(t){return t=z(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},bo.insert=function(t,e){return t=z(t),e=w(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},bo.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},bo.data=function(t,e){function n(t,n){var i,r,s,a=t.length,h=n.length,f=Math.min(a,h),d=new Array(h),p=new Array(h),m=new Array(a);if(e){var g,_=new o,v=new o,y=[];for(i=-1;++i<a;)g=e.call(r=t[i],r.__data__,i),_.has(g)?m[i]=r:_.set(g,r),y.push(g);for(i=-1;++i<h;)g=e.call(n,s=n[i],i),(r=_.get(g))?(d[i]=r,r.__data__=s):v.has(g)||(p[i]=P(s)),v.set(g,s),_.remove(g);for(i=-1;++i<a;)_.has(y[i])&&(m[i]=t[i])}else{for(i=-1;++i<f;)r=t[i],s=n[i],r?(r.__data__=s,d[i]=r):p[i]=P(s);for(;h>i;++i)p[i]=P(n[i]);for(;a>i;++i)m[i]=t[i]}p.update=d,p.parentNode=d.parentNode=m.parentNode=t.parentNode,l.push(p),c.push(d),u.push(m)}var i,r,s=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(i=this[0]).length);++s<a;)(r=i[s])&&(t[s]=r.__data__);return t}var l=R([]),c=x([]),u=x([]);if("function"==typeof t)for(;++s<a;)n(i=this[s],t.call(i,i.parentNode.__data__,s));else for(;++s<a;)n(i=this[s],t);return c.enter=function(){return l},c.exit=function(){return u},c},bo.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},bo.filter=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=j(t));for(var s=0,o=this.length;o>s;s++){r.push(e=[]),e.parentNode=(n=this[s]).parentNode;for(var a=0,l=n.length;l>a;a++)(i=n[a])&&t.call(i,i.__data__,a,s)&&e.push(i)}return x(r)},bo.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],r=i.length-1,s=i[r];--r>=0;)(n=i[r])&&(s&&s!==n.nextSibling&&s.parentNode.insertBefore(n,s),s=n);return this},bo.sort=function(t){t=I.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},bo.each=function(t){return $(this,function(e,n,i){t.call(e,e.__data__,n,i)})},bo.call=function(t){var e=Qs(arguments);return t.apply(e[0]=this,e),this},bo.empty=function(){return!this.node()},bo.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],i=0,r=n.length;r>i;i++){var s=n[i];if(s)return s}return null},bo.size=function(){var t=0;return this.each(function(){++t}),t};var wo=[];Ks.selection.enter=R,Ks.selection.enter.prototype=wo,wo.append=bo.append,wo.empty=bo.empty,wo.node=bo.node,wo.call=bo.call,wo.size=bo.size,wo.select=function(t){for(var e,n,i,r,s,o=[],a=-1,l=this.length;++a<l;){i=(r=this[a]).update,o.push(e=[]),e.parentNode=r.parentNode;for(var c=-1,u=r.length;++c<u;)(s=r[c])?(e.push(i[c]=n=t.call(r.parentNode,s.__data__,c,a)),n.__data__=s.__data__):e.push(null)}return x(o)},wo.insert=function(t,e){return arguments.length<2&&(e=L(this)),bo.insert.call(this,t,e)},bo.transition=function(){for(var t,e,n=Dl||++jl,i=[],r=El||{time:Date.now(),ease:Si,delay:0,duration:250},s=-1,o=this.length;++s<o;){i.push(t=[]);for(var a=this[s],l=-1,c=a.length;++l<c;)(e=a[l])&&qs(e,l,n,r),t.push(e)}return Os(i,n)},bo.interrupt=function(){return this.each(F)},Ks.select=function(t){var e=["string"==typeof t?go(t,to):t];return e.parentNode=eo,x([e])},Ks.selectAll=function(t){var e=Qs("string"==typeof t?_o(t,to):t);return e.parentNode=eo,x([e])};var ko=Ks.select(eo);bo.on=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e=!1);for(n in t)this.each(O(n,t[n],e));return this}if(2>i)return(i=this.node()["__on"+t])&&i._;n=!1}return this.each(O(t,e,n))};var So=Ks.map({mouseenter:"mouseover",mouseleave:"mouseout"});So.forEach(function(t){"on"+t in to&&So.remove(t)});var Mo="onselectstart"in to?null:p(eo.style,"userSelect"),To=0;Ks.mouse=function(t){return B(t,y())},Ks.touches=function(t,e){return arguments.length<2&&(e=y().touches),e?Qs(e).map(function(e){var n=B(t,e);return n.identifier=e.identifier,n}):[]},Ks.behavior.drag=function(){function t(){this.on("mousedown.drag",r).on("touchstart.drag",s)}function e(t,e,r,s,o){return function(){function a(){var t,n,i=e(f,m);i&&(t=i[0]-y[0],n=i[1]-y[1],p|=t|n,y=i,d({type:"drag",x:i[0]+c[0],y:i[1]+c[1],dx:t,dy:n}))}function l(){e(f,m)&&(_.on(s+g,null).on(o+g,null),v(p&&Ks.event.target===h),d({type:"dragend"}))}var c,u=this,h=Ks.event.target,f=u.parentNode,d=n.of(u,arguments),p=0,m=t(),g=".drag"+(null==m?"":"-"+m),_=Ks.select(r()).on(s+g,a).on(o+g,l),v=q(),y=e(f,m);i?(c=i.apply(u,arguments),c=[c.x-y[0],c.y-y[1]]):c=[0,0],d({type:"dragstart"})}}var n=b(t,"drag","dragstart","dragend"),i=null,r=e(m,Ks.mouse,Y,"mousemove","mouseup"),s=e(U,Ks.touch,W,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},Ks.rebind(t,n,"on")};var Co=Math.PI,Ao=2*Co,Do=Co/2,Eo=1e-6,No=Eo*Eo,zo=Co/180,Po=180/Co,jo=Math.SQRT2,Io=2,$o=4;Ks.interpolateZoom=function(t,e){function n(t){var e=t*v;if(_){var n=Q(m),o=s/(Io*f)*(n*tt(jo*e+m)-Z(m));return[i+o*c,r+o*u,s*n/Q(jo*e+m)]}return[i+t*c,r+t*u,s*Math.exp(jo*e)]}var i=t[0],r=t[1],s=t[2],o=e[0],a=e[1],l=e[2],c=o-i,u=a-r,h=c*c+u*u,f=Math.sqrt(h),d=(l*l-s*s+$o*h)/(2*s*Io*f),p=(l*l-s*s-$o*h)/(2*l*Io*f),m=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(p*p+1)-p),_=g-m,v=(_||Math.log(l/s))/jo;return n.duration=1e3*v,n},Ks.behavior.zoom=function(){function t(t){t.on(C,c).on(Fo+".zoom",h).on(A,f).on("dblclick.zoom",d).on(E,u)}function e(t){return[(t[0]-S.x)/S.k,(t[1]-S.y)/S.k]}function n(t){return[t[0]*S.k+S.x,t[1]*S.k+S.y]}function i(t){S.k=Math.max(T[0],Math.min(T[1],t))}function r(t,e){e=n(e),S.x+=t[0]-e[0],S.y+=t[1]-e[1]}function s(){x&&x.domain(y.range().map(function(t){return(t-S.x)/S.k}).map(y.invert)),k&&k.domain(w.range().map(function(t){return(t-S.y)/S.k}).map(w.invert))}function o(t){t({type:"zoomstart"})}function a(t){s(),t({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function l(t){t({type:"zoomend"})}function c(){function t(){u=1,r(Ks.mouse(i),d),a(c)}function n(){h.on(A,no===i?f:null).on(D,null),p(u&&Ks.event.target===s),l(c)}var i=this,s=Ks.event.target,c=N.of(i,arguments),u=0,h=Ks.select(no).on(A,t).on(D,n),d=e(Ks.mouse(i)),p=q();F.call(i),o(c)}function u(){function t(){var t=Ks.touches(d);return f=S.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))}),t}function n(){for(var e=Ks.event.changedTouches,n=0,s=e.length;s>n;++n)m[e[n].identifier]=null;var o=t(),l=Date.now();if(1===o.length){if(500>l-_){var c=o[0],u=m[c.identifier];i(2*S.k),r(c,u),v(),a(p)}_=l}else if(o.length>1){var c=o[0],h=o[1],f=c[0]-h[0],d=c[1]-h[1];g=f*f+d*d}}function s(){for(var t,e,n,s,o=Ks.touches(d),l=0,c=o.length;c>l;++l,s=null)if(n=o[l],s=m[n.identifier]){if(e)break;t=n,e=s}if(s){var u=(u=n[0]-t[0])*u+(u=n[1]-t[1])*u,h=g&&Math.sqrt(u/g);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+s[0])/2,(e[1]+s[1])/2],i(h*f)}_=null,r(t,e),a(p)}function h(){if(Ks.event.touches.length){for(var e=Ks.event.changedTouches,n=0,i=e.length;i>n;++n)delete m[e[n].identifier];for(var r in m)return void t()}w.on(y,null),k.on(C,c).on(E,u),M(),l(p)}var f,d=this,p=N.of(d,arguments),m={},g=0,y=".zoom-"+Ks.event.changedTouches[0].identifier,b="touchmove"+y,x="touchend"+y,w=Ks.select(Ks.event.target).on(b,s).on(x,h),k=Ks.select(d).on(C,null).on(E,n),M=q();F.call(d),n(),o(p)}function h(){var t=N.of(this,arguments);g?clearTimeout(g):(F.call(this),o(t)),g=setTimeout(function(){g=null,l(t)},50),v();var n=m||Ks.mouse(this);p||(p=e(n)),i(Math.pow(2,.002*Ro())*S.k),r(n,p),a(t)}function f(){p=null}function d(){var t=N.of(this,arguments),n=Ks.mouse(this),s=e(n),c=Math.log(S.k)/Math.LN2;o(t),i(Math.pow(2,Ks.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)),r(n,s),a(t),l(t)}var p,m,g,_,y,x,w,k,S={x:0,y:0,k:1},M=[960,500],T=Lo,C="mousedown.zoom",A="mousemove.zoom",D="mouseup.zoom",E="touchstart.zoom",N=b(t,"zoomstart","zoom","zoomend");return t.event=function(t){t.each(function(){var t=N.of(this,arguments),e=S;Dl?Ks.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(t)}).tween("zoom:zoom",function(){var n=M[0],i=M[1],r=n/2,s=i/2,o=Ks.interpolateZoom([(r-S.x)/S.k,(s-S.y)/S.k,n/S.k],[(r-e.x)/e.k,(s-e.y)/e.k,n/e.k]);return function(e){var i=o(e),l=n/i[2];this.__chart__=S={x:r-i[0]*l,y:s-i[1]*l,k:l},a(t)}}).each("end.zoom",function(){l(t)}):(this.__chart__=S,o(t),a(t),l(t))})},t.translate=function(e){return arguments.length?(S={x:+e[0],y:+e[1],k:S.k},s(),t):[S.x,S.y]},t.scale=function(e){return arguments.length?(S={x:S.x,y:S.y,k:+e},s(),t):S.k},t.scaleExtent=function(e){return arguments.length?(T=null==e?Lo:[+e[0],+e[1]],t):T},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(M=e&&[+e[0],+e[1]],t):M},t.x=function(e){return arguments.length?(x=e,y=e.copy(),S={x:0,y:0,k:1},t):x},t.y=function(e){return arguments.length?(k=e,w=e.copy(),S={x:0,y:0,k:1},t):k},Ks.rebind(t,N,"on")};var Ro,Lo=[0,1/0],Fo="onwheel"in to?(Ro=function(){return-Ks.event.deltaY*(Ks.event.deltaMode?120:1)},"wheel"):"onmousewheel"in to?(Ro=function(){return Ks.event.wheelDelta},"mousewheel"):(Ro=function(){return-Ks.event.detail},"MozMousePixelScroll");nt.prototype.toString=function(){return this.rgb()+""},Ks.hsl=function(t,e,n){return 1===arguments.length?t instanceof rt?it(t.h,t.s,t.l):xt(""+t,wt,it):it(+t,+e,+n)};var Oo=rt.prototype=new nt;Oo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),it(this.h,this.s,this.l/t)},Oo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),it(this.h,this.s,t*this.l)},Oo.rgb=function(){return st(this.h,this.s,this.l)},Ks.hcl=function(t,e,n){return 1===arguments.length?t instanceof at?ot(t.h,t.c,t.l):t instanceof ut?ft(t.l,t.a,t.b):ft((t=kt((t=Ks.rgb(t)).r,t.g,t.b)).l,t.a,t.b):ot(+t,+e,+n)};var Ho=at.prototype=new nt;Ho.brighter=function(t){return ot(this.h,this.c,Math.min(100,this.l+Vo*(arguments.length?t:1)))},Ho.darker=function(t){return ot(this.h,this.c,Math.max(0,this.l-Vo*(arguments.length?t:1)))},Ho.rgb=function(){return lt(this.h,this.c,this.l).rgb()},Ks.lab=function(t,e,n){return 1===arguments.length?t instanceof ut?ct(t.l,t.a,t.b):t instanceof at?lt(t.l,t.c,t.h):kt((t=Ks.rgb(t)).r,t.g,t.b):ct(+t,+e,+n)};var Vo=18,qo=.95047,Bo=1,Uo=1.08883,Wo=ut.prototype=new nt;Wo.brighter=function(t){return ct(Math.min(100,this.l+Vo*(arguments.length?t:1)),this.a,this.b)},Wo.darker=function(t){return ct(Math.max(0,this.l-Vo*(arguments.length?t:1)),this.a,this.b)},Wo.rgb=function(){return ht(this.l,this.a,this.b)},Ks.rgb=function(t,e,n){return 1===arguments.length?t instanceof yt?vt(t.r,t.g,t.b):xt(""+t,vt,st):vt(~~t,~~e,~~n)};var Yo=yt.prototype=new nt;Yo.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b,r=30;return e||n||i?(e&&r>e&&(e=r),n&&r>n&&(n=r),i&&r>i&&(i=r),vt(Math.min(255,~~(e/t)),Math.min(255,~~(n/t)),Math.min(255,~~(i/t)))):vt(r,r,r)},Yo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),vt(~~(t*this.r),~~(t*this.g),~~(t*this.b))},Yo.hsl=function(){return wt(this.r,this.g,this.b)},Yo.toString=function(){return"#"+bt(this.r)+bt(this.g)+bt(this.b)};var Xo=Ks.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,
723lightcyan: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,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});Xo.forEach(function(t,e){Xo.set(t,gt(e))}),Ks.functor=Tt,Ks.xhr=At(Ct),Ks.dsv=function(t,e){function n(t,n,s){arguments.length<3&&(s=n,n=null);var o=Dt(t,e,null==n?i:r(n),s);return o.row=function(t){return arguments.length?o.response(null==(n=t)?i:r(t)):n},o}function i(t){return n.parse(t.responseText)}function r(t){return function(e){return n.parse(e.responseText,t)}}function s(e){return e.map(o).join(t)}function o(t){return a.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var a=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return n.parse=function(t,e){var i;return n.parseRows(t,function(t,n){if(i)return i(t,n-1);var r=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");i=e?function(t,n){return e(r(t),n)}:r})},n.parseRows=function(t,e){function n(){if(u>=c)return o;if(r)return r=!1,s;var e=u;if(34===t.charCodeAt(e)){for(var n=e;n++<c;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}u=n+2;var i=t.charCodeAt(n+1);return 13===i?(r=!0,10===t.charCodeAt(n+2)&&++u):10===i&&(r=!0),t.substring(e+1,n).replace(/""/g,'"')}for(;c>u;){var i=t.charCodeAt(u++),a=1;if(10===i)r=!0;else if(13===i)r=!0,10===t.charCodeAt(u)&&(++u,++a);else if(i!==l)continue;return t.substring(e,u-a)}return t.substring(e)}for(var i,r,s={},o={},a=[],c=t.length,u=0,h=0;(i=n())!==o;){for(var f=[];i!==s&&i!==o;)f.push(i),i=n();(!e||(f=e(f,h++)))&&a.push(f)}return a},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var i=new f,r=[];return e.forEach(function(t){for(var e in t)i.has(e)||r.push(i.add(e))}),[r.map(o).join(t)].concat(e.map(function(e){return r.map(function(t){return o(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(s).join("\n")},n},Ks.csv=Ks.dsv(",","text/csv"),Ks.tsv=Ks.dsv("\t","text/tab-separated-values"),Ks.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=y().changedTouches),e)for(var i,r=0,s=e.length;s>r;++r)if((i=e[r]).identifier===n)return B(t,i)};var Jo,Go,Ko,Zo,Qo,ta=no[p(no,"requestAnimationFrame")]||function(t){setTimeout(t,17)};Ks.timer=function(t,e,n){var i=arguments.length;2>i&&(e=0),3>i&&(n=Date.now());var r=n+e,s={c:t,t:r,f:!1,n:null};Go?Go.n=s:Jo=s,Go=s,Ko||(Zo=clearTimeout(Zo),Ko=1,ta(Nt))},Ks.timer.flush=function(){zt(),Pt()},Ks.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ea=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(It);Ks.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=Ks.round(t,jt(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ea[8+n/3]};var na=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ia=Ks.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Ks.round(t,jt(t,e))).toFixed(Math.max(0,Math.min(20,jt(t*(1+1e-15),e))))}}),ra=Ks.time={},sa=Date;Lt.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(){oa.setUTCDate.apply(this._,arguments)},setDay:function(){oa.setUTCDay.apply(this._,arguments)},setFullYear:function(){oa.setUTCFullYear.apply(this._,arguments)},setHours:function(){oa.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){oa.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){oa.setUTCMinutes.apply(this._,arguments)},setMonth:function(){oa.setUTCMonth.apply(this._,arguments)},setSeconds:function(){oa.setUTCSeconds.apply(this._,arguments)},setTime:function(){oa.setTime.apply(this._,arguments)}};var oa=Date.prototype;ra.year=Ft(function(t){return t=ra.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ra.years=ra.year.range,ra.years.utc=ra.year.utc.range,ra.day=Ft(function(t){var e=new sa(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ra.days=ra.day.range,ra.days.utc=ra.day.utc.range,ra.dayOfYear=function(t){var e=ra.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=ra[t]=Ft(function(t){return(t=ra.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=ra.year(t).getDay();return Math.floor((ra.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});ra[t+"s"]=n.range,ra[t+"s"].utc=n.utc.range,ra[t+"OfYear"]=function(t){var n=ra.year(t).getDay();return Math.floor((ra.dayOfYear(t)+(n+e)%7)/7)}}),ra.week=ra.sunday,ra.weeks=ra.sunday.range,ra.weeks.utc=ra.sunday.utc.range,ra.weekOfYear=ra.sundayOfYear;var aa={"-":"",_:" ",0:"0"},la=/^\s*\d+/,ca=/^%/;Ks.locale=function(t){return{numberFormat:$t(t),timeFormat:Ht(t)}};var ua=Ks.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","Frid
723ay","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"]});Ks.format=ua.numberFormat,Ks.geo={},le.prototype={s:0,t:0,add:function(t){ce(t,this.t,ha),ce(ha.s,this.s,this),this.s?this.t+=ha.t:this.s=ha.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ha=new le;Ks.geo.stream=function(t,e){t&&fa.hasOwnProperty(t.type)?fa[t.type](t,e):ue(t,e)};var fa={Feature:function(t,e){ue(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)ue(n[i].geometry,e)}},da={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){he(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)he(n[i],e,0)},Polygon:function(t,e){fe(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)fe(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)ue(n[i],e)}};Ks.geo.area=function(t){return pa=0,Ks.geo.stream(t,ga),pa};var pa,ma=new le,ga={sphere:function(){pa+=4*Co},point:m,lineStart:m,lineEnd:m,polygonStart:function(){ma.reset(),ga.lineStart=de},polygonEnd:function(){var t=2*ma;pa+=0>t?4*Co+t:t,ga.lineStart=ga.lineEnd=ga.point=m}};Ks.geo.bounds=function(){function t(t,e){y.push(b=[u=t,f=t]),h>e&&(h=e),e>d&&(d=e)}function e(e,n){var i=pe([e*zo,n*zo]);if(_){var r=ge(_,i),s=[r[1],-r[0],0],o=ge(s,r);ye(o),o=be(o);var l=e-p,c=l>0?1:-1,m=o[0]*Po*c,g=co(l)>180;if(g^(m>c*p&&c*e>m)){var v=o[1]*Po;v>d&&(d=v)}else if(m=(m+360)%360-180,g^(m>c*p&&c*e>m)){var v=-o[1]*Po;h>v&&(h=v)}else h>n&&(h=n),n>d&&(d=n);g?p>e?a(u,e)>a(u,f)&&(f=e):a(e,f)>a(u,f)&&(u=e):f>=u?(u>e&&(u=e),e>f&&(f=e)):e>p?a(u,e)>a(u,f)&&(f=e):a(e,f)>a(u,f)&&(u=e)}else t(e,n);_=i,p=e}function n(){x.point=e}function i(){b[0]=u,b[1]=f,x.point=t,_=null}function r(t,n){if(_){var i=t-p;v+=co(i)>180?i+(i>0?360:-360):i}else m=t,g=n;ga.point(t,n),e(t,n)}function s(){ga.lineStart()}function o(){r(m,g),ga.lineEnd(),co(v)>Eo&&(u=-(f=180)),b[0]=u,b[1]=f,_=null}function a(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,h,f,d,p,m,g,_,v,y,b,x={point:t,lineStart:n,lineEnd:i,polygonStart:function(){x.point=r,x.lineStart=s,x.lineEnd=o,v=0,ga.polygonStart()},polygonEnd:function(){ga.polygonEnd(),x.point=t,x.lineStart=n,x.lineEnd=i,0>ma?(u=-(f=180),h=-(d=90)):v>Eo?d=90:-Eo>v&&(h=-90),b[0]=u,b[1]=f}};return function(t){d=f=-(u=h=1/0),y=[],Ks.geo.stream(t,x);var e=y.length;if(e){y.sort(l);for(var n,i=1,r=y[0],s=[r];e>i;++i)n=y[i],c(n[0],r)||c(n[1],r)?(a(r[0],n[1])>a(r[0],r[1])&&(r[1]=n[1]),a(n[0],r[1])>a(r[0],r[1])&&(r[0]=n[0])):s.push(r=n);for(var o,n,p=-1/0,e=s.length-1,i=0,r=s[e];e>=i;r=n,++i)n=s[i],(o=a(r[1],n[0]))>p&&(p=o,u=n[0],f=r[1])}return y=b=null,1/0===u||1/0===h?[[0/0,0/0],[0/0,0/0]]:[[u,h],[f,d]]}}(),Ks.geo.centroid=function(t){_a=va=ya=ba=xa=wa=ka=Sa=Ma=Ta=Ca=0,Ks.geo.stream(t,Aa);var e=Ma,n=Ta,i=Ca,r=e*e+n*n+i*i;return No>r&&(e=wa,n=ka,i=Sa,Eo>va&&(e=ya,n=ba,i=xa),r=e*e+n*n+i*i,No>r)?[0/0,0/0]:[Math.atan2(n,e)*Po,K(i/Math.sqrt(r))*Po]};var _a,va,ya,ba,xa,wa,ka,Sa,Ma,Ta,Ca,Aa={sphere:m,point:we,lineStart:Se,lineEnd:Me,polygonStart:function(){Aa.lineStart=Te},polygonEnd:function(){Aa.lineStart=Se}},Da=Ne(Ce,$e,Le,[-Co,-Co/2]),Ea=1e9;Ks.geo.clipExtent=function(){var t,e,n,i,r,s,o={stream:function(t){return r&&(r.valid=!1),r=s(t),r.valid=!0,r},extent:function(a){return arguments.length?(s=He(t=+a[0][0],e=+a[0][1],n=+a[1][0],i=+a[1][1]),r&&(r.valid=!1,r=null),o):[[t,e],[n,i]]}};return o.extent([[0,0],[960,500]])},(Ks.geo.conicEqualArea=function(){return qe(Be)}).raw=Be,Ks.geo.albers=function(){return Ks.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Ks.geo.albersUsa=function(){function t(t){var s=t[0],o=t[1];return e=null,n(s,o),e||(i(s,o),e)||r(s,o),e}var e,n,i,r,s=Ks.geo.albers(),o=Ks.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Ks.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=s.scale(),n=s.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&.234>r&&i>=-.425&&-.214>i?o:r>=.166&&.234>r&&i>=-.214&&-.115>i?a:s).invert(t)},t.stream=function(t){var e=s.stream(t),n=o.stream(t),i=a.stream(t);return{point:function(t,r){e.point(t,r),n.point(t,r),i.point(t,r)},sphere:function(){e.sphere(),n.sphere(),i.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),i.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),i.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),i.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),i.polygonEnd()}}},t.precision=function(e){return arguments.length?(s.precision(e),o.precision(e),a.precision(e),t):s.precision()},t.scale=function(e){return arguments.length?(s.scale(e),o.scale(.35*e),a.scale(e),t.translate(s.translate())):s.scale()},t.translate=function(e){if(!arguments.length)return s.translate();var c=s.scale(),u=+e[0],h=+e[1];return n=s.translate(e).clipExtent([[u-.455*c,h-.238*c],[u+.455*c,h+.238*c]]).stream(l).point,i=o.translate([u-.307*c,h+.201*c]).clipExtent([[u-.425*c+Eo,h+.12*c+Eo],[u-.214*c-Eo,h+.234*c-Eo]]).stream(l).point,r=a.translate([u-.205*c,h+.212*c]).clipExtent([[u-.214*c+Eo,h+.166*c+Eo],[u-.115*c-Eo,h+.234*c-Eo]]).stream(l).point,t},t.scale(1070)};var Na,za,Pa,ja,Ia,$a,Ra={point:m,lineStart:m,lineEnd:m,polygonStart:function(){za=0,Ra.lineStart=Ue},polygonEnd:function(){Ra.lineStart=Ra.lineEnd=Ra.point=m,Na+=co(za/2)}},La={point:We,lineStart:m,lineEnd:m,polygonStart:m,polygonEnd:m},Fa={point:Je,lineStart:Ge,lineEnd:Ke,polygonStart:function(){Fa.lineStart=Ze},polygonEnd:function(){Fa.point=Je,Fa.lineStart=Ge,Fa.lineEnd=Ke}};Ks.geo.path=function(){function t(t){return t&&("function"==typeof a&&s.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=r(s)),Ks.geo.stream(t,o)),s.result()}function e(){return o=null,t}var n,i,r,s,o,a=4.5;return t.area=function(t){return Na=0,Ks.geo.stream(t,r(Ra)),Na},t.centroid=function(t){return ya=ba=xa=wa=ka=Sa=Ma=Ta=Ca=0,Ks.geo.stream(t,r(Fa)),Ca?[Ma/Ca,Ta/Ca]:Sa?[wa/Sa,ka/Sa]:xa?[ya/xa,ba/xa]:[0/0,0/0]},t.bounds=function(t){return Ia=$a=-(Pa=ja=1/0),Ks.geo.stream(t,r(La)),[[Pa,ja],[Ia,$a]]},t.projection=function(t){return arguments.length?(r=(n=t)?t.stream||en(t):Ct,e()):n},t.context=function(t){return arguments.length?(s=null==(i=t)?new Ye:new Qe(t),"function"!=typeof a&&s.pointRadius(a),e()):i},t.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(s.pointRadius(+e),+e),t):a},t.projection(Ks.geo.albersUsa()).context(null)}
vendor: 9,296 bytes, line 723
723,Ks.geo.transform=function(t){return{stream:function(e){var n=new nn(e);for(var i in t)n[i]=t[i];return n}}},nn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Ks.geo.projection=sn,Ks.geo.projectionMutator=on,(Ks.geo.equirectangular=function(){return sn(ln)}).raw=ln.invert=ln,Ks.geo.rotation=function(t){function e(e){return e=t(e[0]*zo,e[1]*zo),e[0]*=Po,e[1]*=Po,e}return t=un(t[0]%360*zo,t[1]*zo,t.length>2?t[2]*zo:0),e.invert=function(e){return e=t.invert(e[0]*zo,e[1]*zo),e[0]*=Po,e[1]*=Po,e},e},cn.invert=ln,Ks.geo.circle=function(){function t(){var t="function"==typeof i?i.apply(this,arguments):i,e=un(-t[0]*zo,-t[1]*zo,0).invert,r=[];return n(null,null,1,{point:function(t,n){r.push(t=e(t,n)),t[0]*=Po,t[1]*=Po}}),{type:"Polygon",coordinates:[r]}}var e,n,i=[0,0],r=6;return t.origin=function(e){return arguments.length?(i=e,t):i},t.angle=function(i){return arguments.length?(n=pn((e=+i)*zo,r*zo),t):e},t.precision=function(i){return arguments.length?(n=pn(e*zo,(r=+i)*zo),t):r},t.angle(90)},Ks.geo.distance=function(t,e){var n,i=(e[0]-t[0])*zo,r=t[1]*zo,s=e[1]*zo,o=Math.sin(i),a=Math.cos(i),l=Math.sin(r),c=Math.cos(r),u=Math.sin(s),h=Math.cos(s);return Math.atan2(Math.sqrt((n=h*o)*n+(n=c*u-l*h*a)*n),l*u+c*h*a)},Ks.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Ks.range(Math.ceil(s/g)*g,r,g).map(f).concat(Ks.range(Math.ceil(c/_)*_,l,_).map(d)).concat(Ks.range(Math.ceil(i/p)*p,n,p).filter(function(t){return co(t%g)>Eo}).map(u)).concat(Ks.range(Math.ceil(a/m)*m,o,m).filter(function(t){return co(t%_)>Eo}).map(h))}var n,i,r,s,o,a,l,c,u,h,f,d,p=10,m=p,g=90,_=360,v=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(s).concat(d(l).slice(1),f(r).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(s=+e[0][0],r=+e[1][0],c=+e[0][1],l=+e[1][1],s>r&&(e=s,s=r,r=e),c>l&&(e=c,c=l,l=e),t.precision(v)):[[s,c],[r,l]]},t.minorExtent=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],a=+e[0][1],o=+e[1][1],i>n&&(e=i,i=n,n=e),a>o&&(e=a,a=o,o=e),t.precision(v)):[[i,a],[n,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],_=+e[1],t):[g,_]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(v=+e,u=gn(a,o,90),h=_n(i,n,v),f=gn(c,l,90),d=_n(s,r,v),t):v},t.majorExtent([[-180,-90+Eo],[180,90-Eo]]).minorExtent([[-180,-80-Eo],[180,80+Eo]])},Ks.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||i.apply(this,arguments),n||r.apply(this,arguments)]}}var e,n,i=vn,r=yn;return t.distance=function(){return Ks.geo.distance(e||i.apply(this,arguments),n||r.apply(this,arguments))},t.source=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,t):i},t.target=function(e){return arguments.length?(r=e,n="function"==typeof e?null:e,t):r},t.precision=function(){return arguments.length?t:0},t},Ks.geo.interpolate=function(t,e){return bn(t[0]*zo,t[1]*zo,e[0]*zo,e[1]*zo)},Ks.geo.length=function(t){return Oa=0,Ks.geo.stream(t,Ha),Oa};var Oa,Ha={sphere:m,point:m,lineStart:xn,lineEnd:m,polygonStart:m,polygonEnd:m},Va=wn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Ks.geo.azimuthalEqualArea=function(){return sn(Va)}).raw=Va;var qa=wn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},Ct);(Ks.geo.azimuthalEquidistant=function(){return sn(qa)}).raw=qa,(Ks.geo.conicConformal=function(){return qe(kn)}).raw=kn,(Ks.geo.conicEquidistant=function(){return qe(Sn)}).raw=Sn;var Ba=wn(function(t){return 1/t},Math.atan);(Ks.geo.gnomonic=function(){return sn(Ba)}).raw=Ba,Mn.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Do]},(Ks.geo.mercator=function(){return Tn(Mn)}).raw=Mn;var Ua=wn(function(){return 1},Math.asin);(Ks.geo.orthographic=function(){return sn(Ua)}).raw=Ua;var Wa=wn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Ks.geo.stereographic=function(){return sn(Wa)}).raw=Wa,Cn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Do]},(Ks.geo.transverseMercator=function(){var t=Tn(Cn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[-t[1],t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},t.rotate([0,0])}).raw=Cn,Ks.geom={},Ks.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,r=Tt(n),s=Tt(i),o=t.length,a=[],l=[];for(e=0;o>e;e++)a.push([+r.call(this,t[e],e),+s.call(this,t[e],e),e]);for(a.sort(Nn),e=0;o>e;e++)l.push([a[e][0],-a[e][1]]);var c=En(a),u=En(l),h=u[0]===c[0],f=u[u.length-1]===c[c.length-1],d=[];for(e=c.length-1;e>=0;--e)d.push(t[a[c[e]][2]]);for(e=+h;e<u.length-f;++e)d.push(t[a[u[e]][2]]);return d}var n=An,i=Dn;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e)},Ks.geom.polygon=function(t){return mo(t,Ya),t};var Ya=Ks.geom.polygon.prototype=[];Ya.area=function(){for(var t,e=-1,n=this.length,i=this[n-1],r=0;++e<n;)t=i,i=this[e],r+=t[1]*i[0]-t[0]*i[1];return.5*r},Ya.centroid=function(t){var e,n,i=-1,r=this.length,s=0,o=0,a=this[r-1];for(arguments.length||(t=-1/(6*this.area()));++i<r;)e=a,a=this[i],n=e[0]*a[1]-a[0]*e[1],s+=(e[0]+a[0])*n,o+=(e[1]+a[1])*n;return[s*t,o*t]},Ya.clip=function(t){for(var e,n,i,r,s,o,a=jn(t),l=-1,c=this.length-jn(this),u=this[c-1];++l<c;){for(e=t.slice(),t.length=0,r=this[l],s=e[(i=e.length-a)-1],n=-1;++n<i;)o=e[n],zn(o,u,r)?(zn(s,u,r)||t.push(Pn(s,o,u,r)),t.push(o)):zn(s,u,r)&&t.push(Pn(s,o,u,r)),s=o;a&&t.push(t[0]),u=r}return t};var Xa,Ja,Ga,Ka,Za,Qa=[],tl=[];Vn.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)t=e[n].edge,t.b&&t.a||e.splice(n,1);return e.sort(Bn),e.length},ti.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}},ei.prototype={insert:function(t,e){var n,i,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=si(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)i=n.U,n===i.L?(r=i.R,r&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.R&&(ii(this,n),t=n,n=t.U),n.C=!1,i.C=!0,ri(this,i))):(r=i.L,r&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.L&&(ri(this,n),t=n,n=t.U),n.C=!1,i.C=!0,ii(this,i))),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,r=t.U,s=t.L,o=t.R;if(n=s?o?si(o):s:o,r?r.L===t?r.L=n:r.R=n:this._=n,s&&o?(i=n.C,n.C=t.C,n.L=s,s.U=n,n!==o?(r=n.U,n.U=t.U,t=n.R,r.L=t,n.R=o,o.U=n):(n.U=r,r=n,t=n.R)):(i=t.C,t=n),t&&(t.U=r),!i){if(t&&t.C)return t.C=!1,void 0;do{if(t===this._)break;if(t===r.L){if(e=r.R,e.C&&(e.C=!1,r.C=!0,ii(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ri(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,ii(this,r),t=this._;break}}else if(e=r.L,e.C&&(e.C=!1,r.C=!0,ri(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,ii(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,ri(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}},Ks.geom.voronoi=function(t){function e(t){var e=new Array(t.length),i=a[0][0],r=a[0][1],s=a[1][0],o=a[1][1];return oi(n(t),a).cells.forEach(function(n,a){var l=n.edges,c=n.site,u=e[a]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=i&&c.x<=s&&c.y>=r&&c.y<=o?[[i,o],[s,o],[s,r],[i,r]]:[];u.point=t[a]}),e}function n(t){return t.map(function(t,e){return{x:Math.round(s(t,e)/Eo)*Eo,y:Math.round(o(t,e)/Eo)*Eo,i:e}})}var i=An,r=Dn,s=i,o=r,a=el;return t?e(t):(e.links=function(t){return oi(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return oi(n(t)).cells.forEach(function(n,i){for(var r,s,o=n.site,a=n.edges.sort(Bn),l=-1,c=a.length,u=a[c-1].edge,h=u.l===o?u.r:u.l;++l<c;)r=u,s=h,u=a[l].edge,h=u.l===o?u.r:u.l,i<s.i&&i<h.i&&li(o,s,h)<0&&e.push([t[i],t[s.i],t[h.i]])}),e},e.x=function(t){return arguments.length?(s=Tt(i=t),e):i},e.y=function(t){return arguments.length?(o=Tt(r=t),e):r},e.clipExtent=function(t){return arguments.length?(a=null==t?el:t,e):a===el?null:a},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):a===el?null:a&&a[1]},e)};var el=[[-1e6,-1e6],[1e6,1e6]];Ks.geom.delaunay=function(t){return Ks.geom.voronoi().triangles(t)},Ks.geom.quadtree=function(t,e,n,i,r){function s(t){function s(t,e,n,i,r,s,o,a){if(!isNaN(n)&&!isNaN(i))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(co(l-n)+co(u-i)<.01)c(t,e,n,i,r,s,o,a);else{var h=t.point;t.x=t.y=t.point=null,c(t,h,l,u,r,s,o,a),c(t,e,n,i,r,s,o,a)}else t.x=n,t.y=i,t.point=e}else c(t,e,n,i,r,s,o,a)}function c(t,e,n,i,r,o,a,l){var c=.5*(r+a),u=.5*(o+l),h=n>=c,f=i>=u,d=(f<<1)+h;
vendor: 4,325 bytes, line 723
723t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=hi()),h?r=c:a=c,f?o=u:l=u,s(t,e,n,i,r,o,a,l)}var u,h,f,d,p,m,g,_,v,y=Tt(a),b=Tt(l);if(null!=e)m=e,g=n,_=i,v=r;else if(_=v=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;p>d;++d)u=t[d],u.x<m&&(m=u.x),u.y<g&&(g=u.y),u.x>_&&(_=u.x),u.y>v&&(v=u.y),h.push(u.x),f.push(u.y);else for(d=0;p>d;++d){var x=+y(u=t[d],d),w=+b(u,d);m>x&&(m=x),g>w&&(g=w),x>_&&(_=x),w>v&&(v=w),h.push(x),f.push(w)}var k=_-m,S=v-g;k>S?v=g+k:_=m+S;var M=hi();if(M.add=function(t){s(M,t,+y(t,++d),+b(t,d),m,g,_,v)},M.visit=function(t){fi(t,M,m,g,_,v)},d=-1,null==e){for(;++d<p;)s(M,t[d],h[d],f[d],m,g,_,v);--d}else t.forEach(M.add);return h=f=t=u=null,M}var o,a=An,l=Dn;return(o=arguments.length)?(a=ci,l=ui,3===o&&(r=n,i=e,n=e=0),s(t)):(s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(l=t,s):l},s.extent=function(t){return arguments.length?(null==t?e=n=i=r=null:(e=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),s):null==e?null:[[e,n],[i,r]]},s.size=function(t){return arguments.length?(null==t?e=n=i=r=null:(e=n=0,i=+t[0],r=+t[1]),s):null==e?null:[i-e,r-n]},s)},Ks.interpolateRgb=di,Ks.interpolateObject=pi,Ks.interpolateNumber=mi,Ks.interpolateString=gi;var nl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,il=new RegExp(nl.source,"g");Ks.interpolate=_i,Ks.interpolators=[function(t,e){var n=typeof e;return("string"===n?Xo.has(e)||/^(#|rgb\(|hsl\()/.test(e)?di:gi:e instanceof nt?di:Array.isArray(e)?vi:"object"===n&&isNaN(e)?pi:mi)(t,e)}],Ks.interpolateArray=vi;var rl=function(){return Ct},sl=Ks.map({linear:rl,poly:Mi,quad:function(){return wi},cubic:function(){return ki},sin:function(){return Ti},exp:function(){return Ci},circle:function(){return Ai},elastic:Di,back:Ei,bounce:function(){return Ni}}),ol=Ks.map({"in":Ct,out:bi,"in-out":xi,"out-in":function(t){return xi(bi(t))}});Ks.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.substring(0,e):t,i=e>=0?t.substring(e+1):"in";return n=sl.get(n)||rl,i=ol.get(i)||Ct,yi(i(n.apply(null,Zs.call(arguments,1))))},Ks.interpolateHcl=zi,Ks.interpolateHsl=Pi,Ks.interpolateLab=ji,Ks.interpolateRound=Ii,Ks.transform=function(t){var e=to.createElementNS(Ks.ns.prefix.svg,"g");return(Ks.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new $i(n?n.matrix:al)})(t)},$i.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var al={a:1,b:0,c:0,d:1,e:0,f:0};Ks.interpolateTransform=Oi,Ks.layout={},Ks.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(qi(t[n]));return e}},Ks.layout.chord=function(){function t(){var t,c,h,f,d,p={},m=[],g=Ks.range(s),_=[];for(n=[],i=[],t=0,f=-1;++f<s;){for(c=0,d=-1;++d<s;)c+=r[f][d];m.push(c),_.push(Ks.range(s)),t+=c}for(o&&g.sort(function(t,e){return o(m[t],m[e])}),a&&_.forEach(function(t,e){t.sort(function(t,n){return a(r[e][t],r[e][n])})}),t=(Ao-u*s)/t,c=0,f=-1;++f<s;){for(h=c,d=-1;++d<s;){var v=g[f],y=_[v][d],b=r[v][y],x=c,w=c+=b*t;p[v+"-"+y]={index:v,subindex:y,startAngle:x,endAngle:w,value:b}}i[v]={index:v,startAngle:h,endAngle:c,value:(c-h)/t},c+=u}for(f=-1;++f<s;)for(d=f-1;++d<s;){var k=p[f+"-"+d],S=p[d+"-"+f];(k.value||S.value)&&n.push(k.value<S.value?{source:S,target:k}:{source:k,target:S})}l&&e()}function e(){n.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,i,r,s,o,a,l,c={},u=0;return c.matrix=function(t){return arguments.length?(s=(r=t)&&r.length,n=i=null,c):r},c.padding=function(t){return arguments.length?(u=t,n=i=null,c):u},c.sortGroups=function(t){return arguments.length?(o=t,n=i=null,c):o},c.sortSubgroups=function(t){return arguments.length?(a=t,n=null,c):a},c.sortChords=function(t){return arguments.length?(l=t,n&&e(),c):l},c.chords=function(){return n||t(),n},c.groups=function(){return i||t(),i},c},Ks.layout.force=function(){function t(t){return function(e,n,i,r){if(e.point!==t){var s=e.cx-t.x,o=e.cy-t.y,a=r-n,l=s*s+o*o;if(l>a*a/g){if(p>l){var c=e.charge/l;t.px-=s*c,t.py-=o*c}return!0}if(e.point&&l&&p>l){var c=e.pointCharge/l;t.px-=s*c,t.py-=o*c}}return!e.charge}}function e(t){t.px=Ks.event.x,t.py=Ks.event.y,a.resume()}var n,i,r,s,o,a={},l=Ks.dispatch("start","tick","end"),c=[1,1],u=.9,h=ll,f=cl,d=-30,p=ul,m=.1,g=.64,_=[],v=[];
vendor: 28,233 bytes, lines 723-724
723return a.tick=function(){if((i*=.99)<.005)return l.end({type:"end",alpha:i=0}),!0;var e,n,a,h,f,p,g,y,b,x=_.length,w=v.length;for(n=0;w>n;++n)a=v[n],h=a.source,f=a.target,y=f.x-h.x,b=f.y-h.y,(p=y*y+b*b)&&(p=i*s[n]*((p=Math.sqrt(p))-r[n])/p,y*=p,b*=p,f.x-=y*(g=h.weight/(f.weight+h.weight)),f.y-=b*g,h.x+=y*(g=1-g),h.y+=b*g);if((g=i*m)&&(y=c[0]/2,b=c[1]/2,n=-1,g))for(;++n<x;)a=_[n],a.x+=(y-a.x)*g,a.y+=(b-a.y)*g;if(d)for(Gi(e=Ks.geom.quadtree(_),i,o),n=-1;++n<x;)(a=_[n]).fixed||e.visit(t(a));for(n=-1;++n<x;)a=_[n],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*u,a.y-=(a.py-(a.py=a.y))*u);l.tick({type:"tick",alpha:i})},a.nodes=function(t){return arguments.length?(_=t,a):_},a.links=function(t){return arguments.length?(v=t,a):v},a.size=function(t){return arguments.length?(c=t,a):c},a.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,a):h},a.distance=a.linkDistance,a.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,a):f},a.friction=function(t){return arguments.length?(u=+t,a):u},a.charge=function(t){return arguments.length?(d="function"==typeof t?t:+t,a):d},a.chargeDistance=function(t){return arguments.length?(p=t*t,a):Math.sqrt(p)},a.gravity=function(t){return arguments.length?(m=+t,a):m},a.theta=function(t){return arguments.length?(g=t*t,a):Math.sqrt(g)},a.alpha=function(t){return arguments.length?(t=+t,i?i=t>0?t:0:t>0&&(l.start({type:"start",alpha:i=t}),Ks.timer(a.tick)),a):i},a.start=function(){function t(t,i){if(!n){for(n=new Array(l),a=0;l>a;++a)n[a]=[];for(a=0;c>a;++a){var r=v[a];n[r.source.index].push(r.target),n[r.target.index].push(r.source)}}for(var s,o=n[e],a=-1,c=o.length;++a<c;)if(!isNaN(s=o[a][t]))return s;return Math.random()*i}var e,n,i,l=_.length,u=v.length,p=c[0],m=c[1];for(e=0;l>e;++e)(i=_[e]).index=e,i.weight=0;for(e=0;u>e;++e)i=v[e],"number"==typeof i.source&&(i.source=_[i.source]),"number"==typeof i.target&&(i.target=_[i.target]),++i.source.weight,++i.target.weight;for(e=0;l>e;++e)i=_[e],isNaN(i.x)&&(i.x=t("x",p)),isNaN(i.y)&&(i.y=t("y",m)),isNaN(i.px)&&(i.px=i.x),isNaN(i.py)&&(i.py=i.y);if(r=[],"function"==typeof h)for(e=0;u>e;++e)r[e]=+h.call(this,v[e],e);else for(e=0;u>e;++e)r[e]=h;if(s=[],"function"==typeof f)for(e=0;u>e;++e)s[e]=+f.call(this,v[e],e);else for(e=0;u>e;++e)s[e]=f;if(o=[],"function"==typeof d)for(e=0;l>e;++e)o[e]=+d.call(this,_[e],e);else for(e=0;l>e;++e)o[e]=d;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return n||(n=Ks.behavior.drag().origin(Ct).on("dragstart.force",Wi).on("drag.force",e).on("dragend.force",Yi)),arguments.length?(this.on("mouseover.force",Xi).on("mouseout.force",Ji).call(n),void 0):n},Ks.rebind(a,l,"on")};var ll=20,cl=1,ul=1/0;Ks.layout.hierarchy=function(){function t(e,o,a){var l=r.call(n,e,o);if(e.depth=o,a.push(e),l&&(c=l.length)){for(var c,u,h=-1,f=e.children=new Array(c),d=0,p=o+1;++h<c;)u=f[h]=t(l[h],p,a),u.parent=e,d+=u.value;i&&f.sort(i),s&&(e.value=d)}else delete e.children,s&&(e.value=+s.call(n,e,o)||0);return e}function e(t,i){var r=t.children,o=0;if(r&&(a=r.length))for(var a,l=-1,c=i+1;++l<a;)o+=e(r[l],c);else s&&(o=+s.call(n,t,i)||0);return s&&(t.value=o),o}function n(e){var n=[];return t(e,0,n),n}var i=tr,r=Zi,s=Qi;return n.sort=function(t){return arguments.length?(i=t,n):i},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(t){return arguments.length?(s=t,n):s},n.revalue=function(t){return e(t,0),t},n},Ks.layout.partition=function(){function t(e,n,i,r){var s=e.children;if(e.x=n,e.y=e.depth*r,e.dx=i,e.dy=r,s&&(o=s.length)){var o,a,l,c=-1;for(i=e.value?i/e.value:0;++c<o;)t(a=s[c],n,l=a.value*i,r),n+=l}}function e(t){var n=t.children,i=0;if(n&&(r=n.length))for(var r,s=-1;++s<r;)i=Math.max(i,e(n[s]));return 1+i}function n(n,s){var o=i.call(this,n,s);return t(o[0],0,r[0],r[1]/e(o[0])),o}var i=Ks.layout.hierarchy(),r=[1,1];return n.size=function(t){return arguments.length?(r=t,n):r},Ki(n,i)},Ks.layout.pie=function(){function t(s){var o=s.map(function(n,i){return+e.call(t,n,i)}),a=+("function"==typeof i?i.apply(this,arguments):i),l=(("function"==typeof r?r.apply(this,arguments):r)-a)/Ks.sum(o),c=Ks.range(s.length);null!=n&&c.sort(n===hl?function(t,e){return o[e]-o[t]}:function(t,e){return n(s[t],s[e])});var u=[];return c.forEach(function(t){var e;u[t]={data:s[t],value:e=o[t],startAngle:a,endAngle:a+=e*l}}),u}var e=Number,n=hl,i=0,r=Ao;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(i=e,t):i},t.endAngle=function(e){return arguments.length?(r=e,t):r},t};var hl={};Ks.layout.stack=function(){function t(a,l){var c=a.map(function(n,i){return e.call(t,n,i)}),u=c.map(function(e){return e.map(function(e,n){return[s.call(t,e,n),o.call(t,e,n)]})}),h=n.call(t,u,l);c=Ks.permute(c,h),u=Ks.permute(u,h)
724;var f,d,p,m=i.call(t,u,l),g=c.length,_=c[0].length;for(d=0;_>d;++d)for(r.call(t,c[0][d],p=m[d],u[0][d][1]),f=1;g>f;++f)r.call(t,c[f][d],p+=u[f-1][d][1],u[f][d][1]);return a}var e=Ct,n=sr,i=or,r=rr,s=nr,o=ir;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:fl.get(e)||sr,t):n},t.offset=function(e){return arguments.length?(i="function"==typeof e?e:dl.get(e)||or,t):i},t.x=function(e){return arguments.length?(s=e,t):s},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(r=e,t):r},t};var fl=Ks.map({"inside-out":function(t){var e,n,i=t.length,r=t.map(ar),s=t.map(lr),o=Ks.range(i).sort(function(t,e){return r[t]-r[e]}),a=0,l=0,c=[],u=[];for(e=0;i>e;++e)n=o[e],l>a?(a+=s[n],c.push(n)):(l+=s[n],u.push(n));return u.reverse().concat(c)},reverse:function(t){return Ks.range(t.length).reverse()},"default":sr}),dl=Ks.map({silhouette:function(t){var e,n,i,r=t.length,s=t[0].length,o=[],a=0,l=[];for(n=0;s>n;++n){for(e=0,i=0;r>e;e++)i+=t[e][n][1];i>a&&(a=i),o.push(i)}for(n=0;s>n;++n)l[n]=(a-o[n])/2;return l},wiggle:function(t){var e,n,i,r,s,o,a,l,c,u=t.length,h=t[0],f=h.length,d=[];for(d[0]=l=c=0,n=1;f>n;++n){for(e=0,r=0;u>e;++e)r+=t[e][n][1];for(e=0,s=0,a=h[n][0]-h[n-1][0];u>e;++e){for(i=0,o=(t[e][n][1]-t[e][n-1][1])/(2*a);e>i;++i)o+=(t[i][n][1]-t[i][n-1][1])/a;s+=o*t[e][n][1]}d[n]=l-=r?s/r*a:0,c>l&&(c=l)}for(n=0;f>n;++n)d[n]-=c;return d},expand:function(t){var e,n,i,r=t.length,s=t[0].length,o=1/r,a=[];for(n=0;s>n;++n){for(e=0,i=0;r>e;e++)i+=t[e][n][1];if(i)for(e=0;r>e;e++)t[e][n][1]/=i;else for(e=0;r>e;e++)t[e][n][1]=o}for(n=0;s>n;++n)a[n]=0;return a},zero:or});Ks.layout.histogram=function(){function t(t,s){for(var o,a,l=[],c=t.map(n,this),u=i.call(this,c,s),h=r.call(this,u,c,s),s=-1,f=c.length,d=h.length-1,p=e?1:1/f;++s<d;)o=l[s]=[],o.dx=h[s+1]-(o.x=h[s]),o.y=0;if(d>0)for(s=-1;++s<f;)a=c[s],a>=u[0]&&a<=u[1]&&(o=l[Ks.bisect(h,a,1,d)-1],o.y+=p,o.push(t[s]));return l}var e=!0,n=Number,i=fr,r=ur;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(i=Tt(e),t):i},t.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return hr(t,e)}:Tt(e),t):r},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},Ks.layout.tree=function(){function t(t,s){function o(t,e){var i=t.children,r=t._tree;if(i&&(s=i.length)){for(var s,a,c,u=i[0],h=u,f=-1;++f<s;)c=i[f],o(c,a),h=l(c,a,h),a=c;xr(t);var d=.5*(u._tree.prelim+c._tree.prelim);e?(r.prelim=e._tree.prelim+n(t,e),r.mod=r.prelim-d):r.prelim=d}else e&&(r.prelim=e._tree.prelim+n(t,e))}function a(t,e){t.x=t._tree.prelim+e;var n=t.children;if(n&&(i=n.length)){var i,r=-1;for(e+=t._tree.mod;++r<i;)a(n[r],e)}}function l(t,e,i){if(e){for(var r,s=t,o=t,a=e,l=t.parent.children[0],c=s._tree.mod,u=o._tree.mod,h=a._tree.mod,f=l._tree.mod;a=mr(a),s=pr(s),a&&s;)l=pr(l),o=mr(o),o._tree.ancestor=t,r=a._tree.prelim+h-s._tree.prelim-c+n(a,s),r>0&&(wr(kr(a,t,i),t,r),c+=r,u+=r),h+=a._tree.mod,c+=s._tree.mod,f+=l._tree.mod,u+=o._tree.mod;a&&!mr(o)&&(o._tree.thread=a,o._tree.mod+=h-u),s&&!pr(l)&&(l._tree.thread=s,l._tree.mod+=c-f,i=t)}return i}var c=e.call(this,t,s),u=c[0];br(u,function(t,e){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:e?e._tree.number+1:0}}),o(u),a(u,-u._tree.prelim);var h=gr(u,vr),f=gr(u,_r),d=gr(u,yr),p=h.x-n(h,f)/2,m=f.x+n(f,h)/2,g=d.depth||1;return br(u,r?function(t){t.x*=i[0],t.y=t.depth*i[1],delete t._tree}:function(t){t.x=(t.x-p)/(m-p)*i[0],t.y=t.depth/g*i[1],delete t._tree}),c}var e=Ks.layout.hierarchy().sort(null).value(null),n=dr,i=[1,1],r=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=null==(i=e),t):r?null:i},t.nodeSize=function(e){return arguments.length?(r=null!=(i=e),t):r?i:null},Ki(t,e)},Ks.layout.pack=function(){function t(t,s){var o=n.call(this,t,s),a=o[0],l=r[0],c=r[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(a.x=a.y=0,br(a,function(t){t.r=+u(t.value)}),br(a,Ar),i){var h=i*(e?1:Math.max(2*a.r/l,2*a.r/c))/2;br(a,function(t){t.r+=h}),br(a,Ar),br(a,function(t){t.r-=h})}return Nr(a,l/2,c/2,e?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var e,n=Ks.layout.hierarchy().sort(Sr),i=0,r=[1,1];return t.size=function(e){return arguments.length?(r=e,t):r},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(i=+e,t):i},Ki(t,n)},Ks.layout.cluster=function(){function t(t,s){var o,a=e.call(this,t,s),l=a[0],c=0;br(l,function(t){var e=t.children;e&&e.length?(t.x=jr(e),t.y=Pr(e)):(t.x=o?c+=n(t,o):0,t.y=0,o=t)});var u=Ir(l),h=$r(l),f=u.x-n(u,h)/2,d=h.x+n(h,u)/2;return br(l,r?function(t){t.x=(t.x-l.x)*i[0],t.y=(l.y-t.y)*i[1]}:function(t){t.x=(t.x-f)/(d-f)*i[0],t.y=(1-(l.y?t.y/l.y:1))*i[1]}),a}var e=Ks.layout.hierarchy().sort(null).value(null),n=dr,i=[1,1],r=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=null==(i=e),t):r?null:i},t.nodeSize=function(e){return arguments.length?(r=null!=(i=e),t):r?i:null},Ki(t,e)},Ks.layout.treemap=function(){function t(t,e){for(var n,i,r=-1,s=t.length;++r<s;)i=(n=t[r]).value*(0>e?0:e),n.area=isNaN(i)||0>=i?0:i}function e(n){var s=n.children;if(s&&s.length){var o,a,l,c=h(n),u=[],f=s.slice(),p=1/0,m="slice"===d?c.dx:"dice"===d?c.dy:"slice-dice"===d?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(f,c.dx*c.dy/n.value),u.area=0;(l=f.length)>0;)u.push(o=f[l-1]),u.area+=o.area,"squarify"!==d||(a=i(u,m))<=p?(f.pop(),p=a):(u.area-=u.pop().area,r(u,m,c,!1),m=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(r(u,m,c,!0),u.length=u.area=0),s.forEach(e)}}function n(e){var i=e.children;if(i&&i.length){var s,o=h(e),a=i.slice(),l=[];for(t(a,o.dx*o.dy/e.value),l.area=0;s=a.pop();)l.push(s),l.area+=s.area,null!=s.z&&(r(l,s.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);i.forEach(n)}}function i(t,e){for(var n,i=t.area,r=0,s=1/0,o=-1,a=t.length;++o<a;)(n=t[o].area)&&(s>n&&(s=n),n>r&&(r=n));return i*=i,e*=e,i?Math.max(e*r*p/i,i/(e*s*p)):1/0}function r(t,e,n,i){var r,s=-1,o=t.length,a=n.x,c=n.y,u=e?l(t.area/e):0;if(e==n.dx){for((i||u>n.dy)&&(u=n.dy);++s<o;)r=t[s],r.x=a,r.y=c,r.dy=u,a+=r.dx=Math.min(n.x+n.dx-a,u?l(r.area/u):0);r.z=!0,r.dx+=n.x+n.dx-a,n.y+=u,n.dy-=u}else{for((i||u>n.dx)&&(u=n.dx);++s<o;)r=t[s],r.x=a,r.y=c,r.dx=u,c+=r.dy=Math.min(n.y+n.dy-c,u?l(r.area/u):0);r.z=!1,r.dy+=n.y+n.dy-c,n.x+=u,n.dx-=u}}function s(i){var r=o||a(i),s=r[0];return s.x=0,s.y=0,s.dx=c[0],s.dy=c[1],o&&a.revalue(s),t([s],s.dx*s.dy/s.value),(o?n:e)(s),f&&(o=r),r}var o,a=Ks.layout.hierarchy(),l=Math.round,c=[1,1],u=null,h=Rr,f=!1,d="squarify",p=.5*(1+Math.sqrt(5));return s.size=function(t){return arguments.length?(c=t,s):c},s.padding=function(t){function e(e){var n=t.call(s,e,e.depth);return null==n?Rr(e):Lr(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Lr(e,t)}if(!arguments.length)return u;var i;return h=null==(u=t)?Rr:"function"==(i=typeof t)?e:"number"===i?(t=[t,t,t,t],n):n,s},s.round=function(t){return arguments.length?(l=t?Math.round:Number,s):l!=Number},s.sticky=function(t){return arguments.length?(f=t,o=null,s):f},s.ratio=function(t){return arguments.length?(p=t,s):p},s.mode=function(t){return arguments.length?(d=t+"",s):d},Ki(s,a)},Ks.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,i,r;do{n=2*Math.random()-1,i=2*Math.random()-1,r=n*n+i*i}while(!r||r>1);return t+e*n*Math.sqrt(-2*Math.log(r)/r)}},logNormal:function(){var t=Ks.random.normal.apply(Ks,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Ks.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},Ks.scale={};var pl={floor:Ct,ceil:Ct};Ks.scale.linear=function(){return Ur([0,1],[0,1],_i,!1)};var ml={s:1,g:1,p:1,r:1,e:1};Ks.scale.log=function(){return Qr(Ks.scale.linear().domain([0,1]),10,!0,[1,10])};var gl=Ks.format(".0e"),_l={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};Ks.scale.pow=function(){return ts(Ks.scale.linear(),1,[0,1])},Ks.scale.sqrt=function(){return Ks.scale.pow().exponent(.5)},Ks.scale.ordinal=function(){return ns([],{t:"range",a:[[]]})},Ks.scale.category10=function(){return Ks.scale.ordinal().range(vl)},Ks.scale.category20=function(){return Ks.scale.ordinal().range(yl)},Ks.scale.category20b=function(){return Ks.scale.ordinal().range(bl)},Ks.scale.category20c=function(){return Ks.scale.ordinal().range(xl)};var vl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),yl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),bl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),xl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);Ks.scale.quantile=function(){return is([],[])},Ks.scale.quantize=function(){return rs(0,1,[0,1])},Ks.scale.threshold=function(){return ss([.5],[0,1])},Ks.scale.identity=function(){return os([0,1])},Ks.svg={},Ks.svg.arc=function(){function t(){var t=e.apply(this,arguments),s=n.apply(this,arguments),o=i.apply(this,arguments)+wl,a=r.apply(this,arguments)+wl,l=(o>a&&(l=o,o=a,a=l),a-o),c=Co>l?"0":"1",u=Math.cos(o),h=Math.sin(o),f=Math.cos(a),d=Math.sin(a);return l>=kl?t?"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+-s+"A"+s+","+s+" 0 1,1 0,"+s+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+-s+"A"+s+","+s+" 0 1,1 0,"+s+"Z":t?"M"+s*u+","+s*h+"A"+s+","+s+" 0 "+c+",1 "+s*f+","+s*d+"L"+t*f+","+t*d+"A"+t+","+t+" 0 "+c+",0 "+t*u+","+t*h+"Z":"M"+s*u+","+s*h+"A"+s+","+s+" 0 "+c+",1 "+s*f+","+s*d+"L0,0"+"Z"}var e=as,n=ls,i=cs,r=us;return t.innerRadius=function(n){return arguments.length?(e=Tt(n),t):e},t.outerRadius=function(e){return arguments.length?(n=Tt(e),t):n},t.startAngle=function(e){return arguments.length?(i=Tt(e),t):i},t.endAngle=function(e){return arguments.length?(r=Tt(e),t):r},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,s=(i.apply(this,arguments)+r.apply(this,arguments))/2+wl;return[Math.cos(s)*t,Math.sin(s)*t]},t};var wl=-Do,kl=Ao-Eo;Ks.svg.line=function(){return hs(Ct)};var Sl=Ks.map({linear:fs,"linear-closed":ds,step:ps,"step-before":ms,"step-after":gs,basis:ws,"basis-open":ks,"basis-closed":Ss,bundle:Ms,cardinal:ys,"cardinal-open":_s,"cardinal-closed":vs,monotone:Ns});Sl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Ml=[0,2/3,1/3,0],Tl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];Ks.svg.line.radial=function(){var t=hs(zs);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ms.reverse=gs,gs.reverse=ms,Ks.svg.area=function(){return Ps(Ct)},Ks.svg.area.radial=function(){var t=Ps(zs);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Ks.svg.chord=function(){function t(t,a){var l=e(this,s,t,a),c=e(this,o,t,a);return"M"+l.p0+i(l.r,l.p1,l.a1-l.a0)+(n(l,c)?r(l.r,l.p1,l.r,l.p0):r(l.r,l.p1,c.r,c.p0)+i(c.r,c.p1,c.a1-c.a0)+r(c.r,c.p1,l.r,l.p0))+"Z"}function e(t,e,n,i){var r=e.call(t,n,i),s=a.call(t,r,i),o=l.call(t,r,i)+wl,u=c.call(t,r,i)+wl;return{r:s,a0:o,a1:u,p0:[s*Math.cos(o),s*Math.sin(o)],p1:[s*Math.cos(u),s*Math.sin(u)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function i(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Co)+",1 "+e}function r(t,e,n,i){return"Q 0,0 "+i}var s=vn,o=yn,a=js,l=cs,c=us;return t.radius=function(e){return arguments.length?(a=Tt(e),t):a},t.source=function(e){return arguments.length?(s=Tt(e),t):s},t.target=function(e){return arguments.length?(o=Tt(e),t):o},t.startAngle=function(e){return arguments.length?(l=Tt(e),t):l},t.endAngle=function(e){return arguments.length?(c=Tt(e),t):c},t},Ks.svg.diagonal=function(){function t(t,r){var s=e.call(this,t,r),o=n.call(this,t,r),a=(s.y+o.y)/2,l=[s,{x:s.x,y:a},{x:o.x,y:a},o];return l=l.map(i),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=vn,n=yn,i=Is;return t.source=function(n){return arguments.length?(e=Tt(n),t):e},t.target=function(e){return arguments.length?(n=Tt(e),t):n},t.projection=function(e){return arguments.length?(i=e,t):i},t},Ks.svg.diagonal.radial=function(){var t=Ks.svg.diagonal(),e=Is,n=t.projection;return t.projection=function(t){return arguments.length?n($s(e=t)):e},t},Ks.svg.symbol=function(){function t(t,i){return(Al.get(e.call(this,t,i))||Fs)(n.call(this,t,i))}var e=Ls,n=Rs;return t.type=function(n){return arguments.length?(e=Tt(n),t):e},t.size=function(e){return arguments.length?(n=Tt(e),t):n},t};var Al=Ks.map({circle:Fs,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*zl)),n=e*zl;return"M0,"+-e+"L"+n+",0"+" 0,"+e+" "+-n+",0"+"Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Nl),n=e*Nl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Nl),n=e*Nl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});Ks.svg.symbolTypes=Al.keys();var Dl,El,Nl=Math.sqrt(3),zl=Math.tan(30*zo),Pl=[],jl=0;Pl.call=bo.call,Pl.empty=bo.empty,Pl.node=bo.node,Pl.size=bo.size,Ks.transition=function(t){return arguments.length?Dl?t.transition():t:ko.transition()},Ks.transition.prototype=Pl,Pl.select=function(t){var e,n,i,r=this.id,s=[];t=w(t);for(var o=-1,a=this.length;++o<a;){s.push(e=[]);for(var l=this[o],c=-1,u=l.length;++c<u;)(i=l[c])&&(n=t.call(i,i.__data__,c,o))?("__data__"in i&&(n.__data__=i.__data__),qs(n,c,r,i.__transition__[r]),e.push(n)):e.push(null)}return Os(s,r)},Pl.selectAll=function(t){var e,n,i,r,s,o=this.id,a=[];t=k(t);for(var l=-1,c=this.length;++l<c;)for(var u=this[l],h=-1,f=u.length;++h<f;)if(i=u[h]){s=i.__transition__[o],n=t.call(i,i.__data__,h,l),a.push(e=[]);for(var d=-1,p=n.length;++d<p;)(r=n[d])&&qs(r,d,o,s),e.push(r)}return Os(a,o)},Pl.filter=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=j(t));for(var s=0,o=this.length;o>s;s++){r.push(e=[]);for(var n=this[s],a=0,l=n.length;l>a;a++)(i=n[a])&&t.call(i,i.__data__,a,s)&&e.push(i)}return Os(r,this.id)},Pl.tween=function(t,e){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(t):$(this,null==e?function(e){e.__transition__[n].tween.remove(t)}:function(i){i.__transition__[n].tween.set(t,e)})},Pl.attr=function(t,e){function n(){this.removeAttribute(a)}function i(){this.removeAttributeNS(a.space,a.local)}function r(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(a);return n!==t&&(e=o(n,t),function(t){this.setAttribute(a,e(t))})})}function s(t){return null==t?i:(t+="",function(){var e,n=this.getAttributeNS(a.space,a.local);return n!==t&&(e=o(n,t),function(t){this.setAttributeNS(a.space,a.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?Oi:_i,a=Ks.ns.qualify(t);return Hs(this,"attr."+t,e,a.local?s:r)},Pl.attrTween=function(t,e){function n(t,n){var i=e.call(this,t,n,this.getAttribute(r));return i&&function(t){this.setAttribute(r,i(t))}}function i(t,n){var i=e.call(this,t,n,this.getAttributeNS(r.space,r.local));return i&&function(t){this.setAttributeNS(r.space,r.local,i(t))}}var r=Ks.ns.qualify(t);return this.tween("attr."+t,r.local?i:n)},Pl.style=function(t,e,n){function i(){this.style.removeProperty(t)}function r(e){return null==e?i:(e+="",function(){var i,r=no.getComputedStyle(this,null).getPropertyValue(t);return r!==e&&(i=_i(r,e),function(e){this.style.setProperty(t,i(e),n)})})}var s=arguments.length;if(3>s){if("string"!=typeof t){2>s&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Hs(this,"style."+t,e,r)},Pl.styleTween=function(t,e,n){function i(i,r){var s=e.call(this,i,r,no.getComputedStyle(this,null).getPropertyValue(t));return s&&function(e){this.style.setProperty(t,s(e),n)}}return arguments.length<3&&(n=""),this.tween("style."+t,i)},Pl.text=function(t){return Hs(this,"text",t,Vs)},Pl.remove=function(){return this.each("end.transition",function(){var t;this.__transition__.count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof t&&(t=Ks.ease.apply(Ks,arguments)),$(this,function(n){n.__transition__[e].ease=t}))},Pl.delay=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].delay:$(this,"function"==typeof t?function(n,i,r){n.__transition__[e].delay=+t.call(n,n.__data__,i,r)}:(t=+t,function(n){n.__transition__[e].delay=t}))},Pl.duration=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].duration:$(this,"function"==typeof t?function(n,i,r){n.__transition__[e].duration=Math.max(1,t.call(n,n.__data__,i,r))}:(t=Math.max(1,t),function(n){n.__transition__[e].duration=t}))},Pl.each=function(t,e){var n=this.id;if(arguments.length<2){var i=El,r=Dl;Dl=n,$(this,function(e,i,r){El=e.__transition__[n],t.call(e,e.__data__,i,r)}),El=i,Dl=r}else $(this,function(i){var r=i.__transition__[n];(r.event||(r.event=Ks.dispatch("start","end"))).on(t,e)});return this},Pl.transition=function(){for(var t,e,n,i,r=this.id,s=++jl,o=[],a=0,l=this.length;l>a;a++){o.push(t=[]);for(var e=this[a],c=0,u=e.length;u>c;c++)(n=e[c])&&(i=Object.create(n.__transition__[r]),i.delay+=i.duration,qs(n,c,s,i)),t.push(n)}return Os(o,s)},Ks.svg.axis=function(){function t(t){t.each(function(){var t,c=Ks.select(this),u=this.__chart__||n,h=this.__chart__=n.copy(),f=null==l?h.ticks?h.ticks.apply(h,a):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,a):Ct:e,p=c.selectAll(".tick").data(f,h),m=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Eo),g=Ks.transition(p.exit()).style("opacity",Eo).remove(),_=Ks.transition(p.order()).style("opacity",1),v=Or(h),y=c.selectAll(".domain").data([0]),b=(y.enter().append("path").attr("class","domain"),Ks.transition(y));m.append("line"),m.append("text");var x=m.select("line"),w=_.select("line"),k=p.select("text").text(d),S=m.select("text"),M=_.select("text");switch(i){case"bottom":t=Bs,x.attr("y2",r),S.attr("y",Math.max(r,0)+o),w.attr("x2",0).attr("y2",r),M.attr("x",0).attr("y",Math.max(r,0)+o),k.attr("dy",".71em").style("text-anchor","middle"),b.attr("d","M"+v[0]+","+s+"V0H"+v[1]+"V"+s);break;case"top":t=Bs,x.attr("y2",-r),S.attr("y",-(Math.max(r,0)+o)),w.attr("x2",0).attr("y2",-r),M.attr("x",0).attr("y",-(Math.max(r,0)+o)),k.attr("dy","0em").style("text-anchor","middle"),b.attr("d","M"+v[0]+","+-s+"V0H"+v[1]+"V"+-s);break;case"left":t=Us,x.attr("x2",-r),S.attr("x",-(Math.max(r,0)+o)),w.attr("x2",-r).attr("y2",0),M.attr("x",-(Math.max(r,0)+o)).attr("y",0),k.attr("dy",".32em").style("text-anchor","end"),b.attr("d","M"+-s+","+v[0]+"H0V"+v[1]+"H"+-s);break;case"right":t=Us,x.attr("x2",r),S.attr("x",Math.max(r,0)+o),w.attr("x2",r).attr("y2",0),M.attr("x",Math.max(r,0)+o).attr("y",0),k.attr("dy",".32em").style("text-anchor","start"),b.attr("d","M"+s+","+v[0]+"H0V"+v[1]+"H"+s)}if(h.rangeBand){var T=h,C=T.rangeBand()/2;u=h=function(t){return T(t)+C}}else u.rangeBand?u=h:g.call(t,h);m.call(t,u),_.call(t,h)})}var e,n=Ks.scale.linear(),i=Il,r=6,s=6,o=3,a=[10],l=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(i=e in $l?e+"":Il,t):i},t.ticks=function(){return arguments.length?(a=arguments,t):a},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(r=+e,s=+arguments[n-1],t):r},t.innerTickSize=function(e){return arguments.length?(r=+e,t):r},t.outerTickSize=function(e){return arguments.length?(s=+e,t):s},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var Il="bottom",$l={top:1,right:1,bottom:1,left:1};Ks.svg.brush=function(){function t(s){s.each(function(){var s=Ks.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",r).on("touchstart.brush",r),o=s.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),s.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=s.selectAll(".resize").data(p,Ct);a.exit().remove(),a.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Rl[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",t.empty()?"none":null);var u,h=Ks.transition(s),f=Ks.transition(o);l&&(u=Or(l),f.attr("x",u[0]).attr("width",u[1]-u[0]),n(h)),c&&(u=Or(c),f.attr("y",u[0]).attr("height",u[1]-u[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+u[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",u[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",u[1]-u[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function r(){function r(){32==Ks.event.keyCode&&(A||(y=null,E[0]-=u[1],E[1]-=h[1],A=2),v())}function p(){32==Ks.event.keyCode&&2==A&&(E[0]+=u[1],E[1]+=h[1],A=0,v())}function m(){var t=Ks.mouse(x),r=!1;b&&(t[0]+=b[0],t[1]+=b[1]),A||(Ks.event.altKey?(y||(y=[(u[0]+u[1])/2,(h[0]+h[1])/2]),E[0]=u[+(t[0]<y[0])],E[1]=h[+(t[1]<y[1])]):y=null),T&&g(t,l,0)&&(n(S),r=!0),C&&g(t,c,1)&&(i(S),r=!0),r&&(e(S),k({type:"brush",mode:A?"move":"resize"}))}function g(t,e,n){var i,r,a=Or(e),l=a[0],c=a[1],p=E[n],m=n?h:u,g=m[1]-m[0];return A&&(l-=p,c-=g+p),i=(n?d:f)?Math.max(l,Math.min(c,t[n])):t[n],A?r=(i+=p)+g:(y&&(p=Math.max(l,Math.min(c,2*y[n]-i))),i>p?(r=i,i=p):r=p),m[0]!=i||m[1]!=r?(n?o=null:s=null,m[0]=i,m[1]=r,!0):void 0}function _(){m(),S.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Ks.select("body").style("cursor",null),N.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),k({type:"brushend"})}var y,b,x=this,w=Ks.select(Ks.event.target),k=a.of(x,arguments),S=Ks.select(x),M=w.datum(),T=!/^(n|s)$/.test(M)&&l,C=!/^(e|w)$/.test(M)&&c,A=w.classed("extent"),D=q(),E=Ks.mouse(x),N=Ks.select(no).on("keydown.brush",r).on("keyup.brush",p);if(Ks.event.changedTouches?N.on("touchmove.brush",m).on("touchend.brush",_):N.on("mousemove.brush",m).on("mouseup.brush",_),S.interrupt().selectAll("*").interrupt(),A)E[0]=u[0]-E[0],E[1]=h[0]-E[1];else if(M){var z=+/w$/.test(M),P=+/^n/.test(M);b=[u[1-z]-E[0],h[1-P]-E[1]],E[0]=u[z],E[1]=h[P]}
724else Ks.event.altKey&&(y=E.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Ks.select("body").style("cursor",w.style("cursor")),k({type:"brushstart"}),m()}var s,o,a=b(t,"brushstart","brush","brushend"),l=null,c=null,u=[0,0],h=[0,0],f=!0,d=!0,p=Ll[0];return t.event=function(t){t.each(function(){var t=a.of(this,arguments),e={x:u,y:h,i:s,j:o},n=this.__chart__||e;this.__chart__=e,Dl?Ks.select(this).transition().each("start.brush",function(){s=n.i,o=n.j,u=n.x,h=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=vi(u,e.x),i=vi(h,e.y);return s=o=null,function(r){u=e.x=n(r),h=e.y=i(r),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){s=e.i,o=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(l=e,p=Ll[!l<<1|!c],t):l},t.y=function(e){return arguments.length?(c=e,p=Ll[!l<<1|!c],t):c},t.clamp=function(e){return arguments.length?(l&&c?(f=!!e[0],d=!!e[1]):l?f=!!e:c&&(d=!!e),t):l&&c?[f,d]:l?f:c?d:null},t.extent=function(e){var n,i,r,a,f;return arguments.length?(l&&(n=e[0],i=e[1],c&&(n=n[0],i=i[0]),s=[n,i],l.invert&&(n=l(n),i=l(i)),n>i&&(f=n,n=i,i=f),(n!=u[0]||i!=u[1])&&(u=[n,i])),c&&(r=e[0],a=e[1],l&&(r=r[1],a=a[1]),o=[r,a],c.invert&&(r=c(r),a=c(a)),r>a&&(f=r,r=a,a=f),(r!=h[0]||a!=h[1])&&(h=[r,a])),t):(l&&(s?(n=s[0],i=s[1]):(n=u[0],i=u[1],l.invert&&(n=l.invert(n),i=l.invert(i)),n>i&&(f=n,n=i,i=f))),c&&(o?(r=o[0],a=o[1]):(r=h[0],a=h[1],c.invert&&(r=c.invert(r),a=c.invert(a)),r>a&&(f=r,r=a,a=f))),l&&c?[[n,r],[i,a]]:l?[n,i]:c&&[r,a])},t.clear=function(){return t.empty()||(u=[0,0],h=[0,0],s=o=null),t},t.empty=function(){return!!l&&u[0]==u[1]||!!c&&h[0]==h[1]},Ks.rebind(t,a,"on")};var Rl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ll=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Fl=ra.format=ua.timeFormat,Ol=Fl.utc,Hl=Ol("%Y-%m-%dT%H:%M:%S.%LZ");Fl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ws:Hl,Ws.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ws.toString=Hl.toString,ra.second=Ft(function(t){return new sa(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ra.seconds=ra.second.range,ra.seconds.utc=ra.second.utc.range,ra.minute=Ft(function(t){return new sa(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ra.minutes=ra.minute.range,ra.minutes.utc=ra.minute.utc.range,ra.hour=Ft(function(t){var e=t.getTimezoneOffset()/60;return new sa(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ra.hours=ra.hour.range,ra.hours.utc=ra.hour.utc.range,ra.month=Ft(function(t){return t=ra.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ra.months=ra.month.range,ra.months.utc=ra.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],ql=[[ra.second,1],[ra.second,5],[ra.second,15],[ra.second,30],[ra.minute,1],[ra.minute,5],[ra.minute,15],[ra.minute,30],[ra.hour,1],[ra.hour,3],[ra.hour,6],[ra.hour,12],[ra.day,1],[ra.day,2],[ra.week,1],[ra.month,1],[ra.month,3],[ra.year,1]],Bl=Fl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ce]]),Ul={range:function(t,e,n){return Ks.range(Math.ceil(t/n)*n,+e,n).map(Xs)},floor:Ct,ceil:Ct};ql.year=ra.year,ra.scale=function(){return Ys(Ks.scale.linear(),ql,Bl)};var Wl=ql.map(function(t){return[t[0].utc,t[1]]}),Yl=Ol.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ce]]);Wl.year=ra.year.utc,ra.scale.utc=function(){return Ys(Ks.scale.linear(),Wl,Yl)},Ks.text=At(function(t){return t.responseText}),Ks.json=function(t,e){return Dt(t,"application/json",Js,e)},Ks.html=function(t,e){return Dt(t,"text/html",Gs,e)},Ks.xml=At(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(Ks):"object"==typeof module&&module.exports?module.exports=Ks:this.d3=Ks}();(function(){on_ready(function(){var t;$("table.ms_cmm_table").dataTable();$("div.ms-search-table table").each(function(t,e){return $(e).dataTable({aaSorting:[[6,"asc"]]})});t=function(t,e){return $(t).change(function(t){var n,i,r,s,o,a,l;l=$("option:selected",this).text();r=$(e);i=function(){switch(l){case"Positive":return r.data("positive-adducts");case"Negative":return r.data("negative-adducts");case"Neutral":return r.data("neutral-adducts")}}();r.empty();for(s=0,o=i.length;s<o;s++){n=i[s];a=$("<option></option>").attr("value",n).text(n);r.append(a)}if(r.data("remember-selected")){r.val(r.data("remember-selected").split(" "))}return t.preventDefault()})};t("#ms_search_ion_mode","#adduct_type");return $("#ms_search_ion_mode").trigger("change")})}).call(this);(function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e=function(t,e){for(var i in e){if(n.call(e,i))t[i]=e[i]}function r(){this.constructor=t}r.prototype=e.prototype;t.prototype=new r;t.__super__=e.prototype;return t},n={}.hasOwnProperty;this.SpectrumChart=function(){e.prototype.x_title="X title";e.prototype.y_title="Y title";e.prototype.x_getter=function(t){return+t.x};e.prototype.y_getter=function(t){return+t.y};e.prototype.shift_intensity_x=1;e.prototype.shift_intensity_y=1;e.buildAll=function(t,e){var n;if(e==null){e={}}n=this;return d3.selectAll(t).map(function(t){return new n(d3.select(this))})};e.prototype.setup_chart_info=function(){};e.prototype.draw_peak_assignments=function(t){this.chart.selectAll("div.peak-assignment").attr("class","peak-assignment hidden");if(t.assignment){return this.chart.select("#assignment-"+t.assignment.id).attr("class","peak-assignment")}};e.prototype.peak_url=function(t){return t};e.prototype.orient_canvas=function(t){return t.attr("transform","translate("+(this.width+this.margin.left)+","+(this.height+this.margin.top)+") scale(-1,-1)")};e.prototype.orient_x_rules=function(t){return t.attr("transform","scale(1,-1)")};e.prototype.orient_x_rule_numbers=function(t){return t.attr("transform","scale(-1,1)")};e.prototype.orient_intensity=function(t){return t.attr("transform","scale("+-this.shift_intensity_x+","+-this.shift_intensity_y+")")};function e(e){this.chart=e;this.select_prev_peak=t(this.select_prev_peak,this);this.select_next_peak=t(this.select_next_peak,this);this.orient_intensity=t(this.orient_intensity,this);this.orient_x_rule_numbers=t(this.orient_x_rule_numbers,this);this.orient_x_rules=t(this.orient_x_rules,this);this.orient_canvas=t(this.orient_canvas,this);this.draw_peak_assignments=t(this.draw_peak_assignments,this);this.width=500;this.height=300;this.zoom_window_height=80;this.margin={top:10,right:10,bottom:60,left:60};this.setup_chart();this.setup_chart_info();this.data_url=this.chart.attr("data-url");this.fetch_data(this.data_url,this.draw_chart)}e.prototype.fetch_data=function(t,e){var n,i,r,s,o;n=this;s=this.x_getter;o=this.y_getter;r=this.sort_peaks;i=this.normalize_intensity;return d3.json(this.peaks_data_url(),function(t){var i;t.forEach(function(t,e){t.x=+s(t);t.y=+o(t);t.selected=false;return t.assignment=t.assignments.length>0?t.assignments[0]:null});i=r(t);
724i.forEach(function(t,e){return t.index=e});n.peaks=t;return e.call(n)})};e.prototype.sort_peaks=function(t){return t.sort(function(t,e){return t.x-e.x})};e.prototype.peaks_data_url=function(){return this.data_url+"/peaks.json"};e.prototype.setup_chart=function(){this.chart_title=this.chart.attr("data-title");this.specdiv=this.chart.append("div").attr("class","spectrum");this.specdiv.append("h1").text(this.chart_title);this.specsvg=this.specdiv.append("svg").style("padding-left","30px").attr("width",this.width+this.margin.left+this.margin.right).attr("height",this.height+this.margin.top+this.margin.bottom);this.specdiv.append("p").attr("class","instructions").text("Hover over peaks or use controls on the right hand side to view the assignments for each peak.");this.y_rules_container=this.specsvg.append("g");this.canvas=this.specsvg.append("g").call(this.orient_canvas);return this.append_toolbar()};e.prototype.append_toolbar=function(){this.char_toolbar=this.chart.append("div").attr("class","toolbar");this.next_button=this.char_toolbar.append("div").attr("class","btn next").on("click",this.select_next_peak);this.prev_button=this.char_toolbar.append("div").attr("class","btn prev").on("click",this.select_prev_peak);return this.char_toolbar.selectAll("div.btn").on("mousedown",this.draw_pressed_button).on("mouseup",this.draw_released_button).on("mouseout",this.draw_released_button)};e.prototype.select_next_peak=function(){var t;t=this.selected_peak||0;return this.select_peak(t+1)}
725;e.prototype.select_prev_peak=function(){var t;t=this.selected_peak||0;return this.select_peak(t-1)};e.prototype.select_peak=function(t){var e,n;e=this.spectrum_peaks.length;this.selected_peak=t<0?e-1-(e-1-t)%e:t%this.spectrum_peaks.length;this.spectrum_peaks_container.selectAll(".peak").classed("selected",fal
725se);n=d3.select(this.spectrum_peaks[this.selected_peak]);n.attr("class","peak selected");return this.draw_peak_assignments(n.datum())};e.prototype.draw_pressed_button=function(){return d3.select(this).classed("pressed",true)};e.prototype.draw_released_button=function(){return d3.select(this).classed("pressed",false)};e.prototype.draw_chart=function(t){var e,n;e={max:d3.max(this.peaks,function(t){return t.x}),min:d3.min(this.peaks,function(t){return t.x})};e.scale=d3.scale.linear().range([0,this.width]).domain([e.min,e.max]).nice();n={max:d3.max(this.peaks,function(t){return t.y}),min:0};n.scale=d3.scale.linear().range([0,this.height-40]).domain([n.min,n.max]).nice();e.min=e.min<0?e.min:0;this.draw_y_axis(n);this.draw_x_axis(e);this.draw_peaks(this.peaks,e,n);this.draw_peak_x_labels(this.peaks,e,n);return this.select_peak(0)};e.prototype.draw_peaks=function(t,e,n){var i;this.spectrum_peaks_container=this.canvas.append("g");i=this;this.spectrum_peaks_container.selectAll(".peak").data(t).enter().append("line").attr("class","peak").attr("y1",n.min).attr("y2",function(t){return function(t){return n.scale(t.y)}}(this)).attr("x1",function(t){return function(t){return e.scale(t.x)}}(this)).attr("x2",function(t){return function(t){return e.scale(t.x)}}(this)).on("mouseover",function(t,e){return i.select_peak(e)});return this.spectrum_peaks=this.spectrum_peaks_container.selectAll(".peak")[0]};e.prototype.draw_peak_x_labels=function(t,e,n){var i,r,s;this.peak_x_labels=this.canvas.append("g");i=this;s=5;r=10;return this.peak_x_labels.selectAll("g.peak-x-label").data(t).enter().append("g").attr("class","peak-x-label").attr("transform",function(t){return function(i){return"translate("+(e.scale(i.x)+t.shift_intensity_x*r)+","+(n.scale(i.y)+t.shift_intensity_y*s)+")"}}(this)).append("text").text(function(t){return function(t){return t.x.toFixed(1)}}(this)).call(this.orient_intensity)};e.prototype.draw_x_axis=function(t){var e,n;e=d3.svg.axis().orient("bottom").scale(t.scale);this.x_rules=this.canvas.append("g").attr("class","axis").call(this.orient_x_rules).call(e);this.x_rules.selectAll("text").call(this.orient_x_rule_numbers);n=this.x_title_getter!=null?this.x_title_getter():this.x_title;return this.specsvg.append("text").attr("class","title").attr("x",this.width/2+this.margin.left).attr("dy",this.height+this.margin.top+this.margin.bottom/2+10).attr("text-anchor","middle").text(n)};e.prototype.draw_y_axis=function(t){var e;this.y_rules_container.attr("transform","translate("+this.margin.left+","+(this.height+this.margin.top)+") scale(1,-1)");this.y_rules=this.y_rules_container.selectAll(".rule").data(t.scale.ticks(10)).enter().append("g").attr("class","rule").attr("transform",function(e){return"translate(0,"+t.scale(e)+")"});this.y_rules.append("line").attr("x2",this.width);this.y_rules.append("text").attr("x",-6).attr("dy",".35em").attr("text-anchor","end").text(function(t){return t}).attr("transform","scale(1,-1)");e=this.y_title_getter!=null?this.y_title_getter():this.y_title;return this.specsvg.append("text").attr("class","title").attr("transform","rotate(-90)").attr("y",this.margin.left/2-10).attr("x",-this.height/2-this.margin.top).attr("text-anchor","middle").text(e)};return e}();this.MsMsChart=function(n){e(i,n);function i(){this.orient_x_rule_numbers=t(this.orient_x_rule_numbers,this);this.orient_x_rules=t(this.orient_x_rules,this);this.orient_canvas=t(this.orient_canvas,this);return i.__super__.constructor.apply(this,arguments)}i.prototype.x_title="Mass Charge (m/z)";i.prototype.y_title="Intensity";i.prototype.x_getter=function(t){return+t.mass_charge};i.prototype.y_getter=function(t){return+t.intensity};i.prototype.shift_intensity_x=-1;i.prototype.shift_intensity_y=1;i.prototype.orient_canvas=function(t){return t.attr("transform","translate("+this.margin.left+","+(this.height+this.margin.top)+") scale(1,-1)")};i.prototype.orient_x_rules=function(t){return t.attr("transform","scale(1,-1)")};i.prototype.orient_x_rule_numbers=function(t){};return i}(this.SpectrumChart);this.CMsChart=function(t){e(n,t);function n(){return n.__super__.constructor.apply(this,arguments)}n.prototype.y_getter=function(t){if(t.intensity===null){return 1}else{return+t.intensity}};return n}(this.MsMsChart);this.NmrOneDChart=function(n){e(i,n);function i(){this.orient_intensity=t(this.orient_intensity,this);return i.__super__.constructor.apply(this,arguments)}i.prototype.x_title="Chemical Shift";i.prototype.y_title="Intensity";i.prototype.x_getter=function(t){return+t.chemical_shift};i.prototype.y_getter=function(t){return+t.intensity};i.prototype.orient_intensity=function(t){return t.attr("transform","scale(-1,-1)")};i.prototype.draw_peak_assignments=function(t){};i.prototype.draw_peak_x_labels=function(t,e,n){};i.prototype.sort_peaks=function(t){return t.sort(function(t,e){return e.x-t.x}
725)};return i}(this.SpectrumChart);this.NmrTwoDChart=function(t){e(n,t);function n(){return n.__super__.constructor.apply(this,arguments)}n.prototype.x_title_getter=function(){return this.chart.attr("data-nucleus-x")+" Chemical Shift (ppm)"};n.prototype.y_title_getter=function(){return this.chart.attr("data-nucleus-y")+" Chemical Shift (ppm)"};n.prototype.x_getter=function(t){return+t.chemical_shift_x};n.prototype.y_getter=function(t){return+t.chemical_shift_y};n.prototype.sort_peaks=function(t){return t.sort(function(t,e){return e.x-t.x})};n.prototype.draw_peaks=function(t,e,n){var i;this.spectrum_peaks_container=this.canvas.append("g");i=this;this.spectrum_peaks_container.selectAll(".peak").data(t).enter().append("circle").attr("class","peak").attr("r",10).attr("cy",function(t){return function(t){return n.scale(t.y)}}(this)).attr("cx",function(t){return function(t){return e.scale(t.x)}}(this)).on("mouseover",function(t,e){return i.select_peak(e)});return this.spectrum_peaks=this.spectrum_peaks_container.selectAll(".peak")[0]};return n}(this.SpectrumChart);$(document).ready(function(){})}).call(this);var Rickshaw={namespace:function(t,e){var n=t.split(".");var i=Rickshaw;for(var r=1,s=n.length;r<s;r++){var o=n[r];i[o]=i[o]||{};i=i[o]}return i},keys:function(t){var e=[];for(var n in t)e.push(n);return e},extend:function(t,e){for(var n in e){t[n]=e[n]}return t},clone:function(t){return JSON.parse(JSON.stringify(t))}};if(typeof module!=="undefined"&&module.exports){var d3=require("d3");module.exports=Rickshaw}(function(t){var e=Object.prototype.toString,n="Null",i="Undefined",r="Boolean",s="Number",o="String",a="Object",l="[object Function]";function c(t){return e.call(t)===l}function u(t,e){for(var n in e)if(e.hasOwnProperty(n))t[n]=e[n];return t}function h(t){if(f(t)!==a){throw new TypeError}var e=[];for(var n in t){if(t.hasOwnProperty(n)){e.push(n)}}return e}function f(t){switch(t){case null:return n;case void 0:return i}var e=typeof t;switch(e){case"boolean":return r;case"number":return s;case"string":return o}return a}function d(t){return typeof t==="undefined"}var p=Array.prototype.slice;function m(t){var e=t.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return e.length==1&&!e[0]?[]:e}function g(t,e){var n=t;return function(){var t=_([y(n,this)],arguments);return e.apply(this,t)}}function _(t,e){var n=t.length,i=e.length;while(i--)t[n+i]=e[i];return t}function v(t,e){t=p.call(t,0);return _(t,e)}function y(t,e){if(arguments.length<2&&d(arguments[0]))return this;var n=t,i=p.call(arguments,2);return function(){var t=v(i,arguments);return n.apply(e,t)}}var b=function(){};var x=function(){var t=function(){for(var t in{toString:1}){if(t==="toString")return false}return true}();function e(){}function n(){var t=null,n=[].slice.apply(arguments);if(c(n[0]))t=n.shift();function i(){this.initialize.apply(this,arguments)}u(i,x.Methods);i.superclass=t;i.subclasses=[];if(t){e.prototype=t.prototype;i.prototype=new e;try{t.subclasses.push(i)}catch(o){}}for(var r=0,s=n.length;r<s;r++)i.addMethods(n[r]);if(!i.prototype.initialize)i.prototype.initialize=b;i.prototype.constructor=i;return i}function i(e){var n=this.superclass&&this.superclass.prototype,i=h(e);if(t){if(e.toString!=Object.prototype.toString)i.push("toString");if(e.valueOf!=Object.prototype.valueOf)i.push("valueOf")}for(var r=0,s=i.length;r<s;r++){var o=i[r],a=e[o];if(n&&c(a)&&m(a)[0]=="$super"){var l=a;a=g(function(t){return function(){return n[t].apply(this,arguments)}}(o),l);a.valueOf=y(l.valueOf,l);a.toString=y(l.toString,l)}this.prototype[o]=a}return this}return{create:n,Methods:{addMethods:i}}}();if(t.exports){t.exports.Class=x}else{t.Class=x}})(Rickshaw);Rickshaw.namespace("Rickshaw.Compat.ClassList");Rickshaw.Compat.ClassList=function(){if(typeof document!=="undefined"&&!("classList"in document.createElement("a"))){(function(t){"use strict";var e="classList",n="prototype",i=(t.HTMLElement||t.Element)[n],r=Object,s=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){var e=0,n=this.length;for(;e<n;e++){if(e in this&&this[e]===t){return e}}return-1},a=function(t,e){this.name=t;this.code=DOMException[t];this.message=e},l=function(t,e){if(e===""){throw new a("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(e)){throw new a("INVALID_CHARACTER_ERR","String contains an invali
725d character")}return o.call(t,e)},c=function(t){var e=s.call(t.className),n=e?e.split(/\s+/):[],i=0,r=n.length;for(;i<r;i++){this.push(n[i])}this._updateClassName=function(){t.className=this.toString()}},u=c[n]=[],h=function(){return new c(this)};a[n]=Error[n];u.item=function(t){return this[t]||null};u.contains=function(t){t+="";return l(this,t)!==-1};u.add=function(t){t+="";if(l(this,t)===-1){this.push(t);this._updateClassName()}};u.remove=function(t){t+="";var e=l(this,t);if(e!==-1){this.splice(e,1);this._updateClassName()}};u.toggle=function(t){t+="";if(l(this,t)===-1){this.add(t)}else{this.remove(t)}};u.toString=function(){return this.join(" ")};if(r.defineProperty){var f={get:h,enumerable:true,configurable:true};try{r.defineProperty(i,e,f)}catch(d){if(d.number===-2146823252){f.enumerable=false;r.defineProperty(i,e,f)}}}else if(r[n].__defineGetter__){i.__defineGetter__(e,h)}})(window)}};if(typeof RICKSHAW_NO_COMPAT!=="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT==="undefined"){new Rickshaw.Compat.ClassList}Rickshaw.namespace("Rickshaw.Graph");Rickshaw.Graph=function(t){var e=this;this.initialize=function(t){if(!t.element)throw"Rickshaw.Graph needs a reference to an element";if(t.element.nodeType!==1)throw"Rickshaw.Graph element was defined but not an HTML element";this.element=t.element;this.series=t.series;this.window={};this.updateCallbacks=[];this.configureCallbacks=[];this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined,preserve:false,xScale:undefined,yScale:undefined};this._loadRenderers();this.configure(t);this.validateSeries(t.series);this.series.active=function(){return e.series.filter(function(t){return!t.disabled})};this.setSize({width:t.width,height:t.height});this.element.classList.add("rickshaw_graph");this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);this.discoverRange()};this._loadRenderers=function(){for(var t in Rickshaw.Graph.Renderer){if(!t||!Rickshaw.Graph.Renderer.hasOwnProperty(t))continue;var n=Rickshaw.Graph.Renderer[t];if(!n||!n.prototype||!n.prototype.render)continue;e.registerRenderer(new n({graph:e}))}};this.validateSeries=function(t){if(!Array.isArray(t)&&!(t instanceof Rickshaw.Series)){var e=Object.prototype.toString.apply(t);throw"series is not an array: "+e}var n;t.forEach(function(t){if(!(t instanceof Object)){throw"series element is not an object: "+t}if(!t.data){throw"series has no data: "+JSON.stringify(t)}if(!Array.isArray(t.data)){throw"series data is not an array: "+JSON.stringify(t.data)}var e=t.data[0].x;var n=t.data[0].y;if(typeof e!="number"||typeof n!="number"&&n!==null){throw"x and y properties of points should be numbers instead of "+typeof e+" and "+typeof n}if(t.data.length>=3){if(t.data[2].x<t.data[1].x||t.data[1].x<t.data[0].x||t.data[t.data.length-1].x<t.data[0].x){throw"series data needs to be sorted on x values for series name: "+t.name}}},this)};this.dataDomain=function(){var t=this.series.map(function(t){return t.data});var e=d3.min(t.map(function(t){return t[0].x}));var n=d3.max(t.map(function(t){return t[t.length-1].x}));return[e,n]};this.discoverRange=function(){var t=this.renderer.domain();this.x=(this.xScale||d3.scale.linear()).domain(t.x).range([0,this.width]);this.y=(this.yScale||d3.scale.linear()).domain(t.y).range([this.height,0]);this.y.magnitude=d3.scale.linear().domain([t.y[0]-t.y[0],t.y[1]-t.y[0]]).range([0,this.height])};this.render=function(){var t=this.stackData();this.discoverRange();this.renderer.render();this.updateCallbacks.forEach(function(t){t()})};this.update=this.render;this.stackData=function(){var t=this.series.active().map(function(t){return t.data}).map(function(t){return t.filter(function(t){return this._slice(t)},this)},this);var n=this.preserve;if(!n){this.series.forEach(function(t){if(t.scale){n=true}})}t=n?Rickshaw.clone(t):t;this.series.active().forEach(function(e,n){if(e.scale){var i=t[n];if(i){i.forEach(function(t){t.y=e.scale(t.y)})}}});this.stackData.hooks.data.forEach(function(n){t=n.f.apply(e,[t])});var i;
725if(!this.renderer.unstack){this._validateStackable();var r=d3.layout.stack();r.offset(e.offset);i=r(t)}i=i||t;if(this.renderer.unstack){i.forEach(function(t){t.forEach(function(t){t.y0=t.y0===undefined?0:t.y0})})}this.stackData.hooks.after.forEach(function(n){i=n.f.apply(e,[t])});var s=0;this.series.forEach(function(t){if(t.disabled)return;t.stack=i[s++]});this.stackedData=i;return i};this._validateStackable=function(){var t=this.series;var e;t.forEach(function(t){e=e||t.data.length;if(e&&t.data.length!=e){throw"stacked series cannot have differing numbers of points: "+e+" vs "+t.data.length+"; see Rickshaw.Series.fill()"}},this)};this.stackData.hooks={data:[],after:[]};this._slice=function(t){if(this.window.xMin||this.window.xMax){var e=true;if(this.window.xMin&&t.x<this.window.xMin)e=false;if(this.window.xMax&&t.x>this.window.xMax)e=false;return e}return true};this.onUpdate=function(t){this.updateCallbacks.push(t)};this.onConfigure=function(t){this.configureCallbacks.push(t)};this.registerRenderer=function(t){this._renderers=this._renderers||{};this._renderers[t.name]=t};this.configure=function(t){this.config=this.config||{};if(t.width||t.height){this.setSize(t)}Rickshaw.keys(this.defaults).forEach(function(e){this.config[e]=e in t?t[e]:e in this?this[e]:this.defaults[e]},this);Rickshaw.keys(this.config).forEach(function(t){this[t]=this.config[t]},this);var e=t.renderer||this.renderer&&this.renderer.name||"stack";this.setRenderer(e,t);this.configureCallbacks.forEach(function(e){e(t)})};this.setRenderer=function(t,n){if(typeof t=="function"){this.renderer=new t({graph:e});this.registerRenderer(this.renderer)}else{if(!this._renderers[t]){throw"couldn't find renderer "+t}this.renderer=this._renderers[t]}if(typeof n=="object"){this.renderer.configure(n)}};this.setSize=function(t){t=t||{};if(typeof window!==undefined){var e=window.getComputedStyle(this.element,null);var n=parseInt(e.getPropertyValue("width"),10);var i=parseInt(e.getPropertyValue("height"),10)}this.width=t.width||n||400;this.height=t.height||i||250;this.vis&&this.vis.attr("width",this.width).attr("height",this.height)};this.initialize(t)};Rickshaw.namespace("Rickshaw.Fixtures.Color");Rickshaw.Fixtures.Color=function(){this.schemes={};this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse();this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"];this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"];this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse();this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"};this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse();this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"];this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]};Rickshaw.namespace("Rickshaw.Fixtures.RandomData");Rickshaw.Fixtures.RandomData=function(t){var e;t=t||1;var n=200;var i=Math.floor((new Date).getTime()/1e3);this.addData=function(e){var r=Math.random()*100+15+n;var s=e[0].length;var o=1;e.forEach(function(e){var n=Math.random()*20;var a=r/25+o+++(Math.cos(s*o*11/960)+2)*15+(Math.cos(s/7)+2)*7+(Math.cos(s/17)+2)*1;e.push({x:s*t+i,y:a+n})});n=r*.85};this.removeData=function(e){e.forEach(function(t){t.shift()});i+=t}};Rickshaw.namespace("Rickshaw.Fixtures.Time");Rickshaw.Fixtures.Time=function(){var t=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(t){return parseInt(t.getUTCFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(t){return t.getUTCFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(e){return t.months[e.getUTCMonth()]}},{name:"week",seconds:86400*7,formatter:function(e){return t.formatDate(e)}},{name:"day",seconds:86400,formatter:function(t){return t.getUTCDate()}},{name:"6 hour",seconds:3600*6,formatter:function(e){return t.formatTime(e)}},{name:"hour",seconds:3600,formatter:function(e){return t.formatTime(e)}},{name:"15 minute",seconds:60*15,formatter:function(e){return t.formatTime(e)}},{name:"minute",seconds:60,formatter:function(t){return t.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(t){return t.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(t){return t.getUTCSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(t){return t.getUTCMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(t){return t.getUTCMilliseconds()+"ms"}}];this.unit=function(t){return this.units.filter(function(e){return t==e.name}).shift()};this.formatDate=function(t){return d3.time.format("%b %e")(t)};this.formatTime=function(t){return t.toUTCString().match(/(\d+:\d+):/)[1]};this.ceil=function(t,e){var n,i,r;if(e.name=="month"){n=new Date(t*1e3);i=Date.UTC(n.getUTCFullYear(),n.getUTCMonth())/1e3;if(i==t)return t;r=n.getUTCFullYear();var s=n.getUTCMonth();if(s==11){s=0;r=r+1}else{s+=1}return Date.UTC(r,s)/1e3}if(e.name=="year"){n=new Date(t*1e3);i=Date.UTC(n.getUTCFullYear(),0)/1e3;if(i==t)return t;r=n.getUTCFullYear()+1;return Date.UTC(r,0)/1e3}return Math.ceil(t/e.seconds)*e.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Time.Local");Rickshaw.Fixtures.Time.Local=function(){var t=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(t){return parseInt(t.getFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(t){return t.getFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(e){return t.months[e.getMonth()]}},{name:"week",seconds:86400*7,formatter:function(e){return t.formatDate(e)}},{name:"day",seconds:86400,formatter:function(t){return t.getDate()}},{name:"6 hour",seconds:3600*6,formatter:function(e){return t.formatTime(e)}},{name:"hour",seconds:3600,formatter:function(e){return t.formatTime(e)}},{name:"15 minute",seconds:60*15,formatter:function(e){return t.formatTime(e)}},{name:"minute",seconds:60,formatter:function(t){return t.getMinutes()}},{name:"15 second",seconds:15,formatter:function(t){return t.getSeconds()+"s"}},{name:"second",seconds:1,formatter:function(t){return t.getSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(t){return t.getMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(t){return t.getMilliseconds()+"ms"}}];this.unit=function(t){return this.units.filter(function(e){return t==e.name}).shift()};this.formatDate=function(t){return d3.time.format("%b %e")(t)};this.formatTime=function(t){return t.toString().match(/(\d+:\d+):/)[1]};this.ceil=function(t,e){var n,i,r;if(e.name=="day"){var s=new Date((t+e.seconds-1)*1e3);var o=new Date(0);o.setMilliseconds(0);o.setSeconds(0);o.setMinutes(0);o.setHours(0);o.setDate(s.getDate());o.setMonth(s.getMonth());o.setFullYear(s.getFullYear());return o.getTime()/1e3}if(e.name=="month"){n=new Date(t*1e3);i=new Date(n.getFullYear(),n.getMonth()).getTime()/1e3;if(i==t)return t;r=n.getFullYear();var a=n.getMonth();if(a==11){a=0;r=r+1}else{a+=1}return new Date(r,a).getTime()/1e3}if(e.name=="year"){n=new Date(t*1e3);i=new Date(n.getUTCFullYear(),0).getTime()/1e3;if(i==t)return t;r=n.getFullYear()+1;return new Date(r,0).getTime()/1e3}return Math.ceil(t/e.seconds)*e.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Number");Rickshaw.Fixtures.Number.formatKMBT=function(t){var e=Math.abs(t);if(e>=1e12){return t/1e12+"T"}else if(e>=1e9){return t/1e9+"B"}else if(e>=1e6){return t/1e6+"M"}else if(e>=1e3){return t/1e3+"K"}else if(e<1&&t>0){return t.toFixed(2)}else if(e===0){return""}else{return t}};Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(t){var e=Math.abs(t);if(e>=0x4000000000000){return t/0x4000000000000+"P"}else if(e>=1099511627776){return t/1099511627776+"T"}else if(e>=1073741824){return t/1073741824+"G"}else if(e>=1048576){return t/1048576+"M"}else if(e>=1024){return t/1024+"K"}else if(e<1&&t>0){return t.toFixed(2)}else if(e===0){return""}else{return t}};Rickshaw.namespace("Rickshaw.Color.Palette");Rickshaw.Color.Palette=function(t){var e=new Rickshaw.Fixtures.Color;t=t||{};this.schemes={};this.scheme=e.schemes[t.scheme]||t.scheme||e.schemes.colorwheel;this.runningIndex=0;this.generatorIndex=0;if(t.interpolatedStopCount){var n=this.scheme.length-1;var i,r,s=[];for(i=0;i<n;i++){s.push(this.scheme[i]);var o=d3.interpolateHsl(this.scheme[i],this.scheme[i+1]);for(r=1;r<t.interpolatedStopCount;r++){s.push(o(1/t.interpolatedStopCount*r))}}s.push(this.scheme[this.scheme.length-1]);this.scheme=s}this.rotateCount=this.scheme.length;this.color=function(t){return this.scheme[t]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"};this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var t;if(this.generatorIndex==this.rotateCount*2-1){t=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5);this.generatorIndex=0;this.rotateCount*=2}else{t=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5);this.generatorIndex++}this.scheme.push(t);return t}};Rickshaw.namespace("Rickshaw.Graph.Ajax");Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(t){this.dataURL=t.dataURL;this.onData=t.onData||function(t){return t};this.onComplete=t.onComplete||function(){};this.onError=t.onError||function(){};this.args=t;this.request()},request:function(){$.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL);this.onError(this)},success:function(t,e){t=this.onData(t);this.args.series=this._splice({data:t,series:this.args.series});this.graph=this.graph||new Rickshaw.Graph(this.args);this.graph.render();this.onComplete(this)},_splice:function(t){var e=t.data;var n=t.series;if(!t.series)return e;
725n.forEach(function(t){var n=t.key||t.name;if(!n)throw"series needs a key or a name";e.forEach(function(e){var i=e.key||e.name;if(!i)throw"data needs a key or a name";if(n==i){var r=["color","name","data"];r.forEach(function(n){if(e[n])t[n]=e[n]})}})});return n}});Rickshaw.namespace("Rickshaw.Graph.Annotate");Rickshaw.Graph.Annotate=function(t){var e=this.graph=t.graph;this.elements={timeline:t.element};var n=this;this.data={};this.elements.timeline.classList.add("rickshaw_annotation_timeline");this.add=function(t,e,i){n.data[t]=n.data[t]||{boxes:[]};n.data[t].boxes.push({content:e,end:i})};this.update=function(){Rickshaw.keys(n.data).forEach(function(t){var e=n.data[t];var i=n.graph.x(t);if(i<0||i>n.graph.x.range()[1]){if(e.element){e.line.classList.add("offscreen");e.element.style.display="none"}e.boxes.forEach(function(t){if(t.rangeElement)t.rangeElement.classList.add("offscreen")});return}if(!e.element){var r=e.element=document.createElement("div");r.classList.add("annotation");this.elements.timeline.appendChild(r);r.addEventListener("click",function(t){r.classList.toggle("active");e.line.classList.toggle("active");e.boxes.forEach(function(t){if(t.rangeElement)t.rangeElement.classList.toggle("active")})},false)}e.element.style.left=i+"px";e.element.style.display="block";e.boxes.forEach(function(t){var r=t.element;if(!r){r=t.element=document.createElement("div");r.classList.add("content");r.innerHTML=t.content;e.element.appendChild(r);e.line=document.createElement("div");e.line.classList.add("annotation_line");n.graph.element.appendChild(e.line);if(t.end){t.rangeElement=document.createElement("div");t.rangeElement.classList.add("annotation_range");n.graph.element.appendChild(t.rangeElement)}}if(t.end){var s=i;var o=Math.min(n.graph.x(t.end),n.graph.x.range()[1]);if(s>o){o=i;s=Math.max(n.graph.x(t.end),n.graph.x.range()[0])}var a=o-s;t.rangeElement.style.left=s+"px";t.rangeElement.style.width=a+"px";t.rangeElement.classList.remove("offscreen")}e.line.classList.remove("offscreen");e.line.style.left=i+"px"})},this)};this.graph.onUpdate(function(){n.update()})};Rickshaw.namespace("Rickshaw.Graph.Axis.Time");Rickshaw.Graph.Axis.Time=function(t){var e=this;this.graph=t.graph;this.elements=[];this.ticksTreatment=t.ticksTreatment||"plain";this.fixedTimeUnit=t.timeUnit;var n=t.timeFixture||new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var t;var e=n.units;var i=this.graph.x.domain();var r=i[1]-i[0];e.forEach(function(e){if(Math.floor(r/e.seconds)>=2){t=t||e}});return t||n.units[n.units.length-1]};this.tickOffsets=function(){var t=this.graph.x.domain();var e=this.fixedTimeUnit||this.appropriateTimeUnit();var i=Math.ceil((t[1]-t[0])/e.seconds);var r=t[0];var s=[];for(var o=0;o<i;o++){var a=n.ceil(r,e);r=a+e.seconds/2;s.push({value:a,unit:e})}return s};this.render=function(){this.elements.forEach(function(t){t.parentNode.removeChild(t)});this.elements=[];var t=this.tickOffsets();t.forEach(function(t){if(e.graph.x(t.value)>e.graph.x.range()[1])return;var n=document.createElement("div");n.style.left=e.graph.x(t.value)+"px";n.classList.add("x_tick");n.classList.add(e.ticksTreatment);var i=document.createElement("div");i.classList.add("title");i.innerHTML=t.unit.formatter(new Date(t.value*1e3));n.appendChild(i);e.graph.element.appendChild(n);e.elements.push(n)})};this.graph.onUpdate(function(){e.render()})};Rickshaw.namespace("Rickshaw.Graph.Axis.X");Rickshaw.Graph.Axis.X=function(t){var e=this;var n=.1;this.initialize=function(t){this.graph=t.graph;this.orientation=t.orientation||"top";this.pixelsPerTick=t.pixelsPerTick||75;if(t.ticks)this.staticTicks=t.ticks;if(t.tickValues)this.tickValues=t.tickValues;this.tickSize=t.tickSize||4;this.ticksTreatment=t.ticksTreatment||"plain";if(t.element){this.element=t.element;this._discoverSize(t.element,t);this.vis=d3.select(t.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:t.width,height:t.height})}else{this.vis=this.graph.vis}
725this.graph.onUpdate(function(){e.render()})};this.setSize=function(t){t=t||{};if(!this.element)return;this._discoverSize(this.element.parentNode,t);this.vis.attr("height",this.height).attr("width",this.width*(1+n));var e=Math.floor(this.width*n/2);this.element.style.left=-1*e+"px"};this.render=function(){if(this._renderWidth!==undefined&&this.graph.width!==this._renderWidth)this.setSize({auto:true});var e=d3.svg.axis().scale(this.graph.x).orient(this.orientation);e.tickFormat(t.tickFormat||function(t){return t});if(this.tickValues)e.tickValues(this.tickValues);this.ticks=this.staticTicks||Math.floor(this.graph.width/this.pixelsPerTick);var i=Math.floor(this.width*n/2)||0;var r;if(this.orientation=="top"){var s=this.height||this.graph.height;r="translate("+i+","+s+")"}else{r="translate("+i+", 0)"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",r).call(e.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var o=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(e.ticks(this.ticks).tickSubdivide(0).tickSize(o)).selectAll("text").each(function(){this.parentNode.setAttribute("data-x-value",this.textContent)});this._renderHeight=this.graph.height};this._discoverSize=function(t,e){if(typeof window!=="undefined"){var i=window.getComputedStyle(t,null);var r=parseInt(i.getPropertyValue("height"),10);if(!e.auto){var s=parseInt(i.getPropertyValue("width"),10)}}this.width=(e.width||s||this.graph.width)*(1+n);this.height=e.height||r||40};this.initialize(t)};Rickshaw.namespace("Rickshaw.Graph.Axis.Y");Rickshaw.Graph.Axis.Y=Rickshaw.Class.create({initialize:function(t){this.graph=t.graph;this.orientation=t.orientation||"right";this.pixelsPerTick=t.pixelsPerTick||75;if(t.ticks)this.staticTicks=t.ticks;if(t.tickValues)this.tickValues=t.tickValues;this.tickSize=t.tickSize||4;this.ticksTreatment=t.ticksTreatment||"plain";this.tickFormat=t.tickFormat||function(t){return t};this.berthRate=.1;if(t.element){this.element=t.element;this.vis=d3.select(t.element).append("svg:svg").attr("class","rickshaw_graph y_axis");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:t.width,height:t.height})}else{this.vis=this.graph.vis}var e=this;this.graph.onUpdate(function(){e.render()})},setSize:function(t){t=t||{};if(!this.element)return;if(typeof window!=="undefined"){var e=window.getComputedStyle(this.element.parentNode,null);var n=parseInt(e.getPropertyValue("width"),10);if(!t.auto){var i=parseInt(e.getPropertyValue("height"),10)}}this.width=t.width||n||this.graph.width*this.berthRate;this.height=t.height||i||this.graph.height;this.vis.attr("width",this.width).attr("height",this.height*(1+this.berthRate));var r=this.height*this.berthRate;if(this.orientation=="left"){this.element.style.top=-1*r+"px"}},render:function(){if(this._renderHeight!==undefined&&this.graph.height!==this._renderHeight)this.setSize({auto:true});this.ticks=this.staticTicks||Math.floor(this.graph.height/this.pixelsPerTick);var t=this._drawAxis(this.graph.y);this._drawGrid(t);this._renderHeight=this.graph.height},_drawAxis:function(t){var e=d3.svg.axis().scale(t).orient(this.orientation);e.tickFormat(this.tickFormat);if(this.tickValues)e.tickValues(this.tickValues);if(this.orientation=="left"){var n=this.height*this.berthRate;var i="translate("+this.width+", "+n+")"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",i).call(e.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));return e},_drawGrid:function(t){var e=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(t.ticks(this.ticks).tickSubdivide(0).tickSize(e)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)})}});Rickshaw.namespace("Rickshaw.Graph.Axis.Y.Scaled")
726;Rickshaw.Graph.Axis.Y.Scaled=Rickshaw.Class.create(Rickshaw.Graph.Axis.Y,{initialize:function($super,t){if(typeof t.scale==="undefined"){throw new Error("Scaled requires scale")}this.scale=t.scale;if(typeof t.grid==="undefined"){this.grid=true}else{this.grid=t.grid}$super(t)},_drawAxis:function($super,t){var e=this.scale.domain();var n=this.graph.renderer.domain().y;var i=[Math.min.apply(Math,e),Math.max.apply(Math,e)];var r=d3.scale.linear().domain([0,1]).range(i);var s=[r(n[0]),r(n[1])];var o=d3.scale.linear().domain(i).range(s);var a=this.scale.copy().domain(e.map(o)).range(t.range());return $super(a)}
726,_drawGrid:function($super,t){if(this.grid){$super(t)}}});Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(t){this.graph=t.graph;this.legend=t.legend;var e=this;var n={};var i=null;var r=t.disabledColor||function(t){return d3.interpolateRgb(t,d3.rgb("#d8d8d8"))(.8).toString()};this.addHighlightEvents=function(t){t.element.addEventListener("mouseover",function(s){if(i)return;else i=t;e.legend.lines.forEach(function(i){if(t===i){if(e.graph.renderer.unstack&&(i.series.renderer?i.series.renderer.unstack:true)){var s=e.graph.series.indexOf(i.series);i.originalIndex=s;var o=e.graph.series.splice(s,1)[0];e.graph.series.push(o)}return}n[i.series.name]=n[i.series.name]||i.series.color;i.series.color=r(i.series.color)});e.graph.update()},false);t.element.addEventListener("mouseout",function(r){if(!i)return;else i=null;e.legend.lines.forEach(function(i){if(t===i&&i.hasOwnProperty("originalIndex")){var r=e.graph.series.pop();e.graph.series.splice(i.originalIndex,0,r);delete i.originalIndex}if(n[i.series.name]){i.series.color=n[i.series.name]}});e.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(t){e.addHighlightEvents(t)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(t){this.graph=t.graph;this.legend=t.legend;var e=this;if(typeof window.$=="undefined"){throw"couldn't find jQuery at window.$"}if(typeof window.$.ui=="undefined"){throw"couldn't find jQuery UI at window.$.ui"}$(function(){$(e.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(t,n){var i=[];$(e.legend.list).find("li").each(function(t,e){if(!e.series)return;i.push(e.series)});for(var r=e.graph.series.length-1;r>=0;r--){e.graph.series[r]=i.shift()}e.graph.update()}});$(e.legend.list).disableSelection()});this.graph.onUpdate(function(){var t=window.getComputedStyle(e.legend.element).height;e.legend.element.style.height=t})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(t){this.graph=t.graph;this.legend=t.legend;var e=this;this.addAnchor=function(t){var n=document.createElement("a");n.innerHTML="&#10004;";n.classList.add("action");t.element.insertBefore(n,t.element.firstChild);n.onclick=function(e){if(t.series.disabled){t.series.enable();t.element.classList.remove("disabled")}else{if(this.graph.series.filter(function(t){return!t.disabled}).length<=1)return;t.series.disable();t.element.classList.add("disabled")}}.bind(this);var i=t.element.getElementsByTagName("span")[0];i.onclick=function(n){var i=t.series.disabled;if(!i){for(var r=0;r<e.legend.lines.length;r++){var s=e.legend.lines[r];if(t.series===s.series){}else if(s.series.disabled){}else{i=true;break}}}if(i){t.series.enable();t.element.classList.remove("disabled");e.legend.lines.forEach(function(e){if(t.series===e.series){}else{e.series.disable();e.element.classList.add("disabled")}})}else{e.legend.lines.forEach(function(t){t.series.enable();t.element.classList.remove("disabled")})}}};if(this.legend){if(typeof $!="undefined"&&$(this.legend.list).sortable){$(this.legend.list).sortable({start:function(t,e){e.item.bind("no.onclick",function(t){t.preventDefault()})},stop:function(t,e){setTimeout(function(){e.item.unbind("no.onclick")},250)}})}this.legend.lines.forEach(function(t){e.addAnchor(t)})}this._addBehavior=function(){this.graph.series.forEach(function(t){t.disable=function(){if(e.graph.series.length<=1){throw"only one series left"}t.disabled=true;e.graph.update()};t.enable=function(){t.disabled=false;e.graph.update()}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(t){var e=this.graph=t.graph;this.xFormatter=t.xFormatter||function(t){return new Date(t*1e3).toUTCString()};this.yFormatter=t.yFormatter||function(t){return t===null?t:t.toFixed(2)};var n=this.element=document.createElement("div");n.className="detail";this.visible=true;e.element.appendChild(n);this.lastEvent=null;this._addListeners();this.onShow=t.onShow;this.onHide=t.onHide;this.onRender=t.onRender;this.formatter=t.formatter||this.formatter},formatter:function(t,e,n,i,r,s){return t.name+":&nbsp;"+r},update:function(t){t=t||this.lastEvent;if(!t)return;this.lastEvent=t;if(!t.target.nodeName.match(/^(path|svg|rect|circle)$/))return;var e=this.graph;var n=t.offsetX||t.layerX;var i=t.offsetY||t.layerY;var r=0;var s=[];var o;
726this.graph.series.active().forEach(function(t){var a=this.graph.stackedData[r++];if(!a.length)return;var l=e.x.invert(n);var c=d3.scale.linear().domain([a[0].x,a.slice(-1)[0].x]).range([0,a.length-1]);var u=Math.round(c(l));if(u==a.length-1)u--;var h=Math.min(u||0,a.length-1);for(var f=u;f<a.length-1;){if(!a[f]||!a[f+1])break;if(a[f].x<=l&&a[f+1].x>l){h=Math.abs(l-a[f].x)<Math.abs(l-a[f+1].x)?f:f+1;break}if(a[f+1].x<=l){f++}else{f--}}if(h<0)h=0;var d=a[h];var p=Math.sqrt(Math.pow(Math.abs(e.x(d.x)-n),2)+Math.pow(Math.abs(e.y(d.y+d.y0)-i),2));var m=t.xFormatter||this.xFormatter;var g=t.yFormatter||this.yFormatter;var _={formattedXValue:m(d.x),formattedYValue:g(t.scale?t.scale.invert(d.y):d.y),series:t,value:d,distance:p,order:r,name:t.name};if(!o||p<o.distance){o=_}s.push(_)},this);if(!o)return;o.active=true;var a=o.value.x;var l=o.formattedXValue;this.element.innerHTML="";this.element.style.left=e.x(a)+"px";this.visible&&this.render({points:s,detail:s,mouseX:n,mouseY:i,formattedXValue:l,domainX:a})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(t){var e=this.graph;var n=t.points;var i=n.filter(function(t){return t.active}).shift();if(i.value.y===null)return;var r=i.formattedXValue;var s=i.formattedYValue;this.element.innerHTML="";this.element.style.left=e.x(i.value.x)+"px";var o=document.createElement("div");o.className="x_label";o.innerHTML=r;this.element.appendChild(o);var a=document.createElement("div");a.className="item";var l=i.series;var c=l.scale?l.scale.invert(i.value.y):i.value.y;a.innerHTML=this.formatter(l,i.value.x,c,r,s,i);a.style.top=this.graph.y(i.value.y0+i.value.y)+"px";this.element.appendChild(a);var u=document.createElement("div");u.className="dot";u.style.top=a.style.top;u.style.borderColor=l.color;this.element.appendChild(u);if(i.active){a.classList.add("active");u.classList.add("active")}var h=[o,a];h.forEach(function(t){t.classList.add("left")});this.show();var f=this._calcLayoutError(h);if(f>0){h.forEach(function(t){t.classList.remove("left");t.classList.add("right")});var d=this._calcLayoutError(h);if(d>f){h.forEach(function(t){t.classList.remove("right");t.classList.add("left")})}}if(typeof this.onRender=="function"){this.onRender(t)}},_calcLayoutError:function(t){var e=this.element.parentNode.getBoundingClientRect();var n=0;var i=t.forEach(function(t){var i=t.getBoundingClientRect();if(!i.width){return}if(i.right>e.right){n+=i.right-e.right}if(i.left<e.left){n+=e.left-i.left}});return n},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(t){this.visible=true;this.update(t)}.bind(this),false);this.graph.onUpdate(function(){this.update()}.bind(this));this.graph.element.addEventListener("mouseout",function(t){if(t.relatedTarget&&!(t.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this),false)}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){$.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=Rickshaw.Class.create({className:"rickshaw_legend",initialize:function(t){this.element=t.element;this.graph=t.graph;this.naturalOrder=t.naturalOrder;this.element.classList.add(this.className);this.list=document.createElement("ul");this.element.appendChild(this.list);this.render();this.graph.onUpdate(function(){})},render:function(){var t=this;while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.lines=[];var e=this.graph.series.map(function(t){return t});if(!this.naturalOrder){e=e.reverse()}e.forEach(function(e){t.addLine(e)})},addLine:function(t){var e=document.createElement("li");e.className="line";if(t.disabled){e.className+=" disabled"}if(t.className){d3.select(e).classed(t.className,true)}var n=document.createElement("div");n.className="swatch";n.style.backgroundColor=t.color;e.appendChild(n);var i=document.createElement("span");i.className="label";i.innerHTML=t.name;e.appendChild(i);this.list.appendChild(e);e.series=t;if(t.noLegend){e.style.display="none"}var r={element:e,series:t};if(this.shelving){this.shelving.addAnchor(r);this.shelving.updateBehaviour()}if(this.highlighter){this.highlighter.addHighlightEvents(r)}this.lines.push(r);return e}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(t){var e=this.element=t.element;var n=this.graph=t.graph;this.build();n.onUpdate(function(){this.update()}.bind(this))},build:function(){var t=this.element;var e=this.graph;var n=e.dataDomain();$(function(){$(t).slider({range:true,min:n[0],max:n[1],values:[n[0],n[1]],slide:function(t,n){if(n.values[1]<=n.values[0])return;e.window.xMin=n.values[0];e.window.xMax=n.values[1];
726e.update();var i=e.dataDomain();if(i[0]==n.values[0]){e.window.xMin=undefined}if(i[1]==n.values[1]){e.window.xMax=undefined}}})});$(t)[0].style.width=e.width+"px"},update:function(){var t=this.element;var e=this.graph;var n=$(t).slider("option","values");var i=e.dataDomain();$(t).slider("option","min",i[0]);$(t).slider("option","max",i[1]);if(e.window.xMin==null){n[0]=i[0]}if(e.window.xMax==null){n[1]=i[1]}$(t).slider("option","values",n)}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider.Preview");Rickshaw.Graph.RangeSlider.Preview=Rickshaw.Class.create({initialize:function(t){if(!t.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!t.graph&&!t.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=t.element;this.graphs=t.graph?[t.graph]:t.graphs;this.defaults={height:75,width:400,gripperColor:undefined,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0};this.defaults.gripperColor=d3.rgb(this.defaults.frameColor).darker().toString();this.configureCallbacks=[];this.previews=[];t.width=t.width||this.graphs[0].width||this.defaults.width;t.height=t.height||this.graphs[0].height/5||this.defaults.height;this.configure(t);this.render()},onConfigure:function(t){this.configureCallbacks.push(t)},configure:function(t){this.config={};this.configureCallbacks.forEach(function(e){e(t)});Rickshaw.keys(this.defaults).forEach(function(e){this.config[e]=e in t?t[e]:e in this.config?this.config[e]:this.defaults[e]},this);if(t.width){this.previews.forEach(function(e){var n=t.width-this.config.frameHandleThickness*2;e.setSize({width:n})},this)}if(t.height){this.previews.forEach(function(t){var e=this.previewHeight/this.graphs.length;t.setSize({height:e})},this)}},render:function(){var t=this;this.svg=d3.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]);this.previewHeight=this.config.height-this.config.frameTopThickness*2;this.previewWidth=this.config.width-this.config.frameHandleThickness*2;this.currentFrame=[0,this.previewWidth];var e=function(e,n){var i=Rickshaw.extend({},e.config);var r=t.previewHeight/t.graphs.length;Rickshaw.extend(i,{element:this.appendChild(document.createElement("div")),height:r,width:t.previewWidth,series:e.series});var s=new Rickshaw.Graph(i);t.previews.push(s);e.onUpdate(function(){s.render();t.render()});e.onConfigure(function(t){delete t.height;s.configure(t);s.render()});s.render()};var n=d3.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs);var i="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";n.enter().append("div").classed("rickshaw_range_slider_preview_container",true).style("-webkit-transform",i).style("-moz-transform",i).style("-ms-transform",i).style("transform",i).each(e);n.exit().remove();var r=this.graphs[0];var s=d3.scale.linear().domain([0,this.previewWidth]).range(r.dataDomain());var o=[r.window.xMin,r.window.xMax];this.currentFrame[0]=o[0]===undefined?0:Math.round(s.invert(o[0]));if(this.currentFrame[0]<0)this.currentFrame[0]=0;this.currentFrame[1]=o[1]===undefined?this.previewWidth:s.invert(o[1]);if(this.currentFrame[1]-this.currentFrame[0]<t.config.minimumFrameWidth){this.currentFrame[1]=(this.currentFrame[0]||0)+t.config.minimumFrameWidth}this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",true).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","relative").style("top",-this.previewHeight+"px");this._renderDimming();this._renderFrame();this._renderGrippers();this._renderHandles();this._renderMiddle();this._registerMouseEvents()},_renderDimming:function(){var t=this.svg.selectAll("path.dimming").data([null]);t.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",true);var e="";e+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness;e+=" h "+this.previewWidth;e+=" v "+this.previewHeight;e+=" h "+-this.previewWidth;e+=" z ";e+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness;e+=" H "+Math.min(this.currentFrame[1]+this.config.frameHandleThickness*2,this.previewWidth+this.config.frameHandleThickness);e+=" v "+this.previewHeight;e+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness);e+=" z";t.attr("d",e)},_renderFrame:function(){var t=this.svg.selectAll("path.frame").data([null]);t.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",true);var e="";e+=" M "+this.currentFrame[0]+" 0";e+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness*2);e+=" V "+this.config.height;e+=" H "+this.currentFrame[0];e+=" z";e+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness;e+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness);e+=" v "+this.previewHeight;e+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness);e+=" z";t.attr("d",e)},_renderGrippers:function(){var t=this.svg.selectAll("path.gripper").data([null]);t.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",true);var e="";
726[.4,.6].forEach(function(t){e+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*t)+" "+Math.round(this.config.height*.3);e+=" V "+Math.round(this.config.height*.7);e+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+t))+" "+Math.round(this.config.height*.3);e+=" V "+Math.round(this.config.height*.7)}.bind(this));t.attr("d",e)},_renderHandles:function(){var t=this.svg.selectAll("rect.left_handle").data([null]);t.enter().append("rect").attr("width",this.config.frameHandleThickness).attr("height",this.config.height).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",true);t.attr("x",this.currentFrame[0]);var e=this.svg.selectAll("rect.right_handle").data([null]);e.enter().append("rect").attr("width",this.config.frameHandleThickness).attr("height",this.config.height).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",true);e.attr("x",this.currentFrame[1]+this.config.frameHandleThickness)},_renderMiddle:function(){var t=this.svg.selectAll("rect.middle_handle").data([null]);t.enter().append("rect").attr("height",this.config.height).style("cursor","move").style("fill-opacity","0").classed("middle_handle",true);t.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness)},_registerMouseEvents:function(){var t=d3.select(this.element);var e={target:null,start:null,stop:null,left:false,right:false,rigid:false};var n=this;function i(t,i){e.stop=n._getClientXFromEvent(d3.event,e);var r=e.stop-e.start;var s=n.frameBeforeDrag.slice(0);var o=n.config.minimumFrameWidth;if(e.rigid){o=n.frameBeforeDrag[1]-n.frameBeforeDrag[0]}if(e.left){s[0]=Math.max(s[0]+r,0)}if(e.right){s[1]=Math.min(s[1]+r,n.previewWidth)}var a=s[1]-s[0];if(a<=o){if(e.left){s[0]=s[1]-o}if(e.right){s[1]=s[0]+o}if(s[0]<=0){s[1]-=s[0];s[0]=0}if(s[1]>=n.previewWidth){s[0]-=s[1]-n.previewWidth;s[1]=n.previewWidth}}n.graphs.forEach(function(t){var e=d3.scale.linear().interpolate(d3.interpolateRound).domain([0,n.previewWidth]).range(t.dataDomain());var i=[e(s[0]),e(s[1])];if(s[0]===0){i[0]=undefined}if(s[1]===n.previewWidth){i[1]=undefined}t.window.xMin=i[0];t.window.xMax=i[1];t.update()})}function r(){e.target=d3.event.target;e.start=n._getClientXFromEvent(d3.event,e);n.frameBeforeDrag=n.currentFrame.slice();d3.event.preventDefault?d3.event.preventDefault():d3.event.returnValue=false;d3.select(document).on("mousemove.rickshaw_range_slider_preview",i);d3.select(document).on("mouseup.rickshaw_range_slider_preview",l);d3.select(document).on("touchmove.rickshaw_range_slider_preview",i);d3.select(document).on("touchend.rickshaw_range_slider_preview",l);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",l)}function s(t,n){e.left=true;r()}function o(t,n){e.right=true;r()}function a(t,n){e.left=true;e.right=true;e.rigid=true;r()}function l(t,i){d3.select(document).on("mousemove.rickshaw_range_slider_preview",null);d3.select(document).on("mouseup.rickshaw_range_slider_preview",null);d3.select(document).on("touchmove.rickshaw_range_slider_preview",null);d3.select(document).on("touchend.rickshaw_range_slider_preview",null);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",null);delete n.frameBeforeDrag;e.left=false;e.right=false;e.rigid=false}t.select("rect.left_handle").on("mousedown",s);t.select("rect.right_handle").on("mousedown",o);t.select("rect.middle_handle").on("mousedown",a);t.select("rect.left_handle").on("touchstart",s);t.select("rect.right_handle").on("touchstart",o);t.select("rect.middle_handle").on("touchstart",a)},_getClientXFromEvent:function(t,e){switch(t.type){case"touchstart":case"touchmove":var n=t.changedTouches;var i=null;for(var r=0;r<n.length;r++){if(n[r].target===e.target){i=n[r];break}}return i!==null?i.clientX:undefined;default:return t.clientX}}});Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(t){this.graph=t.graph;this.tension=t.tension||this.tension;this.configure(t)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false}},domain:function(t){var e=t||this.graph.stackedData||this.graph.stackData();var n=e[0][0];if(n===undefined){return{x:[null,null],y:[null,null]}}var i=n.x;var r=n.x;var s=n.y+n.y0;var o=n.y+n.y0;e.forEach(function(t){t.forEach(function(t){if(t.y==null)return;var e=t.y+t.y0;if(e<s)s=e;if(e>o)o=e});if(!t.length)return;if(t[0].x<i)i=t[0].x;if(t[t.length-1].x>r)r=t[t.length-1].x});i-=(r-i)*this.padding.left;r+=(r-i)*this.padding.right;s=this.graph.min==="auto"?s:this.graph.min||0;o=this.graph.max===undefined?o:this.graph.max;if(this.graph.min==="auto"||s<0){s-=(o-s)*this.padding.bottom}if(this.graph.max===undefined){o+=(o-s)*this.padding.top}return{x:[i,r],y:[s,o]}},render:function(t){t=t||{};var e=this.graph;var n=t.series||e.series;var i=t.vis||e.vis;i.selectAll("*").remove();var r=n.filter(function(t){return!t.disabled}).map(function(t){return t.stack});var s=i.selectAll("path.path").data(r).enter().append("svg:path").classed("path",true).attr("d",this.seriesPathFactory());if(this.stroke){var o=i.selectAll("path.stroke").data(r).enter().append("svg:path").classed("stroke",true).attr("d",this.seriesStrokeFactory())}var a=0;
726n.forEach(function(t){if(t.disabled)return;t.path=s[0][a];if(this.stroke)t.stroke=o[0][a];this._styleSeries(t);a++},this)},_styleSeries:function(t){var e=this.fill?t.color:"none";var n=this.stroke?t.color:"none";t.path.setAttribute("fill",e);t.path.setAttribute("stroke",n);t.path.setAttribute("stroke-width",this.strokeWidth);if(t.className){d3.select(t.path).classed(t.className,true)}if(t.className&&this.stroke){d3.select(t.stroke).classed(t.className,true)}},configure:function(t){t=t||{};Rickshaw.keys(this.defaults()).forEach(function(e){if(!t.hasOwnProperty(e)){this[e]=this[e]||this.graph[e]||this.defaults()[e];return}if(typeof this.defaults()[e]=="object"){Rickshaw.keys(this.defaults()[e]).forEach(function(n){this[e][n]=t[e][n]!==undefined?t[e][n]:this[e][n]!==undefined?this[e][n]:this.defaults()[e][n]},this)}else{this[e]=t[e]!==undefined?t[e]:this[e]!==undefined?this[e]:this.graph[e]!==undefined?this.graph[e]:this.defaults()[e]}},this)},setStrokeWidth:function(t){if(t!==undefined){this.strokeWidth=t}},setTension:function(t){if(t!==undefined){this.tension=t}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var t=this.graph;var e=d3.svg.line().x(function(e){return t.x(e.x)}).y(function(e){return t.y(e.y)}).interpolate(this.graph.interpolation).tension(this.tension);e.defined&&e.defined(function(t){return t.y!==null});return e}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var t=this.graph;var e=d3.svg.area().x(function(e){return t.x(e.x)}).y0(function(e){return t.y(e.y0)}).y1(function(e){return t.y(e.y+e.y0)}).interpolate(this.graph.interpolation).tension(this.tension);e.defined&&e.defined(function(t){return t.y!==null});return e}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var t=Rickshaw.extend($super(),{gapSize:.05,unstack:false});delete t.tension;return t},initialize:function($super,t){t=t||{};this.gapSize=t.gapSize||this.gapSize;$super(t)},domain:function($super){var t=$super();var e=this._frequentInterval(this.graph.stackedData.slice(-1).shift());t.x[1]+=Number(e.magnitude);return t},barWidth:function(t){var e=this._frequentInterval(t.stack);var n=this.graph.x(t.stack[0].x+e.magnitude*(1-this.gapSize));return n},render:function(t){t=t||{};var e=this.graph;var n=t.series||e.series;var i=t.vis||e.vis;i.selectAll("*").remove();var r=this.barWidth(n.active()[0]);var s=0;var o=n.filter(function(t){return!t.disabled}).length;var a=this.unstack?r/o:r;var l=function(t){var n=[1,0,0,t.y<0?-1:1,0,t.y<0?e.y.magnitude(Math.abs(t.y))*2:0];return"matrix("+n.join(",")+")"};n.forEach(function(t){if(t.disabled)return;var n=this.barWidth(t);var r=i.selectAll("path").data(t.stack.filter(function(t){return t.y!==null})).enter().append("svg:rect").attr("x",function(t){return e.x(t.x)+s}).attr("y",function(t){return e.y(t.y0+Math.abs(t.y))*(t.y<0?-1:1)}).attr("width",a).attr("height",function(t){return e.y.magnitude(Math.abs(t.y))}).attr("transform",l);Array.prototype.forEach.call(r[0],function(e){e.setAttribute("fill",t.color)});if(this.unstack)s+=a},this)},_frequentInterval:function(t){var e={};for(var n=0;n<t.length-1;n++){var i=t[n+1].x-t[n].x;e[i]=e[i]||0;e[i]++}var r={count:0,magnitude:1};Rickshaw.keys(e).forEach(function(t){if(r.count<e[t]){r={count:e[t],magnitude:t}}});return r}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var t=this.graph;var e=d3.svg.area().x(function(e){return t.x(e.x)}).y0(function(e){return t.y(e.y0)}).y1(function(e){return t.y(e.y+e.y0)}).interpolate(t.interpolation).tension(this.tension);e.defined&&e.defined(function(t){return t.y!==null});return e},seriesStrokeFactory:function(){var t=this.graph;var e=d3.svg.line().x(function(e){return t.x(e.x)}).y(function(e){return t.y(e.y+e.y0)}).interpolate(t.interpolation).tension(this.tension);e.defined&&e.defined(function(t){return t.y!==null});return e},render:function(t){t=t||{};var e=this.graph;var n=t.series||e.series;var i=t.vis||e.vis;i.selectAll("*").remove();var r=this.unstack?"append":"insert";var s=n.filter(function(t){return!t.disabled}).map(function(t){return t.stack});var o=i.selectAll("path").data(s).enter()[r]("svg:g","g");o.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){o.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var a=0;
726n.forEach(function(t){if(t.disabled)return;t.path=o[0][a++];this._styleSeries(t)},this)},_styleSeries:function(t){if(!t.path)return;d3.select(t.path).select(".area").attr("fill",t.color);if(this.stroke){d3.select(t.path).select(".line").attr("fill","none").attr("stroke",t.stroke||d3.interpolateRgb(t.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(t.className){t.path.setAttribute("class",t.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,t){$super(t)},render:function(t){t=t||{};var e=this.graph;var n=t.series||e.series;var i=t.vis||e.vis;var r=this.dotSize;i.selectAll("*").remove();n.forEach(function(t){if(t.disabled)return;var n=i.selectAll("path").data(t.stack.filter(function(t){return t.y!==null})).enter().append("svg:circle").attr("cx",function(t){return e.x(t.x)}).attr("cy",function(t){return e.y(t.y)}).attr("r",function(t){return"r"in t?t.r:r});if(t.className){n.classed(t.className,true)}Array.prototype.forEach.call(n[0],function(e){e.setAttribute("fill",t.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Multi");Rickshaw.Graph.Renderer.Multi=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"multi",initialize:function($super,t){$super(t)},defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},configure:function($super,t){t=t||{};this.config=t;$super(t)},domain:function($super){this.graph.stackData();var t=[];var e=this._groups();this._stack(e);e.forEach(function(e){var n=e.series.filter(function(t){return!t.disabled}).map(function(t){return t.stack});if(!n.length)return;var i=$super(n);t.push(i)});var n=d3.min(t.map(function(t){return t.x[0]}));var i=d3.max(t.map(function(t){return t.x[1]}));var r=d3.min(t.map(function(t){return t.y[0]}));var s=d3.max(t.map(function(t){return t.y[1]}));return{x:[n,i],y:[r,s]}},_groups:function(){var t=this.graph;var e={};t.series.forEach(function(n){if(n.disabled)return;if(!e[n.renderer]){var i="http://www.w3.org/2000/svg";var r=document.createElementNS(i,"g");t.vis[0][0].appendChild(r);var s=t._renderers[n.renderer];var o={};var a=[this.defaults(),s.defaults(),this.config,this.graph];a.forEach(function(t){Rickshaw.extend(o,t)});s.configure(o);e[n.renderer]={renderer:s,series:[],vis:d3.select(r)}}e[n.renderer].series.push(n)},this);var n=[];Object.keys(e).forEach(function(t){var i=e[t];n.push(i)});return n},_stack:function(t){t.forEach(function(t){var e=t.series.filter(function(t){return!t.disabled});var n=e.map(function(t){return t.stack});if(!t.renderer.unstack){var i=d3.layout.stack();var r=Rickshaw.clone(i(n));e.forEach(function(t,e){t._stack=Rickshaw.clone(r[e])})}},this);return t},render:function(){this.graph.series.forEach(function(t){if(!t.renderer){throw new Error("Each series needs a renderer for graph 'multi' renderer")}});this.graph.vis.selectAll("*").remove();var t=this._groups();t=this._stack(t);t.forEach(function(t){var e=t.series.filter(function(t){return!t.disabled});e.active=function(){return e};t.renderer.render({series:e,vis:t.vis});e.forEach(function(t){t.stack=t._stack||t.stack||t.data})})}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LinePlot");Rickshaw.Graph.Renderer.LinePlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"lineplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},initialize:function($super,t){$super(t)},seriesPathFactory:function(){var t=this.graph;var e=d3.svg.line().x(function(e){return t.x(e.x)}).y(function(e){return t.y(e.y)}).interpolate(this.graph.interpolation).tension(this.tension);e.defined&&e.defined(function(t){return t.y!==null});return e},_renderDots:function(){var t=this.graph;t.series.forEach(function(e){if(e.disabled)return;var n=t.vis.selectAll("x").data(e.stack.filter(function(t){return t.y!==null})).enter().append("svg:circle").attr("cx",function(e){return t.x(e.x)}).attr("cy",function(e){return t.y(e.y)}).attr("r",function(e){return"r"in e?e.r:t.renderer.dotSize});Array.prototype.forEach.call(n[0],function(t){if(!t)return;t.setAttribute("data-color",e.color);t.setAttribute("fill","white");t.setAttribute("stroke",e.color);t.setAttribute("stroke-width",this.strokeWidth)}.bind(this))},this)},_renderLines:function(){var t=this.graph;var e=t.vis.selectAll("path").data(this.graph.stackedData).enter().append("svg:path").attr("d",this.seriesPathFactory());var n=0;
726t.series.forEach(function(t){if(t.disabled)return;t.path=e[0][n++];this._styleSeries(t)},this)},render:function(){var t=this.graph;t.vis.selectAll("*").remove();this._renderLines();this._renderDots()}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(t){this.graph=t.graph;this.element=t.element;this.aggregationScale=1;this.build();this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var t=this;if(this.element){$(function(){$(t.element).slider({min:1,max:100,slide:function(e,n){t.setScale(n.value);t.graph.update()}})})}},setScale:function(t){if(t<1){throw"scale out of range: "+t}this.aggregationScale=t;this.graph.update()},transformer:function(t){if(this.aggregationScale==1)return t;var e=[];t.forEach(function(t){var n=[];while(t.length){var i=0,r=0;var s=t.splice(0,this.aggregationScale);s.forEach(function(t){i+=t.x/s.length;r+=t.y/s.length});n.push({x:i,y:r})}e.push(n)}.bind(this));return e}});Rickshaw.namespace("Rickshaw.Graph.Socketio");Rickshaw.Graph.Socketio=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){var t=io.connect(this.dataURL);var e=this;t.on("rickshaw",function(t){e.success(t)})}});Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(t,e,n){n=n||{};this.palette=new Rickshaw.Color.Palette(e);this.timeBase=typeof n.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):n.timeBase;var i=typeof n.timeInterval=="undefined"?1e3:n.timeInterval;this.setTimeInterval(i);if(t&&typeof t=="object"&&Array.isArray(t)){t.forEach(function(t){this.addItem(t)},this)}},addItem:function(t){if(typeof t.name==="undefined"){throw"addItem() needs a name"}t.color=t.color||this.palette.color(t.name);t.data=t.data||[];if(t.data.length===0&&this.length&&this.getIndex()>0){
727this[0].data.forEach(function(e){t.data.push({x:e.x,y:0})})}else if(t.data.length===0){t.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(t);if(this.legend){this.legend.addLine(this.itemByName(t.name))}},addData:function(t,e){var n=this.getIndex();Rickshaw.keys(t).forEach(function(t){if(!this.itemByName(t)){this.addItem({name:t})}},this);this.forEach(function(i){i.data.push({x:e||(n*this.timeInterval||1)+this.timeBase,y:t[i.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(t){for(var e=0;e<this.length;e++){if(this[e].name==t)return this[e]}},setTimeInterval:function(t){this.timeInterval=t/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var t={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(e){var n={color:e.color,name:e.name,data:[]};e.data.forEach(function(t){n.data.push({x:t.x,y:t.y})});t.items.push(n)});return t},load:function(t){if(t.timeInterval){this.timeInterval=t.timeInterval}if(t.timeBase){this.timeBase=t.timeBase}if(t.items){t.items.forEach(function(t){this.push(t);if(this.legend){this.legend.addLine(this.itemByName(t.name))}},this)}}});Rickshaw.Series.zeroFill=function(t){Rickshaw.Series.fill(t,0)};Rickshaw.Series.fill=function(t,e){var n;var i=0;var r=t.map(function(t){return t.data});while(i<Math.max.apply(null,r.map(function(t){return t.length}))){n=Math.min.apply(null,r.filter(function(t){return t[i]}).map(function(t){return t[i].x}));r.forEach(function(t){if(!t[i]||t[i].x!=n){t.splice(i,0,{x:n,y:e})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(t,e,n){n=n||{};if(typeof n.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof n.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(e);this.timeBase=typeof n.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):n.timeBase;this.setTimeInterval(n.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=n.maxDataPoints;if(t&&typeof t=="object"&&Array.isArray(t)){t.forEach(function(t){this.addItem(t)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>1;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(t){t.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,t,e){$super(t,e);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(t){t.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LineBar");Rickshaw.Graph.Renderer.LineBar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"linebar",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})}
727,initialize:function($super,t){$super(t)},domain:function(t){var e=this.graph;return{x:[e.xMin,e.xMax],y:[e.yMin,e.yMax]}},render:function(t){t=t||{};var e=this.graph;var n=t.series||e.series;var i=t.vis||e.vis;var r=this.dotSize;i.selectAll("*").remove();n.forEach(function(t){if(t.disabled)return;var n=i.selectAll("path").data(t.stack.filter(function(t){return t.y!==null})).enter().append("svg:line").attr("x1",function(t){return e.x(t.x)}).attr("x2",function(t){return e.x(t.x)}).attr("y1",function(t){return e.y(0)}).attr("y2",function(t){return e.y(t.y)}).attr("class","graphline");if(t.className){n.classed(t.className,true)}Array.prototype.forEach.call(n[0],function(e,n){e.setAttribute("fill",t.color);e.setAttribute("style","stroke: "+t.color)})},this)}});var mz_plot=function(t,e,n,i){var r=40;var s=40;var o=100;var a=250;i=typeof i!=="undefined"?i:{};var l=d3.select(t),c=$(n)[0];l.attr("class","chart_container");l.append("div").attr("class","y_axis_label").text("Relative Intensity");var u=l.append("div").attr("class","y_axis")[0][0],h=l.append("div").attr("class","chart")[0][0],f=l.append("div").attr("class","x_axis")[0][0];l.append("div").attr("class","x_axis_label").text("m/z");var d=function(){return c.offsetWidth-2*r-s};var p=function(t){var e=t[0].y;for(var n=0;n<t.length;n++){e=Math.max(e,t[n].y)}for(var n=0;n<t.length;n++){t[n].y=t[n].y/e*o}return t};var m=function(t,e){return t.x<e.x?-1:t.x>e.x?1:0};e=p(e);e.sort(m);var g=o;var _=0;if(i.mirror){_=g*-1}var v=Number.MIN_VALUE;var y=Number.MAX_VALUE;for(k=0;k<e.length;k++){y=Math.min(y,e[k].x);v=Math.max(v,e[k].x)}var b=[],x=[],w;if(e[0].structures){for(var k=0;k<e.length;k++){int_data={formula:e[k].formula,x:parseFloat(e[k].x),y:parseFloat(e[k].y),structures:e[k].structures};if(e[k].structures.length>0){b.push(int_data)}else{x.push(int_data)}}if(b.length<1){w=[{color:"#52B4FA",data:x}]}else if(x.length<1){w=[{color:"#E63434",data:b}]}else{w=[{color:"#E63434",data:b},{color:"#52B4FA",data:x}]}}else{if(window.compareCandidate){var S=p(window.compareCandidate.peak_list);for(k=0;k<S.length;k++){y=Math.min(y,S[k].x);v=Math.max(v,S[k].x)}if(i.mirror){S=S.map(function(t){return{formula:t.formula,x:t.x,y:t.y*-1,structures:t.structures,scores:t.scores}});l.append("div").attr("class","input_spectra_label").text("Input Spectra");l.append("div").attr("class","candidate_spectra_label").text("Comparison Result Spectra")}w=[{color:"#E63434",data:S,name:window.compareCandidate.compound_id},{color:"#52B4FA",data:e}]}else{w=[{color:"#52B4FA",data:e}]}}var M=d();if(i.mirror){a=a*2}var T=new Rickshaw.Graph({element:h,width:M,height:a,xmin:0,renderer:"linebar",name:"Spectra",series:w});T.xMin=i.xMin||0;T.xMax=i.xMax||v+10;T.yMin=i.yMin||(i.mirror?_-10:0);T.yMax=i.yMax||g+10;new Rickshaw.Graph.Axis.Y({graph:T,orientation:"left",tickFormat:Rickshaw.Fixtures.Number.formatKMBT,ticks:i.mirror?10:5,element:u,grid:true,height:a});new Rickshaw.Graph.Axis.X({graph:T,orientation:"bottom",element:f,grid:false});new Rickshaw.Graph.HoverDetail({graph:T,formatter:function(t,e,n,i,r,s){var o=s.value.structures;var a="";var l="";if(o){var c=o[0];var a="Fragment unknown<br>";var l="<br>Formula: unknown";if(c||c==0){a='<img class="structure" src="'+c+'" alt="Structure"><br>';l="<br>Formula: "+s.value.formula}}return'<div class="hover-box" style="width: 150px;">'+a+"m/z: "+e.toFixed(4)+"<br>intensity: "+n.toFixed(2)+l+"</div>"}});var C=function(){T.configure({width:d()});T.render()};var A=function(){T.configure({width:d()});T.series.splice(0,1);var t=p(window.compareCandidate.peak_list);if(i.mirror){t=t.map(function(t){return{formula:t.formula,x:t.x,y:t.y*-1,structures:t.structures,scores:t.scores}})}T.series.unshift({color:"#E63434",data:t,name:window.compareCandidate.compound_id});for(k=0;k<t.length;k++){y=Math.min(T.xMin,t[k].x);v=Math.max(T.xMax,t[k].x)}T.xMin=y;T.xMax=v;T.render()};var D=function(){if(i.mirror){d3.selectAll("g.y_ticks text").html(function(){return $(this).html().replace("-","")});$("g.y_ticks g[transform='translate(0,"+a/2+")'] text").html("0");$("g[data-y-value=''] line").css("stroke-dasharray","none")}};window.addEventListener("resize",C);window.addEventListener("compare",A);T.render();D();T.onUpdate(D)};function X2JS(t){var e="1.1.5";t=t||{};n();r();function n(){if(t.escapeMode===undefined){t.escapeMode=true}t.attributePrefix=t.attributePrefix||"_";t.arrayAccessForm=t.arrayAccessForm||"none";t.emptyNodeForm=t.emptyNodeForm||"text";if(t.enableToStringFunc===undefined){t.enableToStringFunc=true}t.arrayAccessFormPaths=t.arrayAccessFormPaths||[];
727if(t.skipEmptyTextNodesForObj===undefined){t.skipEmptyTextNodesForObj=true}if(t.stripWhitespaces===undefined){t.stripWhitespaces=true}t.datetimeAccessFormPaths=t.datetimeAccessFormPaths||[]}var i={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function r(){function t(t){var e=String(t);if(e.length===1){e="0"+e}return e}if(typeof String.prototype.trim!=="function"){String.prototype.trim=function(){return this.replace(/^\s+|^\n+|(\s|\n)+$/g,"")}}if(typeof Date.prototype.toISOString!=="function"){Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}}function s(t){var e=t.localName;if(e==null){e=t.baseName}if(e==null||e==""){e=t.nodeName}return e}function o(t){return t.prefix}function a(t){if(typeof t=="string"){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}else{return t}}function l(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}function c(e,n,i){switch(t.arrayAccessForm){case"property":if(!(e[n]instanceof Array)){e[n+"_asArray"]=[e[n]]}else{e[n+"_asArray"]=e[n]}break}if(!(e[n]instanceof Array)&&t.arrayAccessFormPaths.length>0){var r=0;for(;r<t.arrayAccessFormPaths.length;r++){var s=t.arrayAccessFormPaths[r];if(typeof s==="string"){if(s==i){break}}else{if(s instanceof RegExp){if(s.test(i)){break}}else{if(typeof s==="function"){if(s(e,n,i)){break}}}}}if(r!=t.arrayAccessFormPaths.length){e[n]=[e[n]]}}}function u(t){var e=t.split(/[-T:+Z]/g);var n=new Date(e[0],e[1]-1,e[2]);var i=e[5].split(".");n.setHours(e[3],e[4],i[0]);if(i.length>1){n.setMilliseconds(i[1])}if(e[6]&&e[7]){var r=e[6]*60+Number(e[7]);var s=/\d\d-\d\d:\d\d$/.test(t)?"-":"+";r=0+(s=="-"?-1*r:r);n.setMinutes(n.getMinutes()-r-n.getTimezoneOffset())}else{if(t.indexOf("Z",t.length-1)!==-1){n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()))}}return n}function h(e,n,i){if(t.datetimeAccessFormPaths.length>0){var r=i.split(".#")[0];var s=0;for(;s<t.datetimeAccessFormPaths.length;s++){var o=t.datetimeAccessFormPaths[s];if(typeof o==="string"){if(o==r){break}}else{if(o instanceof RegExp){if(o.test(r)){break}}else{if(typeof o==="function"){if(o(obj,n,r)){break}}}}}if(s!=t.datetimeAccessFormPaths.length){return u(e)}else{return e}}else{return e}}function f(e,n){if(e.nodeType==i.DOCUMENT_NODE){var r=new Object;var a=e.childNodes;for(var u=0;u<a.length;u++){var d=a.item(u);if(d.nodeType==i.ELEMENT_NODE){var p=s(d);r[p]=f(d,p)}}return r}else{if(e.nodeType==i.ELEMENT_NODE){var r=new Object;r.__cnt=0;var a=e.childNodes;for(var u=0;u<a.length;u++){var d=a.item(u);var p=s(d);if(d.nodeType!=i.COMMENT_NODE){r.__cnt++;if(r[p]==null){r[p]=f(d,n+"."+p);c(r,p,n+"."+p)}else{if(r[p]!=null){if(!(r[p]instanceof Array)){r[p]=[r[p]];c(r,p,n+"."+p)}}r[p][r[p].length]=f(d,n+"."+p)}}}for(var m=0;m<e.attributes.length;m++){var g=e.attributes.item(m);r.__cnt++;r[t.attributePrefix+g.name]=g.value}var _=o(e);if(_!=null&&_!=""){r.__cnt++;r.__prefix=_}if(r["#text"]!=null){r.__text=r["#text"];if(r.__text instanceof Array){r.__text=r.__text.join("\n")}if(t.escapeMode){r.__text=l(r.__text)}if(t.stripWhitespaces){r.__text=r.__text.trim()}delete r["#text"];if(t.arrayAccessForm=="property"){delete r["#text_asArray"]}r.__text=h(r.__text,p,n+"."+p)}if(r["#cdata-section"]!=null){r.__cdata=r["#cdata-section"];delete r["#cdata-section"];if(t.arrayAccessForm=="property"){delete r["#cdata-section_asArray"]}}if(r.__cnt==1&&r.__text!=null){r=r.__text}else{if(r.__cnt==0&&t.emptyNodeForm=="text"){r=""}else{if(r.__cnt>1&&r.__text!=null&&t.skipEmptyTextNodesForObj){if(t.stripWhitespaces&&r.__text==""||r.__text.trim()==""){delete r.__text}}}}delete r.__cnt;if(t.enableToStringFunc&&(r.__text!=null||r.__cdata!=null)){r.toString=function(){return(this.__text!=null?this.__text:"")+(this.__cdata!=null?this.__cdata:"")}}return r}else{if(e.nodeType==i.TEXT_NODE||e.nodeType==i.CDATA_SECTION_NODE){return e.no
727deValue}}}}function d(e,n,i,r){var s="<"+(e!=null&&e.__prefix!=null?e.__prefix+":":"")+n;if(i!=null){for(var o=0;o<i.length;o++){var l=i[o];var c=e[l];if(t.escapeMode){c=a(c)}s+=" "+l.substr(t.attributePrefix.length)+"='"+c+"'"}}if(!r){s+=">"}else{s+="/>"}return s}function p(t,e){return"</"+(t.__prefix!=null?t.__prefix+":":"")+e+">"}function m(t,e){return t.indexOf(e,t.length-e.length)!==-1}function g(e,n){if(t.arrayAccessForm=="property"&&m(n.toString(),"_asArray")||n.toString().indexOf(t.attributePrefix)==0||n.toString().indexOf("__")==0||e[n]instanceof Function){return true}else{return false}}function _(t){var e=0;if(t instanceof Object){for(var n in t){if(g(t,n)){continue}e++}}return e}function v(e){var n=[];if(e instanceof Object){for(var i in e){if(i.toString().indexOf("__")==-1&&i.toString().indexOf(t.attributePrefix)==0){n.push(i)}}}return n}function y(e){var n="";if(e.__cdata!=null){n+="<![CDATA["+e.__cdata+"]]>"}if(e.__text!=null){if(t.escapeMode){n+=a(e.__text)}else{n+=e.__text}}return n}function b(e){var n="";if(e instanceof Object){n+=y(e)}else{if(e!=null){if(t.escapeMode){n+=a(e)}else{n+=e}}}return n}function x(t,e,n){var i="";if(t.length==0){i+=d(t,e,n,true)}else{for(var r=0;r<t.length;r++){i+=d(t[r],e,v(t[r]),false);i+=w(t[r]);i+=p(t[r],e)}}return i}function w(t){var e="";var n=_(t);if(n>0){for(var i in t){if(g(t,i)){continue}var r=t[i];var s=v(r);if(r==null||r==undefined){e+=d(r,i,s,true)}else{if(r instanceof Object){if(r instanceof Array){e+=x(r,i,s)}else{if(r instanceof Date){e+=d(r,i,s,false);e+=r.toISOString();e+=p(r,i)}else{var o=_(r);if(o>0||r.__text!=null||r.__cdata!=null){e+=d(r,i,s,false);e+=w(r);e+=p(r,i)}else{e+=d(r,i,s,true)}}}}else{e+=d(r,i,s,false);e+=b(r);e+=p(r,i)}}}}e+=b(t);return e}this.parseXmlString=function(t){var e=window.ActiveXObject||"ActiveXObject"in window;if(t===undefined){return null}var n;if(window.DOMParser){var i=new window.DOMParser;var r=null;if(!e){try{r=i.parseFromString("INVALID","text/xml").childNodes[0].namespaceURI}catch(s){r=null}}try{n=i.parseFromString(t,"text/xml");if(r!=null&&n.getElementsByTagNameNS(r,"parsererror").length>0){n=null}}catch(s){n=null}}else{if(t.indexOf("<?")==0){t=t.substr(t.indexOf("?>")+2)}n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(t)}return n};this.asArray=function(t){if(t instanceof Array){return t}else{return[t]}};this.toXmlDateTime=function(t){if(t instanceof Date){return t.toISOString()}else{if(typeof t==="number"){return new Date(t).toISOString()}else{return null}}};this.asDateTime=function(t){if(typeof t=="string"){return u(t)}else{return t}};this.xml2json=function(t){return f(t)};this.xml_str2json=function(t){var e=this.parseXmlString(t);if(e!=null){return this.xml2json(e)}else{return null}};this.json2xml_str=function(t){return w(t)};this.json2xml=function(t){var e=this.json2xml_str(t);return this.parseXmlString(e)};this.getVersion=function(){return e}}window.JSpectraViewer={};JSpectraViewer.version="0.1";if(window.JSV===undefined)window.JSV=JSpectraViewer;if(window.d3v7===undefined)window.d3v7=d3;(function(t){t.inherits=function(t,e){t.prototype=Object.create(e.prototype)};t.initialize=function(){if(!d3v7.version.match(/^7\./g))throw"JSpectraViewer requires D3 v7";t._viewers=new t.SVSet;t.viewers=function(e){return t._viewers.get(e)}}})(JSpectraViewer);(function(t){const e=function(e,n){const i=this;this.container=d3v7.select(e);n=n||{};this.title=n.title;this.width=t.default_for(n.width,800);this.height=t.default_for(n.height,400);this.tick_count=t.default_for(n.tick_count,10);this.x_tick_count=t.default_for(n.x_tick_count,10);this.tick_length=t.default_for(n.tick_length,10);this.tick_precision=t.default_for(n.tick_precision,3);this.axis_x_tick_format=d3v7.format(t.default_for(n.axis_x_tick_format,"~g"));this.axis_y_tick_format=d3v7.format(t.default_for(n.axis_y_tick_format,"~g"));this.axis_x_title=t.default_for(n.axis_x_title,"ppm");this.axis_y_title=t.default_for(n.axis_y_title,"Intensity");this.axis_y_show=t.default_for(n.axis_y_show,false);this.axis_x_show=t.default_for(n.axis_x_show,true);this.axis_y_grid=t.default_for(n.axis_y_grid,false);this.axis_x_grid=t.default_for(n.axis_x_grid,false);this.axis_x_reverse=t.default_for(n.axis_x_reverse,true);this.axis_y_lock=t.default_for(n.axis_y_lock,false);this.min_boundaries=n.min_boundaries;this.zoom_max=t.default_for(n.zoom_max,100);this.zoombox_show=t.default_for(n.zoombox_show,true);this.zoombox_size=t.default_for(n.zoombox_size,15);this.legend_show=t.default_for(n.legend_show,true);this.simplify_tolerance=n.simplify_tolerance;this.debug=t.default_for(n.debug,false);this.debug_data={time:{},data:{},drag:{},zoom:{},zbox:{}};const r=t.viewers().map(function(t){return t.id});this.id=t.default_for(n.id,t.unique_id("jsv-",1,r));this.axis_y_gutter=this.axis_y_show?t.default_for(n.axis_y_gutter,60):0;this.axis_x_gutter=this.axis_x_show?t.default_for(n.axis_x_gutter,50):0;const s=this.title?"<h3>"+this.title+"</h3>":"";this.container.html(s).style("width",this.width+2+"px");this.sv_wrapper=this.container.append("div").attr("class","sv-wrapper").style("position","relative");this.container.append("div").attr("class","sv-key-down").style("display","none");this.canvas=this.sv_wrapper.append("canvas").attr("id",this.container.attr("id")).attr("class","spectra-viewer "+this["class"]).style("border","1p
727x solid #DDD").attr("width",this.width).attr("height",this.height).node();if(!this.canvas.getContext){this.container.html("<h3>Spectra Viewer requires Canvas, which is not supported by this browser.</h3>");throw"Canvas not supported"}t.pixel_ratio=t.get_pixel_ratio(this.canvas);t.scale_resolution(this.canvas,t.pixel_ratio);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.context=this.canvas.getContext("2d");if(!this.context.setLineDash){this.context.setLineDash=function(){}}this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale=new t.SVScale;this.scale.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary=new t.SVScale;this.boundary.x.range(this.x_range());this.boundary.y.range([this.scaled_height,0]);this.boundary.clamp(true);if(this.min_boundaries){this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries)}this._spectra=new t.SVSet;this.svg=this.sv_wrapper.append("svg").attr("width",this.width).attr("height",this.height).attr("class","svg-viewer").style("position","absolute").style("top",0).style("left",0);this.svg.style("cursor","all-scroll");this.drag_drop_load=t.default_for(n.drag_drop_load,true);this.initialize_zooming();this.initialize_dragging();i.legend=new t.SVLegend(i);d3v7.select(window).on("keydown",i.keydown).on("keyup",i.keyup);this.svg.on("mousemove",function(e){const n=d3v7.pointer(e);i.mx=i.scale.x.invert(t.pixel(n[0]));i.my=i.scale.y.invert(t.pixel(n[1]));i.highlight.hover();i.annotation.check_hover()});this.svg.on("mouseover",function(){i.contains_mouse=true;document.activeElement.blur()});this.svg.on("mouseout",function(){i.contains_mouse=false});this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger;if(this.drag_drop_load){this.initialize_drag_drop_load()}this.selection=new t.SVSelection(this,t.default_for(n.select,{}));this.annotation=new t.SVAnnotation(i);this.zoombox=new t.ZoomBox(i);this.zoombox.visible=this.zoombox_show;this.highlight=new t.SVHighlighter(this,t.default_for(n.highlight,{}));this.menu=new t.SVMenu(i);this.help=new t.SVHelp(i);this.initial_settings();this.cluster_navigation_id=n.cluster_navigation_id;if(n.structure){this.structure=new t.SVStructure(n.structure)}if(n.assignment_table){this.assignment_table=new t.SVAssignments(i,n.assignment_table)}t._viewers.push(this);this.draw()};e.prototype.toString=function(){return"SpectraViewer"};Object.defineProperties(e.prototype,{drag_drop_load:{get:function(){return this._drag_drop_load},set:function(t){this._drag_drop_load=t;if(this._drag_drop_load){this.initialize_drag_drop_load()}else{this.svg.on(".dragndrop",null)}}},cluster_navigation_id:{get:function(){return this._cluster_navigation_id},set:function(e){this._cluster_navigation_id=e;if(this._cluster_navigation_id){this._cluster_navigation=new t.SVClusterNavigator(this,e)}else{if(this._cluster_navigation){this._cluster_navigation.detach();this._cluster_navigation=undefined}}}},structure_viewer_id:{get:function(){return this._structure_viewer_id},set:function(e){this._structure_viewer_id=e;if(this._structure_viewer_id){this._structure_viewer=new t.SVStructure(this,e)}else{if(this._structure_viewer){this._structure_viewer.detach();this._structure_viewer=undefined}}}}});e.prototype.x_range=function(e){e=e||this.width;const n=t.pixel(e-this.axis_y_gutter);return this.axis_x_reverse?[n,0]:[t.pixel(this.axis_y_gutter),t.pixel(e)]};e.prototype.resize=function(e,n,i){this.width=e||this.width;this.height=n||this.height;this.container.style("width",this.width+"px");d3v7.select(this.canvas).attr("width",this.width).attr("height",this.height);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale.y.range([this.scaled_height,0]);this.boundary.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary.x.range(this.x_range());this.svg.attr("width",this.width).attr("height",this.height);t.scale_resolution(this.canvas,t.pixel_ratio);this.zoombox.update();this.legend.update();this.draw(i)};e.prototype.keyval=function(){return d3v7.select(".sv-key-down").html()};d3v7.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})};e.prototype.keydown=function(t){if(t[this.zoom_brush_key]){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","crosshair")}d3v7.selectAll(".sv-key-down").html(t.keyCode)};e.prototype.keyup=function(t){if(t.keyCode==16){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","all-scroll")}d3v7.selectAll(".sv-key-down").html("")};e.prototype.pixels_to_units_of_axis=function(e,n){const i=this;return i.scale[e].invert(t.pixel(n))-i.scale[e].invert(0)};e.prototype.set_zoom_axis=function(t,e){if(t){if(this.zoom_axis!="y"){this.zoom_axis="y";this.set_zoom_cursor(t)}}else{if(this.zoom_axis!="x"){this.zoom_axis="x";this.set_zoom_cursor(t)}}};e.prototype.set_zoom_cursor=function(t){if(t){this.svg.style("cursor","ns-resize")}else{this.svg.style("cursor","ew-resize")}};e.prototype.scale_axis=function(e,n,i){const r=Math.abs(this.boundary[e].domain()[0]-this.boundary[e].domain()[1])/n;const s=e==="x"?0:1;let o=this.scale[e].invert(this.mouse(i,this.canvas)[s]);let a=(o-this.scale[e].domain()[0])/Math.abs(this.scale[e].domain()[0]-this.scale[e].domain()[1]);if(e=="y"){a=0;o=this.scale.y.domain()[0]}const l=[o-r*a,o+r*(1-a)];this.scale[e].domain(l);this.set_domain(e,l);if(this.debug){e=e.toUpperCase();this.debug_data.zoom["d"+e]=t.round(r);this.debug_data.zoom["v"+e]=t.round(o);this.debug_data.zoom["r"+e]=t.round(a)}};e.prototype.mouse=function(e,n){return d3v7.pointer(e,n).map(function(e){return t.pixel(e)})};e.prototype.translate_axis=function(e,n){const i=this.scale[e].range().map(function(e){return e-t.pixel(n)}).map(this.scale[e].invert);this.set_domain(e,i)};e.prototype.move_to=function(t,e){const n=this;e=e||500;if(this.axis_y_lock!==false){t[1][0]=this.axis_y_lock_value(t[1])}let i=[];let r=[];i=i.concat.apply(i,t);r=r.concat.apply(r,[n.scale.x.domain(),n.scale.y.domain()]);d3v7.select(this.canvas).transition().duration(e).tween("move",function(){const t=d3v7.interpolateArray(r,i);return function(e){n.set_domain("x",[t(e)[0],t(e)[1]]);n.set_domain("y",[t(e)[2],t(e)[3]]);n.fast_draw()}}).on("end",function(){n.full_draw()});n.zoom_axis=""};e.prototype.set_domain=function(e,n){const i=this.scale;const r=this.boundary;const s=Math.abs(r[e].domain()[1]-r[e].domain()[0]);let o=Math.abs(n[1]-n[0]);if(e=="y"&&this["axis_y_lock"]!==false){n[0]=this.axis_y_lock_value(n);n[1]=n[0]+o}let a=s/o;if(a>this.zoom_max){a=this.zoom_max;const i=o;o=s/a;const r=(n[0]+n[1])/2;n[0]=r-o/2;n[1]=n[0]+o;if(this.debug){this.debug_data.zoom["center-"+e]=t.round(r);this.debug_data.zoom["domain-diff-"+e]=t.round(o)}}
727if(a<1){a=1;o=s/a;n[0]=r[e].min();n[1]=r[e].max()}if(this["zoom_"+e]!=a){this["zoom_"+e]=a;this.trigger("zoom")}if(n[0]<r[e].domain()[0]){n[0]=r[e].domain()[0];n[1]=n[0]+o}else if(n[1]>r[e].domain()[1]){n[1]=r[e].domain()[1];n[0]=n[1]-o}this.scale[e].domain(n);this.trigger("domain-change")};e.prototype.axis_y_lock_value=function(t){if(this.axis_y_lock===true){return this.boundary.y.domain()[0]}else{const e=Math.abs(t[1]-t[0]);return 0-e*this.axis_y_lock}};e.prototype.zoom_out_completely=function(){this.move_to([this.boundary.x.domain(),this.boundary.y.domain()]);this.scale.x.domain(this.boundary.x.domain());this.scale.y.domain(this.boundary.y.domain());this.zoom_x=1;this.zoom_y=1};e.prototype.add_spectrum=function(e,n,i){const r=(new Date).getTime();let s=d3v7.max(this.spectra().map(function(t){return t.xy_data.length()}));if(!s)s=4e4;this.points_per_ppm=s/(this.boundary.x.domain()[1]-this.boundary.x.domain()[0]);e.tolerance=t.default_for(e.tolerance,this.simplify_tolerance);e.number_of_points=t.default_for(e.number_of_points,s);e.min_x=t.default_for(e.min_x,this.boundary.x.domain()[0]);e.max_x=t.default_for(e.max_x,this.boundary.x.domain()[1]);const o=this.all_spectra().map(function(t){return t.name});e.id=t.default_for(e.id,t.unique_id("Spectrum_",1,o));if(e.xy_line&&typeof e.xy_line.x=="string"){const t=e.xy_line.x;if(this.spectra(t)){e.xy_line.x=this.spectra(t).xy_data.x}else{throw new Error("There is no spectrum with the id provided by '"+e.id+"' xy_line.x:"+t)}}const a=e.toString()=="Spectrum"?e:new t.Spectrum(e,n,i);a._sv=this;this._spectra.push(a);this.boundary.update(a.xy_data);this.scale.update(a.xy_data);this.zoombox.update();this.legend.update();if(this.debug){this.debug_data.time[e.id+"~add"]=t.elapsed_time(r);this.debug_data.data[e.id+"~noise"]=a.noise;this.debug_data.data[e.id+"~points-all"]=a.xy_data.length();this.debug_data.data[e.id+"~points-simple"]=a.simple_xy_data.length()}this.draw()};e.prototype.add_bayesil_data=function(e){this.add_spectrum({id:"Spectrum",xy_line:e.spectrum_xy},undefined,e.meta);this.add_spectrum(t.convert_bayesil_data(e))};e.prototype.replace_bayesil_data=function(t,e){const n=this;const i=[n.scale.x.domain(),n.scale.y.domain()];const r=n.spectra().length>0;n.remove_all_spectra();n.add_bayesil_data(t);if(r&&e){n.set_domain("x",i[0]);n.set_domain("y",i[1])}n.draw()};e.prototype.add_nmrml_data=function(e,n="experimental"){const i={x:[],y:[]};if(!["experimental","predicted","simulated"].includes(n)){console.error("Spectra source not recognized")}else{const s=this;if(!window.X2JS){console.log("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const o=e.match(/<spectrumDataArray.*compressed="(true|false)"[^]*>(.*)<\/spectrumDataArray>/);if(o){const e=o[1]=="true";const n=o[2];const r=t.convert_base64_to_float64(n,e);let a=r[1];for(let t=0;t<r.length;t+=2){i.x.push(r[t]);i.y.push(r[t+1]);a=r[t+1]>a?r[t+1]:a}const l=1/a;i.y=i.y.map(function(t){return t*l});s.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:i})}else{console.log("No Spectrum Data Array found")}const a=e.match(/<atomAssignment[^]*<\/atomAssignment>/);let l;if(a){l=a[0]}else{console.log("Could not read nmrML. No <atomAssignment> tag found.");return}const c=l.match(/<structure[^]*<\/structure>/);if(s.structure&&c){const t=l.match(/<identifier.*name="(.*?)"/);if(t){s.structure.title=t[1]}s.structure.read_nmrml(c[0])}const u=e.match(/acquisitionNucleus.*name=\"(.*?)\"/);if(s.assignment_table&&u){const t=u[1];if(t.match(/hydrogen/i)||t.match(/1H/i)){s.assignment_table.nmr_nucleus="1H"}else if(t.match(/carbon/i)||t.match(/13C/i)){s.assignment_table.nmr_nucleus="13C"}}const h=new X2JS;const f=h.xml_str2json(l);let d;try{d=f.atomAssignment.chemicalCompound.identifierList.identifier._name}catch(r){console.error("nmrML contains no compound identifier");d="Compound"}const p={name:d};const m=[];let g=f.atomAssignment.atomAssignmentList.multiplet;if(g){g=Array.isArray(g)?g:[g];let t=g.map(t=>{let e=t.peakList.peak;e=Array.isArray(e)?e:[e];return e.map(t=>parseFloat(t._amplitude))});t=t.flat();let e=i.y[0];let n=i.y[0];
727i.y.forEach(function(t){e=Math.min(t,e);n=Math.max(t,n)});let r=d3v7.scaleLinear().domain([Math.min(0,Math.min(...t)),Math.max(...t)]).range([e,n]);g.forEach(function(t,e){const n=[];let i=t.peakList.peak;i=Array.isArray(i)?i:[i];i.forEach(t=>{let e=r(parseFloat(t._amplitude));t={center:parseFloat(t._center),amplitude:e};t.width=parseFloat(t._width)||.005;n.push(t)});m.push({peaks:n,meta:{nmrml_cluster_index:e}})})}p.clusters=m;let _="Simulated";let v=false;if(n==="predicted"){v=true;_="Predicted/Simulated"}else if(n==="simulated"){v=true}s.add_spectrum({id:"Simulated",name:_,display:{color:"blue",visible:v},compounds:[p]});if(s.structure&&g){const t=s.compounds(s.compounds().length).clusters();g.forEach((e,n)=>{const i=t.find(t=>{return t.meta.nmrml_cluster_index===n});if(e.atoms&&i){let t=[];const n=e.atoms._atomRefs;if(n&&n.match(/\w/)){t=n.trim().split(/\s+/)}t.forEach((e,n)=>t[n]=e.replace(/\D/g,""));i.atom_refs=t;i._atoms.merge(s.structure.atoms(t));switch(e.multiplicity._name.toLowerCase()){case"singlet feature":i.multiplet_type="s";break;case"doublet feature":i.multiplet_type="d";break;case"triplet feature":i.multiplet_type="t";break;case"quartet feature":i.multiplet_type="q";break;case"doublet of doublets feature":i.multiplet_type="dd";break;case"doublet of doublet of doublets feature":i.multiplet_type="ddd";break;case"doublet of doublet of doublets of doublets feature":i.multiplet_type="dddd";break;case"triplet of doublets feature":i.multiplet_type="td";break;case"doublet of triplets feature":i.multiplet_type="dt";break;case"triplet of triplets feature":i.multiplet_type="tt";break;case"doublet of quartets feature":i.multiplet_type="dq";break;case"doublet of doublet of triplets feature":i.multiplet_type="ddt";break;case"doublet of triplet of doublets feature":i.multiplet_type="dtd";break;case"triplet of doublets of doublets feature":i.multiplet_type="tdd";break;case"quintet feature":i.multiplet_type="quint";break;case"multiplet feature":i.multiplet_type="m";break}if(!i.hasOwnProperty("multiplet_type")){switch(e.multiplicity._accession){case"NMR:1000194":i.multiplet_type="s";break;case"NMR:1000184":i.multiplet_type="d";break;case"NMR:1000185":i.multiplet_type="t";break;case"NMR:1000186":i.multiplet_type="q";break;case"NMR:1000192":i.multiplet_type="dd";break;case"NMR:1000195":i.multiplet_type="qunit";break;case"NMR:1000196":i.multiplet_type="dt";break;case"NMR:1000197":i.multiplet_type="td";break;case"NMR:1400305":i.multiplet_type="m";break}}}})}if(n!=="experimental"){s.remove_spectra("Experimental")}s.spectra("Simulated").labels.update_peaks();s.trigger("adjust-end")}};e.prototype.add_spin_matrix_data=function(t){const e=this;const n=JSON.parse(t);const i=n.spectrum.spectrum_xy;const r=n.fit.spectrum_xy;e.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:i});e.add_spectrum({id:"Fit",name:"Fit",display:{color:"blue",visible:true},xy_line:r})};e.prototype.add_ir_data=function(t){const e=this;const n=new X2JS;const i=n.xml_str2json(t);if(i.hasOwnProperty("ms-ir")){const t=i["ms-ir"];if(t.hasOwnProperty("x-units"))e.axis_x_title=t["x-units"];if(t.hasOwnProperty("y-units"))e.axis_y_title=t["y-units"];const n=t["ms-ir-spectrum"].split("\n");const r={x:[],y:[]};for(let t of n){t=t.split(" ");r["x"].push(parseFloat(t[0]));r["y"].push(parseFloat(t[1]))}e.add_spectrum({id:"Experimental",name:"Experimental",display:{color:"black",visible:true},xy_line:r});e.full_draw()}else{console.error("Could not find IR data")}};e.prototype.remove_spectra=function(e){this._spectra=new t.SVSet(this._spectra.filter(function(t){return t.id!=e}));this.zoombox.remove_spectra(e);this.legend.update()};e.prototype.remove_all_spectra=function(){const t=this;t.selection.clear();this.all_spectra().forEach(function(e){t.remove_spectra(e.id)});t.reset_boundaries()};e.prototype.reset_boundaries=function(){const t=this;t.selection.clear()
728;t.boundary.initialized=false;t.scale.initialized=false;if(t.min_boundaries){t.boundary.update(t.min_boundaries);t.scale.update(t.min_boundaries)}else{t.boundary.update({x:[0,1],y:[0,1]});t.scale.update({x:[0,1],y:[0,1]})}};e.prototype.spectra=function(e){if(e)return this._spectra.get(e);const n=new t.SVSet(this._spectra.filter(function(t){return t.active}));return n.get(e)};e.prototype.all_spectra=function(t){return this._spectra.get(t)};e.prototype.compounds=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].compounds())}return n.get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;
728i++){n.merge(this._spectra[i].clusters())}return n.get(e)};e.prototype.peaks=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].peaks())}return n.get(e)};e.prototype.clear=function(){this.context.clearRect(0,0,t.pixel(this.width),t.pixel(this.height))};e.prototype.draw=function(e,n,i){const r=(new Date).getTime();const s=this;e=e||false;const o=this.context;const a=this.scale;this.clear();if(this.axis_y_grid)this.draw_grid_lines("y");if(this.axis_x_grid)this.draw_grid_lines("x");this.spectra().forEach(function(t){t.compounds().draw(o,a,e,n,i);t.clusters().draw(o,a,e,n,i);t.peaks().draw(o,a,e,true,i);t.draw(o,a,e,n,i)});this.selection.draw(o,a,e,n,i);this.zoombox.set_zoom_area(this.scale);this.annotation.draw();if(this.legend_show)this.legend.draw();this.draw_axes();this.selection.draw_bounds(o,a);this.selection.draw_indicators(o,a);if(this.debug){this.debug_data.time["draw"]=t.elapsed_time(r);this.draw_debug(this.legend.bottom())}};e.prototype.full_draw=function(){const t=this.scale.x.domain()[1]-this.scale.x.domain()[0];const e=this.points_per_ppm*t;const n=Math.abs(this.scale.x.range()[1]-this.scale.x.range()[0]);n/e>3?this.draw(false,true,1):this.draw(false,false)};e.prototype.calc_draw=function(){this.draw(false,true,1)};e.prototype.fast_calc_draw=function(){this.draw(false,true,2)};e.prototype.fast_draw=function(){this.zoom_x<10?this.draw(true):this.draw()};e.prototype.flash=function(e){this.context.font=this.adjust_font(1.5);this.context.textAlign="center";this.context.textBaseline="center";const n=t.pixel(this.width)/2;const i=t.pixel(this.height)/2;this.context.fillText(e,n,i)};e.prototype.draw_debug=function(e){if(!this.debug)return;const n=this.context;const i=this.debug_data;n.font=this.adjust_font(1,"monospace");n.fillStyle="black";const r=t.pixel(18);e=e||0;let s;if(this.axis_x_reverse){s=t.pixel(10);n.textAlign="left"}else{s=t.pixel(this.width-10);n.textAlign="right"}const o=this.debug===true?Object.keys(i):this.debug;let a=0;o.forEach(function(t){const o=Object.keys(i[t]);o.forEach(function(o){n.fillText(t+"|"+o+": "+i[t][o],s,e+r*a);a+=1})})};e.prototype.adjust_font=function(e,n,i){e=e||1;n=n||"Sans-Serif";i=i||"";let r=9/1400*e;let s=r*t.pixel(this.width)+t.pixel(5);return i+" "+s+"pt "+n};e.prototype.get_font_size=function(e){let n=9/1400*e;return n*t.pixel(this.width)+t.pixel(5)};e.prototype.draw_axes=function(){const e=this.scale;this.context.strokeStyle="black";this.context.lineWidth=1;this.context.setLineDash([1,0]);const n=t.pixel(this.axis_y_gutter);const i=t.pixel(this.axis_x_gutter);this.context.clearRect(e.x.range_min(),e.y.range_max(),e.x.range_max()+n,i);const r=this.axis_x_reverse?e.x.range_max():0;this.context.clearRect(r,e.y.range_min(),n,e.y.range_max()+i);this.context.fillStyle="black";if(this.axis_y_show)this.draw_y_axis();if(this.axis_x_show)this.draw_x_axis()};e.prototype.draw_x_axis=function(){const e=this;const n=t.pixel(this.tick_length);const i=this.context;const r=this.scale;i.beginPath();i.moveTo(r.x.range()[1],r.y.range()[0]);i.lineTo(r.x.range()[0],r.y.range()[0]);i.stroke();i.textAlign="center";i.textBaseline="top";i.font=this.font;r.x.ticks(this.x_tick_count).forEach(function(t){i.beginPath();i.moveTo(r.x(t),r.y.range()[0]);i.lineTo(r.x(t),r.y.range()[0]+n);i.stroke();const s=parseFloat(t.toFixed(e.tick_precision));i.fillText(s,r.x(t),r.y.range()[0]+n)});if(this.axis_x_title){i.font=this.axis_title_font;const t=r.x.range_diff()/2;const e=r.y.range()[0]+3*n;i.fillText(this.axis_x_title,t,e)}};e.prototype.draw_y_axis=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=this.axis_x_reverse?1:-1;const o=s*t.pixel(this.tick_length);const a=i.x.range()[0]+s*t.pixel(this.tick_length+r);n.beginPath();n.moveTo(i.x.range()[0],i.y.range()[1]);n.lineTo(i.x.range()[0],i.y.range()[0]);n.stroke();n.textAlign=this.axis_x_reverse?"left":"right";n.textBaseline="middle";n.font=this.font;let l=0;i.y.ticks(this.tick_count).forEach(function(t){n.beginPath();n.moveTo(i.x.range()[0],i.y(t));n.lineTo(i.x.range()[0]+o,i.y(t));n.stroke();n.fillText(e.axis_y_tick_format(t),a,i.y(t));if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>l)l=e}});if(this.axis_y_title){const e=t.pixel(4);const a=t.pixel(this.axis_y_gutter);const c=/(\d+\.?\d*)pt/.exec(this.axis_title_font)[1];const u=l+Math.abs(o)+Number(c)+e+r;if(u<a){n.save();n.textAlign="center";n.textBaseline="middle";n.font=this.axis_title_font;const t=i.x.range()[0]+(a-e-Number(c)/2)*s;const r=i.y.range()[0]/2;n.translate(t,r);n.rotate(s*Math.PI/2);n.translate(-t,-r);n.fillText(this.axis_y_title,t,r);
728n.restore()}}};e.prototype.draw_grid_lines=function(e){const n=this;const i=this.context;const r=i;const s=this.scale;s[e].ticks(this.tick_count).forEach(function(n){i.beginPath();if(e=="y"){i.moveTo(s.x.range()[0],s.y(n));i.lineTo(s.x.range()[1],s.y(n))}else if(e=="x"){i.moveTo(s.x(n),s.y.range()[0]);i.lineTo(s.x(n),s.y.range()[1])}i.strokeStyle="rgb(210,210,210)";i.lineWidth=t.pixel(.5);i.stroke()});this.context=r};e.prototype.draw_y_axis2=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=d3v7.min(i.x.range());const o=d3v7.max(i.x.range());const a=d3v7.min(i.y.range());const l=d3v7.max(i.y.range());let c,u,h;if(this.axis_y_left){c=s;u=c-t.pixel(this.tick_length+r);n.textAlign="right";h=-t.pixel(this.tick_length)}else{c=o;u=c+t.pixel(this.tick_length+r);n.textAlign="left";h=t.pixel(this.tick_length)}n.beginPath();n.moveTo(c,a);n.lineTo(c,l);n.stroke();n.textBaseline="middle";n.font=this.font;let f=0;i.y.ticks(this.tick_count).forEach(function(t){n.beginPath();n.moveTo(c,i.y(t));n.lineTo(c+h,i.y(t));n.stroke();n.fillText(t,u,i.y(t));if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>f)f=e}});if(this.axis_y_title){const e=t.pixel(4);const r=t.pixel(this.axis_y_gutter);const s=/(\d+)pt/.exec(this.axis_title_font)[1];const o=f+h+Number(s)+e;if(o<r){n.save();n.textAlign="center";n.textBaseline="hanging";n.font=this.axis_title_font;n.rotate(Math.PI/2);const t=-i.x.range()[0]-r+e;const s=i.y.range()[0]/2;n.fillText(this.axis_y_title,s,t);n.restore()}}};e.prototype.get_peak_domains=function(e,n){const i=.1;let r=e[0];let s=e[0];let o,a;for(let t=1;t<e.length;t++){const n=e[t];if(n.center<r.center)r=n;if(n.center>s.center)s=n}const l=t.xy_from_peaks(e,1e3,r.center,s.center);let c=d3v7.max(l.y);if(n){o=r.center-r.width/2;a=s.center+s.width/2}else{o=r.center-r.width;a=s.center+s.width;const t=(a-o)*i;o-=t;a+=t;c+=c*i}return[[o,a],[0,c]]};e.prototype.move_to_compound=function(t,e,n){const i=this.spectra(t);const r=i&&i.compounds(e);this.move_to_peaks(r.peaks(),n)};e.prototype.move_to_peaks=function(t,e,n){n=n||1;const i=this.get_peak_domains(t);i[1][1]=i[1][1]*n;const r=Math.abs(i[0][1]-i[0][0]);i[0][0]=i[0][0]-(r-r/n);i[0][1]=i[0][1]+(r-r/n);this.move_to(i,e)};e.prototype.set_domain_to_brush_extent=function(t,e){const n=this.domains_from_brush_extent(t,e);this.set_domain("x",n[0]);this.set_domain("y",n[1])};e.prototype.domains_from_brush_extent=function(t,e){const n=[t[0][0],t[1][0]];const i=[t[0][1],t[1][1]];return[n,i]};e.prototype.elements=function(e,n,i,r){const s=this;let o=i;if(!i){n=t.default_for(n,s);if(typeof n=="string"){n=s.spectra(n)}if(!n){o=new t.SVSet}else if(e=="peak"){o=n.peaks()}
728else if(e=="cluster"){o=n.clusters()}else if(e=="compound"){o=n.compounds()}else if(e=="spectrum"){o=n.spectra()}else{o=new t.SVSet}}if(r){o=new t.SVSet(o.filter(function(t){return t.visible}))}return o};e.prototype.find_element_mouse_over=function(e,n,i,r){const s=this;let o;elements=s.elements(e,n,i,r);elements.forEach(function(e){e.y_for_mouse_x=t.sum_of_peaks(s.mx,e.peaks())});elements.order_by("y_for_mouse_x");for(let t=0;t<elements.length;t++){if(s.my<=elements[t].y_for_mouse_x&&s.my>=0){o=elements[t];break}}return o};e.prototype.max_y_in_range=function(t,e){};e.prototype.image=function(e,n){e=e||this.width;n=n||this.height;const i=this.context;const r=this.zoombox.visible;const s=d3v7.select("body").append("canvas").attr("width",e).attr("height",n).node();t.scale_resolution(s,t.pixel_ratio);this.context=s.getContext("2d");const o=t.pixel(n-this.axis_x_gutter);this.scale.x.range(this.x_range(e));this.scale.y.range([o,0]);this.zoombox.visible=false;this.full_draw();image=s.toDataURL();this.scale.x.range(this.x_range());this.scale.y.range([this.scaled_height,0]);this.context=i;this.zoombox.visible=r;d3v7.select(s).remove();return image};e.prototype.initial_settings=function(){const e=this;this.settings=new t.SVSettings(this,{title:"JSV Settings",width:"250",height:"210",settings:[{label:"Grid lines [y-axis]",property:"axis_y_grid",type:"boolean"},{label:"Grid lines [x-axis]",property:"axis_x_grid",type:"boolean"},{label:"Show Zoombox",property:function(t){if(arguments.length==0)return e.zoombox.visible;e.zoombox.visible=t},type:"boolean"},{label:"Show Legend",property:"legend_show",type:"boolean"}]})};t.SpectraViewer=e})(JSpectraViewer);(function(t){const e=function(e,n){let i=this;this.container=d3v7.select(e);n=n||{};this.title=n.title;this.width=t.default_for(n.width,800);this.height=t.default_for(n.height,400);this.tick_count=t.default_for(n.tick_count,10);this.x_tick_count=t.default_for(n.x_tick_count,10);this.tick_length=t.default_for(n.tick_length,10);this.tick_precision=t.default_for(n.tick_precision,3);this.axis_x_tick_format=d3v7.format(t.default_for(n.axis_x_tick_format,"~g"));this.axis_y_tick_format=d3v7.format(t.default_for(n.axis_y_tick_format,"~g"));this.axis_x_title=t.default_for(n.axis_x_title,"ppm");this.axis_y_title=t.default_for(n.axis_y_title,"ppm");this.axis_y_show=t.default_for(n.axis_y_show,"ppm");this.axis_x_show=t.default_for(n.axis_x_show,true);this.axis_y_grid=t.default_for(n.axis_y_grid,false);this.axis_x_grid=t.default_for(n.axis_x_grid,false);this.axis_y_reverse=t.default_for(n.axis_y_reverse,false);this.axis_x_reverse=t.default_for(n.axis_x_reverse,true);this.axis_y_lock=t.default_for(n.axis_y_lock,false);this.min_boundaries=n.min_boundaries;this.zoom_max=t.default_for(n.zoom_max,25);this.zoom_min=t.default_for(n.zoom_min,.25);this.simplify_tolerance=n.simplify_tolerance;this.debug=t.default_for(n.debug,false);this.debug_data={time:{},data:{},drag:{},zoom:{},zbox:{}};const r=t.viewers().map(function(t){return t.id});this.id=t.default_for(n.id,t.unique_id("jsv-",1,r));this.axis_y_gutter=this.axis_y_show?t.default_for(n.axis_y_gutter,.14*this.width):0;this.axis_x_gutter=this.axis_x_show?t.default_for(n.axis_x_gutter,150):0;this.threshold=1;const s=this.title?"<h3>"+this.title+"</h3>":"";this.container.html(s).style("width",this.width+2+"px");this.sv_wrapper=this.container.append("div").attr("class","sv-wrapper").style("position","relative");this.container.append("div").attr("class","sv-key-down").style("display","none");this.canvas=this.sv_wrapper.append("canvas").attr("id",this.container.attr("id")).attr("class","spectra-viewer "+this["class"]).style("border","1px solid #DDD").attr("width",this.width).attr("height",this.height).node();if(!this.canvas.getContext){this.container.html("<h3>Spectra Viewer requires Canvas, which is not supported by this browser.</h3>");throw"Canvas not supported"}t.pixel_ratio=t.get_pixel_ratio(this.canvas);t.scale_resolution(this.canvas,t.pixel_ratio);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.context=this.canvas.getContext("2d");if(!this.context.setLineDash){this.context.setLineDash=function(){}}this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale=new t.SVScale;this.scale.y.range([0,this.scaled_height]);this.scale.x.range(this.x_range());this.boundary=new t.SVScale;this.boundary.x.range(this.x_range());this.boundary.y.range([this.scaled_height,0]);this.boundary.clamp(true);if(this.min_boundaries){this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries)}this._spectra=new t.SVSet;this.shift_plot();this.svg=this.sv_wrapper.append("svg").attr("width",this.width).attr("height",this.height).attr("class","svg-viewer").style("position","absolute").style("top",0).style("left",0);this.svg.style("cursor","crosshair");this.svg.append("text").attr("id","crosshairs_label").attr("x","0.35em").attr("y","1em");this.svg.append("line").attr("id","crosshair_x").style("stroke","blue").style("stroke-width",1);this.svg.append("line").attr("id","crosshair_y").style("stroke","blue").style("stroke-width",1);this.svg.on("mousemove",function(e){const n=d3v7.pointer(e,this);i.mx=i.scale.x.invert(t.pixel(n[0]));i.my=i.scale.y.invert(t.pixel(n[1]));i.annotation.check_hover();d3v7.select("#crosshair_x").attr("x1",0).attr("y1",n[1]).attr("x2",i.width).attr("y2",n[1]);d3v7.select("#crosshair_y").attr("x1",n[0]).attr("y1",0).attr("x2",n[0]).attr("y2",i.height);if(i.debug)d3v7.select("#crosshairs_label").text("x: "+i.mx+" y: "+i.my)});this.zoom_rect={r:null,origin:null,translated_origin:null};i.svg.call(d3v7.drag().on("start",this.drag_zoom().start).on("drag",this.drag_zoom().drag).on("end",this.drag_zoom().end));this.initialize_zooming();d3v7.select(window).on("keydown",i.keydown).on("keyup",i.keyup);this.svg.on("mouseover",function(){i.contains_mouse=true;document.activeElement.blur()});this.svg.on("mouseout",function(){i.contains_mouse=false});this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger;this.selection=new t.SVSelection(this,t.default_for(n.select,{}));this.annotation=new t.SVAnnotation(i);this.menu=new t.SVMenu(i);this.help=new t.SVHelp(i);this.cluster_navigation_id=n.cluster_navigation_id;if(n.structure){this.structure=new t.SVStructure(n.structure)}if(n.assignment_table){this.assignment_table=new t.SVAssignments2D(i,n.assignment_table)}t._viewers.push(this);this.draw()};e.prototype.toString=function(){return"SpectraViewer2D"};Object.defineProperties(e.prototype,{cluster_navigation_id:{get:function(){return this._cluster_navigation_id},set:function(e){this._cluster_navigation_id=e;if(this._cluster_navigation_id){this._cluster_navigation=new t.SVClusterNavigator(this,e)}else{if(this._cluster_navigation){this._cluster_navigation.detach();this._cluster_navigation=undefined}}}},structure_viewer_id:{get:function(){return this._structure_viewer_id},set:function(e){this._structure_viewer_id=e;if(this._structure_viewer_id){this._structure_viewer=new t.SVStructure(this,e)}else{if(this._structure_viewer){this._structure_viewer.detach();this._structure_viewer=undefined}}}}});e.prototype.x_range=function(e){e=e||this.width;const n=t.pixel(e-this.axis_y_gutter);return this.axis_x_reverse?[n,0]:[t.pixel(this.axis_y_gutter),t.pixel(e)]};e.prototype.resize=function(e,n,i){this.shift_plot(true);this.width=e||this.width;this.height=n||this.height;this.container.style("width",this.width+"px");d3v7.select(this.canvas).attr("width",this.width).attr("height",this.height);this.font=this.adjust_font();this.axis_title_font=this.adjust_font(1,undefined,"bold");this.scaled_height=t.pixel(this.height-this.axis_x_gutter);this.scaled_width=t.pixel(this.width-this.axis_y_gutter);this.scale.y.range([0,this.scaled_height]);this.boundary.y.range([this.scaled_height,0]);this.scale.x.range(this.x_range());this.boundary.x.range(this.x_range());this.svg.attr("width",this.width).attr("height",this.height);t.scale_resolution(this.canvas,t.pixel_ratio);this.shift_plot();this.draw()};e.prototype.keyval=function(){return d3v7.select(".sv-key-down").html()};d3v7.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})};e.prototype.keydown=function(t){if(t[this.zoom_brush_key]){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","crosshair")}d3v7.selectAll(".sv-key-down").html(t.keyCode)};e.prototype.keyup=function(t){if(t.keyCode==16){d3v7.selectAll(".sv-wrapper .svg-viewer").style("cursor","all-scroll")}d3v7.selectAll(".sv-key-down").html("")};e.prototype.pixels_to_units_of_axis=function(e,n){const i=this;return i.scale[e].invert(t.pixel(n))-i.scale[e].invert(0)};e.prototype.set_zoom_axis=function(t){if(t){if(this.zoom_axis!="y"){this.zoom_axis="y";this.zoom_behavior.scale(this.zoom_y);this.set_zoom_cursor(t)}}else{if(this.zoom_axis!="x"){this.zoom_axis="x";this.zoom_behavior.scale(this.zoom_x);this.set_zoom_cursor(t)}}};e.prototype.set_zoom_cursor=function(t){if(t){this.svg.style("cursor","ns-resize")}else{this.svg.style("cursor","ew-resize")}};e.prototype.scale_axis=function(e,n){const i=Math.abs(this.boundary[e].domain()[0]-this.boundary[e].domain()[1])/n;const r=e==="x"?0:1;let s=this.scale[e].invert(this.mouse(this.canvas)[r]);let o=(s-this.scale[e].domain()[0])/Math.abs(this.scale[e].domain()[0]-this.scale[e].domain()[1]);if(e=="y"){o=0;s=this.scale.y.domain()[0]}const a=[s-i*o,s+i*(1-o)];this.scale[e].domain(a);this.set_domain(e,a);if(this.debug){e=e.toUpperCase();this.debug_data.zoom["d"+e]=t.round(i);this.debug_data.zoom["v"+e]=t.round(s);this.debug_data.zoom["r"+e]=t.round(o)}};e.prototype.mouse=function(e){return d3v7.mouse(e).map(function(e){return t.pixel(e)})};e.prototype.translate_axis=function(e,n){const i=this.scale[e].range().map(function(e){return e-t.pixel(n)}).map(this.scale[e].invert);this.set_domain(e,i)};e.prototype.shift_plot=function(t=false){if(t){this.context.translate(-this.x_range()[0]*.08,-this.scaled_height*.12)}
728else{this.context.translate(this.x_range()[0]*.08,this.scaled_height*.12)}};e.prototype.absolute_to_translated_context=function(t,e){let n=this.x_range()[0]*.08;let i=this.scaled_height*.12;let r=this.scale.x.range()[1];let s=this.scale.x.range()[0];let o=this.scale.y.range()[0];let a=this.scale.y.range()[1];t=t-n;e=e-i;t=Math.max(r,Math.min(s,t));e=Math.max(o,Math.min(a,e));return[this.scale.x.invert(t),this.scale.y.invert(e)]};e.prototype.move_to=function(t,e){const n=this;e=e||500;if(this.axis_y_lock!==false){t[1][0]=this.axis_y_lock_value(t[1])}let i=[];let r=[];i=i.concat.apply(i,t);r=r.concat.apply(r,[n.scale.x.domain(),n.scale.y.domain()]);d3v7.select(this.canvas).transition().duration(e).tween("move",function(){const t=d3v7.interpolateArray(r,i);return function(e){n.set_domain("x",[t(e)[0],t(e)[1]]);n.set_domain("y",[t(e)[2],t(e)[3]]);n.fast_draw()}}).on("end",function(){n.full_draw()});n.zoom_axis=""};e.prototype.set_domain=function(e,n){const i=this.scale;const r=this.boundary;const s=Math.abs(r[e].domain()[1]-r[e].domain()[0]);let o=Math.abs(n[1]-n[0]);if(e=="y"&&this["axis_y_lock"]!==false){n[0]=this.axis_y_lock_value(n);n[1]=n[0]+o}let a=s/o;if(a>this.zoom_max){a=this.zoom_max;const i=o;o=s/a;const r=(n[0]+n[1])/2;n[0]=r-o/2;n[1]=n[0]+o;if(this.debug){this.debug_data.zoom["center-"+e]=t.round(r);this.debug_data.zoom["domain-diff-"+e]=t.round(o)}}if(a<1){a=1;o=s/a;n[0]=r[e].min();n[1]=r[e].max()}if(this["zoom_"+e]!=a){this["zoom_"+e]=a;this.trigger("zoom")}if(n[0]<r[e].domain()[0]){n[0]=r[e].domain()[0];n[1]=n[0]+o}else if(n[1]>r[e].domain()[1]){n[1]=r[e].domain()[1];n[0]=n[1]-o}this.scale[e].domain(n);this.trigger("domain-change")};e.prototype.axis_y_lock_value=function(t){if(this.axis_y_lock===true){return this.boundary.y.domain()[0]}else{const e=Math.abs(t[1]-t[0]);return 0-e*this.axis_y_lock}};e.prototype.zoom_out_completely=function(){this.move_to([this.boundary.x.domain(),this.boundary.y.domain()]);this.scale.x.domain(this.boundary.x.domain());this.scale.y.domain(this.boundary.y.domain());this.zoom_x=1;this.zoom_y=1};e.prototype.add_spectrum_2d=function(e,n,i){let r=e.json_data.y.map(t=>e.json_data.y[0]-t);let s=Math.floor(Math.min(...e.json_data.x));let o=Math.ceil(Math.max(...e.json_data.x));let a=Math.floor(Math.min(...r));let l=Math.ceil(Math.max(...r));this.min_boundaries={x:[s,o],y:[a,l]};this.boundary.update(this.min_boundaries);this.scale.update(this.min_boundaries);e.min_x=t.default_for(e.min_x,this.boundary.x.domain()[0]);e.max_x=t.default_for(e.max_x,this.boundary.x.domain()[1]);const c=this.all_spectra().map(function(t){return t.name});e.id=t.default_for(e.id,t.unique_id("Spectrum2D_",1,c));const u=e.toString()=="Spectrum2D"?e:new t.Spectrum2D(e,n,i);u._sv=this;this._spectra.push(u);this.boundary.update(u.xyz_data);this.scale.update(u.xyz_data);this.draw()};e.prototype.add_nmrml_data=function(e){let n=this;if(!window.X2JS){console.error("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const i={x:/<spectrumDataArray2dDirectDimensionF2.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dDirectDimensionF2>/,y:/<spectrumDataArray2dIndirectDimensionF1.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dIndirectDimensionF1>/,z:/<spectrumDataArray2dIntensities.*compressed="(true|false)"[^]*>([^]+)<\/spectrumDataArray2dIntensities>/};let r={};Object.entries(i).forEach(function([n,i]){const s=e.match(i);if(s){let e=s[1]==="true";let i=s[2];r[n]=Array.from(t.convert_base64_to_float64(i,e))}else{console.error(`${n} data array not found`)}});if(Object.keys(i).every(t=>t in r)){n.add_spectrum_2d({json_data:r});const t=e.match(/<atomAssignment[^]*<\/atomAssignment>/);let i;if(t){i=t[0]}else{console.log("Could not read nmrML. No <atomAssignment> tag found.");return}const s=i.match(/<structure[^]*<\/structure>/);if(n.structure&&s){const t=i.match(/<identifier.*name="(.*?)"/);if(t){n.structure.title=t[1]}n.structure.read_nmrml(s[0])}const o=new X2JS;const a=o.xml_str2json(i);const l={name:a.atomAssignment.chemicalCompound.identifierList.identifier._name};const c=[];let u=a.atomAssignment.atomAssignmentList.multiplet;if(u){u=Array.isArray(u)?u:[u];u.forEach(function(t,e){const n=[t._dir_dim_center,t._indir_dim_center];c.push({peaks:n,meta:{nmrml_cluster_index:e}})});l.clusters=c;if(n.structure&&u){const t=n.compounds(n.compounds().length).cluster
728s();u.forEach((e,i)=>{const r=t.find(t=>{return t.meta.nmrml_cluster_index===i});if(e.atoms&&r){let t=[];let i=[];const s=e.atoms._dir_dim_atomRefs;const o=e.atoms._indir_dim_atomRefs;if(s&&s.match(/\w/)&&o&&o.match(/\w/)){t=s.trim().split(/\s+/);i=o.trim().split(/\s+/)}t.forEach((e,n)=>{t[n]=e.replace(/\D/g,"")});i.forEach((t,e)=>{i[e]=t.replace(/\D/g,"")});r.dir_dim_atom_refs=t;r.indir_dim_atom_refs=o;const a=t.concat(i.filter(e=>t.indexOf(e)<0));r._atoms.merge(n.structure.atoms(a));switch(e.multiplicity._name.toLowerCase()){case"singlet feature":r.multiplet_type="s";break;case"doublet feature":r.multiplet_type="d";break;case"triplet feature":r.multiplet_type="t";break;case"quartet feature":r.multiplet_type="q";break;case"doublet of doublets feature":r.multiplet_type="dd";break;case"doublet of doublet of doublets feature":r.multiplet_type="ddd";break;case"doublet of doublet of doublets of doublets feature":r.multiplet_type="dddd";break;case"triplet of doublets feature":r.multiplet_type="td";break;case"doublet of triplets feature":r.multiplet_type="dt";break;case"triplet of triplets feature":r.multiplet_type="tt";break;case"doublet of quartets feature":r.multiplet_type="dq";break;case"doublet of doublet of triplets feature":r.multiplet_type="ddt";break;case"doublet of triplet of doublets feature":r.multiplet_type="dtd";break;case"triplet of doublets of doublets feature":r.multiplet_type="tdd";break;case"quintet feature":r.multiplet_type="quint";break;case"multiplet feature":r.multiplet_type="m";break}if(!r.hasOwnProperty("multiplet_type")){switch(e.multiplicity._accession){case"NMR:1000194":r.multiplet_type="s";break;case"NMR:1000184":r.multiplet_type="d";break;case"NMR:1000185":r.multiplet_type="t";break;case"NMR:1000186":r.multiplet_type="q";break;case"NMR:1000192":r.multiplet_type="dd";break;case"NMR:1000195":r.multiplet_type="qunit";break;case"NMR:1000196":r.multiplet_type="dt";break;case"NMR:1000197":r.multiplet_type="td";break;case"NMR:1400305":r.multiplet_type="m";break}}}})}}n.trigger("adjust-end")}else{console.error("Could not read in Spectrum Data")}};e.prototype.remove_spectra=function(e){this._spectra=new t.SVSet(this._spectra.filter(function(t){return t.id!=e}))};e.prototype.remove_all_spectra=function(){const t=this;t.selection.clear();this.all_spectra().forEach(function(e){t.remove_spectra(e.id)});t.reset_boundaries()};e.prototype.reset_boundaries=function(){const t=this;t.selection.clear();t.boundary.initialized=false;t.scale.initialized=false;if(t.min_boundaries){t.boundary.update(t.min_boundaries);t.scale.update(t.min_boundaries)}else{t.boundary.update({x:[0,1],y:[0,1]});t.scale.update({x:[0,1],y:[0,1]})}};e.prototype.spectra=function(e){if(e)return this._spectra.get(e);const n=new t.SVSet(this._spectra.filter(function(t){return t.active}));return n.get(e)};e.prototype.all_spectra=function(t){return this._spectra.get(t)};e.prototype.compounds=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].compounds())}return n.get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._spectra.length;for(;i<r;i++){n.merge(this._spectra[i].clusters())}return n.get(e)};e.prototype.clear=function(e=false){if(e){this.context.clearRect(0,-1,t.pixel(this.width),t.pixel(this.height)+1);this.context.clearRect(-this.x_range()[0]*.08,t.pixel(this.height)-t.pixel(this.axis_x_gutter),t.pixel(this.width),t.pixel(this.height))}else{this.shift_plot(true);this.context.clearRect(0,0,t.pixel(this.width),t.pixel(this.height));this.shift_plot()}};e.prototype.draw=function(e,n,i){const r=(new Date).getTime();const s=this;e=e||false;const o=this.context;const a=this.scale;this.clear(e);if(this.axis_y_grid)this.draw_grid_lines("y");if(this.axis_x_grid)this.draw_grid_lines("x");this.spectra().forEach(function(t){t.draw(o,a,e,s.scaled_height,s.x_range(),s.threshold)});this.draw_axes();if(this.debug){this.debug_data.time["draw"]=t.elapsed_time(r)}};e.prototype.full_draw=function(){const t=this.scale.x.domain()[1]-this.scale.x.domain()[0];const e=this.points_per_ppm*t;const n=Math.abs(this.scale.x.range()[1]-this.scale.x.range()[0]);n/e>3?this.draw(false,true,1):this.draw(false,false)};e.prototype.calc_draw=function(){this.draw(false,true,1)};e.prototype.fast_calc_draw=function(){this.draw(false,true,2)};e.prototype.fast_draw=function(){this.draw(true)};e.prototype.flash=function(e){this.context.font=this.adjust_font(1.5);this.context.textAlign="center";this.context.textBaseline="center";const n=t.pixel(this.width)/2;const i=t.pixel(this.height)/2;this.context.fillText(e,n,i)};e.prototype.draw_debug=function(e){if(!this.debug)return;const n=this.context;const i=this.debug_data;n.font=this.adjust_font(1,"monospace");n.fillStyle="black";const r=t.pixel(18);e=e||0;let s;if(this.axis_x_reverse){s=t.pixel(10);n.textAlign="left"}else{s=t.pixel(this.width-10);n.textAlign="right"}const o=this.debug===true?Object.keys(i):this.debug;let a=0;o.forEach(function(t){const o=Object.keys(i[t]);o.forEach(function(o){n.fillText(t+"|"+o+": "+i[t][o],s,e+r*a);a+=1})})};e.prototype.adjust_font=function(e,n,i){e=e||1;n=n||"Sans-Serif";i=i||"";const r=9/1400*e;const s=r*t.pixel(this.width)+t.pixel(5);return i+" "+s+"pt "+n};e.prototype.draw_axes=function(){const e=this.scale;this.context.strokeStyle="black";this.context.lineWidth=1;this.context.setLineDash([1,0]);const n=t.pixel(this.axis_y_gutter);const i=t.pixel(this.axis_x_gutter);this.context.clearRect(e.x.range_min(),e.y.range_max(),e.x.range_max()+n,i);const r=this.axis_x_reverse?e.x.range_max():0;this.context.clearRect(r,e.y.range_min(),n,e.y.range_max()+i);this.context.fillStyle="black";if(this.axis_y_show)this.draw_y_axis();if(this.axis_x_show)this.draw_x_axis()};e.prototype.draw_x_axis=function(){const e=this;const n=t.pixel(this.tick_length);const i=this.context;const r=this.scale;i.beginPath();i.moveTo(r.x.range()[1],r.y.range()[1]);i.lineTo(r.x.range()[0],r.y.range()[1]);i.stroke();i.textAlign="center";i.textBaseline="top";i.font=this.font;r.x.ticks(this.x_tick_count).forEach(function(t){i.beginPath();i.moveTo(r.x(t),r.y.range()[1]);i.lineTo(r.x(t),r.y.range()[1]+n);i.stroke();let s=+t.toFixed(e.tick_precision);i.fillText(e.axis_x_tick_format(s),r.x(t),r.y.range()[1]+n)});if(this.axis_x_title){i.font=this.axis_title_font;const t=r.x.range_diff()/2;const e=r.y.range()[1]+3*n;i.fillText(this.axis_x_title,t,e)}};e.prototype.draw_y_axis=function(){const e=this;const n=this.context;const i=this.scale;const r=5;const s=this.axis_x_reverse?1:-1;const o=s*t.pixel(this.tick_length);const a=i.x.range()[0]+s*t.pixel(this.tick_length+r);n.beginPath();n.moveTo(i.x.range()[0],i.y.range()[1]);n.lineTo(i.x.range()[0],i.y.range()[0]);n.stroke();
728n.textAlign=this.axis_x_reverse?"left":"right";n.textBaseline="middle";n.font=this.font;let l=0;let c=i.y.ticks(this.tick_count);c.forEach(function(t){n.beginPath();n.moveTo(i.x.range()[0],i.y(t));n.lineTo(i.x.range()[0]+o,i.y(t));n.stroke();n.fillText(e.axis_y_tick_format(t),a,i.y(t));if(e.axis_y_title){const e=Number(n.measureText(t).width);if(e>l)l=e}});if(this.axis_y_title){const e=t.pixel(4);const a=t.pixel(this.axis_y_gutter);const c=/(\d+\.?\d*)pt/.exec(this.axis_title_font)[1];const u=l+Math.abs(o)+Number(c)+e+r;if(u<a){n.save();n.textAlign="center";n.textBaseline="middle";n.font=this.axis_title_font;const t=i.x.range()[0]+7*o*s;const e=i.y.range()[1]/2;n.translate(t,e);n.rotate(s*Math.PI/2);n.translate(-t,-e);n.fillText(this.axis_y_title,t,e);n.restore()}}};e.prototype.draw_grid_lines=function(e){const n=this;const i=this.context;const r=i;const s=this.scale;s[e].ticks(this.tick_count).forEach(function(n){i.beginPath();if(e=="y"){i.moveTo(s.x.range()[0],s.y(n));i.lineTo(s.x.range()[1],s.y(n))}else if(e=="x"){i.moveTo(s.x(n),s.y.range()[0]);i.lineTo(s.x(n),s.y.range()[1])}i.strokeStyle="rgb(210,210,210)";i.lineWidth=t.pixel(.5);i.stroke()});this.context=r};e.prototype.elements=function(e,n,i,r){const s=this;let o=i;if(!i){n=t.default_for(n,s);if(typeof n=="string"){n=s.spectra(n)}if(!n){o=new t.SVSet}else if(e=="peak"){o=n.peaks()}
728else if(e=="cluster"){o=n.clusters()}else if(e=="compound"){o=n.compounds()}else if(e=="spectrum"){o=n.spectra()}else{o=new t.SVSet}}if(r){o=new t.SVSet(o.filter(function(t){return t.visible}))}return o};e.prototype.image=function(e,n){e=e||this.width;n=n||this.height;const i=this.context;const r=d3v7.select("body").append("canvas").attr("width",e).attr("height",n).node();t.scale_resolution(r,t.pixel_ratio);this.context=r.getContext("2d");const s=t.pixel(n-this.axis_x_gutter);this.scale.x.range(this.x_range(e));this.scale.y.range([s,0]);this.full_draw();image=r.toDataURL();this.scale.x.range(this.x_range());this.scale.y.range([this.scaled_height,0]);this.context=i;d3v7.select(r).remove();return image};t.SpectraViewer2D=e})(JSpectraViewer);(function(t){t.SpectraViewer.prototype.initialize_dragging=function(){const e=this;e.drag_event=false;e.drag_behavior=d3v7.drag().on("start",n).on("drag",i).on("end",r);e.svg.call(e.drag_behavior);function n(t){e.drag_event=true;t.sourceEvent.preventDefault();e.svg.style("cursor","all-scroll");e.trigger("drag-start")}function i(n){const i=(new Date).getTime();e.translate_axis("x",n.dx);e.translate_axis("y",n.dy);e.trigger("drag");e.fast_draw();if(e.debug){console.log("dragging");e.debug_data.time["drag"]=t.elapsed_time(i);e.debug_data.drag["dX"]=t.round(n.dx);e.debug_data.drag["dY"]=t.round(n.dy);e.debug_data.drag["zX"]=t.round(e.zoom_x);e.debug_data.drag["zY"]=t.round(e.zoom_y)}}function r(){e.drag_event=false;e.trigger("drag-end");e.full_draw()}};t.SpectraViewer.prototype.initialize_zooming=function(){const e=this;e.zoom_behavior=d3v7.zoom().scaleExtent([1,e.zoom_max]).on("start",n).on("zoom",i).on("end",r);e.svg.call(e.zoom_behavior).on("mousedown.zoom",null).on("dblclick.zoom",null);e.zoom_x=1;e.zoom_y=1;e.zoom_axis="x";e.zoom_y_key="altKey";function n(t){if(e.drag_event)return;const n=t.sourceEvent[e.zoom_y_key];e.set_zoom_axis(n,t);e.set_zoom_cursor(n);e.trigger("zoom-start")}function i(n){if(e.drag_event)return;const i=(new Date).getTime();e.set_zoom_axis(n.sourceEvent[e.zoom_y_key],n);e.scale_axis(e.zoom_axis,n.transform.k,n);e.fast_draw();if(e.debug){
729console.log("zooming");e.debug_data.time["zoom"]=t.elapsed_time(i);e.debug_data.zoom["zX"]=t.round(e.zoom_x);e.debug_data.zoom["zY"]=t.round(e.zoom_y)}}function r(){if(e.drag_event)return;e.svg.style("cursor","all-scroll");e.trigger("zoom-end");e.full_draw()}};t.SpectraViewer.prototype.initialize_drag_drop_load=function(){const t=this;this.svg.on("dragleave.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw()});this.svg.on("dragover.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw();t.flash("Drop Bayesil JSON File...")});this.svg.on("drop.dragndrop",function(e){e.preventDefault();e.stopPropagation();t.draw();const n=e.dataTransfer.files[0];t.flash('Loading "'+n.name+'"...');const i=new FileReader;t.json_file=n;i.onload=function(){const e=i.result;try{const i=JSON.parse(e);t.replace_bayesil_data(i,true);t.trigger("drop")}catch(n){t.draw();t.flash("Could not read file: "+n.message)}};i.readAsText(n)})}})(JSpectraViewer);(function(t){t.SpectraViewer2D.prototype.initialize_zooming=function(){const t=this;t.zoom_behavior=d3v7.zoom().scaleExtent([t.zoom_min,t.zoom_max]).on("zoom",e);t.svg.call(t.zoom_behavior).on("dblclick.zoom",null);function e(e){if(t.drag_event)return;t.threshold=e.transform.k;t.fast_draw()}};t.SpectraViewer2D.prototype.drag_zoom=function(){const e=this;const n=e.svg;const i=i=>{e.zoom_rect.origin=[i.x,i.y];e.zoom_rect.translated_origin=e.absolute_to_translated_context(t.pixel(e.zoom_rect.origin[0]),t.pixel(e.zoom_rect.origin[1]));e.zoom_rect.r=n.append("rect").attr("id","zoom-rect").attr("style","fill:blue;fill-opacity:0.1;").attr("x",e.zoom_rect.origin[0]).attr("y",e.zoom_rect.origin[1]).attr("width",1).attr("height",1)};const r=t=>{e.zoom_rect.r.attr("x",Math.min(e.zoom_rect.origin[0],t.x)).attr("y",Math.min(e.zoom_rect.origin[1],t.y)).attr("width",Math.abs(t.x-e.zoom_rect.origin[0])).attr("height",Math.abs(t.y-e.zoom_rect.origin[1]))};const s=n=>{const i=(t,e)=>{return t-e};const r=e.absolute_to_translated_context(t.pixel(n.x),t.pixel(n.y));if(n.x!==e.zoom_rect.origin[0]&&n.y!==e.zoom_rect.origin[1]){e.move_to([[e.zoom_rect.translated_origin[0],r[0]].sort(i),[e.zoom_rect.translated_origin[1],r[1]].sort(i)],500)}e.zoom_rect.r.remove()};return{start:i,drag:r,end:s}}})(JSpectraViewer);(function(t){const e=function(){const t=d3v7.scaleLinear();t.min=function(e){if(!arguments.length)return t.domain()[0];if(e>t.max()){throw new Error("x must be less than domain max: "+t.max())}t.domain([e,t.max()]);return t};t.max=function(e){if(!arguments.length)return t.domain()[1];if(e<t.min()){throw new Error("x must be greater than domain min: "+t.min())}t.domain([t.min(),e]);return t};t.diff=function(){return Math.abs(t.max()-t.min())};t.range_diff=function(){return Math.abs(t.range()[1]-t.range()[0])};t.range_min=function(){return d3v7.min(t.range())};t.range_max=function(){return d3v7.max(t.range())};return t};const n=function(){this.x=t.LinearScale();this.y=t.LinearScale();this.initialized=false};n.prototype.clamp=function(t){this.x.clamp(t);this.y.clamp(t)};n.prototype.update=function(t){const e=this.initialized?this.x.max():null;const n=this.initialized?this.y.max():null;let i=Number.NEGATIVE_INFINITY;let r=Number.POSITIVE_INFINITY;let s=Number.NEGATIVE_INFINITY;let o=Number.POSITIVE_INFINITY;t.x.concat(e).forEach(t=>{if(t>i)i=t});t.x.forEach(t=>{if(t<r)r=t});t.y.concat(e).forEach(t=>{if(t>s)s=t});
729t.y.forEach(t=>{if(t<o)o=t});this.x.domain([r,i]);this.y.domain([o,s]);this.initialized=true};t.LinearScale=e;t.SVScale=n})(JSpectraViewer);(function(t){const e=function(){const t={};this.on=function(r,s){e(r);const o=i(r);if(!t[o])t[o]=[];t[o].push(new n(r,s))};this.off=function(n,s){e(n);const o=i(n);const a=r(n);if(arguments.length==1){if(a){if(o){t[o]=t[o].filter(function(t){return t.namespace!=a})}else{Object.keys(t).forEach(function(e){t[e]=t[e].filter(function(t){return t.namespace!=a})})}}else{t[o]=undefined}}else{t[o]=t[o].filter(function(t){return t.callback!=s})}};this.trigger=function(n,s){e(n);const o=i(n);const a=r(n);if(Array.isArray(t[o])){t[o].forEach(function(t){if(a){if(t.namespace==a)t.callback.call(null,s)}else{t.callback.call(null,s)}})}};var e=function(t){if(typeof t!="string"){throw new Error("Type must be a string")}}};const n=function(t,e){this.callback=e;this.event_type=i(t);this.namespace=r(t)};const i=function(t){return t.replace(/\..*/,"")};const r=function(t){const e=t.match(/\.(.*)/);return e?e[1]:undefined};t.SVEvents=e})(JSpectraViewer);(function(t){const e=function(){if(arguments.length==1&&Array.isArray(arguments[0])){this.push.apply(this,arguments[0])}else if(arguments.length>0){this.push.apply(this,arguments)}};e.prototype=Object.create(Array.prototype);e.prototype.toString=function(){return"SVSet"};e.prototype.merge=function(t){this.push.apply(this,t);return this};e.prototype.attr=function(t){if(arguments.length==1&&typeof t=="object"){const e=Object.keys(t);const n=e.length;let i=0;const r=this.length;for(;i<r;i++){for(let r=0;r<n;r++){this[i][e[r]]=t[e[r]]}}}else if(arguments.length==2){let t=0;const e=this.length;for(;t<e;t++){this[t][arguments[0]]=arguments[1]}}else if(t!=undefined){throw new Error("attr(): must be 2 arguments or a single object")}return this};e.prototype.draw=function(t,e,n,i,r,s=null){let o=0;const a=this.length;for(;o<a;o++){if(s)this[o].draw(t,e,n,i,r);else this[o].draw(t,e,n,i,r,s)}return this};e.prototype.each=function(t){let e=0;const n=this.length;for(;e<n;e++){t.call(this[e],e,this)}return this};e.prototype.contains=function(t){return this.indexOf(t)>=0};e.prototype.remove=function(t){let n=this;n=new e(n.filter(function(e){return e!=t}));return n};e.prototype.empty=function(){return this.length==0};e.prototype.present=function(){return this.length>0};e.prototype.order_by=function(t,e){if(this.length>0){if(typeof this[0][t]==="function"){this.sort(function(e,n){if(e[t]()>n[t]()){return 1}else if(e[t]()<n[t]()){return-1}else{return 0}})}else{this.sort(function(e,n){if(e[t]>n[t]){return 1}else if(e[t]<n[t]){return-1}else{return 0}})}}if(e)this.reverse();return this};e.prototype.lineWidth=function(t){let e=0;const n=this.length;for(;e<n;e++){this[e].lineWidth=t}return this};e.prototype.get=function(t){if(t==undefined){return this}else if(Number.isInteger(t)){return this[t-1]}else if(typeof t=="string"){if(t.match(/^path-id-/)){return this.filter(function(e){return e.path_id()==t})[0]}else if(t.match(/^label-id-/)){return this.filter(function(e){return e.label_id()==t})[0]}else{return this.filter(function(e){return e.id==t})[0]}}else if(Array.isArray(t)){const n=this.filter(function(e){return t.some(function(t){return e.id==t})});const i=new e;i.push.apply(i,n);return i}else{return new e}};e.prototype.equals=function(t){if(t.toString()!="SVSet"&&!Array.isArray(t)){return false}const e=this.unique();const n=t.unique();let i=true;if(e.length!=n.length){return false}e.forEach(function(t){if(!n.contains(t)){i=false;return}});return i};e.prototype.unique=function(){return new e(this.filter(n))};function n(t,e,n){return n.indexOf(t)===e}e.prototype.find=function(t){if(typeof t!=="function"){throw new TypeError("predicate must be a function")}const e=Object(this);const n=e.length>>>0;const i=arguments[1];let r;for(let s=0;s<n;s++){r=e[s];if(t.call(i,r,s,e)){return r}}return undefined};t.SVSet=e})(JSpectraViewer);(function(t){const e=function(t){if(t===undefined){t={x:[],y:[]}}if(t instanceof Array){t=n(t)}if(t.x.length!=t.y.length){throw new Error("x and y must be the same length!")}if(t.yi&&t.yi.length!=t.x.length){throw new Error("If present yi must be the same length as x and y!")}const e=t.x[0]>t.x[t.x.length-1];this.x=e?t.x.reverse():t.x;this.y=e?t.y.reverse():t.y;this.yi=t.yi&&e?t.yi.reverse():t.yi};e.prototype.length=function(){return this.x.length};e.prototype.asArray=function(){const t=[];let e;let n=0;const i=this.length();for(;n<i;n++){e={x:this.x[n],y:this.y[n]};if(this.yi){e.yi=this.yi[n]}t.push(e)}return t};e.prototype.index_of=function(e,n){return t.index_of_value(this.x,e,n)};e.prototype.simplify=function(n,i){return new e(t.simplify(this,n,i))};const n=function(t){const e=[],n=[],i=[];let r=0;const s=t.length;for(;r<s;r++){e.push(t[r].x);n.push(t[r].y);if(t[0].yi){i.push(t[r].yi)}}const o={x:e,y:n};if(t[0]&&t[0].yi){o.yi=i}return o};t.SVData=e})(JSpectraViewer);(function(t){const e=function(t){if(t===undefined){t={x:[],y:[],z:[]}}if(t instanceof Array){t=n(t)}if(t.z.length!=t.x.length*t.y.length){throw new Error("z length must be divisible by x and y length!")}this.x=t.x;this.y=t.y;this.z=t.z};e.prototype.length=function(){return this.x.length};e.prototype.asArray=function(){let t=[];let e;for(let n=0,i=this.length();n<i;n++){e={x:this.x[n],y:this.y[n],z:this.z[n]};t.push(e)}return t};let n=function(t){let e=[],n=[],i=[];let r=0;const s=t.length;for(;r<s;r++){e.push(t[r].x);n.push(t[r].y);i.push(t[r].z)}let o={x:e,y:n,z:i};return o};t.SVData2D=e})(JSpectraViewer);(function(t){path_id=0;const e=function(e,n){e=e||{};this.meta=n||{};this.lineWidth=t.default_for(e.lineWidth,1);this.color=t.default_for(e.color,"black");this.visible=t.default_for(e.visible,true);this.dash=t.default_for(e.dash,[]);this.fill=e.fill;this.path_id()};e.prototype.peaks=function(){return new t.SVSet};e.prototype.path_id=function(){const t=n();this.path_id=function(){return t};return t};const n=function(){return"path-id-"+path_id++};e.prototype.attr=function(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){this[e[n]]=t[e[n]]}return this};e.prototype.display_settings=function(t){if(t){return this.attr(t)}else{return{color:this.color,fill:this.fill,lineWidth:this.lineWidth,visible:this.visible,dash:this.dash}}};e.prototype.data_for_draw=function(e,n,i,r){let s;const o=this.xy_data!=undefined;if(this.phasing&&o&&this.xy_data.yi!=undefined){let t;const e=[];const n=this.xy_data.length();for(let i=0;i<n;i++){t=Math.PI*(1*this.ph0+1*(n-i-1)*this.ph1/n)/180;e.push(Math.cos(t)*this.xy_data.y[i]+Math.sin(t)*this.xy_data.yi[i])}s={x:this.xy_data.x,y:e}}else if(i&&this.peaks().length>0||!o&&this.peaks().length>0){if(!r)r=1;const n=e.x.range_diff()/t.pixel_ratio/r;const i=r>1;s=t.xy_from_peaks(this.peaks(),n,e.x.domain()[0],e.x.domain()[1],i)}else if(o){s=n?this.simple_xy_data:this.xy_data}else{s={x:[0],y:[0]};console.error("No data or Peaks for SVPath:")}return s};e.prototype.draw=function(e,n,i,r,s){if(this.visible){const o=this.data_for_draw(n,i,r,s);const a=t.index_of_value(o.x,n.x.domain()[0],false);const l=t.index_of_value(o.x,n.x.domain()[1],true);e.translate(.5,.5);e.beginPath();const c=this.fill?n.y(0):n.y(o.y[a]);e.moveTo(n.x(o.x[a]),c);for(let t=a;t<=l;t++){e.lineTo(n.x(o.x[t]),n.y(o.y[t]))}if(this.fill){e.lineTo(n.x(o.x[l]),n.y(0));e.fillStyle=this.fill;e.fill()}e.lineWidth=t.default_for(this.lineWidth,1);e.strokeStyle=this.color;e.setLineDash(this.dash);e.stroke();e.translate(-.5,-.5)}};t.SVPath=e})(JSpectraViewer);(function(t){plot_id=0;const e=function(e,n){e=e||{};this.meta=n||{};this.dotSize=t.default_for(e.dotSize,1);this.color=t.default_for(e.color,"black");this.visible=t.default_for(e.visible,true);this.plot_id()};e.prototype.plot_id=function(){let t=n();this.path_id=function(){return t};return t};const n=function(){return"plot-id-"+plot_id++};e.prototype.attr=function(t){const e=Object.keys(t);let n=0;const i=e.length;for(;n<i;n++){this[e[n]]=t[e[n]]}return this};e.prototype.display_settings=function(t){if(t){return this.attr(t)}else{return{color:this.color,fill:this.fill,lineWidth:this.lineWidth,visible:this.visible,dash:this.dash}}};e.prototype.sum=function(t){return t.reduce((t,e)=>t+e)};e.prototype.mean=function(t){return this.sum(t)/t.length};e.prototype.stddev=function(t){const e=this.mean(t);const n=function(t,n){return t+(n-e)*(n-e)};return Math.sqrt(t.reduce(n,0)/t.length)};e.prototype.find_peaks=function(t,e){const n=Array(t.length).fill(0);let i=this.stddev(t);let r=this.mean(t);for(let s=0;s<t.length;s++){if(t[s]>r+i*e){n[s]=1}else if(t[s]<r-i*e){n[s]=-1}}return n};e.prototype.data_for_draw=function(){let t;const e=this.xyz_data!=undefined;if(e){return{x:this.xyz_data.x,y:this.xyz_data.y,z:this.xyz_data.z}}else{t={x:[0],y:[0],z:[0]};console.log("No data or Peaks for SVPath:");console.log(this);return t}};e.prototype.draw=function(e,n,i,r,s,o){let a=t=>{t.forEach(t=>{if(t.coordinates.length==0)return;
729t.coordinates.forEach(t=>{e.beginPath();t.forEach(t=>{t.forEach(t=>{const i=n.x.range();const r=n.y.range();let s=n.x(this.original_scale.x.invert(t[0]));let o=n.y(this.original_scale.y.invert(t[1]));if(s<i[1]){s=i[1]}else if(s>i[0]){s=i[0]}if(o<r[0]){o=r[0]}else if(o>r[1]){o=r[1]}e.lineTo(s,o)})});e.stroke()})})};if(this.visible){let l=this;let c=this.data_for_draw();if(!this.original_scale){this.original_scale=new t.SVScale;this.original_scale.x.domain(n.x.domain());this.original_scale.y.domain(n.y.domain());this.original_scale.x.range(n.x.range());this.original_scale.y.range(n.y.range())}if(!this.old_threshold||this.old_threshold!=o){this.old_threshold=o;const t=l.find_peaks(c.z,o);let e=[];let i=[];for(let r=0;r<c.y.length;r++){for(let s=0;s<c.x.length;s++){if(t[c.x.length*r+s]===-1){i.push([n.x(c.x[s]),n.y(c.y[r])])}else if(t[c.x.length*r+s]===1){e.push([this.original_scale.x(c.x[s]),this.original_scale.y(c.y[r])])}}}this.posContours=d3v7.contourDensity().size([c.x.length*3,c.y.length*3]).bandwidth(10)(e);this.negContours=d3v7.contourDensity().size([c.x.length*3,c.y.length*3]).bandwidth(10)(i)}e.strokeStyle="blue";a(this.posContours);e.strokeStyle="red";a(this.negContours);if(!i){let t={};let i={};for(let e=0;e<c.y.length;e++){let n=c.y[e];for(let r=0;r<c.x.length;r++){let s=c.x[r];let o=c.z[c.x.length*e+r];if(t[s]===undefined){t[s]=0}if(i[n]===undefined){i[n]=0}t[s]+=o;i[n]+=o}}let o=Object.values(i);let a=Object.values(t);let l=Math.max(...a);let u=Math.min(...a);let h=Math.max(...o);let f=Math.min(...o);const d=l-u;const p=h-f;Object.keys(t).map(function(e,n){t[e]=(t[e]-u)/d});Object.keys(i).map(function(t,e){i[t]=(i[t]-f)/p});let m=d3v7.scaleLinear().domain([u,l]).range([0,-(r*.12)+10]);let g=d3v7.scaleLinear().domain([f,h]).range([0,-(s[0]*.08)+10]);e.lineWidth=1;e.strokeStyle="blue";e.beginPath();for(let t=0;t<=c.x.length;t++){const i=n.x(c.x[t]);const r=n.x.range();if(i>=r[1]&&i<=r[0]){e.lineTo(i,m(a[t]))}}e.stroke();e.beginPath();for(let t=0;t<=c.y.length;t++){const i=n.y(c.y[t]);const r=n.y.range();if(i>=r[0]&&i<=r[1]){e.lineTo(g(o[t]),n.y(c.y[t]))}}e.stroke()}}};t.SVDot=e})(JSpectraViewer);(function(t){function e(t,e,n,i){this.x=t;this.y=e;this.width=n;this.height=i}e.prototype.contains_pt=function(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height};function n(e){const n=this;this.sv=e;this.max_label_length=0;this.margin_top=t.pixel(5);this.margin_side=t.pixel(10);this.key_label_space=t.pixel(5);this.key_width=t.pixel(10);this.line_width=t.pixel(3);this.text_height=t.pixel(18);this.items=[];e.svg.on("click.legend",function(t){let i=e.mouse(t,e.canvas);for(let t=0,r=n.items.length;t<r;t++){let r=n.items[t];if(r.rect.contains_pt(i[0],i[1])&&e.legend_show){r.path.visible=!r.path.visible;e.full_draw()}}})}n.prototype.bottom=function(){const e=(this.sv.zoombox.visible?t.pixel(this.sv.zoombox.height):0)+this.margin_top;return this.sv.legend_show?this.offset_y:e};n.prototype.update=function(){const n=this.sv;const i=n.context;this.offset_y=(n.zoombox.visible?t.pixel(n.zoombox.height):0)+this.margin_top;const r=this.margin_side;i.font=n.adjust_font(1,"monospace");this.items=[];for(let s=0;s<n.spectra().length;s++){const o=n.spectra()[s];const a=new t.SVLegendItem(this);const l=new e;l.y=this.offset_y;l.height=this.text_height;l.width=this.key_width+this.key_label_space+i.measureText(o.name).width;l.x=n.axis_x_reverse?r:t.pixel(n.width)-r-l.width;a.rect=l;a.path=o;this.offset_y+=this.text_height;this.items.push(a);this.max_label_length=Math.max(a.path.name.length,this.max_label_length)}};n.prototype.draw=function(){const t=this.sv;const e=t.context;e.save();e.textAlign="left";e.textBaseline="middle";e.font=t.adjust_font(1,"monospace");for(let t=0;t<this.items.length;t++){this.items[t].draw(this.max_label_length)}e.restore()};function i(t,e,n){this.legend=t;this.sv=t.sv;this.path=e;this.rect=n}i.prototype.key_x1=function(){return this.sv.axis_x_reverse?this.rect.x:this.rect.x+this.rect.width-this.legend.key_width};i.prototype.key_x2=function(){return this.key_x1()+this.legend.key_width};i.prototype.key_y=function(){return this.rect.y+this.rect.height/2};i.prototype.label_x=function(){return this.sv.axis_x_reverse?this.rect.x+this.legend.key_width+this.legend.key_label_space:this.rect.x};i.prototype.draw=function(t){let e=this.rect;this.sv.context.clearRect(e.x,e.y,e.width,e.height);if(this.path.visible)this.draw_key();this.draw_label(t)};i.prototype.draw_key=function(){let t=this.sv.context;t.beginPath();t.moveTo(this.key_x1(),this.key_y());t.lineTo(this.key_x2(),this.key_y());t.lineWidth=this.legend.line_width;t.strokeStyle=this.path.color;t.setLineDash(this.path.dash);t.stroke()};i.prototype.draw_label=function(t){this.sv.context.fillStyle=this.path.visible?"black":"#999";let e=this.path.visible?"\u2612":"\u2610";let n=`${this.path.name.padEnd(t)} ${e}`;this.sv.context.fillText(n,this.label_x(),this.key_y())};t.SVLegend=n;t.SVLegendItem=i})(JSpectraViewer);(function(t){function e(e,n={}){const i=this;this.sv=e;this.highlighted_label;this.point_gap=t.default_for(n.point_gap,t.pixel(12));this.label_color=t.default_for(n.label_color,"#5555DD");this.visible=t.default_for(n.visible,true);this.hover=t.default_for(n.hover,true);this.labels=new t.SVSet;this.visible_labels=new t.SVSet;e.svg.on("mousedown.label",function(){if(i.highlighted_label&&i.hover){e.trigger("label-click",i.highlighted_label)}})}e.prototype.get=function(t){return this.labels.get(t)};e.prototype.update=function(){const e=this.sv;const n=e.labels?e.labels.get():new t.SVSet;
729e.spectra().forEach(function(t){if(t.visible&&t.active&&t.labels){n.push.apply(n,t.labels.get())}});this.labels=n;let i=this.reduce_labels_by_view();i=this.reduce_labels_by_height(i);i=this.adjust_labels(i);this.visible_labels=i};e.prototype.rect_for_label=function(e){const n=this.sv;let i,r,o;const a=n.scale.x(e.x);const l=n.scale.y(e.y);const c=n.context.measureText(e.text).width;const u=t.pixel(e.font_size);if(e.vertical){r=a-u/2;o=l-c-this.point_gap;i=new s(r,o,u,c)}else{r=a-c/2;o=l-u-this.point_gap;i=new s(r,o,u,c)}return i};e.prototype.reduce_labels_by_view=function(t){if(!t)t=this.labels;const e=this.sv.scale;return t.filter(function(t){return t.x>e.x.min()&&t.x<e.x.max()&&t.y<e.y.max()})};e.prototype.reduce_labels_by_height=function(e){if(!e)e=this.labels;const n=this.sv.scale;const i=6;const r=new t.SVSet;let s=0;const o=e.length;for(;s<o;s++){label=e[s];label.font_size=i;label.rect=this.rect_for_label(label);label.adjust_rect(r);if(label.stack_level<3){r.push(label)}}return r};e.prototype.adjust_labels=function(e){const n=this.sv;let i,r,s,o;const a=1;const l=t.pixel(2);const c=t.pixel(12);const u=13;const h=8;const f=u-h;let d=u;let p=h;const m=n.scale;const g=n.context;g.save();let _=true;while(_){_=false;adjusted_labels=new t.SVSet;g.font=t.pixel(d)+"px Arial";p=h+Math.round(f*n.zoom_x/n.zoom_max);let i=0;const s=e.length;for(;i<s;i++){r=e[i];r.font_size=d;r.rect=this.rect_for_label(r);r.adjust_rect(adjusted_labels);if(r.stack_level>a&&d>p){_=true;d-=1;break}else{adjusted_labels.push(r)}}}return e};e.prototype.label_over_spectra=function(e,n,i){const r=this.sv;const s=[];for(let t=0,n=e.rect.width;t<n;t++){s.push(r.scale.x.invert(e.rect.x+t))}const o=r.scale.y.invert(e.rect.bottom());let a=false;for(let e=0,i=s.length;e<i;e++){if(o<t.sum_of_peaks(s[e],n)){a=true;break}}return a};e.prototype.draw=function(){if(!this.visible){return}const e=this.sv;const n=e.context;const i=e.scale;let r;const s=t.pixel(2);n.save();this.update();const o=this.visible_labels;for(let e=0,a=o.length;e<a;e++){r=o[e];const a=i.x(r.x);const l=i.y(r.y)-s;const c=r.rect.bottom()+s;n.beginPath();n.moveTo(a,l);n.lineTo(a,c);n.strokeStyle="#999999";n.lineWidth=t.pixel(.5);n.stroke()}n.fillStyle=this.label_color;for(let t=0,e=o.length;t<e;t++){r=o[t];if(r===this.highlighted_label){n.font="bold "+n.font}else{n.font=n.font.replace("bold ","")}n.textBaseline="top";if(r.vertical){n.textAlign="right";n.save();n.translate(r.rect.x,r.rect.y);n.rotate(-Math.PI/2);n.fillText(r.text,0,0);n.restore()}else{n.textAlign="left";n.fillText(r.text,r.rect.x,r.rect.y)}}n.restore()};e.prototype.check_hover=function(){const t=this.sv;let e;if(this.hover){const n=t.scale.x(t.mx);const i=t.scale.y(t.my);const r=this.highlighted_label;let s;let o=0;const a=this.visible_labels.length;for(;o<a;o++){e=this.visible_labels[o];if(e.rect.contains_pt(n,i)){s=e;break}}if(r!=s){this.highlighted_label=s;this.sv.trigger("click-start");t.full_draw()}if(this.highlighted_label){t.svg.style("cursor","pointer")}else{t.svg.style("cursor","move")}}};function n(e){e=e||{};this.spectrum=e.spectrum;this.labels=new t.SVSet}n.prototype.get=function(t){return this.labels.get(t)};n.prototype.add=function(t,e,n){this.labels.push(new i(this,t,e,n))};n.prototype.add_peaks=function(){if(this.spectrum){const e=this.spectrum.peaks();let n=0;const i=e.length;for(;n<i;n++){const i=e[n];const r=t.sum_of_peaks(i.center,i.spectrum().peaks());this.add({x:i.center,y:r,text:i.label()})}}};n.prototype.update_peaks=function(){if(this.spectrum){this.labels=new t.SVSet;this.add_peaks()}};label_id=0;function i(e,n,i,r){n=n||{};display_defaults={vertical:true,font_size:12};i=t.merge(display_defaults,n.display,i);this.meta=t.merge(n.meta,r);this.label_set=e;this.vertical=i.vertical;this.font_size=i.font_size;this.text=n.text;this.x=n.x;this.y=n.y;this.stack_level=0;this.label_id()}i.prototype.label_id=function(){const t=r();this.label_id=function(){return t};return t};const r=function(){return"label-id-"+label_id++};i.prototype.adjust_rect=function(e){const n=true;let i=0;while(this.overlap(e)){this.rect.y-=t.pixel(this.font_size)*2;i+=1}this.stack_level=i};i.prototype.overlap=function(t){return this.rect.overlap(t.map(function(t){return t.rect}))};function s(t,e,n,i){this.x=t;this.y=e;this.width=n;this.height=i}s.prototype.bottom=function(){return this.y+this.height};s.prototype.top=function(){return this.y};s.prototype.left=function(){return this.x};s.prototype.right=function(){return this.x+this.width};s.prototype.overlap=function(e){const n=t.pixel(4);const i=this;let r=false;let s=0;const o=e.length;for(;s<o;s++){const t=e[s];if(i.x<=t.right()&&t.x<=i.right()+n&&i.y<=t.bottom()&&t.y<=i.bottom()){r=true;break}else{r=false}}return r};s.prototype.contains_pt=function(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height};t.SVAnnotation=e;t.SVLabelSet=n;t.SVLabel=i})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this.id=e.id;this.name=e.name||this.id;this.tolerance=e.tolerance;this.noise;this.active=true;this.xy_data=new t.SVData;this.simple_xy_data=new t.SVData;this.labels=new t.SVLabelSet({spectrum:this});this._compounds=new t.SVSet;if(e.compounds){e.compounds.forEach(function(e){r.add_compound(new t.Compound(e))})}else if(e.peak_list){const n={clusters:[{peaks:e.peak_list}]};r.add_compound(new t.Compound(n))}if(r.compounds().present()){const n=t.default_for(e.number_of_points,1e4);const i=t.default_for(e.min_x,-1);const s=t.default_for(e.max_x,10);if(!e.xy_line){const e=t.xy_from_peaks(r.peaks(),n,i,s);r.add_xy_line(e)}}if(e.xy_line){r.add_xy_line(e.xy_line)}
729if(e.labels){e.labels.forEach(function(t){r.labels.add(t)})}}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Spectrum"};e.prototype.add_compound=function(t){this._compounds.push(t);t._spectrum=this};e.prototype.update=function(){const e=this._sv;const n=t.xy_from_peaks(this.peaks(),this.xy_data.length(),e.boundary.x.min(),e.boundary.x.max());this.add_xy_line(n);e.zoombox.update()};e.prototype.compounds=function(t){return this._compounds.get(t)};e.prototype.add_xy_line=function(e){this.xy_data=new t.SVData(e);this.noise=this.calculate_noise();const n=this.tolerance||this.noise;this.simple_xy_data=this.xy_data.simplify(n,true)};e.prototype.calculate_noise=function(){const t=[-.05,-.04];const e=this.xy_data.index_of(t[0]);const n=this.xy_data.index_of(t[1]);const i=this.xy_data.y.slice(e,n);return(d3v7.max(i)-d3v7.min(i)).toPrecision(2)};e.prototype.clusters=function(e){const n=new t.SVSet;let i=0;const r=this._compounds.length;for(;i<r;i++){n.merge(this._compounds[i].clusters())}return n.get(e)};e.prototype.peaks=function(e){const n=new t.SVSet;this.compounds().forEach(function(t){t.clusters().forEach(function(t){n.merge(t.peaks())})});return n.get(e)};Object.defineProperties(e.prototype,{active:{get:function(){return this._active},set:function(t){this._active=t;const e=this._sv;if(e){e.reset_boundaries();e.all_spectra().each(function(){if(this.active){e.boundary.update(this.xy_data);e.scale.update(this.xy_data)}});e.zoombox.update();e.legend.update()}}}});t.Spectrum=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVDot.call(this,n,i);this._compounds=new t.SVSet;this.id=e.id;this.name=e.name||this.id;this.active=true;this.xyz_data=new t.SVData2D;if(e.compounds){e.compounds}r.add_xyz_plot(e.json_data);if(e.labels){e.labels.forEach(function(t){r.labels.add(t)})}}t.inherits(e,t.SVDot);e.prototype.toString=function(){return"Spectrum2D"};e.prototype.add_compound=function(t){this._compounds.push(t);t._spectrum=this};e.prototype.add_xyz_plot=function(e){this.xyz_data=new t.SVData2D(e)};e.prototype.compounds=function(t){return this._compounds.get(t)};Object.defineProperties(e.prototype,{active:{get:function(){return this._active},set:function(t){this._active=t;const e=this._sv;if(e){e.reset_boundaries();e.all_spectra().each(function(){if(this.active){e.boundary.update(this.xy_data);e.scale.update(this.xy_data)}});e.zoombox.update();e.legend.update()}}}});t.Spectrum2D=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this._clusters=new t.SVSet;if(e){this.id=e.id;this.name=e.name;this.concentration=e.concentration;this.original_concentration=e.concentration;if(e.clusters){e.clusters.forEach(function(e){r.add_cluster(new t.Cluster(e))})}}this.update()}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Compound"};e.prototype.add_cluster=function(t){this._clusters.push(t);t._compound=this};e.prototype.update=function(){this.x_min=t.peak_min(this.peaks());this.x_max=t.peak_max(this.peaks());this.xy_data=new t.SVData(t.xy_from_peaks(this.peaks(),5e3,this.x_min,this.x_max));this.simple_xy_data=this.xy_data.simplify(5e-4,true);this._clusters.order_by("center")};e.prototype.clusters=function(t){return this._clusters.get(t)};e.prototype.peaks=function(e){const n=new t.SVSet;this._clusters.forEach(function(t){n.merge(t.peaks())});return n.get(e)};e.prototype.spectrum=function(){return this._spectrum};e.prototype.intersect=function(e,n,i){const r=t.sum_of_peaks(e,this.peaks());return n<=r&&n>=0};e.prototype.display_concentration=function(){return t.round(this.concentration,1)+" \u03bcM"};e.prototype.center=function(){let t;if(this.peaks().present()){t=d3v7.mean(this.peaks(),function(t){return t.center})}return t};e.prototype.atom_assignment_nmrml=function(){if(!window.X2JS){console.log("X2JS needs to be installed to create nmrML: https://github.com/abdmob/x2js");return}const t=d3v7.format(".2f");const e=new X2JS;const n={atomAssignmentList:{multiplet:[]}};
729this.clusters().forEach(function(e){const i=[];e.peaks().forEach(function(t){i.push({_center:t.center,_amplitude:t.amplitude,_width:t.width})});const r={_center:t(e.center()),atoms:{_atomRefs:e.atom_refs.join(" ")},multiplicity:e.nmrml_multiplet_json(),peakList:{peak:i}};n.atomAssignmentList.multiplet.push(r)});let i=e.json2xml_str(n);i=i.replace(/><\/peak>/g,"/>");return i};t.Compound=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this._peaks=new t.SVSet;this._atoms=new t.SVSet;this.lower_bound=t.number(e.lower_bound);this.upper_bound=t.number(e.upper_bound);this.weight=t.number(e.weight);this.protons=t.number(e.protons);if(e.peaks){e.peaks.forEach(function(e){r.add_peak(new t.Peak(e))})}}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Cluster"};e.prototype.add_peak=function(t){this._peaks.push(t);this.multiplet_type=undefined;t._cluster=this};e.prototype.update=function(){this._peaks.order_by("center")};e.prototype.peaks=function(t){return this._peaks.get(t)};e.prototype.compound=function(){return this._compound};e.prototype.spectrum=function(){return this.compound().spectrum()};e.prototype.center=function(){let t;if(this.peaks().present()){t=d3v7.mean(this.peaks(),function(t){return t.center})}return t};e.prototype.atoms=function(t){return this._atoms.get(t)};e.prototype.determine_multiplet_type=function(){const t=this;const e=t.peaks();let r="m";if(e.length==1){r="s"}else if(e.length==2){r="d"}else if(e.length==3){r="t"}else if(e.length==4){if(n(e)){r="dd"}else{r="q"}}else if(e.length==5){r="quint"}else if(e.length==6){if(i(e)){r="td"}else{r="dt"}}return r};const n=function(t){const e=.1;const n=t.map(function(t){return t.amplitude});const i=d3v7.max(n);const r=i*(1-e);const s=i*(1+e);return n.every(function(t){return t>=r&&t<=s})};const i=function(t){const e=t.map(function(t){return t.amplitude});const n=d3v7.min(e.slice(2,3));const i=e.slice(0,1).concat(e.slice(4,5));return i.every(function(t){return t<=n})};e.prototype.nmrml_multiplet_json=function(){let t;switch(this.multiplet_type){case"s":t={_cvRef:"NMRCV",_accession:"NMR:1000194",_name:"singlet feature"};break;case"d":t={_cvRef:"NMRCV",_accession:"NMR:1000184",_name:"doublet feature"};break;case"t":t={_cvRef:"NMRCV",_accession:"NMR:1000185",_name:"triplet feature"};break;case"q":t={_cvRef:"NMRCV",_accession:"NMR:1000186",_name:"quatruplet feature"};break;case"dd":t={_cvRef:"NMRCV",_accession:"NMR:1000192",_name:"doublet of doublets feature"};break;case"quint":t={_cvRef:"NMRCV",_accession:"NMR:1000195",_name:"quintet feature"};break;case"dt":t={_cvRef:"NMRCV",_accession:"NMR:1000196",_name:"doublet of triplets feature"};break;case"td":t={_cvRef:"NMRCV",_accession:"NMR:1000197",_name:"triplet of doublets feature"};break;case"m":t={_cvRef:"NMRCV",_accession:"NMR:1400305",_name:"multiplet feature"};break;default:t={_cvRef:"NMRCV",_accession:"NMR:1400305",_name:"multiplet feature"}}return t};Object.defineProperties(e.prototype,{multiplet_type:{get:function(){if(!this._multiplet_type){this._multiplet_type=this.determine_multiplet_type()}return this._multiplet_type},set:function(t){this._multiplet_type=t}},atom_refs:{get:function(){if(this.atoms().length>0){return this.atoms().map(function(t){return t.id})}else{return this._atom_refs||[]}},set:function(t){this._atom_refs=t}},dir_dim_atom_refs:{get:function(){return this.dir_dim_atom_refs},set:function(t){this._dir_dim_atom_refs=t}},indir_dim_atom_refs:{get:function(){return this.indir_dim_atom_refs},set:function(t){this._indir_dim_atom_refs=t}}});t.Cluster=e})(JSpectraViewer);(function(t){function e(e,n,i){const r=this;e=e||{};display_defaults={visible:false};n=t.merge(display_defaults,e.display,n);i=t.merge(e.meta,i);t.SVPath.call(this,n,i);this.center=t.number(e.center);this.original_amplitude=t.number(e.original_amplitude);this.amplitude=t.number(e.amplitude);this.width=t.number(e.width)}t.inherits(e,t.SVPath);e.prototype.toString=function(){return"Peak"};e.prototype.set_amplitude=function(t){if(t<=0)t=1e-5;this.amplitude=t};e.prototype.set_center=function(t){this.center=t};e.prototype.update=function(){};e.prototype["delete"]=function(){const e=this;const n=this.cluster();const i=this.compound();const r=this.spectrum();const s=r._sv;const o=n._peaks.filter(function(t){return t!=e});n._peaks=new t.SVSet(o);n.multiplet_type=undefined;
729if(n.peaks().empty()){const e=i._clusters.filter(function(t){return t!=n});i._clusters=new t.SVSet(e)}if(i.peaks().empty()){const e=r._compounds.filter(function(t){return t!=i});r._compounds=new t.SVSet(e)}if(r.peaks().empty()){const e=s._spectra.filter(function(t){return t!=r});s._spectra=new t.SVSet(e)}};e.prototype.peaks=function(){return new t.SVSet(this)};e.prototype.cluster=function(){return this._cluster};e.prototype.compound=function(){
730return this.cluster().compound()};e.prototype.spectrum=function(){return this.compound().spectrum()};e.prototype.label=function(){return this.center.toFixed(3)};t.Peak=e})(JSpectraViewer);(function(t){function e(n,i){t.SVPath.call(this);const r=this;this.sv=n;this.element_type=i.element_type;this.allow_multiselect=t.default_for(i.allow_multiselect,true);this.allow_adjust=t.default_for(i.allow_adjust,true);this.allow_width_adjust=t.default_for(i.allow_width_adjust,true);this.allow_peak_creation=t.default_for(i.allow_peak_creation,false);this.show_bounds=t.default_for(i.show_bounds,true);this.show_indicators=t.default_for(i.show_indicators,false);this.display_info=t.default_for(i.display_info,true);this.constrain_adjust=i.constrain_adjust;this.restriction_spectrum_id=i.restriction_spectrum_id;this.possible_elements=i.possible_elements;display_defaults={fill:"rgba(150, 150, 150, 0.2)",visible:true};this.display_settings(t.merge(display_defaults,i.display));this.handle_spacer=t.pixel(10);this.handle_size=t.pixel(15);this._elements=new t.SVSet;this.initialize_selection_events();this.popup_box=this.sv.sv_wrapper.append("div").attr("class","jsv-select-popup-box").style("visibility","hidden");this.text_container=this.popup_box.append("div").attr("class","jsv-select-text-container");this.draw=function(){if(r.present()){e.prototype.draw.apply(this,arguments);r.draw_adjust_handles(arguments[0],arguments[1])}r.present()&&r.display_info?r.show_popup_box():r.hide_popup_box()}}t.inherits(e,t.SVPath);e.prototype.peaks=function(e){const n=new t.SVSet;let i=0;const r=this._elements.length;for(;i<r;i++){n.merge(this._elements[i].peaks())}return n.get(e)};e.prototype.elements=function(t){return this._elements.get(t)};e.prototype.clear=function(){this.sv.trigger("selection-clear");this._elements=new t.SVSet;this.sv.trigger("selection-empty");return this};e.prototype.add_element=function(t){this._elements.push(t);this.sv.highlight.remove();this.sv.trigger("selection-add");return this};e.prototype.remove_element=function(e){this._elements=new t.SVSet(this._elements.filter(function(t){return t!=e}));this.sv.trigger("selection-remove");if(this.empty())this.sv.trigger("selection-empty");return this};e.prototype.size=function(){return this._elements.length};e.prototype.present=function(){return this._elements.length>0};e.prototype.empty=function(){return this._elements.length==0};e.prototype.contains=function(t){return this._elements.contains(t)};e.prototype["delete"]=function(){this.peaks().each(function(){this["delete"]()});this.update();this.clear();this.sv.trigger("adjust-end");this.sv.full_draw()};e.prototype.hide_popup_box=function(){this.popup_box.style("visibility","hidden")};e.prototype.show_popup_box=function(){const e=this.highlighted_element;this.popup_box.style("width","100%");const n=this.sv.axis_x_reverse?"right":"left";this.popup_box.style(n,this.sv.axis_y_gutter+t.pixel(2)+"px");this.text_container.html(this.info_text());const i=this.text_container.node().offsetWidth+20;this.popup_box.style("visibility","visible").style("width",i+"px")};e.prototype.info_text=function(){let t="",e="",n="";const i=this.compounds();
730const r=this.clusters();const s=this.peaks();if(i.length==1){const e=i[0];t=e.name;if(e.concentration!==undefined){t+" ["+e.display_concentration()+"]"}}else{t=i.length+" compounds"}if(r.length==1){const t=r[0];e="cluster: "+t.center().toFixed(3)+" ppm"}else{e=r.length+" clusters"}if(s.length==1){const t=s[0];n="peak: "+t.center.toFixed(3)+" ppm"}else{n=s.length+" peaks"}text="<p>"+t+"</p><p>"+e+"</p><p>"+n+"</p>";return text};e.prototype.compounds=function(e){const n=new t.SVSet;this.peaks().forEach(function(t){n.push(t.compound())});return n.unique().get(e)};e.prototype.clusters=function(e){const n=new t.SVSet;this.peaks().forEach(function(t){n.push(t.cluster())});return n.unique().get(e)};e.prototype.adjust_concentration=function(){return this.element_type=="compound"||this.constrain_adjust=="compound"};e.prototype.draw_adjust_handles=function(t,e){const n=this;const i=this.sv;let r;if(n.allow_adjust&&n.allow_width_adjust&&n.present()){const s=this.handle_spacer;const o=this.handle_size;const a=i.get_peak_domains(n.peaks(),true);const l=e.x(d3v7.min(a[0]));const c=e.x(d3v7.max(a[0]));if(i.axis_x_reverse){this.handle_min_x=l+s;this.handle_max_x=c-s-o;r=-1}else{this.handle_min_x=l-s-o;this.handle_max_x=c+s;r=1}const u=e.y(d3v7.max(a[1])/2);this.handle_y=u-o/2;t.translate(.5,.5);t.beginPath();t.strokeStyle="rgba(50, 50, 50, 0.9)";t.rect(this.handle_min_x,this.handle_y,o,o);t.rect(this.handle_max_x,this.handle_y,o,o);t.stroke();t.beginPath();t.strokeStyle="rgba(150, 150, 150, 0.5)";t.moveTo(l,u);t.lineTo(l-s*r,u);t.moveTo(c,u);t.lineTo(c+s*r,u);t.stroke();t.translate(-.5,-.5)}};e.prototype.draw_bounds=function(e,n){const i=this;const r=t.pixel(10);const s=this.sv;if(o()){const t=this.elements(1);const o=s.get_peak_domains(i.peaks(),true);const a=n.y.range()[0];const l=n.x(t.lower_bound);const c=n.x(t.upper_bound);const u=n.x(t.center());e.save();e.translate(.5,.5);e.beginPath();e.lineWidth=2;if(t.center()<t.lower_bound||t.center()>t.upper_bound){e.strokeStyle="red";e.fillStyle="red"}else{e.strokeStyle="blue";e.fillStyle="white"}e.moveTo(l,a);e.lineTo(l+r,a-r);e.lineTo(l+r,a+r);e.lineTo(l,a);e.moveTo(c,a);e.lineTo(c-r,a-r);e.lineTo(c-r,a+r);e.lineTo(c,a);e.moveTo(u,a-r);e.lineTo(u,a+r);e.fill();e.stroke();e.translate(-.5,-.5);e.restore()}function o(){const e=i.elements(1);return i.show_bounds&&i.size()==1&&typeof e.center=="function"&&t.isNumeric(e.center())&&t.isNumeric(e.lower_bound)&&t.isNumeric(e.upper_bound)}};e.prototype.draw_indicators=function(e,n){const i=this;const r=t.pixel(10);const s=this.sv;if(i.show_indicators){const s=n.y.range()[0];e.save();e.translate(.5,.5);i.elements().forEach(function(i){let o;if(typeof i.center=="function"){o=i.center()}else{o=i.center}if(o!==undefined){o=n.x(o);e.beginPath();e.lineWidth=t.pixel(2);e.strokeStyle="green";e.fillStyle="green";e.moveTo(o,s-r);e.lineTo(o,s+r);e.fill();e.stroke()}});e.translate(-.5,-.5);e.restore()}};e.prototype.mouse_in_handle=function(){const t=this;const e=this.sv;let n;if(t.allow_adjust&&t.allow_width_adjust&&t.present()){const t=e.scale.x(e.mx);const i=e.scale.y(e.my);if(i>this.handle_y&&i<this.handle_y+this.handle_size){if(t>this.handle_max_x&&t<this.handle_max_x+this.handle_size)n="left";if(t>this.handle_min_x&&t<this.handle_min_x+this.handle_size)n="right"}}return n};e.prototype.mouse_in_selection=function(){const e=this;const n=this.sv;if(e.present()){const i=n.scale.x(n.mx);const r=n.scale.y(n.my);const s=t.sum_of_peaks(n.mx,e.peaks());return n.my<=s&&n.my>=0}};e.prototype.update=function(){const e=new t.SVSet;this.constrained_peaks().forEach(function(t){e.push(t,t.cluster(),t.compound(),t.spectrum())});e.unique().forEach(function(t){t.update()})};e.prototype.constrained_peaks=function(){const e=this;let n;if(e.constrain_adjust){n=new t.SVSet;e.peaks().forEach(function(t){if(t[e.constrain_adjust]){n.merge(t[e.constrain_adjust]().peaks())}});n=n.unique()}else{n=e.peaks()}return n};e.prototype.initialize_selection_events=function(){const e=this.sv;const n=this;let i,r,s,o,a,l,c;let u,h,f,d,p;let m,g;let _;e.svg.on("mousedown.selection",function(t){_=false;const i=t.x;const r=t.y;if(w(t)&&n.allow_adjust){k();e.svg.on("mousemove.fit",function(){S()});e.svg.on("mouseup.fit",function(){M();e.svg.on("mousemove.fit",null);
730e.svg.on("mouseup.fit",null)})}else if(b(t)&&n.allow_multiselect){T();e.svg.on("mousemove.fit",function(){C()});e.svg.on("mouseup.fit",function(){A();e.svg.on("mousemove.fit",null);e.svg.on("mouseup.fit",null)})}else{e.svg.on("mouseup.selection",function(t){if(i==t.x&&r==t.y){if(v(t)){E()}else if(!_){n.clear()}}e.svg.on("mouseup.selection",null)})}});function v(t){return n.allow_peak_creation&&(e.create_peak_mode||e.keyval()=="65"||t.metaKey)}function y(t){return n.allow_multiselect&&(e.keyval()=="83"||t.shiftKey)}function b(t){return y(t)&&!n.mouse_in_handle()&&!x()}function x(){return e.find_element_mouse_over(n.element_type,n.restriction_spectrum_id,n.possible_elements,n.visible_only)}function w(t){if(n.mouse_in_handle())return true;if(v(t))return false;let i;const r=x();const s=n.mouse_in_selection();if(r||s){if(y(t)){if(n.contains(r)){n.remove_element(r);i=false;_=true}else if(!s){n.add_element(r);i=true}}else if(!s){n.clear();n.add_element(r);i=true;_=true}else{i=true}e.fast_calc_draw()}else{i=false}return i}function k(){i=d3v7.event.x;r=d3v7.event.y;c=n.mouse_in_handle();e.svg.style("cursor","grabbing")}function S(){d3v7.event.stopPropagation();_=true;s=d3v7.event.x-i;o=d3v7.event.y-r;i=d3v7.event.x;r=d3v7.event.y;a=e.pixels_to_units_of_axis("x",s);l=e.pixels_to_units_of_axis("y",o);if(c){const t=c=="right"?1:-1;n.peaks().forEach(function(e){e.width=e.width-t*a*2;if(e.width<1e-5)e.width=1e-5})}else{if(n.adjust_concentration()){n.compounds().forEach(function(t){t.orig_amplitude=d3v7.max(t.peaks(),function(t){return t.amplitude})})}const t=n.constrained_peaks();m=d3v7.max(t,function(t){return t.amplitude});if(m<=0)m=1e-5;t.forEach(function(t){g=t.amplitude+l/m*t.amplitude;t.set_amplitude(g)});n.peaks().forEach(function(t){t.set_center(t.center+a)});if(n.adjust_concentration()){n.compounds().forEach(function(t){const e=d3v7.max(t.peaks(),function(t){return t.amplitude});t.concentration=t.concentration*e/t.orig_amplitude})}}e.trigger("adjust");e.fast_calc_draw()}function M(){n.update();e.svg.style("cursor","grab");e.trigger("adjust-end",n.compounds());e.full_draw()}function T(){h=new t.SVSet;const n=d3v7.mouse(e.canvas);d=n[0];p=n[1];u=e.svg.append("rect").attr("class","select-box").attr("x",d).attr("y",p).attr("width",0).attr("height",0)}function C(){d3v7.event.stopPropagation();_=true;const i=d3v7.mouse(e.canvas);x_new=i[0];y_new=i[1];const r=d3v7.min([d,x_new]);const s=d3v7.min([p,y_new]);const o=Math.abs(x_new-d);const a=Math.abs(y_new-p);u.attr("x",r).attr("y",s).attr("width",o).attr("height",a);const l=D(r,s,o,a);l.forEach(function(t){if(!n.contains(t)){n.add_element(t);h.push(t)}});h=new t.SVSet(h.filter(function(t){if(!l.contains(t)){n.remove_element(t);return false}return true}));e.fast_draw()}function A(){u.remove();e.full_draw()}function D(i,r,s,o){const a=new t.SVSet;let l;const c=e.scale.y.invert(t.pixel(r+o));const u=e.elements(n.element_type,n.restriction_spectrum_id,n.possible_elements,n.visible_only);let h=0;const f=u.length;for(;h<f;h++){const n=u[h];for(let r=0;r<s;r++){l=e.scale.x.invert(t.pixel(i+r));if(c<t.sum_of_peaks(l,n.peaks())){a.push(n);break}}}return a}function E(){let i,r;if(n.present()){i=n.peaks(1).cluster();r=d3v7.mean(n.peaks(),function(t){return t.width})}else{let s;if(n.restriction_spectrum_id){s=e.spectra(n.restriction_spectrum_id)}else{s=e.spectra().filter(function(t){return t.compounds().present()})[0]}i=new t.Cluster;s.compounds(1).add_cluster(i);if(s.peaks().present()){r=d3v7.mean(s.peaks(),function(t){return t.width})}else{r=.003}}const s=new t.Peak({width:r,center:0});i.add_peak(s);const o=e.mouse(e.canvas);s.set_center(e.scale.x.invert(o[0]));s.set_amplitude(e.scale.y.invert(o[1]));e.trigger("adjust-peak-created",s);if(n.element_type=="peak"){n.add_element(s)}else if(n.empty()&&n.element_type=="cluster"){n.add_element(i)}else if(n.empty()&&n.element_type=="compound"){n.add_element(i.compound())}M()}};t.SVSelection=e})(JSpectraViewer);(function(t){function e(e,n){this.sv=e;this.element_type=n.element_type;this.restriction_spectrum_id=n.restriction_spectrum_id;this.possible_elements=n.possible_elements;this.visible_only=t.default_for(n.visible_only,true);this.text_display=t.default_for(n.text_display,true);display_defaults={lineWidth:3,visible:true};this.display=t.merge(display_defaults,n.display);this.popup_box=this.sv.sv_wrapper.append("div").attr("class","jsv-highlight-popup-box").style("visibility","hidden");this.text_container=this.popup_box.append("div").attr("class","jsv-highlight-text-container")}e.prototype.hover=function(){const t=this.sv;if(this.element_type){const e=this.highlighted_element;let n=t.find_element_mouse_over(this.element_type,this.restriction_spectrum_id,this.possible_elements,this.visible_only);if(t.selection.mouse_in_selection()||t.selection.mouse_in_handle()){n=undefined}if(e!=n){this.highlighted_element=n;if(e){e.display_settings(this.saved_display_settings);this.hide_popup_box()}if(n){this.saved_display_settings=n.display_settings();n.display_settings(this.display);this.show_popup_box()}t.full_draw()}}};e.prototype.remove=function(){if(this.highlighted_element){this.highlighted_element.display_settings(this.saved_display_settings);this.highlighted_element=undefined;this.hide_popup_box()}};e.prototype.hide_popup_box=function(){this.sv.trigger("highlight-end");this.popup_box.style("visibility","hidden")};e.prototype.show_popup_box=function(){const t=this.highlighted_element;let e="";if(this.text_display===true){e=this.default_text()}else if(typeof this.text_display=="string"){e=this.parsed_text()}this.sv.trigger("highlight-start");if(this.text_display){this.popup_box.style("width","100%");this.text_container.html(e);const t=this.text_container.node().offsetWidth+20;const n=this.sv.menu.visible()?this.sv.menu.height()+5:15;this.popup_box.style("visibility","visible").style("top",n+"px").style("width",t+"px")}};e.prototype.default_text=function(){let t="";if(this.element_type=="peak"){t="Peak: "+this.highlighted_element.center.toFixed(3)+" ppm"}else if(this.element_type=="cluster"){t="Cluster: "+this.highlighted_element.center().toFixed(3)+" ppm"}else if(this.element_type=="compound"){t=this.highlighted_element.name}else if(this.element_type=="spectrum"){t=this.highlighted_element.name}return t};e.prototype.parsed_text=function(){const t=this.highlighted_element;const e=function(e,n,i){let r;if(n=="p"){r=t[i]}else if(n=="f"){r=t[i]()}else if(n=="m"){r=t.meta[i]}return r};return this.text_display.replace(/#\{(.):(.*?)\}/g,e)};t.SVHighlighter=e})(JSpectraViewer);(function(t){function e(t,e){const n=this;this.sv=t;this.id=e;this.speed=400;this.active_ids=[];this.container=d3v7.select(e);this.static_compounds;this.table=this.container.append("table").style("display","none").attr("class","jsv-cluster-navigator");this.thead=this.table.append("thead");this.tbody=this.table.append("tbody");t.on("selection-add.cluster-navigator",function(){n.table.style("display","block");n.update_table()});if(t.selection.present())t.trigger("selection-add.cluster-navigator");t.on("selection-remove.cluster-navigator",function(){n.update_table()});t.on("adjust-end.cluster-navigator",function(){n.update_table()});t.on("selection-empty.cluster-navigator",function(){if(!n.static_compounds){n.table.style("display","none")}});d3v7.select(".jsv-cluster-navigator").on("click",function(t){const e=d3v7.select(t.target);window.getSelection().removeAllRanges();if(e.classed("cluster-unit")){n.move_to_cluster(e.node())}
730else if(e.classed("jsv-cluster-nav")){n.cycle_clusters(e)}})}e.prototype.update_table=function(){const t=this.static_compounds||this.sv.selection.compounds();this.tbody.html(n(t));if(this.active_ids.length>0){d3v7.selectAll(this.active_ids.join(",")).classed("active",true)}this.sv.trigger("cluster-navigator-updated")};const n=function(t){return t.map(function(t){return i(t)}).join("")};const i=function(t){html="<tr>";if(t.name!==undefined){html+="<td>"+t.name+"</td>"}if(t.concentration!==undefined){html+="<td>"+t.display_concentration()+"</td>"}html+="<td>"+r(t.clusters())+"</td></tr>";return html};const r=function(t){t.order_by("center",true);const e="<span class='jsv-cluster-nav jsv-cluster-nav-left'>&#10094;</span>&nbsp;<span class='jsv-cluster-nav jsv-cluster-nav-right'>&#10095;</span>";return e+t.map(function(t){return s(t)}).join("")};const s=function(t){return'<div class="cluster-unit" style="display: inline-block" id="'+t.path_id()+'">'+t.center().toFixed(2)+"</div>"};e.prototype.cycle_clusters=function(t){const e=t.classed("jsv-cluster-nav-right");const n=d3v7.select(t.node().parentNode);const i=n.select(".active");const r=n.selectAll(".cluster-unit")[0].map(function(t){return t.id});let s=i.node()?r.indexOf(i.node().id):-1;if(s<0){s=0}else if(e){s=s+1<r.length?s+1:0}else{s=s-1<0?r.length-1:s-1}const o=n.select("#"+r[s]);this.move_to_cluster(o.node())};e.prototype.move_to_cluster=function(t){const e=sv.clusters(t.id);sv.move_to_peaks(e.peaks(),this.speed,2);d3v7.select(t.parentNode).selectAll(".cluster-unit").classed("active",false);d3v7.select(t).classed("active",true);this.active_ids=d3v7.selectAll(".cluster-unit.active")[0].map(function(t){return"#"+t.id});sv.selection.clear();sv.selection.add_element(e)};e.prototype.detach=function(){this.sv.off(".cluster-navigator");this.table.remove()};Object.defineProperties(e.prototype,{static_compounds:{get:function(){return this._static_compounds},set:function(t){this._static_compounds=t;this.table.style("display","block");this.update_table()}}});t.SVClusterNavigator=e})(JSpectraViewer);(function(t){const e=function(t,e){const n=t.sv_wrapper.select("#jsv-save-height").property("value");const i=t.sv_wrapper.select("#jsv-save-width").property("value");const r=t.image(i,n);const s="JSV-Image-"+i+"x"+n;const o=window.open(r,s);e.close();setTimeout(function(){o.document.title=s},100)};const n=function(t){return""+'<div class="jsv-alert">Display the viewer image in a new window to download or print. Note that you must allow pop-ups!</div>'+'<div><label class="jsv-label">Width</label><div class="jsv-input-group">'+'<input class="jsv-input" id="jsv-save-width" type="text" value="'+t.width+'" /><div class="jsv-input-addon">px</div></div></div>'+'<div><label class="jsv-label">Height</label><div class="jsv-input-group">'+'<input class="jsv-input" id="jsv-save-height" type="text" value="'+t.height+'" /><div class="jsv-input-addon">px</div></div></div>'};const i=d3v7.line().x(function(t){return t.x}).y(function(t){return t.y}).curve(d3v7.curveLinear);const r=function(t,e,n,i,r,s){const o=t.append("g").attr("class","jsv-menu-button");o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r).attr("rx",2).attr("ry",2).style("stroke-width",1);const a=s.remove();o.append("g").attr("class","jsv-button-image").append(function(){return a.node()});o.attr("transform","translate("+e+".5,"+n+".5)");return o};const s=function(t){const e=t.append("g");const n=3;e.append("line").attr("x1",10).attr("y1",0).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",6).attr("y1",7).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",14).attr("y1",7).attr("x2",10).attr("y2",12).attr("stroke-linecap","round").attr("stroke-width",n);e.append("line").attr("x1",2).attr("y1",16).attr("x2",18).attr("y2",16).attr("stroke-linecap","round").attr("stroke-width",n);return e};const o=function(t){const e=t.append("g");const n=4;e.append("circle").attr("cx",10).attr("cy",10).attr("r",7).style("fill","rgb(75, 75, 75");e.append("line").attr("x1",10).attr("y1",1).attr("x2",10).attr("y2",19).attr("stroke-width",n);e.append("line").attr("x1",1).attr("y1",10).attr("x2",19).attr("y2",10).attr("stroke-width",n);e.append("line").attr("x1",3.5).attr("y1",3.5).attr("x2",16.5).attr("y2",16.5).attr("stroke-width",n);e.append("line").attr("x1",16.5).attr("y1",3.5).attr("x2",3.5).attr("y2",16.5).attr("stroke-width",n);e.append("circle").attr("cx",10).attr("cy",10).attr("r",3).style("fill","white");return e};const a=function(t,e,n,i,r,s){const o=t.append("g");const a=1;const l=2;const c=n+l;const u=n+r-l;const h=2;const f=e+i/2;o.append("line").attr("x1",e).attr("y1",n).attr("x2",e+i).attr("y2",n).attr("stroke-width",a);o.append("line").attr("x1",e).attr("y1",n+r).attr("x2",e+i).attr("y2",n+r).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f).attr("y2",u).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f-h).attr("y2",c+h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",c).attr("x2",f+h).attr("y2",c+h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",u).attr("x2",f-h).attr("y2",u-h).attr("stroke-width",a);o.append("line").attr("x1",f).attr("y1",u).attr("x2",f+h).attr("y2",u-h).attr("stroke-width",a);o.attr("stroke","rgb(150, 150, 150)").attr("transform","rotate("+s+","+e+","+n+")");return o};const l=function(t){return t.append("line").attr("x1",3).attr("y1",8).attr("x2",13).attr("y2",8).attr("stroke-width",3).attr("stroke","black")};const c=function(t){const e=t.append("g");e.append("line").attr("x1",3).attr("y1",8).attr("x2",13).attr("y2",8).attr("stroke-width",3).attr("stroke","black");e.append("line").attr("x1",8).attr("y1",3).attr("x2",8).attr("y2",13).attr("stroke-width",3).attr("stroke","black");return e};const u=function(t,e){return t.append("path").attr("d",i(e)).attr("stroke","black").attr("stroke-width",3).attr("fill","none")};const h=function(t,e,n,i){return setInterval(function(){t.translate_axis(e,n);t.fast_draw()},i)};function f(t){const e=this;this.sv=t;this.slide_time=500;this._visible=true;this.menu=t.sv_wrapper.append("div").style("visibility","hidden").attr("class","jsv-menu").on("click",function(){window.getSelection().removeAllRanges()});this.menu_svg=this.menu.append("svg").attr("width",this.width()).attr("height",this.height());
730this.handle=t.sv_wrapper.append("div").attr("class","jsv-menu-handle").on("click",function(){if(e.opened()){e.close()}else{e.open()}}).on("mouseover",function(){e.handle_mouseover()}).on("mouseout",function(){e.handle_mouseout()});const n=40;const i=12;this.handle_svg=this.handle.append("svg").attr("width",n).attr("height",i);this.stroke_width=4;this.handle_data_closed=[{x:0,y:0},{x:n/2,y:i-this.stroke_width},{x:n,y:0}];this.handle_data_opened=[{x:0,y:i},{x:n/2,y:this.stroke_width},{x:n,y:i}];this.draw();t.trigger("domain-change.menu");this.close(0)}f.prototype.visible=function(t){if(arguments.length==0)return this._visible;if(t){this._visible=true;this.handle.style("visibility","visible");this.menu.style("visibility","visible")}else{this._visible=false;this.handle.style("visibility","hidden");this.menu.style("visibility","hidden")}};f.prototype.opened=function(){return this.menu.style("visibility")=="visible"};f.prototype.width=function(){return 300};f.prototype.height=function(){return 41};f.prototype.open=function(e){e=t.default_for(e,this.slide_time);this.menu.style("visibility","visible");this.menu.transition().duration(e).style("top","0px").style("opacity",1);this.handle_path.transition().duration(e).attr("d",i(this.handle_data_opened))};f.prototype.close=function(e){e=t.default_for(e,this.slide_time);this.menu.transition().duration(e).style("top","-50px").style("opacity",0).on("end",function(){d3v7.select(this).style("visibility","hidden")});this.handle_path.transition().duration(e).attr("d",i(this.handle_data_closed))};f.prototype.handle_mouseover=function(){this.handle_path.transition().duration(200).attr("stroke","black")};f.prototype.handle_mouseout=function(){this.handle_path.transition().duration(200).attr("stroke","grey")};f.prototype.draw=function(){const f=this.sv;const p=this;let m;let g=5;let _=4;this.handle_path=this.handle_svg.append("path").attr("d",i(this.handle_data_closed)).attr("stroke","grey").attr("stroke-width",this.stroke_width).attr("fill","none");if(this.sv.constructor.name==="SpectraViewer"){const t=[{x:11,y:4},{x:4,y:15},{x:11,y:26}];const e=[{x:4,y:4},{x:11,y:15},{x:4,y:26}];const n=u(this.menu_svg,t);const i=u(this.menu_svg,e);this.nav_group=this.menu_svg.append("g");this.scroll_left_button=r(this.nav_group,0,0,15,30,n);this.scroll_right_button=r(this.nav_group,17,0,15,30,i);this.nav_group.attr("transform","translate("+7+","+4+")");this.scroll_left_button.on("mousedown",function(){if(d3v7.select(this).classed("disabled"))return;m=h(f,"x",g,_);return false});this.scroll_right_button.on("mousedown",function(){if(d3v7.select(this).classed("disabled"))return;m=h(f,"x",-g,_);return false});$(document).mouseup(function(){if(m){clearInterval(m);f.full_draw()}})}else{this.reset_zoom_button=r(this.menu_svg,10,4,30,30,d(this.menu_svg));this.reset_zoom_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=[[-10,500],[-10,500]];f.move_to(t,1e3)})}this.zoom_group=this.menu_svg.append("g");this.zoom_y_minus_button=r(this.zoom_group,6,18,16,16,l(this.menu_svg));this.zoom_y_plus_button=r(this.zoom_group,6,0,16,16,c(this.menu_svg));this.zoom_x_minus_button=r(this.zoom_group,25,9,16,16,l(this.menu_svg));this.zoom_x_plus_button=r(this.zoom_group,43,9,16,16,c(this.menu_svg));a(this.zoom_group,0,.5,5,34,0);a(this.zoom_group,25.5,32,5,34,-90);this.zoom_group.attr("transform","translate("+55+","+2+")");this.zoom_x_minus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.x.diff()/2;const e=[[f.scale.x.min()-t,f.scale.x.max()+t],f.scale.y.domain()];f.move_to(e)});this.zoom_x_plus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.x.diff()/4;const e=[[f.scale.x.min()+t,f.scale.x.max()-t],f.scale.y.domain()];f.move_to(e)});this.zoom_y_minus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.y.diff()/2;const e=[f.scale.x.domain(),[f.scale.y.min()-t,f.scale.y.max()+t]];f.move_to(e)});this.zoom_y_plus_button.on("click",function(){if(d3v7.select(this).classed("disabled"))return;const t=f.scale.y.diff()/4;const e=[f.scale.x.domain(),[f.scale.y.min()+t,f.scale.y.max()-t]];f.move_to(e)});f.on("domain-change.menu",function(){if(f.zoom_x==1){p.zoom_x_minus_button.classed("disabled",true)}else if(f.zoom_x>=f.zoom_max){p.zoom_x_plus_button.classed("disabled",true)}
730else{p.zoom_x_minus_button.classed("disabled",false);p.zoom_x_plus_button.classed("disabled",false)}if(f.zoom_y==1){p.zoom_y_minus_button.classed("disabled",true)}else if(f.zoom_y>=f.zoom_max){p.zoom_y_plus_button.classed("disabled",true)}else{p.zoom_y_minus_button.classed("disabled",false);p.zoom_y_plus_button.classed("disabled",false)}if(f.constructor.name==="SpectraViewer"){if(f.scale.x.min()==f.boundary.x.min()){p.scroll_right_button.classed("disabled",true)}else{p.scroll_right_button.classed("disabled",false)}if(f.scale.x.max()==f.boundary.x.max()){p.scroll_left_button.classed("disabled",true)}else{p.scroll_left_button.classed("disabled",false)}}else if(f.zoom_y===1&&f.zoom_x===1){p.reset_zoom_button.classed("disabled",true)}else{p.reset_zoom_button.classed("disabled",false)}});const v=this.menu_svg.append("text").attr("x",15).attr("y",24).attr("font-family","sans-serif").attr("font-size","26px").attr("stroke-width",1).attr("fill","black").attr("class","jsv-button-text").style("text-anchor","middle").text("?");this.help_button=r(this.menu_svg,260,4,30,30,v);this.help_button.on("click",function(){f.help.dialog.open()});const y=s(this.menu_svg).attr("transform","translate(5,7)");this.download_button=r(this.menu_svg,220,4,30,30,y);this.download_dialog=new t.SVDialog(f,{header_text:"Save Image",content_text:n(f),buttons:{Cancel:function(){this.close()},Generate:function(){e(f,this)}},width:400,height:250});this.download_button.on("click",function(){p.download_dialog.open()});const b=o(this.menu_svg).attr("transform","translate(5,5)");this.settings_button=r(this.menu_svg,180,4,30,30,b);this.settings_button.on("click",function(){f.settings.open()});const x=this.menu_svg.append("text").attr("x",149).attr("y",32).attr("font-family","sans-serif").attr("font-size","16px").attr("stroke-width",1).attr("fill","grey").attr("class","jsv-button-text").style("text-anchor","middle").text("JSV")};let d=function(t){let e=t.append("g");e.append("circle").attr("cx",13).attr("cy",12).attr("r",9).style("fill","grey");e.append("circle").attr("cx",13).attr("cy",12).attr("r",7).style("fill","white");e.append("line").attr("x1",17).attr("y1",17).attr("x2",25).attr("y2",25).attr("stroke-width",3).attr("stroke","black");e.append("line").attr("x1",9).attr("y1",12).attr("x2",17).attr("y2",12).attr("stroke-width",3).attr("stroke","black");return e};t.SVMenu=f})(JSpectraViewer);(function(t){function e(e){this.sv=e;const r=e.toString()==="SpectraViewer"?n:i;this.dialog=new t.SVDialog(e,{header_text:"JSpectraViewer (JSV) Help",content_text:r,width:700,height:350})}let n=""+"The view of the spectra can be scrolled around or scaled using the controls in the menu or by using the various mouse and keyboard shortcuts:"+"<h3>Viewer Controls</h3>"+'<table class="jsv-table">'+"<thead><tr><th>Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Zoom In/Out X Axis</td><td>Scroll wheel</td></tr>"+"<tr><td>Zoom In/Out Y Axis</td><td>Option/Alt Key + Scroll wheel</td></tr>"+"<tr><td>Zoom In on Area</td><td>Option/Alt Key + Click and Drag around area</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Option/Alt Key + Click once anywhere on viewer </td></tr>"+"<tr><td>Move Around</td><td>Click and Drag</td></tr></tbody></table>"+"<h3>Zoombox Controls (box in upper left corner)</h3>"+'<table class="jsv-table">'+"<thead><tr><th>Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Move Around</td><td>Click and Drag grey selection box</td></tr>"+"<tr><td>Zoom In on Area</td><td>Click on unselected region and drag around new selection</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Click once anywhere in unselected region</td></tr>"+"<tr><td>Alter Zoomed Area</td><td>Click and Drag on sides of grey selection box</td></tr></tbody></table>"+"<h3>Troubleshooting</h3>"+"<p>If the viewer is not showing any spectra or is slow, try updating to the latest version of your "+'browser. We have found that <a href="https://www.google.com/chrome" target="_blank">Google Chrome</a> is the fastest.</p></div></div>';let i=""+"The view of the spectra can be scaled using the controls in the menu or by using the various mouse and keyboard shortcuts:"+"<h3>Viewer Controls</h3>"+'<table class="jsv-table">'+"<thead><tr><th>
730Action</th><th>Command</th></tr></thead><tbody>"+"<tr><td>Adjust Peak Sensitivity</td><td>Scroll wheel</td></tr>"+"<tr><td>Zoom In on Area</td><td>Click and Drag around area</td></tr>"+"<tr><td>Zoom Out Completely</td><td>Double click inside viewer</td></tr>"+"<h3>Troubleshooting</h3>"+"<p>If the viewer is not showing any spectra or is slow, try updating to the latest version of your "+'browser. We have found that <a href="https://www.google.com/chrome" target="_blank">Google Chrome</a> is the fastest.</p></div></div>';t.SVHelp=e})(JSpectraViewer);(function(t){function e(e,n){n=n||{};const i=this;this.wrapper=e.sv_wrapper.node();this.fade_time=t.default_for(n.fade_time,500);this.header_text=t.default_for(n.header_text,"");this.content_text=t.default_for(n.content_text,"");this.height=t.default_for(n.height,300);this.width=t.default_for(n.width,300);this.buttons=n.buttons;this.box=d3v7.select(this.wrapper).append("div").style("display","none").attr("class","jsv-dialog");this.header=this.box.append("div").attr("class","jsv-dialog-header").html(this.header_text);this.dismiss=this.box.append("div").attr("class","jsv-dialog-dismiss").html("X").on("click",function(){i.close()});this.contents=this.box.append("div").attr("class","jsv-dialog-contents jsv-scroll");if(this.buttons){this.footer=this.box.append("div").attr("class","jsv-dialog-footer");this.generate_buttons()}this.contents.html(this.content_text);this.adjust_size();return i}e.prototype.visible=function(){return this.box.style("display")!="none"};e.prototype.open=function(){this.adjust_size();this.box.style("display","block");this.box.transition().duration(this.fade_time).style("opacity",1);return this};e.prototype.close=function(){this.box.transition().duration(this.fade_time).style("opacity",0).on("end",function(){d3v7.select(this).style("display","none")});return this};e.prototype.generate_buttons=function(){const t=this;const e=Object.keys(this.buttons);e.forEach(function(e){t.footer.append("button").html(e).attr("class","jsv-button").on("click",function(){t.buttons[e].call(t)})})};e.prototype.adjust_size=function(){const t=50;const e=this.wrapper.offsetWidth;const n=this.wrapper.offsetHeight;let i=this.width;let r=this.height;if(this.height>n-t)r=n-t;if(this.width>e-t)i=e-t;const s=40;const o=this.buttons?35:0;const a=r-s-o;this.box.style("width",i+"px").style("height",r+"px");this.contents.style("height",a+"px")};t.SVDialog=e})(JSpectraViewer);(function(t){function e(e,n){n=n||{};const i=this;this.sv=e;this.object=t.default_for(n.object,e);this.title=t.default_for(n.title,"Settings");this.height=t.default_for(n.height,400);this.width=t.default_for(n.width,400);n.settings=n.settings||[];this.settings=[];n.settings.forEach(function(t){
731i.settings.push(new r(i.object,t))});this.dialog=new t.SVDialog(e,{header_text:this.title,content_text:this.settings_html(),buttons:{Done:function(){this.close()}},width:this.width,height:this.height});return this}e.prototype.open=function(){const t=this;this.dialog.contents.html(this.settings_html());d3v7.selectAll(".jsv-setting").on("change",function(){const e=d3v7.select(this);const n=t.find(e.attr("id"));const i=e.property("checked");n.value(i);t.sv.full_draw()});this.dialog.open();return this};e.prototype.close=function(){this.dialog.close();return this};e.prototype.find=function(t){return this.settings.filter(function(e){return e.id()==t})[0]};e.prototype.settings_html=function(){html='<div class="jsv-settings">';this.settings.forEach(function(t){html+='<div><label class="jsv-label">'+t.label+"</label>";html+='<div class="jsv-input-group">';if(t.type=="boolean"){html+=n(t)}html+="</div></div>"});html+="</div>";return html};const n=function(t){html="";html+='<input type="checkbox" class="jsv-input jsv-setting" id="'+t.id()+'"';if(t.value()){html+=' checked="true" '}html+=" />";return html};let i=0;function r(e,n){n=n||{};this.object=e;this.label=n.label;this.property=n.property;this.type=t.default_for(n.type,"boolean");this.id()}r.prototype.id=function(){const t=s();this.id=function(){return t};return t};const s=function(){return"jsv-setting-id-"+i++};r.prototype.value=function(t){if(arguments.length==0){if(typeof this.property==="function"){t=this.property.call(this.object)}else{t=this.object[this.property]}}else{if(typeof this.property==="function"){this.property.call(this.object,t)}else{this.object[this.property]=t}self.sv.full_draw()}return t};t.SVSettings=e})(JSpectraViewer);(function(t){function e(e){t.pixel(10);this.sv=e;let n=e.zoombox_size||10;this.width=e.width*n/100;this.height=e.height*n/100;this.adjusting=false;this.svg=e.sv_wrapper.append("svg").attr("width",this.width+1).attr("height",this.height+1).style("position","absolute").style("top",0).style("left",e.width-this.width-1);if(e.axis_x_reverse){this.svg.style("left",0)}this.border=this.svg.append("rect").attr("x",0).attr("y",0).attr("width",this.width).attr("height",this.height).attr("fill","white").attr("stroke","#BBB");this.scale=new t.SVScale;this.scale.y.range([this.height,0]);let i=this.sv.axis_x_reverse?[this.width,0]:[0,this.width];this.scale.x.range(i);this.initialize_brushing();this.spectra_function=d3v7.line().x(t=>this.scale.x(t.x)).y(t=>this.scale.y(t.y))}Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t;if(this._visible){this.svg.style("display","block")}else{this.svg.style("display","none")}this.sv.legend.update();this.sv.draw()}});e.prototype.initialize_brushing=function(){const e=this;const n=e.sv;e.brush=d3v7.brush().extent([[e.scale.x.range()[1],e.scale.y.range()[1]],[e.scale.x.range()[0],e.scale.y.range()[0]]]).on("start",i).on("brush",r).on("end",s);e.select_brush=e.svg.append("g").attr("class","active-brush").call(e.brush);function i(t){if(t.sourceEvent)t.sourceEvent.preventDefault()}function r(i){if(!(i.selection===null)&&!e.adjusting){let t;if(n.axis_y_lock!==false){const n=i.selection;const r=n[0][0];const s=n[1][0];const o=e.scale.y.domain()[0];const a=e.scale.y.invert(d3v7.pointer(i,e.svg.node())[1]);const l=e.scale.y.domain()[1];let c=Math.min(a,l);c=Math.max(o,c);t=[[e.scale.x.invert(s),0],[e.scale.x.invert(r),c]]}if(!t)t=[[e.scale.x.invert(i.selection[1][0]),e.scale.y.invert(i.selection[1][1])],[e.scale.x.invert(i.selection[0][0]),e.scale.y.invert(i.selection[0][1])]];n.set_domain_to_brush_extent(t,false);n.fast_draw()}if(n.debug){n.debug_data.zbox["X1"]=t.round(e.brush.extent()[0][0]);n.debug_data.zbox["Y1"]=t.round(e.brush.extent()[0][1]);n.debug_data.zbox["X2"]=t.round(e.brush.extent()[1][0]);n.debug_data.zbox["Y2"]=t.round(e.brush.extent()[1][1])}}function s(t){if(!e.adjusting){n.zoom_axis="";n.draw()}}};e.prototype.add_spectrum=function(t){const e=this.sv.boundary;this.scale.x.domain(e.x.domain());this.scale.y.domain(e.y.domain());this.svg.append("path").attr("id",t.id).attr("d",this.spectra_function(t.simple_xy_data.asArray())).attr("stroke",t.color).attr("stroke-width",.5).attr("fill","none");this.set_zoom_area(e)};e.prototype.remove_spectra=function(t){this.sv.container.select("path#"+t).remove()};e.prototype.update=function(){const t=this;const e=this.sv;if(e.axis_x_reverse){this.svg.style("left",0)}else{this.svg.style("left",e.width-this.width-1)}
731this.sv.all_spectra().forEach(function(e){t.remove_spectra(e.id);if(e.active){t.add_spectrum(e)}})};e.prototype.set_zoom_area=function(t){let e=this;const n=e.scale.x(t.x.domain()[1]);const i=e.scale.x(t.x.domain()[0]);const r=e.scale.y(t.y.domain()[1]);const s=e.scale.y(t.y.domain()[0]);e.adjusting=true;e.select_brush.call(e.brush.move,[[n,r],[i,s]]);e.adjusting=false};t.ZoomBox=e})(JSpectraViewer);(function(t){t.default_for=function(t,e){return t===undefined?e:t};t.pixel_ratio=1;t.pixel=function(e){return e*t.pixel_ratio};t.get_pixel_ratio=function(t){const e=t.getContext("2d");const n=window.devicePixelRatio||1;const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/i};t.scale_resolution=function(t,e){const n=t.getContext("2d");if(e!=1){const n=t.width;const i=t.height;t.width=n*e;t.height=i*e;t.style.width=n+"px";t.style.height=i+"px"}};Function.prototype.inherits=function(t){this.prototype=Object.create(t.prototype)};t.merge=function(){const t={};let e,n,i;let r=0;const s=arguments.length;for(;r<s;r++){e=arguments[r];if(typeof e==="object"){n=Object.keys(e);let r=0;const s=n.length;for(;r<s;r++){i=n[r];t[i]=e[i]}}}return t};t.unique_id=function(t,e,n){let i;do{i=t+e;e++}while(n.indexOf(i)>-1);return i};t.round=function(t,e=2){return d3v7.round(t,e)};t.elapsed_time=function(t){const e=(new Date).getTime()-t;return e+" ms"};t.index_of_value=function(t,e,n){let i=0;let r=t.length-1;let s,o;if(t[i]>=e)return i;if(t[r]<=e)return r;while(r-i>1){s=(i+r)/2|0;o=t[s];if(o<e){i=s}else if(o>e){r=s}else{return s}}return n?r:i};t.lorentzian=function(t,e,n,i){const r=n*n;const s=t-e;return i*r/(r+4*s*s)};t.sum_of_peaks=function(e,n){let i=0;let r;for(let s=0;s<n.length;s++){r=n[s];i+=t.lorentzian(e,r.center,r.width,r.amplitude)}return i};t.xy_from_peaks=function(e,n,i,r,s){if(s)e=t.peaks_in_range(e,i,r,6);const o=t.peaks_in_range(e,i,r);const a=o.order_by("center").map(function(t){return t.center});let l=i;const c=r;const u=[],h=[];const f=(r-i)/n;while(l<c){u.push(l);h.push(t.sum_of_peaks(l,e));if(a[0]&&a[0]<=l+f){l=a.shift()}else{l+=f}}u.push(r);h.push(t.sum_of_peaks(r,e));return{x:u,y:h}};t.peaks_in_range=function(e,n,i,r){r=r||0;const s=new t.SVSet;e.forEach(function(e){if(t.peak_min([e],r)<i&&t.peak_max([e],r)>n){s.push(e)}});return s};t.peak_min=function(t,e){e=e||3;let n,i;if(t.length>0){i=t[0]}t.forEach(function(t){if(t.center<i.center){i=t}});if(i){n=i.center-e*i.width}return n};t.peak_max=function(t,e){e=e||3;let n,i;if(t.length>0){i=t[0]}t.forEach(function(t){if(t.center>i.center){i=t}});if(i){n=i.center+e*i.width}return n};t.number=function(t){if(t===undefined)return;return Number(t)};t.isNumeric=function(t){return isFinite(t)&&parseFloat(t)==t};t.decimalPlaces=function(t){const e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!e){return 0}return Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0))};t.colors=function(t,e,n,i,r,s,o,a,l,c){const u=[];if(t==undefined)t=50;if(e==undefined)e=200;if(n==undefined)n=30;if(i==undefined)i=1;if(r==undefined)r=2.4;if(s==undefined)s=2.4;if(o==undefined)o=2.4;if(a==undefined)a=0;if(l==undefined)l=2;if(c==undefined)c=4;for(let h=0;h<t;++h){const t=Math.round(Math.sin(r*h+a)*n+e);const f=Math.round(Math.sin(s*h+l)*n+e);const d=Math.round(Math.sin(o*h+c)*n+e);u.push("rgba("+t+","+f+","+d+","+i+")")}return u};t.test_colors=function(t){t.forEach(function(t){document.write('
731<font style="color:'+t+'">&#9608;</font>')});document.write("<br/>")};t.convert_base64_to_float64=function(t,e){if(typeof e==="undefined"){e=false}const n=atob(t);let i=new Int8Array(n.length);if(e){i=new Zlib.Deflate(i)}for(let t=0;t<n.length;t++){i[t]=n.charCodeAt(t)}const r=new Float64Array(i.buffer);return r};t.convert_bayesil_data=function(e){const n={id:t.default_for(e.id,"Fit"),name:t.default_for(e.name,"Fit"),compounds:[],display:t.merge({color:"blue"},e.display),meta:{dss_concentration:e.dss_conc}};e.metabolites.forEach(function(e){const i={concentration:e.concentration,original_concentration:e.concentration,concentration_units:"\u03bcM",id:e.id,name:e.name,clusters:[],display:{visible:false},meta:{dss_ratio:t.default_for(t.number(e.dss_ratio),1),threshold:e.threshold,score:e.score}};i.meta.amplitude_coefficient=i.concentration/i.meta.dss_ratio/n.meta.dss_concentration;e.clusters.forEach(function(e){const n={peaks:[],meta:{shift:e.shift}};e.shift=t.default_for(e.shift,0);n.upper_bound=e.upper_bound;n.lower_bound=e.lower_bound;n.meta.lower_bound_diff=e.lower_bound_diff;n.meta.upper_bound_diff=e.upper_bound_diff;e.peaks.forEach(function(t){const r={center:Number(t.center)+Number(e.shift),width:Number(t.width),original_amplitude:Number(t.amplitude),amplitude:Number(t.amplitude)*Number(i.meta.amplitude_coefficient),meta:{initial_width:t.initial_width}};n.peaks.push(r)});i.clusters.push(n)});n.compounds.push(i)});return n};t.create_bayesil_json=function(t,e){t=t||{xy_data:{x:[],y:[]}};const n={dss_conc:e.meta.dss_concentration,metabolites:[],meta:t.meta};e.compounds().forEach(function(t){const i={name:t.name,id:t.id,concentration:t.concentration,dss_ratio:t.meta.dss_ratio,score:t.meta.score,threshold:t.meta.threshold,clusters:[]};t.meta.amplitude_coefficient=t.concentration/t.meta.dss_ratio/e.meta.dss_concentration;t.clusters().forEach(function(e){const n={center:e.center(),initial_center:e.meta.initial_center,shift:e.center(),lower_bound:e.lower_bound,upper_bound:e.upper_bound,peaks:[]};e.peaks().forEach(function(i){let r;if(t.original_concentration==0){r=i.original_amplitude}else{r=i.amplitude/t.meta.amplitude_coefficient}const s={amplitude:r,center:i.center-e.center(),width:i.width,initial_width:i.meta.initial_width};if(isNaN(s.amplitude))s.amplitude=0;n.peaks.push(s)});i.clusters.push(n)});n.metabolites.push(i)});n.spectrum_xy={x:t.xy_data.x,y:t.xy_data.y};return n};if(!Number.isInteger){Number.isInteger=function t(e){return typeof e==="number"&&isFinite(e)&&e>-9007199254740992&&e<9007199254740992&&Math.floor(e)===e}}})(JSpectraViewer);(function(t){let e=[];function n(t,n){const i=e.x[t]-e.x[n],r=e.y[t]-e.y[n];return i*i+r*r}function i(t,n,i){let r=e.x[n],s=e.y[n],o=e.x[i]-r,a=e.y[i]-s;if(o!==0||a!==0){const n=((e.x[t]-r)*o+(e.y[t]-s)*a)/(o*o+a*a);if(n>1){r=e.x[i];s=e.y[i]}else if(n>0){r+=o*n;s+=a*n}}o=e.x[t]-r;a=e.y[t]-s;return o*o+a*a}function r(t,e){let i=t[0];const r=[i];let s;let o=1;const a=t.length;for(;o<a;o++){s=t[o];if(n(s,i)>e){r.push(s);i=s}}if(i!==s)r.push(s);return r}function s(t,e){const n=t.length,r=typeof Uint8Array!=="undefined"?Uint8Array:Array,s=new r(n);let o=0,a=n-1;const l=[],c=[];let u,h,f,d;s[o]=s[a]=1;while(a){h=0;for(u=o+1;u<a;u++){f=i(t[u],t[o],t[a]);if(f>h){d=u;h=f}}if(h>e){s[d]=1;l.push(o,d,d,a)}a=l.pop();o=l.pop()}for(u=0;u<n;u++){if(s[u])c.push(t[u])}return c}
732/**
733     * Simplify.js is a high-performance JS polyline simplification library by Vladimir Agafonkin.
734     * [Orignal Project](http://mourner.github.io/simplify-js)
735     *
736     * It has been adapted here to work with a different point format.
737     * The format used in JSV is an object of arrays:
738     * ```js
739     * points = { x: [1, 2, 3], y: [10, 20, 30] };
740     * ```
741     * There can also be an optional yi array, to hold the imaginary component of
742     * the line. This is used when incorporating phasing into the viewer.
743     *
744     * The orginal format was an array of points:
745     * ```js
746     * // Do not use this format
747     * points = [ {x:1, y:10}, {x:2, y:20}, {x:3, y:30} ];
748     * ```
749     * ***
750     * Copyright (c) 2012, Vladimir Agafonkin
751     * All rights reserved.
752     *
753     * Redistribution and use in source and binary forms, with or without modification, are
754     * permitted provided that the following conditions are met:
755     *
756     *   1. Redistributions of source code must retain the above copyright notice, this list of
757     *      conditions and the following disclaimer.
758     *
759     *   2. Redistributions in binary form must reproduce the above copyright notice, this list
760     *      of conditions and the following disclaimer in the documentation and/or other materials
761     *      provided with the distribution.
762     *
763     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
764     * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
765     * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
766     * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
767     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
768     * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
769     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
770     * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
771     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)
772     *
773     * @param {Object} points An object containing an x and y array of points. There may also be an yi array.
774     * @param {Number} tolerance Affects the amount of simplification. [Default: 1]
775     * @param {Boolean} highestQuality Excludes distance-based preprocessing step which leads to highest quality simplification but runs ~10-20 times slower. [Default: false]
776     */function o(t,n,i){const o=t.x.length;if(o<=1)return t;e=t;let a=new Array(o);for(let t=0;t<o;t++){a[t]=t}const l=n!==undefined?n*n:1;a=i?a:r(a,l);a=s(a,l);const c=new Array(a.length);const u=new Array(a.length);for(let t=0,n=a.length;t<n;t++){c[t]=e.x[a[t]];u[t]=e.y[a[t]]}let h;if(e.yi){h=new Array(a.length);for(let t=0,n=a.length;t<n;t++){h[t]=e.yi[a[t]]}}t={x:c,y:u};if(h){t.yi=h}return t}t.simplify=o})(JSpectraViewer);(function(t){function e(e){this.container_id=e.container_id;this.width=e.width||200,this.height=e.height||200,this.container=d3v7.select(this.container_id);this.container.classed("js-structure",true);this.data=e.data;this.format=e.format||"mol";this.x_scale;this.y_scale;this.avgL=0;this.show_hydrogen=t.default_for(e.show_hydrogen,false);this.show_atom_numbers=t.default_for(e.show_atom_numbers,false);this.use_jsmol=t.default_for(e.use_jsmol,false);this.nmr_nucleus=e.nmr_nucleus;this.interactive_1H=true;this._atoms=new t.SVSet;this._bonds=new t.SVSet;if(this.data){this.read_data(this.data,this.format)}this.handlers=new t.SVEvents;this.on=this.handlers.on;this.off=this.handlers.off;this.trigger=this.handlers.trigger}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.initSVG=function(){const t=this;const e=t.container;const n=d3v7.extent(t.atoms(),function(t){return t.x});const i=d3v7.extent(t.atoms(),function(t){return t.y});const r=[15,15,20,15];t.margins=r;let s=t.width-r[1]-r[3];let o=t.height-r[0]-r[2];const a=s/o;t.structure_ratio=(n[1]-n[0])/(i[1]-i[0]);const l=a>=t.structure_ratio?"height":"width";if(l=="height"){s=o*t.structure_ratio}else{o=s/t.structure_ratio}t.wp=s;t.hp=o;t.x_scale=d3v7.scaleLinear().domain([n[0],n[1]]).range([r[1],s-r[3]]);t.y_scale=d3v7.scaleLinear().domain([i[0],i[1]]).range([o-r[2],r[0]]);e.style({height:t.height+"px",width:t.width+"px"});t.add_menu_bar();if(!this.use_jsmol)t.add_resizer();e.select("div.js-graph-div").remove();let c=null;if(!this.use_jsmol){t.graph_div=e.append("div").attr("class","js-graph-div").style({width:s+"px",height:o+"px",margin:"0 auto","margin-top":(t.height-o-r[0])/2+"px"});c=t.graph_div.append("svg:svg").attr("width","100%").attr("height","100%").append("svg:g")}return c};e.prototype.add_menu_bar=function(){const t=this;t.container.select("div.menubar").remove();const e=t.container.insert("div",":first-child").attr("class","menubar");t.button_toggle_H=e.append("div").attr("class","toggle-hydrogens menu-button button-on").style("width","60px").text("Show H").on("click",function(){t.toggleH();d3v7.event.stopPropagation()});t.button_toggle_numbers=e.append("div").attr("class","toggle-atom-ids menu-button button-on").text("Show #").style("width","60px").style("padding-bottom","50px").on("click",function(){t.toggleAtomNumbers();d3v7.event.stopPropagation()});t.menu_buttons_width=t.button_toggle_numbers.offsetWidth+t.button_toggle_numbers.offsetWidth;t.menu_title=e.append("div").attr("class","structure-title").style("width",t.menu_buttons_width+"px").text(t.title)};e.prototype.add_resizer=function(){const t=this;const e=t.margins;const n=t.wp;const i=t.hp;const r=d3v7.select("body");t.resizer=t.container.append("div").attr("class","js-structure-resizer").on("mousedown.resizer",function(){let s=d3v7.event.x;let o=d3v7.event.y;d3v7.event.preventDefault();r.on("mousemove.resizer",function(){dx_mouse=d3v7.event.x-s;dy_mouse=d3v7.event.y-o;s=d3v7.event.x;o=d3v7.event.y;t.height=t.height+dy_mouse;t.width=t.width+dx_mouse;t.container.style({height:t.height+"px",width:t.width+"px"});const r=t.width/t.height;const a=r>=t.structure_ratio?"height":"width";let l;if(a=="height"){l=(t.height-e[0]-e[2])/i}else{l=(t.width-e[1]-e[3])/n}t.graph.attr("transform","scale("+l+","+l+")");const c=i*l;const u=(t.height-c-e[0])/2;t.graph_div.style({width:n*l+"px",height:i*l+"px","margin-top":u+"px"});t.menu_title.style("width",t.width-t.menu_buttons_width+"px");t.trigger("structure-resize")});r.on("mouseup.resizer",function(){r.on("mousemove.resizer",null);r.on("mouseup.resizer",null)})}).on("click.resizer",function(){d3v7.event.stopPropagation()});const s=[{x:9,y:4},{x:4,y:4},{x:4,y:9},{x:4,y:4},{x:16,y:16},{x:16,y:11},{x:16,y:16},{x:11,y:16}];const o=d3v7.svg.line().x(function(t){return t.x}).y(function(t){return t.y}).interpolate("linear");const a=t.resizer.append("svg").style({width:"100%",height:"100%"}).append("path").attr("d",o(s)).attr("stroke","grey").attr("stroke-width",1).attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("fill","none")};e.prototype.drawBonds=function(){const t=this;const e=this.graph;const i=this.x_scale;const r=this.y_scale;this.create_bond_functions();
776this.bonds().forEach(function(s){let o;let a;let l;let c;const u=s.a1;const h=s.a2;let f;const d=h.x-u.x,p=h.y-u.y,m=Math.sqrt(d*d+p*p),g=d/m*.2,_=p/m*.2;const v=u.x+g,y=u.y+_,b=h.x-g,x=h.y-_;t.avgL+=n(i(v),r(y),i(b),r(x));let w,k,S,M=[];if(s.order===1){if(s.stereo===1){const i=n(v,y,b,x);w=.1;k=w*(x-y)/i;S=w*(v-b)/i;M=[[v,y],[b+k,x+S],[b-k,x-S]];f=e.append("svg:path").style("fill","black").style("stroke-width",1).attr("d",t.wedgeBond(M))}else if(s.stereo===6){w=.2;k=w*(x-y)/m;S=w*(v-b)/m;o=b+k-v;a=x+S-y;l=b-k-v;c=x-S-y;for(let t=.05;t<=1;t+=.15){M.push([v+o*t,y+a*t],[v+l*t,y+c*t])}f=e.append("svg:path").style("fill","none").style("stroke-width",1).attr("d",t.hashBond(M)).attr("stroke","black")}else if(s.stereo===4){w=.2;k=w*(x-y)/m;S=w*(v-b)/m;o=b+k-v;a=x+S-y;l=b-k-v;c=x-S-y;for(let t=.05;t<=1;t+=.1){if(M.length%2===0){M.push([v+o*t,y+a*t])}else{M.push([v+l*t,y+c*t])}}f=e.append("svg:path").attr("d",t.wigglyBond(M)).attr("fill","none").style("stroke-width",1).attr("stroke","black")}else{M=[[v,y],[b,x]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}}else if(s.order===2){w=.1;k=w*(x-y)/m;S=w*(v-b)/m;M=[[v+k,y+S],[b+k,x+S],[v-k,y-S],[b-k,x-S]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").style("fill","none").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}else if(s.order===3){w=.15;k=w*(x-y)/m;S=w*(v-b)/m;M=[[v,y],[b,x],[v+k,y+S],[b+k,x+S],[v-k,y-S],[b-k,x-S]];f=e.append("svg:path").attr("d",t.plainBond(M)).attr("stroke-width","1").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke","black")}if(u.is("H")||h.is("H")){f.classed("bond-H",true)}});t.avgL/=this.bonds().length};e.prototype.drawAtoms=function(){const t=this.graph;const e=this.avgL;const n=this.x_scale;const i=this.y_scale;this.atoms().forEach(function(r){const s=t.append("svg:g").attr("transform","translate("+n(r.x)+","+i(r.y)+")");s.attr("class","atom");if((r.is("C")||r.is("N"))&&r.bonded_Hs().length>0){s.classed("nmr-1h",true)}if(r.is("C")){s.classed("nmr-13c",true)}if(r.is("H")){s.classed("atom-H",true);if(r.isBondedTo("C")||r.isBondedTo("N")){s.classed("nmr-1h",true)}}s.attr("data-atom-number",r.number);s.attr("data-atom-id",r.id);s.append("svg:circle").attr("r",Math.ceil(e/3)).attr("fill","white").attr("opacity","1");s.append("svg:circle").attr("r",Math.ceil(e/2)).attr("fill-opacity","0").attr("class","overlay");s.append("text").attr("dy",Math.ceil(e/4.5)).attr("text-anchor","middle").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/1.5)).attr("fill",r.color()).text(r.symbol);s.append("text").attr("dy",Math.ceil(e/2)+2).attr("text-anchor","middle").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/2.5)).attr("stroke","#FFF").attr("stroke-width","2px").attr("fill","#595").attr("paint-order","stroke").classed("atom-id",true).text(r.display_id);if(r.charge!==0){let t=r.charge;if(t<0){t=t===-1?"-":t+"-"}else{t=t===+1?"+":t+"+"}s.append("text").attr("dx",+1*Math.ceil(e/3)).attr("dy",-1*Math.ceil(e/4.5)).attr("text-anchor","left").attr("font-family","sans-serif").attr("fill",r.color()).attr("font-size",Math.ceil(e/3)).text(t)}if(r.mass!==0){s.append("text").attr("dx",-2*Math.ceil(e/3)).attr("dy",-1*Math.ceil(e/4.5)).attr("text-anchor","left").attr("font-family","sans-serif").attr("font-size",Math.ceil(e/3)).attr("fill",r.color()).text(r.mass)}})};const n=function(t,e,n,i){return Math.sqrt((n-t)*(n-t)+(i-e)*(i-e))};e.prototype.create_bond_functions=function(){const t=this.x_scale;const e=this.y_scale;this.plainBond=d3v7.svg.line().interpolate(function(t){let e=t[0][0]+","+t[0][1];for(let n=1;n<t.length;n++){if(n%2===0){e+="M"+t[n][0]+","+t[n][1]}else{e+="L"+t[n][0]+","+t[n][1]}}return e}).x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.wedgeBond=d3v7.svg.line().x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.hashBond=d3v7.svg.line().interpolate(function(t){let e=t[0][0]+","+t[0][1];for(let n=1;n<t.length;n++){if(n%2===0){e+="M"+t[n][0]+","+t[n][1]}else{e+="L"+t[n][0]+","+t[n][1]}}return e}).x(function(e){return t(e[0])}).y(function(t){return e(t[1])});this.wigglyBond=d3v7.svg.line().interpolate("cardinal").x(function(e){return t(e[0])}).y(function(t){return e(t[1])})};AtomColors={H:"#000000",He:"#FFC0CB",Li:"#B22222",B:"#00FF00",C:"#000000",N:"#8F8FFF",O:"#F00000",F:"#DAA520",Na:"#0000FF",Mg:"#228B22",Al:"#808090",Si:"#DAA520",P:"#FFA500",S:"#FFC832",Cl:"#00FF00",Ca:"#808090",Ti:"#808090",Cr:"#808090",Mn:"#808090",Fe:"#FFA500",Ni:"#A52A2A",Cu:"#A52A2A",Zn:"#A52A2A",Br:"#A52A2A",Ag:"#808090",I:"#A020F0",Ba:"#FFA500",Au:"#DAA520"};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
776n.selectAll(".atom").classed("selected",false);t.forEach(function(t){n.select('.atom[data-atom-id="'+t.id+'"]').classed("selected",true)});e.add_partially_selected_highlighting(t)}}});e.prototype.add_partially_selected_highlighting=function(e){const n=this;const i=this.container;i.selectAll(".atom").classed("selected-partially",false);if(n.nmr_1H()){const r=n.hydrogens_from_atoms(e);let s=r.map(function(t){return t.bonded_atoms(1)});s=new t.SVSet(s).unique();s.forEach(function(t){let e=true;const n=t.bonded_Hs();n.forEach(function(t){if(!r.contains(t)){e=false}});if(!e){i.select('.atom[data-atom-id="'+t.id+'"]').classed("selected-partially",true)}})}};e.prototype.read_data=function(t,e){if(e=="mol"){this.read_mol(t)}else if(e=="nmrml"){this.read_nmrml(t)}else{console.log("Format not recognized: "+e+". Must be one of the following: nmrml, mol")}};e.prototype.read_nmrml=function(e){const n=this;if(!window.X2JS){console.log("X2JS needs to be installed to read nmrML: https://github.com/abdmob/x2js");return}const s=new X2JS;const o=s.xml_str2json(e);this.data=e;this._atoms=new t.SVSet;this._bonds=new t.SVSet;if(!(o.structure&&o.structure.atomList&&o.structure.atomList.atom&&Array.isArray(o.structure.atomList.atom))){console.log("nmrML not formatted correctly: no atoms found");return}if(!(o.structure&&o.structure.bondList&&o.structure.bondList.bond&&Array.isArray(o.structure.bondList.bond))){console.log("nmrML not formatted correctly: no bonds found");return}o.structure.atomList.atom.forEach(function(t,e){const r=new i({id:t._id.replace(/\D/g,""),x:parseFloat(t._x),y:parseFloat(t._y),symbol:t._elementType,number:e+1});r.display_id=r.id;n._atoms.push(r)});
776o.structure.bondList.bond.forEach(function(t){const e=t._atomRefs.split(/\s+/);const i=n.atoms(e[0].replace(/\D/g,""));const s=n.atoms(e[1].replace(/\D/g,""));const o=new r({a1:i,a2:s,order:parseInt(t._order)});n._bonds.push(o);i._bonds.push(o);s._bonds.push(o);i._bonded_atoms.push(s);s._bonded_atoms.push(i)});if(this.use_jsmol)this.generate_molfile(o);n.draw()};e.prototype.generate_molfile=function(t){let e=this;let n=function(t){let e="  ";if(typeof t==="undefined"){e+="  0.0000"}else{t=parseFloat(t).toFixed(4);if(t>=0)e+=" ";if(Math.abs(t)<10)e+=" ";e+=`${t}`}return e};e.mol_file=`\nJSpectraViewer\n\n ${t.structure.atomList.atom.length} ${t.structure.bondList.bond.length} 0 0 0 0 0 0 0 0999 V2000`;t.structure.atomList.atom.forEach(function(t){e.mol_file+=`\n${n(t._x)}${n(t._y)}${n(t._z)}`;e.mol_file+=` ${t._elementType}   0  0  0  0  0  0  0  0  0  0  0  0`});t.structure.bondList.bond.forEach(function(t){let n=t._atomRefs.split(/\s+/);const i=parseInt(n[0].replace(/\D/g,""));const r=parseInt(n[1].replace(/\D/g,""));e.mol_file+=i<10?`\n  ${i}`:`\n ${i}`;e.mol_file+=r<10?`  ${r}`:` ${r}`;e.mol_file+=`  ${t._order}  0  0  0  0`});e.mol_file+="\nM  END";return};e.prototype.read_mol=function(e){let n;const s=this;const o=e.split(/\r\n|\n/),a=o[3].match(/\d+/g),l=parseFloat(a[0]),c=parseFloat(a[1]);const u=4;this.title=o[1];this.data=e;this._atoms=new t.SVSet;this._bonds=new t.SVSet;for(let t=u;t<l+u;t++){let e=o[t].match(/-*\d+\.\d+|\w+/g);e=new i({x:parseFloat(e[0]),y:parseFloat(e[1]),symbol:e[3],number:t-u+1,mass:0,charge:0});e.id=e.number;e.display_id=e.number;this._atoms.push(e)}for(let t=l+u;t<l+c+u;t++){let e=o[t].match(/\d+/g);const n=this.atoms(parseInt(e[0]));const i=this.atoms(parseInt(e[1]));e=new r({a1:n,a2:i,order:parseInt(e[2]),stereo:parseInt(e[3])});this._bonds.push(e);n._bonds.push(e);i._bonds.push(e);n._bonded_atoms.push(i);i._bonded_atoms.push(n)}for(let t=l+c+u;t<o.length;t++){if(o[t].indexOf("M  ISO")!==-1){n=o[t].match(/-*\d+/g);for(let t=0,e=1;t<n[0];t++,e+=2){this.atoms(n[e]).mass=parseInt(n[e+1],10)}}else if(o[t].indexOf("M  CHG")!==-1){n=o[t].match(/-*\d+/g);for(let t=0,e=1;t<n[0];t++,e+=2){atoms[n[e]-1].charge=parseInt(n[e+1],10);this.atoms(n[e]).charge=parseInt(n[e+1],10)}}}s.draw()};e.prototype.loadJsmolScript=function(t,e){let n=document.createElement("script");n.type="text/javascript";if(n.readyState){n.onreadystatechange=function(){if(n.readyState==="loaded"||n.readyState==="complete"){n.onreadystatechange=null;e()}}}else{n.onload=function(){e()}}n.src=t;document.getElementsByTagName("head")[0].appendChild(n)};e.prototype.atom_picked=function(){let e=window.sv;let n=e.assignment_table;let i=window.sv.structure;let r=arguments[2]+1;let s=new t.SVSet(i.atoms(r));let o=new t.SVSet;Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${r}; colour halos blue;`);let a=n.cluster_from_atoms(s);if(a){o=a.peaks();s=a.atoms()}e.selection._elements=o.unique();e.draw();n.selected_peaks=o;n.selected_atoms=i.LCA_from_nmr_atoms(s);
776n.table.selectAll("tbody tr").classed("selected",false);if(a){n.table.select("tbody tr[data-cluster-path-id="+a.path_id()+"]").classed("selected",true)}};e.prototype.run_jsmol=function(){let t=this.container;let e=parseFloat(t.style("width"))-10,n=parseFloat(t.style("height"))-30;let i="INLINE";let r=`labels off; select ${this.nmr_nucleus==="13C"?"carbon":"hydrogen"}; label %a;`;let s=this.show_hydrogen?"set showHydrogens TRUE;":"set showHydrogens FALSE;";let o="background white;";let a='set PickCallback "sv.structure.atom_picked";';let l=this.mol_file;let c={width:e,height:n,debug:false,color:"#EAF0F2",use:"HTML5",j2sPath:"/jsmol/j2s",multipleBondSpacing:.9,zoomlarge:true,allowJavaScript:true};c.script="load "+i+' "'+l+'"; color labels black; font labels 20; set antialiasDisplay; wireframe 15; spacefill 55; select carbon; halos on; colour halos grey;'+r+s+o+a;$("#view-3d").html(Jmol.getAppletHtml("jmol_jspectraviewer",c));this.atom_picked()};e.prototype.draw=function(){let t=this;this.graph=this.initSVG();this.avgL=0;if(!this.use_jsmol){this.drawBonds();this.drawAtoms();this.addInteractivity()}else{this.container.append("div").attr("id","view-3d").attr("style","position: relative; z-index: 0;");try{t.run_jsmol()}catch(e){t.loadJsmolScript("/jsmol/JSmol.min.js",function(){t.run_jsmol();t.initialize_jsmol_atom_picking()})}}this.toggleH(this.show_hydrogen);this.toggleAtomNumbers(this.show_atom_numbers)};e.prototype.initialize_jsmol_atom_picking=function(){};e.prototype.atoms=function(t){return this._atoms.get(t)};e.prototype.bonds=function(t){return this._bonds.get(t)};e.prototype.addInteractivity=function(){const t=this;const e=this.container;e.on("mouseenter",function(){e.selectAll(".atom").style("cursor","default");if(t.nmr_1H()){e.selectAll(".atom.nmr-1h").classed("highlight",true).style("cursor","pointer")}else if(t.nmr_13C()){e.selectAll(".atom.nmr-13c").classed("highlight",true).style("cursor","pointer")}});e.on("mouseleave",function(){e.selectAll(".atom").classed("highlight",false)});e.selectAll(".atom").on("click",function(){const e=d3v7.select(this).attr("data-atom-id");let n;if(e){n=t.atoms(e);if(t.nmr_1H()){t.select_clicked_atoms_for_1H_nmr(n,d3v7.event.shiftKey)}else if(t.nmr_13C()){t.select_clicked_atoms_for_13C_nmr(n,d3v7.event.shiftKey)}}t.trigger("structure-click");d3v7.event.stopPropagation()});e.on("click",function(){t.selected_atoms=[];t.trigger("structure-click")})};e.prototype.select_clicked_atoms_for_1H_nmr=function(e,n){const i=this;let r=this.selected_atoms;if(n){window.getSelection().removeAllRanges();if(r.contains(e)){if(e.is("H")){const t=e.bonded_atoms(1);r=r.remove(t).remove(e)}else{e.bonded_Hs().forEach(function(t){r=r.remove(t)});r=r.remove(e)}}else{r.push(e)}}else{r=new t.SVSet(e)}i.selected_atoms=r};e.prototype.select_clicked_atoms_for_13C_nmr=function(e,n){const i=this;let r=this.selected_atoms;if(n){window.getSelection().removeAllRanges();if(r.contains(e)){r=r.remove(e)}else{r.push(e)}}else{r=new t.SVSet(e)}i.selected_atoms=r};e.prototype.toggleH=function(t){this.show_hydrogen=t===undefined?!this.show_hydrogen:t;if(this.show_hydrogen){d3v7.selectAll(".atom-H, .bond-H").style("display","inline");this.button_toggle_H.classed("button-on",true);this.button_toggle_H.text("Hide H");if(typeof Jmol!=="undefined")Jmol.script(jmol_jspectraviewer,"select all; set showHydrogens TRUE;")}else{d3v7.selectAll(".atom-H, .bond-H").style("display","none");this.button_toggle_H.classed("button-on",false);this.button_toggle_H.text("Show H");if(typeof Jmol!=="undefined")Jmol.script(jmol_jspectraviewer,"select all; set showHydrogens FALSE;")}};e.prototype.toggleAtomNumbers=function(t){this.show_atom_numbers=t===undefined?!this.show_atom_numbers:t;if(this.show_atom_numbers){d3v7.selectAll(".atom-id").style("display","inline");this.button_toggle_numbers.classed("button-on",true);this.button_toggle_numbers.text("Hide #");if(typeof Jmol!=="undefined"){if(this.nmr_nucleus==="13C"){Jmol.script(jmol_jspectraviewer,"select carbon; labels %a;")}else{Jmol.script(jmol_jspectraviewer,"select hydrogen; labels %a;")}}}else{d3v7.selectAll(".atom-id").style("display","none");
776this.button_toggle_numbers.classed("button-on",false);this.button_toggle_numbers.text("Show #");if(typeof Jmol!=="undefined"){if(this.nmr_nucleus==="13C"){Jmol.script(jmol_jspectraviewer,"select carbon; labels %e;")}else{Jmol.script(jmol_jspectraviewer,"select hydrogen; labels %e;")}}}};e.prototype.addAtomDisplayIDs=function(){const e=this;const n=new t.SVSet(e.atoms().filter(function(t){return!t.is("H")}));n.each(function(){this.morgan_num=1});let i=new t.SVSet;let r=-1;while(r!=i.unique().length){r=i.unique().length;i=new t.SVSet;n.forEach(function(t){let e=0;t.bonded_atoms().each(function(){if(!this.is("H")){e+=this.morgan_num}});t.morgan_temp=e});n.forEach(function(t){t.morgan_num=t.morgan_temp;i.push(t.morgan_num)})}n.order_by("morgan_num",true);let s=n[0];let o=1;let a;while(s){s.display_id=o;let e=s.bonded_atoms().filter(function(t){return!t.is("H")&&t.display_id==undefined});e=new t.SVSet(e);if(e.length>0){a=e.order_by("morgan_num",true)[0]}else{a=n.find(function(t){return t.display_id==undefined})}s=a;o+=1}this.addHydrogenDisplayIDs()};e.prototype.addHydrogenDisplayIDs=function(){const t=["a","b","c","d"];this.atoms().forEach(function(e){if(e.is("H")){return}e.bonded_Hs().forEach(function(n,i){n.display_id=e.display_id+t[i]})})};e.prototype.hydrogens_from_atoms=function(e){const n=new t.SVSet;e.forEach(function(t){if(t.toString()==="Atom"){if(t.is("H")){n.push(t)}else{n.merge(t.bonded_Hs())}}});return n.unique()};e.prototype.nmr_atoms_from_atoms=function(e){const n=this;if(n.nmr_1H()){return n.hydrogens_from_atoms(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};e.prototype.LCA_from_hydrogens=function(e){const n=new t.SVSet;if(!e||e.empty()){return n}const i=this.hydrogens_from_atoms(e);let r=i.map(function(t){return t.bonded_atoms(1)});r=new t.SVSet(r).unique();r.forEach(function(e){let r=true;const s=new t.SVSet;const o=e.bonded_Hs();o.forEach(function(t){if(i.contains(t)){s.push(t)}else{r=false}});if(r){n.push(e)}else{n.merge(s)}});return n.unique()};e.prototype.LCA_from_nmr_atoms=function(e){const n=this;if(n.nmr_1H()){return n.hydrogens_from_atoms(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};e.prototype.LCA_and_hydrogens=function(t){const e=this.hydrogens_from_atoms(t);const n=this.LCA_from_hydrogens(t);return e.merge(n).unique()};e.prototype.LCA_and_nmr_atoms=function(e){const n=this;if(n.nmr_1H()){return n.LCA_and_hydrogens(e)}if(n.nmr_13C()){return new t.SVSet(e.filter(function(t){return t.is("C")})).unique()}};function i(e){e=e||{};this.x=t.default_for(e.x,0);this.y=t.default_for(e.y,0);this.id=e.id;this.symbol=t.default_for(e.symbol,0);this.index=t.default_for(e.index,0);this.number=t.default_for(e.number,1);this.mass=t.default_for(e.mass,0);this.charge=t.default_for(e.charge,0);this._bonds=new t.SVSet;this._bonded_Hs=new t.SVSet;this._bonded_atoms=new t.SVSet}i.prototype.toString=function(){return"Atom"};i.prototype.bonds=function(t){return this._bonds.get(t)};i.prototype.bonded_atoms=function(t){return this._bonded_atoms.get(t)};i.prototype.bonded_Hs=function(e){const n=this.bonded_atoms().filter(function(t){return t.is("H")});return new t.SVSet(n)};i.prototype.is=function(t){return this.symbol==t};i.prototype.isBondedTo=function(t){return this.bonded_atoms().some(function(e){return e.symbol==t})};i.prototype.color=function(){return d3v7.rgb(AtomColors[this.symbol])};function r(e){e=e||{};this.a1=e.a1;this.a2=e.a2;this.order=t.default_for(e.order,1);this.stereo=t.default_for(e.stereo,0);this._atoms=new t.SVSet([this.a1,this.a2])}r.prototype.toString=function(){return"Bond"};r.prototype.atoms=function(t){return this._atoms.get(t)};t.SVStructure=e})(JSpectraViewer);(function(t){function e(e,n={}){const i=this;this.sv=e;this.struct=e.structure;this.container_id=n.container_id;this.container=d3v7.select(this.container_id);this.table=this.container.append("table").classed("jsv-assignment-table",true);this.nmr_nucleus=t.default_for(n.nmr_nucleus,"1H");if(!window.Sortable){console.log("Sortable needs to be installed to make peaks/atoms dragable: https://github.com/RubaXa/Sortable");this.sortable=false}this.add_sv_events();if(this.struct){this.add_struct_events()}this.edit_mode=n.edit_mode}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.get_columns=function(){const t=this;const e=t.struct;const n=d3v7.format(".2f");const i=function(t,n){let i="";if(t&&t.length>0){const n=e.LCA_from_nmr_atoms(t);i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id='"+t.id+"'>"+t.display_id+"</div>"}).join("")}else if(n&&n.length>0){i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id=''>"+t+"</div>"}).join("")}return i};
776const r=function(t,e){return"<div class='add-atoms-container'><a class='add-atoms jsv-btn' href='javascript:void(0)'>+</a><div>"};const s=function(t){return t.reverse().map(function(t){return"<span class='jsv-badge peak-badge' data-peak-id='"+t.path_id()+"'>"+n(t.center)+"</span>"}).join("")};const o=[{heading:"Row No.","class":"cluster-number center",html:function(t){return t.number}},{heading:"Cluster Midpoint","class":"center",html:function(t){return n(t.center)}},{heading:"No. Peaks","class":"center",html:function(t){return t.peak_num}},{heading:"Coupling Type","class":"center",html:function(t){return t.multiplet_type}},{heading:"No. H's","class":"center",html:function(t){return t.atoms.length}},{heading:"Atom No.","class":"atom-cell",html:function(t){return i(t.atoms,t.atom_refs)}},{heading:"","class":"add-atom-cell",html:function(t,e){return r(t.atoms,e)}},{heading:"Peak Centers (ppm)","class":"peak-cell",html:function(t){return s(t.peaks)}}];if(t.nmr_13C()){o[4].heading="No. C's"}if(!e){o.splice(4,3)}return o};e.prototype.update_table_header=function(){this.table.select("thead").remove();this.table.append("thead").append("tr").append("th").attr("class","center").attr("style","font-size: larger").attr("colspan",this.columns.length).text("Assignment Table");this.table.select("thead").append("tr").selectAll("th").data(this.columns).enter().append("th").attr("class",function(t){return t["class"]}).text(function(t){return t.heading})};e.prototype.update_table=function(){const t=this;const e=this.struct;const n=this.table;const i=this.columns;rows=[];this.sv._cluster_navigation.static_compounds=this.sv.compounds();this.sv.clusters().each(function(t){row={path_id:this.path_id(),number:t+1,center:this.center(),peak_num:this.peaks().length,peaks:this.peaks(),multiplet_type:this.multiplet_type,atoms:this.atoms(),atom_refs:this.atom_refs};rows.push(row)});n.select("tbody").remove();if(rows.length>0){n.append("tbody").selectAll("tr").data(rows).enter().append("tr").attr("data-cluster-path-id",function(t){return t.path_id}).selectAll("td").data(function(t,e){return i.map(function(n){const i={};Object.keys(n).forEach(function(r){i[r]=typeof n[r]=="function"?n[r](t,e):n[r]});return i})}).enter().append("td").html(function(t){return t.html}).attr("class",function(t){return t["class"]})}else{n.append("tbody").append("tr").append("td").attr("colspan",i.length).style("text-align","center").html("No Clusters")}this.add_table_events();d3v7.selectAll(".atom-badge").each(function(){const t=d3v7.select(this);const n=e.atoms(t.text());if(n){t.classed("atom-badge-symbol-"+n.symbol,true)}});if(t.edit_mode){this.make_sortable()}else{n.selectAll(".add-atoms").style("display","none")}};e.prototype.make_sortable=function(){const e=this;const n=this.table;const i=this.struct;n.classed("editable",true);n.selectAll("tbody tr .atom-cell").each(function(){Sortable.create(this,{draggable:".atom-badge",group:"atoms",animation:150,ghostClass:"badge-ghost",onAdd:function(n){let r;const s=e.cluster_from_table_child(n.item);const o=e.cluster_from_table_child(n.from);const a=d3v7.select(n.item).attr("data-atom-id");if(a){r=i.atoms(a)}if(r&&s&&o){const n=i.nmr_atoms_from_atoms([r]);atoms=s.atoms().merge(n).unique();s._atoms=atoms;o._atoms=new t.SVSet(o._atoms.filter(function(t){return!n.contains(t)}));e.update_table()}e.select_peaks_and_atoms(e.selected_atoms)},onEnd:function(n){const r=d3v7.select(n.item).attr("data-atom-id");if(r){atom=i.atoms(r);e.selected_atoms=new t.SVSet(atom);e.select_peaks_and_atoms(e.selected_atoms)}}})});n.selectAll("tbody tr td.peak-cell").each(function(){Sortable.create(this,{draggable:".peak-badge",group:"peaks",animation:150,ghostClass:"badge-ghost",onAdd:function(t){let n;const i=e.cluster_from_table_child(t.item);const r=e.cluster_from_table_child(t.from);const s=d3v7.select(t.item).attr("data-peak-id");if(s){n=sv.peaks(s)}if(n&&i&&r){n["delete"]();i.add_peak(n);i.update();if(sv._cluster_navigation){sv._cluster_navigation.update_table()}e.update_table()}e.select_peaks_and_atoms(e.selected_peaks)},onEnd:function(n){const i=d3v7.select(n.item).attr("data-peak-id");if(i){peak=sv.peaks(i);e.selected_peaks=new t.SVSet(peak);e.select_peaks_and_atoms(e.selected_peaks)}}})})};e.prototype.add_table_events=function(){const e=this;const n=this.table;const i=this.sv;const r=this.struct;n.selectAll("tbody tr").on("click",function(){n.selectAll("tbody tr").classed("selected",fal
776se);d3v7.select(this).classed("selected",true);const t=d3v7.select(this).attr("data-cluster-path-id");const r=i.clusters(t);e.select_peaks_and_atoms(r);i.move_to_peaks(r.peaks(),i._cluster_navigation.speed,2)});n.selectAll("tbody .atom-badge").on("click",function(){let n=e.selected_atoms;const s=d3v7.select(this).attr("data-atom-id");const o=r.atoms(s);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(o)){n=n.remove(o)}else{n.push(o)}}else{n=new t.SVSet(o)}e.selected_atoms=n;e.select_peaks_and_atoms(e.selected_atoms);i.move_to_peaks(e.cluster_from_atoms(e.selected_atoms).peaks(),i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody .peak-badge").on("click",function(){let n=e.selected_peaks;const r=d3v7.select(this).attr("data-peak-id");const s=i.peaks(r);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(s)){n=n.remove(s)}else{n.push(s)}}else{n=new t.SVSet(s)}e.selected_peaks=n;e.select_peaks_and_atoms(e.selected_peaks);i.move_to_peaks(e.selected_peaks,i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody tr .add-atoms").on("click",function(){const t=e.cluster_from_table_child(this);if(t){t._atoms=r.nmr_atoms_from_atoms(r.selected_atoms)}d3v7.event.stopPropagation();e.update_table();e.select_peaks_and_atoms(t);return false})};e.prototype.add_sv_events=function(){const t=this;const e=t.struct;const n=t.sv;n.on("adjust-end.assign",function(){t.update_table();t.select_peaks_and_atoms(n.selection.peaks())});n.on("adjust-peak-created.assign",function(t){const n=t.cluster();if(n.peaks().length==1){n._atoms=e.nmr_atoms_from_atoms(e.selected_atoms)}});n.on("selection-add.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-remove.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-clear.assign",function(){t.select_peaks_and_atoms(undefined)})};e.prototype.add_struct_events=function(){const t=this;const e=this.struct;e.on("structure-click.assign",function(){e.selected_atoms=e.LCA_and_nmr_atoms(e.selected_atoms);t.select_peaks_and_atoms(e.selected_atoms)})};e.prototype.select_peaks_and_atoms=function(e){const n=this;const i=this.sv;const r=this.struct;const s=this.table;let o;let a=new t.SVSet;let l=new t.SVSet;if(e){if(e.toString()=="Cluster"){o=e}else if(e.toString()=="SVSet"||Array.isArray(e)){const t=e[0];if(t){if(e[0].toString()=="Atom"){l=e}else if(e[0].toString()=="Peak"){a=e}}}else{console.log("Unknown Selection")}}if(a.present()){o=this.cluster_from_peaks(a)}if(l.present()){o=this.cluster_from_atoms(l)}if(o){a=o.peaks();l=o.atoms()}if(r){if(r.use_jsmol&&typeof Jmol!=="undefined"){if(r.nmr_1H()){let t=r.LCA_from_hydrogens(l);Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${t[0].id.replace(/\D/g,"")}; colour halos blue;`)}else{Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${l[0].id.replace(/\D/g,"")}; colour halos blue;`)}}else{r.selected_atoms=r.LCA_and_nmr_atoms(l)}}i.selection._elements=a.unique();i.draw();n.selected_peaks=a;if(r){n.selected_atoms=r.LCA_from_nmr_atoms(l)}
776s.selectAll("tbody tr").classed("selected",false);if(o){s.select("tbody tr[data-cluster-path-id="+o.path_id()+"]").classed("selected",true)}};e.prototype.cluster_from_peaks=function(t){let e;this.sv.clusters().forEach(function(n){if(n.peaks().equals(t)){e=n}});return e};e.prototype.cluster_from_atoms=function(t){let e;const n=this.struct;const i=n.nmr_atoms_from_atoms(t);this.sv.clusters().forEach(function(t){const r=n.nmr_atoms_from_atoms(t.atoms());if(r.equals(i)){e=t}});return e};e.prototype.cluster_from_table_child=function(t){if(!t){return}let e;let n=false;let i=t;while(!n){localName=i.localName.toUpperCase();if(localName=="TR"){n=true;const t=d3v7.select(i).attr("data-cluster-path-id");if(t){e=this.sv.clusters(t)}}else if(localName=="TABLE"){n=true}else{i=i.parentNode;if(!i){n=true}}}return e};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom-badge.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.struct.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
776n.selectAll(".atom-badge").classed("selected",false);t.forEach(function(t){n.selectAll('.atom-badge[data-atom-id="'+t.id+'"]').classed("selected",true)})}},selected_peaks:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".peak-badge.selected").each(function(){const t=d3v7.select(this).attr("data-peak-id");n.push(e.sv.peaks(t))});return n},set:function(t){const e=this;const n=this.container;n.selectAll(".peak-badge").classed("selected",false);t.forEach(function(t){
777n.select('.peak-badge[data-peak-id="'+t.path_id()+'"]').classed("selected",true)})}},edit_mode:{get:function(){return this._edit_mode},set:function(t){const e=this;const n=e.sv;e._edit_mode=t;if(e._edit_mode){n.selection.element_type="peak";n.selection.allow_multiselect=true;n.selection.allow_adjust=true;n.selection.allow_width_adjust=true;n.selection.allow_peak_creation=true;if(n.highlight)n.highlight.element_type="peak"}else{n.selection.element_type="cluster";n.selection.allow_multiselect=true;n.selection.allow_adjust=false;n.selection.allow_width_adjust=false;n.selection.allow_peak_creation=false;if(n.highlight)n.highlight.element_type="cluster"}e.update_table();e.select_peaks_and_atoms(n.selection.peaks());n.draw()}},nmr_nucleus:{get:function(){return this._nmr_nucleus},set:function(t){this._nmr_nucleus=t;this.columns=this.get_columns();if(this.struct)this.struct.nmr_nucleus=t;this.update_table_header();this.update_table()}}});t.SVAssignments=e})(JSpectraViewer);(function(t){function e(t,e={}){const n=this;this.sv=t;this.struct=t.structure;this.container_id=e.container_id;this.container=d3v7.select(this.container_id);this.table=this.container.append("table").classed("jsv-assignment-table",true);this.nmr_nucleus="2D";if(!window.Sortable){console.log("Sortable needs to be installed to make peaks/atoms dragable: https://github.com/RubaXa/Sortable");this.sortable=false}this.add_sv_events();if(this.struct){this.add_struct_events()}this.edit_mode=e.edit_mode}e.prototype.nmr_1H=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="1H"};e.prototype.nmr_13C=function(){return this.nmr_nucleus&&this.nmr_nucleus.toUpperCase()=="13C"};e.prototype.get_columns=function(){const t=this;const e=t.struct;const n=d3v7.format(".2f");const i=function(t,n){let i="";if(t&&t.length>0){const n=e.LCA_from_nmr_atoms(t);i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id='"+t.id+"'>"+t.display_id+"</div>"}).join("")}else if(n&&n.length>0){i=n.map(function(t){return"<div class='jsv-badge atom-badge' data-atom-id=''>"+t+"</div>"}).join("")}return i};const r=function(t,e){return"<div class='add-atoms-container'><a class='add-atoms jsv-btn' href='javascript:void(0)'>+</a><div>"};const s=function(t){return t.reverse().map(function(t){return"<span class='jsv-badge peak-badge' data-peak-id='"+t.path_id()+"'>"+n(t.center)+"</span>"}).join("")};const o=[{heading:"Row No.","class":"cluster-number center",html:function(t){return t.number}},{heading:"Dir. Dim. Center","class":"center",html:function(t){return n(t.peaks[0])}},{heading:"Indir. Dim. Center","class":"center",html:function(t){return n(t.peaks[1])}},{heading:"Coupling Type","class":"center",html:function(t){return t.multiplet_type}},{heading:"Dir. Dim. Atom No.","class":"atom-cell center",html:function(t){return i(t.atoms,t.dir_dim_atom_refs)}},{heading:"Indir. Dim. Atom No.","class":"atom-cell center",html:function(t){return i(t.atoms,t.indir_dim_atom_refs)}}];return o};e.prototype.update_table_header=function(){this.table.select("thead").remove();this.table.append("thead").append("tr").append("th").attr("class","center").attr("style","font-size: larger").attr("colspan",this.columns.length).text("Assignment Table");this.table.select("thead").append("tr").selectAll("th").data(this.columns).enter().append("th").attr("class",function(t){return t["class"]}).text(function(t){return t.heading})};e.prototype.update_table=function(){const t=this;const e=this.struct;const n=this.table;const i=this.columns;rows=[];this.sv._cluster_navigation.static_compounds=this.sv.compounds();this.sv.clusters().each(function(t){row={path_id:this.path_id(),number:t+1,center:this.center(),peak_num:this.peaks().length,peaks:this.peaks(),multiplet_type:this.multiplet_type,atoms:this.atoms(),dir_dim_atom_refs:this.dir_dim_atom_refs(),indir_dim_atom_refs:this.indir_dim_atom_refs()};rows.push(row)});n.select("tbody").remove();if(rows.length>0){n.append("tbody").selectAll("tr").data(rows).enter().append("tr").attr("data-cluster-path-id",function(t){return t.path_id}).selectAll("td").data(function(t,e){return i.map(function(n){const i={};
777Object.keys(n).forEach(function(r){i[r]=typeof n[r]=="function"?n[r](t,e):n[r]});return i})}).enter().append("td").html(function(t){return t.html}).attr("class",function(t){return t["class"]})}else{n.append("tbody").append("tr").append("td").attr("colspan",i.length).style("text-align","center").html("No Clusters")}this.add_table_events();d3v7.selectAll(".atom-badge").each(function(){const t=d3v7.select(this);const n=e.atoms(t.text());if(n){t.classed("atom-badge-symbol-"+n.symbol,true)}});if(t.edit_mode){this.make_sortable()}else{n.selectAll(".add-atoms").style("display","none")}};e.prototype.make_sortable=function(){const e=this;const n=this.table;const i=this.struct;n.classed("editable",true);n.selectAll("tbody tr .atom-cell").each(function(){Sortable.create(this,{draggable:".atom-badge",group:"atoms",animation:150,ghostClass:"badge-ghost",onAdd:function(n){let r;const s=e.cluster_from_table_child(n.item);const o=e.cluster_from_table_child(n.from);const a=d3v7.select(n.item).attr("data-atom-id");if(a){r=i.atoms(a)}if(r&&s&&o){const n=i.nmr_atoms_from_atoms([r]);atoms=s.atoms().merge(n).unique();s._atoms=atoms;o._atoms=new t.SVSet(o._atoms.filter(function(t){return!n.contains(t)}));e.update_table()}e.select_peaks_and_atoms(e.selected_atoms)},onEnd:function(n){const r=d3v7.select(n.item).attr("data-atom-id");if(r){atom=i.atoms(r);e.selected_atoms=new t.SVSet(atom);e.select_peaks_and_atoms(e.selected_atoms)}}})});n.selectAll("tbody tr td.peak-cell").each(function(){Sortable.create(this,{draggable:".peak-badge",group:"peaks",animation:150,ghostClass:"badge-ghost",onAdd:function(t){let n;const i=e.cluster_from_table_child(t.item);const r=e.cluster_from_table_child(t.from);const s=d3v7.select(t.item).attr("data-peak-id");if(s){n=sv.peaks(s)}if(n&&i&&r){n["delete"]();i.add_peak(n);i.update();if(sv._cluster_navigation){sv._cluster_navigation.update_table()}e.update_table()}e.select_peaks_and_atoms(e.selected_peaks)},onEnd:function(n){const i=d3v7.select(n.item).attr("data-peak-id");if(i){peak=sv.peaks(i);e.selected_peaks=new t.SVSet(peak);e.select_peaks_and_atoms(e.selected_peaks)}}})})};e.prototype.add_table_events=function(){const e=this;const n=this.table;const i=this.sv;const r=this.struct;n.selectAll("tbody tr").on("click",function(){n.selectAll("tbody tr").classed("selected",fal
777se);d3v7.select(this).classed("selected",true);const t=d3v7.select(this).attr("data-cluster-path-id");const r=i.clusters(t);e.select_peaks_and_atoms(r);i.move_to_peaks(r.peaks(),i._cluster_navigation.speed,2)});n.selectAll("tbody .atom-badge").on("click",function(){let n=e.selected_atoms;const s=d3v7.select(this).attr("data-atom-id");const o=r.atoms(s);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(o)){n=n.remove(o)}else{n.push(o)}}else{n=new t.SVSet(o)}e.selected_atoms=n;e.select_peaks_and_atoms(e.selected_atoms);i.move_to_peaks(e.cluster_from_atoms(e.selected_atoms).peaks(),i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody .peak-badge").on("click",function(){let n=e.selected_peaks;const r=d3v7.select(this).attr("data-peak-id");const s=i.peaks(r);if(d3v7.event.shiftKey){window.getSelection().removeAllRanges();if(n.contains(s)){n=n.remove(s)}else{n.push(s)}}else{n=new t.SVSet(s)}e.selected_peaks=n;e.select_peaks_and_atoms(e.selected_peaks);i.move_to_peaks(e.selected_peaks,i._cluster_navigation.speed,2);d3v7.event.stopPropagation()});n.selectAll("tbody tr .add-atoms").on("click",function(){const t=e.cluster_from_table_child(this);if(t){t._atoms=r.nmr_atoms_from_atoms(r.selected_atoms)}d3v7.event.stopPropagation();e.update_table();e.select_peaks_and_atoms(t);return false})};e.prototype.add_sv_events=function(){const t=this;const e=t.struct;const n=t.sv;n.on("adjust-end.assign",function(){t.update_table();t.select_peaks_and_atoms(n.selection.peaks())});n.on("adjust-peak-created.assign",function(t){const n=t.cluster();if(n.peaks().length==1){n._atoms=e.nmr_atoms_from_atoms(e.selected_atoms)}});n.on("selection-add.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-remove.assign",function(){t.select_peaks_and_atoms(n.selection.peaks())});n.on("selection-clear.assign",function(){t.select_peaks_and_atoms(undefined)})};e.prototype.add_struct_events=function(){const t=this;const e=this.struct;e.on("structure-click.assign",function(){e.selected_atoms=e.LCA_and_nmr_atoms(e.selected_atoms);t.select_peaks_and_atoms(e.selected_atoms)})};e.prototype.select_peaks_and_atoms=function(e){const n=this;const i=this.sv;const r=this.struct;const s=this.table;let o;let a=new t.SVSet;let l=new t.SVSet;if(e){if(e.toString()=="Cluster"){o=e}else if(e.toString()=="SVSet"||Array.isArray(e)){const t=e[0];if(t){if(e[0].toString()=="Atom"){l=e}else if(e[0].toString()=="Peak"){a=e}}}else{console.log("Unknown Selection")}}if(a.present()){o=this.cluster_from_peaks(a)}if(l.present()){o=this.cluster_from_atoms(l)}if(o){a=o.peaks();l=o.atoms()}if(r){if(r.use_jsmol&&typeof Jmol!=="undefined"){if(r.nmr_1H()){let t=r.LCA_from_hydrogens(l);Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${t[0].id.replace(/\D/g,"")}; colour halos blue;`)}else{Jmol.script(jmol_jspectraviewer,`select carbon; colour halos grey; select atomno = ${l[0].id.replace(/\D/g,"")}; colour halos blue;`)}}else{r.selected_atoms=r.LCA_and_nmr_atoms(l)}}i.selection._elements=a.unique();i.draw();n.selected_peaks=a;if(r){n.selected_atoms=r.LCA_from_nmr_atoms(l)}
777s.selectAll("tbody tr").classed("selected",false);if(o){s.select("tbody tr[data-cluster-path-id="+o.path_id()+"]").classed("selected",true)}};e.prototype.cluster_from_peaks=function(t){let e;this.sv.clusters().forEach(function(n){if(n.peaks().equals(t)){e=n}});return e};e.prototype.cluster_from_atoms=function(t){let e;const n=this.struct;const i=n.nmr_atoms_from_atoms(t);this.sv.clusters().forEach(function(t){const r=n.nmr_atoms_from_atoms(t.atoms());if(r.equals(i)){e=t}});return e};e.prototype.cluster_from_table_child=function(t){if(!t){return}let e;let n=false;let i=t;while(!n){localName=i.localName.toUpperCase();if(localName=="TR"){n=true;const t=d3v7.select(i).attr("data-cluster-path-id");if(t){e=this.sv.clusters(t)}}else if(localName=="TABLE"){n=true}else{i=i.parentNode;if(!i){n=true}}}return e};Object.defineProperties(e.prototype,{selected_atoms:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".atom-badge.selected").each(function(){const t=d3v7.select(this).attr("data-atom-id");n.push(e.struct.atoms(t))});return n},set:function(t){const e=this;const n=this.container;
777n.selectAll(".atom-badge").classed("selected",false);t.forEach(function(t){n.selectAll('.atom-badge[data-atom-id="'+t.id+'"]').classed("selected",true)})}},selected_peaks:{get:function(){const e=this;const n=new t.SVSet;this.container.selectAll(".peak-badge.selected").each(function(){const t=d3v7.select(this).attr("data-peak-id");n.push(e.sv.peaks(t))});return n},set:function(t){const e=this;const n=this.container;n.selectAll(".peak-badge").classed("selected",false);t.forEach(function(t){n.select('.peak-badge[data-peak-id="'+t.path_id()+'"]').classed("selected",true)})}},edit_mode:{get:function(){return this._edit_mode},set:function(t){const e=this;const n=e.sv;e._edit_mode=t;if(e._edit_mode){n.selection.element_type="peak";n.selection.allow_multiselect=true;n.selection.allow_adjust=true;n.selection.allow_width_adjust=true;n.selection.allow_peak_creation=true;if(n.highlight)n.highlight.element_type="peak"}else{n.selection.element_type="cluster";n.selection.allow_multiselect=true;n.selection.allow_adjust=false;n.selection.allow_width_adjust=false;n.selection.allow_peak_creation=false;if(n.highlight)n.highlight.element_type="cluster"}e.update_table();n.draw()}},nmr_nucleus:{get:function(){return this._nmr_nucleus},set:function(t){this._nmr_nucleus=t;this.columns=this.get_columns();if(this.struct)this.struct.nmr_nucleus=t;this.update_table_header();this.update_table()}}});t.SVAssignments2D=e})(JSpectraViewer);JSpectraViewer.initialize();(function(){on_ready(function(){var t,e,n,i,r,s,o,a,l;if($("#nmr-spectrum").length){r=d3.select("#nmr-spectrum").attr("data-path");i=d3.select("#nmr-spectrum").attr("data-nucleus");n=d3.select("#nmr-spectrum").attr("data-name");e=d3.select("#nmr-spectrum").attr("data-type");o=d3.select("#nmr-spectrum").attr("data-source");l=i==="13C"?205:11.1;s=i==="13C"?false:true;if(e==="json"){a=new JSV.SpectraViewer("#nmr-spectrum",{debug:false,width:$(".panel#spectrum .panel-body").width(),min_boundaries:{x:[-1,l],y:[-.02,1.18]},axis_y_lock:.04,legend_show:true,x_axis_label:"ppm"});a.flash("Loading...");window.sv=a;$.getJSON(r,function(t){a.add_spectrum({id:"sum_line",name:n,peak_list:t.peaks});a.spectra("sum_line").labels.update_peaks();return a.draw()})}else if(e==="nmrml"){a=new JSV.SpectraViewer("#nmr-spectrum",{width:$(".panel#spectrum .panel-body").width(),drag_drop_load:false,axis_y_lock:.04,axis_x_title:"ppm",legend_show:true,cluster_navigation_id:"#cluster-navigation",simplify_tolerance:.01,zoom_max:1e3,min_boundaries:{x:[-1,l],y:[-.02,1.18]},highlight:{restriction_spectrum_id:"Assignment",element_type:"peak",display:{fill:"rgba(238, 238, 255, 0.7)"},visible_only:false},select:{element_type:"peak",allow_multiselect:true,allow_adjust:false,allow_peak_creation:false,show_indicators:true,display:{fill:"rgba(208, 208, 255, 0.75)"}},assignment_table:{container_id:"#assignments",edit_mode:false},structure:{container_id:"#structure",show_atom_numbers:true,use_jsmol:true,show_hydrogen:s,width:400,height:400}});a.flash("Loading...");window.sv=a;$.ajax({dataType:"text",url:r,success:function(e){if(e){a.add_nmrml_data(e,o);a.reset_boundaries();$(".jsv-cluster-navigator td:first").html("Multiplets");t.trigger("resize");return a.draw()}}})}a.on("cluster-navigator-updated",function(){return $(".jsv-cluster-navigator td:first").html("Multiplets")});t=$(window);t.resize(function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();a.resize(e,null,true);t=e-n-4;$("#assignments").width(t);return $("#cluster-navigation").width(t-2)});if(a.structure){return a.structure.on("structure-resize",function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();t=e-n-4;$("#assignments").width(t);return $("#cluster-navigation").width(t-2)})}}})}).call(this);(function(){on_ready(function(){var t,e,n,i;if($("#nmr-spectrum-2d").length){n=d3.select("#nmr-spectrum-2d").attr("data-path");e=d3.select("#nmr-spectrum-2d").attr("data-type");if(e==="json"){i=new JSV.SpectraViewer2D("#nmr-spectrum-2d",{debug:false,width:$(".panel#spectrum .panel-body").width(),height:"800",zoom_min:.1});i.flash("Loading...");$.getJSON(n,function(t){var e;t=JSON.parse(t);e=t["x"];t["x"]=t["y"];t["y"]=e;return i.add_spectrum_2d({json_data:t})});t=$(window);t.resize(function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();t=e-n-4;i.resize(e,null,true);$("#assignments").width(t);$("#cluster-navigation").width(t-2);return i.draw()});if(i.structure){return i.structure.on("structure-resize",function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();t=e-n-4;$("#assignments").width(t);$("#cluster-navigation").width(t-2);return i.draw()})}}else if(e==="nmrml"){i=new JSV.SpectraViewer2D("#nmr-spectrum-2d",{debug:false,width:$(".panel#spectrum .panel-body").width(),height:"800",zoom_min:.1});i.flash("Loading...");$.ajax({dataType:"text",url:n,success:function(e){if(e){i.add_nmrml_data(e);$(".jsv-cluster-navigator td:first").html("Multiplets");t.trigger("resize");return i.draw()}}});t=$(window);t.resize(function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();t=e-n-4;i.resize(e,null,true);$("#assignments").width(t);$("#cluster-navigation").width(t-2);return i.draw()});if(i.structure){return i.structure.on("structure-resize",function(){var t,e,n;e=$(".panel#spectrum .panel-body").width()-1;n=$("#structure").width();t=e-n-4;$("#assignments").width(t);$("#cluster-navigation").width(t-2);return i.draw()})}}}})}).call(this);(function(){var t,e,n,i,r,s,o,a,l,c,u,h,f,d,p,m;f=null;on_ready(function(){return $(".example-loader").click(function(t){var e,n,i,r,s,o,a,l;i=$(t.currentTarget).closest(".specdb-search-form");o=i.find("#search_type").val();r=i.find("#nucleus").val();a=i.find("#spectra_type").val();e=JSON.parse($(t.currentTarget).data("example").replace(/'/g,""));$("#peaks").removeClass("final");s=e[o][r][a];for(n in s){l=s[n];i.find("#"+n).val(l)}return t.preventDefault()})});on_ready(function(){if($(".search-tabs").length){return $('a[href="'+location.hash+'"]').tab("show")}});window.retrieving=false;on_ready(function(){$(".results-table a.compare").click(c);if(window.compareCandidate!=null){return $("#comparison-compound").html(window.compareCandidate.compound_name+" ("+window.compareCandidate.compound_id+")")}});c=function(t){var e,n;e=$(this).attr("data-spectrum_id");n=$(this).attr("spec_name");if(!window.retrieving){$(".spectrum-overlay").show();window.retrieving=true;return $.ajax({url:"/spectra/"+n+"/load_candidate",type:"GET",dataType:"JSON",data:{id:e},success:function(t){$("[data-spectrum_id="+window.compareCandidate.spectrum_id+"]").removeClass("btn-current").addClass("btn-compare").removeAttr("disabled").html("Compare Spectrum");$("[data-spectrum_id="+t.spectrum_id+"]").removeClass("btn-compare").addClass("btn-current").attr("disabled","disabled").html("Current Spectrum");$("#comparison-compound").html(t.compound_name+" ("+t.compound_id+")");window.compareCandidate=t;window.retrieving=false;window.dispatchEvent(new CustomEvent("compare"));return $(".spectrum-overlay").fadeOut()},error:function(){alert("Error occurred.");window.retrieving=false;return $(".spectrum-overlay").fadeOut()}})}};on_ready(function(){$("#nmr-one-mirror").hide();$(".results-table-one-d a.compare").click(u);if(window.compareCandidate!=null){return $("#comparison-compound").html(window.compareCandidate.compound_name+" ("+window.compareCandidate.compound_id+")")}});u=function(t){var e,n;e=$(this).attr("data-spectrum_id");n=$(this).attr("spec_name");if(!window.retrieving){$("#load-screen").show();window.retrieving=true;return $.ajax({url:"/spectra/"+n+"/load_candidate",type:"GET",dataType:"JSON",data:{id:e},success:function(t){var e;$("#load-screen").hide();$("#nmr-one-mirror").show();e=$("#comparison-compound").val();if(e===""){e=t.spectrum_id}window.compareCandidate=t;$("[data-spectrum_id="+e+"]").removeClass("btn-current").addClass("btn-compare").removeAttr("disabled").html("Compare Spectrum");$("[data-spectrum_id="+t.spectrum_id+"]").removeClass("btn-compare").addClass("btn-current").attr("disabled","disabled").html("Current Spectrum");$("#comparison-compound").val(t.spectrum_id);window.compareCandidate=t;window.retrieving=false;return window.dispatchEvent(new CustomEvent("compare"))},error:function(){alert("Error occurred.");window.retrieving=false;return $("#load-screen").hide()}})}};on_ready(function(){var t,e,n,i;n=1;e=3e3;t=5e5;i=$("#range-slider").slider({range:true,min:n,max:e,values:[1,10],slide:function(e,n){$("#range-start").val(n.values[0]);$("#range-end").val(n.values[1]);p(n.values[0],n.values[1],t)}});$("#range-start").val(i.slider("values")[0]);$("#range-end").val(i.slider("values")[1]);$("#range-start").on("input",function(){i.slider("values",0,$(this).val());m($(this),n,e);return p($("#range-start").val(),$("#range-end").val(),t)});return $("#range-end").on("input",function(){i.slider("values",1,$(this).val());m($(this),n,e);return p($("#range-start").val(),$("#range-end").val(),t)})});on_ready(function(){l("#percent-slider","#percent-value",parseInt($("#percent-value").attr("max")),parseInt($("#percent-value").attr("min")));return l("#exact-slider","#exact-value",parseInt($("#exact-value").attr("max")),parseInt($("#exact-value").attr("min")))});on_ready(function(){return $("#num_peaks_range_over").change(function(){if($(this).is(":checked")){$("#range-start").prop("disabled",true);$("#range-end").prop("disabled",true);$("#range-slider").slider("disable");
777return $("#nmr-search-button").prop("disabled",false)}else{$("#range-start").prop("disabled",false);$("#range-end").prop("disabled",false);$("#range-slider").slider("enable");if($("#range-info").hasClass("alert-danger")){return $("#nmr-search-button").prop("disabled",true)}}})});on_ready(function(){return $("#peaks").on("input",function(){$(this).removeClass("final");return $("#chemical-shift-error").html("")})});a=function(){$("#range-search").hide();$("#range-start").prop("disabled",true);return $("#range-end").prop("disabled",true)};o=function(){$("#percent-search").hide();$("#percent-value").prop("disabled",true);return $("#percent-slider").prop("disabled",true)};s=function(){$("#exact-search").hide();$("#exact-value").prop("disabled",true);return $("#exact-slider").prop("disabled",true)};r=function(e){switch(e){case 0:n($("#range-info"),true,"alert-danger");$("div.ui-slider-range.ui-widget-header").css("background","red");$("#nmr-search-button").prop("disabled",true);i($("#range-start"),true,"invalid-input");i($("#range-end"),true,"invalid-input");return t("Margin is too large");case 1:n($("#range-info"),true,"alert-warning");$("div.ui-slider-range.ui-widget-header").css("background","yellow");$("#nmr-search-button").prop("disabled",false);i($("#range-start"),true,"warning-input");i($("#range-end"),true,"warning-input");return d();case 2:n($("#range-info"),true,"alert-success");$("div.ui-slider-range.ui-widget-header").css("background","green");$("#nmr-search-button").prop("disabled",false);i($("#range-start"),false);i($("#range-end"),false);return d()}};i=function(t,e,n){if(n==null){n=""}t.removeClass("warning-input");t.removeClass("invalid-input");if(!e){return}return t.addClass(n)};n=function(t,e,n){if(n==null){n=""}t.removeClass("alert-danger");t.removeClass("alert-warning");t.removeClass("alert-success");if(!e){return}return t.addClass(n)};p=function(t,e,n){var i,s,o,a,l,c;h();i=e-t;c=0;if(i<3e3){for(o=s=a=t,l=e;a<=l?s<=l:s>=l;o=a<=l?++s:--s){if(f.hasOwnProperty(o.toString())){c+=f[o.toString()]}}if(c>n||i<0){return r(0)}else if(c>n/2){return r(1)}else{return r(2)}}else{return r(2)}};m=function(e,n,i){if(e.val()>i||e.val()<n){e.addClass("invalid-input");return t("Invalid Number of Peaks")}else{e.removeClass("invalid-input");return d()}};t=function(t){$("#error-ctn").text(t);$("#error-ctn").removeClass("invisible");return $("#error-ctn").addClass("visible")};d=function(){$("#error-ctn").text();$("#error-ctn").removeClass("visible");return $("#error-ctn").addClass("invisible")};h=function(){if(f===null){return f=JSON.parse($("#peak-data").data("peak-lists").replace(/'/g,""))}};l=function(t,n,i,r){$(t).on("input",function(){$(n).val($(this).val());$(n).removeClass("invalid-input");$("#nmr-search-button").prop("disabled",false);return $(t).val($(this).val())});return $(n).on("input",function(){$(t).val($(this).val());if($(this).val()<r||$(this).val()>i||!$(this).val()){$(this).addClass("invalid-input");$("#nmr-search-button").prop("disabled",true);return e($(this).val(),r,i)}else{$(this).removeClass("invalid-input");d();return $("#nmr-search-button").prop("disabled",false)}})};e=function(e,n,i){if(!e){return t("Input must not be blank!")}else if(e<n){return t("Input is too small!")}else if(e>i){return t("Input is too large!")}}}).call(this);var mz_plot_one_d=function(t,e,n,i){console.log(e);var r=20;var s=40;var o=100;var a=250;i=typeof i!=="undefined"?i:{};console.log(n);var l=d3.select(t),c=l[0][0];l.attr("class","chart_container");l.attr("data-query-id",n);l.append("div").attr("class","y_axis_label").text("Relative Intensity");var u=l.append("div").attr("class","y_axis")[0][0],h=l.append("div").attr("class","chart")[0][0],f=l.append("div").attr("class","x_axis")[0][0];l.append("div").attr("class","x_axis_label").text("Chemical Shift");console.log(c);var d=function(){return c-2*r-s};var p=function(t){var e=t[0].y;for(var n=0;n<t.length;n++){e=Math.max(e,t[n].y)}for(var n=0;n<t.length;n++){t[n].y=t[n].y/e*o}return t};var m=function(t,e){return t.x<e.x?-1:t.x>e.x?1:0};e=p(e);e.sort(m);var g=o;var _=0;if(i.mirror){_=g*-1}var v=Number.MIN_VALUE;var y=Number.MAX_VALUE;for(k=0;k<e.length;k++){y=Math.max(y,e[k].x);v=Math.min(v,e[k].x)}var b=[],x=[],w;if(e[0].structure_ids){for(var k=0;k<e.length;k++){if(e[k].structure_ids.length>0){b.push(e[k])}else{x.push(e[k])}}if(b.length<1){w=[{color:"#52B4FA",data:x}]}else if(x.length<1){w=[{color:"#E63434",data:b}]}else{w=[{color:"#E63434",data:b},{color:"#52B4FA",data:x}]}window.data[t.substring(1)]=b.concat(x)}else{if(window.compareCandidate&&window.compareCandidate.peak_list){var S=p(window.compareCandidate.peak_list);for(k=0;k<S.length;k++){y=Math.min(y,S[k].x);v=Math.max(v,S[k].x)}if(i.mirror){S=S.map(function(t){return{x:t.x,y:t.y*-1,structure_ids:t.structure_ids,structure_urls:t.structure_urls,scores:t.scores}});l.append("div").attr("class","input_spectra_label").text("Input Spectra");l.append("div").attr("class","candidate_spectra_label").text("Candidate Spectra")}w=[{color:"#E63434",data:S,name:window.compareCandidate.compound},{color:"#52B4FA",data:e}];window.data=S.concat(e)}else{l.append("div").attr("class","input_spectra_label").text("Input Spectra");l.append("div").attr("class","candidate_spectra_label").text("Candidate Spectra");w=[{color:"#52B4FA",data:e},{color:"#52B4FA",data:e}];window.data=e}}console.log("before window data");console.log(window.data);var M=d();if(i.mirror){a=a*2}var T=new Rickshaw.Graph({element:h,width:M,height:a,xmin:y,renderer:"linebar",name:"Predicted Spectra",series:w.map(function(t){t.data=t.data.sort(function(t,e){return t.x-e.x});return t})});console.log("before");console.log(w);T.xMin=i.xMin||v-.1;T.xMax=i.xMax||0;T.yMin=i.yMin||(i.mirror?_-10:0);T.yMax=i.yMax||(i.mirror?g+10:0);new Rickshaw.Graph.Axis.Y({graph:T,orientation:"left",tickFormat:Rickshaw.Fixtures.Number.formatKMBT,ticks:i.mirror?10:5,element:u,grid:true,height:a});new Rickshaw.Graph.Axis.X({graph:T,orientation:"bottom",tickFormat:function(t){return t*-1},element:f,grid:false});new Rickshaw.Graph.HoverDetail({graph:T,formatter:function(t,e,n,i,r,s){var o=s.value.structure_ids;var a="";var l="";if(o){var c=o[0];var a="Fragment unknown<br>";if(c||c==0||s.value.structure_urls[0]){a='<img class="structure" src="'+s.value.structure_urls[0]+'" class="frag-structure" alt="Structure"><br>'}
777if(o.length>1){l=l.concat("<br>"+(o.length-1)+" other possible fragments.")}}var u;if(s.value.adduct_type){u='<div class="hover-box" style="width: 150px;">Adduct: '+s.value.adduct_type+"<br>chemical shift: "+e+"<br>intensity: "+n.toFixed(1).toString().replace("-","")+"</div>"}else{u='<div class="hover-box" style="width: 150px;">'+a+"chemical shift: "+e+"<br>intensity: "+n.toFixed(1).toString().replace("-","")+l+"</div>"}return u}});var C=function(){T.configure({width:d()});T.render()};var A=function(){T.configure({width:d()});console.log(T.series.splice(0,1));if(window.compareCandidate.peak_list){var t=p(window.compareCandidate.peak_list);if(i.mirror){t=t.map(function(t){return{x:t.x,y:t.y*-1,structure_ids:t.structure_ids,structure_urls:t.structure_urls,scores:t.scores}})}T.series.unshift({color:"#E63434",data:t,name:window.compareCandidate.compound});for(k=0;k<t.length;k++){y=Math.min(T.xMin,t[k].x);v=Math.max(T.xMax,t[k].x)}T.xMin=y;T.xMax=v;window.data=t.concat(T.series[1]);T.render()}};var D=function(){if(i.mirror){d3.selectAll("g.y_ticks text").html(function(){return $(this).html().replace("-","")});$("g.y_ticks g[transform='translate(0,"+a/2+")'] text").html("0");$("g[data-y-value=''] line").css("stroke-dasharray","none")}};window.addEventListener("resize",C);window.addEventListener("compare",A);T.render();D();T.onUpdate(D)};function submit_button_click(){$("#load-screen").show();$.ajax({complete:function(){$("#load-screen").hide()}})}function search_button_click(){$("#load-screen").show()}function mass_search_button_click(){$("#load-screen").show();if($("#query_from").val()!=""&&$("#query_to").val()!="")$("#load-screen").show();else $.ajax({complete:function(){$("#load-screen").hide()}})}function validateNmrSearch(){let t=true;if(!isValidPeakList()){displayPeakListErrors();t=false}if(t){$("#load-screen").show()}return t}function isValidPeakList(){let t=/[+-]?([0-9]*[.])?[0-9]+[\r\n]?/;if(!$("#peaks").val()){return false}else if(!t.test($("#peaks").val().trim())){return false}return true}function displayPeakListErrors(){showPeakListError();highlightPeakList()}function showPeakListError(){if(!$("#peaks").val()){$("#chemical-shift-error").html("You must enter at least one chemical shift!")}else{$("#chemical-shift-error").html("Please check your input! Check example for required input formatting.")}}function highlightPeakList(){setTimeout(function(){$("#peaks").addClass("active")},100);$("#peaks").removeClass("active").addClass("final").trigger("focus").select()}function isNumberKey(t){let e=t.which?t.which:t.keyCode;return!(e>31&&(e<48||e>57))}
778/*!
779 * jQuery UI Slider 1.12.1
780 * http://jqueryui.com
781 *
782 * Copyright jQuery Foundation and other contributors
783 * Released under the MIT license.
784 * http://jquery.org/license
785 */
786(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../keycode","../version","../widget"],t)}else{t(jQuery)}})(function(t){return t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:false,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:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;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=false},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var e,n,i=this.options,r=this.element.find(".ui-slider-handle"),s="<span tabindex='0'></span>",o=[];n=i.values&&i.values.length||1;if(r.length>n){r.slice(n).remove();r=r.slice(0,n)}for(e=r.length;e<n;e++){o.push(s)}this.handles=r.add(t(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(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;if(e.range){if(e.range===true){if(!e.values){e.values=[this._valueMin(),this._valueMin()]}else if(e.values.length&&e.values.length!==2){e.values=[e.values[0],e.values[0]]}else if(t.isArray(e.values)){e.values=e.values.slice(0)}}if(!this.range||!this.range.length){this.range=t("<div>").appendTo(this.element);this._addClass(this.range,"ui-slider-range")}else{this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max");this.range.css({left:"",bottom:""})}if(e.range==="min"||e.range==="max"){this._addClass(this.range,"ui-slider-range-"+e.range)}}else{if(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();if(this.range){this.range.remove()}this._mouseDestroy()},_mouseCapture:function(e){var n,i,r,s,o,a,l,c,u=this,h=this.options;if(h.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();n={x:e.pageX,y:e.pageY};i=this._normValueFromMouse(n);r=this._valueMax()-this._valueMin()+1;this.handles.each(function(e){var n=Math.abs(i-u.values(e));if(r>n||r===n&&(e===u._lastChangedValue||u.values(e)===h.min)){r=n;s=t(this);o=e}});a=this._start(e,o);if(a===false){return false}this._mouseSliding=true;this._handleIndex=o;this._addClass(s,null,"ui-state-active");s.trigger("focus");l=s.offset();c=!t(e.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}
786:{left:e.pageX-l.left-s.width()/2,top:e.pageY-l.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(e,o,i)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(e);this._slide(t,this._handleIndex,n);return false},_mouseStop:function(t){this._removeClass(this.handles,null,"ui-state-active");this._mouseSliding=false;this._stop(t,this._handleIndex);this._change(t,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,n,i,r,s;if(this.orientation==="horizontal"){e=this.elementSize.width;n=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;n=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}i=n/e;if(i>1){i=1}if(i<0){i=0}if(this.orientation==="vertical"){i=1-i}r=this._valueMax()-this._valueMin();s=this._valueMin()+i*r;return this._trimAlignValue(s)},_uiHash:function(t,e,n){var i={handle:this.handles[t],handleIndex:t,value:e!==undefined?e:this.value()};if(this._hasMultipleValues()){i.value=e!==undefined?e:this.values(t);i.values=n||this.values()}return i},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,n){var i,r,s=this.value(),o=this.values();if(this._hasMultipleValues()){r=this.values(e?0:1);s=this.values(e);if(this.options.values.length===2&&this.options.range===true){n=e===0?Math.min(r,n):Math.max(r,n)}o[e]=n}if(n===s){return}i=this._trigger("slide",t,this._uiHash(e,n,o));if(i===false){return}if(this._hasMultipleValues()){this.values(e,n)}else{this.value(n)}},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){this._lastChangedValue=e;this._trigger("change",t,this._uiHash(e))}},value:function(t){if(arguments.length){this.options.value=this._trimAlignValue(t);this._refreshValue();this._change(null,0);return}return this._value()},values:function(e,n){var i,r,s;if(arguments.length>1){this.options.values[e]=this._trimAlignValue(n);this._refreshValue();this._change(null,e);return}if(arguments.length){if(t.isArray(arguments[0])){i=this.options.values;r=arguments[0];for(s=0;s<i.length;s+=1){i[s]=this._trimAlignValue(r[s]);this._change(null,s)}this._refreshValue()}else{if(this._hasMultipleValues()){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(e,n){var i,r=0;if(e==="range"&&this.options.range===true){if(n==="min"){this.options.value=this._values(0);this.options.values=null}else if(n==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}if(t.isArray(this.options.values)){r=this.options.values.length}this._super(e,n);switch(e){case"orientation":this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(n)}this.handles.css(n==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=r-1;i>=0;i--){this._change(null,i)}this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break}},_setOptionDisabled:function(t){this._super(t);this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;t=this._trimAlignValue(t);return t},_values:function(t){var e,n,i;if(arguments.length){e=this.options.values[t];e=this._trimAlignValue(e);return e}else if(this._hasMultipleValues()){n=this.options.values.slice();for(i=0;i<n.length;i+=1){n[i]=this._trimAlignValue(n[i])}return n}else{return[]}},_trimAlignValue:function(t){if(t<=this._valueMin()){return this._valueMin()}if(t>=this._valueMax()){return this._valueMax()}var e=this.options.step>0?this.options.step:1,n=(t-this._valueMin())%e,i=t-n;if(Math.abs(n)*2>=e){i+=n>0?e:-e}return parseFloat(i.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),n=this.options.step,i=Math.round((t-e)/n)*n;t=i+e;if(t>this.options.max){t-=n}this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);
786if(this.options.min!==null){t=Math.max(t,this._precisionOf(this.options.min))}return t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".");return n===-1?0:e.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){if(t==="vertical"){this.range.css({width:"",left:""})}if(t==="horizontal"){this.range.css({height:"",bottom:""})}},_refreshValue:function(){var e,n,i,r,s,o=this.options.range,a=this.options,l=this,c=!this._animateOff?a.animate:false,u={};if(this._hasMultipleValues()){this.handles.each(function(i){n=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100;u[l.orientation==="horizontal"?"left":"bottom"]=n+"%";t(this).stop(1,1)[c?"animate":"css"](u,a.animate);if(l.options.range===true){if(l.orientation==="horizontal"){if(i===0){l.range.stop(1,1)[c?"animate":"css"]({left:n+"%"},a.animate)}if(i===1){l.range[c?"animate":"css"]({width:n-e+"%"},{queue:false,duration:a.animate})}}else{if(i===0){l.range.stop(1,1)[c?"animate":"css"]({bottom:n+"%"},a.animate)}if(i===1){l.range[c?"animate":"css"]({height:n-e+"%"},{queue:false,duration:a.animate})}}}e=n})}else{i=this.value();r=this._valueMin();s=this._valueMax();n=s!==r?(i-r)/(s-r)*100:0;u[this.orientation==="horizontal"?"left":"bottom"]=n+"%";this.handle.stop(1,1)[c?"animate":"css"](u,a.animate);if(o==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[c?"animate":"css"]({width:n+"%"},a.animate)}if(o==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[c?"animate":"css"]({width:100-n+"%"},a.animate)}if(o==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[c?"animate":"css"]({height:n+"%"},a.animate)}if(o==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[c?"animate":"css"]({height:100-n+"%"},a.animate)}}},_handleEvents:{keydown:function(e){var n,i,r,s,o=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:e.preventDefault();if(!this._keySliding){this._keySliding=true;this._addClass(t(e.target),null,"ui-state-active");n=this._start(e,o);if(n===false){return}}break}s=this.options.step;if(this._hasMultipleValues()){i=r=this.values(o)}else{i=r=this.value()}switch(e.keyCode){case t.ui.keyCode.HOME:r=this._valueMin();break;case t.ui.keyCode.END:r=this._valueMax();break;case t.ui.keyCode.PAGE_UP:r=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:r=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax()){return}r=this._trimAlignValue(i+s);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin()){return}r=this._trimAlignValue(i-s);break}this._slide(e,o,r)},keyup:function(e){var n=t(e.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(e,n);this._change(e,n);this._removeClass(t(e.target),null,"ui-state-active")}}}})});(function(){$(function(){if($("#unearth-advanced-search").length){$("#add-condition").on("click",function(){var t,e;t=$("#search-fields").data("index");e="/unearth/advanced/"+t+"/field";return $.get(e,function(t){return $("#search-fields").append(t).trigger("change")})});$("#add-display-field").on("click",function(){var t,e;t=$("#display-fields").data("index");e="/unearth/advanced/"+t+"/display_field";return $.get(e,function(t){return $("#display-fields").append(t).trigger("change")})});$("#load-example").on("click",function(){var t,e;t=$("#display-fields").data("index");e="/unearth/advanced/"+t+"/display_field";if($("#display-fields > .condition.display-field").length===0){$.get(e,function(t){return $("#display-fields").append(t).trigger("change")});e="/unearth/advanced/"+t+"/field";return $.get(e,function(t){$("#search-fields").append(t).trigger("change");return $(".value > input").val("Alanine")})}});$("#unearth-advanced-search").on("click",".remove-condition",function(){return $(this).parents(".condition").fadeOut(300,function(){$(this).remove();return $("#unearth-advanced-search").trigger("change")})});$("#unearth-advanced-search").on("change",function(){if($(this).find(".search-condition").length<=0){$("#search-field-instruction").fadeIn()}else{$("#search-field-instruction").fadeOut()}if($(this).find(".display-field").length<=0){return $("#display-field-instruction").fadeIn()}else{return $("#display-field-instruction").fadeOut()}});return $("#add-range-condition").on("click",function(){var t,e;t=$("#search-fields").data("index");e="/unearth/advanced/"+t+"/field?name=mono_mass";return $.get(e,function(t){return $("#search-fields").append(t).trigger("change")})})}});$(function(){if($("#unearth-advanced-search").length){return $("#unearth-advanced-search").on("keypress",".value input",function(t){if(t.which===13){return t.preventDefault()}})}});$(function(){return $("#search-fields").on("change",".field-select select",function(t){var e,n,i,r;i=$(t.currentTarget).find("option:selected");e=i.attr("value");n=$("#search-fields").data("index");r="/unearth/advanced/"+n+"/field?name="+e;return $.get(r,function(e){return $(t.currentTarget).parents(".search-condition").replaceWith(e)})})});$(function(){return $("#search-fields").on("change",".predicate-select select",function(t){var e,n,i;e=$(t.currentTarget).find("option:selected");n=e.attr("value");
786i=$(this).parent().parent().children(".value").children("input");if(n==="is_present"||n==="is_blank"){i.val("*");return i.hide()}else{i.val("");return i.show()}})});$(function(){if($("#unearth-advanced-results").length>0){return $("#unearth-advanced-export").click(function(){var t;t=$("#unearth-advanced-search").attr("action");$("#unearth-advanced-search").attr("action",$(this).attr("href"));$("#unearth-advanced-search").submit();$("#unearth-advanced-search").attr("action",t);return false})}})}).call(this);
787/*!
788 * jQuery Form Plugin
789 * version: 3.28.0-2013.02.06
790 * @requires jQuery v1.5 or later
791 *
792 * Examples and documentation at: http://malsup.com/jquery/form/
793 * Project repository: https://github.com/malsup/form
794 * Dual licensed under the MIT and GPL licenses:
795 *    http://malsup.github.com/mit-license.txt
796 *    http://malsup.github.com/gpl-license-v2.txt
797 */(function(t){"use strict";var e={};e.fileapi=t("<input type='file'/>").get(0).files!==undefined;e.formdata=window.FormData!==undefined;t.fn.ajaxSubmit=function(n){if(!this.length){r("ajaxSubmit: skipping submit process - no element selected");return this}var i,s,o,a=this;if(typeof n=="function"){n={success:n}}i=this.attr("method");s=this.attr("action");o=typeof s==="string"?t.trim(s):"";o=o||window.location.href||"";if(o){o=(o.match(/^([^#]+)/)||[])[1]}n=t.extend(true,{url:o,success:t.ajaxSettings.success,type:i||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},n);var l={};this.trigger("form-pre-serialize",[this,n,l]);if(l.veto){r("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(n.beforeSerialize&&n.beforeSerialize(this,n)===false){r("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var c=n.traditional;if(c===undefined){c=t.ajaxSettings.traditional}var u=[];var h,f=this.formToArray(n.semantic,u);if(n.data){n.extraData=n.data;h=t.param(n.data,c)}if(n.beforeSubmit&&n.beforeSubmit(f,this,n)===false){r("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[f,this,n,l]);if(l.veto){r("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=t.param(f,c);if(h){d=d?d+"&"+h:h}if(n.type.toUpperCase()=="GET"){n.url+=(n.url.indexOf("?")>=0?"&":"?")+d;n.data=null}else{n.data=d}var p=[];if(n.resetForm){p.push(function(){a.resetForm()})}if(n.clearForm){p.push(function(){a.clearForm(n.includeHidden)})}if(!n.dataType&&n.target){var m=n.success||function(){};p.push(function(e){var i=n.replaceTarget?"replaceWith":"html";t(n.target)[i](e).each(m,arguments)})}else if(n.success){p.push(n.success)}n.success=function(t,e,i){var r=n.context||this;for(var s=0,o=p.length;s<o;s++){p[s].apply(r,[t,e,i||a,a])}};var g=t('input[type=file]:enabled[value!=""]',this);var _=g.length>0;var v="multipart/form-data";var y=a.attr("enctype")==v||a.attr("encoding")==v;var b=e.fileapi&&e.formdata;r("fileAPI :"+b);var x=(_||y)&&!b;var w;if(n.iframe!==false&&(n.iframe||x)){if(n.closeKeepAlive){t.get(n.closeKeepAlive,function(){w=T(f)})}else{w=T(f)}}else if((_||y)&&b){w=M(f)}else{w=t.ajax(n)}a.removeData("jqxhr").data("jqxhr",w);for(var k=0;k<u.length;k++)u[k]=null;this.trigger("form-submit-notify",[this,n]);return this;function S(e){var n=t.param(e).split("&");var i=n.length;var r=[];var s,o;for(s=0;s<i;s++){n[s]=n[s].replace(/\+/g," ");o=n[s].split("=");r.push([decodeURIComponent(o[0]),decodeURIComponent(o[1])])}return r}function M(e){var r=new FormData;for(var s=0;s<e.length;s++){r.append(e[s].name,e[s].value)}if(n.extraData){var o=S(n.extraData);for(s=0;s<o.length;s++)if(o[s])r.append(o[s][0],o[s][1])}n.data=null;var a=t.extend(true,{},t.ajaxSettings,n,{contentType:false,processData:false,cache:false,type:i||"POST"});if(n.uploadProgress){a.xhr=function(){var t=jQuery.ajaxSettings.xhr();if(t.upload){t.upload.addEventListener("progress",function(t){var e=0;var i=t.loaded||t.position;var r=t.total;if(t.lengthComputable){e=Math.ceil(i/r*100)}n.uploadProgress(t,i,r,e)},false)}return t}}a.data=null;var l=a.beforeSend;a.beforeSend=function(t,e){e.data=r;if(l)l.call(this,t,e)};return t.ajax(a)}function T(e){var s=a[0],o,l,c,h,f,d,p,m,g,_,v,y;var b=!!t.fn.prop;var x=t.Deferred();if(e){for(l=0;l<u.length;l++){o=t(u[l]);
797if(b)o.prop("disabled",false);else o.removeAttr("disabled")}}c=t.extend(true,{},t.ajaxSettings,n);c.context=c.context||c;f="jqFormIO"+(new Date).getTime();if(c.iframeTarget){d=t(c.iframeTarget);_=d.attr("name");if(!_)d.attr("name",f);else f=_}else{d=t('<iframe name="'+f+'" src="'+c.iframeSrc+'" />');d.css({position:"absolute",top:"-1000px",left:"-1000px"})}p=d[0];m={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var n=e==="timeout"?"timeout":"aborted";r("aborting upload... "+n);this.aborted=1;try{if(p.contentWindow.document.execCommand){p.contentWindow.document.execCommand("Stop")}}catch(i){}d.attr("src",c.iframeSrc);m.error=n;if(c.error)c.error.call(c.context,m,n,e);if(h)t.event.trigger("ajaxError",[m,c,n]);if(c.complete)c.complete.call(c.context,m,n)}};h=c.global;if(h&&0===t.active++){t.event.trigger("ajaxStart")}if(h){t.event.trigger("ajaxSend",[m,c])}if(c.beforeSend&&c.beforeSend.call(c.context,m,c)===false){if(c.global){t.active--}x.reject();return x}if(m.aborted){x.reject();return x}g=s.clk;if(g){_=g.name;if(_&&!g.disabled){c.extraData=c.extraData||{};c.extraData[_]=g.value;if(g.type=="image"){c.extraData[_+".x"]=s.clk_x;c.extraData[_+".y"]=s.clk_y}}}var w=1;var k=2;function S(t){var e=t.contentWindow?t.contentWindow.document:t.contentDocument?t.contentDocument:t.document;return e}var M=t("meta[name=csrf-token]").attr("content");var T=t("meta[name=csrf-param]").attr("content");if(T&&M){c.extraData=c.extraData||{};c.extraData[T]=M}function C(){var e=a.attr("target"),n=a.attr("action");s.setAttribute("target",f);if(!i){s.setAttribute("method","POST")}if(n!=c.url){s.setAttribute("action",c.url)}if(!c.skipEncodingOverride&&(!i||/post/i.test(i))){a.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(c.timeout){y=setTimeout(function(){v=true;z(w)},c.timeout)}function o(){try{var t=S(p).readyState;r("state = "+t);if(t&&t.toLowerCase()=="uninitialized")setTimeout(o,50)}catch(e){r("Server abort: ",e," (",e.name,")");z(k);if(y)clearTimeout(y);y=undefined}}var l=[];try{if(c.extraData){for(var u in c.extraData){if(c.extraData.hasOwnProperty(u)){if(t.isPlainObject(c.extraData[u])&&c.extraData[u].hasOwnProperty("name")&&c.extraData[u].hasOwnProperty("value")){l.push(t('<input type="hidden" name="'+c.extraData[u].name+'">').val(c.extraData[u].value).appendTo(s)[0])}else{l.push(t('<input type="hidden" name="'+u+'">').val(c.extraData[u]).appendTo(s)[0])}}}}if(!c.iframeTarget){d.appendTo("body");if(p.attachEvent)p.attachEvent("onload",z);else p.addEventListener("load",z,false)}setTimeout(o,15);try{s.submit()}catch(m){var h=document.createElement("form").submit;h.apply(s)}}finally{s.setAttribute("action",n);if(e){s.setAttribute("target",e)}else{a.removeAttr("target")}t(l).remove()}}if(c.forceSync){C()}else{setTimeout(C,10)}var A,D,E=50,N;function z(e){if(m.aborted||N){return}try{D=S(p)}catch(_){r("cannot access response document: ",_);e=k}if(e===w&&m){m.abort("timeout");x.reject(m,"timeout");return}else if(e==k&&m){m.abort("server abort");x.reject(m,"error","server abort");return}if(!D||D.location.href==c.iframeSrc){if(!v)return}if(p.detachEvent)p.detachEvent("onload",z);else p.removeEventListener("load",z,false);var n="success",i;try{if(v){throw"timeout"}var s=c.dataType=="xml"||D.XMLDocument||t.isXMLDoc(D);r("isXml="+s);if(!s&&window.opera&&(D.body===null||!D.body.innerHTML)){if(--E){r("requeing onLoad callback, DOM not available");setTimeout(z,250);return}}var o=D.body?D.body:D.documentElement;m.responseText=o?o.innerHTML:null;m.responseXML=D.XMLDocument?D.XMLDocument:D;if(s)c.dataType="xml";m.getResponseHeader=function(t){var e={"content-type":c.dataType};return e[t]};if(o){m.status=Number(o.getAttribute("status"))||m.status;m.statusText=o.getAttribute("statusText")||m.statusText}var a=(c.dataType||"").toLowerCase();var l=/(json|script|text)/.test(a);if(l||c.textarea){var u=D.getElementsByTagName("textarea")[0];if(u){m.responseText=u.value;m.status=Number(u.getAttribute("status"))||m.status;m.statusText=u.getAttribute("statusText")||m.statusText}else if(l){var f=D.getElementsByTagName("pre")[0];var g=D.getElementsByTagName("body")[0];if(f){m.responseText=f.textContent?f.textContent:f.innerText}else if(g){m.responseText=g.textContent?g.textContent:g.innerText}}}else if(a=="xml"&&!m.responseXML&&m.responseText){m.responseXML=P(m.responseText)}try{A=I(m,a,c)}catch(b){n="parsererror";m.error=i=b||n}}catch(b){r("error caught: ",b);n="error";m.error=i=b||n}if(m.aborted){r("upload aborted");n=null}if(m.status){n=m.status>=200&&m.status<300||m.status===304?"success":"error"}if(n==="success"){if(c.success)c.success.call(c.context,A,"success",m);x.resolve(m.responseText,"success",m);if(h)t.event.trigger("ajaxSuccess",[m,c])}else if(n){if(i===undefined)i=m.statusText;if(c.error)c.error.call(c.context,m,n,i);x.reject(m,"error",i);if(h)t.event.trigger("ajaxError",[m,c,i])}if(h)t.event.trigger("ajaxComplete",[m,c]);if(h&&!--t.active){t.event.trigger("ajaxStop")}if(c.complete)c.complete.call(c.context,m,n);N=true;if(c.timeout)clearTimeout(y);setTimeout(function(){if(!c.iframeTarget)d.remove();m.responseXML=null},100)}var P=t.parseXML||function(t,e){if(window.ActiveXObject){e=new ActiveXObject("Microsoft.XMLDOM");e.async="false";e.loadXML(t)}else{e=(new DOMParser).parseFromString(t,"text/xml")}return e&&e.documentElement&&e.documentElement.nodeName!="parsererror"?e:null};var j=t.parseJSON||function(t){return window["eval"]("("+t+")")};var I=function(e,n,i){var r=e.getResponseHeader("content-type")||"",s=n==="xml"||!n&&r.indexOf("xml")>=0,o=s?e.responseXML:e.responseText;if(s&&o.documentElement.nodeName==="parsererror"){if(t.error)t.error("parsererror")}if(i&&i.dataFilter){o=i.dataFilter(o,n)}if(typeof o==="string"){if(n==="json"||!n&&r.indexOf("json")>=0){o=j(o)}else if(n==="script"||!n&&r.indexOf("javascript")>=0){t.globalEval(o)}}return o};return x}};t.fn.ajaxForm=function(e){e=e||{};e.delegation=e.delegation&&t.isFunction(t.fn.on);if(!e.delegation&&this.length===0){var s={s:this.selector,c:this.context};if(!t.isReady&&s.s){r("DOM not ready, queuing ajaxForm");t(function(){t(s.s,s.c).ajaxForm(e)});return this}r("terminating; zero elements found by selector"+(t.isReady?"":" (DOM not ready)"));return this}if(e.delegation){t(document).off("submit.form-plugin",this.selector,n).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,n).on("click.form-plugin",this.selector,e,i);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",e,n).bind("click.form-plugin",e,i)};function n(e){var n=e.data;if(!e.isDefaultPrevented()){e.preventDefault();t(this).ajaxSubmit(n)}}function i(e){var n=e.target;var i=t(n);if(!i.is("[type=submit],[type=image]")){var r=i.closest("[type=submit]");if(r.length===0){return}n=r[0]}var s=this;s.clk=n;
797if(n.type=="image"){if(e.offsetX!==undefined){s.clk_x=e.offsetX;s.clk_y=e.offsetY}else if(typeof t.fn.offset=="function"){var o=i.offset();s.clk_x=e.pageX-o.left;s.clk_y=e.pageY-o.top}else{s.clk_x=e.pageX-n.offsetLeft;s.clk_y=e.pageY-n.offsetTop}}setTimeout(function(){s.clk=s.clk_x=s.clk_y=null},100)}t.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};t.fn.formToArray=function(n,i){var r=[];if(this.length===0){return r}var s=this[0];var o=n?s.getElementsByTagName("*"):s.elements;if(!o){return r}var a,l,c,u,h,f,d;for(a=0,f=o.length;a<f;a++){h=o[a];c=h.name;if(!c){continue}if(n&&s.clk&&h.type=="image"){if(!h.disabled&&s.clk==h){r.push({name:c,value:t(h).val(),type:h.type});r.push({name:c+".x",value:s.clk_x},{name:c+".y",value:s.clk_y})}continue}u=t.fieldValue(h,true);if(u&&u.constructor==Array){if(i)i.push(h);for(l=0,d=u.length;l<d;l++){r.push({name:c,value:u[l]})}}else if(e.fileapi&&h.type=="file"&&!h.disabled){if(i)i.push(h);var p=h.files;if(p.length){for(l=0;l<p.length;l++){r.push({name:c,value:p[l],type:h.type})}}else{r.push({name:c,value:"",type:h.type})}}else if(u!==null&&typeof u!="undefined"){if(i)i.push(h);r.push({name:c,value:u,type:h.type,required:h.required})}}if(!n&&s.clk){var m=t(s.clk),g=m[0];c=g.name;if(c&&!g.disabled&&g.type=="image"){r.push({name:c,value:m.val()});r.push({name:c+".x",value:s.clk_x},{name:c+".y",value:s.clk_y})}}return r};t.fn.formSerialize=function(e){return t.param(this.formToArray(e))};t.fn.fieldSerialize=function(e){var n=[];this.each(function(){var i=this.name;if(!i){return}var r=t.fieldValue(this,e);if(r&&r.constructor==Array){for(var s=0,o=r.length;s<o;s++){n.push({name:i,value:r[s]})}}else if(r!==null&&typeof r!="undefined"){n.push({name:this.name,value:r})}});return t.param(n)};t.fn.fieldValue=function(e){for(var n=[],i=0,r=this.length;i<r;i++){var s=this[i];var o=t.fieldValue(s,e);if(o===null||typeof o=="undefined"||o.constructor==Array&&!o.length){continue}if(o.constructor==Array)t.merge(n,o);else n.push(o)}return n};t.fieldValue=function(e,n){var i=e.name,r=e.type,s=e.tagName.toLowerCase();if(n===undefined){n=true}if(n&&(!i||e.disabled||r=="reset"||r=="button"||(r=="checkbox"||r=="radio")&&!e.checked||(r=="submit"||r=="image")&&e.form&&e.form.clk!=e||s=="select"&&e.selectedIndex==-1)){return null}if(s=="select"){var o=e.selectedIndex;if(o<0){return null}var a=[],l=e.options;var c=r=="select-one";var u=c?o+1:l.length;for(var h=c?o:0;h<u;h++){var f=l[h];if(f.selected){var d=f.value;if(!d){d=f.attributes&&f.attributes["value"]&&!f.attributes["value"].specified?f.text:f.value}if(c){return d}a.push(d)}}return a}return t(e).val()};t.fn.clearForm=function(e){return this.each(function(){t("input,select,textarea",this).clearFields(e)})};t.fn.clearFields=t.fn.clearInputs=function(e){var n=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var i=this.type,r=this.tagName.toLowerCase();if(n.test(i)||r=="textarea"){this.value=""}else if(i=="checkbox"||i=="radio"){this.checked=false}else if(r=="select"){this.selectedIndex=-1}else if(i=="file"){if(/MSIE/.test(navigator.userAgent)){t(this).replaceWith(t(this).clone())}else{t(this).val("")}}else if(e){if(e===true&&/hidden/.test(i)||typeof e=="string"&&t(this).is(e))this.value=""}})};t.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType){this.reset()}})};t.fn.enable=function(t){if(t===undefined){t=true}return this.each(function(){this.disabled=!t})};t.fn.selected=function(e){if(e===undefined){e=true}return this.each(function(){var n=this.type;if(n=="checkbox"||n=="radio"){this.checked=e}else if(this.tagName.toLowerCase()=="option"){var i=t(this).parent("select");if(e&&i[0]&&i[0].type=="select-one"){i.find("option").selected(false)}this.selected=e}})};t.fn.ajaxSubmit.debug=false;function r(){if(!t.fn.ajaxSubmit.debug)return;var e="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(e)}else if(window.opera&&window.opera.postError){window.opera.postError(e)}}})(jQuery);
798/**
799 * Timeago is a jQuery plugin that makes it easy to support automatically
800 * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
801 *
802 * @name timeago
803 * @version 1.1.0
804 * @requires jQuery v1.2.3+
805 * @author Ryan McGeary
806 * @license MIT License - http://www.opensource.org/licenses/mit-license.php
807 *
808 * For usage and examples, visit:
809 * http://timeago.yarp.com/
810 *
811 * Copyright (c) 2008-2013, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
812 */
813/**
814 * Timeago is a jQuery plugin that makes it easy to support automatically
815 * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
816 *
817 * @name timeago
818 * @version 1.1.0
819 * @requires jQuery v1.2.3+
820 * @author Ryan McGeary
821 * @license MIT License - http://www.opensource.org/licenses/mit-license.php
822 *
823 * For usage and examples, visit:
824 * http://timeago.yarp.com/
825 *
826 * Copyright (c) 2008-2013, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
827 */
828(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)}else{t(jQuery)}})(function(t){t.timeago=function(e){if(e instanceof Date){return s(e)}else if(typeof e==="string"){return s(t.timeago.parse(e))}else if(typeof e==="number"){return s(new Date(e))}else{return s(t.timeago.datetime(e))}};var e=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(e){var n=this.settings.strings;var i=n.prefixAgo;var r=n.suffixAgo;if(this.settings.allowFuture){if(e<0){i=n.prefixFromNow;r=n.suffixFromNow}}var s=Math.abs(e)/1e3;var o=s/60;var a=o/60;var l=a/24;var c=l/365;function u(i,r){var s=t.isFunction(i)?i(r,e):i;var o=n.numbers&&n.numbers[r]||r;return s.replace(/%d/i,o)}var h=s<45&&u(n.seconds,Math.round(s))||s<90&&u(n.minute,1)||o<45&&u(n.minutes,Math.round(o))||o<90&&u(n.hour,1)||a<24&&u(n.hours,Math.round(a))||a<42&&u(n.day,1)||l<30&&u(n.days,Math.round(l))||l<45&&u(n.month,1)||l<365&&u(n.months,Math.round(l/30))||c<1.5&&u(n.year,1)||u(n.years,Math.round(c));var f=n.wordSeparator||"";if(n.wordSeparator===undefined){f=" "}return t.trim([i,h,r].join(f))},parse:function(e){var n=t.trim(e);n=n.replace(/\.\d+/,"");n=n.replace(/-/,"/").replace(/-/,"/");n=n.replace(/T/," ").replace(/Z/," UTC");n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");return new Date(n)},datetime:function(n){var i=e.isTime(n)?t(n).attr("datetime"):t(n).attr("title");return e.parse(i)},isTime:function(e){return t(e).get(0).tagName.toLowerCase()==="time"}});var n={init:function(){var n=t.proxy(i,this);n();var r=e.settings;if(r.refreshMillis>0){setInterval(n,r.refreshMillis)}},update:function(n){t(this).data("timeago",{datetime:e.parse(n)});i.apply(this)}};t.fn.timeago=function(t,e){var i=t?n[t]:n.init;if(!i){throw new Error("Unknown function name '"+t+"' for timeago")}this.each(function(){i.call(this,e)});return this};function i(){var e=r(this);if(!isNaN(e.datetime)){t(this).text(s(e.datetime))}return this}function r(n){n=t(n);if(!n.data("timeago")){n.data("timeago",{datetime:e.datetime(n)});var i=t.trim(n.text());if(i.length>0&&!(e.isTime(n)&&n.attr("title"))){n.attr("title",i)}}return n.data("timeago")}function s(t){return e.inWords(o(t))}function o(t){return(new Date).getTime()-t.getTime()}document.createElement("abbr");document.createElement("time")}
828);(function(){$(function(){var t,e,n,i;$(".select-all").button().click(function(t){t.preventDefault();return $(this).parents("form").find(":checkbox").attr("checked","checked")});$(".clear-all").button().click(function(t){t.preventDefault();return $(this).parents("form").find(":checkbox").removeAttr("checked")});i=function(){return $("span.status").fadeOut(300,function(){return $(this).remove()})};n=function(t){$(".extractor-ui .header").append(t);return setTimeout(i,1e4)};e=function(t,e,i,r){var s;s='<span class="status alert alert-success">\n  Succesfully submitted.\n  <a href="/unearth/extractions" target="_blank" >Download your extractions here.</a>\n</span>';return n(s)};t=function(t,e,i,r){var s;s="<span class='status alert alert-failure'>\n  There was an error submitting your request.\n</span> ";return n(s)};$(".extractor-ui form").submit(function(n){var i,r;n.preventDefault();i=$(this);i.parents("div.extractor-form").slideUp();r=i.parents(".extractor-ui");$("html, body").animate({scrollTop:r.offset().top},500);return i.ajaxSubmit({success:e,failure:t})});return $(".extractor-ui a.show").click(function(t){var e;t.preventDefault();e=$(this);return e.parents(".extractor-ui").find("div.extractor-form").slideToggle(function(){return $("span.glyphicon",e).toggleClass("glyphicon-chevron-up").toggleClass("glyphicon-chevron-down")})})});$(function(){var t,e,n,i,r,s;if($("#extraction-jobs").length){i=function(t){return function(t){return $.getJSON("/unearth/extractions.json",t)}}(this);t=function(t){return"<a href='/extractions/"+t.id+"."+t.output_format+".zip'\ntarget='_blank' class=\"download-link btn btn-default btn-xs\"\n>Download File</a>"};n=function(){return i(function(t){var n,i,r;for(n=0,r=t.length;n<r;n++){i=t[n];e(i)}return s()})};e=function(t){var e;e="<tr id='job-"+t.id+"'>\n  <td>"+t.output_format.toUpperCase()+" File</td>\n  <td class='status'>"+t.status+"</td>\n  <td class='timeago' title=\""+t.created_at+'">\n    '+t.created_at+'\n  </td>\n  <td class=\'progress-container\'>\n    <div class="progress progress-striped active">\n      <div class=\'progress-bar\' role="progressbar" style="width: 0%"></div>\n    </div>\n  </td>\n</tr>';$("#extraction-jobs tbody").prepend(e);$("#job-"+t.id+" .timeago").timeago();return r(t)};r=function(e){if(e.status==="job failed"){$("#job-"+e.id+" .progress").remove()}else if(e.status==="complete"){$("#job-"+e.id+" td.progress-container").html(t(e))}else if(e.progress<100){$("#job-"+e.id+" .progress-bar").css("width",e.progress+"%")}return $("#job-"+e.id+" .status").html(e.status)};s=function(){i(function(t){return $.each(t,function(n,i){var s,o,a;if($("#job-"+i.id).length){a=[];for(s=0,o=t.length;s<o;s++){i=t[s];a.push(r(i))}return a}else{return e(i)}})});return setTimeout(s,5e3)};return n()}})}).call(this);(function(){$(function(){$(".filter-clear").on("click",function(){$(".checkbox-filter").each(function(){return $(this).prop("checked",false)});$(".filter-bar-list textarea").each(function(){return $(this).val("")}
828);return $(this).parents("form").submit()});$(".filter-group-list-section .checkbox").each(function(){return $(".filter-list-toggle",$(this).parent()).toggle($("input",$(this)).prop("checked"))});$(".filter-group-list-section .checkbox").on("click",function(){var t;t=$(this).parent();if($("input",$(this)).prop("checked")){if($(".filter-list-choice input:radio:checked",t).length===0){$(".filter-list-choice input:radio",t).first().prop("checked",true)}return $(".filter-list-toggle",t).slideDown("fast")}else{return $(".filter-list-toggle",t).slideUp("fast")}});return $(".filter-list-example a").click(function(t){var e;t.preventDefault();e=$(this).data("example");if(e!==void 0){return $(".filter-bar-list textarea",$(this).parents(".filter-list-toggle")).val(e)}})})}).call(this);(function(){$(function(){return $(".seq-search-example-loader").click(function(){var t,e;e=$(this).data("update");t=$(this).data("example");$("#"+e).val(t);return false})})}).call(this);(function(){on_ready(function(){return $(".example-loader").click(function(t){var e,n,i,r;i=$(t.currentTarget).closest(".moldbi-search-form");e=JSON.parse($(t.currentTarget).data("example").replace(/'/g,""));for(n in e){r=e[n];i.find("#"+n).val(r)}return t.preventDefault()})})}).call(this);
829/*!
830 * jQuery UI Menu 1.12.1
831 * http://jqueryui.com
832 *
833 * Copyright jQuery Foundation and other contributors
834 * Released under the MIT license.
835 * http://jquery.org/license
836 */
837/*!
838 * jQuery UI Menu 1.12.1
839 * http://jqueryui.com
840 *
841 * Copyright jQuery Foundation and other contributors
842 * Released under the MIT license.
843 * http://jquery.org/license
844 */
845(function(t){if(typeof define==="function"&&define.amd){define(["jquery","../keycode","../position","../safe-active-element","../unique-id","../version","../widget"],t)}else{t(jQuery)}})(function(t){return t.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=false;this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu","ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target);var i=t(t.ui.safeActiveElement(this.document[0]));if(!this.mouseHandled&&n.not(".ui-state-disabled").length){this.select(e);if(!e.isPropagationStopped()){this.mouseHandled=true}if(n.has(".ui-menu").length){this.expand(e)}else if(!this.element.is(":focus")&&i.closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer)}}}},"mouseenter .ui-menu-item":function(e){if(this.previousFilter){return}var n=t(e.target).closest(".ui-menu-item"),i=t(e.currentTarget);if(n[0]!==i[0]){return}this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active");this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);if(!e){this.focus(t,n)}},blur:function(e){this._delay(function(){var n=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));if(n){this.collapseAll(e)}})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(t){if(this._closeOnDocumentClick(t)){this.collapseAll(t)}this.mouseHandled=false}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),n=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled "+"tabIndex").removeUniqueId().show();n.children().each(function(){var e=t(this);if(e.data("ui-menu-submenu-caret")){e.remove()}})},_keydown:function(e){var n,i,r,s,o=true;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(e)}break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:o=false;i=this.previousFilter||"";s=false;r=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode);clearTimeout(this.filterTimer);if(r===i){s=true}else{r=i+r}n=this._filterMenuItems(r);n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n;if(!n.length){r=String.fromCharCode(e.keyCode);n=this._filterMenuItems(r)}if(n.length){this.focus(e,n);this.previousFilter=r;this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)}else{delete this.previousFilter}}if(o){e.preventDefault()}},_activate:function(t){if(this.active&&!this.active.is(".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(t)}else{this.select(t)}}},refresh:function(){var e,n,i,r,s,o=this,a=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);i=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),n=e.prev(),i=t("<span>").data("ui-menu-submenu-caret",true);o._addClass(i,"ui-menu-icon","ui-icon "+a);n.attr("aria-haspopup","true").prepend(i);e.attr("aria-labelledby",n.attr("id"))});this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front");e=l.add(this.element);n=e.find(this.options.items);n.not(".ui-menu-item").each(function(){var e=t(this);if(o._isDivider(e)){o._addClass(e,"ui-menu-divider","ui-widget-content")}});r=n.not(".ui-menu-item, .ui-menu-divider");s=r.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()});this._addClass(r,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper");
845n.filter(".ui-state-disabled").attr("aria-disabled","true");if(this.active&&!t.contains(this.element[0],this.active[0])){this.blur()}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if(t==="icons"){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t);this.element.attr("aria-disabled",String(t));this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var n,i,r;this.blur(t,t&&t.type==="focus");this._scrollIntoView(e);this.active=e.first();i=this.active.children(".ui-menu-item-wrapper");this._addClass(i,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",i.attr("id"))}r=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper");this._addClass(r,null,"ui-state-active");if(t&&t.type==="keydown"){this._close()}else{this.timer=this._delay(function(){this._close()},this.delay)}n=e.children(".ui-menu");if(n.length&&t&&/^mouse/.test(t.type)){this._startOpening(n)}this.activeMenu=e.parent();this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,i,r,s,o,a;if(this._hasScroll()){n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0;i=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0;r=e.offset().top-this.activeMenu.offset().top-n-i;s=this.activeMenu.scrollTop();o=this.activeMenu.height();a=e.outerHeight();if(r<0){this.activeMenu.scrollTop(s+r)}else if(r+a>o){this.activeMenu.scrollTop(s+r-o+a)}}},blur:function(t,e){if(!e){clearTimeout(this.timer)}if(!this.active){return}this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",t,{item:this.active});this.active=null},_startOpening:function(t){clearTimeout(this.timer);if(t.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();this._open(t)},this.delay)},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true");e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer);this.timer=this._delay(function(){var i=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));if(!i.length){i=this.element}this._close(i);this.blur(e);this._removeClass(i.find(".ui-state-active"),null,"ui-state-active");this.activeMenu=i},this.delay)},_close:function(t){if(!t){t=this.active?this.active.parent():this.element}t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(e&&e.length){this._close();this.focus(t,e)}},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();if(e&&e.length){this._open(e.parent());this._delay(function(){this.focus(t,e)})}},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var i;if(this.active){if(t==="first"||t==="last"){i=this.active[t==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1)}else{i=this.active[t+"All"](".ui-menu-item").eq(0)}}if(!i||!i.length||!this.active){i=this.activeMenu.find(this.options.items)[e]()}this.focus(n,i)},nextPage:function(e){var n,i,r;if(!this.active){this.next(e);return}if(this.isLastItem()){return}if(this._hasScroll()){i=this.active.offset().top;r=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){n=t(this);return n.offset().top-i-r<0});this.focus(e,n)}else{this.focus(e,this.activeMenu.find(this.options.items)[!this.active?"first":"last"]())}},previousPage:function(e){var n,i,r;if(!this.active){this.next(e);return}if(this.isFirstItem()){return}if(this._hasScroll()){i=this.active.offset().top;r=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){n=t(this);return n.offset().top-i+r>0});this.focus(e,n)}else{this.focus(e,this.activeMenu.find(this.options.items).first())}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var n={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(e,true)}this._trigger("select",e,n)},_filterMenuItems:function(e){var n=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),i=new RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return i.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}})});
846/*!
847 * jQuery UI Autocomplete 1.12.1
848 * http://jqueryui.com
849 *
850 * Copyright jQuery Foundation and other contributors
851 * Released under the MIT license.
852 * http://jquery.org/license
853 */
854/*!
855 * jQuery UI Autocomplete 1.12.1
856 * http://jqueryui.com
857 *
858 * Copyright jQuery Foundation and other contributors
859 * Released under the MIT license.
860 * http://jquery.org/license
861 */
862(function(t){if(typeof define==="function"&&define.amd){define(["jquery","./menu","../keycode","../position","../safe-active-element","../version","../widget"],t)}else{t(jQuery)}})(function(t){t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,n,i,r=this.element[0].nodeName.toLowerCase(),s=r==="textarea",o=r==="input";this.isMultiLine=s||!o&&this._isContentEditable(this.element);this.valueMethod=this.element[s||o?"val":"text"];this.isNewMenu=true;this._addClass("ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly")){e=true;i=true;n=true;return}e=false;i=false;n=false;var s=t.ui.keyCode;switch(r.keyCode){case s.PAGE_UP:e=true;this._move("previousPage",r);break;case s.PAGE_DOWN:e=true;this._move("nextPage",r);break;case s.UP:e=true;this._keyEvent("previous",r);break;case s.DOWN:e=true;this._keyEvent("next",r);break;case s.ENTER:if(this.menu.active){e=true;r.preventDefault();this.menu.select(r)}break;case s.TAB:if(this.menu.active){this.menu.select(r)}break;case s.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term)}this.close(r);r.preventDefault()}break;default:n=true;this._searchTimeout(r);break}},keypress:function(i){if(e){e=false;if(!this.isMultiLine||this.menu.element.is(":visible")){i.preventDefault()}return}if(n){return}var r=t.ui.keyCode;
862switch(i.keyCode){case r.PAGE_UP:this._move("previousPage",i);break;case r.PAGE_DOWN:this._move("nextPage",i);break;case r.UP:this._keyEvent("previous",i);break;case r.DOWN:this._keyEvent("next",i);break}},input:function(t){if(i){i=false;t.preventDefault();return}this._searchTimeout(t)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(t){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching);this.close(t);this._change(t)}});this._initSource();this.menu=t("<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(e){e.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;if(this.element[0]!==t.ui.safeActiveElement(this.document[0])){this.element.trigger("focus")}})},menufocus:function(e,n){var i,r;if(this.isNewMenu){this.isNewMenu=false;if(e.originalEvent&&/^mouse/.test(e.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});return}}r=n.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",e,{item:r})){if(e.originalEvent&&/^key/.test(e.originalEvent.type)){this._value(r.value)}}i=n.item.attr("aria-label")||r.value;if(i&&t.trim(i).length){this.liveRegion.children().hide();t("<div>").text(i).appendTo(this.liveRegion)}},menuselect:function(e,n){var i=n.item.data("ui-autocomplete-item"),r=this.previous;if(this.element[0]!==t.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");this.previous=r;this._delay(function(){this.previous=r;this.selectedItem=i})}if(false!==this._trigger("select",e,{item:i})){this._value(i.value)}this.term=this._value();this.close(e);this.selectedItem=i}});this.liveRegion=t("<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(t,e){this._super(t,e);if(t==="source"){this._initSource()}if(t==="appendTo"){this.menu.element.appendTo(this._appendTo())}if(t==="disabled"&&e&&this.xhr){this.xhr.abort()}},_isEventTargetInWidget:function(e){var n=this.menu.element[0];return e.target===this.element[0]||e.target===n||t.contains(n,e.target)},_closeOnClickOutside:function(t){if(!this._isEventTargetInWidget(t)){this.close()}},_appendTo:function(){var e=this.options.appendTo;if(e){e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)}if(!e||!e[0]){e=this.element.closest(".ui-front, dialog")}if(!e.length){e=this.document[0].body}return e},_initSource:function(){var e,n,i=this;if(t.isArray(this.options.source)){e=this.options.source;this.source=function(n,i){i(t.ui.autocomplete.filter(e,n.term))}}else if(typeof this.options.source==="string"){n=this.options.source;this.source=function(e,r){if(i.xhr){i.xhr.abort()}i.xhr=t.ajax({url:n,data:e,dataType:"json",success:function(t){r(t)},error:function(){r([])}})}}else{this.source=this.options.source}},_searchTimeout:function(t){clearTimeout(this.searching);this.searching=this._delay(function(){var e=this.term===this._value(),n=this.menu.element.is(":visible"),i=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;if(!e||e&&!n&&!i){this.selectedItem=null;this.search(null,t)}},this.options.delay)},search:function(t,e){t=t!=null?t:this._value();this.term=this._value();if(t.length<this.options.minLength){return this.close(e)}if(this._trigger("search",e)===false){return}return this._search(t)},_search:function(t){this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){if(e===this.requestIndex){this.__response(t)}this.pending--;if(!this.pending){this._removeClass("ui-autocomplete-loading")}},this)},__response:function(t){if(t){t=this._normalize(t)}this._trigger("response",null,{content:t});if(!this.options.disabled&&t&&t.length&&!this.cancelSearch){this._suggest(t);this._trigger("open")}else{this._close()}},close:function(t){this.cancelSearch=true;this._close(t)},_close:function(t){this._off(this.document,"mousedown");if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",t)}}
862,_change:function(t){if(this.previous!==this._value()){this._trigger("change",t,{item:this.selectedItem})}},_normalize:function(e){if(e.length&&e[0].label&&e[0].value){return e}return t.map(e,function(e){if(typeof e==="string"){return{label:e,value:e}}return t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var n=this.menu.element.empty();this._renderMenu(n,e);this.isNewMenu=true;this.menu.refresh();n.show();this._resizeMenu();n.position(t.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next()}this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,n){var i=this;t.each(n,function(t,n){i._renderItemData(e,n)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,n){return t("<li>").append(t("<div>").text(n.label)).appendTo(e)},_move:function(t,e){if(!this.menu.element.is(":visible")){this.search(null,e);return}if(this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)){if(!this.isMultiLine){this._value(this.term)}this.menu.blur();return}this.menu[t](e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(t,e);e.preventDefault()}},_isContentEditable:function(t){if(!t.length){return false}var e=t.prop("contentEditable");if(e==="inherit"){return this._isContentEditable(t.parent())}return e==="true"}});t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,n){var i=new RegExp(t.ui.autocomplete.escapeRegex(n),"i");return t.grep(e,function(t){return i.test(t.label||t.value||t)})}});t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var n;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return}if(e&&e.length){n=this.options.messages.results(e.length)}else{n=this.options.messages.noResults}this.liveRegion.children().hide();t("<div>").text(n).appendTo(this.liveRegion)}});return t.ui.autocomplete});!function(t){t.fn.railsAutocomplete=function(e){var n=function(){this.railsAutoCompleter||(this.railsAutoCompleter=new t.railsAutocomplete(this))};if(void 0!==t.fn.on){if(!e)return;return t(document).on("focus",e,n)}return this.live("focus",n)},t.railsAutocomplete=function(t){var e=t;this.init(e)},t.railsAutocomplete.options={showNoMatches:!0,noMatchesLabel:"no existing match"},t.railsAutocomplete.fn=t.railsAutocomplete.prototype={railsAutocomplete:"0.0.1"},t.railsAutocomplete.fn.extend=t.railsAutocomplete.extend=t.extend,t.railsAutocomplete.fn.extend({init:function(e){function n(t){return t.split(e.delimiter)}function i(t){return n(t).pop().replace(/^\s+/,"")}e.delimiter=t(e).attr("data-delimiter")||null,e.min_length=t(e).attr("data-min-length")||t(e).attr("min-length")||2,e.append_to=t(e).attr("data-append-to")||null,e.autoFocus=t(e).attr("data-auto-focus")||!1,t(e).autocomplete({appendTo:e.append_to,autoFocus:e.autoFocus,delay:t(e).attr("delay")||0,source:function(n,r){var s=this.element[0],o={term:i(n.term)};t(e).attr("data-autocomplete-fields")&&t.each(t.parseJSON(t(e).attr("data-autocomplete-fields")),function(e,n){o[e]=t(n).val()}),t.getJSON(t(e).attr("data-autocomplete"),o,function(){var n={};t.extend(n,t.railsAutocomplete.options),t.each(n,function(i,r){if(n.hasOwnProperty(i)){var s=t(e).attr("data-"+i);n[i]=s?s:r}}),0==arguments[0].length&&t.inArray(n.showNoMatches,[!0,"true"])>=0&&(arguments[0]=[],arguments[0][0]={id:"",label:n.noMatchesLabel}),t(arguments[0]).each(function(n,i){var r={};r[i.id]=i,t(e).data(r)}),r.apply(null,arguments),t(s).trigger("railsAutocomplete.source",arguments)})},change:function(e,n){if(t(this).is("[data-id-element]")&&""!==t(t(this).attr("data-id-element")).val()&&(t(t(this).attr("data-id-element")).val(n.item?n.item.id:"").trigger("change"),t(this).attr("data-update-elements"))){var i=t.parseJSON(t(this).attr("data-update-elements")),r=n.item?t(this).data(n.item.id.toString()):{};if(i&&""===t(i.id).val())return;for(var s in i){var o=t(i[s]);o.is(":checkbox")?null!=r[s]&&o.prop("checked",r[s]):o.val(n.item?r[s]:"").trigger("change")}}},search:function(){var t=i(this.value);return t.length<e.min_length?!1:void 0},focus:function(){return!1}
862,select:function(i,r){if(r.item.value=r.item.value.toString(),-1!=r.item.value.toLowerCase().indexOf("no match")||-1!=r.item.value.toLowerCase().indexOf("too many results"))return t(this).trigger("railsAutocomplete.noMatch",r),!1;var s=n(this.value);if(s.pop(),s.push(r.item.value),null!=e.delimiter)s.push(""),this.value=s.join(e.delimiter);else if(this.value=s.join(""),t(this).attr("data-id-element")&&t(t(this).attr("data-id-element")).val(r.item.id).trigger("change"),t(this).attr("data-update-elements")){var o=r.item,a=-1!=r.item.value.indexOf("Create New")?!0:!1,l=t.parseJSON(t(this).attr("data-update-elements"));for(var c in l)"checkbox"===t(l[c]).attr("type")?o[c]===!0||1===o[c]?t(l[c]).attr("checked","checked"):t(l[c]).removeAttr("checked"):a&&o[c]&&-1==o[c].indexOf("Create New")||!a?t(l[c]).val(o[c]).trigger("change"):t(l[c]).val("").trigger("change")}var u=this.value;return t(this).bind("keyup.clearId",function(){t.trim(t(this).val())!=t.trim(u)&&(t(t(this).attr("data-id-element")).val("").trigger("change"),t(this).unbind("keyup.clearId"))}),t(e).trigger("railsAutocomplete.select",r),!1}}),t(e).trigger("railsAutocomplete.init")}}),t(document).ready(function(){t("input[data-autocomplete]").railsAutocomplete("input[data-autocomplete]")})}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.