@nebula.js/sn-distributionplot 0.37.0 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +4 -4
- package/core/esm/index.js.map +1 -1
- package/dist/sn-distplot.js +7 -7
- package/dist/sn-distplot.js.map +1 -1
- package/dist/sn-distplot.systemjs.js +6 -6
- package/dist/sn-distplot.systemjs.js.map +1 -1
- package/package.json +4 -4
package/dist/sn-distplot.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-distributionplot v0.37.
|
|
2
|
+
* @nebula.js/sn-distributionplot v0.37.2
|
|
3
3
|
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* https://jquery.org/license
|
|
18
18
|
*
|
|
19
19
|
* Date: 2022-08-26T17:52Z
|
|
20
|
-
*/!function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:t,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,
|
|
20
|
+
*/!function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:t,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,d=h.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var r,i,o=(n=n||g).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var x="3.6.1",w=function(e,t){return new w.fn.init(e,t)};function q(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!p(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}w.fn=w.prototype={jquery:x,constructor:w,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(w.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||p(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,a[t]=w.extend(u,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e))&&(!(t=r(e))||"function"==typeof(n=c.call(t,"constructor")&&t.constructor)&&h.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(q(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(q(Object(e))?w.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,s=[];if(q(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&s.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&s.push(i);return o(s)},guid:1,support:f}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var M=
|
|
21
21
|
/*!
|
|
22
22
|
* Sizzle CSS Selector Engine v2.3.6
|
|
23
23
|
* https://sizzlejs.com/
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
*
|
|
29
29
|
* Date: 2021-02-16
|
|
30
30
|
*/
|
|
31
|
-
function(e){var t,n,r,i,o,a,s,l,u,c,h,f,d,p,m,g,y,v,b,x="sizzle"+1*new Date,w=e.document,q=0,M=0,D=le(),k=le(),S=le(),_=le(),C=function(e,t){return e===t&&(h=!0),0},E={}.hasOwnProperty,A=[],T=A.pop,I=A.push,R=A.push,N=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",j="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\[[\\x20\\t\\r\\n\\f]*("+j+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+L+"*\\]",F=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",H=new RegExp(L+"+","g"),B=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),V=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),W=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),U=new RegExp(L+"|>"),$=new RegExp(F),Y=new RegExp("^"+j+"$"),X={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{R.apply(A=N.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){R={apply:A.length?function(e,t){I.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,u,c,h,p,y,v=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(f(t),t=t||d,m)){if(11!==w&&(h=Q.exec(e)))if(o=h[1]){if(9===w){if(!(u=t.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(v&&(u=v.getElementById(o))&&b(t,u)&&u.id===o)return r.push(u),r}else{if(h[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!_[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===w&&(U.test(e)||W.test(e))){for((v=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=x)),s=(p=a(e)).length;s--;)p[s]=(c?"#"+c:":scope")+" "+be(p[s]);y=p.join(",")}try{return R.apply(r,v.querySelectorAll(y)),r}catch(t){_(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ue(e){return e[x]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue((function(t){return t=+t,ue((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},f=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement?(p=(d=a).documentElement,m=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return p.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(d.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=x,!d.getElementsByName||!d.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],g=[],(n.qsa=Z.test(d.querySelectorAll))&&(ce((function(e){var t;p.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+P+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F)})),g=g.length&&new RegExp(g.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(p.compareDocumentPosition),b=t||Z.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},C=t?function(e,t){if(e===t)return h=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&b(w,e)?-1:t==d||t.ownerDocument==w&&b(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?fe(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},d):d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&m&&!_[t+" "]&&(!y||!y.test(t))&&(!g||!g.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){_(t,!0)}return se(t,d,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=d&&f(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=d&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&E.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(C),h){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:ue,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+L+"|$)"))&&D(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,h,f,d,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s,b=!1;if(g){if(o){for(;m;){for(f=t;f=f[m];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&v){for(b=(d=(u=(c=(h=(f=g)[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[e]||[])[0]===q&&u[1])&&u[2],f=d&&g.childNodes[d];f=++d&&f&&f[m]||(b=d=0)||p.pop();)if(1===f.nodeType&&++b&&f===t){c[e]=[q,d,b];break}}else if(v&&(b=d=(u=(c=(h=(f=t)[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[e]||[])[0]===q&&u[1]),!1===b)for(;(f=++d&&f&&f[m]||(b=d=0)||p.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++b||(v&&((c=(h=f[x]||(f[x]={}))[f.uniqueID]||(h[f.uniqueID]={}))[e]=[q,b]),f!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=O(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ue((function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[x]?ue((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ue((function(e){return function(t){return se(e,t).length>0}})),contains:ue((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ue((function(e){return Y.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ve(){}function be(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function xe(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=M++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,l){var u,c,h,f=[q,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(h=t[x]||(t[x]={}))[t.uniqueID]||(h[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[o])&&u[0]===q&&u[1]===s)return f[2]=u[2];if(c[o]=f,f[2]=e(t,n,l))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function qe(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function Me(e,t,n,r,i,o){return r&&!r[x]&&(r=Me(r)),i&&!i[x]&&(i=Me(i,o)),ue((function(o,a,s,l){var u,c,h,f=[],d=[],p=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:qe(m,f,e,s,l),y=n?i||(o?e:p||r)?[]:a:g;if(n&&n(g,y,s,l),r)for(u=qe(y,d),r(u,[],s,l),c=u.length;c--;)(h=u[c])&&(y[d[c]]=!(g[d[c]]=h));if(o){if(i||e){if(i){for(u=[],c=y.length;c--;)(h=y[c])&&u.push(g[c]=h);i(null,y=[],u,l)}for(c=y.length;c--;)(h=y[c])&&(u=i?O(o,h):f[c])>-1&&(o[u]=!(a[u]=h))}}else y=qe(y===a?y.splice(p,y.length):y),i?i(null,a,y,l):R.apply(a,y)}))}function De(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=xe((function(e){return e===t}),s,!0),h=xe((function(e){return O(t,e)>-1}),s,!0),f=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):h(e,n,r));return t=null,i}];l<o;l++)if(n=r.relative[e[l].type])f=[xe(we(f),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return Me(l>1&&we(f),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l<i&&De(e.slice(l,i)),i<o&&De(e=e.slice(i)),i<o&&be(e))}f.push(n)}return we(f)}return ve.prototype=r.filters=r.pseudos,r.setFilters=new ve,a=se.tokenize=function(e,t){var n,i,o,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in n&&!(i=V.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=W.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length)),r.filter)!(i=X[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):k(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=S[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=De(t[n]))[x]?i.push(s):o.push(s);(s=S(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var h,p,g,y=0,v="0",b=o&&[],x=[],w=u,M=o||i&&r.find.TAG("*",c),D=q+=null==w?1:Math.random()||.1,k=M.length;for(c&&(u=a==d||a||c);v!==k&&null!=(h=M[v]);v++){if(i&&h){for(p=0,a||h.ownerDocument==d||(f(h),s=!m);g=e[p++];)if(g(h,a||d,s)){l.push(h);break}c&&(q=D)}n&&((h=!g&&h)&&y--,o&&b.push(h))}if(y+=v,n&&v!==y){for(p=0;g=t[p++];)g(b,x,a,s);if(o){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=T.call(l));x=qe(x)}R.apply(l,x),c&&!o&&x.length>0&&y+t.length>1&&se.uniqueSort(l)}return c&&(q=D,u=w),b};return n?ue(o):o}(o,i))).selector=e}return s},l=se.select=function(e,t,n,i){var o,l,u,c,h,f="function"==typeof e&&e,d=!i&&a(e=f.selector||e);if(n=n||[],1===d.length){if((l=d[0]=d[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=X.needsContext.test(e)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(te,ne),ee.test(l[0].type)&&ye(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return R.apply(n,i),n;break}}return(f||s(e,d))(i,t,!m,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=x.split("").sort(C).join("")===x,n.detectDuplicates=!!h,f(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||he("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||he("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||he(P,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(e);w.find=M,w.expr=M.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=M.uniqueSort,w.text=M.getText,w.isXMLDoc=M.isXML,w.contains=M.contains,w.escapeSelector=M.escape;var D=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=w.expr.match.needsContext;function _(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function E(e,t,n){return p(t)?w.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return s.call(t,e)>-1!==n})):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,(function(e){return 1===e.nodeType})))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter((function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&S.test(e)?w(e):e||[],!1).length}});var A,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:T.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),C.test(r[1])&&w.isPlainObject(t))for(r in t)p(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,A=w(g);var I=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!S.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(w(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,n){return D(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,n){return D(e,"nextSibling",n)},prevUntil:function(e,t,n){return D(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(_(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},(function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(R[e]||w.uniqueSort(i),I.test(e)&&i.reverse()),this.pushStack(i)}}));var O=/[^\x20\t\r\n\f]+/g;function P(e){return e}function L(e){throw e}function j(e,t,n,r){var i;try{e&&p(i=e.promise)?i.call(e).done(t).fail(n):e&&p(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(O)||[],(function(e,n){t[n]=!0})),t}(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,(function(n,r){p(r)?e.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return w.each(arguments,(function(e,t){for(var n;(n=w.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred((function(t){w.each(n,(function(n,r){var i=p(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,l=arguments,u=function(){var e,u;if(!(t<o)){if((e=r.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(u)?i?u.call(e,a(o,n,P,i),a(o,n,L,i)):(o++,u.call(e,a(o,n,P,i),a(o,n,L,i),a(o,n,P,n.notifyWith))):(r!==P&&(s=void 0,l=[e]),(i||n.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==L&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred((function(e){n[0][3].add(a(0,e,p(i)?i:P,e.notifyWith)),n[1][3].add(a(0,e,p(t)?t:P)),n[2][3].add(a(0,e,p(r)?r:L))})).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(r,o)}};if(t<=1&&(j(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||p(o[n]&&o[n].then)))return a.then();for(;n--;)j(o[n],s(n),a.reject);return a.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&z.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout((function(){throw t}))};var F=w.Deferred();function H(){g.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),w.ready()}w.fn.ready=function(e){return F.then(e).catch((function(e){w.readyException(e)})),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(g,[w]))}}),w.ready.then=F.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var B=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===b(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,p(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(w(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},V=/^-ms-/,W=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function $(e){return e.replace(V,"ms-").replace(W,U)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function X(){this.expando=w.expando+X.uid++}X.uid=1,X.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[$(t)]=n;else for(r in t)i[$(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][$(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map($):(t=$(t))in r?[t]:t.match(O)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var K=new X,G=new X,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function Q(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:J.test(e)?JSON.parse(e):e)}(n)}catch(e){}G.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return G.hasData(e)||K.hasData(e)},data:function(e,t,n){return G.access(e,t,n)},removeData:function(e,t){G.remove(e,t)},_data:function(e,t,n){return K.access(e,t,n)},_removeData:function(e,t){K.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=G.get(o),1===o.nodeType&&!K.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=$(r.slice(5)),Q(o,r,i[r]));K.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){G.set(this,e)})):B(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=G.get(o,e))||void 0!==(n=Q(o,e))?n:void 0;this.each((function(){G.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){G.remove(this,e)}))}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=K.get(e,t),n&&(!r||Array.isArray(n)?r=K.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){w.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:w.Callbacks("once memory").add((function(){K.remove(e,[t+"queue",n])}))})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each((function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){w.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=K.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=g.documentElement,ie=function(e){return w.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===w.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},l=s(),u=n&&n[3]||(w.cssNumber[t]?"":"px"),c=e.nodeType&&(w.cssNumber[t]||"px"!==u&&+l)&&te.exec(w.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)w.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var le={};function ue(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function ce(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=K.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ue(r))):"none"!==n&&(i[o]="none",K.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ae(this)?w(this).show():w(this).hide()}))}});var he,fe,de=/^(?:checkbox|radio)$/i,pe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;he=g.createDocumentFragment().appendChild(g.createElement("div")),(fe=g.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),he.appendChild(fe),d.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue,he.innerHTML="<option></option>",d.option=!!he.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&_(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)K.set(e[n],"globalEval",!t||K.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,d.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var be=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,l,u,c,h=t.createDocumentFragment(),f=[],d=0,p=e.length;d<p;d++)if((o=e[d])||0===o)if("object"===b(o))w.merge(f,o.nodeType?[o]:o);else if(be.test(o)){for(a=a||h.appendChild(t.createElement("div")),s=(pe.exec(o)||["",""])[1].toLowerCase(),l=ge[s]||ge._default,a.innerHTML=l[1]+w.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;w.merge(f,a.childNodes),(a=h.firstChild).textContent=""}else f.push(t.createTextNode(o));for(h.textContent="",d=0;o=f[d++];)if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(u=ie(o),a=ye(h.appendChild(o),"script"),u&&ve(a),n)for(c=0;o=a[c++];)me.test(o.type||"")&&n.push(o);return h}var we=/^([^.]*)(?:\.(.+)|)/;function qe(){return!0}function Me(){return!1}function De(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Me;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each((function(){w.event.add(this,t,i,r,n)}))}function Se(e,t,n){n?(K.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var r,o,a=K.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),K.set(this,t,a),r=n(this,t),this[t](),a!==(o=K.get(this,t))||r?K.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(K.set(this,t,{value:w.event.trigger(w.extend(a[0],w.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===K.get(e,t)&&w.event.add(e,t,qe)}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,h,f,d,p,m,g=K.get(e);if(Y(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(re,i),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(O)||[""]).length;u--;)d=m=(s=we.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),d&&(h=w.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,h=w.event.special[d]||{},c=w.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:p.join(".")},o),(f=l[d])||((f=l[d]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(d,a)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),w.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,h,f,d,p,m,g=K.hasData(e)&&K.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(O)||[""]).length;u--;)if(d=m=(s=we.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),d){for(h=w.event.special[d]||{},f=l[d=(r?h.delegateType:h.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)c=f[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,h.remove&&h.remove.call(e,c));a&&!f.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||w.removeEvent(e,d,g.handle),delete l[d])}else for(d in l)w.event.remove(e,d+t[u],n,r,!0);w.isEmptyObject(l)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=w.event.fix(e),u=(K.get(this,"events")||Object.create(null))[l.type]||[],c=w.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=w.event.handlers.call(this,l,u),t=0;(i=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((w.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(u)>-1:w.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return de.test(t.type)&&t.click&&_(t,"input")&&Se(t,"click",qe),!1},trigger:function(e){var t=this||e;return de.test(t.type)&&t.click&&_(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return de.test(t.type)&&t.click&&_(t,"input")&&K.get(t,"click")||_(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?qe:Me,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:Me,isPropagationStopped:Me,isImmediatePropagationStopped:Me,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=qe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=qe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=qe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},(function(e,t){w.event.special[e]={setup:function(){return Se(this,e,De),!1},trigger:function(){return Se(this,e),!0},_default:function(t){return K.get(t.target,e)},delegateType:t}})),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),w.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Me),this.each((function(){w.event.remove(this,e,n,t)}))}});var _e=/<script|<style|<link/i,Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Ee=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ae(e,t){return _(e,"table")&&_(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function Te(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(K.hasData(e)&&(s=K.get(e).events))for(i in K.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(t,i,s[i][n]);G.hasData(e)&&(o=G.access(e),a=w.extend({},o),G.set(t,a))}}function Ne(e,t){var n=t.nodeName.toLowerCase();"input"===n&&de.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Oe(e,t,n,r){t=o(t);var i,a,s,l,u,c,h=0,f=e.length,m=f-1,g=t[0],y=p(g);if(y||f>1&&"string"==typeof g&&!d.checkClone&&Ce.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),Oe(o,t,n,r)}));if(f&&(a=(i=xe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(l=(s=w.map(ye(i,"script"),Te)).length;h<f;h++)u=i,h!==m&&(u=w.clone(u,!0,!0),l&&w.merge(s,ye(u,"script"))),n.call(e[h],u,h);if(l)for(c=s[s.length-1].ownerDocument,w.map(s,Ie),h=0;h<l;h++)u=s[h],me.test(u.type||"")&&!K.access(u,"globalEval")&&w.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?w._evalUrl&&!u.noModule&&w._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):v(u.textContent.replace(Ee,""),u,c))}return e}function Pe(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=ie(e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Ne(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Re(o[r],a[r]);else Re(e,s);return(a=ye(s,"script")).length>0&&ve(a,!l&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[K.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[K.expando]=void 0}n[G.expando]&&(n[G.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return B(this,(function(e){return void 0===e?w.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Oe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ae(this,e).appendChild(e)}))},prepend:function(){return Oe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ae(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return w.clone(this,e,t)}))},html:function(e){return B(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!_e.test(e)&&!ge[(pe.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,(function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))}),e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}}));var Le=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),je=/^--/,ze=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},He=new RegExp(ne.join("|"),"i"),Be=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g");function Ve(e,t,n){var r,i,o,a,s=je.test(t),l=e.style;return(n=n||ze(e))&&(a=n.getPropertyValue(t)||n[t],s&&(a=a.replace(Be,"$1")),""!==a||ie(e)||(a=w.style(e,t)),!d.pixelBoxStyles()&&Le.test(a)&&He.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function We(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,l=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),re.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(d,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==s&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",re.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,re.removeChild(t)),s}}))}();var Ue=["Webkit","Moz","ms"],$e=g.createElement("div").style,Ye={};function Xe(e){var t=w.cssProps[e]||Ye[e];return t||(e in $e?e:Ye[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;n--;)if((e=Ue[n]+t)in $e)return e}(e)||e)}var Ke=/^(none|table(?!-c[ea]).+)/,Ge={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=w.css(e,n+ne[a],!0,i)),r?("content"===n&&(l-=w.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(l-=w.css(e,"border"+ne[a]+"Width",!0,i))):(l+=w.css(e,"padding"+ne[a],!0,i),"padding"!==n?l+=w.css(e,"border"+ne[a]+"Width",!0,i):s+=w.css(e,"border"+ne[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function et(e,t,n){var r=ze(e),i=(!d.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),o=i,a=Ve(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Le.test(a)){if(!n)return a;a="auto"}return(!d.boxSizingReliable()&&i||!d.reliableTrDimensions()&&_(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===w.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=$(t),l=je.test(t),u=e.style;if(l||(t=Xe(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=$(t);return je.test(t)||(t=Xe(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ve(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],(function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!Ke.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):Fe(e,Ge,(function(){return et(e,t,r)}))},set:function(e,n,r){var i,o=ze(e),a=!d.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===w.css(e,"boxSizing",!1,o),l=r?Qe(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Qe(e,t,"border",!1,o)-.5)),l&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ze(0,n,l)}}})),w.cssHooks.marginLeft=We(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),w.each({margin:"",padding:"",border:"Width"},(function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ze)})),w.fn.extend({css:function(e,t){return B(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=ze(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)}),e,t,arguments.length>1)}}),w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout((function(){nt=void 0})),nt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(ct.tweeners[t]||[]).concat(ct.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o=0,a=ct.prefilters.length,s=w.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=$(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<a;o++)if(r=ct.prefilters[o].call(u,e,c,u.opts))return p(r.stop)&&(w._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,ut,u),p(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),w.fx.timer(w.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}w.Animation=w.extend(ct,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(O);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ct.tweeners[n]=ct.tweeners[n]||[],ct.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,h="width"in t||"height"in t,f=this,d={},p=e.style,m=e.nodeType&&ae(e),g=K.get(e,"fxshow");for(r in n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always((function(){f.always((function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}d[r]=g&&g[r]||w.style(e,r)}if((l=!w.isEmptyObject(t))||!w.isEmptyObject(d))for(r in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=g&&g.display)&&(u=K.get(e,"display")),"none"===(c=w.css(e,"display"))&&(u?c=u:(ce([e],!0),u=e.style.display||u,c=w.css(e,"display"),ce([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===w.css(e,"float")&&(l||(f.done((function(){p.display=u})),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,d)l||(g?"hidden"in g&&(m=g.hidden):g=K.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&ce([e],!0),f.done((function(){for(r in m||ce([e]),K.remove(e,"fxshow"),d)w.style(e,r,d[r])}))),l=ut(m?g[r]:0,r,f),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ct.prefilters.unshift(e):ct.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){p(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=ct(this,w.extend({},e),o);(i||K.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=K.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=K.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),w.each(["toggle","show","hide"],(function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(lt(t,!0),e,r,i)}})),w.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx&&w.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",d.radioValue="t"===e.value}();var ht,ft=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return B(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){w.removeAttr(this,e)}))}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&_(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(O);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ft[t]||w.find.attr;ft[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ft[a],ft[a]=i,i=null!=n(e,t,r)?a:null,ft[a]=o),i}}));var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function mt(e){return(e.match(O)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function yt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}w.fn.extend({prop:function(e,t){return B(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[w.propFix[e]||e]}))}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){w.propFix[this.toLowerCase()]=this})),w.fn.extend({addClass:function(e){var t,n,r,i,o,a;return p(e)?this.each((function(t){w(this).addClass(e.call(this,t,gt(this)))})):(t=yt(e)).length?this.each((function(){if(r=gt(this),n=1===this.nodeType&&" "+mt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=mt(n),r!==a&&this.setAttribute("class",a)}})):this},removeClass:function(e){var t,n,r,i,o,a;return p(e)?this.each((function(t){w(this).removeClass(e.call(this,t,gt(this)))})):arguments.length?(t=yt(e)).length?this.each((function(){if(r=gt(this),n=1===this.nodeType&&" "+mt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=mt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return p(e)?this.each((function(n){w(this).toggleClass(e.call(this,n,gt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=yt(e),this.each((function(){if(s)for(o=w(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==a||((r=gt(this))&&K.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":K.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+mt(gt(n))+" ").indexOf(t)>-1)return!0;return!1}});var vt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=p(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,(function(e){return null==e?"":e+""}))),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(vt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:mt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!_(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=w.makeArray(t),a=i.length;a--;)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],(function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},d.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),d.focusin="onfocusin"in e;var bt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,r,i){var o,a,s,l,u,h,f,d,y=[r||g],v=c.call(t,"type")?t.type:t,b=c.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!bt.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),u=v.indexOf(":")<0&&"on"+v,(t=t[w.expando]?t:new w.Event(v,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),f=w.event.special[v]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!m(r)){for(l=f.delegateType||v,bt.test(l+v)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||g)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?l:f.bindType||v,(h=(K.get(a,"events")||Object.create(null))[t.type]&&K.get(a,"handle"))&&h.apply(a,n),(h=u&&a[u])&&h.apply&&Y(a)&&(t.result=h.apply(a,n),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(y.pop(),n)||!Y(r)||u&&p(r[v])&&!m(r)&&((s=r[u])&&(r[u]=null),w.event.triggered=v,t.isPropagationStopped()&&d.addEventListener(v,xt),r[v](),t.isPropagationStopped()&&d.removeEventListener(v,xt),w.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each((function(){w.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),d.focusin||w.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,t);i||r.addEventListener(e,n,!0),K.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,t)-1;i?K.access(r,t,i):(r.removeEventListener(e,n,!0),K.remove(r,t))}}}));var wt=e.location,qt={guid:Date.now()},Mt=/\?/;w.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||w.error("Invalid XML: "+(r?w.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Dt=/\[\]$/,kt=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,_t=/^(?:input|select|textarea|keygen)/i;function Ct(e,t,n,r){var i;if(Array.isArray(t))w.each(t,(function(t,i){n||Dt.test(e)?r(e,i):Ct(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)Ct(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=p(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ct(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&_t.test(this.nodeName)&&!St.test(e)&&(this.checked||!de.test(e))})).map((function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,(function(e){return{name:t.name,value:e.replace(kt,"\r\n")}})):{name:t.name,value:n.replace(kt,"\r\n")}})).get()}});var Et=/%20/g,At=/#.*$/,Tt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Nt=/^\/\//,Ot={},Pt={},Lt="*/".concat("*"),jt=g.createElement("a");function zt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(O)||[];if(p(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var i={},o=e===Pt;function a(s){var l;return i[s]=!0,w.each(e[s]||[],(function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ht(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}jt.href=wt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(wt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Lt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ht(Ht(e,w.ajaxSettings),t):Ht(w.ajaxSettings,e)},ajaxPrefilter:zt(Ot),ajaxTransport:zt(Pt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,l,u,c,h,f,d=w.ajaxSetup({},n),p=d.context||d,m=d.context&&(p.nodeType||p.jquery)?w(p):w.event,y=w.Deferred(),v=w.Callbacks("once memory"),b=d.statusCode||{},x={},q={},M="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=It.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=q[e.toLowerCase()]=q[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==u&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)D.always(e[D.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||M;return r&&r.abort(t),k(0,t),this}};if(y.promise(D),d.url=((t||d.url||wt.href)+"").replace(Nt,wt.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(O)||[""],null==d.crossDomain){l=g.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=jt.protocol+"//"+jt.host!=l.protocol+"//"+l.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=w.param(d.data,d.traditional)),Ft(Ot,d,n,D),u)return D;for(h in(c=w.event&&d.global)&&0==w.active++&&w.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Rt.test(d.type),i=d.url.replace(At,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Et,"+")):(f=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(Mt.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(Tt,"$1"),f=(Mt.test(i)?"&":"?")+"_="+qt.guid+++f),d.url=i+f),d.ifModified&&(w.lastModified[i]&&D.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&D.setRequestHeader("If-None-Match",w.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&D.setRequestHeader("Content-Type",d.contentType),D.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Lt+"; q=0.01":""):d.accepts["*"]),d.headers)D.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,D,d)||u))return D.abort();if(M="abort",v.add(d.complete),D.done(d.success),D.fail(d.error),r=Ft(Pt,d,n,D)){if(D.readyState=1,c&&m.trigger("ajaxSend",[D,d]),u)return D;d.async&&d.timeout>0&&(s=e.setTimeout((function(){D.abort("timeout")}),d.timeout));try{u=!1,r.send(x,k)}catch(e){if(u)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,a,l){var h,f,g,x,q,M=n;u||(u=!0,s&&e.clearTimeout(s),r=void 0,o=l||"",D.readyState=t>0?4:0,h=t>=200&&t<300||304===t,a&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(d,D,a)),!h&&w.inArray("script",d.dataTypes)>-1&&w.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(d,x,D,h),h?(d.ifModified&&((q=D.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=q),(q=D.getResponseHeader("etag"))&&(w.etag[i]=q)),204===t||"HEAD"===d.type?M="nocontent":304===t?M="notmodified":(M=x.state,f=x.data,h=!(g=x.error))):(g=M,!t&&M||(M="error",t<0&&(t=0))),D.status=t,D.statusText=(n||M)+"",h?y.resolveWith(p,[f,M,D]):y.rejectWith(p,[D,M,g]),D.statusCode(b),b=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[D,d,h?f:g]),v.fireWith(p,[D,M]),c&&(m.trigger("ajaxComplete",[D,d]),--w.active||w.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],(function(e,t){w[t]=function(e,n,r,i){return p(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}})),w.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){w(this).wrapInner(e.call(this,t))})):this.each((function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){w(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){w(this).replaceWith(this.childNodes)})),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},Vt=w.ajaxSettings.xhr();d.cors=!!Vt&&"withCredentials"in Vt,d.ajax=Vt=!!Vt,w.ajaxTransport((function(t){var n,r;if(d.cors||Vt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Bt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),w.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),w.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Wt,Ut=[],$t=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ut.pop()||w.expando+"_"+qt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,a,s=!1!==t.jsonp&&($t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&$t.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace($t,"$1"+i):!1!==t.jsonp&&(t.url+=(Mt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always((function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Ut.push(i)),a&&p(o)&&o(a[0]),a=o=void 0})),"script"})),d.createHTMLDocument=((Wt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),o=!n&&[],(i=C.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=mt(e.slice(s)),e=e.slice(0,s)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,(function(t){return e===t.elem})).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=w.css(e,"position"),c=w(e),h={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),l=w.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),p(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(h.top=t.top-s.top+a),null!=t.left&&(h.left=t.left-s.left+i),"using"in t?t.using.call(e,h):c.css(h)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){w.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||re}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return B(this,(function(e,r,i){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=We(d.pixelPosition,(function(e,n){if(n)return n=Ve(e,t),Le.test(n)?w(e).position()[t]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return B(this,(function(t,n,i){var o;return m(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){w.fn[t]=function(e){return this.on(t,e)}})),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var Yt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return r=i.call(arguments,2),(o=function(){return e.apply(t||this,r.concat(i.call(arguments)))}).guid=e.guid=e.guid||w.guid++,o},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=_,w.isFunction=p,w.isWindow=m,w.camelCase=$,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(Yt,"$1")};var Xt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Xt),w},void 0===t&&(e.jQuery=e.$=w),w}))}(r);var i=r.exports,o={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var u=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(s,(function(e,n,r){var i=n.toLowerCase(),o=function(e){var t=e.match(l);return t?t.map(Number):[]}(r),s=n;if("m"===i&&o.length>2&&(t.push([s].concat(o.splice(0,2))),i="l",s="m"===s?"l":"L"),o.length<a[i])return"";for(t.push([s].concat(o.splice(0,a[i])));o.length>=a[i]&&o.length&&a[i];)t.push([s].concat(o.splice(0,a[i])));return""})),t};function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=u;function p(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),r=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=r}function m(e,t,n){e.x+=t,e.y+=n}function g(e,t){e.x*=t,e.y*=t}var y=u,v=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,h(t.segments)):t&&(this.segments=d(t))}var t,n,r;return t=e,(n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,h(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,r,i,o){this.segments.push(["AC",e,t,n,r,i,!!o])}},{key:"arcTo",value:function(e,t,n,r,i){this.segments.push(["AT",e,t,n,r,i])}},{key:"ellipse",value:function(e,t,n,r,i,o,a,s){this.segments.push(["E",e,t,n,r,i,o,a,!!s])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,r,i,o){this.segments.push(["C",e,t,n,r,i,o])}},{key:"quadraticCurveTo",value:function(e,t,n,r){this.segments.push(["Q",e,t,n,r])}},{key:"rect",value:function(e,t,n,r){this.segments.push(["R",e,t,n,r])}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,r=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(i=t[1]);var a=t[0];o(this,a.segments),n.call(this,i)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),r.call(this)):r.call(this)};var i=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var r=t[1],a=t[2],s=t[3]||"nonzero",l=t[0];return o(this,l.segments),i.apply(this,[r,a,s])}return i.apply(this,t)},e.Path2D=t}function o(e,t){var n,r,i,o,a,s,l,u,c,h,f,d,y,v,b,x,w,q,M,D,k,S,_,C,E,A,T={x:0,y:0},I={x:0,y:0};e.beginPath();for(var R=0;R<t.length;++R){var N=t[R];switch("S"!==(D=N[0])&&"s"!==D&&"C"!==D&&"c"!==D&&(S=null,_=null),"T"!==D&&"t"!==D&&"Q"!==D&&"q"!==D&&(C=null,E=null),D){case"m":case"M":"m"===D?(f+=N[1],y+=N[2]):(f=N[1],y=N[2]),"M"!==D&&T||(T={x:f,y:y}),e.moveTo(f,y);break;case"l":f+=N[1],y+=N[2],e.lineTo(f,y);break;case"L":f=N[1],y=N[2],e.lineTo(f,y);break;case"H":f=N[1],e.lineTo(f,y);break;case"h":f+=N[1],e.lineTo(f,y);break;case"V":y=N[1],e.lineTo(f,y);break;case"v":y+=N[1],e.lineTo(f,y);break;case"a":case"A":"a"===D?(f+=N[6],y+=N[7]):(f=N[6],y=N[7]),x=N[1],w=N[2],l=N[3]*Math.PI/180,i=!!N[4],o=!!N[5],a={x:f,y:y},p(s={x:(I.x-a.x)/2,y:(I.y-a.y)/2},-l),(u=s.x*s.x/(x*x)+s.y*s.y/(w*w))>1&&(x*=u=Math.sqrt(u),w*=u),c=x*x*w*w,h=x*x*s.y*s.y+w*w*s.x*s.x,g(k={x:x*s.y/w,y:-w*s.x/x},o!==i?Math.sqrt((c-h)/h)||0:-Math.sqrt((c-h)/h)||0),r=Math.atan2((s.y-k.y)/w,(s.x-k.x)/x),n=Math.atan2(-(s.y+k.y)/w,-(s.x+k.x)/x),p(k,l),m(k,(a.x+I.x)/2,(a.y+I.y)/2),e.save(),e.translate(k.x,k.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,!o),e.restore();break;case"C":S=N[3],_=N[4],f=N[5],y=N[6],e.bezierCurveTo(N[1],N[2],S,_,f,y);break;case"c":e.bezierCurveTo(N[1]+f,N[2]+y,N[3]+f,N[4]+y,N[5]+f,N[6]+y),S=N[3]+f,_=N[4]+y,f+=N[5],y+=N[6];break;case"S":null!==S&&null!==_||(S=f,_=y),e.bezierCurveTo(2*f-S,2*y-_,N[1],N[2],N[3],N[4]),S=N[1],_=N[2],f=N[3],y=N[4];break;case"s":null!==S&&null!==_||(S=f,_=y),e.bezierCurveTo(2*f-S,2*y-_,N[1]+f,N[2]+y,N[3]+f,N[4]+y),S=N[1]+f,_=N[2]+y,f+=N[3],y+=N[4];break;case"Q":C=N[1],E=N[2],f=N[3],y=N[4],e.quadraticCurveTo(C,E,f,y);break;case"q":C=N[1]+f,E=N[2]+y,f+=N[3],y+=N[4],e.quadraticCurveTo(C,E,f,y);break;case"T":null!==C&&null!==E||(C=f,E=y),C=2*f-C,E=2*y-E,f=N[1],y=N[2],e.quadraticCurveTo(C,E,f,y);break;case"t":null!==C&&null!==E||(C=f,E=y),C=2*f-C,E=2*y-E,f+=N[1],y+=N[2],e.quadraticCurveTo(C,E,f,y);break;case"z":case"Z":f=T.x,y=T.y,T=void 0,e.closePath();break;case"AC":f=N[1],y=N[2],b=N[3],r=N[4],n=N[5],A=N[6],e.arc(f,y,b,r,n,A);break;case"AT":d=N[1],v=N[2],f=N[3],y=N[4],b=N[5],e.arcTo(d,v,f,y,b);break;case"E":f=N[1],y=N[2],x=N[3],w=N[4],l=N[5],r=N[6],n=N[7],A=N[8],e.save(),e.translate(f,y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,A),e.restore();break;case"R":f=N[1],y=N[2],q=N[3],M=N[4],T={x:f,y:y},e.rect(f,y,q,M)}I.x=f,I.y=y}}};"undefined"!=typeof window&&v(window);var b={path2dPolyfill:v,parsePath:y},x=Object.prototype.hasOwnProperty,w=Object.prototype.toString,q=Object.defineProperty,M=Object.getOwnPropertyDescriptor,D=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===w.call(e)},k=function(e){if(!e||"[object Object]"!==w.call(e))return!1;var t,n=x.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&x.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||x.call(e,t)},S=function(e,t){q&&"__proto__"===t.name?q(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},_=function(e,t){if("__proto__"===t){if(!x.call(e,t))return;if(M)return M(e,t).value}return e[t]},C=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=_(s,n),s!==(i=_(t,n))&&(c&&i&&(k(i)||(o=D(i)))?(o?(o=!1,a=r&&D(r)?r:[]):a=r&&k(r)?r:{},S(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&S(s,{name:n,newValue:i}));return s},E="1.9.7";function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function F(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function H(e,t,n){return(H=F()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&z(i,n.prototype),i}).apply(null,arguments)}function B(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function W(e){var t=F();return function(){var n,r=j(e);if(t){var i=j(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return V(this,n)}}function U(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=j(e)););return e}function $(){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=U(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}}).apply(this,arguments)}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){if(e){if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e){return!!e.changedTouches}function Z(e){return"number"==typeof e&&!isNaN(e)}function Q(e){return"number"!=typeof e||isNaN(e)}function ee(e){for(var t=e.length,n=NaN,r=NaN,i=NaN,o=NaN,a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function te(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function ne(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function re(e){var t=Y(ee(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function ie(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function oe(e){var t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,u=t.y2,c=t.cx,h=t.cy,f=t.r,d=t.vertices;return Z(c)&&Z(h)&&Z(f)?"circle":Z(a)&&Z(s)&&Z(l)&&Z(u)?"line":Z(n)&&Z(r)&&Z(i)&&Z(o)?"rect":Z(n)&&Z(r)?"point":Array.isArray(d)?d.every((function(e){return Array.isArray(e)}))?"geopolygon":"polygon":null}function ae(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function se(e,t){var n=t.types,r=t.logger,i={},o=[];Array.isArray(e)?o.push.apply(o,X(e)):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((function(e,t){var o=n(e.type);if(o){var a=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),a=t);var s=o({key:a,data:e.data,config:e.config});i[a]=s}}));return function(e){return e?i[e]:i[Object.keys(i)[0]]}}var le=Math.PI,ue=2*le,ce=1e-6,he=ue-ce;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function de(){return new fe}function pe(e){return function(){return e}}fe.prototype=de.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,u=o-e,c=a-t,h=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>ce)if(Math.abs(c*s-l*u)>ce&&i){var f=n-o,d=r-a,p=s*s+l*l,m=f*f+d*d,g=Math.sqrt(p),y=Math.sqrt(h),v=i*Math.tan((le-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>ce&&(this._+="L"+(e+b*u)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*d)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,u=t+s,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>ce||Math.abs(this._y1-u)>ce)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%ue+ue),h>he?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>ce&&(this._+="A"+n+","+n+",0,"+ +(h>=le)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var me=Math.abs,ge=Math.atan2,ye=Math.cos,ve=Math.max,be=Math.min,xe=Math.sin,we=Math.sqrt,qe=1e-12,Me=Math.PI,De=Me/2,ke=2*Me;function Se(e){return e>1?0:e<-1?Me:Math.acos(e)}function _e(e){return e>=1?De:e<=-1?-De:Math.asin(e)}function Ce(e){return e.innerRadius}function Ee(e){return e.outerRadius}function Ae(e){return e.startAngle}function Te(e){return e.endAngle}function Ie(e){return e&&e.padAngle}function Re(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,f=h*l-c*u;if(!(f*f<qe))return[e+(f=(c*(t-o)-h*(e-i))/f)*l,t+f*u]}function Ne(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/we(s*s+l*l),c=u*l,h=-u*s,f=e+c,d=t+h,p=n+c,m=r+h,g=(f+p)/2,y=(d+m)/2,v=p-f,b=m-d,x=v*v+b*b,w=i-o,q=f*m-p*d,M=(b<0?-1:1)*we(ve(0,w*w*x-q*q)),D=(q*b-v*M)/x,k=(-q*v-b*M)/x,S=(q*b+v*M)/x,_=(-q*v+b*M)/x,C=D-g,E=k-y,A=S-g,T=_-y;return C*C+E*E>A*A+T*T&&(D=S,k=_),{cx:D,cy:k,x01:-c,y01:-h,x11:D*(i/w-1),y11:k*(i/w-1)}}function Oe(){var e=Ce,t=Ee,n=pe(0),r=null,i=Ae,o=Te,a=Ie,s=null;function l(){var l,u,c=+e.apply(this,arguments),h=+t.apply(this,arguments),f=i.apply(this,arguments)-De,d=o.apply(this,arguments)-De,p=me(d-f),m=d>f;if(s||(s=l=de()),h<c&&(u=h,h=c,c=u),h>qe)if(p>ke-qe)s.moveTo(h*ye(f),h*xe(f)),s.arc(0,0,h,f,d,!m),c>qe&&(s.moveTo(c*ye(d),c*xe(d)),s.arc(0,0,c,d,f,m));else{var g,y,v=f,b=d,x=f,w=d,q=p,M=p,D=a.apply(this,arguments)/2,k=D>qe&&(r?+r.apply(this,arguments):we(c*c+h*h)),S=be(me(h-c)/2,+n.apply(this,arguments)),_=S,C=S;if(k>qe){var E=_e(k/c*xe(D)),A=_e(k/h*xe(D));(q-=2*E)>qe?(x+=E*=m?1:-1,w-=E):(q=0,x=w=(f+d)/2),(M-=2*A)>qe?(v+=A*=m?1:-1,b-=A):(M=0,v=b=(f+d)/2)}var T=h*ye(v),I=h*xe(v),R=c*ye(w),N=c*xe(w);if(S>qe){var O,P=h*ye(b),L=h*xe(b),j=c*ye(x),z=c*xe(x);if(p<Me&&(O=Re(T,I,j,z,P,L,R,N))){var F=T-O[0],H=I-O[1],B=P-O[0],V=L-O[1],W=1/xe(Se((F*B+H*V)/(we(F*F+H*H)*we(B*B+V*V)))/2),U=we(O[0]*O[0]+O[1]*O[1]);_=be(S,(c-U)/(W-1)),C=be(S,(h-U)/(W+1))}}M>qe?C>qe?(g=Ne(j,z,T,I,h,C,m),y=Ne(P,L,R,N,h,C,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),C<S?s.arc(g.cx,g.cy,C,ge(g.y01,g.x01),ge(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,C,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,h,ge(g.cy+g.y11,g.cx+g.x11),ge(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,C,ge(y.y11,y.x11),ge(y.y01,y.x01),!m))):(s.moveTo(T,I),s.arc(0,0,h,v,b,!m)):s.moveTo(T,I),c>qe&&q>qe?_>qe?(g=Ne(R,N,P,L,c,-_,m),y=Ne(T,I,j,z,c,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<S?s.arc(g.cx,g.cy,_,ge(g.y01,g.x01),ge(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,c,ge(g.cy+g.y11,g.cx+g.x11),ge(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,ge(y.y11,y.x11),ge(y.y01,y.x01),!m))):s.arc(0,0,c,w,x,m):s.lineTo(R,N)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Me/2;return[ye(r)*n,xe(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:pe(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:pe(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:pe(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:pe(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:pe(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:pe(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:pe(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Pe(e){this._context=e}function Le(e){return new Pe(e)}function je(e){return e[0]}function ze(e){return e[1]}function Fe(){var e=je,t=null,n=pe(0),r=ze,i=pe(!0),o=null,a=Le,s=null;function l(l){var u,c,h,f,d,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(d=de())),u=0;u<=p;++u){if(!(u<p&&i(f=l[u],u,l))===m)if(m=!m)c=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=c;--h)s.point(g[h],y[h]);s.lineEnd(),s.areaEnd()}m&&(g[u]=+e(f,u,l),y[u]=+n(f,u,l),s.point(t?+t(f,u,l):g[u],r?+r(f,u,l):y[u]))}if(d)return s=null,d+""||null}function u(){return function(){var e=je,t=ze,n=pe(!0),r=null,i=Le,o=null;function a(a){var s,l,u,c=a.length,h=!1;for(null==r&&(o=i(u=de())),s=0;s<=c;++s)!(s<c&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(u)return o=null,u+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:pe(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:pe(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:pe(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:pe(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:pe(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:pe(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:pe(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:pe(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:pe(+e),l):r},l.lineX0=l.lineY0=function(){return u().x(e).y(n)},l.lineY1=function(){return u().x(e).y(r)},l.lineX1=function(){return u().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:pe(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function He(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Be(e){return e}Pe.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ve=Array.prototype.slice;function We(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ue(e){this._context=e}function $e(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ye(e,t){this._context=e,this._k=(1-t)/6}Ue.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:We(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:We(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ye.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:$e(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:$e(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Xe=function e(t){function n(e){return new Ye(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ke(e,t){this._context=e,this._alpha=t}Ke.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>qe){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>qe){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ge=function e(t){function n(e){return t?new Ke(e,t):new Ye(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Je(e){return e<0?-1:1}function Ze(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Je(o)+Je(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Qe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function et(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function tt(e){this._context=e}function nt(e){this._context=new rt(e)}function rt(e){this._context=e}function it(e){this._context=e}function ot(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function at(e,t){this._context=e,this._t=t}function st(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function lt(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ut(e,t){return e[t]}function ct(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function ht(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function ft(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0,i={},o=e||{get:function(){},has:function(){return!1},default:function(){}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e){return!!i[e]||o.has(e)}function u(e){var t=i[e];return delete i[e],t}function c(){return Object.keys(i)}function h(){return Object.keys(i).map((function(e){return i[e]}))}function f(e){return void 0!==e&&(t=e),t}function d(e,i){if(void 0!==i)return a(e,i);var o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),d.add=a,d.get=s,d.has=l,d.remove=u,d.getKeys=c,d.getValues=h,d.default=f,d.register=a,d}function dt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function pt(e){return(e=dt(Math.abs(e)))?e[1]:NaN}tt.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:et(this,this._t0,Qe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,et(this,Qe(this,n=Ze(this,e,t)),n);break;default:et(this,this._t0,n=Ze(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(nt.prototype=Object.create(tt.prototype)).point=function(e,t){tt.prototype.point.call(this,t,e)},rt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},it.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=ot(e),i=ot(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},at.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var mt,gt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yt(e){if(!(t=gt.exec(e)))throw new Error("invalid format: "+e);var t;return new vt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function vt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function bt(e,t){var n=dt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}yt.prototype=vt.prototype,vt.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 xt={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return bt(100*e,t)},r:bt,s:function(e,t){var n=dt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(mt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+dt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function wt(e){return e}var qt,Mt,Dt,kt=Array.prototype.map,St=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _t(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?wt:(t=kt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?wt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(kt.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=yt(e)).fill,n=e.align,h=e.sign,f=e.symbol,d=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):xt[v]||(void 0===g&&(g=12),y=!0,v="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?o:/[%p]/.test(v)?l:"",w=xt[v],q=/[defgprs%]/.test(v);function M(e){var i,o,l,f=b,M=x;if("c"===v)M=w(e)+M,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),D&&0==+e&&"+"!==h&&(D=!1),f=(D?"("===h?h:u:"-"===h||"("===h?"":h)+f,M=("s"===v?St[8+mt/3]:"")+M+(D&&"("===h?")":""),q)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){M=(46===l?a+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}m&&!d&&(e=r(e,1/0));var k=f.length+e.length+M.length,S=k<p?new Array(p-k+1).join(t):"";switch(m&&d&&(e=r(S+e,S.length?p-M.length:1/0),S=""),n){case"<":e=f+e+M+S;break;case"=":e=f+S+e+M;break;case"^":e=S.slice(0,k=S.length>>1)+f+e+M+S.slice(k);break;default:e=S+f+e+M}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return e+""},M}return{format:h,formatPrefix:function(e,t){var n=h(((e=yt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(pt(t)/3))),i=Math.pow(10,-r),o=St[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){qt=_t(e),Mt=qt.format,Dt=qt.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Ct=new Date,Et=new Date;function At(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return At((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Ct.setTime(+t),Et.setTime(+r),e(Ct),e(Et),Math.floor(n(Ct,Et))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Tt=864e5,It=6048e5,Rt=At((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Tt}),(function(e){return e.getDate()-1})),Nt=Rt;function Ot(e){return At((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/It}))}Rt.range;var Pt=Ot(0),Lt=Ot(1),jt=Ot(2),zt=Ot(3),Ft=Ot(4),Ht=Ot(5),Bt=Ot(6);Pt.range,Lt.range,jt.range,zt.range,Ft.range,Ht.range,Bt.range;var Vt=At((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Vt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?At((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wt=Vt;Vt.range;var Ut=At((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Tt}),(function(e){return e.getUTCDate()-1})),$t=Ut;function Yt(e){return At((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/It}))}Ut.range;var Xt=Yt(0),Kt=Yt(1),Gt=Yt(2),Jt=Yt(3),Zt=Yt(4),Qt=Yt(5),en=Yt(6);Xt.range,Kt.range,Gt.range,Jt.range,Zt.range,Qt.range,en.range;var tn=At((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));tn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?At((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var nn=tn;function rn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function on(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function an(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sn(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=pn(i),c=mn(i),h=pn(o),f=mn(o),d=pn(a),p=mn(a),m=pn(s),g=mn(s),y=pn(l),v=mn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Pn,e:Pn,f:Hn,g:Zn,G:er,H:Ln,I:jn,j:zn,L:Fn,m:Bn,M:Vn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Mr,s:Dr,S:Wn,u:Un,U:$n,V:Xn,w:Kn,W:Gn,x:null,X:null,y:Jn,Y:Qn,Z:tr,"%":qr},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:nr,e:nr,f:sr,g:vr,G:xr,H:rr,I:ir,j:or,L:ar,m:lr,M:ur,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Mr,s:Dr,S:cr,u:hr,U:fr,V:pr,w:mr,W:gr,x:null,X:null,y:yr,Y:br,Z:wr,"%":qr},w={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return D(e,t,n,r)},d:Sn,e:Sn,f:In,g:qn,G:wn,H:Cn,I:Cn,j:_n,L:Tn,m:kn,M:En,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Dn,Q:Nn,s:On,S:An,u:yn,U:vn,V:bn,w:gn,W:xn,x:function(e,t,r){return D(e,n,t,r)},X:function(e,t,n){return D(e,r,t,n)},y:qn,Y:wn,Z:Mn,"%":Rn};function q(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=ln[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function M(e,t){return function(n){var r,i,o=an(1900,void 0,1);if(D(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=on(an(o.y,0,1))).getUTCDay(),r=i>4||0===i?Kt.ceil(r):Kt(r),r=$t.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=rn(an(o.y,0,1))).getDay(),r=i>4||0===i?Lt.ceil(r):Lt(r),r=Nt.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?on(an(o.y,0,1)).getUTCDay():rn(an(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,on(o)):rn(o)}}function D(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in ln?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=q(n,b),b.X=q(r,b),b.c=q(t,b),x.x=q(n,x),x.X=q(r,x),x.c=q(t,x),{format:function(e){var t=q(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=M(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=q(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=M(e+="",!0);return t.toString=function(){return e},t}}}tn.range;var ln={"-":"",_:" ",0:"0"},un=/^\s*\d+/,cn=/^%/,hn=/[\\^$*+?|[\]().{}]/g;function fn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function dn(e){return e.replace(hn,"\\$&")}function pn(e){return new RegExp("^(?:"+e.map(dn).join("|")+")","i")}function mn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function gn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function yn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Dn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function kn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Sn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function _n(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Cn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function En(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function An(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function In(e,t,n){var r=un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Rn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Nn(e,t,n){var r=un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function On(e,t,n){var r=un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Pn(e,t){return fn(e.getDate(),t,2)}function Ln(e,t){return fn(e.getHours(),t,2)}function jn(e,t){return fn(e.getHours()%12||12,t,2)}function zn(e,t){return fn(1+Nt.count(Wt(e),e),t,3)}function Fn(e,t){return fn(e.getMilliseconds(),t,3)}function Hn(e,t){return Fn(e,t)+"000"}function Bn(e,t){return fn(e.getMonth()+1,t,2)}function Vn(e,t){return fn(e.getMinutes(),t,2)}function Wn(e,t){return fn(e.getSeconds(),t,2)}function Un(e){var t=e.getDay();return 0===t?7:t}function $n(e,t){return fn(Pt.count(Wt(e)-1,e),t,2)}function Yn(e){var t=e.getDay();return t>=4||0===t?Ft(e):Ft.ceil(e)}function Xn(e,t){return e=Yn(e),fn(Ft.count(Wt(e),e)+(4===Wt(e).getDay()),t,2)}function Kn(e){return e.getDay()}function Gn(e,t){return fn(Lt.count(Wt(e)-1,e),t,2)}function Jn(e,t){return fn(e.getFullYear()%100,t,2)}function Zn(e,t){return fn((e=Yn(e)).getFullYear()%100,t,2)}function Qn(e,t){return fn(e.getFullYear()%1e4,t,4)}function er(e,t){var n=e.getDay();return fn((e=n>=4||0===n?Ft(e):Ft.ceil(e)).getFullYear()%1e4,t,4)}function tr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+fn(t/60|0,"0",2)+fn(t%60,"0",2)}function nr(e,t){return fn(e.getUTCDate(),t,2)}function rr(e,t){return fn(e.getUTCHours(),t,2)}function ir(e,t){return fn(e.getUTCHours()%12||12,t,2)}function or(e,t){return fn(1+$t.count(nn(e),e),t,3)}function ar(e,t){return fn(e.getUTCMilliseconds(),t,3)}function sr(e,t){return ar(e,t)+"000"}function lr(e,t){return fn(e.getUTCMonth()+1,t,2)}function ur(e,t){return fn(e.getUTCMinutes(),t,2)}function cr(e,t){return fn(e.getUTCSeconds(),t,2)}function hr(e){var t=e.getUTCDay();return 0===t?7:t}function fr(e,t){return fn(Xt.count(nn(e)-1,e),t,2)}function dr(e){var t=e.getUTCDay();return t>=4||0===t?Zt(e):Zt.ceil(e)}function pr(e,t){return e=dr(e),fn(Zt.count(nn(e),e)+(4===nn(e).getUTCDay()),t,2)}function mr(e){return e.getUTCDay()}function gr(e,t){return fn(Kt.count(nn(e)-1,e),t,2)}function yr(e,t){return fn(e.getUTCFullYear()%100,t,2)}function vr(e,t){return fn((e=dr(e)).getUTCFullYear()%100,t,2)}function br(e,t){return fn(e.getUTCFullYear()%1e4,t,4)}function xr(e,t){var n=e.getUTCDay();return fn((e=n>=4||0===n?Zt(e):Zt.ceil(e)).getUTCFullYear()%1e4,t,4)}function wr(){return"+0000"}function qr(){return"%"}function Mr(e){return+e}function Dr(e){return Math.floor(+e/1e3)}var kr=ft();kr("d3-number",(function(e,t,n){var r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=_t(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),kr("d3-time",(function(e){var t=sn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=sn.apply(void 0,arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));var Sr={id:function(e){return"".concat(e.source,"/").concat(e.key||e.title)},key:function(e){return String(e.key||e.title)},tags:function(e){return e.tags},min:function(e){return e.min},max:function(e){return e.max},type:function(e){return e.type},title:function(e){return String(e.title)},values:function(e){return e.values},value:function(e){return e},label:function(e){return e},formatter:function(e){return function(e){if("function"==typeof e.formatter)return e.formatter();var t=e.formatter||{};return kr(t.type||"d3-number")(t.format||"")}(e)}};function _r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?Sr.id:n,i=t.key,o=void 0===i?Sr.key:i,a=t.min,s=void 0===a?Sr.min:a,l=t.max,u=void 0===l?Sr.max:l,c=t.type,h=void 0===c?Sr.type:c,f=t.tags,d=void 0===f?Sr.tags:f,p=t.title,m=void 0===p?Sr.title:p,g=t.values,y=void 0===g?Sr.values:g,v=t.value,b=void 0===v?Sr.value:v,x=t.label,w=void 0===x?Sr.label:x,q=t.formatter,M=void 0===q?Sr.formatter:q,D={id:function(){return r(e)},key:function(){return o(e)},raw:function(){return e},tags:function(){return d(e)},type:function(){return h(e)},min:function(){return s(e)},max:function(){return u(e)},title:function(){return m(e)},items:function(){return y(e)},formatter:function(){return M(e)},value:b,label:w};return D}var Cr={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,u=e[t[0]].length;l<u;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:st,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}st(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}st(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,u=0;s<i;++s){for(var c=e[t[s]],h=c[a][1]||0,f=(h-(c[a-1][1]||0))/2,d=0;d<s;++d){var p=e[t[d]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,u+=f*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=u/l)}n[a-1][1]+=n[a-1][0]=o,st(e,t)}}},Er={ascending:function(e){var t=e.map(ht);return lt(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(ht),o=function(e){var t=e.map(ct);return lt(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],u=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(l)},none:lt,reverse:function(e){return lt(e).reverse()}};function Ar(e,t,n){for(var r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",u=t.order||"none",c=t.valueRef||"",h=0,f={},d=0;d<e.items.length;d++){var p=e.items[d],m=c?p[c]:null;if(m&&m.source){var g="".concat(m.source.key||"","/").concat(m.source.field);f[g]||(f[g]=m.source)}var y=i(p);r[y]=r[y]||{items:[]},r[y].items.push(p),h=Math.max(h,r[y].items.length)}for(var v=Array.apply(null,{length:h}).map(Number.call,Number),b=Object.keys(r).map((function(e){return r[e].items})),x=function(){var e=pe([]),t=lt,n=st,r=ut;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,u=s.length,c=new Array(u);for(o=0;o<u;++o){for(var h,f=s[o],d=c[o]=new Array(l),p=0;p<l;++p)d[p]=h=[0,+r(i[p],f,p,i)],h.data=i[p];d.key=f}for(o=0,a=t(c);o<u;++o)c[a[o]].index=o;return n(c,a),c}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:pe(Ve.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:pe(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?lt:"function"==typeof e?e:pe(Ve.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?st:e,i):n},i}().keys(v).value((function(e,t){return e[t]?o(e[t]):0})).order(Er[u]).offset(Cr[l])(b),w=[],q=0;q<x.length;q++)for(var M=x[q],D=0;D<M.length;D++){var k=M[D],S=M[D].data[M.key];S&&(S[a]={value:k[0]},S[s]={value:k[1]},w.push(k[0],k[1]))}var _=Object.keys(f).map((function(e){var t=n(f[e].key);return t?t.field(f[e].field):null})).filter((function(e){return!!e})),C=_r({title:_.map((function(e){return e.title()})).join(", "),min:Math.min.apply(Math,w),max:Math.max.apply(Math,w),type:"measure",formatter:_[0]?_[0].formatter:void 0});e.fields.push(C)}function Tr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=n.logger;if(Array.isArray(e))r.items=e.map((function(e){return{value:e,label:String(e)}}));else if(e){if("collection"in e)r=T({},t.collection(e.collection));else{var o=t.dataset?t.dataset(e.source):null,a=e.value||function(e){return e},s=e.label||function(e){return e};if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),r.items=[];else if(e.hierarchy)r.root=o.hierarchy?o.hierarchy(e.hierarchy):null,r.fields=o.fields();else if(e.items)r.items=e.items.map((function(e){return{value:a(e),label:String(s(e))}}));else if(e.extract){var l=Array.isArray(e.extract)?e.extract:[e.extract];r.items=[];var u=[];l.forEach((function(e){var n=e.source?t.dataset(e.source):o;n&&(r.items=[].concat(X(r.items),X(n.extract(e))),void 0!==e.field&&u.push(n.field(e.field)))})),u.length&&(r.fields=u),e.amend&&Array.isArray(e.amend)&&(r.items=[].concat(X(r.items),X(e.amend)))}else if(void 0!==e.field&&o){var c=o.field(e.field);c&&(r.fields||(r.fields=[]),r.fields.push(c),"value"in e||(a=c.value||function(e){return e},s=c.label||function(e){return e},r.value=a),r.items=c.items().map((function(t){return{value:a(t),label:String(s(t)),source:{field:e.field}}})))}else e.fields&&e.fields.forEach((function(e){var n,i="object"===I(e)&&e.source?t.dataset(e.source):o;i&&((n="object"===I(e)&&void 0!==e.field?i.field(e.field):i.field(e))&&(r.fields||(r.fields=[]),r.fields.push(n)))}));r.items&&e.map&&(r.items=r.items.map(e.map))}e&&e.stack&&Ar(r,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&r.items&&(r.items=r.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&r.items&&(r.items=r.items.sort(e.sort)),r}function Ir(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Tr,i={};(e||[]).forEach((function(e){if(!e.key)throw new Error('Data collection is missing "key" property');if("object"===I(e.data)&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=function(){return r(e.data,t,n)}}));var o=function(e){var t,n;if("string"==typeof e?t=e:"object"===I(e)&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());var r=i[t];if(n&&n.fields&&n.fields.filter){var o=r.fields.filter(n.fields.filter);r.fields.length!==o.length&&(r=C(r,{fields:o}))}return r};return o}function Rr(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Tr;if(e.data){var o=i(e.data,t,n);if(o&&o.fields&&o.fields[0])return o.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){var a=n.formatter.get(r)(e.format||"");return a}throw new Error("Formatter of type '".concat(r,"' was not found"))}function Nr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rr,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===I(o)&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"===I(o)&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}function Or(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Pr=function(e){return 1===e.length&&(e=function(e){return function(t,n){return Or(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}(Or).right;function Lr(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}var jr=Math.sqrt(50),zr=Math.sqrt(10),Fr=Math.sqrt(2);function Hr(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=jr?10:o>=zr?5:o>=Fr?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=jr?10:o>=zr?5:o>=Fr?2:1)}function Br(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Vr="$";function Wr(){}function Ur(e,t){var n=new Wr;if(e instanceof Wr)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function $r(){}Wr.prototype=Ur.prototype={constructor:Wr,has:function(e){return Vr+e in this},get:function(e){return this[Vr+e]},set:function(e,t){return this[Vr+e]=t,this},remove:function(e){var t=Vr+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Vr&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Vr&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Vr&&++e;return e},empty:function(){for(var e in this)if(e[0]===Vr)return!1;return!0},each:function(e){for(var t in this)t[0]===Vr&&e(this[t],t.slice(1),this)}};var Yr=Ur.prototype;$r.prototype={constructor:$r,has:Yr.has,add:function(e){return this[Vr+(e+="")]=e,this},remove:Yr.remove,clear:Yr.clear,values:Yr.keys,size:Yr.size,empty:Yr.empty,each:Yr.each};var Xr=Array.prototype,Kr=Xr.map,Gr=Xr.slice,Jr={name:"implicit"};function Zr(){var e=Ur(),t=[],n=[],r=Jr;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Jr)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=Ur();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=Gr.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Zr(t,n).unknown(r)},Br.apply(i,arguments),i}function Qr(){var e,t,n=Zr().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){var n=r().length,c=o[1]<o[0],h=o[c-0],f=o[1-c];e=(f-h)/Math.max(1,n-s+2*l),a&&(e=Math.floor(e)),h+=(f-h-e*(n-s))*u,t=e*(1-s),a&&(h=Math.round(h),t=Math.round(t));var d=Lr(n).map((function(t){return h+e*t}));return i(c?d.reverse():d)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),c()):r()},n.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},n.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,c()):a},n.padding=function(e){return arguments.length?(s=Math.min(1,l=+e),c()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),c()):s},n.paddingOuter=function(e){return arguments.length?(l=+e,c()):l},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},n.copy=function(){return Qr(r(),o).round(a).paddingInner(s).paddingOuter(l).align(u)},Br.apply(c(),arguments)}function ei(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ti(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ni(){}var ri=.7,ii=1/ri,oi="\\s*([+-]?\\d+)\\s*",ai="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",li=/^#([0-9a-f]{3,8})$/,ui=new RegExp("^rgb\\("+[oi,oi,oi]+"\\)$"),ci=new RegExp("^rgb\\("+[si,si,si]+"\\)$"),hi=new RegExp("^rgba\\("+[oi,oi,oi,ai]+"\\)$"),fi=new RegExp("^rgba\\("+[si,si,si,ai]+"\\)$"),di=new RegExp("^hsl\\("+[ai,si,si]+"\\)$"),pi=new RegExp("^hsla\\("+[ai,si,si,ai]+"\\)$"),mi={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 gi(){return this.rgb().formatHex()}function yi(){return this.rgb().formatRgb()}function vi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=li.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?bi(t):3===n?new Mi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ui.exec(e))?new Mi(t[1],t[2],t[3],1):(t=ci.exec(e))?new Mi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=hi.exec(e))?xi(t[1],t[2],t[3],t[4]):(t=fi.exec(e))?xi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=di.exec(e))?_i(t[1],t[2]/100,t[3]/100,1):(t=pi.exec(e))?_i(t[1],t[2]/100,t[3]/100,t[4]):mi.hasOwnProperty(e)?bi(mi[e]):"transparent"===e?new Mi(NaN,NaN,NaN,0):null}function bi(e){return new Mi(e>>16&255,e>>8&255,255&e,1)}function xi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mi(e,t,n,r)}function wi(e){return e instanceof ni||(e=vi(e)),e?new Mi((e=e.rgb()).r,e.g,e.b,e.opacity):new Mi}function qi(e,t,n,r){return 1===arguments.length?wi(e):new Mi(e,t,n,null==r?1:r)}function Mi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Di(){return"#"+Si(this.r)+Si(this.g)+Si(this.b)}function ki(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Si(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function _i(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ei(e,t,n,r)}function Ci(e){if(e instanceof Ei)return new Ei(e.h,e.s,e.l,e.opacity);if(e instanceof ni||(e=vi(e)),!e)return new Ei;if(e instanceof Ei)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ei(a,s,l,e.opacity)}function Ei(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ai(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Ti(e){return function(){return e}}function Ii(e){return 1==(e=+e)?Ri:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ti(isNaN(t)?n:t)}}function Ri(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ti(isNaN(e)?t:e)}ei(ni,vi,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:gi,formatHex:gi,formatHsl:function(){return Ci(this).formatHsl()},formatRgb:yi,toString:yi}),ei(Mi,qi,ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new Mi(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new Mi(this.r*e,this.g*e,this.b*e,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:Di,formatHex:Di,formatRgb:ki,toString:ki})),ei(Ei,(function(e,t,n,r){return 1===arguments.length?Ci(e):new Ei(e,t,n,null==r?1:r)}),ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new Ei(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new Ei(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Mi(Ai(e>=240?e-240:e+120,i,r),Ai(e,i,r),Ai(e<120?e+240:e-120,i,r),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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ni=function e(t){var n=Ii(t);function r(e,t){var r=n((e=qi(e)).r,(t=qi(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ri(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Oi(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Pi(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Vi(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Li(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ji(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function zi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Vi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hi=new RegExp(Fi.source,"g");function Bi(e,t){var n,r,i,o=Fi.lastIndex=Hi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Fi.exec(e))&&(r=Hi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:ji(n,r)})),o=Hi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Vi(e,t){var n,r=typeof t;return null==t||"boolean"===r?Ti(t):("number"===r?ji:"string"===r?(n=vi(t))?(t=n,Ni):Bi:t instanceof vi?Ni:t instanceof Date?Li:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Oi:Array.isArray(t)?Pi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?zi:ji)(e,t)}function Wi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ui(e){return+e}var $i=[0,1];function Yi(e){return e}function Xi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ki(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Gi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Xi(i,r),o=n(a,o)):(r=Xi(r,i),o=n(o,a)),function(e){return o(r(e))}}function Ji(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Xi(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Pr(e,t,1,r)-1;return o[n](i[n](t))}}function Zi(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qi(e,t){return function(){var e,t,n,r,i,o,a=$i,s=$i,l=Vi,u=Yi;function c(){return r=Math.min(a.length,s.length)>2?Ji:Gi,i=o=null,h}function h(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return h.invert=function(n){return u(t((o||(o=r(s,a.map(e),ji)))(n)))},h.domain=function(e){return arguments.length?(a=Kr.call(e,Ui),u===Yi||(u=Ki(a)),c()):a.slice()},h.range=function(e){return arguments.length?(s=Gr.call(e),c()):s.slice()},h.rangeRound=function(e){return s=Gr.call(e),l=Wi,c()},h.clamp=function(e){return arguments.length?(u=e?Ki(a):Yi,h):u!==Yi},h.interpolate=function(e){return arguments.length?(l=e,c()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function eo(e,t,n,r){var i,o=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=jr?i*=10:o>=zr?i*=5:o>=Fr&&(i*=2),t<e?-i:i}(e,t,n);switch((r=yt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(pt(t)/3)))-pt(Math.abs(e)))}(o,a))||(r.precision=i),Dt(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pt(t)-pt(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-pt(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Mt(r)}function to(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Hr(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eo(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Hr(s,l,n))>0?r=Hr(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Hr(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function no(){var e=Qi(Yi,Yi);return e.copy=function(){return Zi(e,no())},Br.apply(e,arguments),to(e)}function ro(){var e,t=[.5],n=[0,1],r=1;function i(i){return i<=i?n[Pr(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Gr.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Gr.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return ro().domain(t).range(n).unknown(e)},Br.apply(i,arguments)}function io(e){return void 0===e?function(e){return e}:function(t){return e(t)}}function oo(e){return Math.max(0,Math.min(1,e))}function ao(e){return"object"===I(e)}function so(e,t,n){for(var r=Math.abs(t-n)/(e+1),i=[],o=1;o<=e;o++){var a=o*r;i.push(t<n?t+a:t-a)}return i}function lo(e,t,n){if(1===e.length)return e;for(var r=e.concat([]),i=0;i<e.length;i++){var o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push.apply(r,X(so(t,o,a))),o-=a-o,a=e[i],r.push.apply(r,X(so(t,o,a)))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push.apply(r,X(so(t,o,a)))):r.push.apply(r,X(so(t,o,a)))}return r.filter((function(e){return e>=n.min()&&e<=n.max()}))}function uo(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),h=n.ticks(c);h.length<=1&&(h=n.ticks(c+1));var f=i>0?lo(h,i,n):h;f.sort((function(e,t){return e-t}));var d=f.map(io(l));return f.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===h.indexOf(e)}}))}function co(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),h=c>10?10:c;n.nice(h);var f=n.ticks(c),d=i>0?lo(f,i,n):f;d.sort((function(e,t){return e-t}));var p=d.map(io(l));return d.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===f.indexOf(e)}}))}function ho(e){var t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?function(e){return e}:o,s=n.minorTicks&&!Q(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values))t=function(e){var t=e.values,n=e.scale,r=e.formatter,i=void 0===r?function(e){return e}:r;return t.sort((function(e,t){return(ao(e)?e.value:e)-(ao(t)?t.value:t)})).filter((function(e,t,r){var i=ao(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((function(e){var t=ao(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?oo(n(e.start)):o,end:t&&!isNaN(e.end)?oo(n(e.end)):o}}))}({values:n.ticks.values.filter((function(e){return"object"===I(e)?!Q(e.value):!Q(e)})),scale:r.copy(),formatter:a});else if(Q(n.ticks.count)){t=(n.ticks.tight?co:uo)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){var r=e.map((function(e){return e.position})),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);var o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){var t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((function(e,t){var o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function fo(e){var t=e.scale,n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((function(e,n){var a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}function po(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return Object.keys(t).forEach((function(i){var o=I(e[i]);r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}var mo={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},go={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},yo={count:NaN};function vo(e,t){var n=+e.min,r=+e.max,i=0,o=1;if(t&&t[0]){var a=t.map((function(e){return e.min()})).filter((function(e){return!isNaN(e)})),s=t.map((function(e){return e.max()})).filter((function(e){return!isNaN(e)}));if(i=a.length?Math.min.apply(Math,X(a)):Number.NaN,o=s.length?Math.max.apply(Math,X(s)):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){var l=o-i;i-=l*e.expand,o+=l*e.expand}if(Array.isArray(e.include)){var u=e.include.filter((function(e){return!isNaN(e)}));i=Math.min.apply(Math,X(u).concat([i])),o=Math.max.apply(Math,X(u).concat([o]))}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}function bo(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function xo(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=no(),o={instance:null,invert:!1},a={data:n,resources:r},s=po(t,mo,a);function l(e){return Q(e)?NaN:i(e)}s.ticks=po(t.ticks,go,a),s.minorTicks=po(t.minorTicks,yo,a),l.data=function(){return n},l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return e},l.clearTicksCache=function(){return e=void 0,this},l.ticks=function(t){return null!==t&&"object"===I(t)?(t.settings=t.settings||{},t.settings=C(!0,{},s,t.settings),t.scale=l,e=ho(t)):e=i.ticks(t)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),o.instance&&o.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){for(var t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2,o=0;o<e;o++){var a=n[n.length-1]||0,s=a+t,u=l(a+i);n.push.apply(n,[s,s]),r.push.apply(r,[u,u])}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){var e=xo(t,n,r);return e.domain(l.domain()),e.range(l.range()),e.clamp(i.clamp()),e},l.norm=function(e){return bo(o,l),o.instance(e)},l.normInvert=function(e){return bo(o,l),o.instance.invert(e)};var u=vo(s,n?n.fields:[]),c=u.mini,h=u.maxi;return l.domain([c,h]),l.range(s.invert?[1,0]:[0,1]),o.invert=s.invert,l}var wo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={data:t,resources:n},i=po(e,wo,r),o=t.items||[],a={},s=[],l=[];function u(e,n){e.data=function(){return t},e.datum=function(e){return o[a[e]]},e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=function(){return l},e.ticks=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,fo(t,n.trackBy)}}var c=Qr();u(c,e),c.pxScale=function(t){var n=i.maxPxStep;if(isNaN(n))return c;var r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;var a=c.copy();a.type=c.type,u(a,e);var s=o*n/t,l=(1-s)*c.align();return a.range(i.invert?[s+l,l]:[l,s+l]),a};for(var h="function"==typeof e.value?e.value:function(e){return e.datum.value},f="function"==typeof e.label?e.label:function(e){return e.datum.label},d=0;d<o.length;d++){var p=C({datum:o[d]},r),m=h(p,d);-1===s.indexOf(m)&&(s.push(m),l.push(f(p,d)),a[m]=d)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}var Mo={depth:0};function Do(e,t,n){return e.ancestors().map((function(e){return t(C({datum:e.data},n))})).reverse().slice(1).toString()}function ko(e,t,n){var r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},u=[],c=0;if(!e)return{values:a,labels:s,items:l,ticks:u};e.eachAfter((function(e){if(e.depth>0){var t=Do(e,i,n),h=e.leaves()||[e],f=i(C({datum:e.data},n)),d=o(C({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:f,label:d,leftEdge:Do(h[0],i,n),rightEdge:Do(h[Math.max(h.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(c,"_SPACER")),c++):(a.push(t),s.push(d)),(r<=0&&!p||e.depth===r)&&u.push(m),l[t]=m}}));var h=e.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:u}}var So=function(e){return e.min()},_o=function(e){return e.max()};function Co(e,t){var n=e&&!isNaN(e.min),r=e&&!isNaN(e.max),i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){var a=t.map(So).filter(Z);i=a.length?Math.min.apply(Math,X(a)):i}if(!r){var s=t.map(_o).filter(Z);o=s.length?Math.max.apply(Math,X(s)):o}}return[i,o]}var Eo={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Ao(e,t,n){var r=e.length;if(2===r)return[t,n];var i=[],o=(n-t)/(r-1);i.push(t);for(var a=1;a<r-1;a++)i.push(t+o*a);return i.push(n),i}function To(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=xo(e,t,n).clamp(!0).interpolate(Ni),i=po(e,Eo,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;C(!0,s,r);var l=Co(i,t?t.fields:[]),u=Y(l,2),c=u[0],h=u[1],f=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",f>0?f:2):[],p=a?i.range:d;return s.range(i.invert?p.slice().reverse():p.slice()),s.domain(o?i.domain:Ao(s.range(),c,h)),s}var Io={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Ro(e,t,n){var r=e.length;if(2===r)return[t+(n-t)/2];for(var i=[],o=(n-t)/r,a=1;a<r;a++)i.push(t+o*a);return i}function No(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;var i=To().domain([n,r]).range(t);return[n].concat(X(function(e){for(var t=[],n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}(e)),[r]).map((function(e){return i(e)}))}function Oo(e,t,n){var r=2===e.length?10:Math.max(1,e.length),i=no().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;for(var o=Math.max(0,e.length-1);i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}var Po={domain:[],range:[]};function Lo(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Zr(),i={data:t,resources:n},o=po(e,Po,i),a="function"==typeof e.value?e.value:function(e){return e.datum.value},s="function"==typeof e.label?e.label:function(e){return e.datum.label},l=t.items||[],u={},c=[],h=[],f=0;f<l.length;f++){var d=C({datum:l[f]},i),p=a(d,f);-1===c.indexOf(p)&&(c.push(p),h.push(s(d,f)),u[p]=f)}return r.data=function(){return t},r.labels=function(){return h},r.label=function(e){return h[c.indexOf(e)]},r.datum=function(e){return l[u[e]]},r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(c),r}var jo={domain:[],range:[],unknown:void 0},zo={domain:[],range:[],override:!1};var Fo=ft();function Ho(e,t,n){var r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((function(e){r.extract.push({field:e})})));var i,o=Tr(r,t,n),a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?-1!==e.fields.map((function(e){return"dimension"===e.type()?"band":"linear"})).indexOf("linear")?"linear":"band":"linear"}(o);return"color"===a&&(a=o.fields&&o.fields[0]&&"dimension"===o.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&((i=(i=n.scale.get(a))(e,o,{theme:n.theme,logger:n.logger})).type=a),i}function Bo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ho,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===I(o)&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}Fo("linear",xo),Fo("band",qo),Fo("h-band",(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={data:n,resources:r},o=po(t,wo,i);o.ticks=po(t.ticks,Mo,i),o.value="function"==typeof t.value?t.value:function(e){return e.datum.value},o.label="function"==typeof t.label?t.label:function(e){return e.datum.value};var a=qo(o),s=ko(n.root,o,i),l=s.values,u=s.labels,c=s.items,h=s.ticks,f=function(e){var t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};C(!0,f,a),f.bandwidth=function(e){var t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){var r=f(t.leftEdge),i=f(t.rightEdge);return Math.abs(r-i)+n}return n},f.step=function(e){var t=c[String(e)],n=t?t.count:1,r=a.step();return r*=n},f.data=function(){return n},f.datum=function(e){var t=c[String(e)];return t?t.node.data:null},f.copy=function(){return e(t,n,r)},f.labels=function(){return u},f.ticks=function(){return h.map((function(e){var t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}))};var d=a.pxScale;return f.pxScale=function(e){return a=d(e),f},f.domain(l),f})),Fo("sequential-color",To),Fo("threshold-color",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ro(),i=po(e,Io,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return Q(e)?NaN:r(e)}Object.keys(r).forEach((function(e){return s[e]=r[e]}));var l=t.fields,u=Co(i,l),c=Y(u,2),h=c[0],f=c[1],d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[],m=a?i.range:p,g=[];return g=o?i.domain:i.nice?Oo(m,h,f):[h+(f-h)/2],m.length>g.length+1?g=Ro(m,h,f):m.length<g.length+1&&(m=No(g,m,h,f)),s.data=function(){return t},s.range(i.invert?m.slice().reverse():m),s.domain(g),s})),Fo("categorical-color",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Lo(t,n,r),o=r.theme,a=po(t,jo,{data:n,resources:r});if(a.explicit=po(t.explicit,zo,{data:n,resources:r}),e=Array.isArray(a.range)&&0!==a.range.length?a.range.slice():o?o.palette("categorical",i.domain().length).slice():[],a.unknown)i.unknown(a.unknown);else if(o&&o.palette("unknown")){var s=o.palette("unknown");i.unknown(s[0])}if(Array.isArray(a.explicit.domain)&&a.explicit.domain.length){for(var l=i.domain().slice(),u=a.explicit.domain,c=Array.isArray(a.explicit.range)?a.explicit.range:[],h=Math.floor(l.length/e.length),f=1;f<h+1;f*=2)e=e.concat(e);if(a.explicit.override)for(var d=0;d<u.length;d++){var p=l.indexOf(u[d]);p>-1&&(e[p]=c[d])}else{var m=u.map((function(e,t){return[l.indexOf(e),e,c[t]]})).sort((function(e,t){return e[0]-t[0]}));m.forEach((function(t){var n=l.indexOf(t[1]);-1!==n&&e.splice(n,0,t[2])}))}e.length=l.length}return i.range(e),i}));var Vo={};function Wo(){Wo.init.call(this)}Vo.isObject=function(e){return"object"==typeof e&&null!==e},Vo.isNumber=function(e){return"number"==typeof e},Vo.isUndefined=function(e){return void 0===e},Vo.isFunction=function(e){return"function"==typeof e};var Uo=Wo;Wo.EventEmitter=Wo,Wo.prototype._events=void 0,Wo.prototype._maxListeners=void 0,Wo.defaultMaxListeners=10,Wo.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Wo.prototype.setMaxListeners=function(e){if(!Vo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Wo.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Vo.isUndefined(n))return!1;if(Vo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Vo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},Wo.prototype.addListener=function(e,t){var n;if(!Vo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Vo.isFunction(t.listener)?t.listener:t),this._events[e]?Vo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Vo.isObject(this._events[e])&&!this._events[e].warned)&&((n=Vo.isUndefined(this._maxListeners)?Wo.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Vo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Vo.isFunction(console.trace)&&console.trace()));return this},Wo.prototype.on=Wo.prototype.addListener,Wo.prototype.once=function(e,t){if(!Vo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},Wo.prototype.removeListener=function(e,t){var n,r,i,o;if(!Vo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Vo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Vo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Wo.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Vo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Wo.prototype.listeners=function(e){return this._events&&this._events[e]?Vo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Wo.listenerCount=function(e,t){return e._events&&e._events[t]?Vo.isFunction(e._events[t])?1:e._events[t].length:0};var $o=function(e){return Object.keys(Uo.prototype).forEach((function(t){e[t]=Uo.prototype[t]})),Uo.init(e),e};function Yo(){var e=0,t=0,n=0,r=0;n=n||e;var i={move:function(e){this.moveTo(n+e)},moveTo:function(o){var a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update:function(o){var a=!1,s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);var u=Math.max(e,Math.min(t-r,n));n!==u&&(n=u,a=!0),a&&i.emit("update")},getState:function(){return{min:e,max:t,start:n,viewSize:r}}};return $o(i),i}function Xo(e,t){var n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Yo();return o.update({min:n,max:r,viewSize:i}),o}function Ko(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xo(e[r],t?t[r]:null));return n}function Go(e,t){return t[e]||(t[e]=Yo()),t[e]}function Jo(e,t){return e<=t}function Zo(e,t){return e<t}function Qo(e,t,n){for(var r=0;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function ea(e,t,n,r){for(var i=e.length,o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}function ta(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.includeMax,i=void 0===r||r,o=n.includeMin,a=void 0===o||o;e=i?Jo:Zo,t=a?Jo:Zo},i.add=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==0&&s.push(n),a%2==0&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.remove=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==1&&s.push(n),a%2==1&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.set=function(e){var t=r.join(",");return r=[],Array.isArray(e)?e.forEach(i.add):i.add(e),t!==r.join(",")},i.clear=function(){var e=r.length>0;return r=[],e},i.containsValue=function(n){return ea(r,n,t,e)},i.containsRange=function(e){var t=e.min,n=e.max,i=Qo(r,t,!0),o=Qo(r,n);return i===o&&o%2==1},i.toggle=function(e){return i.containsRange(e)?i.remove(e):i.add(e)},i.ranges=function(){for(var e=[],t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function na(){var e=[];function t(){}return t.add=function(t){return-1===e.indexOf(t)&&(e.push(t),!0)},t.remove=function(t){var n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=function(t){return-1!==e.indexOf(t)},t.values=function(){return e.slice()},t.clear=function(){return e=[]},t.toString=function(){return e.join(";")},t}var ra={key:void 0,includeMin:!0,includeMax:!0};function ia(e){for(var t,n,r=e.items,i=e.collection,o=e.vc,a={},s=[],l=0,u=r.length;l<u;l++){i[t=r[l].key]||(i[t]=o()),n=r[l].values||[r[l].value];for(var c=0;c<n.length;c++)i[t].add(n[c])&&(a[t]=a[t]||[],a[t].push(n[c]))}for(var h=Object.keys(a),f=0,d=h.length;f<d;f++)t=h[f],s.push({id:t,values:a[t]});return s}function oa(e){for(var t,n,r=e.items,i=e.collection,o={},a=[],s=0,l=r.length;s<l;s++)if(i[t=r[s].key]){n=r[s].values||[r[s].value];for(var u=0;u<n.length;u++)i[t].remove(n[u])&&(o[t]=o[t]||[],o[t].push(n[u]))}for(var c=Object.keys(o),h=0,f=c.length;h<f;h++)t=c[h],a.push({id:t,values:o[t]});return a}function aa(e){for(var t,n,r={},i=0,o=e.length;i<o;i++){t=e[i].key,n=e[i].values||[e[i].value],r[t]||(r[t]=[]);for(var a=0;a<n.length;a++){-1===r[t].indexOf(n[a])&&r[t].push(n[a])}}return r}function sa(e){var t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function la(e){for(var t,n,r,i=e.items,o=e.values,a=e.vc,s={},l={},u=[],c=[],h=aa(i),f=Object.keys(h),d=0,p=f.length;d<p;d++)for(var m=0,g=(r=h[t=f[d]]).length;m<g;m++)n=r[m],o[t]&&o[t].contains(n)?o[t]&&o[t].contains(n)&&(l[t]=l[t]||[],l[t].push(n),o[t].remove(n)):sa({key:t,value:n,collection:o,obj:s,fn:a});for(var y=Object.keys(s),v=0,b=y.length;v<b;v++)t=y[v],u.push({id:t,values:s[t]});for(var x=Object.keys(l),w=0,q=x.length;w<q;w++)t=x[w],c.push({id:t,values:l[t]});return[u,c]}function ua(e,t){for(var n,r,i=[],o=Object.keys(e),a=function(e){return-1===t[n].indexOf(e)},s=0,l=o.length;s<l;s++)n=o[s],t[n]?(r=e[n].filter(a)).length&&i.push({id:n,values:r}):i.push({id:n,values:e[n]});return i}function ca(e){for(var t,n,r=e.items,i=e.vCollection,o=e.vc,a={},s=aa(r),l={},u=Object.keys(i),c=0,h=u.length;c<h;c++)l[n=u[c]]=i[n].values().slice(),delete i[n];for(var f=function(e){i[n]&&i[n].contains(e)||sa({key:n,value:e,collection:i,obj:a,fn:o})},d=Object.keys(s),p=0,m=d.length;p<m;p++)s[n=d[p]].forEach(f);return t=ua(l,a),[ua(a,l),t]}function ha(e,t,n){var r=function(e,t){if(!Object.keys(t).length)return e;for(var n=e.length,r=Array(n),i=0;i<n;i++)r[i]=e[i].key in t?C({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((function(e,t){return t(e)}),r):r}function fa(e){return e.replace(/(-[a-z])/g,(function(e){return e.toUpperCase().replace("-","")}))}function da(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))}function pa(e,t,n){var r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig,l=ha(i["".concat(t,"Ranges")],e,a),u=!1;return l.forEach((function(e){var n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)u=r[n][t](e.ranges||e.range)||u;else for(var i=e.ranges||[e.range],a=0;a<i.length;a++)u=r[n][t](i[a])||u})),u}function ma(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?na:t,r=e.rc,i=void 0===r?ta:r,o=!1,a={},s={},l={},u={sources:{},default:C({},ra)},c={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},h=function(){var e={values:{},ranges:{}};return Object.keys(s).forEach((function(t){e.values[t]=s[t].values()})),Object.keys(a).forEach((function(t){e.ranges[t]=a[t].ranges()})),e},f={ls:[],clear:function(){this.ls.forEach((function(e){return e.clear()}))},start:function(){this.ls.forEach((function(e){return e.start()}))},end:function(){this.ls.forEach((function(e){return e.end()}))},update:function(){var e=h();this.ls.forEach((function(t){return t._state(e)}))},updateValues:function(){var e=h();this.ls.forEach((function(t){return t._state({values:e.values})}))},updateRanges:function(){var e=h();this.ls.forEach((function(t){return t._state({ranges:e.ranges})}))}},d={configure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(u={sources:{},default:C({},ra)},e.ranges.forEach((function(e){var t={};Object.keys(ra).filter((function(e){return"key"!==e})).forEach((function(n){t[n]=void 0!==e[n]?e[n]:ra[n]})),void 0!==e.key?u.sources[e.key]=t:u.default=t})),Object.keys(a).forEach((function(e){return a[e].configure(u.sources[e]||u.default)})),d.emit("update",[],[]))},link:function(e){if(d===e)throw new Error("Can't link to self");f.ls.push(e),e._state(h())},_state:function(e){if(!e)return h();if(e.values){var t=[];Object.keys(e.values).forEach((function(n){s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(s).forEach((function(n){e.values[n]||t.push({key:n,values:[]})})),t.length&&d.setValues(t)}if(e.ranges){var n=[];Object.keys(e.ranges).forEach((function(t){a[t]&&e.ranges[t].join(";")===a[t].toString()||n.push({key:t,ranges:e.ranges[t]})})),Object.keys(a).forEach((function(t){e.ranges[t]||n.push({key:t,ranges:[]})})),n.length&&d.setRanges(n)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];d.emit.apply(d,["start"].concat(t)),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];d.emit.apply(d,["end"].concat(t)),f.end()}},isActive:function(){return o},clear:function(){var e=d.brushes().filter((function(e){return"value"===e.type&&e.brush.values().length})).map((function(e){return{id:e.id,values:e.brush.values()}})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(d.emit("update",[],e),f.clear())},brushes:function(){var e=[];return e=(e=e.concat(Object.keys(a).map((function(e){return{type:"range",id:e,brush:a[e]}})))).concat(Object.keys(s).map((function(e){return{type:"value",id:e,brush:s[e]}})))},addValue:function(e,t){d.addValues([{key:e,value:t}])},addValues:function(e){var t=ha(c.addValues,e,l),r=ia({vc:n,collection:s,items:t});d.emit("add-values",t),r.length&&(o||(o=!0,d.emit("start")),d.emit("update",r,[]),f.updateValues())},setValues:function(e){var t=ha(c.setValues,e,l),r=ca({items:t,vCollection:s,vc:n});d.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,d.emit("start")),d.emit("update",r[0],r[1]),f.updateValues())},removeValue:function(e,t){d.removeValues([{key:e,value:t}])},removeValues:function(e){var t=ha(c.removeValues,e,l),n=oa({collection:s,items:t});d.emit("remove-values",t),n.length&&(d.emit("update",[],n),f.updateValues())},addAndRemoveValues:function(e,t){var r=ha(c.addValues,e,l),i=ha(c.removeValues,t,l),a=ia({vc:n,collection:s,items:r}),u=oa({collection:s,items:i});d.emit("add-values",r),d.emit("remove-values",i),(a.length||u.length)&&(o||(o=!0,d.emit("start")),d.emit("update",a,u),f.updateValues())},toggleValue:function(e,t){d.toggleValues([{key:e,value:t}])},toggleValues:function(e){var t=ha(c.toggleValues,e,l),r=la({items:t,values:s,vc:n});d.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,d.emit("start")),d.emit("update",r[0],r[1]),f.updateValues())},containsValue:function(e,t){var n=l[e]||e;return!!s[n]&&s[n].contains(t)},addRange:function(e,t){d.addRanges([{key:e,range:t}])},addRanges:function(e){pa(e,"add",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,d.emit("start")),d.emit("update",[],[]),f.updateRanges())},removeRange:function(e,t){d.removeRanges([{key:e,range:t}])},removeRanges:function(e){pa(e,"remove",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,d.emit("start")),d.emit("update",[],[]),f.updateRanges())},setRange:function(e,t){d.setRanges([{key:e,range:t}])},setRanges:function(e){pa(e,"set",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,d.emit("start")),d.emit("update",[],[]),f.updateRanges())},toggleRange:function(e,t){d.toggleRanges([{key:e,range:t}])},toggleRanges:function(e){pa(e,"toggle",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,d.emit("start")),d.emit("update",[],[]),f.updateRanges())},containsRangeValue:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},containsRange:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},containsMappedData:function(e,t,n){for(var r,i,o,u,c=[],h=Object.keys(e),f=0,d=h.length;f<d;f++){if("value"===(r=h[f]))i=e,c[f]={key:"",i:f,bool:!1};else{if("source"===r)continue;i=e[r],c[f]={key:r,i:f,bool:!1}}void 0!==(o=i.source&&i.source.field)&&(void 0!==i.source.key&&(o="".concat(i.source.key,"/").concat(o)),o in l&&(o=l[o]),u=i.value,a[o]?c[f].bool=Array.isArray(u)?a[o].containsRange({min:u[0],max:u[1]}):a[o].containsValue(u):s[o]&&s[o].contains(u)&&(c[f].bool=!0))}return t?(c=c.filter((function(e){return-1!==t.indexOf(e.key)})),"and"===n?!!c.length&&!c.some((function(e){return!1===e.bool})):"xor"===n?!!c.length&&c.some((function(e){return e.bool}))&&c.some((function(e){return!1===e.bool})):c.some((function(e){return e.bool}))):c.some((function(e){return e.bool}))},intercept:function(e,t){var n=fa(e);c[n]&&c[n].push(t)},removeInterceptor:function(e,t){var n=fa(e);if(c[n]){var r=c[n].indexOf(t);-1!==r&&c[n].splice(r,1)}},removeAllInterceptors:function(e){var t=[];if(e){var n=fa(e);c[n]&&c[n].length&&t.push({name:e,handlers:c[n]})}else Object.keys(c).forEach((function(e){c[e].length&&t.push({name:da(e),handlers:c[e]})}));t.forEach((function(e){e.handlers.slice().forEach((function(t){return d.removeInterceptor(e.name,t)}))}))},addKeyAlias:function(e,t){l[e]=t},removeKeyAlias:function(e){delete l[e]}};return $o(d),d}function ga(e){return e*e*e}function ya(e){return--e*e*e+1}function va(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function ba(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}ft();var xa={shouldBeRemoved:!1,isInit:!1};function wa(e,t,n){var r,i=e.old,o=e.current,a=t.renderer,s=[],l={nodes:[],ips:[]},u={nodes:[],ips:[]},c={nodes:[],ips:[]},h=[],f=null,d=n.trackBy||ba,p={start:function(){var e={};if(i.forEach((function(t,n){var r=d(t,n);e[r]=t})),o.forEach((function(t,n){var r=d(t,n);e[r]?(c.ips.push(zi(e[r],t)),c.nodes.push(t),s.push(e[r]),e[r]=!1):(l.nodes.push(t),l.ips.push(zi(C({},t,{r:.001,opacity:0}),t)))})),Object.keys(e).forEach((function(t){e[t]&&(u.nodes.push(e[t]),u.ips.push(zi(e[t],C({},e[t],{r:1e-4,opacity:0}))))})),h.push({name:"exiting",easing:ga,duration:200,tweens:u.ips,nodes:[].concat(s)}),h.push({name:"updating",easing:va,duration:400,tweens:c.ips,nodes:[]}),h.push({name:"entering",easing:ya,duration:200,tweens:l.ips,nodes:X(c.nodes)}),n.isMainComponent){var t,m=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,g=m?s.filter(m).length:s.length;!1===xa.isInit?(xa.shouldBeRemoved=0===g,xa.isInit=!0):xa.shouldBeRemoved=xa.shouldBeRemoved&&0===g}h.length&&(f=a.getScene(o),h[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(p.tick)))},tick:function(){var e=h[0];e||p.stop(),e.started||(e.started=Date.now());var t=(Date.now()-e.started)/e.duration,n=[],i=e.tweens.map((function(n){return n(e.easing(Math.min(1,t)))}));n.push.apply(n,X(i)),n.push.apply(n,X(e.nodes)),a.render(n),t>=1&&(h.shift(),h.length?"updating"===h[0].name&&xa.shouldBeRemoved&&h.shift():(!0===xa.isInit&&(xa.isInit=!1),p.stop())),r&&(r=window.requestAnimationFrame(p.tick))},stop:function(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:function(){return!!r},get targetScene(){return f}};return p}var qa={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Ma=/^\$/;function Da(e){var t=I(e);return"object"!==t&&"function"!==t&&"undefined"!==t}function ka(e,t,n){var r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Sa(e,t){return e.pxScale?e.pxScale(t):e}var _a={normalizeSettings:function(e,t,n){var r=C({},e),i=C({},t);return Object.keys(r).forEach((function(e){i[e]={};var o=r[e],a=I(o);if("function"==typeof o)i[e].fn=o;else if(Da(o)){var s=t[e];"string"==typeof s&&Ma.test(s)&&(s=qa[s]);var l=I(s);i[e]="undefined"===l||l===a?o:s}else o&&"object"===I(o)&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((function(e){if(!(e in r)){var n=t[e];"string"===I(n)&&Ma.test(n)?i[e]=qa[n]:i[e]=n}})),i},resolveForItem:function(e,t,n){for(var r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum,l=0;l<o;l++){var u=i[l],c=t[u],h="object"===I(s)&&void 0!==c,f=h&&"string"==typeof c.ref,d=h&&u in s,p=f?s[c.ref]:d?s[u]:a;Da(c)?r[u]=c:h&&c.fn?(c.scale&&(e.scale=c.scale),r[u]=c.fn.call(null,e,n)):h&&c.scale&&p?(r[u]=c.scale(p.value),c.scale.bandwidth&&(r[u]+=c.scale.bandwidth()/2)):f&&p?r[u]=p.value:c.fn?r[u]=c.fn.call(null,e,n):r[u]=c}return r},updateScaleSize:ka};function Ca(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_a,n={};function r(r){var i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled,u=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach((function(e){u[e]&&t.updateScaleSize(u,e,l[e])}));var h=[];if(!i||!Array.isArray(i.items)){var f={data:i,resources:c},d=t.resolveForItem(f,n.norm,-1);return{settings:n.norm,item:d}}for(var p,m=0,g=i.items.length;m<g;m++){p={datum:i.items[m],data:i,resources:c};var y=t.resolveForItem(p,n.norm,m);y.data=i.items[m],h.push(y)}return{settings:n.norm,items:h}}return{resolve:r}}function Ea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((function(e,t){return Array.isArray(t.children)?(e.push.apply(e,X(Ea(t.children))),e):(e.push(t),e)}),[])}function Aa(e,t){var n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode,s=e.chart.brush(n),l=r,u=i.active||{},c=i.inactive||{},h=[];Object.keys(u).forEach((function(e){h.push(e)})),Object.keys(c).forEach((function(e){-1===h.indexOf(e)&&h.push(e)}));var f=[],d=!1,p=function(){var t=Ea(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=function(){for(var e,t=p(),n=t.length,r=!1,i="function"==typeof l?l({brush:s}):l,o=function(n){if(!(e=t[n].data))return"continue";t[n].__style||(t[n].__style={},h.forEach((function(e){t[n].__style[e]=t[n][e]})));var r=s.containsMappedData(e,i,a),o=f.indexOf(t[n]),l=!1;r&&-1===o?(f.push(t[n]),l=!0):r||-1===o||(f.splice(o,1),l=!0),t[n].needToUpdate=l||d,t[n].isActive=r},m=0;m<n;m++)o(m);for(var g=function(n){if(!(e=t[n].data))return"continue";if(t[n].needToUpdate){var i=C({},t[n],t[n].__style),o=t[n].isActive;h.forEach((function(e){t[n][e]=o&&e in u?"function"==typeof u[e]?u[e].call(null,i,f):u[e]:!o&&e in c?"function"==typeof c[e]?c[e].call(null,i,f):c[e]:t[n].__style[e]})),r=!0}delete t[n].needToUpdate},y=0;y<n;y++)g(y);return d=!1,r},g=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=p(),i=r.length,o=function(e){if(!r[e].data)return"continue";r[e].__style=r[e].__style||{},h.forEach((function(t){r[e].__style[t]=r[e][t],t in c&&(r[e][t]="function"==typeof c[t]?c[t].call(null,r[e]):c[t])}))},a=0;a<i;a++)o(a);d=!0,f.length=0,n||e.renderer.render(e.nodes)},y=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=p(),i=r.length,o=function(e){r[e].__style&&(Object.keys(r[e].__style).forEach((function(t){r[e][t]=r[e].__style[t]})),r[e].__style=void 0)},a=0;a<i;a++)o(a);f.length=0,n||e.renderer.render(e.nodes)},v=function(){if(m()){var t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",v),{isActive:function(){return s.isActive()},update:function(){f.length=0,d=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function Ta(e){for(var t=e.nodes,n=e.action,r=e.chart,i=e.trigger,o=[],a=0;a<t.length;a++){var s=t[a].data;null!==s&&o.push(s)}!function(e){var t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(i){var o=i.data||[""],a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(var l=function(e){var n=t[e];if(!n)return"continue";o.forEach((function(e){var t=n&&!e?n:n[e];if(t){var r={key:t.source.field};void 0!==t.source.key&&(r.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(r.range={min:t.value[0],max:t.value[1]},a.items.push(r)):(r.value=t.value,s.items.push(r))}}))},u=0;u<t.length;u++)l(u);i.contexts.forEach((function(e){a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}}({dataPoints:o,action:n,chart:r,trigger:i})}function Ia(e){var t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;return t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]])),Ta({nodes:o.map((function(e){return e.node})),action:i,chart:r.chart,data:r.data,trigger:n}),a}function Ra(e,t,n){var r=n.element().getBoundingClientRect(),i=J(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&J(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!J(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Na(e,t,n){return e?"function"==typeof e?e(t):e:n}function Oa(e){var t=e.e,n=e.t,r=e.config;return Ia({collisions:Ra(t,n,r.renderer),t:n,config:r,action:Na(n.action,t,"toggle")})}function Pa(e){var t=e.e,n=e.t,r=e.config;return Ia({collisions:Ra(t,n,r.renderer),t:n,config:r,action:Na(n.action,t,"set")})}var La={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function ja(e,t){Object.keys(La).forEach((function(n){var r=t[n];void 0!==r&&(e[La[n]]=r)}))}function za(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var i=e[r];n+=0===r?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Fa(e,t,n,r){var i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Ha(e){return-e/180*Math.PI}function Ba(e){return function(e){var t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Ha(e))}function Va(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Wa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ua(e,t){return{x:e.x*t,y:e.y*t}}function $a(e,t){return e.x-t.x}function Ya(e,t){return e.y-t.y}function Xa(e,t){return Math.pow($a(e,t),2)+Math.pow(Ya(e,t),2)}function Ka(e,t){return Math.sqrt(Xa(e,t))}function Ga(e,t){return e.x*t.x+e.y*t.y}function Ja(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0},r=Math.cos(t),i=Math.sin(t),o=Wa(e,n),a={x:r*o.x-i*o.y,y:i*o.x+r*o.y};return Va(a,n)}var Za={up:0,down:180,left:90,right:-90};function Qa(e){var t=e.x,n=e.y,r=e.size,i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}var es=ft();function ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((function(n){void 0!==La[n]&&"transform"!==n&&(e[n]=t[n])}))}es.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),es.add("diamond",(function(e){var t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:za([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),es.add("saltire",(function(e){var t=Ha(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n),o=e.size,a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;var s={x:e.x,y:e.y};return{type:"path",fill:"black",d:za(Fa(e.x,e.y,o,i).map((function(e){return Ja(e,t,s)})))}})),es.add("square",(function(e){var t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),es.add("triangle",(function(e){var t=e.size,n={x:e.x,y:e.y},r=Za[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i,s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}],l=Ha(r);return{type:"path",fill:"black",d:za(s=s.map((function(e){return Ja(e,l,n)})))}})),es.add("line",(function(e){var t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Qa(e)}})),es.add("star",(function(e){for(var t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i,l=1;l<=i;l++){var u=s*l+a,c=Ha(u),h=Ha(u+s/2),f=Math.sin(c),d=Math.cos(c),p=Math.sin(h),m=Math.cos(h);n.push({x:e.x+d*r,y:e.y+f*r}),n.push({x:e.x+m*o,y:e.y+p*o})}return{type:"path",fill:"black",d:za(n)}})),es.add("n-polygon",(function(e){for(var t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle,a=1;a<=r;a++){var s=Ha(i*a+o),l=Math.sin(s),u=Math.cos(s);t.push({x:e.x+u*n,y:e.y+l*n})}return{type:"path",fill:"black",d:za(t)}})),es.add("cross",(function(e){var t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:za(Fa(t,n,e.size,o))}})),es.add("bar",(function(e){var t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2,o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){var a=Ha(90);o=o.map((function(e){return Ja(e,a,t)}))}var s=re(o);return s.type="rect",s.fill="black",s})),es.add("rect",(function(e){var t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));var ns=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:es;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.get(t.type);if(n){var r=n(t);return ts(r,t),void 0!==t.data&&(r.data=t.data),r}return n}};function rs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,u=void 0===l?0:l,c=e.minimumLayoutMode,h=e.show,f=void 0===h||h;r=r||"center";var d={computePreferredSize:function(e){var n=e.inner,r=e.outer,i=e.children;return"function"==typeof u?u({inner:n,outer:r,children:i,dock:this.dock()},t):u},dock:function(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder:function(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder:function(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode:function(e){return void 0!==e?(c=e,this):"function"==typeof c?c(t):c},show:function(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}};return d}function is(e,t,n){var r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,u=n.data,c=n.renderer,h=n.chart,f=n.dockConfig,d=n.mediator,p=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,q=n.isVisible;e.emit=function(){},q&&(e.isVisible=q),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:u}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach((function(n){var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((function(e){return e===r}))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((function(t){"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:h}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})})),Object.keys(o).forEach((function(t){e.mediator.on(t,o[t].bind(e))}))}function os(e,t,n){var r=function(t){return e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0},i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function as(e,t,n){Object.keys(n.on||{}).forEach((function(r){e.eventListeners=e.eventListeners||[];var i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit.apply(t,[e].concat(r))}}function ss(e,t){e.eventListeners&&(e.eventListeners.forEach((function(e){var n=e.event,r=e.listener;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=function(){}}function ls(e,t,n){return Va(function(e,t){var n=Ga(e,t)/Ga(t,t)||1;return{x:t.x*n,y:t.y*n}}(Wa(n,e),Wa(t,e)),e)}function us(e,t,n){return Ka(e,n)+Ka(t,n)-Ka(e,t)<1e-12}function cs(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function hs(e){return e.x1===e.x2&&e.y1===e.y2}function fs(e){return e.width<=0||e.height<=0}function ds(e){return e.r<=0}function ps(e){return e.edges.length<=2}function ms(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===qs(e,ie(t.edges[n])))return!0;return!1}function gs(e,t){for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++){if(!0===Ts(e,r[i]))return!0}return!1}function ys(e,t){return!ds(e)&&Xa({x:e.cx,y:e.cy},t)<=Math.pow(e.r,2)}function vs(e,t){if(fs(t)||ds(e))return!1;var n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,u=Math.abs(s-i),c=Math.abs(l-o);return!(u>n+a||c>r+a)&&(u<=n||c<=r||Math.pow(u-n,2)+Math.pow(c-r,2)<=Math.pow(a,2))}function bs(e,t){if(ds(e)||hs(t))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(ys(e,r)||ys(e,i))return!0;var o={x:e.cx,y:e.cy},a=ls(r,i,o);return Xa(a,o)<=Math.pow(e.r,2)&&us(r,i,a)}function xs(e,t){if(ps(t)||ds(e))return!1;if(ws(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.edges.length,r=0;r<n;r++){if(bs(e,ie(t.edges[r])))return!0}return!1}function ws(e,t){if(ps(e)||!Ss(e.boundingRect(),t))return!1;var n,r,i,o,a,s=t.x,l=t.y,u=e.vertices;for(n=!1,o=-1,i=(r=u.length)-1;++o<r;i=o){if(u[o].x===s&&u[o].y===l)return!0;if(u[o].y===u[i].y&&u[o].y===l&&(s-u[o].x)*(s-u[i].x)<=0)return!0;if(u[o].y<l&&l<=u[i].y||u[i].y<l&&l<=u[o].y){if(s===(a=(u[i].x-u[o].x)*(l-u[o].y)/(u[i].y-u[o].y)+u[o].x))return!0;s<a&&(n=!n)}}return n}function qs(e,t){if(ps(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Cs(t,ie(e.edges[n])))return!0}var i=Y(te(t),2),o=i[0],a=i[1];return ws(e,o)||ws(e,a)}function Ms(e,t){if(ps(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(_s(t,ie(e.edges[n])))return!0}var i=Y(ne(t),4),o=i[0],a=i[1],s=i[2],l=i[3];return ws(e,o)||ws(e,a)||ws(e,s)||ws(e,l)}function Ds(e,t){return!fs(e)&&!fs(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function ks(e,t){return!fs(e)&&!fs(t)&&[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((function(t){return Ss(e,t)}))}function Ss(e,t){return!fs(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function _s(e,t){if(hs(t)||fs(e))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(Ss(e,r)||Ss(e,i))return!0;for(var o=ne(e),a=o.length,s=0;s<a;s++){if(Cs(ie([o[s],o[3!==s?s+1:0]]),t))return!0}return!1}function Cs(e,t){var n,r,i=Y(te(e),2),o=i[0],a=i[1],s=Y(te(t),2),l=s[0],u=s[1],c=$a(a,o),h=Ya(a,o),f=$a(u,l),d=Ya(u,l),p=$a(o,l),m=Ya(o,l),g=d*c-f*h,y=f*m-d*p,v=c*m-h*p;if(0===c&&0===h)return!1;if(0===f&&0===d)return!1;if(0===g){if(0===y&&0===v){if(0===c){if(0===h)return o.x===a.x&&o.y===a.y;n=Ya(l,o)/h,r=Ya(u,o)/h}else n=(l.x-o.x)/c,r=(u.x-o.x)/c;return!(n<0&&r<0||n>1&&r>1)}return!1}var b=y/g;return g=v/g,b>=0&&b<=1&&g>=0&&g<=1}function Es(e,t){if(hs(e))return!1;var n=Y(te(e),2);return us(n[0],n[1],t)}function As(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ds(n,r)&&(ks(n,r)?ms(e,t):ms(t,e))}function Ts(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ds(n,r)&&(ks(r,n)?function(e,t){for(var n=e.numPolygons,r=e.polygons,i=0;i<n;i++)if(!0===As(t,r[i]))return!0;return!1}(e,t):function(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===Ns(e,ie(t.edges[n])))return!0;return!1}(e,t))}function Is(e,t){if(ds(e))return!1;if(Rs(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++)for(var o=r[i],a=o.edges.length,s=0;s<a;s++){if(bs(e,ie(o.edges[s])))return!0}return!1}function Rs(e,t){if(!Ss(e.boundingRect(),t))return!1;var n,r,i,o,a,s,l=t.x,u=t.y,c=e.numPolygons,h=!1;for(r=0;r<c;r++)for(a=-1,o=(i=(n=e.vertices[r]).length)-1;++a<i;o=a){if(n[a].x===l&&n[a].y===u)return!0;if(n[a].y===n[o].y&&n[a].y===u&&(l-n[a].x)*(l-n[o].x)<=0)return!0;if(n[a].y<u&&u<=n[o].y||n[o].y<u&&u<=n[a].y){if(l===(s=(n[o].x-n[a].x)*(u-n[a].y)/(n[o].y-n[a].y)+n[a].x))return!0;l<s&&(h=!h)}}return h}function Ns(e,t){var n=Y(te(t),2),r=n[0],i=n[1];if(Rs(e,r)||Rs(e,i))return!0;for(var o=e.numPolygons,a=e.polygons,s=0;s<o;s++)for(var l=a[s],u=0,c=l.edges.length;u<c;u++){if(Cs(t,ie(l.edges[u])))return!0}return!1}function Os(e,t){var n=Y(ne(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(Rs(e,r)||Rs(e,i)||Rs(e,o)||Rs(e,a))return!0;for(var s=e.numPolygons,l=e.polygons,u=0;u<s;u++)for(var c=l[u],h=0,f=c.edges.length;h<f;h++){if(_s(t,ie(c.edges[h])))return!0}return!1}var Ps=/^\$/,Ls="@extend";function js(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function zs(e,t,n){if("string"==typeof e){var r=t[e];return-1!==n.indexOf(e)&&js(e),Ps.test(r)?(n.push(e),zs(r,t,n)):r}var i=e,o=C(!0,{},t,e),a={};if(e[Ls]){var s=e[Ls];-1!==n.indexOf(s)&&js(s);var l=n.slice();l.push(s),i=C(!0,{},zs(o[s],t,l),e)}return Object.keys(i).forEach((function(e){var t=n.slice();if(e!==Ls&&!Ps.test(e)){a[e]=i[e];var r=a[e];Ps.test(r)&&r in o?(-1!==n.indexOf(r)&&js(r),t.push(r),"object"===I(r=o[r])||Ps.test(r)&&r in o?a[e]=zs(r,o,t):a[e]=r):"object"===I(r)&&(a[e]=zs(r,o,t))}})),a}function Fs(e,t){return zs(e,t,[])}function Hs(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Bs(e,t){var n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Hs(r),Hs(n),{logicalContainerRect:r,containerRect:n}}function Vs(e){var t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return C(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Ws(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Us(e,t,n){if(void 0===e.cachedSize){var r,i=e.config.dock(),o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function $s(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Ys(e,t){var n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Xs(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);var r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);var i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Ks(e,t,n,r,i){var o=C({},t),a=C({},n);return $s(o,r),Ys(a,r),Xs(e,o,a),!!function(e,t,n){var r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i)&&($s(t,r),Ys(n,r),!0)}function Gs(e){var t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings,o=Ws(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((function(e,t){return e.config.prioOrder()-t.config.prioOrder()}));for(var l=0;l<s.length;++l){var u=s[l];Us(u,o,t),Ks(t,o,a,u,i)||(r.push(s.splice(l,1)[0]),--l)}!function(e,t){if(0!==t.length)for(var n=0;n<e.length;++n){var r=e[n];r.referencedDocks.length&&r.referencedDocks.every((function(e){return t.some((function(t){return t.key===e}))}))&&t.push(e.splice(n,1)[0])}}(n,r);var c=n.filter((function(e){return-1!==s.indexOf(e)}));return n.length=0,n.push.apply(n,X(c)),Xs(t,o,a),o}function Js(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Zs(e){var t;return re((t=[]).concat.apply(t,X(e.map(ne))))}function Qs(e){var t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation,a=Ws(r.x,r.y,r.width,r.height),s=Ws(r.x,r.y,r.width,r.height),l={},u=t.slice(),c=u.slice().sort((function(e,t){return e.config.displayOrder()-t.config.displayOrder()}));return t.sort((function(e,t){if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;var n=e.config.displayOrder()-t.config.displayOrder();return 0===n?u.indexOf(e)-u.indexOf(t):n})).forEach((function(e){var t={},u={};switch(e.config.dock()){case"top":t.height=u.height=e.cachedSize,t.width=n.width,u.width=a.width,t.x=n.x,u.x=a.x,t.y=u.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,u.x=a.x,t.y=u.y=a.y+a.height,t.width=n.width,u.width=a.width,t.height=u.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=u.x=s.x-e.cachedSize,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=u.x=s.x+s.width,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=u.x=r.x,t.y=u.y=r.y,t.width=u.width=r.width,t.height=u.height=r.height;break;default:if(e.referencedDocks.length>0){var c=e.referencedDocks.map((function(e){return l[e]})).filter((function(e){return!!e}));c.length>0&&(t=Zs(c.map((function(e){return e.outerRect}))),u=Zs(c.map((function(e){return e.r}))))}}e.key&&(l[e.key]={r:u,outerRect:t}),function(e,t,n,r){var i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){var a=i.x<i.y,s=Math.min(i.x,i.y);i.x=s,i.y=s;var l=a?"height":"width",u=(r[l]-n[l]*i.x)*n.align;o.left=a?0:u,o.top=a?u:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(u,t,n,i),u.edgeBleed=e.edgeBleed,u.computed=Js(u),t.edgeBleed=e.edgeBleed,t.computed=Js(t),u.x+=o.x,u.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(u,t),e.cachedSize=void 0,e.edgeBleed=void 0})),c}function el(e,t,n){var r=e.layoutModes||{},i=t.minimumLayoutMode(),o=t.show();return o&&"object"===I(i)?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function tl(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function nl(e,t,n){for(var r=[],i=[],o=0;o<e.length;++o){var a=e[o];tl(a);var s=a.dockConfig,l=a.key,u=s.dock(),c=/@/.test(u)?u.split(",").map((function(e){return e.replace(/^\s*@/,"")})):[];el(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:c}):i.push({comp:a,key:l,config:s,referencedDocks:c})}return[r,i]}var rl=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},il=function e(t){return null==t?void 0:t.map((function(t){var n=t.instance.dockConfig();return{preferredSize:function(r){return n.computePreferredSize(T(T({},r),{},{children:e(t.children)}))}}}))},ol=function(e,t){return{visible:[],hidden:t,ordered:[]}},al=function(e){return function(t,n){var r,i=n.map((function(e,t){var n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:function(t){return n.computePreferredSize(T(T({},t),{},{children:il(e.children)}))}}})),o=function(e){return n[e.index]},a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,u=a.hidden,c=void 0===u?[]:u,h=a.ordered,f=void 0===h?l:h;return{visible:l.map(o),hidden:c.map(o),ordered:f.map(o)}}},sl=function(e){var t=function(e){var t=Vs(e);return{layout:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};var r=Bs(e,t),i=r.logicalContainerRect,o=r.containerRect,a=Y(nl(n,t,i),2),s=a[0],l=a[1],u=Qs({visible:s,layoutRect:i,reducedRect:Gs({layoutRect:i,visible:s,hidden:l,settings:t}),containerRect:o,translation:{x:e.x,y:e.y}});return l.forEach((function(e){e.comp.visible=!1;var t=Ws();e.comp.resize(t,t)})),{visible:s.map((function(e){return e.comp})),hidden:l.map((function(e){return e.comp})),ordered:u.map((function(e){return e.comp}))}},settings:function(e){t=Vs(e)}}}(e);return al((function(e,n){return t.layout(e,n)}))},ll=function(e){return"function"==typeof e?al(e):sl(e)};function ul(e){var t=e.createComponent,n={},r=[],i=[],o=function e(n){var i=t(n);return i&&(r.push(i),n.components&&(i.children=n.components.map((function(t){return e(t)})).filter((function(e){return!!e})))),i},a=function e(t,n){for(var i=function(i){var o=t[i],a=n.find((function(e){return o.hasKey&&o.key===e.key}));a?o.children&&a.components&&e(o.children,a.components):(t.splice(i,1),function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}(o),o.children&&e(o.children,[]),o.instance.destroy())},o=t.length-1;o>=0;o--)i(o)},s=function e(t){var n=t.compList,r=t.data,i=t.excludeFromUpdate,a=t.formatters,s=t.scales;return t.settingsList.map((function(t){var l=rl(n,t.key);return i.indexOf(t.key)>-1?(delete l.updateWith,l):l?(t.rendererSettings&&"function"==typeof l.instance.renderer().settings&&l.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(l.applyTransform=!0,l):(l.updateWith={formatters:a,scales:s,data:r,settings:t},t.components&&(l.children=e({compList:l.children||[],data:r,excludeFromUpdate:i,formatters:a,scales:s,settingsList:t.components})),l)):o(t)})).filter((function(e){return!!e}))},l=function e(t){var n=t.components,r=t.hidden,i=t.layoutFn,o=t.ordered,a=t.rect,s=t.visible,l=i(a,n),u=l.visible,c=l.hidden,h=l.ordered;s.push.apply(s,X(u)),r.push.apply(r,X(c)),o.push.apply(o,X(h)),u.forEach((function(t){if(t.children){var n,i,a=ll(null!==(n=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==n?n:{});e({components:t.children,hidden:r,layoutFn:a,ordered:o,rect:t.instance.getRect(),visible:s})}})),c.forEach((function(t){t.children&&e({components:t.children,hidden:r,layoutFn:ol,ordered:o,rect:null,visible:s})}))};return n.destroy=function(){r.forEach((function(e){return e.instance.destroy()})),r=[],i=[]},n.findComponentByKey=function(e){return rl(r,e)},n.forEach=function(e){r.forEach(e)},n.layout=function(e){var t=e.layoutSettings,n=e.rect,r=[],o=[],a=[],s=ll(t);return l({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=function(e){var t=e.components;i=t.map((function(e){return o(e)})).filter((function(e){return!!e}))},n.update=function(e){var t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,l=e.scales;a(i,t),i=s({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:l,settingsList:t})},n}function cl(e,t,n){var r=t.left-n.left,i=t.top-n.top,o=oe(e),a=C(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(var s=0,l=a.vertices.length;s<l;s++){var u=a.vertices[s];u.x+=r,u.y+=i}break;case"geopolygon":for(var c=0;c<a.vertices.length;c++)for(var h=a.vertices[c],f=0,d=h.length;f<d;f++){var p=h[f];p.x+=r,p.y+=i}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function hl(e,t){var n=[],r=0;t.forEach((function(e){n.push(r),r++;var t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach((function(t,r){return function(e,t,n){var r=t.instance.renderer().element();if(!isNaN(n)&&r&&e&&e.children){var i=e.children[Math.max(0,n)];if(r!==i){var o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((function(t){e.insertBefore(t,r)}))):(o&&o.forEach((function(t){e.appendChild(t,r)})),e.appendChild(r))}}}(e,t,n[r])}))}function fl(e,t){var n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s,u=t.registries,c=t.logger,h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e,r=function(e){e.forEach((function(e){var n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((function(e){return e?e.length:0}))}}))},i=function(e,n){var r=t[e];if(!r)return[];for(var i=r.sizes,o=0;o<i.length;o++)if(n<=i[o])return r.colors[o];return r.colors[i.length-1]},o={palette:function(e,t){return i(e,t)},setPalettes:r,style:function(e){return Fs(e,n)},setStyle:function(t){n=C({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),o}(t.style,t.palettes),f=[],d=C({},e),p=function(){var e={};return $o(e),e}(),m=[],g=null,y=null,v=null,b=[],x=function(){},w=function(){},q={},M=!1,D=ul({createComponent:function(e){return u.component.has(e.type)?{instance:function(e){var t,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e.defaultSettings,l=void 0===s?{}:s,u=e._DO_NOT_USE_getInfo,c=void 0===u?function(){return{}}:u,h=a.chart,f=a.container,d=a.mediator,p=a.registries,m=a.theme,g=a.renderer,y=$o({}),v=a.settings||{},b=C(!0,{},l,v),x=[],w=Ca({chart:h}),q=!1,M={nodes:[],chart:h,config:b.brush||{},renderer:null},D={tap:[],over:[]},k=[],S={},_=C({},v);function E(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i,o,a,s=void 0!==e[t],l=void 0!==v[t],u=arguments.length,c=new Array(u),h=0;h<u;h++)c[h]=arguments[h];return s&&("function"==typeof e[t]?i=(o=e[t]).call.apply(o,[S].concat(c)):r&&(i=e[t])),l&&("function"==typeof v[t]?i=(a=v[t]).call.apply(a,[_].concat(c)):r&&(i=v[t])),s||l||(i=n.call.apply(n,[S].concat(c))),i}}var A=E("preferredSize",(function(){return 0}),!0),R=E("resize",(function(e){return e.inner})),N=E("created"),O=E("beforeMount"),P=E("mounted"),L=E("beforeUnmount"),j=E("beforeUpdate"),z=E("updated"),F=E("beforeRender"),H=E("beforeDestroy"),B=E("destroyed"),V=e.render,W=function(){b.brush&&(b.brush.consume||[]).forEach((function(e){e.context&&e.style&&k.push(Aa(M,e))}))},U=function(){b.brush&&(b.brush.trigger||[]).forEach((function(e){"over"===e.on?D.over.push(e):D.tap.push(e)}))};Object.defineProperty(M,"data",{get:function(){return x}});var $=b.renderer||e.renderer,Y=$?g||p.renderer($)():g||p.renderer()();"function"==typeof Y.settings&&Y.settings(b.rendererSettings),M.renderer=Y;var K={resources:h.logger?{logger:h.logger()}:{}},G=rs(os(b,A,h.logger()),K),J=function(e){e.key=b.key,e.element=Y.element()},Z=function(){};Z.dockConfig=function(){return G},Z.set=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=C(!0,{},l,e.settings),G=rs(os(b,A,h.logger()),K),M.config=b.brush||{}),b.scale&&(t=h.scale(b.scale)),b.data){var r=b.rendererSettings,i="function"==typeof(null==r?void 0:r.progressive)&&r.progressive(),a=Tr(b.data,{dataset:h.dataset,collection:h.dataCollection},{logger:h.logger()},h.dataCollection);if(i){if(i.isFirst)(x=a).items&&(x.items=X(a.items));else if(x.items){var s;(s=x.items).push.apply(s,X(a.items||[]))}}else x=a}else x=t?t.data():[];"string"==typeof b.formatter||"object"===I(b.formatter)?n=h.formatter(b.formatter):t&&t.data().fields&&(n=t.data().fields[0].formatter()),o=m.style(b.style||{})},Z.resize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=R({inner:e,outer:t});i=n?Y.size(n):Y.size(e),_.rect=C(!0,{computedPhysical:i.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),i=C(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},i)},Z.getRect=function(){return _.rect};var Q,ee,te,ne=function(){var e=Y.renderArgs?Y.renderArgs.slice(0):[],t=b.rendererSettings,n=x,r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=T(T({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};function re(e){var t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();if(n){if(n.isFirst)M.nodes=X(e||[]);else if(M.nodes){var r;(r=M.nodes).push.apply(r,X(e||[]))}}else M.nodes=e}Z.beforeMount=O,Z.beforeRender=function(){F({size:i})},Z.render=function(){var e=V.call.apply(V,[S].concat(X(ne())));re(e),Y.render(e),Q=e,ee=_.rect.computed},Z.hide=function(){Z.unmount(),Y.size({x:0,y:0,width:0,height:0}),Y.clear()},Z.beforeUpdate=function(){j({settings:b,data:x})},Z.update=function(){te&&te.stop();var e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return Y.render(),void(Q=null);var i=V.call.apply(V,[S].concat(X(ne())));re(i),k.forEach((function(e){return e.cleanUp()})),k.length=0,D.tap=[],D.over=[],n&&(W(),U()),k.forEach((function(e){e.isActive()&&e.update()})),Q&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:Q,currentRect:_.rect.computed,previousRect:ee}),(te=wa({old:Q,current:i},{renderer:Y},r)).start()):Y.render(i),Q=i,ee=_.rect.computed,Y.setKey&&"string"==typeof v.key&&Y.setKey(v.key)},Z.updated=z,Z.destroy=function(){Z.unmount(),H(r),Y.destroy(),B(),r=null};var ie=function(e){M.nodes=e,k.forEach((function(e){e.isActive()&&e.update()})),Y.render(e)};return is(S,e,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return h},dockConfig:function(){return G},mediator:function(){return d},instance:function(){return _},rect:function(){return _.rect},style:function(){return o},update:function(){return ie},registries:function(){return p},resolver:function(){return w},symbol:function(){return ns(p.symbol)}}),is(_,v,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return h},dockConfig:function(){return G},mediator:function(){return d},style:function(){return o},_DO_NOT_USE_getInfo:c.bind(S),isVisible:function(){return q}}),Z.getBrushedShapes=function(e,t,n){var r=[];if(b.brush&&b.brush.consume){var i=h.brush(e),o=Y.findShapes("*");b.brush.consume.filter((function(t){return t.context===e})).forEach((function(e){for(var a=0;a<o.length;a++){var s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(J(s),r.push(s),o.splice(a,1),a--)}}))}return r},Z.findShapes=function(e){for(var t,n=(null!==(t=te)&&void 0!==t&&t.inProgress()?te.targetScene:Y).findShapes(e),r=0,i=n.length;r<i;r++)J(n[r]);return n},Z.shapesAt=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Y.itemsAt(e);t=n&&"stop"===n.propagation&&r.length>0?[r.pop().node]:r.map((function(e){return e.node}));for(var i=0,o=t.length;i<o;i++)J(t[i]);return t},Z.brushFromShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[],Ta({nodes:e,action:t.action||"toggle",trigger:t,chart:h,data:M.data})},Z.mount=function(){r=Y.element&&Y.element()?r:Y.appendTo(f),Y.setKey&&"string"==typeof v.key&&Y.setKey(v.key),b.brush&&(W(),U()),as(_,y,v),as(S,y,e),q=!0},Z.mounted=function(){return P(r)},Z.unmount=function(){[_,S].forEach((function(e){ss(e,y)})),D.tap=[],D.over=[],k.forEach((function(e){e.cleanUp()})),k.length=0,L(),q=!1},Z.onBrushTap=function(e){D.tap.forEach((function(t){Oa({e:e,t:t,config:M})&&"stop"===t.globalPropagation&&h.toggleBrushing(!0)}))},Z.onBrushOver=function(e){D.over.forEach((function(t){Pa({e:e,t:t,config:M})&&"stop"===t.globalPropagation&&h.toggleBrushing(!0)}))},Z.def=S,Z.ctx=_,Z.renderer=function(){return Y},Z.set({settings:v}),N(),Z}(u.component(e.type),{settings:e,chart:d,mediator:p,registries:u,theme:h,container:n}),settings:C(!0,{},e),key:e.key,hasKey:void 0!==e.key}:(c.warn("Unknown component: ".concat(e.type)),!1)}});function k(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return function(){for(var r,i,o="function"==typeof e[t],a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];o?r=(i=e[t]).call.apply(i,[d].concat(s)):r=n.call.apply(n,[d].concat(s));return r}}var S=function(){var e;a.dockLayout?(c.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;var t=function(e){if("function"==typeof e.getBoundingClientRect){var t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return D.layout({layoutSettings:e,rect:t})},_=k("created"),E=k("beforeMount"),A=k("mounted"),R=k("beforeUpdate"),N=k("updated"),O=k("beforeRender"),P=k("beforeDestroy"),L=k("destroyed"),j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.partialData,i=t.formatters,o=void 0===i?{}:i,a=t.scales,s=void 0===a?{}:a,l=t.scroll,f=void 0===l?{}:l;x=se(e,{logger:c,types:u.data}),r||Object.keys(q).forEach((function(e){return q[e].clear()})),t.palettes&&h.setPalettes(t.palettes),t.style&&h.setStyle(t.style),w=Ir(t.collections,{dataset:x},{logger:c});var d={theme:h,logger:c};g=Bo(s,{dataset:x,collection:w},T(T({},d),{},{scale:u.scale})),y=Nr(o,{dataset:x,collection:w},T(T({},d),{},{formatter:u.formatter})),v=Ko(f,v)};function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={},r=e.filter((function(e){return!!e.key})).map((function(e){return e.key}));b.forEach((function(e){e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),b=e.map((function(e){var r=e.key&&t[e.key]?t[e.key]:u.interaction(e.type)(d,p,n);return r.set(e),r}))}var F=function(e){var t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach((function(e){var t=e.instance.getRect();Ss(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},H=function(){if(!f.length&&n){Object.keys(l).forEach((function(e){var t=l[e].bind(d);n.addEventListener(e,t),f.push({key:e,listener:t})}));var e={},t=function(t){t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=F(e)},r=function(t){var n=e.comps||F(t);if(!n.every((function(e){return e.instance.def.disableTriggers}))&&("touchend"===t.type&&t.preventDefault(),function(e,t){var n=J(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(var r=n.length-1;r>=0;r--){if(n[r].instance.onBrushTap(t),M){M=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:function(e){for(var t=F(e),n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),M){M=!1;break}}}}),i.forEach((function(e){n.addEventListener(e.key,e.listener),f.push(e)}))}},B=function(){f.forEach((function(e){var t=e.key,r=e.listener;return n.removeEventListener(t,r)})),f.length=0};return d.layoutComponents=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,z(e.settings.interactions)),R(),j(i,a);var r=a,o=r.formatters,s=r.scales,l=r.components,u=void 0===l?[]:l;D.update({components:u,data:i,excludeFromUpdate:n,formatters:o,scales:s}),D.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),D.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()})),S()},d.update=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.partialData,o=t.excludeFromUpdate,s=void 0===o?[]:o;t.data&&(i=t.data),t.settings&&(a=t.settings,z(t.settings.interactions)),R(),j(i,a,{partialData:r});var l=a,u=l.formatters,c=l.scales,h=l.components,f=void 0===h?[]:h;D.update({components:f,data:i,excludeFromUpdate:s,formatters:u,scales:c}),D.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),D.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()}));var d,p=[],g=[];if(r)D.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible&&p.push(e)})),d=p;else{var y=S(),v=y.visible,b=y.hidden,x=y.ordered;m=v,d=v,e=x,v.forEach((function(e){e.updateWith&&e.visible?p.push(e):g.push(e)})),b.forEach((function(e){e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}g.forEach((function(e){return e.instance.beforeMount()})),g.forEach((function(e){return e.instance.mount()})),d.forEach((function(e){return e.instance.beforeRender()})),d.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),r||hl(n,e),g.forEach((function(e){return e.instance.mounted()})),p.forEach((function(e){return e.instance.updated()})),m.forEach((function(e){delete e.updateWith,e.visible=!0,e.applyTransform=!1})),N()},d.destroy=function(){P(),D.destroy(),B(),z(),delete d.update,delete d.destroy,L()},d.getAffectedShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter((function(e){return null==r||e.key===r})).forEach((function(r){i.push.apply(i,X(r.instance.getBrushedShapes(e,t,n)))})),i},d.findShapes=function(e){var t=[];return m.forEach((function(n){t.push.apply(t,X(n.instance.findShapes(e)))})),t},d.componentsFromPoint=function(e){return F(e).map((function(e){return e.instance.ctx}))},d.shapesAt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=n.getBoundingClientRect(),o=m;if(Array.isArray(t.components)&&t.components.length>0){var a=t.components.map((function(e){return e.key}));o=m.filter((function(e){return-1!==a.indexOf(e.key)})).map((function(e){return{instance:e.instance,opts:t.components[a.indexOf(e.key)]}}))}for(var s=o.length-1;s>=0;s--){var l=o[s],u=l.instance.renderer().element().getBoundingClientRect(),c=cl(e,i,u),h=l.instance.shapesAt(c,l.opts),f=h.length>0&&"stop"===t.propagation;if(r.push.apply(r,X(h)),r.length>0&&f)return r}return r},d.brushFromShapes=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]},n=function(n){var r=t.components[n].key;m.filter((function(e){return r===e.key})).forEach((function(r){var i=e.filter((function(e){return e.key===r.key}));r.instance.brushFromShapes(i,t.components[n])}))},r=0;r<t.components.length;r++)n(r)},d.scroll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Go(e,v)},d.dataset=function(e){return x(e)},d.dataCollection=function(e){return w(e)},d.scales=function(){return g.all()},d.formatters=function(){return y.all()},d.brush=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return q[e]||(q[e]=ma()),q[e]},d.scale=function(e){return g.get(e)},d.formatter=function(e){return y.get(e)},d.toggleBrushing=function(e){M=void 0!==e?e:!M},d.component=function(e){var t=D.findComponentByKey(e);return null==t?void 0:t.instance.ctx},d.logger=function(){return c},d.theme=function(){return h},Object.defineProperty(d,"interactions",{get:function(){return{instances:b,on:function(){H(),b.forEach((function(e){return e.on()}))},off:function(){B(),b.forEach((function(e){return e.off()}))}}}}),_(),n&&(E(),n.innerHTML="",function(){var e=a.components,t=void 0===e?[]:e;O(),j(i,a),D.set({components:t});var r=S(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach((function(e){e.instance.hide(),e.visible=!1})),o.forEach((function(e){return e.instance.beforeMount()})),o.forEach((function(e){return e.instance.mount()})),o.forEach((function(e){return e.instance.beforeRender()})),o.forEach((function(e){return e.instance.render()})),o.forEach((function(e){return e.instance.mounted()})),o.forEach((function(e){e.visible=!0})),hl(n,l)}(),H(),z(a.interactions),A(n),d.element=n),d}var dl=function(e){var t=ft(e);return t.prio=function(e){return e?t.default(e[0]):[t.default()]},t.types=function(){return t.getKeys()},t},pl=ft();function ml(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];for(var r=0;r<n.fields.length;r++)if(n.fields[r].key()===e)return n.fields[r];for(var i=0;i<n.fields.length;i++)if(n.fields[i].title()===e)return n.fields[i];return null}var gl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))},yl=function(e){return e.reduce((function(e,t){return e+t}),0)},vl={first:function(e){return e[0]},last:function(e){return e[e.length-1]},min:function(e){var t=gl(e);return t.length?Math.min.apply(null,t):NaN},max:function(e){var t=gl(e);return t.length?Math.max.apply(null,t):NaN},sum:function(e){var t=gl(e);return t.length?t.reduce((function(e,t){return e+t}),0):NaN},avg:function(e){var t=gl(e),n=t.length;return n?yl(t)/n:NaN}};function bl(e,t,n,r){var i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((function(a){var s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(I(s))?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"===I(s)&&(s.fields?l.fields=s.fields.map((function(n){return bl(e,t,{main:n},r).main})):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=vl[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?vl[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=vl[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?vl[l.field.reduceLabel]:l.field.reduceLabel))})),i}function xl(e,t){var n=bl(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:bl(e,t,e.props||{},n),main:n}}function wl(e,t,n,r){for(var i,o=Array(e.length),a=Array(e.length),s=0;s<e.length;s++)i=r?e[s][r]:e[s],o[s]=i.value,a[s]=i.label;var l=t.reduce,u=t.reduceLabel,c=l?l(o):o,h={value:c,label:u?u(a,c):n?n(c):String(c)};return r&&e[0][r].source?(h.source=e[0][r].source,h):!r&&e[0].source?(h.source=e[0].source,h):h}function ql(e,t){var n=t.main,r=t.propsArr,i=t.props,o=[],a=n.field.formatter(),s={};return r.forEach((function(e){s[e]=i[e].field?i[e].field.formatter():function(e){return e}})),o.push.apply(o,X(e.map((function(e){var t=wl(e.items,n,a);return r.forEach((function(n){t[n]=wl(e.items,i[n],s[n],n)})),t})))),o}function Ml(e){var t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker,a="function"===e.trackType?t.trackBy(n):n[t.trackBy],s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function Dl(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function kl(e,t){var n=Array.isArray(e)?e:[e],r=[];return n.forEach((function(e){void 0!==e.field&&function(){var n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));for(var o=xl(e,t),a=o.props,s=o.main,l=Object.keys(a),u=!!e.trackBy,c=I(e.trackBy),h={},f=[],d=n.items(),p=[],m=function(t){var n=d[t];if(s.filter&&!s.filter(n))return"continue";var r=Dl(s,n,{key:i});l.forEach((function(e){var o=a[e],s=o.field?o.field.items()[t]:n;r[e]=Dl(o,s,{key:i})})),u&&Ml({cfg:e,itemData:n,obj:r,target:f,tracker:h,trackType:c}),p.push(r)},g=0;g<d.length;g++)m(g);u?r.push.apply(r,X(ql(f,{main:s,propsArr:l,props:a}))):r.push.apply(r,p)}()})),r}var Sl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))};var _l=function(e){var t=e.key,n=e.data,r=e.cache,i=e.config;if(n){var o=n;"string"==typeof o&&(o=function(e){var t=e.data,n=e.config,r=t.split("\n"),i=r[0],o=r[1],a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i)for(var s=[/,/,/\t/,/;/],l=0;l<s.length;l++){var u=s[l];if(i&&o){if(u.test(i)&&u.test(o)&&i.split(u).length===o.split(u).length){a=u;break}}else u.test(i)&&(a=u)}return r.map((function(e){return e.split(a)}))}({data:n,config:i})),Array.isArray(o)&&function(e){var t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r,s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((function(e,t){return t})):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);var l,u=!!s&&"function"==typeof s.row&&s.row,c=t;c=s&&"function"==typeof s.fields?s.fields(c.slice()):t.map((function(e){return{key:e,title:e}})),Array.isArray(r[0])?l=c.map((function(){return[]})):(l={},c.forEach((function(e){l[e.key]=[]})));for(var h=0;h<a.length;h++){var f=u?u(a[h],h,c):a[h];if(f)if(Array.isArray(f))for(var d=0;d<c.length;d++)l[d].push(f[d]);else for(var p=0;p<c.length;p++)l[c[p].key].push(f[c[p].key])}for(var m=Array.isArray(l)?function(e){return l[e]}:function(e){return l[c[e].key]},g=0;g<c.length;g++){var y=m(g),v=Sl(y),b=v.length>0,x=b?"measure":"dimension",w=b?Math.min.apply(Math,X(v)):NaN,q=b?Math.max.apply(Math,X(v)):NaN;i.fields.push(_r(C({source:n,key:g,title:c[g].title,values:y,min:w,max:q,type:x},c[g]),{value:c[g].value,label:c[g].label}))}}({data:o,cache:r,source:t,config:i})}};function Cl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i={fields:[]},o={key:function(){return t},raw:function(){return n},field:function(e){return ml(e,{cache:i,matrix:n})},fields:function(){return i.fields.slice()},extract:function(e){return kl(e,o)},hierarchy:function(){return null}};return _l({key:t,data:n,config:r,cache:i}),o}Cl.util={normalizeConfig:xl,collect:ql,track:Ml};var El=ft();El.default("matrix"),El("matrix",Cl),El("default",Cl);var Al=ft();function Tl(e,t,n){return Math.max(e,Math.min(t,n))}function Il(e){var t,n=e.item,r=e.value,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u=o,c=a,h=r<.5?90:-90;return e.flipXY&&(s="y",l="x",u=a,c=o,h=r<.5?180:0),(0,e.symbol)(C({},n.oob,(P(t={},s,i*u),P(t,l,Math.max(n.oob.size/2,Math.min(r*c,c-n.oob.size/2))),P(t,"startAngle",h),t)))}function Rl(e){var t,n=e.item,r=e.boxWidth,i=e.boxPadding,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u="width",c="height",h=o,f=a;e.flipXY&&(s="y",l="x",u="height",c="width",h=a,f=o);var d=function(e){var t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o,s=Math.max(t,n),l=Math.min(t,n),u=Tl(-.1,1.2,s),c=Tl(-.1,1.2,l),h=u*a-c*a,f=Math.max(i,h),d=(f-h)/2;return{actualDiff:f,startModifier:d,actualLow:c*a-d}}({start:n.start,end:n.end,minPx:n.box.minHeightPx,maxPx:f}),p=d.actualDiff,m=d.actualLow;return C({},n.box,(P(t={type:"rect"},s,(i+n.major)*h),P(t,l,m),P(t,c,p),P(t,u,r*h),P(t,"data",n.data||{}),P(t,"collider",{type:null}),t))}function Nl(e){var t,n=e.item,r=e.from,i=e.to,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",u="y1",c="x2",h="y2",f=a,d=s;return e.flipXY&&(l="y1",u="x1",c="y2",h="x2",f=s,d=a),C({},n.line,(P(t={type:"line"},h,Math.floor(r*d)),P(t,l,o*f),P(t,u,Math.floor(i*d)),P(t,c,o*f),P(t,"data",n.data||{}),P(t,"collider",{type:null}),t))}function Ol(e){var t,n=e.item,r=e.key,i=e.position,o=e.width,a=e.boxCenter,s=e.rendWidth,l=e.rendHeight,u="x1",c="y1",h="x2",f="y2",d=s,p=l;e.flipXY&&(u="y1",c="x1",h="y2",f="x2",d=l,p=s);var m=o/2;return C({type:"line"},n[r],(P(t={},c,Math.floor(i*p)),P(t,u,(a-m)*d),P(t,f,Math.floor(i*p)),P(t,h,(a+m)*d),P(t,"r",m*d),P(t,"cx",a*d),P(t,"cy",i*p),P(t,"width",o*d),P(t,"data",n.data||{}),P(t,"collider",{type:null}),t))}function Pl(e,t,n){var r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1,l=Math.min(s*e*i,isNaN(o)?n:o/n);return(l=isNaN(a)?l:Math.max(a/n,l))*s}Al("native",(function(e,t,n){var r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((function(e){var t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function u(){a.forEach((function(e){var t=e.key,r=e.listener;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set:function(e){!function(e){i=e.key,(r=e).events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),u(),s&&l()},off:function(){s=!1,u()},on:function(){s=!0,0===a.length&&l()},destroy:function(){u(),o=null,r=null}}}));var Ll={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},jl=Object.keys(Ll),zl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created:function(){this.state={}},render:function(e){var t=this,n=e.data,r=this.rect,i=r.width,o=r.height,a="horizontal"===this.settings.settings.orientation,s=this.style,l=this.resolver,u=this.symbol,c=jl.filter((function(e){return!t.settings.settings[e]||!1!==t.settings.settings[e].show})),h={};c.forEach((function(e){return h[e]=Ll[e]}));var f=function(e){var t,n=e.keys,r=e.data,i=e.defaultSettings,o=e.style,a=e.settings,s=e.width,l=e.height,u=e.resolver,c=C(!0,{},i||{},o||{}),h={major:"horizontal"===a.orientation?l:s,minor:"horizontal"===a.orientation?s:l},f=a.major;t="object"===I(f)&&"object"===I(f.ref)&&void 0!==f.ref.start&&void 0!==f.ref.end?u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:C(!0,{},{binStart:{scale:a.major.scale,ref:a.major.ref.start},binEnd:{scale:a.major.scale,ref:a.major.ref.end}})}):"object"===I(f)&&void 0!==f.binStart&&void 0!==f.binEnd?u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:C(!0,{},{binStart:{scale:a.major.scale,ref:"binStart"},binEnd:{scale:a.major.scale,ref:"binEnd"}},a.major)}):u.resolve({data:r,scaled:h,defaults:{major:.5},settings:{major:a.major}});var d=a.minor||{},p={};["start","end","min","max","med"].forEach((function(e){(d[e]||r.items&&r.items.length&&r.items[0][e])&&(p[e]={scale:d.scale,ref:e})}));for(var m,g={major:t,minor:u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:C(!0,{},p,d)})},y=0,v=n.length;y<v;y++)a[m]&&!1===a[m].show||(g[m=n[y]]=u.resolve({data:r,defaults:c[m],settings:a[m],scaled:h}));return g}({keys:c,data:n,defaultSettings:h,style:s,settings:this.settings.settings,width:i,height:o,resolver:l}),d=f.settings;return function(e){var t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol,s=[],l=i.major.items;if(!l.length)return s;var u,c,h,f,d,p,m,g,y,v=t,b=n,x=r?n:t,w=i.major.settings,q=["start","end","min","max","med"].filter((function(e){return void 0!==i.minor.settings[e]})),M=q.length,D=o.filter((function(e){return"oob"!==e})),k=o?o.length:0,S=D?D.length:0,_={box:function(){h.box&&Z(h.start)&&Z(h.end)&&u.push(Rl({item:h,boxWidth:f,boxPadding:d,rendWidth:v,rendHeight:b,flipXY:r}))},line:function(){Z(h.min)&&Z(h.start)&&u.push(Nl({item:h,from:h.min,to:h.start,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r})),Z(h.max)&&Z(h.end)&&u.push(Nl({item:h,from:h.max,to:h.end,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))},median:function(){h.median&&Z(h.med)&&u.push(Ol({item:h,key:"median",position:h.med,width:f,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))},whisker:function(){if(h.whisker){var e=f*h.whisker.width;Z(h.min)&&u.push(Ol({item:h,key:"whisker",position:h.min,width:e,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r})),Z(h.max)&&u.push(Ol({item:h,key:"whisker",position:h.max,width:e,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))}}};function E(){for(var e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=0;r<M;r++)Z(e=h[q[r]])&&(t<e&&(t=e),n>e&&(n=e));m=t<0&&t!==-Number.MAX_VALUE,g=n>1&&n!==Number.MAX_VALUE,y=m||g}for(var A=0,T=l.length;A<T;A++){u=[],c=null;var I=l[A],R=I.data,N=null,O=null;void 0!==w.binStart?(N=I.binStart,O=I.binEnd,c=w.binStart.scale):N=(c=w.major.scale)?I.major:0;var P=0;c?c.bandwidth?N-=(P=c.bandwidth())/2:P=O-N:P=1,h=C({},{major:N,majorEnd:O},i.minor.items[A]);for(var L=0;L<k;L++)h[o[L]]=i[o[L]].items[A];if(f=Pl(P,h,x),p=(d=(P-f)/2)+h.major+f/2,E(),y)h.oob&&(m?u.push(Il({item:h,value:0,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r,symbol:a})):g&&u.push(Il({item:h,value:1,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r,symbol:a})));else for(var j=0;j<S;j++)h[D[j]]&&!1===h[D[j]].show||_[D[j]]();var z={type:"container",data:R,collider:{type:"bounds"},children:u};s.push(z)}return s}({items:f.items,settings:d,width:i,height:o,flipXY:a,resolved:f,keys:c,symbol:u})}};var Fl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Hl=/px$/,Bl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Vl={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Wl(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Ul(e,t,n,r){var i=t.width,o=t.height;return e.filter((function(e){return!1!==e.show&&!isNaN(e.x+e.y)})).map((function(e){var t=e,a=Hl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);Q(a)&&(t=Fl,a=n.min+t.size*(n.max-n.min));var s=Y(function(e){var t=Bl.shape,n={};return"object"===I(e.shape)&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),2),l=s[0],u=T(T({},s[1]),{},{type:l,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(u.width=t.width);var c=r(u);return c.data=e.data,c}))}var $l={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:function(e){return e.data.value}},style:{item:"$shape"}},render:function(e){var t=e.data,n=this.resolver.resolve({data:t,defaults:C({},Bl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=C({},Vl,this.settings.settings.sizeLimits),s=n.items,l=function(e,t,n,r,i){var o=Wl(e?e.scale:void 0,n),a=Wl(t?t.scale:void 0,r),s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Ul(s,this.rect,l,this.settings.shapeFn||this.symbol)}};Math.PI;var Yl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Xl(e,t,n,r){var i=t.x,o=t.y,a=t.width,s=t.height,l=Oe(),u={x:i+a/2,y:o+s/2},c=Math.min(a,s)/2,h=Math.min(a,s)/2,f=h/100;return e.map((function(e,t){var i=n[t];i.type="path";var o=h*i.outerRadius,a=c*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;var d=l.centroid(e),p=i.offset?function(e,t,n,r){var i=Y(e,2),o=i[0],a=i[1],s=Math.sqrt(o*o+a*a),l=n-r;return{x:(o/=s)*t*l,y:(a/=s)*t*l}}(d,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(u.x,", ").concat(u.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:u.x+p.x,y:u.y+p.y}}},i}))}function Kl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}var Gl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render:function(e){for(var t=e.data,n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:C({},Yl,this.style.slice),settings:i.slice}).items,a=0,s=0,l=o.length;s<l;s++){var u=Kl(i,o[s]);u>0&&o[s].outerRadius>=o[s].innerRadius&&(n.push(u),r.push(o[s]),a+=u)}var c=function(){var e=Be,t=He,n=null,r=pe(0),i=pe(ke),o=pe(0);function a(a){var s,l,u,c,h,f=a.length,d=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(ke,Math.max(-ke,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(h=m[p[s]=s]=+e(a[s],s,a))>0&&(d+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,u=d?(y-f*b)/d:0;s<f;++s,g=c)l=p[s],c=g+((h=m[l])>0?h*u:0)+b,m[l]={data:a[l],index:s,value:h,startAngle:g,endAngle:c,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:pe(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:pe(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:pe(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:pe(+e),a):o},a}().sortValues(null);return c.startAngle(i.startAngle),c.endAngle(i.endAngle),c.padAngle(i.padAngle),Xl(c(n),C({},this.rect,{x:0,y:0}),r,a)}};var Jl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){var n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((function(e){var n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:function(e){return e.x1===e.x2||e.y1===e.y2},conditionAppend:function(e){return e.strokeWidth%2!=0}},e.rect={append:["x","y"],round:["width","height"],condition:function(){return!0},conditionAppend:function(e){return e.strokeWidth%2!=0}}),Object.keys(e).forEach((function(t){var n=e[t];n.items=[],n.append.forEach((function(e){n.items.push({key:e,type:"append"})})),n.round.forEach((function(e){n.items.push({key:e,type:"round"})}))})),t.multiple=function(e){return e.forEach((function(e){return t(e)}))},t}(),Zl=function(){function e(){R(this,e),this.reset(),this.push.apply(this,arguments)}return O(e,[{key:"transposeCoordinate",value:function(e,t,n){if("number"==typeof t&&isFinite(t)){var r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}},{key:"push",value:function(){var e;return(e=this.storage).push.apply(e,arguments),this}},{key:"processItem",value:function(t){var n={},r=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){var o=r?this.height:this.width,a=r?this.width:this.height;t=t.fn({width:o,height:a,flipXY:r});for(var s=Object.keys(t),l=0,u=s.length;l<u;l++){var c=s[l];n[e.evaluateKey(c,r)]=t[c]}}else for(var h=Object.keys(t),f=0,d=h.length;f<d;f++){var p=h[f],m=e.evaluateKey(p,r),g=this.transposeCoordinate(m,t[p],r);n[m]=g}return i&&Jl(n),n}},{key:"output",value:function(){for(var e=[],t=0,n=this.storage.length;t<n;t++){var r=this.processItem(this.storage[t]);e.push(r)}return e}},{key:"reset",value:function(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}],[{key:"evaluateKey",value:function(e,t){if(t){var n=e.substring(0,1),r=e.substring(1);if("x"===n)return"y".concat(r);if("y"===n)return"x".concat(r);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}}]),e}();function Ql(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Zl,t)}function eu(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}var tu={created:function(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this;if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,ka(this,"x",this.rect.width),ka(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=C({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=C({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=eu(this.x,this.rect.width),this.lines.y=eu(this.y,this.rect.height),this.lines.y=this.lines.y.map((function(e){return C(e,{flipXY:!0})}));var t=function(t){var n=t.dir,r=t.isMinor,i=e.lines[n].filter((function(e){return!!e.isMinor===r})),o=r?e.settings.minorTicks:e.settings.ticks;e.resolver.resolve({settings:o,data:{items:i,dir:n}}).items.forEach((function(t){var r,i,o=t.data;t.show&&e.blueprint.push({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:o.flipXY||!1,value:null!==(r=o.value)&&void 0!==r?r:null===(i=o.data)||void 0===i?void 0:i.value,dir:n})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function nu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(o?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function ru(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return t+=o?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function iu(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;case"top":case"left":default:return 0}return 0}function ou(e){var t={value:e.value};return e.label&&(t.label=e.label.text),t}function au(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function su(e,t){var n=e.min();if(n===e.max()){var r=function(e){var t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}var lu={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:function(){return 30},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this,t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];var n={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return C(t,{scale:n,position:r})}return C(t,{position:t.value})})),this.lines.y=this.lines.y.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return C(t,{scale:n,position:r,flipXY:!0})}return C(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((function(e){return!(e.position<0||e.position>1)||(n["x".concat(e.position>1?1:0)].push(ou(e)),!1)})),this.lines.y=this.lines.y.filter((function(e){return!(e.position<0||e.position>1)||(n["y".concat(e.position>1?1:0)].push(ou(e)),!1)}));var r=[];return[].concat(X(this.lines.x),X(this.lines.y)).forEach((function(n){(!0===n.show||void 0===n.show)&&function(e){var t,n=e.chart,r=e.blueprint,i=e.renderer,o=e.p,a=e.settings,s=e.items,l=!0,u=!1,c=!1,h=!1,f=C(!0,{},a.style.line,o.line||{});if(t=r.processItem({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:o.flipXY||!1,value:o.valueInfo?o.valueInfo.id:o.value}),o.label){var d,p=C(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:f.stroke},o.label),m={width:0,height:0},g="";if("string"==typeof o.formatter)d=n.formatter(o.formatter);else if("object"===I(o.formatter))d=n.formatter(o.formatter);else if(void 0!==o.scale&&o.scale.data){var y=o.scale.data()&&o.scale.data().fields;d=y&&y[0]?y[0].formatter():null}!1!==o.label.showValue&&(d?g=" (".concat(d(o.value),")"):o.scale&&(g=" (".concat(o.value,")"))),g&&(m=i.measureText({text:g,fontFamily:p.fontFamily,fontSize:p.fontSize}));var v=i.measureText({text:p.text||"",fontFamily:p.fontFamily,fontSize:p.fontSize}),b={width:v.width+m.width,height:Math.max(v.height,m.height)},x=p.padding,w=iu(o.flipXY?p.vAlign:p.align),q=iu(o.flipXY?p.align:p.vAlign),M=Math.min(1+b.width+2*x,p.maxWidth*r.width,p.maxWidthPx),D=b.height+2*x,k=o.flipXY?D:M,S=o.flipXY?M:D;if((u=r.processItem({fn:function(e){var t=e.width,n=e.height,i=o.position*t-(o.flipXY?D:M)*(1-w);return{type:"rect",x:i=o.flipXY?i:Math.max(i,0),y:Math.max(Math.abs(q*n-S*q),0),width:o.flipXY?k:Math.min(k,r.width-i),height:S,stroke:p.background.stroke,strokeWidth:p.background.strokeWidth,fill:p.background.fill,opacity:p.background.opacity}},flipXY:o.flipXY||!1})).x<-1||u.x+u.width>r.width+1||u.y<-1||u.y+u.height>r.height+1)u=void 0;else{c={type:"text",text:p.text||"",fill:p.fill,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:u.x+x,y:u.y+u.height/2+b.height/3,maxWidth:u.width-2*x-m.width,anchor:"start"},g&&(h={type:"text",text:g||"",fill:p.fill,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:c.x+3+(u.width-(m.width+2*x)),y:c.y});for(var _=0,E=s.length;_<E;_++){var A=s[_];"rect"===A.type?Ds(u,A)&&(l=!1):"line"===A.type&&o.flipXY===A.flipXY&&_s(u,A)&&(l=!1)}}}s.push(t),l&&u&&c&&(s.push(u,c),h&&s.push(h))}({chart:e.chart,blueprint:e.blueprint,renderer:e.renderer,p:n,settings:t,items:r})})),t.style.oob.show&&function(e){for(var t=e.blueprint,n=e.oob,r=e.settings,i=e.items,o=Object.keys(n),a=r.style.oob||{},s=function(e,r){var s=o[e],l=n[s];if(l.length>0){var u=s.charAt(1),c="y"===s.charAt(0),h=a.padding.x+a.width,f=a.padding.y+a.width,d="bottom";d=c?"1"===u?"bottom":"top":"1"===u?"right":"left";var p=t.processItem({fn:function(e){var t=e.width,n=e.height,r=u*t+("1"===u?-h:h),i=c?f:n-f;return"arc"===a.type?{type:"path",d:nu(c?i:r,c?r:i,a.width,d),x:r,y:i,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:r,cy:i,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:l}},flipXY:c}),m=p.cx||p.x,g=p.cy||p.y,y={type:"text",text:l.length||"",x:m-.4*a.width,y:g+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},v={type:"path",d:ru(m,g,a.width,d),x:m,y:g,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(p,y,v)}},l=0,u=o.length;l<u;l++)s(l)}({blueprint:this.blueprint,oob:n,settings:t,items:r}),r}};function uu(e){var t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){C(e,t.style)}(t,e),t}function cu(e){return"string"==typeof e||"number"==typeof e?e:"-"}function hu(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){var r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),u=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((function(e){return Ja(e,r,{x:t.x,y:t.y})})),c={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[c,h]:[h,c];u.push.apply(u,f),t.collider={type:"polygon",vertices:u}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){var r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{var i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}var o=t.collider;o.x=Math.max(o.x,0),o.y=Math.max(o.y,0);var a=o.x+o.width-(n.outerRect.x+n.outerRect.width);o.width=a>0?o.width-a:o.width;var s=o.y+o.height-(n.outerRect.y+n.outerRect.height);o.height=s>0?o.height-s:o.height}(e,t,n)}function fu(e,t){var n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1),r=0;if(e.tilted)r=e.stepSize*n;else{var i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function du(e,t){var n,r,i={type:"text",text:cu(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+fu(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+fu(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((function(n){e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){var n=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),i=e.x-r,o=e.x+r;i<0?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):o>n&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{var a=t.outerRect.height,s=t.maxHeight/2,l=e.y-s,u=e.y+s;l<0?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):u>a&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){var n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";var i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){var o=t.outerRect.width-t.paddingEnd;e.x+i>o&&(e.maxWidth=(o-e.x-10)/Math.cos(r))}else{var a=t.paddingEnd;e.x-i<a&&(e.maxWidth=(e.x-a-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),hu(e,i,t),i}function pu(e,t){var n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){C(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){var n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function mu(e){return!e.isMinor&&e.position>=0&&e.position<=1}function gu(e){var t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){for(var t=e.majorTicks,n=e.measureText,r=e.rect,i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map((function(e){return e.label})).map((function(e){return"".concat(e.slice(0,1)).concat(e.length>1?"…":"")})).map(n).map((function(e){return e.width})),s=0;s<t.length;++s){var l=t[s];if(i*o*Math.abs(l.start-l.end)<a[s])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){var t=e.majorTicks,n=e.measureText,r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t,state:n})}function yu(e){var t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function vu(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0,u={left:0,top:0,right:0,bottom:0},c=a.labels,h=c.maxLengthPx,f=c.minLengthPx;if(a.labels.show){var d,p,m=a.align,g="top"===m||"bottom"===m,y=g?n.inner.width:n.inner.height,v=o.ticks({settings:a,distance:y,formatter:r}).filter(mu),b=function(e){var t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=yu({value:t.width,maxValue:h,minValue:f}),t};if(t&&g&&"auto"===a.labels.mode&&(!function(e){var t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings,a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,u=n("…").width,c=r.width,h=0;if(isNaN(a))for(var f=0;f<t.length;f++){var d=t[f],p=d.label;if(n(p).width*(p.length>1?l:1)+u>(h=s*c*Math.abs(d.start-d.end)))return!0}else if(h=s*c*t.reduce((function(e,t){return Math.min(Math.abs(t.start-t.end),e)}),1/0),n("M").width*l*a+u>h)return!0;return!1}({majorTicks:v,measure:b,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&gu({rect:n.inner,state:s,majorTicks:v,measure:b,horizontal:g}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0};if("tilted"===s.labels.activeMode){var x=Math.abs(a.labels.tiltAngle)*(Math.PI/180);d=function(e){return yu({value:e.width,maxValue:h,minValue:f})*Math.sin(x)+e.height*Math.cos(x)}}else d=g?function(e){return e.height}:function(e){return yu({value:e.width,maxValue:h,minValue:f})};if(g&&"tilted"!==s.labels.activeMode)p=["M"];else if(isNaN(a.labels.maxGlyphCount))p=v.map((function(e){return e.label}));else{for(var w="",q=0;q<a.labels.maxGlyphCount;q++)w+="M";p=[w]}var M=p.map(b),D=M.map(d),k=Math.max.apply(Math,X(D).concat([0]));if(l+=k,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){var S="bottom"===a.align==a.labels.tiltAngle>=0,_=Math.abs(a.labels.tiltAngle)*(Math.PI/180),C=(k-b("M").height*Math.cos(_))/Math.sin(_),E=Math.min(a.labels.maxEdgeBleed,Math.max.apply(Math,X(M.map((function(e){return Math.min(C,e.width)*Math.cos(_)+e.height})).map((function(e,t){var r=v[t]?v[t].position:0;return S?e-r*n.inner.width:e-(1-r)*n.inner.width}))).concat([0])))+a.paddingEnd;if(u[S?"left":"right"]=E,!a.labels.filterOverlapping&&function(e){var t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;var a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:v,measureText:b,rect:n,bleedSize:E,angle:a.labels.tiltAngle}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}return{size:l,edgeBleed:u}}var bu=function(e,t,n){return e.width*Math.abs(t.position-n.position)};function xu(e){var t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index,s=t?2:1,l=n[a-s],u=n[a+s],c=l?bu(r,o,l)/2-2:1/0,h=u?bu(r,o,u)/2-2:1/0;return n.length<2?r.width:l?u?2*Math.min(c,h):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth,o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),u=1===r.position?t.width/2-2:0;return Math.max(i,l,u)}({innerRect:r,outerRect:i,tick:o,prevWidth:c}):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth,o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)}({innerRect:r,outerRect:i,tick:o,nextWidth:h})}function wu(e){var t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0}function qu(e){var t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=wu(e)+e.labels.margin}function Mu(e,t){return e.map((function(e){return pu(e,t)}))}function Du(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function ku(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick,l=t.height,u=Du(i,s),c={width:0,height:l};if("left"===n.align||"right"===n.align)c.width=r.width-qu(n)-n.paddingEnd;else if(a)c.width=u*r.width*2;else if(o){var h=Math.abs(n.labels.tiltAngle)*(Math.PI/180);c.width=(r.height-qu(n)-n.paddingEnd-l*Math.cos(h))/Math.sin(h)}else c.width=u*r.width;return c.width=yu({value:c.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),c}function Su(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,u=e.major,c=t.height,h={width:0,height:c};if("left"===n.align||"right"===n.align)h.width=r.width-qu(n)-n.paddingEnd;else if(o){var f=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(r.height-qu(n)-n.paddingEnd-c*Math.cos(f))/Math.sin(f)}else h.width=xu({layered:a,major:u,innerRect:r,outerRect:i,tick:s,index:l});return h.width=yu({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function _u(e){var t;function n(){return t=Su,n}function r(){return t=ku,r}function i(e){var n,r=e.settings,i=e.scale,o=e.innerRect,a=e.outerRect,s=e.measureText,l=e.ticks,u=e.state,c=e.textBounds,h=[],f=function(e){return e.filter((function(e){return!e.isMinor}))}(l),d=function(e){return e.filter((function(e){return e.isMinor}))}(l),p={innerRect:o,align:r.align,outerRect:a},m="tilted"===u.labels.activeMode,g="layered"===u.labels.activeMode;if(r.line.show&&(p.style=r.line,p.padding=r.paddingStart,h.push(uu(p))),r.ticks.show&&(p.style=r.ticks,p.tickSize=r.ticks.tickSize,p.padding=wu(r),n=Mu(f,p)),r.labels.show){var y=qu(r);p.style=r.labels,p.padding=y,p.tilted=m,p.layered=g,p.angle=r.labels.tiltAngle,p.paddingEnd=r.paddingEnd,p.textBounds=c;var v=function(e,n){p.textRect=function(e){var t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:p.style});var u=t({textMetrics:p.textRect,settings:r,innerRect:o,outerRect:a,scale:i,tilted:m,layered:g,tick:e,major:f,index:n});p.maxWidth=u.width,p.maxHeight=u.height,p.stepSize=function(e){var t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Du(n,i)}({innerRect:o,scale:i,ticks:l,settings:r,tick:e})},b=[];b=!g||"top"!==r.align&&"bottom"!==r.align?function(e,t,n){return e.map((function(e,r){n(e,r);var i=du(e,t);return i.data=e.data,i}))}(f,p,v):function(e,t,n,r){var i=t.padding,o=qu(n);return e.map((function(e,a){r(e,a);var s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;var l=du(e,t);return l.data=e.data,l}))}(f,p,r,v),r.labels.filterOverlapping&&function(e,t,n){var r=function(t,n){return Ds(ae(1,e[t].boundingRect),ae(1,e[n].boundingRect))};if(n&&n.tilted){var i=Math.abs(n.angle);r=function(t,n){var r=1/Math.abs(e[t].x-e[n].x),o=Math.sin(i*(Math.PI/180))/r;return e[t].boundingRect.height>o}}for(var o=0;o<=e.length-1;o++)for(var a=o+1;a<=Math.min(o+5,o+(e.length-1));a++)e[o]&&e[a]&&r(o,a)&&(a===e.length-1?(e.splice(o,1),t&&t.splice(o,1)):(e.splice(a,1),t&&t.splice(a,1)),a--,o--)}(b,n,p),h.push.apply(h,X(b))}return r.minorTicks&&r.minorTicks.show&&d.length>0&&(p.style=r.minorTicks,p.tickSize=r.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(r),h.push.apply(h,X(Mu(d,p)))),n&&h.push.apply(h,X(n)),h}return n.build=i,r.build=i,e?r():n()}var Cu={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Eu={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};var Au={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created:function(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState:function(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){var t=e.state,n=e.style,r=e.settings,i=C(!0,{},t.isDiscrete?Cu:Eu,n),o=C(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){var n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));var s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=_u(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){var r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize:function(e){var t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;return this.state.pxScale=Sa(r,i),function(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0,l=vu({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),u=l.size,c=l.edgeBleed;if(s+=u,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){var h=a.minorTicks.margin+a.minorTicks.tickSize;h>s&&(s=h)}if(a.line.show){var f=a.line.strokeWidth/2;s+=f,c[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(f)}return s+=a.paddingStart,{size:s+=a.paddingEnd,edgeBleed:c}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n})},beforeUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.settings;this.setState(t)},resize:function(e){var t=e.inner,n=e.outer,r=C({},t,function(e){var t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return C(this.state.innerRect,r),C(this.state.outerRect,i),n},beforeRender:function(){var e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Sa(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((function(e){return e.position>=0&&e.position<=1}))},render:function(){var e=this.state,t=[];return t.push.apply(t,X(this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e}))),Jl.multiple(t),t}};var Tu={render:function(){return[]}};function Iu(e,t,n){var r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){r=(n.data().fields||[]).map((function(e){return e.title()})).join(t)}return r}function Ru(e,t){var n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}var Nu={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created:function(){this.definitionSettings=this.settings.settings;var e=this.settings.text,t=this.definitionSettings.join;this.title=Iu(e,t,this.scale)},preferredSize:function(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render:function(){var e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){var t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style,s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Ru(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};C(s,a.text);var l=o(s);if("top"===r||"bottom"===r){var u=i.width/2;"left"===n.anchor?u=n.paddingLeft||0:"right"===n.anchor&&(u=i.width-(n.paddingRight||0)),s.x=u,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{var c=i.height/2;"top"===n.anchor?c=n.paddingStart:"bottom"===n.anchor&&(c=i.height-n.paddingStart),s.y=c,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;var h="left"===r?270:90;s.transform="rotate(".concat(h,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate:function(e){e.settings&&(C(this.settings,e.settings),this.definitionSettings=e.settings.settings);var t=this.settings.text,n=this.definitionSettings.join;this.title=Iu(t,n,this.scale)}};function Ou(e,t){var n,r=e.settings.layout.dock,i=e.settings.settings.invert,o="top"===r||"bottom"===r,a=o?"width":"height",s=e.rect[a],l=e.chart.scroll(e.settings.scroll),u=t[o?"x":"y"];i&&(u=s-u);var c=l.getState();n={startOffset:u,startScroll:c.start,swipe:!1};var h=u/s*(c.max-c.min)+c.min;h<c.start?n.startScroll=h:h>c.start+c.viewSize&&(n.startScroll=h-c.viewSize);return{update:function(e){var t=e[o?"x":"y"];if(i&&(t=s-t),!n.swipe){if(Math.abs(n.startOffset-t)<=1)return;n.swipe=!0}var r=l.getState(),a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)},end:function(e){var t=e[o?"x":"y"];i&&(t=s-t);var r=l.getState();if(n.swipe){var a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)}else{var c=t/s*(r.max-r.min)+r.min-r.viewSize/2;l.moveTo(c)}}}}function Pu(e,t){var n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}var Lu={require:["chart","renderer"],on:{panStart:function(e){var t=Pu(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Ou(this,n),this.currentMove.update(t)},panMove:function(e){if(this.currentMove){var t=Pu(e,this.renderer);this.currentMove.update(t)}},panEnd:function(e){if(this.currentMove){var t=Pu(e,this.renderer);this.currentMove.end(t),this.currentMove=null}},panCancel:function(){this.currentMove=null},tap:function(e){var t=Pu(e,this.renderer);Ou(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){var t=this.chart.scroll(this.settings.scroll).getState();return t.viewSize>=t.max-t.min?Math.max(e.width,e.height):this.settings.settings.width},render:function(e){var t,n=this.settings.layout.dock,r=this.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=this.rect[o],s=this.chart.scroll(this.settings.scroll).getState(),l=a*(s.start-s.min)/(s.max-s.min),u=a*s.viewSize/(s.max-s.min);return r&&(l=a-l-u),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:(t={position:"absolute"},P(t,i?"left":"top","".concat(l,"px")),P(t,i?"top":"left","25%"),P(t,i?"height":"width","50%"),P(t,o,"".concat(Math.max(1,u),"px")),P(t,"background",this.settings.settings.thumbColor),t)})))},renderer:"dom"};function ju(e){var t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx,u="end"!==o,c=u?{left:"0",top:"0"}:{right:"0",bottom:"0"},h=0,f="100%",d="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),d="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(h=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-h,"px"),d="".concat(s.rect.height-h,"px")),u||(i-=a),t("div",{onmouseover:function(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout:function(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:i,"px"),top:"".concat(n?i:h,"px"),height:n?"".concat(a,"px"):d,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:C({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},c)})])}function zu(e){var t,n,r=e.h,i=e.isVertical,o=e.label,a=e.otherValue,s=e.rangeIdx,l=e.idx,u=e.pos,c=e.align,h=e.state,f=e.value,d="end"!==c,p="outside"===h.settings.bubbles.placement,m="none";i?(n=d?"left":"right",p&&(m=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(n=d?"top":"bottom",p&&(m=d?"translate(0px, -100%)":"translate(0px, 100%)"));var g=h.edit&&h.edit.rangeIdx===s&&h.edit.bubbleIdx===l,y={position:"relative",borderRadius:"".concat(h.style.bubble.borderRadius,"px"),border:"".concat(h.style.bubble.strokeWidth,"px solid ").concat(h.style.bubble.stroke),backgroundColor:h.style.bubble.fill,color:h.style.bubble.color,fontFamily:h.style.bubble.fontFamily,fontSize:h.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:i?"translate(0,-50%)":"translate(-50%,0)",cursor:i?"ns-resize":"ew-resize"},v=h.style.bubble.stroke,b=g?r("input",{type:"text",value:f,style:T(T({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var t=parseFloat(e.target.value);isNaN(t)?(v="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(h.style.bubble.strokeWidth,"px solid ").concat(v)):h.onEditConfirmed(s,t,a)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),h.onEditCanceled())}}):r("div",{"data-key":[h.key,"bubble",s,l].join("-"),"data-other-value":a,"data-idx":s,"data-bidx":l,style:y},[o]);return r("div",{style:(t={position:"absolute"},P(t,n,"0"),P(t,i?"top":"left","".concat(u,"px")),P(t,"transform",m),t)},[b])}function Fu(e){var t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",C({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Hu(e){var t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);var u=!!i.scale,c=u?i.scale.norm(o)*i.size:o,h=u?i.scale.norm(a)*i.size:a,f=Math.abs(c-h),d=Math.min(c,h)+l,p=d+f;if(i.targetRect){var m=i.targetFillRect||i.targetRect,g=r?m.height:m.width,y=u?i.scale.norm(o)*g:o,v=u?i.scale.norm(a)*g:a,b=Math.abs(y-v),x=Math.min(y,v),w={h:i.h,isVertical:r,top:x,height:b,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(w.on={onmouseover:function(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout:function(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),height:"".concat(m.height,"px"),width:"".concat(m.width,"px")}},[Fu(w)]))}var q=c<h?o:a,M=c<h?a:o,D=Y(u?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),k=D[0],S=D[1],_=q+1e-5>=k&&q-1e-5<=S,C=M-1e-5<=S&&M+1e-5>=k;_&&n.push(ju({h:i.h,isVertical:r,borderHit:t,value:q,pos:d,align:"start",state:i,idx:s})),C&&n.push(ju({h:i.h,isVertical:r,borderHit:t,value:M,pos:p,align:"end",state:i,idx:s}));var E=i.settings.bubbles;if(E&&E.show){var A={fontSize:E.fontSize,fontFamily:E.fontFamily,color:E.fill},T=[o,a];_&&n.push(zu({h:i.h,isVertical:r,align:E.align,style:A,rangeIdx:s,idx:0,otherValue:M,value:q,label:"".concat(i.format(q,T)),pos:d,state:i})),C&&n.push(zu({h:i.h,isVertical:r,align:E.align,style:A,rangeIdx:s,idx:1,otherValue:q,value:M,label:"".concat(i.format(M,T)),pos:p,state:i}))}}function Bu(e){var t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start,r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t)}function Vu(e){var t=[],n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((function(r,i){e.active&&i===e.active.idx||Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){var r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{var o=Bu(e);r=e.active.start+o,i=e.active.end+o}Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function Wu(e){return{min:e.scale.min(),max:e.scale.max()}}function Uu(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function $u(e,t,n){var r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Yu(e){e.renderer.render(Vu(e))}function Xu(e,t){if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}function Ku(e,t){for(var n,r=1/0,i=t.domain(),o=t.bandwidth()/2,a=0;a<i.length;++a){var s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Gu(e,t){return Math.min.apply(Math,X(e))<=Math.max.apply(Math,X(t))&&Math.max.apply(Math,X(e))>=Math.min.apply(Math,X(t))}function Ju(e){return re(e.reduce((function(e,t){return e.push.apply(e,X(ne(t.bounds))),e}),[]))}var Zu={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart:function(e){this.start(e)},rangeMove:function(e){this.move(e)},rangeEnd:function(e){this.end(e)},rangeClear:function(e){this.clear(e)},bubbleStart:function(e){this.bubbleStart(e)}},created:function(){this.state={key:this.settings.key||"brush-range"}},beforeRender:function(e){this.state.rect=e.size.computedInner},renderRanges:function(){this.state.started||(this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.active=null,Yu(this.state))},render:function(e){var t=this,n=this.settings.settings;this.state.direction="vertical"===n.direction?0:1;var r=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"],o=Sa(this.chart.scale(n.scale),i),a=function(e){var t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((function(t){return e.chart.component(t)})).filter((function(e){return!!e&&!!e.rect})),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){var a=Ju(i);if(t.size=a[0===e.state.direction?"height":"width"],t.scale=Sa(e.chart.scale(n.scale),t.size),t.targetRect=a,o.length>0){var s=Ju(o);t.targetFillRect=s}}else if(r&&r.length>0){var l=r.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:l.x0-e.state.rect.x,y:l.y0-e.state.rect.y,width:l.x1-l.x0,height:l.y1-l.y0}}return t}(this);if(o=a.scale?a.scale:o,this.state.targetRect=a.targetRect,this.state.targetFillRect=a.targetFillRect,this.state.size=null===a.size?i:a.size,this.state.settings=n,this.state.style=this.style,this.state.offset=r,this.state.brush="object"===I(n.brush)?n.brush.context:n.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.onEditConfirmed=function(e,n,r){t.state.edit=null,function(e,t,n,r){var i=e.ranges.map((function(e){return{min:e.min,max:e.max}})),o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=T({},i[t]);var s=e.scale.data();s&&s.fields&&s.fields.forEach((function(t){e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(t.state,e,n,r),t.emit("bubbleEnd"),Yu(t.state)},this.state.onEditCanceled=function(){t.state.edit=null,Yu(t.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof n.bubbles.label&&function(e,r){return n.bubbles.label.call(void 0,{datum:e,data:r,scale:o,resources:{scale:t.chart.scale,formatter:t.chart.formatter}})},{}.hasOwnProperty.call(o,"norm")){this.state.editable=!0,this.state.observeBrush="object"===I(n.brush)&&n.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=o;var s=this.state.scale.data();!this.state.format&&s&&s.fields&&s.fields[0]&&(this.state.format=s.fields[0].formatter())}else this.state.editable=!1,this.state.scale=xo(),this.state.scale.data=o.data,this.state.format||(this.state.format=function(e,t){return Gu(o.range(),t)?function(e,t){var n=t.ticks(),r=t.domain().indexOf(Ku(e,t));return-1!==r?n[r].label:"-"}(e,o):"-"}),this.state.fauxBrushInstance=ma(),this.state.findValues=function(e){return function(e,t){var n=t.domain(),r=t.range(),i=[];return e.forEach((function(e){if(Gu(r,[e.min,e.max])){var o=n.indexOf(Ku(e.min,t)),a=n.indexOf(Ku(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}})),i}(e,o)};return this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Vu(this.state)]:[]},mounted:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){t.edit=null;var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=C({},r.element().getBoundingClientRect());var c=a-t.offset.left,h=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);var f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],d=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];u.current=t.scale.normInvert(d/t.size),u.start=t.scale.normInvert(f/t.size);var p,m,g=t.ranges,y=Wu(t),v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),y.min=v>0?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;else{for(p=0;p<g.length;p++){if(g[p].min<=u.start&&u.start<=g[p].max){v=p,y.min=p?g[p-1].max:y.min,y.max=p+1<g.length?g[p+1].min:y.max;break}if(u.start<g[p].min){y.max=g[p].min,y.min=p?g[p-1].max:y.min;break}}-1===v&&g.length&&p>=g.length&&(y.min=g[g.length-1].max)}if(-1!==v||t.multi||(u.ranges=[],y.min=t.scale.min(),y.max=t.scale.max()),-1!==v)if(m={idx:v,start:g[v].min,end:g[v].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),m.mode="modify";else{var b=t.scale.norm(m.start)*t.size,x=t.scale.norm(m.end)*t.size;Math.abs(f-b)<=o?(u.start=m.end,m.mode="modify"):Math.abs(f-x)<=o&&(u.start=m.start,m.mode="modify")}else m={idx:-1,start:u.start,end:u.current,limitLow:y.min,limitHigh:y.max,mode:"current"};u.active=m,"modify"!==m.mode&&t.targetRect&&!Ss(t.targetRect,{x:c,y:h})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:Xu,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);var n=Wu(e);$u(e,e.current,n)}(this.state,Xu),Yu(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move:function(e){this.state.started&&(!function(e,t){var n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});var r=e.scale.data();r&&r.fields&&r.fields.forEach((function(n){if(e.fauxBrushInstance){var r=Xu(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((function(e){return-1===i.indexOf(e)})),s=i.filter((function(e){return-1===o.indexOf(e)})),l=a.map((function(e){return{key:n.id(),value:e}})),u=s.map((function(e){return{key:n.id(),value:e}}));e.brushInstance.addAndRemoveValues(l,u),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Yu(this.state))},clear:function(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart:function(e){if(this.state.editable){var t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(!isNaN(r.rangeIdx)&&JSON.stringify(r)!==JSON.stringify(this.state.edit)){this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();var i=n.parentNode;Yu(this.state);var o=i.querySelector("input");o.focus(),o.select()}}}};function Qu(e){e.renderer.render(Vu(e))}function ec(e){return e.rc.ranges()}var tc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaClear:function(e){this.clear(e)}},created:function(){this.state={key:this.settings.key||"brush-area-dir"}},render:function(e){var t=this;this.state.rect=this.rect;var n=this.settings.settings,r="vertical"===n.direction?0:1,i=this.state.rect[0===r?"height":"width"],o=this.renderer.element().getBoundingClientRect(),a=(n.target?n.target.components||[n.target.component]:[]).map((function(e){return t.chart.component(e)})).filter((function(e){return!!e&&!!e.rect})),s=a[0]?a.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}}),{x0:a[0].rect.x,y0:a[0].rect.y,x1:a[0].rect.x+a[0].rect.width,y1:a[0].rect.y+a[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=r,this.state.settings=n,this.state.offset=o,this.state.rc=ta(),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){var r=Math.min.apply(Math,X(n)),i=Math.max.apply(Math,X(n)),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";var s=a.reduce((function(n,i){var o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce((function(e,t){return e.key===s.key?e:t}));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);var c=a-t.offset.left,h=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],d=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset],p=d,m=f;u.start=f,u.current=d;var g,y,v=t.ranges,b=Uu(t),x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),b.min=x>0?v[x-1].max:b.min,b.max=x+1<v.length?v[x+1].min:b.max;else{for(g=0;g<v.length;g++){if(v[g].min<=m&&m<=v[g].max){x=g,b.min=g?v[g-1].max:b.min,b.max=g+1<v.length?v[g+1].min:b.max;break}if(m<v[g].min){b.max=v[g].min,b.min=g?v[g-1].max:b.min;break}}-1===x&&v.length&&g>=v.length&&(b.min=v[v.length-1].max)}if(-1!==x||t.multi||(u.ranges=[],b.min=0,b.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(y={idx:x,start:v[x].min,end:v[x].max,limitLow:b.min,limitHigh:b.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{var w=y.start,q=y.end;Math.abs(f-w)<=o?(u.start=y.end,y.mode="modify"):Math.abs(f-q)<=o&&(u.start=y.start,y.mode="modify")}else y={idx:-1,start:m,end:p,limitLow:b.min,limitHigh:b.max,mode:"current"};u.active=y,"modify"!==y.mode&&t.targetRect&&!Ss(t.targetRect,{x:c,y:h})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:ec,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);var n=Uu(e);$u(e,e.current,n)}(this.state,ec),Qu(this.state))},move:function(e){this.state.started&&(!function(e,t){var n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);var r=[];t.forEach((function(t){r.push.apply(r,X(function(e,t){var n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}(e,t)))})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,r)}(this.state),Qu(this.state))},clear:function(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function nc(e){var t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){var t=e.brush;if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}(e).map((function(i){var o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function rc(e,t,n,r){function i(){!function(e){e.renderer.render(nc(e))}(e)}function o(){!function(e){e.renderer.render(nc(e))}(e)}function a(){!function(e){e.renderer.render(nc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function ic(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}var oc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:function(){return 50},created:function(){this.state={}},render:function(){var e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Sa(this.chart.scale(e.scale),r);return ic(this.state),rc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,nc(this.state)},beforeDestroy:function(){ic(this.state)}};function ac(e,t){var n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function sc(e,t,n){return Xa(e,t.points[0])<Math.pow(n.settings.snapIndicator.threshold,2)}function lc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function uc(e){var t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function cc(e,t){e.snapIndicator.visible=t}var hc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart:function(e){this.start(e)},lassoEnd:function(e){this.end(e)},lassoMove:function(e){this.move(e)},lassoCancel:function(){this.cancel()}},created:function(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start:function(e){var t,n,r,i;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=(n=this.chart,r=this.state.rendererBounds,i=n.element.getBoundingClientRect(),{x:r.left-i.left,y:r.top-i.top}),this.state.brushConfig=function(e){return e.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}}))}(this.settings);var o=ac(this.state.rendererBounds,e);lc(this.state,o),uc({state:this.state,start:o}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,o)},move:function(e){if(this.state.active){var t=ac(this.state.rendererBounds,e);sc(t,this.state,this.settings)?cc(this.state,!0):cc(this.state,!1),lc(this.state,t),uc({state:this.state,end:t}),function(e,t){var n=[e.startPoint,e.path,e.snapIndicator].filter((function(e){return e.visible}));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){var n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;var i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)}},end:function(e){this.state.active&&(cc(this.state,!1),sc(ac(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){var n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((function(e){return{x:e.x+n,y:e.y+r}})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render:function(){}};function fc(e,t,n,r,i){for(var o,a=0,s=t.length-1;a<s;){var l=Math.floor((a+s)/2);(o=i(t[l]))[n]+o[r]<e[n]?a=l+1:s=l}return a}function dc(e){var t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fc,a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",u=function(e){return e.textBounds},c=function(e){return e.node.localBounds};return function(e,t){var h=r[t],f=h.textBounds,d=h.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(var p=o(f,a,s,l,u);p<a.length;p++)if(Ds(f,a[p].textBounds))return!1;for(var m=o(f,n,s,l,c),g=f[s]+f[l],y=m;y<n.length;y++){var v=n[y].node;if(g<v.localBounds[s])break;if(Ds(f,v.localBounds)&&d!==v)return!1}return a.push(r[t]),!0}}function pc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function mc(e){var t=I(e);return("string"===t||"number"===t)&&""!==e}function gc(e){return T({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds)}function yc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function vc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function bc(e,t,n,r,i){var o,a;return"v"===e?(o=r||i||yc(t,n,!0),a=vc(t,n,!r)):(o=yc(t,n),a=i||vc(t,n,!1)),o&&a}function xc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function wc(e,t,n){var r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return yc(e,t,n.rotate)&&vc(e,t,n.rotate)}(e,i,n))return!1;var o=.5*i.height;return n.rotate?(r.x=xc(e.x,e.width,i.height,n.align)+o,r.y=xc(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=xc(e.x,e.width,i.width,n.align),r.y=xc(e.y,e.height,i.height,n.justify)+o),r}function qc(e){var t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s={};if(C(s,t),i&&"inside"!==i)if("up"===r||"down"===r){var l=Math.max(0,Math.min(t.y,n.height)),u=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=l):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=u,s.height=n.height-u)}else{var c=Math.max(0,Math.min(t.x,n.width)),h=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=c):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=h,s.width=n.width-h)}else;return function(e,t){var n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.top,r=void 0===n?4:n,i=t.bottom,o=void 0===i?4:i,a=t.left,s=void 0===a?4:a,l=t.right,u=void 0===l?4:l;e.x+=s,e.width-=s+u,e.y+=r,e.height-=r+o}(s,a),s}function Mc(e){var t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,u=e.node,c=e.orientation,h=e.placementSettings,f=e.rect,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qc,p=[],m="h"===c?"width":"height";for(o=0;o<h.length;o++)if(r=h[o],i=d({bar:u.localBounds,view:f,direction:a,position:r.position,padding:r.padding}),p.push(i),t=!o||i[m]>t[m]?i:t,bc(c,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),{bounds:n,placement:r=h[o]}}function Dc(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,u=i.left,c=void 0===u?4:u,h=i.right,f=void 0===h?4:h,d=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),y=.5*t.height,v=1e-9,b=n?d-y:d,x=n?p:p-y,w={x:b-c-v,y:x-a-v,width:g+(c+f)-v,height:m+(a+l)-v};return w}function kc(e){for(var t,n,r,i,o,a,s,l,u,c,h,f,d,p=e.chart,m=e.targetNodes,g=e.rect,y=e.fitsHorizontally,v=e.collectiveOrientation,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mc,x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wc,w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:dc,q=[],M={container:g,targetNodes:m,labels:[],orientation:v},D=0,k=m.length;D<k;D++){a=null,f=pc(r=(n=m[D]).node,p),d="left"===(u=n.direction)||"right"===u?"h":"v";for(var S=0;S<n.texts.length;S++)if(mc(i=n.texts[S])){var _=b({direction:u,fitsHorizontally:y,lblStngs:c=n.labelSettings[S],measured:l=n.measurements[S],node:r,orientation:d,placements:c.placements,placementSettings:n.placementSettings[S],rect:g});if(a=_.bounds,h=_.placement,a&&h){o=h.justify;var C="function"==typeof c.linkData?c.linkData(f,D):void 0,E="function"==typeof h.overflow?h.overflow(f,D):h.overflow;"up"===u&&(o=1-o),"opposite"===h.position&&(o=1-o),"left"===u&&(o=1-o);var A=!("h"===v||y);if(t=x(a,i,{justify:"h"===d?h.align:o,align:"h"===d?o:h.align,fontSize:c.fontSize,fontFamily:c.fontFamily,textMetrics:l,rotate:A,overflow:!!E})){var R=Dc(t,l,A,a,h.padding);s="function"==typeof h.fill?h.fill(T(T({},f),{},{textBounds:R}),D):h.fill,t.fill=s,void 0!==C&&(t.data=C),"object"===I(h.background)&&(t.backgroundColor="function"==typeof h.background.fill?h.background.fill(T(T({},f),{},{textBounds:R}),D):h.background.fill,void 0!==t.backgroundColor&&(t.backgroundBounds=Dc(t,l,A,a,h.background.padding))),q.push(t),M.labels.push({node:r,textBounds:R})}}}}var N=q.filter(w(M)),O=N.filter((function(e){return void 0!==e.backgroundBounds})).map(gc);return[].concat(X(O),X(N))}function Sc(e){for(var t,n,r,i,o,a,s,l=e.nodes,u=e.rect,c=e.chart,h=e.labelSettings,f=e.placementSettings,d=e.settings,p=e.renderer,m={},g=[],y=!0,v=!1,b=0;b<l.length;b++)if(Ds(i=(n=l[b]).localBounds,u)){var x=pc(n,c);t={node:n,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(var w=0;w<h.length;w++)mc(r="function"==typeof(a=h[w]).label?a.label(x,b):void 0)&&(s="function"==typeof d.direction?d.direction(x,b):d.direction||"up",v=v||"left"===s||"right"===s,m.fontFamily=a.fontFamily,m.fontSize="".concat(a.fontSize,"px"),m.text=r,o=p.measureText(m),t.measurements.push(o),t.texts.push(r),t.labelSettings.push(a),t.placementSettings.push(f[w]),t.direction=s,y=y&&o.width<=i.width-8);g.push(t)}return{targetNodes:g,fitsHorizontally:y,hasHorizontalDirection:v}}function _c(e){var t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}function Cc(e){var t=2*Math.PI;return(e%t+t)%t}function Ec(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Ac(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Tc(e,t,n){var r=t.x,i=t.y;if(r*r+i*i>e*e)return null;var o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;var u=Math.sqrt(l);return{x:s*a+o*u,y:-s*o+a*u}}function Ic(e){var t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(!(t=Tc(r,l,o)))return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(!(t=Tc(r,l,Math.PI-o)))return null;n={x:-a,y:-s};break;case 2:if(!(t=Tc(r,l,o-Math.PI)))return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(!(t=Tc(r,l,2*Math.PI-o)))return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Rc(e){var t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,u=o-i;if(u<Math.PI){var c=(n.height/2+r)/Math.tan(u/2);c>a&&(l=s-c-2*r)}if(l<0||l<n.minReqWidth)return null;var h=Cc((i+o)/2),f=s-r,d={x:Math.sin(h)*f,y:-Math.cos(h)*f,width:l,height:n.height};return h<Math.PI?(d.angle=h-Math.PI/2,d.anchor="end"):(d.angle=h+Math.PI/2,d.anchor="start"),d}function Nc(e){var t=e.context,n=e.node,r=e.bounds,i=n.desc.slice,o=Cc((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Oc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Pc(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){var i=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(i,", ").concat(r.x,", ").concat(r.y,")")}return r}function Lc(e){var t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,u=e.context,c=e.store,h=r.start,f=r.end,d=r.innerRadius,p=r.offset;switch(o){case"into":t="rotate"===i?Rc({slice:r,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=Cc((i+o)/2),u=Ic({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",_s(u,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||_s(u,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||vs({cx:0,cy:0,r:a},u)?null:(Ec(u,n),u)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:h,end:f,innerRadius:0,outerRadius:d},t="rotate"===i?Rc({slice:n,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=e.store,o=t.start,a=t.end,s=t.outerRadius,l=Cc((o+a)/2),u=Ic({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",Ec(u,n),i.insideLabelBounds.some((function(e){return Ds(e,u)}))?null:(i.insideLabelBounds.push({x:u.x-4,y:u.y,width:u.width+8,height:u.height}),u)):null}({slice:n,measured:s,padding:a,store:c});break;case"outside":t="rotate"===i?function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,u=s+r,c=a-o;if(c<Math.PI&&(n.height/2+r)/Math.tan(c/2)>u)return null;var h=Cc((o+a)/2),f=Math.sin(h)*u,d=-Math.cos(h)*u,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){var g=d<0?i.y:i.y+i.height,y=Math.abs(g-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;y<p&&(p=y)}if(Math.sin(m)>.001){var v=f<0?i.x:i.x+i.width,b=Math.abs(v-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;b<p&&(p=b)}if(p<=0||p<n.minReqWidth)return null;var x={x:f,y:d,width:p,height:n.height};return h<Math.PI?(x.angle=h-Math.PI/2,x.anchor="start"):(x.angle=h+Math.PI/2,x.anchor="end"),x}({slice:r,measured:s,padding:a,view:l}):function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,u=t.offset,c=Cc((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(c/(Math.PI/2)),i))return null;var h=l+r+n.height/2,f=Math.sin(c)*h,d=-Math.cos(c)*h,p=n.width+1;if(c<Math.PI){var m=Math.abs(i.x+i.width-(f+u.x));m<p&&(p=m)}else{var g=Math.abs(i.x-(f+u.x));g<p&&(p=g)}if(p<n.minReqWidth)return null;var y={x:f,y:d,width:p,height:n.height};return c<Math.PI?y.anchor="start":y.anchor="end",y}({slice:r,measured:s,padding:a,view:l,context:u});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){var r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=Cc((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){var l=Math.min(e.y,t.q1maxY-e.height),u=e.y-l;if(e.y=l,u>1){var c=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*c,y2:o.y-Math.cos(s)*c,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){var h=Math.max(e.y,t.q2minY),f=h-e.y;if(e.y=h,f>1){var d=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*d,y2:o.y-Math.cos(s)*d,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){var p=Math.max(e.y,t.q3minY),m=p-e.y;if(e.y=p,m>1){var g=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*g,y2:o.y-Math.cos(s)*g,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){var y=Math.min(e.y,t.q4maxY-e.height),v=e.y-y;if(e.y=y,v>1){var b=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*b,y2:o.y-Math.cos(s)*b,strokeWidth:1}}}}}(t,u,r)),t}function jc(e){for(var t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lc,u=0;u<o.length;u++){var c=o[u],h=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(h)return{bounds:h,placement:c}}return{bounds:null,placement:null}}function zc(e){for(var t=[],n=[],r=[],i=[],o=0;o<e.length;++o){var a=e[o].desc.slice,s=Cc((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}var l=function(e,t){return Cc((e.desc.slice.start+e.desc.slice.end)/2)-Cc((t.desc.slice.start+t.desc.slice.end)/2)},u=function(e,t){return l(t,e)};return t.sort(u),n.sort(l),r.sort(u),i.sort(l),t.concat(n,i,r)}function Fc(e,t,n){var r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}var Hc=/\n+|\r+|\r\n/,Bc=/\s/,Vc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Wc(e){return"string"==typeof e?-1!==e.search(Hc):-1!==String(e).search(Hc)}function Uc(e){return-1!==e.search(Bc)}function $c(e){return-1!==e.search(Vc)}function Yc(e,t,n,r,i){return r.some((function(r){return r(e,t,n)}))?1:i.some((function(r){return r(e,t,n)}))?0:2}function Xc(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Kc(e,t,n){return Math.max(t,Math.min(n,e))}function Gc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?function(e){return{width:e.length,height:1}}:a,l=e.mandatoryBreakIdentifiers,u=void 0===l?[Wc]:l,c=e.noBreakAllowedIdentifiers,h=void 0===c?[]:c,f=e.suppressIdentifier,d=void 0===f?[Uc,Wc,function(e){return""===e}]:f,p=e.hyphenationIdentifiers,m=void 0===p?[$c]:p,g=String(t).split(r);Xc(g);var y=g.length,v=o?function(e){return e>=0}:function(e){return e<y},b=o?y:-1;function x(e){var t=Kc(e,0,y-1),n=g[t],r=s(n),i=Yc(n,t,g,u,h);return{index:t,value:n,breakOpportunity:i,suppress:d.some((function(e){return e(n,t,g)})),hyphenation:m.some((function(e){return e(n,t,g)})),width:r.width,height:r.height,done:!1}}function w(e){return isNaN(e)?o?b--:b++:b=Kc(e,0,y-1),v(b)?x(b):{done:!0}}return{next:w,peek:x,length:y}}var Jc="…",Zc=/^\s*\d+(\.\d+)?px\s*$/i;function Qc(e){return"string"===I(e)&&Zc.test(e)}function eh(e){var t=e["font-size"]||e.fontSize;return Qc(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function th(e){var t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;var r=eh(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function nh(e,t){return{lines:[],line:"",width:0,maxLines:th(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function rh(e){e.lines.push(e.line),e.line="",e.width=0}function ih(e,t){e.line+=t.value,e.width+=t.width}function oh(e,t,n){if(t.width>e.maxWidth)return t;for(var r=t.index,i=1;i<5;i++){var o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function ah(e,t,n){for(var r=Gc({string:t.value,measureText:n});e.lines.length<e.maxLines;){var i=r.next();if(i.done)break;e.width+i.width>e.maxWidth&&2===i.breakOpportunity&&e.line.length>0?(i=e.hyphens.enabled?oh(e,i,r):i,rh(e),ih(e,i)):ih(e,i)}}function sh(e,t){for(var n=Gc({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[function(e,t){return 0===t}]}),r=nh(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rh(r),i=!1;break}1===o.breakOpportunity?rh(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?r.width+=o.width:(o=r.hyphens.enabled?oh(r,o,n):o,rh(r),ih(r,o)):ih(r,o)}return{lines:r.lines,reduced:i}}function lh(e,t){for(var n=Gc({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=nh(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rh(r),i=!1;break}1===o.breakOpportunity?rh(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?rh(r):o.width>r.maxWidth?ah(r,o,t):(rh(r),ih(r,o)):ih(r,o)}return{lines:r.lines,reduced:i}}function uh(e){return{"break-all":sh,"break-word":lh}[e.wordBreak]}function ch(e){return function(t){var n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){var r=uh(n);if(!r)return;var i=e(n);if(i.width>n.maxWidth||Wc(n.text)){var o=(eh(n)-i.height)/2,a=r(n,function(e,t){return function(n){return t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}}(n,e));t.node=function(e,t,n,r){var i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);var o=0;return e.lines.forEach((function(a,s){var l=C({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Jc:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function hh(e,t){var n=e.text,r=e["font-size"],i=e["font-family"],o=e.maxWidth;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;var a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;for(var s=0,l=n.length-1;s<=l;){var u=Math.floor((s+l)/2);(a=t({text:n.substr(0,u)+Jc,fontSize:r,fontFamily:i}).width)<=o?s=u+1:l=u-1}return n.substr(0,l)+Jc}function fh(e){var t=e.baseline||e["dominant-baseline"],n=0,r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}var dh,ph={},mh={},gh={fontSize:void 0,fontFamily:void 0};function yh(e,t,n){var r=e+t+n;return"number"!=typeof mh[r]&&(dh=dh||document.createElement("canvas").getContext("2d"),function(e,t){gh.fontSize===e&&gh.fontFamily===t||(dh.font=e+" "+t,gh.fontSize=e,gh.fontFamily=t)}(t,n),mh[r]=dh.measureText(e).width),mh[r]}function vh(e){return"number"!=typeof ph[e]&&(ph[e]=function(e){if(Qc(e)){var t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),ph[e]}function bh(e){var t=e.text,n=e.fontSize;return{width:yh(t,n,e.fontFamily),height:vh(n)}}function xh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bh,n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,u=(e.dy||0)+fh(e),c={x:0,y:s+u-.75*i.height,width:o,height:i.height},h=e["text-anchor"]||e.anchor;return c.x="middle"===h?a+l-o/2:"end"===h?a+l-o:a+l,c}function wh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bh,n=uh(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Wc(e.text))){for(var a=n(e,(function(e){return t({text:e,fontFamily:i,fontSize:r})})),s=C({},e),l=0,u="",c=0,h=a.lines.length;c<h;c++){var f=a.lines[c];f+=c===h-1&&a.reduced?Jc:"";var d=t({text:f,fontSize:r,fontFamily:i}).width;d>=l&&(l=d,u=f)}s.text=u;var p=xh(s,t);return p.height=eh(e)*a.lines.length,p}return xh(e,t)}var qh=.9;function Mh(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Dh(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;var o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function kh(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Sh(e){return e.desc&&e.desc.slice?function(e){var t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};var a=0!==r?r:i;return kh({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?kh(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var _h={bar:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kc,l=C({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);var u=t.labels.map((function(e){return C({},l,t,e)})),c=t.labels.map((function(e){return e.placements.map((function(n){return C({},l,t,e,n)}))})),h=Sc({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:u,placementSettings:c}),f=h.fitsHorizontally,d=h.hasHorizontalDirection,p=h.targetNodes,m=_c({orientation:t.orientation,defaultOrientation:d?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return p.sort((function(e,t){return e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])})),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Pc,u=C({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);u.fontSize=parseInt(u.fontSize,10);for(var c=t.labels.map((function(e){return C({},u,t,e)})),h=t.labels.map((function(e){return e.placements.map((function(n){return C({},u,t,e,n)}))})),f=[],d={insideLabelBounds:[]},p={},m=0,g=(r=zc(r)).length;m<g;m++)for(var y=r[m],v=Oc(y,n),b=0;b<c.length;b++){var x=c[b],w="function"==typeof x.label?x.label(v,m):"";if(w){var q="function"==typeof x.direction?x.direction(v,m):x.direction||"horizontal",M="function"==typeof x.linkData?x.linkData(v,m):void 0,D=Fc(w,x,o),k=s({context:p,direction:q,lblStngs:x,measured:D,node:y,placementSettings:h[b],rect:i,store:d}),S=k.bounds,_=k.placement;if(S&&_){if("outside"===_.position&&"rotate"!==q){Nc({context:p,node:y,bounds:S});var E=Ac(S);if(!cs(E,i))continue}var A="function"==typeof _.fill?_.fill(v,m):_.fill,T=l(S,w,{fill:A,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:D});T&&(void 0!==M&&(T.data=M),f.push(T),S.line&&(S.line.stroke=A,f.push(S.line)))}}}return f},rows:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dh,s=C({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);for(var l=C({},s,t),u=t.labels.map((function(e){return C({},l,e)})),c={},h=[],f=0,d=r.length;f<d;f++){var p=r[f],m=Mh(p,n),g=Sh(p),y=g.type,v=g.bounds;if(v){var b=0,x=[],w=[],q="circle"===y?2*v.r*qh:v.height;b+=l.padding;var M=void 0;for(M=0;M<u.length;M++){var D=u[M],k="function"==typeof D.label?D.label(m,f):"";c.fontFamily=D.fontFamily,c.fontSize="".concat(D.fontSize,"px"),c.text=k;var S=i.measureText(c);if((b+=S.height+D.padding)>q)break;w.push(k),x.push(S)}var _=M,E=Math.max(0,q-b),A=void 0;for(A="circle"===y?v.cy-v.r*qh:v.y,A+=l.justify*E+l.padding,M=0;M<_;M++){var T=u[M],I=void 0;if("circle"===y){var R=Math.max(Math.abs(A-v.cy),Math.abs(A+x[M].height-v.cy)),N=Math.sqrt(v.r*v.r-R*R);I={x:v.cx-N+l.padding,y:A,width:2*N-2*l.padding,height:x[M].height}}else I={x:v.x+l.padding,y:A,width:v.width-2*l.padding,height:x[M].height};A+=x[M].height+l.padding;var O="function"==typeof T.fill?T.fill(m,f):T.fill,P="function"==typeof T.linkData?T.linkData(m,f):void 0,L=a(I,w[M],{fill:O,align:T.align,fontSize:T.fontSize,fontFamily:T.fontFamily,textMetrics:x[M]});if(L){if(L.text&&L.text!==Jc){var j=hh(L,i.measureText);if(Jc===j)continue;L.ellipsed=j}void 0!==P&&(L.data=P),h.push(L)}}}}return h}};var Ch={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render:function(){var e=this,t=this.settings.settings,n=[];return(t.sources||[]).forEach((function(t){t.strategy&&_h[t.strategy.type]&&t.component&&n.push.apply(n,X(function(e,t){var n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];var s=n.findShapes(r.selector).filter((function(e){return e.key===r.component}));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:e.chart,rect:e.rect,renderer:e.renderer,source:t,style:e.style},_h[t.strategy.type])))})),n}};var Eh={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Ah(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,u=i.label.displayObject,c=i.label.bounds,h=i.symbol.meta,f="rtl"===l,d={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},p=function(e,t,n){var r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:d.height},h.size,{align:void 0===h.align?.5:h.align,justify:void 0===h.justify?.5:h.justify}),m=a(C({},h,p));return delete m.collider,u.anchor=f?"end":"start",function(e,t,n){var r=n.textMetrics;if(e.height<r.height)return!1;var i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";var o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(d,u,{textMetrics:c,fontSize:parseInt(u.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,u],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:d}}function Th(e,t){var n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Ih(e,t){var n,r,i,o,a=t.onScroll,s=void 0===a?function(){}:a,l=null,u=0,c={itemize:function(t){n=function(e,t){for(var n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,u=i.labels.items,c=0,h=0,f=0,d=0;d<s.length;d++)if(!1!==s[d].show){var p=void 0!==u[d].text?u[d].text:u[d].data.label||"";n=C({},u[d],{type:"text",fontSize:"".concat(parseInt(u[d].fontSize,10),"px"),text:p,title:p}),r={symbol:{meta:l[d]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),c=Math.max(l[d].size,c),h=Math.max(r.label.bounds.width,h),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:c,maxItemBounds:{height:Math.max(c,f),width:c+8+h},maxLabelBounds:{width:h,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:function(t){i=t.viewRect,u=c.getContentOverflow(i);var a=c.extent();l=Math.max(0,Math.min(l,u)),o=C({},i);var s="horizontal"===c.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){for(var r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?Ah:o,s=n.parallels,l=n.createSymbol,u=i.layout.direction,c=i.globalMetrics,h=i.items,f="horizontal"===i.layout.orientation,d=0,p=[],m=c.maxItemBounds.height,g=c.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g,b=t.x,x=t.y,w=r.x-t.x,q=0;q<h.length;q++){var M=a({y:x,x:"rtl"===u?r.x+w+r.width-g-(b-t.x):b,item:h[q],globalMetrics:c,direction:u,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&p.push(M.item),++d>=s?(d=0,f?(b+=v,x=t.y):(x+=y,b=t.x)):f?x+=y:b+=v,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:function(e,t){return r=function(e,t,n){var r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o],s=Math.ceil(a/e);if(null!=t){var l="horizontal"===n.layout.orientation?"height":"width",u="width"===l?"horizontal":"vertical",c=n.layout.margin[u]||4,h=Math.floor((t+c)/(c+n.globalMetrics.maxItemBounds[l]));s=Math.min(s,h)}var f=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,f))}(e,t,n)},hasContentOverflow:function(){var e="horizontal"===n.layout.orientation?"width":"height";return Th(n,r)>i[e]},getContentOverflow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Th(n,r)-e[t])},getNextSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:function(){return"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height},hasPrev:function(){return"horizontal"===c.orientation()?o.x<i.x:o.y<i.y},next:function(){c.scroll(-c.getNextSize())},prev:function(){c.scroll(c.getPrevSize())},scroll:function(e){var t=Math.max(0,Math.min(u,l-e));t!==l&&(l=t,s())},offset:function(){return l},orientation:function(){return n.layout.orientation},direction:function(){return n.layout.direction},extent:function(){return Th(n,r)},spread:function(){return function(e,t){var n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)}};return c}function Rh(e){return Object.keys(e).filter((function(t){return e[t]})).join(" ")}var Nh={up:"▲",right:"▶",down:"▼",left:"◀"};function Oh(e,t){var n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="",l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));var u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",C({class:Rh(a),style:u},l),[s||e("span",{style:{pointerEvents:"none"}},[Nh[i]])])}function Ph(e){var t,n={itemize:function(e){var n,r;r=(n=e).dock,t={layout:{orientation:"top"===r||"bottom"===r?"vertical":"horizontal"},navigation:n.navigation}},render:function(r){return function(e,t,n,r){var i=t.rect,o=t.itemRenderer;if(e&&e.renderArgs){e.size(i);var a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),u=o.hasNext(),c=o.hasPrev();if(c||u){var h=s?["right","left"]:["down","up"];l&&s&&h.reverse();var f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Oh(a,{size:32,isActive:u,direction:h[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Oh(a,{size:32,isActive:c,direction:h[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}else e.render([])}}(n.renderer,r,t,e)},extent:function(){return 32},spread:function(){return 64}};return n}function Lh(e){var t,n={itemize:function(n){t=function(e,t){var n=e.resolved;if(!1===n.title.item.show)return null;var r=C({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){var i=t.scale.data().fields;r.text=i&&i[0]?i[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:function(e){!function(e,t,n){var r=e.rect;if(t){var i=[];if(t.size(r),n){var o={start:0,end:r.width,middle:r.width/2};i.push(C({},n.displayObject,{x:o[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}}(e,n.renderer,t)},spread:function(){return t?t.bounds.height:0},extent:function(){return t?t.bounds.width:0}};return n}function jh(e,t,n,r){var i,o,a,s=r.itemRenderer,l=r.navigationRenderer,u=r.titleRenderer,c=r.isPreliminary,h=void 0!==c&&c,f=0,d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:d.x,y:d.y,width:d.width,height:u.spread()},"horizontal"===n){i={x:d.x,y:d.y,width:u.extent(),height:u.spread()};var p=d.width-i.width-(i.width?t.spacing:0),m=d.height;s.parallelize(p,h?void 0:m);var g=s.extent()>p?l.extent():0,y=s.spread(),v=g?l.spread():0;a={x:(o={x:i.x+i.width+(i.width?t.spacing:0),y:d.y+Math.max(0,(v-y)/2),width:d.width-g-i.width-(g?t.spacing:0)-(i.width?t.spacing:0),height:m}).x+o.width+(g?t.spacing:0),y:d.y,width:g,height:d.height},i.y=o.y,"rtl"===s.direction()&&(a.x=d.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),f=Math.max(i.height,v,s.spread())}else{var b=d.height-i.height-(i.height?t.spacing:0),x=d.width;s.parallelize(b,h?void 0:x);var w=s.extent()>b?l.extent():0;a={x:d.x,y:d.y+d.height-w,width:d.width,height:w},o={x:d.x,y:i.y+i.height+(i.height?t.spacing:0),width:d.width,height:d.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},f=Math.max(u.extent(),w?l.spread():0,s.spread())}return o=C({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:C({},e,i),content:C({},e,o),navigation:C({},e,a),orientation:n,preferredSize:f}}function zh(e){e.state.resolved=function(e){var t=e.scale.domain(),n={items:[]},r=e.settings.layout.dock;if("threshold-color"===e.scale.type){var i=e.scale.data().fields[0],o=function(e){return String(e)};e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(var a=0;a<t.length-1;a++){var s={value:t[a],label:"".concat(o(t[a])," - < ").concat(o(t[a+1]))};i&&(s.source={field:i.id()}),n.items.push(s)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{var l=e.scale.labels?e.scale.labels():null;n.items=t.map((function(t,n){var r=e.scale.datum?C({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):l&&(r.label=l[n]),r}))}var u=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:C(!0,{},Eh.title,e.style.title),settings:e.settings.settings.title}),c=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Eh.layout,settings:e.settings.settings.layout}),h=e.resolver.resolve({data:n,defaults:C(!0,{},Eh.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),f=C(!0,{},(e.settings.settings.item||{}).shape);void 0===f.fill&&e.settings.scale&&(f.fill={scale:e.settings.scale});var d=e.resolver.resolve({data:n,defaults:C(!0,{},Eh.item.shape,e.style.item.shape),settings:f}),p=e.resolver.resolve({data:n,defaults:C(!0,{},{show:Eh.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function m(e,n){var r=e.data.value,i=t[n+1];e.data.value=[r,i]}return"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(p.items.reverse().forEach(m),p.items.reverse()):p.items.forEach(m)),{title:u,labels:h,symbols:d,items:p,layout:c}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Fh(e){var t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",u=jh(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(u.content);var c=i.getItemsToRender({viewRect:C({},u.content,{x:0,y:0})});return o.render({rect:u.navigation,itemRenderer:i}),a.render({rect:u.title}),e.state.views={layout:u},c}var Hh={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted:function(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount:function(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart:function(){this.state.interaction.started||this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove:function(e){if(this.state.interaction.started){var t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t}},panend:function(){this.state.interaction.started=!1},scroll:function(e){this.itemRenderer.scroll(-e)},next:function(){this.itemRenderer.next()},prev:function(){this.itemRenderer.prev()}},created:function(){var e=this;this.state={interaction:{}},this.onScroll=function(){var t=Fh(e);e.update(t)},this.itemRenderer=Ih(this,{onScroll:this.onScroll}),this.navigationRenderer=Ph(this),this.titleRenderer=Lh(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),zh(this)},preferredSize:function(e){return function(e,t){var n=0,r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=jh(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+o.spacing}(this,e)},beforeUpdate:function(){zh(this)},render:function(){return Fh(this)},beforeDestroy:function(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements:function(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo:function(){return{offset:this.itemRenderer.offset()}}};function Bh(e,t){var n=0,r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Vh(e,t,n){var r=n[e];return"object"===I(r)?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Wh(e){return Vh(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Uh(e,t){var n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function $h(e){var t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){var n=t.domain(),r=n,i=e.stgns.tick.label;return!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String)),n.map((function(n,i){var o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}))}(e,i),a=function(e){return Vh(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){var s=i.data().fields;n.text=s&&s[0]?s[0].title():""}var l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),u=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:Wh(e.settings),textMetrics:l,textBounds:u,requiredWidth:function(){if(!n.show)return 0;var e=u.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:function(){if(!n.show)return 0;var e=u.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max.apply(Math,X(o.map((function(e){return e.textMetrics.width})))),e.stgns.tick.maxLengthPx),requiredHeight:function(){return"top"===a?Math.max.apply(Math,X(c.ticks.values.map((function(e){return e.textMetrics.height}))))+e.stgns.tick.padding:0},height:Math.max.apply(Math,X(o.map((function(e){return e.textMetrics.height}))))},legend:{fillScale:r,majorScale:i,length:function(){var n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}var Yh={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize:function(e){var t=this.state;t.rect=Uh(this,e.inner);var n=this.stgns.size,r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;var i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){if(t.ticks.values.reduce((function(e,t){return e+t.textMetrics.height}),0)>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max.apply(Math,X(t.ticks.values.map((function(e){return e.textMetrics.height}))))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created:function(){this.stgns=this.settings.settings,this.state=$h(this)},beforeUpdate:function(e){this.stgns=e.settings.settings,this.state=$h(this)},beforeRender:function(e){if(this.state.nodes=[],this.state.rect=Uh(this,e.size),this.stgns.title.show){var t=function(e){var t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor,o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");var l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Bh(e,l),l}(this);this.state.nodes.push(t)}var n,r,i,o=function(e,t){var n=e.state,r=e.stgns,i=n.rect,o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());var u={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Bh(e,u),u}(this,(r=(n=this).state.legend.fillScale,i=n.state.legend.majorScale,r.domain().map((function(e){return{type:"stop",color:r(e),offset:Math.min(1,Math.max(0,i.norm(e)))}})).sort((function(e,t){return e.offset-t.offset})))),a={id:"legend-seq-target",type:"container",children:[o,function(e,t){var n=e.state,r=e.stgns,i="start",o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((function(a){var s=0,l=0,u=0,c="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,c=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,u-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,u=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:u,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:c}}));return{type:"container",id:"legend-seq-ticks",children:[].concat(X(a),[o])}}(this,o)]};this.state.nodes.push(a)},render:function(){return this.state.nodes}};var Xh={step:function(e){return new at(e,.5)},stepAfter:function(e){return new at(e,1)},stepBefore:function(e){return new at(e,0)},linear:Le,basis:function(e){return new Ue(e)},cardinal:Xe.tension(0),catmullRom:Ge,monotonex:function(e){return new tt(e)},monotoney:function(e){return new nt(e)},natural:function(e){return new it(e)}},Kh={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Gh(e,t){var n=t.generator,r=t.item,i=t.data,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=n(e),s={type:"path",d:a,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:o||r.fill,data:i};return r.strokeDasharray&&(s.strokeDasharray=r.strokeDasharray),s}function Jh(e){var t=function(e){for(var t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain,s=r.width,l=r.height,u=i.resolve({data:t,defaults:Kh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),c=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"===I(n.coordinates.layerId)),h={},f=0,d=0;d<u.items.length;d++){var p=u.items[d],m=p.layerId;if(c){var g=h[m]?h[m].items[h[m].items.length-1]:null,y=g?a.indexOf(g.data.major?g.data.major.value:g.data.value):null;g&&a.indexOf(p.data.major?p.data.major.value:p.data.value)-1!==y&&h[m].items.push({dummy:!0})}h[m]=h[m]||{order:f++,id:m,items:[],dataItems:[],consumableData:{}},h[m].dataItems.push(p.data),h[m].items.push(p)}var v=Object.keys(h).map((function(e){return h[e].consumableData=T({points:h[e].dataItems},h[e].dataItems[0]),h[e]})),b={items:v.map((function(e){return e.consumableData}))},x=n.layers||{};return{coordinates:u,metaLayers:v,layers:i.resolve({data:b,defaults:{curve:Kh.layers.curve,show:Kh.layers.show},settings:{curve:x.curve,show:x.show}}),lines:i.resolve({data:b,defaults:C({},Kh.layers.line,o.line),settings:x.line}),areas:i.resolve({data:b,defaults:C({},Kh.layers.area,o.area),settings:x.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((function(t,n){var l=i.items[n];if(!1!==l.show){l.datum=l.data,l.data=[],l.id=t.id;for(var u,c,h=[],f=[],d=0;d<t.items.length;d++){if(c=(u=t.items[d]).data,!u.dummy){if(isNaN(u.major))continue;e.missingMinor0&&(u.minor0=r.settings.minor.scale?r.settings.minor.scale(c.minor0?c.minor0.value:0):0),isNaN(u.minor)||h.push(u.minor),l.data.push(u.data)}f.push(u)}var p=h.sort((function(e,t){return e-t}))[Math.floor((h.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:p,points:f,consumableData:t.consumableData})}})),s}var Zh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created:function(){},render:function(e){var t=e.data,n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};var o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Jh({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){var s=a.map((function(e){return{id:e.layerObj.id,data:e.layerObj.data}})).sort(this.stngs.layers.sort).map((function(e){return e.id}));a.sort((function(e,t){return s.indexOf(e.layerObj.id)-s.indexOf(t.layerObj.id)}))}else a.sort((function(e,t){return e.median-t.median}));return function(e,t){var n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs,a=[],s=o.layers||{};return e.forEach((function(e){var t,l,u=e.lineObj,c=e.layerObj,h=e.areaObj,f=e.points,d=Fe(),p=o.coordinates?o.coordinates.defined:null,m={size:r,p:"y"},g={size:n,p:"x"};if("vertical"===o.orientation){var y=C(!0,{},g);g=C(!0,{},m),m=C(!0,{},y)}d[g.p]((function(e){return e.major*g.size}))["".concat(m.p,"1")]((function(e){return e.minor*m.size}))["".concat(m.p,"0")]((function(e){return e.minor0*m.size})).curve(Xh["monotone"===c.curve?"monotone".concat(g.p):c.curve]),p?d.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined})):d.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)}));var v=o.connect?f.filter(d.defined()):f;t=d["line".concat(m.p.toUpperCase(),"1")](),l=d["line".concat(m.p.toUpperCase(),"0")](),s.area&&!1!==h.show&&a.push(Gh(v,{data:e.consumableData,item:h,generator:d})),u&&!1!==u.show&&(a.push(Gh(v,{data:e.consumableData,item:u,generator:t},"none")),!i&&s.area&&!1!==h.show&&!1!==u.showMinor0&&a.push(Gh(v,{data:e.consumableData,item:u,generator:l},"none")))})),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function Qh(e,t){var n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"===I(t.center)?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);var o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function ef(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function tf(e,t){var n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}var nf={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaCancel:function(){this.cancel()}},created:function(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:function(){return 0},render:function(){},start:function(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();var t=Qh(this,e,!1);Ss({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}}))}(this.settings),this.state.start=Qh(this,e),this.state.active=!0)},move:function(e){var t;this.state.active&&(this.state.end=Qh(this,e),function(e){if(e.state.active){var t=ef(e,e.state.start),n=ef(e,e.state.end),r=e.chart.shapesAt(tf(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([C({type:"rect"},tf(t.state.start,t.state.end),t.style.area)]))},end:function(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){Array.isArray(e.contexts)&&e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function rf(e,t,n){var r=n.renderer,i=n.style,o=n.props,a=n.h,s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),u=a("div",{dir:o.direction,class:Rh(C({"pic-tooltip":!0},s.tooltip)),style:C({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Rh(C({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Rh(C({"pic-tooltip-arrow":!0},s.arrow)),style:C({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(u),r.element().children[0]}function of(e){var t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1,a=function(){var e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};return e.set=function(e){t[e].forEach((function(t){return t(e)}))},e.on=function(e,n){Array.isArray(e)?e.forEach((function(e){return t[e].push(n)})):t[e].push(n)},e.destroy=function(){Object.keys(t).forEach((function(e){t[e].length=0}))},e}(),s=function(){},l=function(){r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((function(){e(),o=!0,r=null,a.set("active")}),u),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(u,0)))},s.clear=function(){o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=function(e,t){a.on(e,t)},s.destroy=function(){s.clear(),a.destroy()},s}function af(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function sf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function lf(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function uf(e,t,n,r,i,o){var a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function cf(e){var t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset,s=n+a.x,l=r+a.y,u=i,c=o,h=s<0?-s:0,f=l<0?-l:0;return{x:h+=s+u>t.width?-(s+u-t.width):0,y:f+=l+c>t.height?-(l+c-t.height):0}}function hf(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y,l=n.targetBounds,u=af(t.offset),c=u[t.dock];if(c)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c},computedArrowStyle:lf(t.offset)[t.dock],dock:t.dock};for(var h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=sf(r,i,t.offset),d=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s,g=0;g<o.length;g+=1){var y=o[g],v=cf({area:h,vx:p,vy:m,width:r,height:i,offset:f[y]}),b={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u[y]},x=lf(t.offset)[y];0!==v.x&&(b.width="".concat(r-20-Math.abs(v.x),"px"),"top"!==y&&"bottom"!==y||(b.left="".concat(a+v.x,"px"),x.left="calc(50% ".concat(v.x>0?"-":"+"," ").concat(Math.abs(v.x),"px)")));var w={computedTooltipStyle:b,computedArrowStyle:x,dock:y,rect:{width:r,height:i}};if(0===v.x&&0===v.y)return w;w.offset=v,d.push(w)}return d.sort((function(e,t){return Math.abs(e.offset.x)-Math.abs(t.offset.x)})),d[0]}function ff(e,t,n){var r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};var i=r.rect;return C({scaleRatio:i.scaleRatio},i.computedInner)}var df,pf={bounds:function(e){var t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options,s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),u=l.x,c=l.y,h=l.width,f=l.height,d={left:{x:u,y:c+f/2},right:{x:u+h,y:c+f/2},top:{x:u+h/2,y:c},bottom:{x:u+h/2,y:c+f}},p=af(a.offset),m=p[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(d[a.dock].x,"px"),top:"".concat(d[a.dock].y,"px"),transform:m},computedArrowStyle:lf(a.offset)[a.dock],dock:a.dock};for(var g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=sf(i,o,a.offset),v=["top","left","right","bottom"],b=0;b<v.length;b+=1){var x=v[b];if(uf(g,"target"===a.area?d[x].x:s.left+d[x].x,"target"===a.area?d[x].y:s.top+d[x].y,i,o,y[x]))return{computedTooltipStyle:{left:"".concat(d[x].x,"px"),top:"".concat(d[x].y,"px"),transform:p[x]},computedArrowStyle:lf(a.offset)[x],dock:x}}return{computedTooltipStyle:{left:"".concat(d.top.x,"px"),top:"".concat(d.top.y,"px"),transform:p.top},computedArrowStyle:lf(a.offset).top,dock:"top"}},pointer:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height;return hf({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources,s=o[0],l=n.dx,u=n.dy,c=a.getComponentBoundsFromNode(s),h=l+c.x+c.width/2,f=u+c.y+c.height/2,d=s.desc.slice,p=d.start,m=d.end,g=d.outerRadius,y=(p+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v,x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),hf({x:h+g*c.scaleRatio.x*Math.cos(b),y:f+g*c.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function mf(e,t){var n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props,s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:function(e){return ff(e,o.pointer,i)},getNodeBoundsRelativeToTarget:function(e){return function(e,t,n){var r=ff(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)}},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=I(a.placement);if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);var u={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(u=C(u,a.placement(s))),"object"===l&&pf[a.placement.type]?u=C(u,a.placement):"string"===l&&pf[a.placement]&&(u=C(u,{type:a.placement})),s.options=u;var c=pf[u.type](s),h=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=h.x,d=h.y,p=h.width,m=h.height;return p+=f+=s.pointer.dx,m+=d+=s.pointer.dy,c.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(c.computedTooltipStyle.left)),p),"px"),c.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(c.computedTooltipStyle.top)),m),"px"),c}function gf(){df=null}function yf(e,t){var n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);var a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,u=o,c=a.left-s.left,h=a.top-s.top,f=i-a.left,d=o-a.top;return{x:i-=s.left,y:o-=s.top,dx:c,dy:h,cx:f,cy:d,clientX:l,clientY:u,targetBounds:s,chartBounds:a}}var vf={require:["chart","renderer"],defaultSettings:{settings:{duration:8e3,delay:500,filter:function(e){return e.filter((function(e){return e.data&&void 0!==e.data.value}))},extract:function(e){return e.node.data.value},content:function(e){var t=e.h;return e.data.map((function(e){return t("div",{},e)}))},isEqual:function(e,t){return e.length&&e.length===t.length&&e.every((function(e,n){return t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)}))},placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0},style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide:function(){this.hide()},show:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent:function(e){this.prevent(e)}},hide:function(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.nodes,o=r.duration,a=r.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=yf(e,this),t=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((function(){return n.invokeRenderer(n.state.activeNodes)}),o,a)))},prevent:function(e){this.state.prevent=!!e},init:function(e){var t=this;this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=of({defaultDuration:this.props.duration,defaultDelay:this.props.delay});var n=this.dispatcher.clear;this.dispatcher.on("pending",(function(){!function(e){df&&df!==e&&df()}(n),df=n,"function"==typeof t.props.beforeShow&&t.props.beforeShow.call(void 0,{resources:{formatter:t.chart.formatter,scale:t.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(function(){var e={resources:{formatter:t.chart.formatter,scale:t.chart.scale}};"function"==typeof t.props.beforeHide&&t.props.beforeHide.call(void 0,C({element:t.state.tooltipElm},e)),"function"==typeof t.props.onHide?t.props.onHide.call(void 0,C({element:t.state.tooltipElm},e)):t.renderer.clear([]),"function"==typeof t.props.afterHide&&t.props.afterHide.call(void 0,e),df===n&&(df=null),t.state.tooltipElm=void 0})),this.dispatcher.on("active",(function(){"function"==typeof t.props.afterShow&&t.props.afterShow.call(void 0,{element:t.state.tooltipElm,resources:{formatter:t.chart.formatter,scale:t.chart.scale}})}))},created:function(){this.init(this.settings)},beforeUpdate:function(e){var t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),gf()),this.init(t)},render:function(e){return this.h=e,[]},beforeDestroy:function(){this.dispatcher.destroy(),gf()},appendTo:function(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;var e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted:function(){this.appendTo()},updated:function(){this.appendTo()},invokeRenderer:function(e){var t=function(e,t){var n=t.chart,r=t.scale,i=t.props,o=t.h,a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((function(e){if("function"==typeof i.extract){var t=C({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=mf(rf(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=rf(t,n,this)}};var bf={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes(this.props.selector).filter((function(t){return t.key===e.props.target})).filter((function(e){return e.collider})).map((function(e){return e.collider}));t.forEach((function(t){t.fill=e.props.fill,t.stroke=e.props.stroke,t.opacity=e.props.opacity,t.collider={type:null}})),this.renderer.render(t)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}},xf=2*Math.PI;function wf(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}function qf(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Mf(e,t,n,r,i){var o=1-e;return Math.pow(o,3)*t+3*Math.pow(o,2)*e*n+3*o*Math.pow(e,2)*r+Math.pow(e,3)*i}function Df(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||wf(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;var a=.5,s=qf(e,t),l=qf(t,n),u=qf(n,r),c={x:Mf(a,e.x,t.x,n.x,r.x),y:Mf(a,e.y,t.y,n.y,r.y)},h=qf(s,l),f=qf(l,u);return Df(e,s,h,c,i,o-1),Df(c,f,u,r,i,o-1),i}function kf(e,t,n){var r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Df(e,r.cp1,r.cp2,n)}function Sf(e,t,n){var r,i,o,a,s=[],l=!!e[4],u=!!e[5],c=e[3],h=e[6],f=e[7],d=e[1],p=e[2];if("a"===e[0]&&(h+=t,f+=n),t===f&&n===f)return s;if(!d||!p)return s.push({x:h,y:f}),s;var m=function(e,t,n,r,i,o,a,s,l){var u,c,h,f,d,p,m=Ha(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;e=Math.abs(e),t=Math.abs(t),(p=Math.pow(x,2)/Math.pow(e,2)+Math.pow(w,2)/Math.pow(t,2))>1&&(e*=p=Math.sqrt(p),t*=p);var q=e*t,M=e*w,D=t*x,k=Math.pow(M,2)+Math.pow(D,2),S=Math.pow(q,2)-k,_=Math.sqrt(Math.max(S/k,0));r===i&&(_=-_);var C=_*(M/t),E=_*(-D/e);f=g*C-y*E+(s+o)/2,d=y*C+g*E+(l+a)/2;var A=(x-C)/e,T=(w-E)/t,I=(-x-C)/e,R=(-w-E)/t;return u=Math.atan2(T,A),u+=u<0?xf:0,c=Math.atan2(R,I),h=(c+=c<0?xf:0)-u,!i&&u<c?h-=xf:i&&c<u&&(h+=xf),{startAngle:u,sweepAngle:h%=xf,cx:f,cy:d,rx:e,ry:t}}(d,p,c,l,u,h,f,t,n);r=m.cx,i=m.cy,d=m.rx,p=m.ry,o=m.sweepAngle,a=m.startAngle;for(var g=Math.abs(o*Math.sqrt((Math.pow(d,2)+Math.pow(p,2))/2)),y=Math.ceil(g/10),v=o/y,b=1;b<=y;b++){var x=(a+v*b)%xf,w=Math.cos(x),q=Math.sin(x);s.push({x:r+w*d+-q*w,y:i+q*p+w*q})}return s}function _f(e){for(var t=b.parsePath(e),n=[],r=[],i=0,o=0,a=null,s=null,l=null,u=null,c=0;c<t.length;++c){var h=t[c],f=h[0];switch("S"!==f&&"s"!==f&&"C"!==f&&"c"!==f&&(a=null,s=null),"T"!==f&&"t"!==f&&"Q"!==f&&"q"!==f&&(l=null,u=null),f){case"m":r.length&&n.push(r.splice(0));case"l":i+=h[1],o+=h[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=h[1],o=h[2],r.push({x:i,y:o});break;case"H":i=h[1],r.push({x:i,y:o});break;case"h":i+=h[1],r.push({x:i,y:o});break;case"V":o=h[1],r.push({x:i,y:o});break;case"v":o+=h[1],r.push({x:i,y:o});break;case"a":r.push.apply(r,X(Sf(h,i,o))),i+=h[6],o+=h[7];break;case"A":r.push.apply(r,X(Sf(h,i,o))),i=h[6],o=h[7];break;case"c":r.push.apply(r,X(Df({x:i,y:o},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o},{x:h[5]+i,y:h[6]+o}))),a=h[3]+i,s=h[4]+o,i+=h[5],o+=h[6];break;case"C":r.push.apply(r,X(Df({x:i,y:o},{x:h[1],y:h[2]},{x:h[3],y:h[4]},{x:h[5],y:h[6]}))),a=h[3],s=h[4],i=h[5],o=h[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Df({x:i,y:o},{x:2*i-a,y:2*o-s},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o}))),a=h[1]+i,s=h[2]+o,i+=h[3],o+=h[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Df({x:i,y:o},{x:2*i-a,y:2*o-s},{x:h[1],y:h[2]},{x:h[3],y:h[4]}))),a=h[1],s=h[2],i=h[3],o=h[4];break;case"Q":r.push.apply(r,X(kf({x:i,y:o},{x:h[1],y:h[2]},{x:h[3],y:h[4]}))),l=h[1],u=h[2],i=h[3],o=h[4];break;case"q":r.push.apply(r,X(kf({x:i,y:o},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o}))),l=h[1]+i,u=h[2]+o,i+=h[3],o+=h[4];break;case"T":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(kf({x:i,y:o},{x:l,y:u},{x:h[1],y:h[2]}))),i=h[1],o=h[2];break;case"t":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(kf({x:i,y:o},{x:l,y:u},{x:h[1]+i,y:h[2]+o}))),i+=h[1],o+=h[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}var Cf={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes("path").filter((function(t){return t.key===e.props.target})),n=[];t.forEach((function(t){_f(t.attrs.d).forEach((function(t){t.forEach((function(t){n.push({type:"circle",cx:t.x,cy:t.y,r:e.props.radius,fill:e.props.fill,stroke:e.props.stroke,opacity:e.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(n)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}};var Ef=[function(e){e.component("box",zl),e.component("box-marker",zl)},function(e){e.component("point",$l),e.component("point-marker",$l)},function(e){e.component("pie",Gl)},function(e){e.component("grid-line",tu)},function(e){e.component("ref-line",lu)},function(e){e.component("axis",Au)},function(e){e.component("container",Tu)},function(e){e.component("text",Nu)},function(e){e.component("scrollbar",Lu)},function(e){e.component("brush-range",Zu),e.component("brush-area-dir",tc)},function(e){e.component("range",oc)},function(e){e.component("brush-lasso",hc)},function(e){e.component("labels",Ch)},function(e){e.component("legend-cat",Hh)},function(e){e.component("legend-seq",Yh)},function(e){e.component("line",Zh)},function(e){e.component("brush-area",nf)},function(e){e.component("tooltip",vf)},function(e){e.component("debug-collider",bf)},function(e){e.component("debug-path-to-points",Cf)}],Af=function(){function e(t){R(this,e),this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}return O(e,[{key:"detach",value:function(){return this._parent&&this._parent.removeChild(this),this}},{key:"parent",get:function(){return this._parent}},{key:"isBranch",get:function(){return this._children&&this._children.length}},{key:"children",get:function(){return this._children}},{key:"ancestors",get:function(){var e;this._ancestors||(this._ancestors=[],this.parent&&(e=this._ancestors).push.apply(e,[this.parent].concat(X(this.parent.ancestors))));return this._ancestors}},{key:"descendants",get:function(){var e,t,n=[],r=this.children.length;for(e=0;e<r;e++)t=this.children[e],n.push(t),t.children.length&&(n=[].concat(X(n),X(t.descendants)));return n}},{key:"equals",value:function(e){var t=this.children,n=e.children;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(n[r]))return!1;return!0}},{key:"toJSON",value:function(){return{type:this.type,children:this.children.map((function(e){return e.toJSON()}))}}}]),e}(),Tf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,l=t.height,u=void 0===l?0:l,c=t.minWidth,h=void 0===c?0:c,f=t.minHeight,d=void 0===f?0:f;R(this,e),this.set({x:r,y:o,width:s,height:u,minWidth:h,minHeight:d})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,u=e.minWidth,c=void 0===u?0:u,h=e.minHeight,f=void 0===h?0:h;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,c)):(this.x=n+Math.min(a,-c),this.width=-Math.min(a,-c)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}},{key:"containsPoint",value:function(e){return Ss(this,e)}},{key:"intersectsLine",value:function(e){return _s(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ds(this,re(e))}},{key:"intersectsCircle",value:function(e){return vs(e,this)}},{key:"intersectsPolygon",value:function(e){return Ms(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Os(e,this)}},{key:"points",value:function(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}]),e}();var If=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a,l=t.minRadius,u=void 0===l?0:l;R(this,e),this.set({cx:r,cy:o,r:s,minRadius:u})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}},{key:"containsPoint",value:function(e){return ys(this,e)}},{key:"intersectsLine",value:function(e){return bs(this,ie(e))}},{key:"intersectsRect",value:function(e){return vs(this,re(e))}},{key:"intersectsCircle",value:function(e){return function(e,t){if(ds(e)||ds(t))return!1;var n=e.cx-t.cx,r=e.cy-t.cy;return Math.pow(n,2)+Math.pow(r,2)<=Math.pow(e.r+t.r,2)}(this,e)}},{key:"intersectsPolygon",value:function(e){return xs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Is(this,e)}},{key:"points",value:function(){return[{x:this.cx,y:this.cy}]}}]),e}();var Rf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x1,r=void 0===n?0:n,i=t.y1,o=void 0===i?0:i,a=t.x2,s=void 0===a?0:a,l=t.y2,u=void 0===l?0:l,c=t.tolerance,h=void 0===c?0:c;R(this,e),this.set({x1:r,y1:o,x2:s,y2:u,tolerance:h})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,u=e.tolerance,c=void 0===u?0:u;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(c)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}},{key:"containsPoint",value:function(e){return this.tolerance>0?bs({cx:e.x,cy:e.y,r:this.tolerance},this):Es(this,e)}},{key:"intersectsLine",value:function(e){return Cs(this,ie(e))}},{key:"intersectsRect",value:function(e){return _s(re(e),this)}},{key:"intersectsCircle",value:function(e){return bs(e,this)}},{key:"intersectsPolygon",value:function(e){return qs(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Ns(e,this)}},{key:"points",value:function(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}]),e}();function Nf(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Of(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var Pf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[]:n;R(this,e),this.set({vertices:r})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;if(this.type="polygon",this.vertices=n.slice(),this.edges=[],Of(this.vertices),!(this.vertices.length<=2)){Nf(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.vertices.length;r++)r<this.vertices.length-1&&this.edges.push([this.vertices[r],this.vertices[r+1]]),this.xMin=isNaN(this.xMin)?this.vertices[r].x:Math.min(this.xMin,this.vertices[r].x),this.xMax=isNaN(this.xMax)?this.vertices[r].x:Math.max(this.xMax,this.vertices[r].x),this.yMin=isNaN(this.yMin)?this.vertices[r].y:Math.min(this.yMin,this.vertices[r].y),this.yMax=isNaN(this.yMax)?this.vertices[r].y:Math.max(this.yMax,this.vertices[r].y);this._bounds=null,this._boundingRect=null}}},{key:"containsPoint",value:function(e){return ws(this,e)}},{key:"intersectsCircle",value:function(e){return xs(e,this)}},{key:"intersectsLine",value:function(e){return qs(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ms(this,re(e))}},{key:"intersectsPolygon",value:function(e){return As(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Ts(e,this)}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Pf,t)}function jf(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function zf(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var Ff=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[[]]:n;R(this,e),this.set({vertices:r})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;this.type="geopolygon",this.vertices=n.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.numPolygons;r++)zf(this.vertices[r]),this.vertices[r].length>2&&jf(this.vertices[r]),this.polygons[r]=Lf({vertices:this.vertices[r]}),this.xMin=isNaN(this.xMin)?this.polygons[r].xMin:Math.min(this.xMin,this.polygons[r].xMin),this.xMax=isNaN(this.xMax)?this.polygons[r].xMax:Math.max(this.xMax,this.polygons[r].xMax),this.yMin=isNaN(this.yMin)?this.polygons[r].yMin:Math.min(this.yMin,this.polygons[r].yMin),this.yMax=isNaN(this.yMax)?this.polygons[r].yMax:Math.max(this.yMax,this.polygons[r].yMax);this._bounds=null,this._boundingRect=null}},{key:"containsPoint",value:function(e){return Rs(this,e)}},{key:"intersectsCircle",value:function(e){return Is(e,this)}},{key:"intersectsLine",value:function(e){return Ns(this,ie(e))}},{key:"intersectsRect",value:function(e){return Os(this,re(e))}},{key:"intersectsPolygon",value:function(e){return Ts(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return n=e,r=(t=this).boundingRect(),i=n.boundingRect(),!!Ds(r,i)&&(ks(i,r)?gs(n,t):gs(t,n));var t,n,r,i}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Hf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Ff,t)}function Bf(e,t){return e.x!==t.x||e.y!==t.y}var Vf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.points,r=void 0===n?[]:n;R(this,e),this.set({points:r})}return O(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.points,n=void 0===t?[]:t;if(this.type="polyline",this.segments=[],this._points=n.slice(),this._points.length>1)for(var r=0,i=this._points.length-1;r<i;r++)Bf(this._points[r],this._points[r+1])&&this.segments.push({x1:this._points[r].x,y1:this._points[r].y,x2:this._points[r+1].x,y2:this._points[r+1].y})}},{key:"containsPoint",value:function(e){return this.segments.some((function(t){return Es(t,e)}))}},{key:"intersectsCircle",value:function(e){return this.segments.some((function(t){return bs(e,t)}))}},{key:"intersectsLine",value:function(e){var t=ie(e);return this.segments.some((function(e){return Cs(e,t)}))}},{key:"intersectsRect",value:function(e){var t=re(e);return this.segments.some((function(e){return _s(t,e)}))}},{key:"intersectsPolygon",value:function(e){return this.segments.some((function(t){return qs(e,t)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.segments.some((function(t){return Ns(e,t)}))}},{key:"points",value:function(){return this._points}}]),e}();var Wf=ft();function Uf(e,t){return Wf.get(e)(t)}Wf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Tf,t)})),Wf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(If,t)})),Wf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Rf,t)})),Wf.add("polygon",Lf),Wf.add("geopolygon",Hf),Wf.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Vf,t)}));var $f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,e),this.set(t)}return O(e,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((function(t){var n=Uf(t.type,t);n&&e.geometries.push(n)}))}},{key:"containsPoint",value:function(e){return this.geometries.some((function(t){return t.containsPoint(e)}))}},{key:"intersectsLine",value:function(e){return this.geometries.some((function(t){return t.intersectsLine(e)}))}},{key:"intersectsRect",value:function(e){return this.geometries.some((function(t){return t.intersectsRect(e)}))}},{key:"intersectsCircle",value:function(e){return this.geometries.some((function(t){return t.intersectsCircle(e)}))}},{key:"intersectsPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsPolygon(e)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsGeoPolygon(e)}))}}]),e}();var Yf=function(){function e(){R(this,e),this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}return O(e,[{key:"clone",value:function(){return(new e).multiply(this)}},{key:"set",value:function(e){return this._elements=e,this}},{key:"save",value:function(){return this._stack.push(this.elements),this}},{key:"restore",value:function(){return this._stack.length&&(this._elements=this._stack.pop()),this}},{key:"add",value:function(e){var t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}},{key:"translate",value:function(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}},{key:"rotate",value:function(e){var t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}},{key:"multiply",value:function(t){var n,r,i,o;if(t instanceof e&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)for(o=0;o<3;o++)i[n][r]+=this._elements[n][o]*t[o][r];this._elements=i}else for(n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)this._elements[n][r]*=t;return this}},{key:"scale",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}},{key:"transform",value:function(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}},{key:"determinant",value:function(){var e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2];return e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s}},{key:"invert",value:function(){var e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],u=this._elements[2][2];return this._elements=[[o*u-a*l,r*l-n*u,n*a-r*o],[a*s-i*u,t*u-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}},{key:"transpose",value:function(){var e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}},{key:"identity",value:function(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}},{key:"toString",value:function(){return"".concat(this._elements.map((function(e){return e.join("\t")})).join("\n"))}},{key:"isIdentity",value:function(){var e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}},{key:"transformPoint",value:function(e){var t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}},{key:"transformPoints",value:function(e){var t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}},{key:"elements",get:function(){var e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}]),e}(),Xf=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Kf(e,t){var n=t.args[0]*(Math.PI/180);if(t.args.length>2){var r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Gf(e,t){var n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Jf(e,t){var n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Zf(e,t){t.args.length>=6&&e.transform.apply(e,X(t.args))}function Qf(e,t){for(var n,r=function(e){for(var t,n=[];null!==(t=Xf.exec(e));){var r=t[2].trim(),i=-1===r.indexOf(",")?r.split(" "):r.split(",");n.push({cmd:t[1],args:i.filter((function(e){return e.trim().length>0})).map((function(e){return Number(e)}))})}return n}(e),i=0,o=r.length;i<o;i++)"rotate"===(n=r[i]).cmd?Kf(t,n):"scale"===n.cmd?Gf(t,n):"matrix"===n.cmd?Zf(t,n):"translate"===n.cmd&&Jf(t,n)}var ed={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},td={type:function(e,t){return t.filter((function(t){var n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}))},attr:function(e,t,n,r){return r.filter((function(r){var i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}))},universal:function(e){return e},tag:function(e,t){return t.filter((function(t){var n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))}};var nd={find:function(e,t){var n,r,i=[],o=[];if(t.isBranch){var a;n=function(e){var t,n,r,i,o=[];return e.split(/\s*,\s*/).forEach((function(e){e=e.trim(),t=[];for(var a=function(o){(r=e.match(ed[o]))&&(i=!0,e=e.slice(r[0].length),n={type:o,value:r[0]},"attr"===o&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),n.attribute=r[1],n.operator=r[2],n.attributeValue=r[3]),t.push(n))};e&&(i=!1,(r=e.match(/^\s*([>+~]|\s)\s*/))&&(i=!0,t.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(ed).forEach(a),t&&t.length&&o.indexOf(t)<0&&o.push(t),i););})),o}(e),r=t.descendants;for(var s=function(e,t){a=n[e];var i=[],s=r.slice(),l=!1;a.reverse().forEach((function(e){if(" "===e.type)return i.push(s),s=r.slice(),void(l=!1);s=function(e,t){if(!t||!t.length||!e||"function"!=typeof td[e.type])return[];switch(e.type){case"type":return td[e.type](e.value,t);case"attr":return td[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return td[e.type](t);case"tag":return td[e.type](e.value,t);default:return[]}}(e,s),l=!0})),l&&i.push(s);var u=i[0].filter((function(e){for(var t,n=e.parent,r=1;r<i.length;r++){for(t=i[r].indexOf(n);n&&t<0;)n=n.parent,t=i[r].indexOf(n);if(t<0)return!1}return!0}));o.push(u)},l=0,u=n.length;l<u;l++)s(l);for(var c=0,h=o.length;c<h;c++)for(var f=0,d=o[c].length;f<d;f++)i.indexOf(o[c][f])<0&&i.push(o[c][f])}return i||[]}};function rd(e,t,n){var r=e.type,i=e.points();n&&(i=i.every((function(e){return Array.isArray(e)}))?i.map((function(e){return n.transformPoints(e)})):n.transformPoints(i)),function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);var o=null;if("rect"===r||"bounds"===r)(o=re(i)).type=r;else if("circle"===r)(o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r)).type=r;else if("line"===r)(o=ie(i)).type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:za(i,"polygon"===r)}}else if("geopolygon"===r){for(var a="",s=0;s<i.length;s++)a+=za(i[s],!0);o={type:"path",d:a}}return o}var id=function(){function e(t){var n=this;R(this,e),this._bounds=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0},r=n.x,i=n.y,o=n.width,a=n.height;return{x:r,y:i,width:o,height:a}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=function(){return function(e,t){if(e.collider){var n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((function(e){return rd(e,t,n)}))}:rd(e.collider,t,n)}return null}(t,n._dpi)},this._desc=t.desc,this._tag=t.tag,this._children=function(){return t.children.map((function(t){return new e(t)}))},this._parent=function(){return t.parent?new e(t.parent):null},this._cache={elementBoundingRect:null},this._getElementBoundingRect=function(){return!n._cache.elementBoundingRect&&n.element&&(n._cache.elementBoundingRect=n.element.getBoundingClientRect()),n._cache.elementBoundingRect||{left:0,top:0}}}return O(e,[{key:"children",get:function(){return this._children()}},{key:"parent",get:function(){return this._parent()}},{key:"type",get:function(){return this._type}},{key:"data",get:function(){return this._data}},{key:"attrs",get:function(){return this._attrs}},{key:"element",get:function(){return this._element},set:function(e){this._cache.elementBoundingRect=null,this._element=e}},{key:"key",get:function(){return this._key},set:function(e){this._key=e}},{key:"bounds",get:function(){var e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}},{key:"localBounds",get:function(){return this._bounds(!1)}},{key:"boundsRelativeTo",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=I(e),r=t?this.bounds:this.localBounds,i=this._getElementBoundingRect(),o=i.left,a=i.top;if("object"===n&&null!==e&&"function"==typeof e.getBoundingClientRect){var s=e.getBoundingClientRect(),l=s.left,u=void 0===l?0:l,c=s.top,h=void 0===c?0:c;o-=u,a-=h}return r.x+=o,r.y+=a,r}},{key:"collider",get:function(){return this._collider()}},{key:"desc",get:function(){return this._desc}},{key:"tag",get:function(){return this._tag}}]),e}();function od(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(id,t)}var ad=function(){function e(t){R(this,e),this._node=od(t),this._parent=null,this._input=null}return O(e,[{key:"node",get:function(){return this._node}},{key:"parent",get:function(){return this._parent},set:function(e){this._parent=e}},{key:"input",get:function(){return this._input},set:function(e){this._input=e}}]),e}();function sd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(ad,t)}function ld(e,t){var n=e.parent;if(n&&"stage"!==n.type){t.parent=sd(n);var r=n.parent;r&&"stage"!==r.type&&ld(r,t.parent)}}function ud(e,t,n){if(null===e.colliderType)return null;var r=function(e,t){var n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{var r={x:t.cx,y:t.cy},i=e.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((function(e){return Array.isArray(e)}))?Hf(n):Lf(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(var r=e.descendants.length-1;r>=0;r--){var i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){var o=sd(i);return ld(i,o),o}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){var r=sd(e);return ld(e,r),r}return null}(e,t,r)}function cd(e,t,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o],s=ud(a,t,r);s&&n.push(s),!a.children||s||a.collider||cd(a.children,t,n,r)}}function hd(e,t,n){for(var r=e.length,i=0;i<r;i++){var o=e[i];if(null!==ud(o,t,n))return!0;if(o.children&&!o.collider)return hd(o.children,t,n)}return!1}function fd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=oe(e),r={};switch(n){case"circle":return r.cx=e.cx*t,r.cy=e.cy*t,r.r=e.r,["intersectsCircle",r];case"rect":return["intersectsRect",r=ne(e).map((function(e){return Ua(e,t)}))];case"line":return["intersectsLine",r=te(e).map((function(e){return Ua(e,t)}))];case"point":return["containsPoint",r=Ua(e,t)];case"polygon":return r.vertices=e.vertices.map((function(e){return Ua(e,t)})),["intersectsPolygon",r];case"geopolygon":return r.vertices=e.vertices.map((function(e){return e.map((function(e){return Ua(e,t)}))})),["intersectsGeoPolygon",r];default:return[]}}function dd(e,t){var n=Y(fd(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(cd([e],r,o,i),function(e,t){for(var n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function pd(e,t){var n=Y(fd(t,e.dpi),2);return hd([e],n[0],n[1])}var md=function(e){L(n,e);var t=W(n);function n(e){var r;return R(this,n),(r=t.call(this,e))._stage=null,r._collider={type:null,definition:null,fn:null},r._attrs={},r._node=null,r}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;var t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;ja(this.attrs,e),void 0!==t&&(this.data=t),"object"===I(n)&&(this.desc=C(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}},{key:"findShapes",value:function(e){return nd.find(e,this).map((function(e){return od(e)}))}},{key:"getItemsFrom",value:function(e){return dd(this,e)}},{key:"containsPoint",value:function(e){return pd(this,e)}},{key:"intersectsLine",value:function(e){return pd(this,e)}},{key:"intersectsRect",value:function(e){return pd(this,e)}},{key:"intersectsCircle",value:function(e){return pd(this,e)}},{key:"intersectsPolygon",value:function(e){return pd(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return pd(this,e)}},{key:"resolveLocalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf;void 0!==this.attrs.transform&&Qf(this.attrs.transform,e),this.modelViewMatrix=e.clone()}},{key:"resolveGlobalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf,t=this.ancestors;if(t.length>0)for(var n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}},{key:"attr",value:function(e){return this.attrs[e]}},{key:"equals",value:function(e){var t=this.attrs,r=Object.keys(t),i=e.attrs,o=Object.keys(i);if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++){var s=r[a];if(!Object.hasOwnProperty.call(i,s))return!1;if(t[s]!==i[s])return!1}return $(j(n.prototype),"equals",this).call(this,e)}},{key:"toJSON",value:function(){var e=$(j(n.prototype),"toJSON",this).call(this);return e.attrs=this.attrs,e}},{key:"attrs",get:function(){return this._attrs}},{key:"stage",get:function(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}},{key:"modelViewMatrix",get:function(){return this._mvm},set:function(e){this._mvm=e,this._imvm=null}},{key:"inverseModelViewMatrix",get:function(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}},{key:"node",get:function(){return this._node},set:function(e){this._node=e}},{key:"collider",get:function(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H($f,t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Uf("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Uf(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn},set:function(e){var t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}},{key:"colliderType",get:function(){return this._collider.type}}]),n}(Af),gd=function(e){L(n,e);var t=W(n);function n(){return R(this,n),t.apply(this,arguments)}return O(n,[{key:"addChild",value:function(e){if(!(e&&e instanceof Af))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}},{key:"addChildren",value:function(e){var t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}},{key:"removeChildren",value:function(e){var t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}]),n}(Af),yd=gd.prototype,vd=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(j(n.prototype),"set",this).call(this,e);var t=e.collider,r=C({type:null},t);this.collider=r,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"appendChildRect",value:function(e,t){if(void 0!==e.bounds){var n=this.__boundingRect[t]||{},r=Y(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,u=o.y,c=isNaN(n.width)?l:Math.max(l,n.width+n.x),h=isNaN(n.height)?u:Math.max(u,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=h-n.y,this.__boundingRect[t]=n}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];for(var t=this.children.length,n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=C({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}},{key:"addChild",value:function(e){var t=yd.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);var n=C({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=n}return t}},{key:"addChildren",value:function(e){var t=yd.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(var r=0;r<n;r++)this.appendChildRect(e[r],!0);var i=C({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=i}return t}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(yd.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var i=C(this.boundingRect(!0),{type:"bounds"});this.collider=i}return this}},{key:"removeChildren",value:function(e){if(yd.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var t=C(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}]),n}(md);function bd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(vd,t)}var xd=function(e){L(n,e);var t=W(n);function n(e){var r;return R(this,n),(r=t.call(this,"stage"))._stage=B(r),r._dpiRatio=e||1,r}return O(n,[{key:"dpi",get:function(){return this._dpiRatio}}]),n}(vd);var wd=gd.prototype,qd=["x1","x2","y1","y2","id","offset","style"],Md=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(j(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=qd.length;i!==o;i++)void 0!==e[r=qd[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return wd.addChild.call(this,e)}},{key:"addChildren",value:function(e){return wd.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return wd.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return wd.removeChildren.call(this,e),this}}]),n}(md);function Dd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Md,t)}var kd=gd.prototype,Sd=["patternUnits","x","y","width","height","id"],_d=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(j(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=Sd.length;i!==o;i++)void 0!==e[r=Sd[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return kd.addChild.call(this,e)}},{key:"addChildren",value:function(e){return kd.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return kd.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return kd.removeChildren.call(this,e),this}}]),n}(md);var Cd=function(e){L(n,e);var t=W(n);function n(){var e,r;return R(this,n),(e=r=t.call(this,"rect")).set.apply(e,arguments),r}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.width,s=void 0===a?0:a,l=e.height,u=void 0===l?0:l,c=e.rx,h=void 0===c?0:c,f=e.ry,d=void 0===f?0:f,p=e.collider,m=C({type:"rect",x:r,y:o,width:s,height:u},p);$(j(n.prototype),"set",this).call(this,e),s>=0?(this.attrs.x=r,this.attrs.width=s):(this.attrs.x=r+s,this.attrs.width=-s),u>=0?(this.attrs.y=o,this.attrs.height=u):(this.attrs.y=o+u,this.attrs.height=-u),h>0&&(this.attrs.rx=h),d>0&&(this.attrs.ry=d),this.collider=m,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=ne(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(md);var Ed=function(e){L(n,e);var t=W(n);function n(){var e,r;return R(this,n),(e=r=t.call(this,"circle")).set.apply(e,arguments),r}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,r=void 0===t?0:t,i=e.cy,o=void 0===i?0:i,a=e.r,s=void 0===a?0:a,l=e.collider,u=C({type:"circle",cx:r,cy:o,r:s},l);$(j(n.prototype),"set",this).call(this,e),this.attrs.cx=r,this.attrs.cy=o,this.attrs.r=s,this.collider=u,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o,l=2*i,u=2*o,c=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+u},{x:a,y:s+u}];if(e&&this.modelViewMatrix){var h=ee(c=this.modelViewMatrix.transformPoints(c)),f=Y(h,4),d=f[0],p=f[1],m=f[2],g=f[3];l=m-d,u=g-p,this.__bounds[e]=[{x:d,y:p},{x:d+l,y:p},{x:d+l,y:p+u},{x:d,y:p+u}]}else this.__bounds[e]=c;return this.__bounds[e]}}]),n}(md);var Ad=function(e){L(n,e);var t=W(n);function n(){var e,r;return R(this,n),(e=r=t.call(this,"line")).set.apply(e,arguments),r}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,r=void 0===t?0:t,i=e.y1,o=void 0===i?0:i,a=e.x2,s=void 0===a?0:a,l=e.y2,u=void 0===l?0:l,c=e.collider;$(j(n.prototype),"set",this).call(this,e),this.attrs.x1=r,this.attrs.y1=o,this.attrs.x2=s,this.attrs.y2=u;var h={type:"line",x1:r,y1:o,x2:s,y2:u};this.collider=C(h,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=te(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));var n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=i!==a||o!==s;return this.__boundingRect[e]={x:i,y:o,width:l?Math.max(1,a-i):0,height:l?Math.max(1,s-o):0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(md);var Td=Math.PI/2;function Id(e,t){var n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Rd(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Nd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=[];if("h"===n.forceOrientation){var o=e[0].x<e[1].x?-1:1,a=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+o,y:e[0].y}),e.push({x:e[e.length-1].x+a,y:e[e.length-1].y})}else if("v"===n.forceOrientation){var s=e[0].y<e[1].y?-1:1,l=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+s}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+l})}for(var u=e.length-1,c=1;c<u;c++){var h=e[c-1],f=e[c],d=e[c+1],p=Id(f,h),m=Id(f,d),g=(p+m)/2,y=g+Math.PI,v=Math.max(g,y),b=Math.min(g,y),x=p>m;if(1===c){var w=Id(h,f);r.push(Rd(h,w-Td,t)),i.unshift(Rd(h,w+Td,t))}var q=x?v:b,M=x?b:v;if(r.push(Rd(f,q,t)),i.unshift(Rd(f,M,t)),c===u-1){var D=Id(d,f);r.push(Rd(d,D+Td,t)),i.unshift(Rd(d,D-Td,t))}}return{type:"polygon",vertices:[].concat(r,i)}}function Od(e){for(var t,n=[],r=e.length,i=0;i<r;i++){t=e[i];for(var o=0;o<t.length;o++)n.push(t[o])}return n}function Pd(e){if(e.length<2)return!1;var t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}var Ld=function(e){L(n,e);var t=W(n);function n(){var e,r;return R(this,n),(e=r=t.call(this,"path")).set.apply(e,arguments),r}return O(n,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if($(j(n.prototype),"set",this).call(this,t),this.segments=[],this.points=[],t.arcDatum){var r=Oe();r.innerRadius(t.desc.slice.innerRadius),r.outerRadius(t.desc.slice.outerRadius),r.cornerRadius(t.desc.slice.cornerRadius);var i=r(t.arcDatum);this.attrs.d=i}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"===I(t.collider)&&void 0!==t.collider.type)this.collider=t.collider;else if(t.arcDatum||t.d){if(this.segments=_f(this.attrs.d),this.segments.length>1&&this.segments.every((function(e){return Pd(e)})))return void(this.collider=C({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((function(n){if(n.length<=1);else if(Pd(n))e.collider=C({type:"polygon",vertices:n},t.collider);else if("object"===I(t.collider)&&t.collider.visual){var r=e.attrs["stroke-width"]/2;e.collider=Nd(n,r,t.collider)}else e.collider=C({type:"polyline",points:n},t.collider)}))}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:_f(this.attrs.d),this.points=Od(this.segments));var t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[e]={x:i||0,y:o||0,width:a-i||0,height:s-o||0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(md);function jd(e){var t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}var zd=function(e){L(n,e);var t=W(n);function n(){var e,r;return R(this,n),(e=r=t.call(this,"text")).set.apply(e,arguments),r}return O(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.dx,s=void 0===a?0:a,l=e.dy,u=void 0===l?0:l,c=e.textBoundsFn,h=e.text,f=e.title,d=e.collider,p=e.boundingRect,m=e.ellipsed;$(j(n.prototype),"set",this).call(this,e),this.attrs.x=r,this.attrs.y=o,this.attrs.dx=s,this.attrs.dy=u,this.attrs.text=h,void 0!==f&&(this.attrs.title=String(f)),"object"===I(p)?this._textBoundsFn=function(){return p}:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof m&&(this.ellipsed=m),this.collider=C({type:jd(this)?"bounds":null},d),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};var t=ne(this._textBoundsFn(this.attrs)),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(md);var Fd=ft();function Hd(e,t){return Fd.get(e)(t)}Fd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Cd,t)})),Fd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Ed,t)})),Fd.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(zd,t)})),Fd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Ad,t)})),Fd.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Ld,t)})),Fd.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(xd,t)})),Fd.add("container",bd),Fd.add("defs",bd),Fd.add("linearGradient",Dd),Fd.add("radialGradient",Dd),Fd.add("stop",Dd),Fd.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(_d,t)}));var Bd=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[{}];function n(){return t[t.length-1]}return n.save=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n(),o={},a="",s=0;s<e.length;s++)void 0!==i[a=e[s]]&&(o[a]=i[a]);return C(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Vd(e,t){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)t[n](e)}function Wd(e,t,n){e.node=n[t],e.index=t}function Ud(e,t,n,r){for(var i={siblings:e,node:null,index:0},o=0,a=e.length;o<a;o++)if(Wd(i,o,e),Vd(i,r.create),!("function"==typeof i.node.disabled?i.node.disabled():i.node.disabled)){i.node=Bd.save(i.node);var s=Hd(i.node.type,i.node);s&&(i.node.transform&&(n.save(),Qf(i.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),i.node.children&&Ud(i.node.children,s,n,r),i.node.transform&&n.restore()),Bd.restore()}}function $d(e){var t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=Hd("stage",r)),Ud(t,n,new Yf,o),n}function Yd(e,t,n){var r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o,s=null;if("radial"===r){var l=t.boundingRect();s=e.createRadialGradient(l.x+l.width/2,l.y+l.height/2,1e-5,l.x+l.width/2,l.y+l.height/2,Math.max(l.width,l.height)/2)}else{var u=Ba(i);["x1","x2","y1","y2"].forEach((function(e){e in n&&(u[e]=n[e])}));var c=t.boundingRect();s=e.createLinearGradient(c.x+u.x1*c.width,c.y+u.y1*c.height,c.x+u.x2*c.width,c.y+u.y2*c.height)}for(var h=0,f=a.length;h<f;h++){var d=a[h];s.addColorStop(d.offset,d.color)}return s}function Xd(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((function(e){switch(e.type){case"rect":n.rect(e.x,e.y,e.width,e.height)}})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Kd(e){var t=e.createElement("canvas"),n=t.getContext("2d"),r={};return{create:function(e){var i=e.key;return i?(r[i]=r[i]||Xd(e,t,n),r[i]):Xd(e,t,n)},clear:function(){r={}}}}function Gd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed,l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"===I(s)&&["left","right","top","bottom"].forEach((function(e){!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)})),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function Jd(){var e={element:function(){},root:function(){},settings:function(){},appendTo:function(){},getScene:function(){return[]},render:function(){return!1},itemsAt:function(){return[]},findShapes:function(){return[]},clear:function(){},destory:function(){},size:function(){},measureText:bh,textBounds:wh,setKey:function(t){e.element().setAttribute("data-key",t)}};return e}function Zd(e){return function(t){var n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}var Qd=200,ep=200,tp=function(){function e(t){R(this,e),this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}return O(e,[{key:"updateSize",value:function(e){var t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Qd,height:n.computedPhysical.height+2*ep},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}},{key:"apply",value:function(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}},{key:"clear",value:function(){this.bufferCanvas.width=this.bufferCanvas.width}},{key:"getContext",value:function(){return this.bufferCanvas.getContext("2d")}}]),e}(),np=ft();function rp(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function ip(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function op(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function ap(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.keys(r),o=0,a=n.length;o<a;o++){var s=n[o],l=s[0],u=s[1],c=s[2];if(l in t.attrs&&!(u in r)&&e[u]!==t.attrs[l]){var h=c?c(t.attrs[l]):t.attrs[l];"function"==typeof e[u]?e[u](h):e[u]=h}}for(var f=0,d=i.length;f<d;f++){var p=i[f];e[p]=r[p]}}function sp(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s={};t.save(),a.attrs&&(a.attrs.fill||a.attrs.stroke)&&(a.attrs.fill&&"object"===I(a.attrs.fill)&&"gradient"===a.attrs.fill.type?s.fillStyle=Yd(t,a,a.attrs.fill):a.attrs.fill&&"object"===I(a.attrs.fill)&&"pattern"===a.attrs.fill.type&&(s.fillStyle=r.patterns.create(a.attrs.fill)),a.attrs.stroke&&"object"===I(a.attrs.stroke)&&"gradient"===a.attrs.stroke.type?s.strokeStyle=Yd(t,a,a.attrs.stroke):a.attrs.stroke&&"object"===I(a.attrs.stroke)&&"pattern"===a.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(a.attrs.stroke))),ap(t,a,n,s),a.modelViewMatrix&&op(a.modelViewMatrix.elements,t),np.has(a.type)&&np.get(a.type)(a.attrs,{g:t,doFill:"fill"in a.attrs&&"none"!==a.attrs.fill,doStroke:"stroke"in a.attrs&&0!==a.attrs["stroke-width"],ellipsed:a.ellipsed}),a.children&&sp(a.children,t,n,r),t.restore()}}function lp(e){var t=e.el,n=e.dpiRatio,r=e.transform;if("object"===I(r)){var i=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n],o=t.getContext("2d");o.setTransform.apply(o,i)}}function up(){var e,t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$d,o={transform:void 0,canvasBufferSize:void 0,progressive:void 0},a=!1,s=Gd(),l=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",rp]],u=Jd();return u.element=function(){return e},u.root=function(){return e},u.settings=function(e){return e&&Object.keys(o).forEach((function(t){void 0!==e[t]&&(o[t]=e[t])})),o},u.appendTo=function(n){return e||((e=n.ownerDocument.createElement("canvas")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof o.transform||t||(t=new tp(e)),n.appendChild(e),e},u.getScene=function(n){var r=ip(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:n,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),i({items:[l],dpi:r,on:{create:[ch(u.measureText),Zd(u)]}})},u.render=function(i){if(!e)return!1;r||(r=Kd(e.ownerDocument));var c=t&&t.getContext()||e.getContext("2d"),h=ip(c),f=t&&o.transform();if(f)return e.width=e.width,lp({el:e,dpiRatio:h,transform:f}),t.apply(),!0;a&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:o.canvasBufferSize}));var d=u.getScene(i),p=!n||!d.equals(n);r.clear();var m,g=a||p,y="function"==typeof o.progressive&&o.progressive();(g&&(y&&!y.isFirst||u.clear(),sp(d.children,c,l,{patterns:r})),t&&(e.width=e.width,t.apply()),a=!1,y&&!y.isFirst)&&(m=d.children).unshift.apply(m,X(n.children));return n=d,g},u.itemsAt=function(e){return n?n.getItemsFrom(e):[]},u.findShapes=function(e){return n?n.findShapes(e):[]},u.clear=function(){return e&&(e.width=e.width),t&&t.clear(),n=null,u},u.size=function(e){if(e){var t=Gd(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},u.destroy=function(){e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),n=null},u}function cp(e,t){np.add(e,t)}function hp(e,t){return Math.max(0,Math.min(e,t))}var fp=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),dp=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),pp=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function mp(e){return fp.test(e)}function gp(e){return dp.test(e)||pp.test(e)}function yp(e){var t,n,r=e?e.length:0;for(t=0;t<r;t++){if(mp(n=e[t]))return"ltr";if(gp(n))return"rtl"}return"ltr"}var vp={start:"end",end:"start",center:"center",middle:"middle"};function bp(e,t){return"rtl"===t?vp[e]:e}function xp(e,t){var n,r,i,o=[],a=[],s=[],l=[],u=function(e){return e.id},c=function(e,t){var n;return n="object"===I(e)?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(c)),t=t.map(c),r=e.map(u),i=t.map(u);for(var h=0,f=t.length;h<f;h++){-1===r.indexOf(t[h].id)?o.push(t[h]):s.push(t[h])}for(var d=0,p=e.length;d<p;d++){-1===i.indexOf(e[d].id)?a.push(e[d]):l.push(e[d])}for(var m=0,g=o.length;m<g;m++)o[m].content.children&&(o[m].diff=xp([],o[m].content.children),o[m].children=o[m].diff.updatedNew.concat(o[m].diff.added),o[m].children.isTree=!0);for(var y=0,v=s.length;y<v;y++)s[y].diff=xp(l[y].children||[],s[y].content.children||[]),s[y].object=l[y].object,s[y].children=s[y].diff.items;return n=s.concat(o),o.isTree=!0,a.isTree=!0,s.isTree=!0,l.isTree=!0,n.isTree=!0,{added:o,updatedNew:s,updatedOld:l,removed:a,items:n}}function wp(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function qp(e,t){for(var n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Mp(e,t,n,r){for(var i,o=0,a=e.length;o<a;o++)null!==(i=e[o]).object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(wp(i.diff.added,i.object,t),qp(i.diff.removed,r),Mp(i.diff.items,t,n,r)))}function Dp(e,t,n,r,i,o){var a=xp(e,t);return wp(a.added,n,r),qp(a.removed,o),Mp(a.items,r,i,o),a.items}cp("rect",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=hp(r/2,o>0?o:a),a=hp(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),cp("circle",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),cp("line",(function(e,t){var n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),cp("path",(function(e,t){var n=t.g,r=t.doStroke,i=t.doFill,o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),cp("text",(function(e,t){var n=t.g,r=t.ellipsed,i=t.doStroke,o=r||hh(e,bh);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);var a=yp(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);var s=bp("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);var l=fh(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));var kp="http://www.w3.org/2000/svg",Sp=function(e,t){if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));var n=t.ownerDocument.createElementNS(kp,"container"===e?"g":e);return t.appendChild(n),n},_p=function(e){e.parentNode&&e.parentNode.removeChild(e)},Cp=function(e,t){if(function(e){switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}}(t)){for(var n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||hh(t.attrs,bh);var r=yp(t.attrs.text);"rtl"===r&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",bp(e.getAttribute("text-anchor"),r)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){var i=e.ownerDocument.createElementNS(kp,"title");i.textContent=t.attrs.title,e.appendChild(i)}else e.setAttribute(n,t.attrs[n]);else{var o=+e.getAttribute(n)||0,a=0;a="dominant-baseline"===n?fh(t.attrs):t.attrs[n],e.setAttribute("dy",a+o)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"===I(t.data)&&null!==t.data)for(var s in t.data)"string"!=typeof t.data[s]&&"number"!=typeof t.data[s]&&"boolean"!=typeof t.data[s]||e.setAttribute("data-".concat(s),t.data[s])}},Ep=function(){function e(t,n,r,i){R(this,e),this.create=t,this.nodeCreator=n,this.nodeMaintainer=r,this.nodeDestroyer=i}return O(e,[{key:"render",value:function(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}]),e}();function Ap(){return new Ep(Dp,Sp,Cp,_p)}function Tp(e){var t,n,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,n=e.length;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r&=r;return r}function Ip(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tp,n={},r=Date.now(),i={getOrCreateGradient:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){var u=i[o],c=u.orientation,h=u.degree,f=u.stops,d=void 0===f?[]:f,p={};void 0===h&&(h=90),"radial"===c?p.type="radialGradient":(p=Ba(h),["x1","x2","y1","y2"].forEach((function(e){e in i[o]&&(p[e]=i[o][e])})),p.type="linearGradient"),p.id=l,p.children=d.map((function(e){var t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(p),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate:function(e){var t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);var n=e.node;n.fill&&"object"===I(n.fill)&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"===I(n.stroke)&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear:function(){n={}}};return i}function Rp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tp,n={},r=Date.now(),i={onCreate:function(i){var o={};i.node&&"object"===I(i.node.fill)&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"===I(i.node.stroke)&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((function(a){var s="",l=o[a],u=t(l),c="picasso-pattern-".concat(r,"-").concat(u);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[u]){var h={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:c,children:[],fill:l.fill};l.shapes.forEach((function(e){h.children.push(e)})),e.push(h),n[u]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(c,"')")}))},clear:function(){n={}}};return i}function Np(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ap,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kp,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$d,a=r(),s=!1,l=Gd(),u={transform:void 0},c=Jd(),h={type:"defs",children:[]},f=Rp(h.children),d=Ip(h.children);return c.element=function(){return e},c.root=function(){return t},c.settings=function(e){return e&&Object.keys(u).forEach((function(t){void 0!==e[t]&&(u[t]=e[t])})),u},c.appendTo=function(n){return e||((e=n.ownerDocument.createElementNS(i,"svg")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none",e.setAttribute("xmlns",i),(t=n.ownerDocument.createElementNS(i,"g")).style.pointerEvents="auto",e.appendChild(t)),n.appendChild(e),e},c.getScene=function(e){var t=l.scaleRatio.x,n=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[].concat(X(e),[h]):e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*n,")"):""};return 1===t&&1===n||(r.transform+="scale(".concat(t,", ").concat(n,")")),o({items:[r],on:{create:[function(e){e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,f.onCreate,ch(c.measureText),Zd(c)]}})},c.render=function(r){if(!e)return!1;var i="function"==typeof u.transform&&u.transform();if(i){var o=i.a,p=i.b,m=i.c,g=i.d,y=i.e,v=i.f;return t.style.transform="matrix(".concat(o,", ").concat(p,", ").concat(m,", ").concat(g,", ").concat(y,", ").concat(v,")"),!0}t.style.transform="",s&&(e.style.left="".concat(l.computedPhysical.x,"px"),e.style.top="".concat(l.computedPhysical.y,"px"),e.setAttribute("width",l.computedPhysical.width),e.setAttribute("height",l.computedPhysical.height)),d.clear(),f.clear(),h.children.length=0;var b=c.getScene(r),x=!n||!b.equals(n),w=s||x;return w&&(c.clear(),a.render(b.children,t)),s=!1,n=b,w},c.itemsAt=function(e){return n?n.getItemsFrom(e):[]},c.findShapes=function(e){return n?n.findShapes(e):[]},c.clear=function(){if(!t)return c;n=null;var r=t.cloneNode(!1);return e.replaceChild(r,t),t=r,c},c.destroy=function(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,t=null},c.size=function(e){if(e){var t=Gd(e);JSON.stringify(l)!==JSON.stringify(t)&&(s=!0,l=t)}return l},c}var Op,Pp,Lp,jp,zp,Fp={},Hp=[],Bp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Vp(e,t){for(var n in t)e[n]=t[n];return e}function Wp(e){var t=e.parentNode;t&&t.removeChild(e)}function Up(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Op.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return $p(e,a,r,i,null)}function $p(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Lp:i};return null==i&&null!=Pp.vnode&&Pp.vnode(o),o}function Yp(e){return e.children}function Xp(e,t){this.props=e,this.context=t}function Kp(e,t){if(null==t)return e.__?Kp(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Kp(e):null}function Gp(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Gp(e)}}function Jp(e){(!e.__d&&(e.__d=!0)&&jp.push(e)&&!Zp.__r++||zp!==Pp.debounceRendering)&&((zp=Pp.debounceRendering)||setTimeout)(Zp)}function Zp(){for(var e;Zp.__r=jp.length;)e=jp.sort((function(e,t){return e.__v.__b-t.__v.__b})),jp=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=Vp({},i)).__v=i.__v+1,am(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Kp(i):o,i.__h),sm(n,i),i.__e!=o&&Gp(i)))}))}function Qp(e,t,n,r,i,o,a,s,l,u){var c,h,f,d,p,m,g,y=r&&r.__k||Hp,v=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(d=n.__k[c]=null==(d=t[c])||"boolean"==typeof d?null:"string"==typeof d||"number"==typeof d||"bigint"==typeof d?$p(null,d,null,null,d):Array.isArray(d)?$p(Yp,{children:d},null,null,null):d.__b>0?$p(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)){if(d.__=n,d.__b=n.__b+1,null===(f=y[c])||f&&d.key==f.key&&d.type===f.type)y[c]=void 0;else for(h=0;h<v;h++){if((f=y[h])&&d.key==f.key&&d.type===f.type){y[h]=void 0;break}f=null}am(e,d,f=f||Fp,i,o,a,s,l,u),p=d.__e,(h=d.ref)&&f.ref!=h&&(g||(g=[]),f.ref&&g.push(f.ref,null,d),g.push(h,d.__c||p,d)),null!=p?(null==m&&(m=p),"function"==typeof d.type&&d.__k===f.__k?d.__d=l=em(d,l,e):l=tm(e,d,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=Kp(f))}for(n.__e=m,c=v;c--;)null!=y[c]&&cm(y[c],y[c]);if(g)for(c=0;c<g.length;c++)um(g[c],g[++c],g[++c])}function em(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?em(r,t,n):tm(n,r,r,i,r.__e,t));return t}function tm(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function nm(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Bp.test(t)?n:n+"px"}function rm(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||nm(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||nm(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?om:im,o):e.removeEventListener(t,o?om:im,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function im(e){this.l[e.type+!1](Pp.event?Pp.event(e):e)}function om(e){this.l[e.type+!0](Pp.event?Pp.event(e):e)}function am(e,t,n,r,i,o,a,s,l){var u,c,h,f,d,p,m,g,y,v,b,x,w,q,M,D=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(u=Pp.__b)&&u(t);try{e:if("function"==typeof D){if(g=t.props,y=(u=D.contextType)&&r[u.__c],v=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in D&&D.prototype.render?t.__c=c=new D(g,v):(t.__c=c=new Xp(g,v),c.constructor=D,c.render=hm),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=v,c.__n=r,h=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=D.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Vp({},c.__s)),Vp(c.__s,D.getDerivedStateFromProps(g,c.__s))),f=c.props,d=c.state,h)null==D.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==D.getDerivedStateFromProps&&g!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,v),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,v)||t.__v===n.__v){for(c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<c._sb.length;b++)c.__h.push(c._sb[b]);c._sb=[],c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,v),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,d,p)}))}if(c.context=v,c.props=g,c.__v=t,c.__P=e,x=Pp.__r,w=0,"prototype"in D&&D.prototype.render){for(c.state=c.__s,c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),q=0;q<c._sb.length;q++)c.__h.push(c._sb[q]);c._sb=[]}else do{c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Vp(Vp({},r),c.getChildContext())),h||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(f,d)),M=null!=u&&u.type===Yp&&null==u.key?u.props.children:u,Qp(e,Array.isArray(M)?M:[M],t,n,r,i,o,a,s,l),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=lm(n.__e,t,n,r,i,o,a,l);(u=Pp.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Pp.__e(e,t,n)}}function sm(e,t){Pp.__c&&Pp.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Pp.__e(e,t.__v)}}))}function lm(e,t,n,r,i,o,a,s){var l,u,c,h=n.props,f=t.props,d=t.type,p=0;if("svg"===d&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!d&&(d?l.localName===d:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===d)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,f.is&&f),o=null,s=!1}if(null===d)h===f||s&&e.data===f||(e.data=f);else{if(o=o&&Op.call(e.childNodes),u=(h=n.props||Fp).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||rm(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||rm(e,o,t[o],n[o],r)}(e,f,h,i,s),c)t.__k=[];else if(p=t.props.children,Qp(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==d,o,a,o?o[0]:n.__k&&Kp(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&Wp(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===d&&!p||"option"===d&&p!==h.value)&&rm(e,"value",p,h.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&rm(e,"checked",p,h.checked,!1))}return e}function um(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Pp.__e(e,n)}}function cm(e,t,n){var r,i;if(Pp.unmount&&Pp.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||um(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Pp.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&cm(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Wp(e.__e),e.__=e.__e=e.__d=void 0}function hm(e,t,n){return this.constructor(e,n)}function fm(e,t,n){var r,i,o;Pp.__&&Pp.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],am(t,e=(!r&&n||t).__k=Up(Yp,null,[e]),i||Fp,Fp,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Op.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),sm(o,e)}function dm(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.createElement,i=void 0===r?document.createElement.bind(document):r,o=Gd(),a={transform:void 0},s=Jd();return s.element=function(){return e},s.root=function(){return e},s.settings=function(e){return e&&Object.keys(a).forEach((function(t){void 0!==e[t]&&(a[t]=e[t])})),a},s.appendTo=function(t){return e||((e=i("div")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),t.appendChild(e),e},s.render=function(n){if(!e)return!1;var r,i="function"==typeof a.transform&&a.transform();if(i){var s=i.a,l=i.b,u=i.c,c=i.d,h=i.e,f=i.f;return e.style.transform="matrix(".concat(s,", ").concat(l,", ").concat(u,", ").concat(c,", ").concat(h,", ").concat(f,")"),!0}return e.style.transform="",e.style.left="".concat(o.computedPhysical.x,"px"),e.style.top="".concat(o.computedPhysical.y,"px"),e.style.width="".concat(o.computedPhysical.width,"px"),e.style.height="".concat(o.computedPhysical.height,"px"),r=Array.isArray(n)?Up("div",null,n):n,t=fm(r,e,t),!0},s.renderArgs=[Up],s.clear=function(){if(e){for(var n=e.firstChild;n;)e.removeChild(n),n=e.firstChild;t=null}return s},s.destroy=function(){e&&e.parentElement&&e.parentElement.removeChild(e),e=null,t=null},s.size=function(e){return e&&(o=Gd(e)),o},s}Op=Hp.slice,Pp={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Lp=0,Xp.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Vp({},this.state),"function"==typeof e&&(e=e(Vp({},n),this.props)),e&&Vp(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Jp(this))},Xp.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jp(this))},Xp.prototype.render=Yp,jp=[],Zp.__r=0;var pm=[function(e){e.renderer("svg",Np)},function(e){e.renderer("canvas",up)},function(e){e.renderer("dom",dm)}],mm={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},gm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.level,r=void 0===n?mm.OFF:n,i=t.pipe,o=void 0===i?console:i,a=r,s=(P(e={},mm.OFF,(function(){})),P(e,mm.ERROR,(function(){return o.error.apply(o,arguments)})),P(e,mm.WARN,(function(){return o.warn.apply(o,arguments)})),P(e,mm.INFO,(function(){return o.info.apply(o,arguments)})),P(e,mm.DEBUG,(function(){return o.log.apply(o,arguments)})),e),l=function(e){if(e&&!(a<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(s[e]||s[mm.DEBUG]).apply(void 0,n)}};return{log:l,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[mm.ERROR].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[mm.WARN].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[mm.INFO].concat(t))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[mm.DEBUG].concat(t))},level:function(e){return"number"==typeof e&&(a=e),a},LOG_LEVEL:mm}};function ym(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}var vm=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=gm(t.logger),i={component:ft(n.component,"component",r),data:ft(n.data,"data",r),formatter:ft(n.formatter,"formatter",r),interaction:ft(n.interaction,"interaction",r),renderer:dl(n.renderer),scale:ft(n.scale,"scale",r),symbol:ft(n.symbol,"symbol",r),logger:r};function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={palettes:t.palettes.concat(n.palettes||[]),style:C({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(r,i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ym(e,t,i)},o.chart=function(e){return fl(e,{registries:i,logger:r,style:t.style,palettes:t.palettes})},o.config=function(){return t},Object.keys(i).forEach((function(e){o[e]=i[e]})),o.version=E,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:pl,data:El,formatter:kr,interaction:Al,renderer:dl(),scale:Fo,symbol:es});function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){km(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wm(e){return(wm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dm(e,t,n){return t&&Mm(e.prototype,t),n&&Mm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function km(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sm(e,t){return(Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Cm(e,t,n){return(Cm=_m()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Sm(i,n.prototype),i}).apply(null,arguments)}function Em(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Tm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Am(e){return function(e){if(Array.isArray(e))return Im(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Tm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tm(e,t){if(e){if("string"==typeof e)return Im(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Im(e,t):void 0}}function Im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ef.forEach(vm.use),pm.forEach(vm.use),[].forEach(vm.use);var Rm=Object.prototype.hasOwnProperty,Nm=Object.prototype.toString,Om=Object.defineProperty,Pm=Object.getOwnPropertyDescriptor,Lm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Nm.call(e)},jm=function(e){if(!e||"[object Object]"!==Nm.call(e))return!1;var t,n=Rm.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Rm.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Rm.call(e,t)},zm=function(e,t){Om&&"__proto__"===t.name?Om(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fm=function(e,t){if("__proto__"===t){if(!Rm.call(e,t))return;if(Pm)return Pm(e,t).value}return e[t]},Hm=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Fm(s,n),s!==(i=Fm(t,n))&&(c&&i&&(jm(i)||(o=Lm(i)))?(o?(o=!1,a=r&&Lm(r)?r:[]):a=r&&jm(r)?r:{},zm(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&zm(s,{name:n,newValue:i}));return s};function Bm(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function Vm(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Wm(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,h=r;if(i.field&&i.field!==n){var f=Bm(i.field,o,{cache:t});if(-1===f)return;h=Hm({qRow:a},f(s))}u[c]=Vm(i,h,{key:l})}function Um(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===wm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),h=c.props,f=c.main,d=Object.keys(h),p=!!i[a].trackBy,m=wm(i[a].trackBy),g={},y=[],v=[],b=0;b<s.qDataPages.length;b++){var x=Bm(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var q=s.qDataPages[b].qArea.qTop+w,M=Hm({qRow:q},x(s.qDataPages[b].qMatrix[w])),D=Vm(f,M,{key:l});if(!(f.filter&&!f.filter(M))){for(var k=0;k<d.length;k++){var S=h[d[k]],_=S.fields||[S];S.fields&&(D[d[k]]=[]);for(var C=0;C<_.length;C++)Wm({cache:n,f:u,mainCell:M,p:_[C],prop:d[k],props:h,page:s.qDataPages[b],rowIdx:q,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:S.fields?D[d[k]]:D,targetProp:S.fields?C:d[k]});if(S.fields){var E=D[d[k]].map((function(e){return e.value})),A=D[d[k]].map((function(e){return e.label}));D[d[k]]={value:"function"==typeof S.value?S.value(E):void 0!==S.value?S.value:E,label:"function"==typeof S.label?S.label(A):void 0!==S.label?String(S.label):String(D[d[k]].value)}}}p&&r.track({cfg:i[a],itemData:M,obj:D,target:y,tracker:g,trackType:m}),v.push(D)}}}var T=p?r.collect(y,{main:f,propsArr:d,props:h}):v;o=[].concat(Am(o),Am(T))}return o}function $m(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Ym(e,t){var n,r,i,o,a,s=new Jm(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Xm);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Jm(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Gm)}function Xm(e){return e.children}function Km(e){e.data=e.data.data}function Gm(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Jm(e){this.data=e,this.depth=this.height=0,this.parent=null}function Zm(e){if("function"!=typeof e)throw new Error;return e}Jm.prototype=Ym.prototype={constructor:Jm,count:function(){return this.eachAfter($m)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Ym(this).eachBefore(Km)}};var Qm={depth:-1},eg={};function tg(e){return e.id}function ng(e){return e.parentId}function rg(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=rg(n,i[s]);Array.isArray(l)?a.push.apply(a,Am(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=rg(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function ig(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,Am(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,Am(ig(e[o].children,t-1,n)));return r}function og(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return ig(e.children,i-1,n)}}return!1}function ag(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var sg=/^qDimensionInfo(?:\/(\d+))?/,lg=/^\/?qMeasureInfo\/(\d+)/,ug=/\/qAttrExprInfo\/(\d+)/,cg=/\/qAttrDimInfo\/(\d+)/;function hg(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function fg(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,h=n.qEffectiveInterColumnSortOrder,f=hg(n);return sg.test(c)&&(i=!0,o=+sg.exec(c)[1],c=r.replace(sg,"")),lg.test(c)&&("K"===n.qMode?l=+lg.exec(c)[1]:h&&-1!==h.indexOf(-1)?(l=+lg.exec(c)[1],u=0):u=+lg.exec(c)[1],c=c.replace(lg,"")),c&&(cg.exec(c)?s=+cg.exec(c)[1]:ug.exec(c)&&(a=+ug.exec(c)[1])),{fieldDepth:(i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function dg(e,t){var n,r,i=og(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(e){var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function pg(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function mg(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,h=void 0;l.fields&&(c=[],h=[]);for(var f=function(e){var n=u[e],f=void 0,d=void 0,p=void 0,m=void 0,g=void 0,y=void 0;if("primitive"===n.type?(p=n.value,y=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(d=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(p=g.map(f),f=null),d&&(y=g.map(d),d=null),p=n.reduce?n.reduce(p):p,y=n.reduceLabel?n.reduceLabel(y,p):String(p)):y=p=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(p=i,y=i)),l.fields){var v=f?f(p):p;c.push(v),h.push(d&&null!=y?d(y):null!=y?y:String(v))}else{var b=f?f(p):p;o[t[s]]={value:b,label:d?d(y):null!=y?y:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},d=0;d<u.length;d++)f(d);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(h,r):h})}}var gg=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=rg(r,e);return o&&o[0]?(t.tree=Ym(o[0],n.children||function(e){return e[i]}),t.tree):null};function yg(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,h=0;h<i.length;h++){var f,d=l[i[h]],p="".concat(u,"__").concat(null!==(f=d.qElemNumber)&&void 0!==f?f:d.qElemNo);a[p]||(a[p]=xm({__id:p,__parent:u,qValues:[]},d),c=!0),u=p}if(c)for(var m=0;m<o.length;m++){var g=l[o[m]];a[u].qValues.push(g)}}var y=Object.keys(a).map((function(e){return a[e]}));return function(){var e=tg,t=ng;function n(n){var r,i,o,a,s,l,u,c=n.length,h=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=h[i]=new Jm(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u="$"+(s.id=l)]=u in f?eg:s);for(i=0;i<c;++i)if(s=h[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f["$"+l]))throw new Error("missing: "+l);if(a===eg)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=Qm,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(Gm),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Zm(t),n):e},n.parentId=function(e){return arguments.length?(t=Zm(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(y)}var vg=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var h=u[c];if(h.field!==a){var f=dg(o,fg(h.field,{cube:r,cache:i}));h.accessor=f.nodeFn,h.valueAccessor=f.valueFn,h.attrAccessor=f.attrFn}}};function bg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?yg(t):gg(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var h=hg(i),f=h[u-1];c=n.fields[f]}else{var d=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(d=i.qDimensionInfo.length),c=n.fields[d]}var p=r.normalizeConfig(xm(xm({},e),{},{field:c?c.key():void 0}),t),m=p.props,g=p.main,y=Object.keys(m);l[u]={propsArr:y,props:m,main:g};var v=c?fg(c,{cube:i,cache:n}):{fieldDepth:0};vg({propsArr:y,props:m,cube:i,cache:n,itemDepthObject:v,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),q=0;q<w.length;q++){var M=l[w[q].depth].propsArr,D=l[w[q].depth].props,k=l[w[q].depth].main,S=x[q],_=S.data,C=pg(k,_,{key:o});mg({propsArr:M,props:D,item:S,itemData:_,ret:C,sourceKey:o,isTree:!0}),w[q].data=C}return a}function xg(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!gg(s,n,e))continue;var u="object"===wm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),h=c.props,f=c.main,d=Object.keys(h),p=fg(u,{cube:s,cache:n}),m=dg({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;vg({propsArr:d,props:h,cube:s,cache:n,itemDepthObject:p,f:u});for(var b=!!i[a].trackBy,x=wm(i[a].trackBy),w={},q=[],M=g(n.tree),D=[],k=0;k<M.length;k++){var S=M[k],_=y?y(v(S)):v(S);if(!(f.filter&&!f.filter(_))){var C=pg(f,_,{key:l});mg({propsArr:d,props:h,item:S,itemData:_,ret:C,sourceKey:l}),b&&r.track({cfg:i[a],itemData:_,obj:C,target:q,tracker:w,trackType:x}),D.push(C)}}var E=b?r.collect(q,{main:f,propsArr:d,props:h}):D;o=[].concat(Am(o),Am(E))}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var wg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
31
|
+
function(e){var t,n,r,i,o,a,s,l,u,c,h,d,f,p,m,g,y,v,b,x="sizzle"+1*new Date,w=e.document,q=0,M=0,D=le(),S=le(),k=le(),_=le(),C=function(e,t){return e===t&&(h=!0),0},E={}.hasOwnProperty,A=[],T=A.pop,I=A.push,R=A.push,N=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",j="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+L+"*("+j+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+L+"*\\]",F=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",H=new RegExp(L+"+","g"),B=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),V=new RegExp("^"+L+"*,"+L+"*"),W=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp(L+"|>"),$=new RegExp(F),Y=new RegExp("^"+j+"$"),X={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{R.apply(A=N.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){R={apply:A.length?function(e,t){I.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,u,c,h,p,y,v=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(t),t=t||f,m)){if(11!==w&&(h=Q.exec(e)))if(o=h[1]){if(9===w){if(!(u=t.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(v&&(u=v.getElementById(o))&&b(t,u)&&u.id===o)return r.push(u),r}else{if(h[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!_[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===w&&(U.test(e)||W.test(e))){for((v=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=x)),s=(p=a(e)).length;s--;)p[s]=(c?"#"+c:":scope")+" "+be(p[s]);y=p.join(",")}try{return R.apply(r,v.querySelectorAll(y)),r}catch(t){_(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ue(e){return e[x]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue((function(t){return t=+t,ue((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=f&&9===a.nodeType&&a.documentElement?(p=(f=a).documentElement,m=!o(f),w!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(f.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],g=[],(n.qsa=Z.test(f.querySelectorAll))&&(ce((function(e){var t;p.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F)})),g=g.length&&new RegExp(g.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(p.compareDocumentPosition),b=t||Z.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},C=t?function(e,t){if(e===t)return h=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==f?-1:t==f?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?de(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!_[t+" "]&&(!y||!y.test(t))&&(!g||!g.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){_(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&E.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(C),h){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},r=se.selectors={cacheLength:50,createPseudo:ue,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&D(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,h,d,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s,b=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&v){for(b=(f=(u=(c=(h=(d=g)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[q,f,b];break}}else if(v&&(b=f=(u=(c=(h=(d=t)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&u[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(v&&((c=(h=d[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]=[q,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=O(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ue((function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[x]?ue((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ue((function(e){return function(t){return se(e,t).length>0}})),contains:ue((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ue((function(e){return Y.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ve(){}function be(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function xe(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=M++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,l){var u,c,h,d=[q,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(h=t[x]||(t[x]={}))[t.uniqueID]||(h[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[o])&&u[0]===q&&u[1]===s)return d[2]=u[2];if(c[o]=d,d[2]=e(t,n,l))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function qe(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function Me(e,t,n,r,i,o){return r&&!r[x]&&(r=Me(r)),i&&!i[x]&&(i=Me(i,o)),ue((function(o,a,s,l){var u,c,h,d=[],f=[],p=a.length,m=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:qe(m,d,e,s,l),y=n?i||(o?e:p||r)?[]:a:g;if(n&&n(g,y,s,l),r)for(u=qe(y,f),r(u,[],s,l),c=u.length;c--;)(h=u[c])&&(y[f[c]]=!(g[f[c]]=h));if(o){if(i||e){if(i){for(u=[],c=y.length;c--;)(h=y[c])&&u.push(g[c]=h);i(null,y=[],u,l)}for(c=y.length;c--;)(h=y[c])&&(u=i?O(o,h):d[c])>-1&&(o[u]=!(a[u]=h))}}else y=qe(y===a?y.splice(p,y.length):y),i?i(null,a,y,l):R.apply(a,y)}))}function De(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=xe((function(e){return e===t}),s,!0),h=xe((function(e){return O(t,e)>-1}),s,!0),d=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):h(e,n,r));return t=null,i}];l<o;l++)if(n=r.relative[e[l].type])d=[xe(we(d),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return Me(l>1&&we(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l<i&&De(e.slice(l,i)),i<o&&De(e=e.slice(i)),i<o&&be(e))}d.push(n)}return we(d)}return ve.prototype=r.filters=r.pseudos,r.setFilters=new ve,a=se.tokenize=function(e,t){var n,i,o,a,s,l,u,c=S[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=r.preFilter;s;){for(a in n&&!(i=V.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=W.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length)),r.filter)!(i=X[a].exec(s))||u[a]&&!(i=u[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):S(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=k[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=De(t[n]))[x]?i.push(s):o.push(s);s=k(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var h,p,g,y=0,v="0",b=o&&[],x=[],w=u,M=o||i&&r.find.TAG("*",c),D=q+=null==w?1:Math.random()||.1,S=M.length;for(c&&(u=a==f||a||c);v!==S&&null!=(h=M[v]);v++){if(i&&h){for(p=0,a||h.ownerDocument==f||(d(h),s=!m);g=e[p++];)if(g(h,a||f,s)){l.push(h);break}c&&(q=D)}n&&((h=!g&&h)&&y--,o&&b.push(h))}if(y+=v,n&&v!==y){for(p=0;g=t[p++];)g(b,x,a,s);if(o){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=T.call(l));x=qe(x)}R.apply(l,x),c&&!o&&x.length>0&&y+t.length>1&&se.uniqueSort(l)}return c&&(q=D,u=w),b};return n?ue(o):o}(o,i)),s.selector=e}return s},l=se.select=function(e,t,n,i){var o,l,u,c,h,d="function"==typeof e&&e,f=!i&&a(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=X.needsContext.test(e)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((h=r.find[c])&&(i=h(u.matches[0].replace(te,ne),ee.test(l[0].type)&&ye(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return R.apply(n,i),n;break}}return(d||s(e,f))(i,t,!m,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=x.split("").sort(C).join("")===x,n.detectDuplicates=!!h,d(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||he("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||he("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||he(P,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(e);w.find=M,w.expr=M.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=M.uniqueSort,w.text=M.getText,w.isXMLDoc=M.isXML,w.contains=M.contains,w.escapeSelector=M.escape;var D=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=w.expr.match.needsContext;function _(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function E(e,t,n){return p(t)?w.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return s.call(t,e)>-1!==n})):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,(function(e){return 1===e.nodeType})))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter((function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&k.test(e)?w(e):e||[],!1).length}});var A,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,I=w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:T.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),C.test(r[1])&&w.isPlainObject(t))for(r in t)p(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=g.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)};I.prototype=w.fn,A=w(g);var R=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(w(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,n){return D(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,n){return D(e,"nextSibling",n)},prevUntil:function(e,t,n){return D(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(_(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},(function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(N[e]||w.uniqueSort(i),R.test(e)&&i.reverse()),this.pushStack(i)}}));var P=/[^\x20\t\r\n\f]+/g;function L(e){return e}function j(e){throw e}function z(e,t,n,r){var i;try{e&&p(i=e.promise)?i.call(e).done(t).fail(n):e&&p(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(P)||[],(function(e,n){t[n]=!0})),t}(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,(function(n,r){p(r)?e.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return w.each(arguments,(function(e,t){for(var n;(n=w.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred((function(t){w.each(n,(function(n,r){var i=p(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,l=arguments,u=function(){var e,u;if(!(t<o)){if((e=r.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(u)?i?u.call(e,a(o,n,L,i),a(o,n,j,i)):(o++,u.call(e,a(o,n,L,i),a(o,n,j,i),a(o,n,L,n.notifyWith))):(r!==L&&(s=void 0,l=[e]),(i||n.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==j&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred((function(e){n[0][3].add(a(0,e,p(i)?i:L,e.notifyWith)),n[1][3].add(a(0,e,p(t)?t:L)),n[2][3].add(a(0,e,p(r)?r:j))})).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(r,o)}};if(t<=1&&(z(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||p(o[n]&&o[n].then)))return a.then();for(;n--;)z(o[n],s(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout((function(){throw t}))};var H=w.Deferred();function B(){g.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),w.ready()}w.fn.ready=function(e){return H.then(e).catch((function(e){w.readyException(e)})),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||H.resolveWith(g,[w]))}}),w.ready.then=H.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var V=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===b(n))for(s in i=!0,n)V(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,p(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(w(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},W=/^-ms-/,U=/-([a-z])/g;function $(e,t){return t.toUpperCase()}function Y(e){return e.replace(W,"ms-").replace(U,$)}var X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=w.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[Y(t)]=n;else for(r in t)i[Y(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Y(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var G=new K,J=new K,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function ee(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}(n)}catch(e){}J.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return J.hasData(e)||G.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return G.access(e,t,n)},_removeData:function(e,t){G.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=J.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=Y(r.slice(5)),ee(o,r,i[r]));G.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){J.set(this,e)})):V(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=J.get(o,e))||void 0!==(n=ee(o,e))?n:void 0;this.each((function(){J.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){w.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:w.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each((function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){w.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=G.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=g.documentElement,oe=function(e){return w.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===w.css(e,"display")};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},l=s(),u=n&&n[3]||(w.cssNumber[t]?"":"px"),c=e.nodeType&&(w.cssNumber[t]||"px"!==u&&+l)&&ne.exec(w.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)w.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var ue={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=ue[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ue[r]=i,i)}function he(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=G.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&se(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",G.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return he(this,!0)},hide:function(){return he(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){se(this)?w(this).show():w(this).hide()}))}});var de,fe,pe=/^(?:checkbox|radio)$/i,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;de=g.createDocumentFragment().appendChild(g.createElement("div")),(fe=g.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),de.appendChild(fe),f.checkClone=de.cloneNode(!0).cloneNode(!0).lastChild.checked,de.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!de.cloneNode(!0).lastChild.defaultValue,de.innerHTML="<option></option>",f.option=!!de.lastChild;var ye={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&_(e,t)?w.merge([e],n):n}function be(e,t){for(var n=0,r=e.length;n<r;n++)G.set(e[n],"globalEval",!t||G.get(t[n],"globalEval"))}ye.tbody=ye.tfoot=ye.colgroup=ye.caption=ye.thead,ye.th=ye.td,f.option||(ye.optgroup=ye.option=[1,"<select multiple='multiple'>","</select>"]);var xe=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,l,u,c,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===b(o))w.merge(d,o.nodeType?[o]:o);else if(xe.test(o)){for(a=a||h.appendChild(t.createElement("div")),s=(me.exec(o)||["",""])[1].toLowerCase(),l=ye[s]||ye._default,a.innerHTML=l[1]+w.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;w.merge(d,a.childNodes),(a=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(u=oe(o),a=ve(h.appendChild(o),"script"),u&&be(a),n)for(c=0;o=a[c++];)ge.test(o.type||"")&&n.push(o);return h}var qe=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function De(){return!1}function Se(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=De;else if(!i)return e;return 1===o&&(a=i,i=function(e){return w().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=w.guid++)),e.each((function(){w.event.add(this,t,i,r,n)}))}function _e(e,t,n){n?(G.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var r,o,a=G.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),G.set(this,t,a),r=n(this,t),this[t](),a!==(o=G.get(this,t))||r?G.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(G.set(this,t,{value:w.event.trigger(w.extend(a[0],w.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&w.event.add(e,t,Me)}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,h,d,f,p,m,g=G.get(e);if(X(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(ie,i),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(P)||[""]).length;u--;)f=m=(s=qe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f&&(h=w.event.special[f]||{},f=(i?h.delegateType:h.bindType)||f,h=w.event.special[f]||{},c=w.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(f,a)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),w.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,h,d,f,p,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(P)||[""]).length;u--;)if(f=m=(s=qe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f){for(h=w.event.special[f]||{},d=l[f=(r?h.delegateType:h.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(e,c));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||w.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)w.event.remove(e,f+t[u],n,r,!0);w.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=w.event.fix(e),u=(G.get(this,"events")||Object.create(null))[l.type]||[],c=w.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=w.event.handlers.call(this,l,u),t=0;(i=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((w.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(u)>-1:w.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&_(t,"input")&&_e(t,"click",Me),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&_(t,"input")&&_e(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&_(t,"input")&&G.get(t,"click")||_(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Me:De,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:De,isPropagationStopped:De,isImmediatePropagationStopped:De,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Me,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Me,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Me,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},(function(e,t){w.event.special[e]={setup:function(){return _e(this,e,Se),!1},trigger:function(){return _e(this,e),!0},_default:function(t){return G.get(t.target,e)},delegateType:t}})),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),w.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=De),this.each((function(){w.event.remove(this,e,n,t)}))}});var Ce=/<script|<style|<link/i,Ee=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Te(e,t){return _(e,"table")&&_(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ne(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(G.hasData(e)&&(s=G.get(e).events))for(i in G.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(t,i,s[i][n]);J.hasData(e)&&(o=J.access(e),a=w.extend({},o),J.set(t,a))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Pe(e,t,n,r){t=o(t);var i,a,s,l,u,c,h=0,d=e.length,m=d-1,g=t[0],y=p(g);if(y||d>1&&"string"==typeof g&&!f.checkClone&&Ee.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),Pe(o,t,n,r)}));if(d&&(a=(i=we(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(l=(s=w.map(ve(i,"script"),Ie)).length;h<d;h++)u=i,h!==m&&(u=w.clone(u,!0,!0),l&&w.merge(s,ve(u,"script"))),n.call(e[h],u,h);if(l)for(c=s[s.length-1].ownerDocument,w.map(s,Re),h=0;h<l;h++)u=s[h],ge.test(u.type||"")&&!G.access(u,"globalEval")&&w.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?w._evalUrl&&!u.noModule&&w._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):v(u.textContent.replace(Ae,""),u,c))}return e}function Le(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&be(ve(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=oe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ve(s),r=0,i=(o=ve(e)).length;r<i;r++)Oe(o[r],a[r]);if(t)if(n)for(o=o||ve(e),a=a||ve(s),r=0,i=o.length;r<i;r++)Ne(o[r],a[r]);else Ne(e,s);return(a=ve(s,"script")).length>0&&be(a,!l&&ve(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[G.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[G.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return V(this,(function(e){return void 0===e?w.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Pe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Te(this,e).appendChild(e)}))},prepend:function(){return Pe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Te(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Pe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Pe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return w.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ce.test(e)&&!ye[(me.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Pe(this,arguments,(function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ve(this)),n&&n.replaceChild(t,this))}),e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),w(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}}));var je=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),ze=/^--/,Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},He=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Be=new RegExp(re.join("|"),"i"),Ve="[\\x20\\t\\r\\n\\f]",We=new RegExp("^"+Ve+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ve+"+$","g");function Ue(e,t,n){var r,i,o,a,s=ze.test(t),l=e.style;return(n=n||Fe(e))&&(a=n.getPropertyValue(t)||n[t],s&&(a=a.replace(We,"$1")),""!==a||oe(e)||(a=w.style(e,t)),!f.pixelBoxStyles()&&je.test(a)&&Be.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,l=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),ie.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(f,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==s&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ie.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ie.removeChild(t)),s}}))}();var Ye=["Webkit","Moz","ms"],Xe=g.createElement("div").style,Ke={};function Ge(e){var t=w.cssProps[e]||Ke[e];return t||(e in Xe?e:Ke[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ye.length;n--;)if((e=Ye[n]+t)in Xe)return e}(e)||e)}var Je=/^(none|table(?!-c[ea]).+)/,Ze={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function et(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function tt(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=w.css(e,n+re[a],!0,i)),r?("content"===n&&(l-=w.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(l-=w.css(e,"border"+re[a]+"Width",!0,i))):(l+=w.css(e,"padding"+re[a],!0,i),"padding"!==n?l+=w.css(e,"border"+re[a]+"Width",!0,i):s+=w.css(e,"border"+re[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function nt(e,t,n){var r=Fe(e),i=(!f.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),o=i,a=Ue(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(je.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&i||!f.reliableTrDimensions()&&_(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===w.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+tt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ue(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=Y(t),l=ze.test(t),u=e.style;if(l||(t=Ge(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=Y(t);return ze.test(t)||(t=Ge(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ue(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],(function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!Je.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):He(e,Ze,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,o=Fe(e),a=!f.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===w.css(e,"boxSizing",!1,o),l=r?tt(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),l&&(i=ne.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),et(0,n,l)}}})),w.cssHooks.marginLeft=$e(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||e.getBoundingClientRect().left-He(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),w.each({margin:"",padding:"",border:"Width"},(function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+re[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=et)})),w.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)}),e,t,arguments.length>1)}}),w.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=rt.prototype.init,w.fx.step={};var it,ot,at=/^(?:toggle|show|hide)$/,st=/queueHooks$/;function lt(){ot&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(lt):e.setTimeout(lt,w.fx.interval),w.fx.tick())}function ut(){return e.setTimeout((function(){it=void 0})),it=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ht(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(e,t,n){var r,i,o=0,a=dt.prefilters.length,s=w.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=it||ut(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:it||ut(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=Y(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<a;o++)if(r=dt.prefilters[o].call(u,e,c,u.opts))return p(r.stop)&&(w._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,ht,u),p(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),w.fx.timer(w.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}w.Animation=w.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&se(e),g=G.get(e,"fxshow");for(r in n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[r],at.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}f[r]=g&&g[r]||w.style(e,r)}if((l=!w.isEmptyObject(t))||!w.isEmptyObject(f))for(r in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=g&&g.display)&&(u=G.get(e,"display")),"none"===(c=w.css(e,"display"))&&(u?c=u:(he([e],!0),u=e.style.display||u,c=w.css(e,"display"),he([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===w.css(e,"float")&&(l||(d.done((function(){p.display=u})),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=G.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&he([e],!0),d.done((function(){for(r in m||he([e]),G.remove(e,"fxshow"),f)w.style(e,r,f[r])}))),l=ht(m?g[r]:0,r,d),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){p(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=dt(this,w.extend({},e),o);(i||G.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=G.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&st.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=G.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),w.each(["toggle","show","hide"],(function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ct(t,!0),e,r,i)}})),w.each({slideDown:ct("show"),slideUp:ct("hide"),slideToggle:ct("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(it=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),it=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){ot||(ot=!0,lt())},w.fx.stop=function(){ot=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx&&w.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ft,pt=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return V(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){w.removeAttr(this,e)}))}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?ft:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&_(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ft={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=pt[t]||w.find.attr;pt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=pt[a],pt[a]=i,i=null!=n(e,t,r)?a:null,pt[a]=o),i}}));var mt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}w.fn.extend({prop:function(e,t){return V(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[w.propFix[e]||e]}))}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){w.propFix[this.toLowerCase()]=this})),w.fn.extend({addClass:function(e){var t,n,r,i,o,a;return p(e)?this.each((function(t){w(this).addClass(e.call(this,t,vt(this)))})):(t=bt(e)).length?this.each((function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}})):this},removeClass:function(e){var t,n,r,i,o,a;return p(e)?this.each((function(t){w(this).removeClass(e.call(this,t,vt(this)))})):arguments.length?(t=bt(e)).length?this.each((function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=yt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return p(e)?this.each((function(n){w(this).toggleClass(e.call(this,n,vt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=bt(e),this.each((function(){if(s)for(o=w(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==a||((r=vt(this))&&G.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":G.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=p(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,(function(e){return null==e?"":e+""}))),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(xt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:yt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!_(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=w.makeArray(t),a=i.length;a--;)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],(function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},f.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),f.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,qt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,r,i){var o,a,s,l,u,h,d,f,y=[r||g],v=c.call(t,"type")?t.type:t,b=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!wt.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),u=v.indexOf(":")<0&&"on"+v,(t=t[w.expando]?t:new w.Event(v,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[v]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!m(r)){for(l=d.delegateType||v,wt.test(l+v)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||g)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)f=a,t.type=o>1?l:d.bindType||v,(h=(G.get(a,"events")||Object.create(null))[t.type]&&G.get(a,"handle"))&&h.apply(a,n),(h=u&&a[u])&&h.apply&&X(a)&&(t.result=h.apply(a,n),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!X(r)||u&&p(r[v])&&!m(r)&&((s=r[u])&&(r[u]=null),w.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,qt),r[v](),t.isPropagationStopped()&&f.removeEventListener(v,qt),w.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each((function(){w.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),f.focusin||w.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t);i||r.addEventListener(e,n,!0),G.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t)-1;i?G.access(r,t,i):(r.removeEventListener(e,n,!0),G.remove(r,t))}}}));var Mt=e.location,Dt={guid:Date.now()},St=/\?/;w.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||w.error("Invalid XML: "+(r?w.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var kt=/\[\]$/,_t=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function At(e,t,n,r){var i;if(Array.isArray(t))w.each(t,(function(t,i){n||kt.test(e)?r(e,i):At(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)At(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=p(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,(function(){i(this.name,this.value)}));else for(n in e)At(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&Et.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!pe.test(e))})).map((function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,(function(e){return{name:t.name,value:e.replace(_t,"\r\n")}})):{name:t.name,value:n.replace(_t,"\r\n")}})).get()}});var Tt=/%20/g,It=/#.*$/,Rt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Lt={},jt={},zt="*/".concat("*"),Ft=g.createElement("a");function Ht(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(p(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Bt(e,t,n,r){var i={},o=e===jt;function a(s){var l;return i[s]=!0,w.each(e[s]||[],(function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Vt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}Ft.href=Mt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Vt(Vt(e,w.ajaxSettings),t):Vt(w.ajaxSettings,e)},ajaxPrefilter:Ht(Lt),ajaxTransport:Ht(jt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,l,u,c,h,d,f=w.ajaxSetup({},n),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?w(p):w.event,y=w.Deferred(),v=w.Callbacks("once memory"),b=f.statusCode||{},x={},q={},M="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Nt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=q[e.toLowerCase()]=q[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)D.always(e[D.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||M;return r&&r.abort(t),S(0,t),this}};if(y.promise(D),f.url=((t||f.url||Mt.href)+"").replace(Pt,Mt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(P)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ft.protocol+"//"+Ft.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=w.param(f.data,f.traditional)),Bt(Lt,f,n,D),u)return D;for(h in(c=w.event&&f.global)&&0==w.active++&&w.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),i=f.url.replace(It,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Tt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(St.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(Rt,"$1"),d=(St.test(i)?"&":"?")+"_="+Dt.guid+++d),f.url=i+d),f.ifModified&&(w.lastModified[i]&&D.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&D.setRequestHeader("If-None-Match",w.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&D.setRequestHeader("Content-Type",f.contentType),D.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+zt+"; q=0.01":""):f.accepts["*"]),f.headers)D.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,D,f)||u))return D.abort();if(M="abort",v.add(f.complete),D.done(f.success),D.fail(f.error),r=Bt(jt,f,n,D)){if(D.readyState=1,c&&m.trigger("ajaxSend",[D,f]),u)return D;f.async&&f.timeout>0&&(s=e.setTimeout((function(){D.abort("timeout")}),f.timeout));try{u=!1,r.send(x,S)}catch(e){if(u)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,a,l){var h,d,g,x,q,M=n;u||(u=!0,s&&e.clearTimeout(s),r=void 0,o=l||"",D.readyState=t>0?4:0,h=t>=200&&t<300||304===t,a&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,D,a)),!h&&w.inArray("script",f.dataTypes)>-1&&w.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,D,h),h?(f.ifModified&&((q=D.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=q),(q=D.getResponseHeader("etag"))&&(w.etag[i]=q)),204===t||"HEAD"===f.type?M="nocontent":304===t?M="notmodified":(M=x.state,d=x.data,h=!(g=x.error))):(g=M,!t&&M||(M="error",t<0&&(t=0))),D.status=t,D.statusText=(n||M)+"",h?y.resolveWith(p,[d,M,D]):y.rejectWith(p,[D,M,g]),D.statusCode(b),b=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[D,f,h?d:g]),v.fireWith(p,[D,M]),c&&(m.trigger("ajaxComplete",[D,f]),--w.active||w.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],(function(e,t){w[t]=function(e,n,r,i){return p(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}})),w.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return p(e)?this.each((function(t){w(this).wrapInner(e.call(this,t))})):this.each((function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=p(e);return this.each((function(n){w(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){w(this).replaceWith(this.childNodes)})),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Ut=w.ajaxSettings.xhr();f.cors=!!Ut&&"withCredentials"in Ut,f.ajax=Ut=!!Ut,w.ajaxTransport((function(t){var n,r;if(f.cors||Ut&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),w.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),w.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var $t,Yt=[],Xt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Dt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Xt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Xt,"$1"+i):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always((function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&p(o)&&o(a[0]),a=o=void 0})),"script"})),f.createHTMLDocument=(($t=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===$t.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),o=!n&&[],(i=C.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=yt(e.slice(s)),e=e.slice(0,s)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,(function(t){return e===t.elem})).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=w.css(e,"position"),c=w(e),h={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),l=w.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),p(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(h.top=t.top-s.top+a),null!=t.left&&(h.left=t.left-s.left+i),"using"in t?t.using.call(e,h):c.css(h)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){w.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||ie}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return V(this,(function(e,r,i){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=$e(f.pixelPosition,(function(e,n){if(n)return n=Ue(e,t),je.test(n)?w(e).position()[t]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return V(this,(function(t,n,i){var o;return m(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){w.fn[t]=function(e){return this.on(t,e)}})),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var Kt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||w.guid++,o},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=_,w.isFunction=p,w.isWindow=m,w.camelCase=Y,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(Kt,"$1")};var Gt=e.jQuery,Jt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Jt),t&&e.jQuery===w&&(e.jQuery=Gt),w},void 0===t&&(e.jQuery=e.$=w),w}))}(r);var i=r.exports,o={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};var a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var u=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(s,(function(e,n,r){var i=n.toLowerCase(),o=function(e){var t=e.match(l);return t?t.map(Number):[]}(r),s=n;if("m"===i&&o.length>2&&(t.push([s].concat(o.splice(0,2))),i="l",s="m"===s?"l":"L"),o.length<a[i])return"";for(t.push([s].concat(o.splice(0,a[i])));o.length>=a[i]&&o.length&&a[i];)t.push([s].concat(o.splice(0,a[i])));return""})),t};function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=u;function p(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),r=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=r}function m(e,t,n){e.x+=t,e.y+=n}function g(e,t){e.x*=t,e.y*=t}var y=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,h(t.segments)):t&&(this.segments=f(t))}var t,n,r;return t=e,n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,h(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,r,i,o){this.segments.push(["AC",e,t,n,r,i,!!o])}},{key:"arcTo",value:function(e,t,n,r,i){this.segments.push(["AT",e,t,n,r,i])}},{key:"ellipse",value:function(e,t,n,r,i,o,a,s){this.segments.push(["E",e,t,n,r,i,o,a,!!s])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,r,i,o){this.segments.push(["C",e,t,n,r,i,o])}},{key:"quadraticCurveTo",value:function(e,t,n,r){this.segments.push(["Q",e,t,n,r])}},{key:"rect",value:function(e,t,n,r){this.segments.push(["R",e,t,n,r])}}],n&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,r=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(i=t[1]);var a=t[0];o(this,a.segments),n.call(this,i)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),r.call(this)):r.call(this)};var i=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var r=t[1],a=t[2],s=t[3]||"nonzero",l=t[0];return o(this,l.segments),i.apply(this,[r,a,s])}return i.apply(this,t)},e.Path2D=t}function o(e,t){var n,r,i,o,a,s,l,u,c,h,d,f,y,v,b,x,w,q,M,D,S,k,_,C,E,A,T={x:0,y:0},I={x:0,y:0};e.beginPath();for(var R=0;R<t.length;++R){var N=t[R];switch("S"!==(D=N[0])&&"s"!==D&&"C"!==D&&"c"!==D&&(k=null,_=null),"T"!==D&&"t"!==D&&"Q"!==D&&"q"!==D&&(C=null,E=null),D){case"m":case"M":"m"===D?(d+=N[1],y+=N[2]):(d=N[1],y=N[2]),"M"!==D&&T||(T={x:d,y:y}),e.moveTo(d,y);break;case"l":d+=N[1],y+=N[2],e.lineTo(d,y);break;case"L":d=N[1],y=N[2],e.lineTo(d,y);break;case"H":d=N[1],e.lineTo(d,y);break;case"h":d+=N[1],e.lineTo(d,y);break;case"V":y=N[1],e.lineTo(d,y);break;case"v":y+=N[1],e.lineTo(d,y);break;case"a":case"A":"a"===D?(d+=N[6],y+=N[7]):(d=N[6],y=N[7]),x=N[1],w=N[2],l=N[3]*Math.PI/180,i=!!N[4],o=!!N[5],a={x:d,y:y},p(s={x:(I.x-a.x)/2,y:(I.y-a.y)/2},-l),(u=s.x*s.x/(x*x)+s.y*s.y/(w*w))>1&&(x*=u=Math.sqrt(u),w*=u),c=x*x*w*w,h=x*x*s.y*s.y+w*w*s.x*s.x,g(S={x:x*s.y/w,y:-w*s.x/x},o!==i?Math.sqrt((c-h)/h)||0:-Math.sqrt((c-h)/h)||0),r=Math.atan2((s.y-S.y)/w,(s.x-S.x)/x),n=Math.atan2(-(s.y+S.y)/w,-(s.x+S.x)/x),p(S,l),m(S,(a.x+I.x)/2,(a.y+I.y)/2),e.save(),e.translate(S.x,S.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,!o),e.restore();break;case"C":k=N[3],_=N[4],d=N[5],y=N[6],e.bezierCurveTo(N[1],N[2],k,_,d,y);break;case"c":e.bezierCurveTo(N[1]+d,N[2]+y,N[3]+d,N[4]+y,N[5]+d,N[6]+y),k=N[3]+d,_=N[4]+y,d+=N[5],y+=N[6];break;case"S":null!==k&&null!==_||(k=d,_=y),e.bezierCurveTo(2*d-k,2*y-_,N[1],N[2],N[3],N[4]),k=N[1],_=N[2],d=N[3],y=N[4];break;case"s":null!==k&&null!==_||(k=d,_=y),e.bezierCurveTo(2*d-k,2*y-_,N[1]+d,N[2]+y,N[3]+d,N[4]+y),k=N[1]+d,_=N[2]+y,d+=N[3],y+=N[4];break;case"Q":C=N[1],E=N[2],d=N[3],y=N[4],e.quadraticCurveTo(C,E,d,y);break;case"q":C=N[1]+d,E=N[2]+y,d+=N[3],y+=N[4],e.quadraticCurveTo(C,E,d,y);break;case"T":null!==C&&null!==E||(C=d,E=y),C=2*d-C,E=2*y-E,d=N[1],y=N[2],e.quadraticCurveTo(C,E,d,y);break;case"t":null!==C&&null!==E||(C=d,E=y),C=2*d-C,E=2*y-E,d+=N[1],y+=N[2],e.quadraticCurveTo(C,E,d,y);break;case"z":case"Z":d=T.x,y=T.y,T=void 0,e.closePath();break;case"AC":d=N[1],y=N[2],b=N[3],r=N[4],n=N[5],A=N[6],e.arc(d,y,b,r,n,A);break;case"AT":f=N[1],v=N[2],d=N[3],y=N[4],b=N[5],e.arcTo(f,v,d,y,b);break;case"E":d=N[1],y=N[2],x=N[3],w=N[4],l=N[5],r=N[6],n=N[7],A=N[8],e.save(),e.translate(d,y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,A),e.restore();break;case"R":d=N[1],y=N[2],q=N[3],M=N[4],T={x:d,y:y},e.rect(d,y,q,M)}I.x=d,I.y=y}}},v=u,b=y;"undefined"!=typeof window&&b(window);var x={path2dPolyfill:b,parsePath:v},w=Object.prototype.hasOwnProperty,q=Object.prototype.toString,M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,S=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===q.call(e)},k=function(e){if(!e||"[object Object]"!==q.call(e))return!1;var t,n=w.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&w.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||w.call(e,t)},_=function(e,t){M&&"__proto__"===t.name?M(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},C=function(e,t){if("__proto__"===t){if(!w.call(e,t))return;if(D)return D(e,t).value}return e[t]},E=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=C(s,n),s!==(i=C(t,n))&&(c&&i&&(k(i)||(o=S(i)))?(o?(o=!1,a=r&&S(r)?r:[]):a=r&&k(r)?r:{},_(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&_(s,{name:n,newValue:i}));return s},A="1.9.9";function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},z(e)}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function H(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function B(e,t,n){return B=H()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&F(i,n.prototype),i},B.apply(null,arguments)}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return V(e)}function U(e){var t=H();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return W(this,n)}}function $(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=z(e)););return e}function Y(){return Y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=$(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Y.apply(this,arguments)}function X(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||G(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||G(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){if(e){if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Z(e){return!!e.changedTouches}function Q(e){return"number"==typeof e&&!isNaN(e)}function ee(e){return"number"!=typeof e||isNaN(e)}function te(e){for(var t=e.length,n=NaN,r=NaN,i=NaN,o=NaN,a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function ne(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function re(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function ie(e){var t=X(te(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function oe(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function ae(e){var t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,u=t.y2,c=t.cx,h=t.cy,d=t.r,f=t.vertices;return Q(c)&&Q(h)&&Q(d)?"circle":Q(a)&&Q(s)&&Q(l)&&Q(u)?"line":Q(n)&&Q(r)&&Q(i)&&Q(o)?"rect":Q(n)&&Q(r)?"point":Array.isArray(f)?f.every((function(e){return Array.isArray(e)}))?"geopolygon":"polygon":null}function se(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function le(e,t){var n=t.types,r=t.logger,i={},o=[];Array.isArray(e)?o.push.apply(o,K(e)):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((function(e,t){var o=n(e.type);if(o){var a=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),a=t);var s=o({key:a,data:e.data,config:e.config});i[a]=s}}));return function(e){return e?i[e]:i[Object.keys(i)[0]]}}var ue=Math.PI,ce=2*ue,he=1e-6,de=ce-he;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pe(){return new fe}function me(e){return function(){return e}}fe.prototype=pe.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,u=o-e,c=a-t,h=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>he)if(Math.abs(c*s-l*u)>he&&i){var d=n-o,f=r-a,p=s*s+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=i*Math.tan((ue-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>he&&(this._+="L"+(e+b*u)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*d>u*f)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,u=t+s,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>he||Math.abs(this._y1-u)>he)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%ce+ce),h>de?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>he&&(this._+="A"+n+","+n+",0,"+ +(h>=ue)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var ge=Math.abs,ye=Math.atan2,ve=Math.cos,be=Math.max,xe=Math.min,we=Math.sin,qe=Math.sqrt,Me=1e-12,De=Math.PI,Se=De/2,ke=2*De;function _e(e){return e>1?0:e<-1?De:Math.acos(e)}function Ce(e){return e>=1?Se:e<=-1?-Se:Math.asin(e)}function Ee(e){return e.innerRadius}function Ae(e){return e.outerRadius}function Te(e){return e.startAngle}function Ie(e){return e.endAngle}function Re(e){return e&&e.padAngle}function Ne(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,d=h*l-c*u;if(!(d*d<Me))return[e+(d=(c*(t-o)-h*(e-i))/d)*l,t+d*u]}function Oe(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/qe(s*s+l*l),c=u*l,h=-u*s,d=e+c,f=t+h,p=n+c,m=r+h,g=(d+p)/2,y=(f+m)/2,v=p-d,b=m-f,x=v*v+b*b,w=i-o,q=d*m-p*f,M=(b<0?-1:1)*qe(be(0,w*w*x-q*q)),D=(q*b-v*M)/x,S=(-q*v-b*M)/x,k=(q*b+v*M)/x,_=(-q*v+b*M)/x,C=D-g,E=S-y,A=k-g,T=_-y;return C*C+E*E>A*A+T*T&&(D=k,S=_),{cx:D,cy:S,x01:-c,y01:-h,x11:D*(i/w-1),y11:S*(i/w-1)}}function Pe(){var e=Ee,t=Ae,n=me(0),r=null,i=Te,o=Ie,a=Re,s=null;function l(){var l,u,c=+e.apply(this,arguments),h=+t.apply(this,arguments),d=i.apply(this,arguments)-Se,f=o.apply(this,arguments)-Se,p=ge(f-d),m=f>d;if(s||(s=l=pe()),h<c&&(u=h,h=c,c=u),h>Me)if(p>ke-Me)s.moveTo(h*ve(d),h*we(d)),s.arc(0,0,h,d,f,!m),c>Me&&(s.moveTo(c*ve(f),c*we(f)),s.arc(0,0,c,f,d,m));else{var g,y,v=d,b=f,x=d,w=f,q=p,M=p,D=a.apply(this,arguments)/2,S=D>Me&&(r?+r.apply(this,arguments):qe(c*c+h*h)),k=xe(ge(h-c)/2,+n.apply(this,arguments)),_=k,C=k;if(S>Me){var E=Ce(S/c*we(D)),A=Ce(S/h*we(D));(q-=2*E)>Me?(x+=E*=m?1:-1,w-=E):(q=0,x=w=(d+f)/2),(M-=2*A)>Me?(v+=A*=m?1:-1,b-=A):(M=0,v=b=(d+f)/2)}var T=h*ve(v),I=h*we(v),R=c*ve(w),N=c*we(w);if(k>Me){var O,P=h*ve(b),L=h*we(b),j=c*ve(x),z=c*we(x);if(p<De&&(O=Ne(T,I,j,z,P,L,R,N))){var F=T-O[0],H=I-O[1],B=P-O[0],V=L-O[1],W=1/we(_e((F*B+H*V)/(qe(F*F+H*H)*qe(B*B+V*V)))/2),U=qe(O[0]*O[0]+O[1]*O[1]);_=xe(k,(c-U)/(W-1)),C=xe(k,(h-U)/(W+1))}}M>Me?C>Me?(g=Oe(j,z,T,I,h,C,m),y=Oe(P,L,R,N,h,C,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),C<k?s.arc(g.cx,g.cy,C,ye(g.y01,g.x01),ye(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,C,ye(g.y01,g.x01),ye(g.y11,g.x11),!m),s.arc(0,0,h,ye(g.cy+g.y11,g.cx+g.x11),ye(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,C,ye(y.y11,y.x11),ye(y.y01,y.x01),!m))):(s.moveTo(T,I),s.arc(0,0,h,v,b,!m)):s.moveTo(T,I),c>Me&&q>Me?_>Me?(g=Oe(R,N,P,L,c,-_,m),y=Oe(T,I,j,z,c,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<k?s.arc(g.cx,g.cy,_,ye(g.y01,g.x01),ye(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,ye(g.y01,g.x01),ye(g.y11,g.x11),!m),s.arc(0,0,c,ye(g.cy+g.y11,g.cx+g.x11),ye(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,ye(y.y11,y.x11),ye(y.y01,y.x01),!m))):s.arc(0,0,c,w,x,m):s.lineTo(R,N)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-De/2;return[ve(r)*n,we(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:me(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:me(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:me(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:me(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:me(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:me(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:me(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Le(e){this._context=e}function je(e){return new Le(e)}function ze(e){return e[0]}function Fe(e){return e[1]}function He(){var e=ze,t=null,n=me(0),r=Fe,i=me(!0),o=null,a=je,s=null;function l(l){var u,c,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(f=pe())),u=0;u<=p;++u){if(!(u<p&&i(d=l[u],u,l))===m)if(m=!m)c=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=c;--h)s.point(g[h],y[h]);s.lineEnd(),s.areaEnd()}m&&(g[u]=+e(d,u,l),y[u]=+n(d,u,l),s.point(t?+t(d,u,l):g[u],r?+r(d,u,l):y[u]))}if(f)return s=null,f+""||null}function u(){return function(){var e=ze,t=Fe,n=me(!0),r=null,i=je,o=null;function a(a){var s,l,u,c=a.length,h=!1;for(null==r&&(o=i(u=pe())),s=0;s<=c;++s)!(s<c&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(u)return o=null,u+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:me(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:me(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:me(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:me(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:me(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:me(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:me(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:me(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:me(+e),l):r},l.lineX0=l.lineY0=function(){return u().x(e).y(n)},l.lineY1=function(){return u().x(e).y(r)},l.lineX1=function(){return u().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:me(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function Be(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Ve(e){return e}Le.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var We=Array.prototype.slice;function Ue(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function $e(e){this._context=e}function Ye(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Xe(e,t){this._context=e,this._k=(1-t)/6}$e.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:Ue(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Ue(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Xe.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:Ye(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ye(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ke=function e(t){function n(e){return new Xe(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ge(e,t){this._context=e,this._alpha=t}Ge.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Me){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Me){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Je=function e(t){function n(e){return t?new Ge(e,t):new Xe(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Ze(e){return e<0?-1:1}function Qe(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Ze(o)+Ze(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function et(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tt(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function nt(e){this._context=e}function rt(e){this._context=new it(e)}function it(e){this._context=e}function ot(e){this._context=e}function at(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function st(e,t){this._context=e,this._t=t}function lt(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function ut(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ct(e,t){return e[t]}function ht(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function dt(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function ft(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0,i={},o=e||{get:function(){},has:function(){return!1},default:function(){}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e){return!!i[e]||o.has(e)}function u(e){var t=i[e];return delete i[e],t}function c(){return Object.keys(i)}function h(){return Object.keys(i).map((function(e){return i[e]}))}function d(e){return void 0!==e&&(t=e),t}function f(e,i){if(void 0!==i)return a(e,i);var o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),f.add=a,f.get=s,f.has=l,f.remove=u,f.getKeys=c,f.getValues=h,f.default=d,f.register=a,f}function pt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function mt(e){return(e=pt(Math.abs(e)))?e[1]:NaN}nt.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:tt(this,this._t0,et(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,tt(this,et(this,n=Qe(this,e,t)),n);break;default:tt(this,this._t0,n=Qe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(rt.prototype=Object.create(nt.prototype)).point=function(e,t){nt.prototype.point.call(this,t,e)},it.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=at(e),i=at(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},st.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var gt,yt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vt(e){if(!(t=yt.exec(e)))throw new Error("invalid format: "+e);var t;return new bt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function bt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function xt(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}vt.prototype=bt.prototype,bt.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 wt={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return xt(100*e,t)},r:xt,s:function(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(gt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+pt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function qt(e){return e}var Mt,Dt,St,kt=Array.prototype.map,_t=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ct(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?qt:(t=kt.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?qt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(kt.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=vt(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):wt[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=wt[v],q=/[defgprs%]/.test(v);function M(e){var i,o,l,d=b,M=x;if("c"===v)M=w(e)+M,e="";else{var D=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),D&&0==+e&&"+"!==h&&(D=!1),d=(D?"("===h?h:u:"-"===h||"("===h?"":h)+d,M=("s"===v?_t[8+gt/3]:"")+M+(D&&"("===h?")":""),q)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){M=(46===l?a+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}m&&!f&&(e=r(e,1/0));var S=d.length+e.length+M.length,k=S<p?new Array(p-S+1).join(t):"";switch(m&&f&&(e=r(k+e,k.length?p-M.length:1/0),k=""),n){case"<":e=d+e+M+k;break;case"=":e=d+k+e+M;break;case"^":e=k.slice(0,S=k.length>>1)+d+e+M+k.slice(S);break;default:e=k+d+e+M}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return e+""},M}return{format:h,formatPrefix:function(e,t){var n=h(((e=vt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(mt(t)/3))),i=Math.pow(10,-r),o=_t[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){Mt=Ct(e),Dt=Mt.format,St=Mt.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Et=new Date,At=new Date;function Tt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Tt((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Et.setTime(+t),At.setTime(+r),e(Et),e(At),Math.floor(n(Et,At))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var It=864e5,Rt=6048e5,Nt=Tt((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/It}),(function(e){return e.getDate()-1})),Ot=Nt;function Pt(e){return Tt((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Rt}))}Nt.range;var Lt=Pt(0),jt=Pt(1),zt=Pt(2),Ft=Pt(3),Ht=Pt(4),Bt=Pt(5),Vt=Pt(6);Lt.range,jt.range,zt.range,Ft.range,Ht.range,Bt.range,Vt.range;var Wt=Tt((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Wt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Tt((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Ut=Wt;Wt.range;var $t=Tt((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/It}),(function(e){return e.getUTCDate()-1})),Yt=$t;function Xt(e){return Tt((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Rt}))}$t.range;var Kt=Xt(0),Gt=Xt(1),Jt=Xt(2),Zt=Xt(3),Qt=Xt(4),en=Xt(5),tn=Xt(6);Kt.range,Gt.range,Jt.range,Zt.range,Qt.range,en.range,tn.range;var nn=Tt((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));nn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Tt((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var rn=nn;function on(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function an(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function sn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ln(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=mn(i),c=gn(i),h=mn(o),d=gn(o),f=mn(a),p=gn(a),m=mn(s),g=gn(s),y=mn(l),v=gn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ln,e:Ln,f:Bn,g:Qn,G:tr,H:jn,I:zn,j:Fn,L:Hn,m:Vn,M:Wn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Dr,s:Sr,S:Un,u:$n,U:Yn,V:Kn,w:Gn,W:Jn,x:null,X:null,y:Zn,Y:er,Z:nr,"%":Mr},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:rr,e:rr,f:lr,g:br,G:wr,H:ir,I:or,j:ar,L:sr,m:ur,M:cr,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Dr,s:Sr,S:hr,u:dr,U:fr,V:mr,w:gr,W:yr,x:null,X:null,y:vr,Y:xr,Z:qr,"%":Mr},w={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return D(e,t,n,r)},d:_n,e:_n,f:Rn,g:Mn,G:qn,H:En,I:En,j:Cn,L:In,m:kn,M:An,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Sn,Q:On,s:Pn,S:Tn,u:vn,U:bn,V:xn,w:yn,W:wn,x:function(e,t,r){return D(e,n,t,r)},X:function(e,t,n){return D(e,r,t,n)},y:Mn,Y:qn,Z:Dn,"%":Nn};function q(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=un[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function M(e,t){return function(n){var r,i,o=sn(1900,void 0,1);if(D(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=an(sn(o.y,0,1))).getUTCDay(),r=i>4||0===i?Gt.ceil(r):Gt(r),r=Yt.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=on(sn(o.y,0,1))).getDay(),r=i>4||0===i?jt.ceil(r):jt(r),r=Ot.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?an(sn(o.y,0,1)).getUTCDay():on(sn(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,an(o)):on(o)}}function D(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in un?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=q(n,b),b.X=q(r,b),b.c=q(t,b),x.x=q(n,x),x.X=q(r,x),x.c=q(t,x),{format:function(e){var t=q(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=M(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=q(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=M(e+="",!0);return t.toString=function(){return e},t}}}nn.range;var un={"-":"",_:" ",0:"0"},cn=/^\s*\d+/,hn=/^%/,dn=/[\\^$*+?|[\]().{}]/g;function fn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pn(e){return e.replace(dn,"\\$&")}function mn(e){return new RegExp("^(?:"+e.map(pn).join("|")+")","i")}function gn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function yn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function bn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function xn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=cn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Mn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Dn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Sn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function kn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function _n(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cn(e,t,n){var r=cn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function En(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function An(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=cn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function In(e,t,n){var r=cn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Rn(e,t,n){var r=cn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Nn(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function On(e,t,n){var r=cn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pn(e,t,n){var r=cn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ln(e,t){return fn(e.getDate(),t,2)}function jn(e,t){return fn(e.getHours(),t,2)}function zn(e,t){return fn(e.getHours()%12||12,t,2)}function Fn(e,t){return fn(1+Ot.count(Ut(e),e),t,3)}function Hn(e,t){return fn(e.getMilliseconds(),t,3)}function Bn(e,t){return Hn(e,t)+"000"}function Vn(e,t){return fn(e.getMonth()+1,t,2)}function Wn(e,t){return fn(e.getMinutes(),t,2)}function Un(e,t){return fn(e.getSeconds(),t,2)}function $n(e){var t=e.getDay();return 0===t?7:t}function Yn(e,t){return fn(Lt.count(Ut(e)-1,e),t,2)}function Xn(e){var t=e.getDay();return t>=4||0===t?Ht(e):Ht.ceil(e)}function Kn(e,t){return e=Xn(e),fn(Ht.count(Ut(e),e)+(4===Ut(e).getDay()),t,2)}function Gn(e){return e.getDay()}function Jn(e,t){return fn(jt.count(Ut(e)-1,e),t,2)}function Zn(e,t){return fn(e.getFullYear()%100,t,2)}function Qn(e,t){return fn((e=Xn(e)).getFullYear()%100,t,2)}function er(e,t){return fn(e.getFullYear()%1e4,t,4)}function tr(e,t){var n=e.getDay();return fn((e=n>=4||0===n?Ht(e):Ht.ceil(e)).getFullYear()%1e4,t,4)}function nr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+fn(t/60|0,"0",2)+fn(t%60,"0",2)}function rr(e,t){return fn(e.getUTCDate(),t,2)}function ir(e,t){return fn(e.getUTCHours(),t,2)}function or(e,t){return fn(e.getUTCHours()%12||12,t,2)}function ar(e,t){return fn(1+Yt.count(rn(e),e),t,3)}function sr(e,t){return fn(e.getUTCMilliseconds(),t,3)}function lr(e,t){return sr(e,t)+"000"}function ur(e,t){return fn(e.getUTCMonth()+1,t,2)}function cr(e,t){return fn(e.getUTCMinutes(),t,2)}function hr(e,t){return fn(e.getUTCSeconds(),t,2)}function dr(e){var t=e.getUTCDay();return 0===t?7:t}function fr(e,t){return fn(Kt.count(rn(e)-1,e),t,2)}function pr(e){var t=e.getUTCDay();return t>=4||0===t?Qt(e):Qt.ceil(e)}function mr(e,t){return e=pr(e),fn(Qt.count(rn(e),e)+(4===rn(e).getUTCDay()),t,2)}function gr(e){return e.getUTCDay()}function yr(e,t){return fn(Gt.count(rn(e)-1,e),t,2)}function vr(e,t){return fn(e.getUTCFullYear()%100,t,2)}function br(e,t){return fn((e=pr(e)).getUTCFullYear()%100,t,2)}function xr(e,t){return fn(e.getUTCFullYear()%1e4,t,4)}function wr(e,t){var n=e.getUTCDay();return fn((e=n>=4||0===n?Qt(e):Qt.ceil(e)).getUTCFullYear()%1e4,t,4)}function qr(){return"+0000"}function Mr(){return"%"}function Dr(e){return+e}function Sr(e){return Math.floor(+e/1e3)}var kr=ft();kr("d3-number",(function(e,t,n){var r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=Ct(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),kr("d3-time",(function(e){var t=ln({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=ln.apply(void 0,arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));var _r={id:function(e){return"".concat(e.source,"/").concat(e.key||e.title)},key:function(e){return String(e.key||e.title)},tags:function(e){return e.tags},min:function(e){return e.min},max:function(e){return e.max},type:function(e){return e.type},title:function(e){return String(e.title)},values:function(e){return e.values},value:function(e){return e},label:function(e){return e},formatter:function(e){return function(e){if("function"==typeof e.formatter)return e.formatter();var t=e.formatter||{};return kr(t.type||"d3-number")(t.format||"")}(e)}};function Cr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?_r.id:n,i=t.key,o=void 0===i?_r.key:i,a=t.min,s=void 0===a?_r.min:a,l=t.max,u=void 0===l?_r.max:l,c=t.type,h=void 0===c?_r.type:c,d=t.tags,f=void 0===d?_r.tags:d,p=t.title,m=void 0===p?_r.title:p,g=t.values,y=void 0===g?_r.values:g,v=t.value,b=void 0===v?_r.value:v,x=t.label,w=void 0===x?_r.label:x,q=t.formatter,M=void 0===q?_r.formatter:q,D={id:function(){return r(e)},key:function(){return o(e)},raw:function(){return e},tags:function(){return f(e)},type:function(){return h(e)},min:function(){return s(e)},max:function(){return u(e)},title:function(){return m(e)},items:function(){return y(e)},formatter:function(){return M(e)},value:b,label:w};return D}var Er={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,u=e[t[0]].length;l<u;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:lt,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}lt(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}lt(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,u=0;s<i;++s){for(var c=e[t[s]],h=c[a][1]||0,d=(h-(c[a-1][1]||0))/2,f=0;f<s;++f){var p=e[t[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,u+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=u/l)}n[a-1][1]+=n[a-1][0]=o,lt(e,t)}}},Ar={ascending:function(e){var t=e.map(dt);return ut(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(dt),o=function(e){var t=e.map(ht);return ut(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],u=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(l)},none:ut,reverse:function(e){return ut(e).reverse()}};function Tr(e,t,n){for(var r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",u=t.order||"none",c=t.valueRef||"",h=0,d={},f=0;f<e.items.length;f++){var p=e.items[f],m=c?p[c]:null;if(m&&m.source){var g="".concat(m.source.key||"","/").concat(m.source.field);d[g]||(d[g]=m.source)}var y=i(p);r[y]=r[y]||{items:[]},r[y].items.push(p),h=Math.max(h,r[y].items.length)}for(var v=Array.apply(null,{length:h}).map(Number.call,Number),b=Object.keys(r).map((function(e){return r[e].items})),x=function(){var e=me([]),t=ut,n=lt,r=ct;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,u=s.length,c=new Array(u);for(o=0;o<u;++o){for(var h,d=s[o],f=c[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+r(i[p],d,p,i)],h.data=i[p];f.key=d}for(o=0,a=t(c);o<u;++o)c[a[o]].index=o;return n(c,a),c}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:me(We.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:me(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?ut:"function"==typeof e?e:me(We.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?lt:e,i):n},i}().keys(v).value((function(e,t){return e[t]?o(e[t]):0})).order(Ar[u]).offset(Er[l]),w=x(b),q=[],M=0;M<w.length;M++)for(var D=w[M],S=0;S<D.length;S++){var k=D[S],_=D[S].data[D.key];_&&(_[a]={value:k[0]},_[s]={value:k[1]},q.push(k[0],k[1]))}var C=Object.keys(d).map((function(e){var t=n(d[e].key);return t?t.field(d[e].field):null})).filter((function(e){return!!e})),E=Cr({title:C.map((function(e){return e.title()})).join(", "),min:Math.min.apply(Math,q),max:Math.max.apply(Math,q),type:"measure",formatter:C[0]?C[0].formatter:void 0});e.fields.push(E)}function Ir(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=n.logger;if(Array.isArray(e))r.items=e.map((function(e){return{value:e,label:String(e)}}));else if(e){if("collection"in e)r=I({},t.collection(e.collection));else{var o=t.dataset?t.dataset(e.source):null,a=e.value||function(e){return e},s=e.label||function(e){return e};if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),r.items=[];else if(e.hierarchy)r.root=o.hierarchy?o.hierarchy(e.hierarchy):null,r.fields=o.fields();else if(e.items)r.items=e.items.map((function(e){return{value:a(e),label:String(s(e))}}));else if(e.extract){var l=Array.isArray(e.extract)?e.extract:[e.extract];r.items=[];var u=[];l.forEach((function(e){var n=e.source?t.dataset(e.source):o;n&&(r.items=[].concat(K(r.items),K(n.extract(e))),void 0!==e.field&&u.push(n.field(e.field)))})),u.length&&(r.fields=u),e.amend&&Array.isArray(e.amend)&&(r.items=[].concat(K(r.items),K(e.amend)))}else if(void 0!==e.field&&o){var c=o.field(e.field);c&&(r.fields||(r.fields=[]),r.fields.push(c),"value"in e||(a=c.value||function(e){return e},s=c.label||function(e){return e},r.value=a),r.items=c.items().map((function(t){return{value:a(t),label:String(s(t)),source:{field:e.field}}})))}else e.fields&&e.fields.forEach((function(e){var n,i="object"===R(e)&&e.source?t.dataset(e.source):o;i&&((n="object"===R(e)&&void 0!==e.field?i.field(e.field):i.field(e))&&(r.fields||(r.fields=[]),r.fields.push(n)))}));r.items&&e.map&&(r.items=r.items.map(e.map))}e&&e.stack&&Tr(r,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&r.items&&(r.items=r.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&r.items&&(r.items=r.items.sort(e.sort)),r}function Rr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ir,i={};(e||[]).forEach((function(e){if(!e.key)throw new Error('Data collection is missing "key" property');if("object"===R(e.data)&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=function(){return r(e.data,t,n)}}));var o=function(e){var t,n;if("string"==typeof e?t=e:"object"===R(e)&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());var r=i[t];if(n&&n.fields&&n.fields.filter){var o=r.fields.filter(n.fields.filter);r.fields.length!==o.length&&(r=E(r,{fields:o}))}return r};return o}function Nr(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ir;if(e.data){var o=i(e.data,t,n);if(o&&o.fields&&o.fields[0])return o.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){var a=n.formatter.get(r)(e.format||"");return a}throw new Error("Formatter of type '".concat(r,"' was not found"))}function Or(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nr,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"===R(o)&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}function Pr(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Lr=function(e){return 1===e.length&&(e=function(e){return function(t,n){return Pr(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}(Pr),jr=Lr.right;function zr(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}var Fr=Math.sqrt(50),Hr=Math.sqrt(10),Br=Math.sqrt(2);function Vr(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Fr?10:o>=Hr?5:o>=Br?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Fr?10:o>=Hr?5:o>=Br?2:1)}function Wr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Ur="$";function $r(){}function Yr(e,t){var n=new $r;if(e instanceof $r)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Xr(){}$r.prototype=Yr.prototype={constructor:$r,has:function(e){return Ur+e in this},get:function(e){return this[Ur+e]},set:function(e,t){return this[Ur+e]=t,this},remove:function(e){var t=Ur+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ur&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ur&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ur&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ur&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ur&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ur)return!1;return!0},each:function(e){for(var t in this)t[0]===Ur&&e(this[t],t.slice(1),this)}};var Kr=Yr.prototype;Xr.prototype={constructor:Xr,has:Kr.has,add:function(e){return this[Ur+(e+="")]=e,this},remove:Kr.remove,clear:Kr.clear,values:Kr.keys,size:Kr.size,empty:Kr.empty,each:Kr.each};var Gr=Array.prototype,Jr=Gr.map,Zr=Gr.slice,Qr={name:"implicit"};function ei(){var e=Yr(),t=[],n=[],r=Qr;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Qr)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=Yr();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=Zr.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return ei(t,n).unknown(r)},Wr.apply(i,arguments),i}function ti(){var e,t,n=ei().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){var n=r().length,c=o[1]<o[0],h=o[c-0],d=o[1-c];e=(d-h)/Math.max(1,n-s+2*l),a&&(e=Math.floor(e)),h+=(d-h-e*(n-s))*u,t=e*(1-s),a&&(h=Math.round(h),t=Math.round(t));var f=zr(n).map((function(t){return h+e*t}));return i(c?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),c()):r()},n.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},n.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,c()):a},n.padding=function(e){return arguments.length?(s=Math.min(1,l=+e),c()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),c()):s},n.paddingOuter=function(e){return arguments.length?(l=+e,c()):l},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},n.copy=function(){return ti(r(),o).round(a).paddingInner(s).paddingOuter(l).align(u)},Wr.apply(c(),arguments)}function ni(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ri(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ii(){}var oi=.7,ai=1/oi,si="\\s*([+-]?\\d+)\\s*",li="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ui="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ci=/^#([0-9a-f]{3,8})$/,hi=new RegExp("^rgb\\("+[si,si,si]+"\\)$"),di=new RegExp("^rgb\\("+[ui,ui,ui]+"\\)$"),fi=new RegExp("^rgba\\("+[si,si,si,li]+"\\)$"),pi=new RegExp("^rgba\\("+[ui,ui,ui,li]+"\\)$"),mi=new RegExp("^hsl\\("+[li,ui,ui]+"\\)$"),gi=new RegExp("^hsla\\("+[li,ui,ui,li]+"\\)$"),yi={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 vi(){return this.rgb().formatHex()}function bi(){return this.rgb().formatRgb()}function xi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ci.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?wi(t):3===n?new Si(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?qi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?qi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=hi.exec(e))?new Si(t[1],t[2],t[3],1):(t=di.exec(e))?new Si(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=fi.exec(e))?qi(t[1],t[2],t[3],t[4]):(t=pi.exec(e))?qi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=mi.exec(e))?Ei(t[1],t[2]/100,t[3]/100,1):(t=gi.exec(e))?Ei(t[1],t[2]/100,t[3]/100,t[4]):yi.hasOwnProperty(e)?wi(yi[e]):"transparent"===e?new Si(NaN,NaN,NaN,0):null}function wi(e){return new Si(e>>16&255,e>>8&255,255&e,1)}function qi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Si(e,t,n,r)}function Mi(e){return e instanceof ii||(e=xi(e)),e?new Si((e=e.rgb()).r,e.g,e.b,e.opacity):new Si}function Di(e,t,n,r){return 1===arguments.length?Mi(e):new Si(e,t,n,null==r?1:r)}function Si(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ki(){return"#"+Ci(this.r)+Ci(this.g)+Ci(this.b)}function _i(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function Ci(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ei(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ti(e,t,n,r)}function Ai(e){if(e instanceof Ti)return new Ti(e.h,e.s,e.l,e.opacity);if(e instanceof ii||(e=xi(e)),!e)return new Ti;if(e instanceof Ti)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ti(a,s,l,e.opacity)}function Ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ii(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Ri(e){return function(){return e}}function Ni(e){return 1==(e=+e)?Oi:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ri(isNaN(t)?n:t)}}function Oi(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ri(isNaN(e)?t:e)}ni(ii,xi,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:vi,formatHex:vi,formatHsl:function(){return Ai(this).formatHsl()},formatRgb:bi,toString:bi}),ni(Si,Di,ri(ii,{brighter:function(e){return e=null==e?ai:Math.pow(ai,e),new Si(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?oi:Math.pow(oi,e),new Si(this.r*e,this.g*e,this.b*e,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:ki,formatHex:ki,formatRgb:_i,toString:_i})),ni(Ti,(function(e,t,n,r){return 1===arguments.length?Ai(e):new Ti(e,t,n,null==r?1:r)}),ri(ii,{brighter:function(e){return e=null==e?ai:Math.pow(ai,e),new Ti(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?oi:Math.pow(oi,e),new Ti(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Si(Ii(e>=240?e-240:e+120,i,r),Ii(e,i,r),Ii(e<120?e+240:e-120,i,r),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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Pi=function e(t){var n=Ni(t);function r(e,t){var r=n((e=Di(e)).r,(t=Di(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Oi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Li(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function ji(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Ui(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function zi(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Fi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Hi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Ui(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Bi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vi=new RegExp(Bi.source,"g");function Wi(e,t){var n,r,i,o=Bi.lastIndex=Vi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Bi.exec(e))&&(r=Vi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Fi(n,r)})),o=Vi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Ui(e,t){var n,r=typeof t;return null==t||"boolean"===r?Ri(t):("number"===r?Fi:"string"===r?(n=xi(t))?(t=n,Pi):Wi:t instanceof xi?Pi:t instanceof Date?zi:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Li:Array.isArray(t)?ji:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Hi:Fi)(e,t)}function $i(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Yi(e){return+e}var Xi=[0,1];function Ki(e){return e}function Gi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ji(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Zi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Gi(i,r),o=n(a,o)):(r=Gi(r,i),o=n(o,a)),function(e){return o(r(e))}}function Qi(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Gi(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=jr(e,t,1,r)-1;return o[n](i[n](t))}}function eo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function to(e,t){return function(){var e,t,n,r,i,o,a=Xi,s=Xi,l=Ui,u=Ki;function c(){return r=Math.min(a.length,s.length)>2?Qi:Zi,i=o=null,h}function h(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return h.invert=function(n){return u(t((o||(o=r(s,a.map(e),Fi)))(n)))},h.domain=function(e){return arguments.length?(a=Jr.call(e,Yi),u===Ki||(u=Ji(a)),c()):a.slice()},h.range=function(e){return arguments.length?(s=Zr.call(e),c()):s.slice()},h.rangeRound=function(e){return s=Zr.call(e),l=$i,c()},h.clamp=function(e){return arguments.length?(u=e?Ji(a):Ki,h):u!==Ki},h.interpolate=function(e){return arguments.length?(l=e,c()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function no(e,t,n,r){var i,o=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Fr?i*=10:o>=Hr?i*=5:o>=Br&&(i*=2),t<e?-i:i}(e,t,n);switch((r=vt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(mt(t)/3)))-mt(Math.abs(e)))}(o,a))||(r.precision=i),St(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,mt(t)-mt(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-mt(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Dt(r)}function ro(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Vr(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return no(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Vr(s,l,n))>0?r=Vr(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Vr(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function io(){var e=to(Ki,Ki);return e.copy=function(){return eo(e,io())},Wr.apply(e,arguments),ro(e)}function oo(){var e,t=[.5],n=[0,1],r=1;function i(i){return i<=i?n[jr(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Zr.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Zr.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return oo().domain(t).range(n).unknown(e)},Wr.apply(i,arguments)}function ao(e){return void 0===e?function(e){return e}:function(t){return e(t)}}function so(e){return Math.max(0,Math.min(1,e))}function lo(e){return"object"===R(e)}function uo(e,t,n){for(var r=Math.abs(t-n)/(e+1),i=[],o=1;o<=e;o++){var a=o*r;i.push(t<n?t+a:t-a)}return i}function co(e,t,n){if(1===e.length)return e;for(var r=e.concat([]),i=0;i<e.length;i++){var o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push.apply(r,K(uo(t,o,a))),o-=a-o,a=e[i],r.push.apply(r,K(uo(t,o,a)))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push.apply(r,K(uo(t,o,a)))):r.push.apply(r,K(uo(t,o,a)))}return r.filter((function(e){return e>=n.min()&&e<=n.max()}))}function ho(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=ee(a)||ee(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),h=n.ticks(c);h.length<=1&&(h=n.ticks(c+1));var d=i>0?co(h,i,n):h;d.sort((function(e,t){return e-t}));var f=d.map(ao(l));return d.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:f[t],value:e,isMinor:-1===h.indexOf(e)}}))}function fo(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=ee(a)||ee(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),h=c>10?10:c;n.nice(h);var d=n.ticks(c),f=i>0?co(d,i,n):d;f.sort((function(e,t){return e-t}));var p=f.map(ao(l));return f.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===d.indexOf(e)}}))}function po(e){var t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?function(e){return e}:o,s=n.minorTicks&&!ee(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){var l=n.ticks.values.filter((function(e){return"object"===R(e)?!ee(e.value):!ee(e)}));t=function(e){var t=e.values,n=e.scale,r=e.formatter,i=void 0===r?function(e){return e}:r;return t.sort((function(e,t){return(lo(e)?e.value:e)-(lo(t)?t.value:t)})).filter((function(e,t,r){var i=lo(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((function(e){var t=lo(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?so(n(e.start)):o,end:t&&!isNaN(e.end)?so(n(e.end)):o}}))}({values:l,scale:r.copy(),formatter:a})}else if(ee(n.ticks.count)){t=(n.ticks.tight?fo:ho)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){var r=e.map((function(e){return e.position})),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);var o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){var t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((function(e,t){var o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function mo(e){var t=e.scale,n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((function(e,n){var a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}function go(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return Object.keys(t).forEach((function(i){var o=R(e[i]);r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}var yo={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},vo={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},bo={count:NaN};function xo(e,t){var n=+e.min,r=+e.max,i=0,o=1;if(t&&t[0]){var a=t.map((function(e){return e.min()})).filter((function(e){return!isNaN(e)})),s=t.map((function(e){return e.max()})).filter((function(e){return!isNaN(e)}));if(i=a.length?Math.min.apply(Math,K(a)):Number.NaN,o=s.length?Math.max.apply(Math,K(s)):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){var l=o-i;i-=l*e.expand,o+=l*e.expand}if(Array.isArray(e.include)){var u=e.include.filter((function(e){return!isNaN(e)}));i=Math.min.apply(Math,K(u).concat([i])),o=Math.max.apply(Math,K(u).concat([o]))}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}function wo(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function qo(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=io(),o={instance:null,invert:!1},a={data:n,resources:r},s=go(t,yo,a);function l(e){return ee(e)?NaN:i(e)}s.ticks=go(t.ticks,vo,a),s.minorTicks=go(t.minorTicks,bo,a),l.data=function(){return n},l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return e},l.clearTicksCache=function(){return e=void 0,this},l.ticks=function(t){return null!==t&&"object"===R(t)?(t.settings=t.settings||{},t.settings=E(!0,{},s,t.settings),t.scale=l,e=po(t)):e=i.ticks(t)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),o.instance&&o.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){for(var t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2,o=0;o<e;o++){var a=n[n.length-1]||0,s=a+t,u=l(a+i);n.push.apply(n,[s,s]),r.push.apply(r,[u,u])}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){var e=qo(t,n,r);return e.domain(l.domain()),e.range(l.range()),e.clamp(i.clamp()),e},l.norm=function(e){return wo(o,l),o.instance(e)},l.normInvert=function(e){return wo(o,l),o.instance.invert(e)};var u=xo(s,n?n.fields:[]),c=u.mini,h=u.maxi;return l.domain([c,h]),l.range(s.invert?[1,0]:[0,1]),o.invert=s.invert,l}var Mo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Do(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={data:t,resources:n},i=go(e,Mo,r),o=t.items||[],a={},s=[],l=[];function u(e,n){e.data=function(){return t},e.datum=function(e){return o[a[e]]},e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=function(){return l},e.ticks=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,mo(t,n.trackBy)}}var c=ti();u(c,e),c.pxScale=function(t){var n=i.maxPxStep;if(isNaN(n))return c;var r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;var a=c.copy();a.type=c.type,u(a,e);var s=o*n/t,l=(1-s)*c.align();return a.range(i.invert?[s+l,l]:[l,s+l]),a};for(var h="function"==typeof e.value?e.value:function(e){return e.datum.value},d="function"==typeof e.label?e.label:function(e){return e.datum.label},f=0;f<o.length;f++){var p=E({datum:o[f]},r),m=h(p,f);-1===s.indexOf(m)&&(s.push(m),l.push(d(p,f)),a[m]=f)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}var So={depth:0};function ko(e,t,n){return e.ancestors().map((function(e){return t(E({datum:e.data},n))})).reverse().slice(1).toString()}function _o(e,t,n){var r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},u=[],c=0;if(!e)return{values:a,labels:s,items:l,ticks:u};e.eachAfter((function(e){if(e.depth>0){var t=ko(e,i,n),h=e.leaves()||[e],d=i(E({datum:e.data},n)),f=o(E({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:ko(h[0],i,n),rightEdge:ko(h[Math.max(h.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(c,"_SPACER")),c++):(a.push(t),s.push(f)),(r<=0&&!p||e.depth===r)&&u.push(m),l[t]=m}}));var h=e.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:u}}var Co=function(e){return e.min()},Eo=function(e){return e.max()};function Ao(e,t){var n=e&&!isNaN(e.min),r=e&&!isNaN(e.max),i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){var a=t.map(Co).filter(Q);i=a.length?Math.min.apply(Math,K(a)):i}if(!r){var s=t.map(Eo).filter(Q);o=s.length?Math.max.apply(Math,K(s)):o}}return[i,o]}var To={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Io(e,t,n){var r=e.length;if(2===r)return[t,n];var i=[],o=(n-t)/(r-1);i.push(t);for(var a=1;a<r-1;a++)i.push(t+o*a);return i.push(n),i}function Ro(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=qo(e,t,n).clamp(!0).interpolate(Pi),i=go(e,To,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;E(!0,s,r);var l=Ao(i,t?t.fields:[]),u=X(l,2),c=u[0],h=u[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[],p=a?i.range:f;return s.range(i.invert?p.slice().reverse():p.slice()),s.domain(o?i.domain:Io(s.range(),c,h)),s}var No={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Oo(e,t,n){var r=e.length;if(2===r)return[t+(n-t)/2];for(var i=[],o=(n-t)/r,a=1;a<r;a++)i.push(t+o*a);return i}function Po(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;var i=Ro().domain([n,r]).range(t),o=[n].concat(K(function(e){for(var t=[],n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}(e)),[r]);return o.map((function(e){return i(e)}))}function Lo(e,t,n){var r=2===e.length?10:Math.max(1,e.length),i=io().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;for(var o=Math.max(0,e.length-1);i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}var jo={domain:[],range:[]};function zo(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ei(),i={data:t,resources:n},o=go(e,jo,i),a="function"==typeof e.value?e.value:function(e){return e.datum.value},s="function"==typeof e.label?e.label:function(e){return e.datum.label},l=t.items||[],u={},c=[],h=[],d=0;d<l.length;d++){var f=E({datum:l[d]},i),p=a(f,d);-1===c.indexOf(p)&&(c.push(p),h.push(s(f,d)),u[p]=d)}return r.data=function(){return t},r.labels=function(){return h},r.label=function(e){return h[c.indexOf(e)]},r.datum=function(e){return l[u[e]]},r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(c),r}var Fo={domain:[],range:[],unknown:void 0},Ho={domain:[],range:[],override:!1};var Bo=ft();function Vo(e,t,n){var r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((function(e){r.extract.push({field:e})})));var i,o=Ir(r,t,n),a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?(t=e.fields,n=t.map((function(e){return"dimension"===e.type()?"band":"linear"})),-1!==n.indexOf("linear")?"linear":"band"):"linear";var t,n}(o);return"color"===a&&(a=o.fields&&o.fields[0]&&"dimension"===o.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&((i=(i=n.scale.get(a))(e,o,{theme:n.theme,logger:n.logger})).type=a),i}function Wo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Vo,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}Bo("linear",qo),Bo("band",Do),Bo("h-band",(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={data:n,resources:r},o=go(t,Mo,i);o.ticks=go(t.ticks,So,i),o.value="function"==typeof t.value?t.value:function(e){return e.datum.value},o.label="function"==typeof t.label?t.label:function(e){return e.datum.value};var a=Do(o),s=_o(n.root,o,i),l=s.values,u=s.labels,c=s.items,h=s.ticks,d=function(e){var t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};E(!0,d,a),d.bandwidth=function(e){var t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){var r=d(t.leftEdge),i=d(t.rightEdge);return Math.abs(r-i)+n}return n},d.step=function(e){var t=c[String(e)],n=t?t.count:1,r=a.step();return r*=n},d.data=function(){return n},d.datum=function(e){var t=c[String(e)];return t?t.node.data:null},d.copy=function(){return e(t,n,r)},d.labels=function(){return u},d.ticks=function(){return h.map((function(e){var t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}))};var f=a.pxScale;return d.pxScale=function(e){return a=f(e),d},d.domain(l),d})),Bo("sequential-color",Ro),Bo("threshold-color",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=oo(),i=go(e,No,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return ee(e)?NaN:r(e)}Object.keys(r).forEach((function(e){return s[e]=r[e]}));var l=t.fields,u=Ao(i,l),c=X(u,2),h=c[0],d=c[1],f=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",f>0?f:2):[],m=a?i.range:p,g=[];return g=o?i.domain:i.nice?Lo(m,h,d):[h+(d-h)/2],m.length>g.length+1?g=Oo(m,h,d):m.length<g.length+1&&(m=Po(g,m,h,d)),s.data=function(){return t},s.range(i.invert?m.slice().reverse():m),s.domain(g),s})),Bo("categorical-color",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=zo(t,n,r),o=r.theme,a=go(t,Fo,{data:n,resources:r});if(a.explicit=go(t.explicit,Ho,{data:n,resources:r}),e=Array.isArray(a.range)&&0!==a.range.length?a.range.slice():o?o.palette("categorical",i.domain().length).slice():[],a.unknown)i.unknown(a.unknown);else if(o&&o.palette("unknown")){var s=o.palette("unknown");i.unknown(s[0])}if(Array.isArray(a.explicit.domain)&&a.explicit.domain.length){for(var l=i.domain().slice(),u=a.explicit.domain,c=Array.isArray(a.explicit.range)?a.explicit.range:[],h=Math.floor(l.length/e.length),d=1;d<h+1;d*=2)e=e.concat(e);if(a.explicit.override)for(var f=0;f<u.length;f++){var p=l.indexOf(u[f]);p>-1&&(e[p]=c[f])}else{var m=u.map((function(e,t){return[l.indexOf(e),e,c[t]]})).sort((function(e,t){return e[0]-t[0]}));m.forEach((function(t){var n=l.indexOf(t[1]);-1!==n&&e.splice(n,0,t[2])}))}e.length=l.length}return i.range(e),i}));var Uo={};function $o(){$o.init.call(this)}Uo.isObject=function(e){return"object"==typeof e&&null!==e},Uo.isNumber=function(e){return"number"==typeof e},Uo.isUndefined=function(e){return void 0===e},Uo.isFunction=function(e){return"function"==typeof e};var Yo=$o;$o.EventEmitter=$o,$o.prototype._events=void 0,$o.prototype._maxListeners=void 0,$o.defaultMaxListeners=10,$o.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},$o.prototype.setMaxListeners=function(e){if(!Uo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},$o.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Uo.isUndefined(n))return!1;if(Uo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Uo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},$o.prototype.addListener=function(e,t){var n;if(!Uo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Uo.isFunction(t.listener)?t.listener:t),this._events[e]?Uo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Uo.isObject(this._events[e])&&!this._events[e].warned)&&((n=Uo.isUndefined(this._maxListeners)?$o.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Uo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Uo.isFunction(console.trace)&&console.trace()));return this},$o.prototype.on=$o.prototype.addListener,$o.prototype.once=function(e,t){if(!Uo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},$o.prototype.removeListener=function(e,t){var n,r,i,o;if(!Uo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Uo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Uo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},$o.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Uo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},$o.prototype.listeners=function(e){return this._events&&this._events[e]?Uo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},$o.listenerCount=function(e,t){return e._events&&e._events[t]?Uo.isFunction(e._events[t])?1:e._events[t].length:0};var Xo=function(e){return Object.keys(Yo.prototype).forEach((function(t){e[t]=Yo.prototype[t]})),Yo.init(e),e};function Ko(){var e=0,t=0,n=0,r=0;n=n||e;var i={move:function(e){this.moveTo(n+e)},moveTo:function(o){var a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update:function(o){var a=!1,s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);var u=Math.max(e,Math.min(t-r,n));n!==u&&(n=u,a=!0),a&&i.emit("update")},getState:function(){return{min:e,max:t,start:n,viewSize:r}}};return Xo(i),i}function Go(e,t){var n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Ko();return o.update({min:n,max:r,viewSize:i}),o}function Jo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Go(e[r],t?t[r]:null));return n}function Zo(e,t){return t[e]||(t[e]=Ko()),t[e]}function Qo(e,t){return e<=t}function ea(e,t){return e<t}function ta(e,t,n){for(var r=0;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function na(e,t,n,r){for(var i=e.length,o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}function ra(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.includeMax,i=void 0===r||r,o=n.includeMin,a=void 0===o||o;e=i?Qo:ea,t=a?Qo:ea},i.add=function(e){var t,n=e.min,i=e.max,o=ta(r,n),a=ta(r,i,!0),s=[o,a-o];o%2==0&&s.push(n),a%2==0&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.remove=function(e){var t,n=e.min,i=e.max,o=ta(r,n),a=ta(r,i,!0),s=[o,a-o];o%2==1&&s.push(n),a%2==1&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.set=function(e){var t=r.join(",");return r=[],Array.isArray(e)?e.forEach(i.add):i.add(e),t!==r.join(",")},i.clear=function(){var e=r.length>0;return r=[],e},i.containsValue=function(n){return na(r,n,t,e)},i.containsRange=function(e){var t=e.min,n=e.max,i=ta(r,t,!0),o=ta(r,n);return i===o&&o%2==1},i.toggle=function(e){return i.containsRange(e)?i.remove(e):i.add(e)},i.ranges=function(){for(var e=[],t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function ia(){var e=[];function t(){}return t.add=function(t){return-1===e.indexOf(t)&&(e.push(t),!0)},t.remove=function(t){var n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=function(t){return-1!==e.indexOf(t)},t.values=function(){return e.slice()},t.clear=function(){return e=[]},t.toString=function(){return e.join(";")},t}var oa={key:void 0,includeMin:!0,includeMax:!0};function aa(e){for(var t,n,r=e.items,i=e.collection,o=e.vc,a={},s=[],l=0,u=r.length;l<u;l++){i[t=r[l].key]||(i[t]=o()),n=r[l].values||[r[l].value];for(var c=0;c<n.length;c++)i[t].add(n[c])&&(a[t]=a[t]||[],a[t].push(n[c]))}for(var h=Object.keys(a),d=0,f=h.length;d<f;d++)t=h[d],s.push({id:t,values:a[t]});return s}function sa(e){for(var t,n,r=e.items,i=e.collection,o={},a=[],s=0,l=r.length;s<l;s++)if(i[t=r[s].key]){n=r[s].values||[r[s].value];for(var u=0;u<n.length;u++)i[t].remove(n[u])&&(o[t]=o[t]||[],o[t].push(n[u]))}for(var c=Object.keys(o),h=0,d=c.length;h<d;h++)t=c[h],a.push({id:t,values:o[t]});return a}function la(e){for(var t,n,r={},i=0,o=e.length;i<o;i++){t=e[i].key,n=e[i].values||[e[i].value],r[t]||(r[t]=[]);for(var a=0;a<n.length;a++){-1===r[t].indexOf(n[a])&&r[t].push(n[a])}}return r}function ua(e){var t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function ca(e){for(var t,n,r,i=e.items,o=e.values,a=e.vc,s={},l={},u=[],c=[],h=la(i),d=Object.keys(h),f=0,p=d.length;f<p;f++)for(var m=0,g=(r=h[t=d[f]]).length;m<g;m++)n=r[m],o[t]&&o[t].contains(n)?o[t]&&o[t].contains(n)&&(l[t]=l[t]||[],l[t].push(n),o[t].remove(n)):ua({key:t,value:n,collection:o,obj:s,fn:a});for(var y=Object.keys(s),v=0,b=y.length;v<b;v++)t=y[v],u.push({id:t,values:s[t]});for(var x=Object.keys(l),w=0,q=x.length;w<q;w++)t=x[w],c.push({id:t,values:l[t]});return[u,c]}function ha(e,t){for(var n,r,i=[],o=Object.keys(e),a=function(e){return-1===t[n].indexOf(e)},s=0,l=o.length;s<l;s++)n=o[s],t[n]?(r=e[n].filter(a)).length&&i.push({id:n,values:r}):i.push({id:n,values:e[n]});return i}function da(e){for(var t,n,r=e.items,i=e.vCollection,o=e.vc,a={},s=la(r),l={},u=Object.keys(i),c=0,h=u.length;c<h;c++)l[n=u[c]]=i[n].values().slice(),delete i[n];for(var d=function(e){i[n]&&i[n].contains(e)||ua({key:n,value:e,collection:i,obj:a,fn:o})},f=Object.keys(s),p=0,m=f.length;p<m;p++)s[n=f[p]].forEach(d);return t=ha(l,a),[ha(a,l),t]}function fa(e,t,n){var r=function(e,t){if(!Object.keys(t).length)return e;for(var n=e.length,r=Array(n),i=0;i<n;i++)r[i]=e[i].key in t?E({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((function(e,t){return t(e)}),r):r}function pa(e){return e.replace(/(-[a-z])/g,(function(e){return e.toUpperCase().replace("-","")}))}function ma(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))}function ga(e,t,n){var r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig,l=fa(i["".concat(t,"Ranges")],e,a),u=!1;return l.forEach((function(e){var n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)u=r[n][t](e.ranges||e.range)||u;else for(var i=e.ranges||[e.range],a=0;a<i.length;a++)u=r[n][t](i[a])||u})),u}function ya(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?ia:t,r=e.rc,i=void 0===r?ra:r,o=!1,a={},s={},l={},u={sources:{},default:E({},oa)},c={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},h=function(){var e={values:{},ranges:{}};return Object.keys(s).forEach((function(t){e.values[t]=s[t].values()})),Object.keys(a).forEach((function(t){e.ranges[t]=a[t].ranges()})),e},d={ls:[],clear:function(){this.ls.forEach((function(e){return e.clear()}))},start:function(){this.ls.forEach((function(e){return e.start()}))},end:function(){this.ls.forEach((function(e){return e.end()}))},update:function(){var e=h();this.ls.forEach((function(t){return t._state(e)}))},updateValues:function(){var e=h();this.ls.forEach((function(t){return t._state({values:e.values})}))},updateRanges:function(){var e=h();this.ls.forEach((function(t){return t._state({ranges:e.ranges})}))}},f={configure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(u={sources:{},default:E({},oa)},e.ranges.forEach((function(e){var t={};Object.keys(oa).filter((function(e){return"key"!==e})).forEach((function(n){t[n]=void 0!==e[n]?e[n]:oa[n]})),void 0!==e.key?u.sources[e.key]=t:u.default=t})),Object.keys(a).forEach((function(e){return a[e].configure(u.sources[e]||u.default)})),f.emit("update",[],[]))},link:function(e){if(f===e)throw new Error("Can't link to self");d.ls.push(e),e._state(h())},_state:function(e){if(!e)return h();if(e.values){var t=[];Object.keys(e.values).forEach((function(n){s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(s).forEach((function(n){e.values[n]||t.push({key:n,values:[]})})),t.length&&f.setValues(t)}if(e.ranges){var n=[];Object.keys(e.ranges).forEach((function(t){a[t]&&e.ranges[t].join(";")===a[t].toString()||n.push({key:t,ranges:e.ranges[t]})})),Object.keys(a).forEach((function(t){e.ranges[t]||n.push({key:t,ranges:[]})})),n.length&&f.setRanges(n)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit.apply(f,["start"].concat(t)),d.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit.apply(f,["end"].concat(t)),d.end()}},isActive:function(){return o},clear:function(){var e=f.brushes().filter((function(e){return"value"===e.type&&e.brush.values().length})).map((function(e){return{id:e.id,values:e.brush.values()}})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(f.emit("update",[],e),d.clear())},brushes:function(){var e=[];return e=(e=e.concat(Object.keys(a).map((function(e){return{type:"range",id:e,brush:a[e]}})))).concat(Object.keys(s).map((function(e){return{type:"value",id:e,brush:s[e]}})))},addValue:function(e,t){f.addValues([{key:e,value:t}])},addValues:function(e){var t=fa(c.addValues,e,l),r=aa({vc:n,collection:s,items:t});f.emit("add-values",t),r.length&&(o||(o=!0,f.emit("start")),f.emit("update",r,[]),d.updateValues())},setValues:function(e){var t=fa(c.setValues,e,l),r=da({items:t,vCollection:s,vc:n});f.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),d.updateValues())},removeValue:function(e,t){f.removeValues([{key:e,value:t}])},removeValues:function(e){var t=fa(c.removeValues,e,l),n=sa({collection:s,items:t});f.emit("remove-values",t),n.length&&(f.emit("update",[],n),d.updateValues())},addAndRemoveValues:function(e,t){var r=fa(c.addValues,e,l),i=fa(c.removeValues,t,l),a=aa({vc:n,collection:s,items:r}),u=sa({collection:s,items:i});f.emit("add-values",r),f.emit("remove-values",i),(a.length||u.length)&&(o||(o=!0,f.emit("start")),f.emit("update",a,u),d.updateValues())},toggleValue:function(e,t){f.toggleValues([{key:e,value:t}])},toggleValues:function(e){var t=fa(c.toggleValues,e,l),r=ca({items:t,values:s,vc:n});f.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),d.updateValues())},containsValue:function(e,t){var n=l[e]||e;return!!s[n]&&s[n].contains(t)},addRange:function(e,t){f.addRanges([{key:e,range:t}])},addRanges:function(e){ga(e,"add",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),d.updateRanges())},removeRange:function(e,t){f.removeRanges([{key:e,range:t}])},removeRanges:function(e){ga(e,"remove",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),d.updateRanges())},setRange:function(e,t){f.setRanges([{key:e,range:t}])},setRanges:function(e){ga(e,"set",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),d.updateRanges())},toggleRange:function(e,t){f.toggleRanges([{key:e,range:t}])},toggleRanges:function(e){ga(e,"toggle",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),d.updateRanges())},containsRangeValue:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},containsRange:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},containsMappedData:function(e,t,n){for(var r,i,o,u,c=[],h=Object.keys(e),d=0,f=h.length;d<f;d++){if("value"===(r=h[d]))i=e,c[d]={key:"",i:d,bool:!1};else{if("source"===r)continue;i=e[r],c[d]={key:r,i:d,bool:!1}}void 0!==(o=i.source&&i.source.field)&&(void 0!==i.source.key&&(o="".concat(i.source.key,"/").concat(o)),o in l&&(o=l[o]),u=i.value,a[o]?c[d].bool=Array.isArray(u)?a[o].containsRange({min:u[0],max:u[1]}):a[o].containsValue(u):s[o]&&s[o].contains(u)&&(c[d].bool=!0))}return t?(c=c.filter((function(e){return-1!==t.indexOf(e.key)})),"and"===n?!!c.length&&!c.some((function(e){return!1===e.bool})):"xor"===n?!!c.length&&c.some((function(e){return e.bool}))&&c.some((function(e){return!1===e.bool})):c.some((function(e){return e.bool}))):c.some((function(e){return e.bool}))},intercept:function(e,t){var n=pa(e);c[n]&&c[n].push(t)},removeInterceptor:function(e,t){var n=pa(e);if(c[n]){var r=c[n].indexOf(t);-1!==r&&c[n].splice(r,1)}},removeAllInterceptors:function(e){var t=[];if(e){var n=pa(e);c[n]&&c[n].length&&t.push({name:e,handlers:c[n]})}else Object.keys(c).forEach((function(e){c[e].length&&t.push({name:ma(e),handlers:c[e]})}));t.forEach((function(e){e.handlers.slice().forEach((function(t){return f.removeInterceptor(e.name,t)}))}))},addKeyAlias:function(e,t){l[e]=t},removeKeyAlias:function(e){delete l[e]}};return Xo(f),f}function va(e){return e*e*e}function ba(e){return--e*e*e+1}function xa(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function wa(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}ft();var qa={shouldBeRemoved:!1,isInit:!1};function Ma(e,t,n){var r,i=e.old,o=e.current,a=t.renderer,s=[],l={nodes:[],ips:[]},u={nodes:[],ips:[]},c={nodes:[],ips:[]},h=[],d=null,f=n.trackBy||wa,p={start:function(){var e={};if(i.forEach((function(t,n){var r=f(t,n);e[r]=t})),o.forEach((function(t,n){var r=f(t,n);e[r]?(c.ips.push(Hi(e[r],t)),c.nodes.push(t),s.push(e[r]),e[r]=!1):(l.nodes.push(t),l.ips.push(Hi(E({},t,{r:.001,opacity:0}),t)))})),Object.keys(e).forEach((function(t){e[t]&&(u.nodes.push(e[t]),u.ips.push(Hi(e[t],E({},e[t],{r:1e-4,opacity:0}))))})),h.push({name:"exiting",easing:va,duration:200,tweens:u.ips,nodes:[].concat(s)}),h.push({name:"updating",easing:xa,duration:400,tweens:c.ips,nodes:[]}),h.push({name:"entering",easing:ba,duration:200,tweens:l.ips,nodes:K(c.nodes)}),n.isMainComponent){var t,m=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,g=m?s.filter(m).length:s.length;!1===qa.isInit?(qa.shouldBeRemoved=0===g,qa.isInit=!0):qa.shouldBeRemoved=qa.shouldBeRemoved&&0===g}h.length&&(d=a.getScene(o),h[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(p.tick)))},tick:function(){var e=h[0];e||p.stop(),e.started||(e.started=Date.now());var t=(Date.now()-e.started)/e.duration,n=[],i=e.tweens.map((function(n){return n(e.easing(Math.min(1,t)))}));n.push.apply(n,K(i)),n.push.apply(n,K(e.nodes)),a.render(n),t>=1&&(h.shift(),h.length?"updating"===h[0].name&&qa.shouldBeRemoved&&h.shift():(!0===qa.isInit&&(qa.isInit=!1),p.stop())),r&&(r=window.requestAnimationFrame(p.tick))},stop:function(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:function(){return!!r},get targetScene(){return d}};return p}var Da={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Sa=/^\$/;function ka(e){var t=R(e);return"object"!==t&&"function"!==t&&"undefined"!==t}function _a(e,t,n){var r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Ca(e,t){return e.pxScale?e.pxScale(t):e}var Ea={normalizeSettings:function(e,t,n){var r=E({},e),i=E({},t);return Object.keys(r).forEach((function(e){i[e]={};var o=r[e],a=R(o);if("function"==typeof o)i[e].fn=o;else if(ka(o)){var s=t[e];"string"==typeof s&&Sa.test(s)&&(s=Da[s]);var l=R(s);i[e]="undefined"===l||l===a?o:s}else o&&"object"===R(o)&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((function(e){if(!(e in r)){var n=t[e];"string"===R(n)&&Sa.test(n)?i[e]=Da[n]:i[e]=n}})),i},resolveForItem:function(e,t,n){for(var r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum,l=0;l<o;l++){var u=i[l],c=t[u],h="object"===R(s)&&void 0!==c,d=h&&"string"==typeof c.ref,f=h&&u in s,p=d?s[c.ref]:f?s[u]:a;ka(c)?r[u]=c:h&&c.fn?(c.scale&&(e.scale=c.scale),r[u]=c.fn.call(null,e,n)):h&&c.scale&&p?(r[u]=c.scale(p.value),c.scale.bandwidth&&(r[u]+=c.scale.bandwidth()/2)):d&&p?r[u]=p.value:c.fn?r[u]=c.fn.call(null,e,n):r[u]=c}return r},updateScaleSize:_a};function Aa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ea,n={};function r(r){var i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled,u=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach((function(e){u[e]&&t.updateScaleSize(u,e,l[e])}));var h=[];if(!i||!Array.isArray(i.items)){var d={data:i,resources:c},f=t.resolveForItem(d,n.norm,-1);return{settings:n.norm,item:f}}for(var p,m=0,g=i.items.length;m<g;m++){p={datum:i.items[m],data:i,resources:c};var y=t.resolveForItem(p,n.norm,m);y.data=i.items[m],h.push(y)}return{settings:n.norm,items:h}}return{resolve:r}}function Ta(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((function(e,t){return Array.isArray(t.children)?(e.push.apply(e,K(Ta(t.children))),e):(e.push(t),e)}),[])}function Ia(e,t){var n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode,s=e.chart.brush(n),l=r,u=i.active||{},c=i.inactive||{},h=[];Object.keys(u).forEach((function(e){h.push(e)})),Object.keys(c).forEach((function(e){-1===h.indexOf(e)&&h.push(e)}));var d=[],f=!1,p=function(){var t=Ta(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=function(){for(var e,t=p(),n=t.length,r=!1,i="function"==typeof l?l({brush:s}):l,o=function(n){if(!(e=t[n].data))return"continue";t[n].__style||(t[n].__style={},h.forEach((function(e){t[n].__style[e]=t[n][e]})));var r=s.containsMappedData(e,i,a),o=d.indexOf(t[n]),l=!1;r&&-1===o?(d.push(t[n]),l=!0):r||-1===o||(d.splice(o,1),l=!0),t[n].needToUpdate=l||f,t[n].isActive=r},m=0;m<n;m++)o(m);for(var g=function(n){if(!(e=t[n].data))return"continue";if(t[n].needToUpdate){var i=E({},t[n],t[n].__style),o=t[n].isActive;h.forEach((function(e){t[n][e]=o&&e in u?"function"==typeof u[e]?u[e].call(null,i,d):u[e]:!o&&e in c?"function"==typeof c[e]?c[e].call(null,i,d):c[e]:t[n].__style[e]})),r=!0}delete t[n].needToUpdate},y=0;y<n;y++)g(y);return f=!1,r},g=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=p(),i=r.length,o=function(e){if(!r[e].data)return"continue";r[e].__style=r[e].__style||{},h.forEach((function(t){r[e].__style[t]=r[e][t],t in c&&(r[e][t]="function"==typeof c[t]?c[t].call(null,r[e]):c[t])}))},a=0;a<i;a++)o(a);f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=p(),i=r.length,o=function(e){r[e].__style&&(Object.keys(r[e].__style).forEach((function(t){r[e][t]=r[e].__style[t]})),r[e].__style=void 0)},a=0;a<i;a++)o(a);d.length=0,n||e.renderer.render(e.nodes)},v=function(){if(m()){var t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",v),{isActive:function(){return s.isActive()},update:function(){d.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function Ra(e){for(var t=e.nodes,n=e.action,r=e.chart,i=e.trigger,o=[],a=0;a<t.length;a++){var s=t[a].data;null!==s&&o.push(s)}!function(e){var t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(i){var o=i.data||[""],a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(var l=function(e){var n=t[e];if(!n)return"continue";o.forEach((function(e){var t=n&&!e?n:n[e];if(t){var r={key:t.source.field};void 0!==t.source.key&&(r.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(r.range={min:t.value[0],max:t.value[1]},a.items.push(r)):(r.value=t.value,s.items.push(r))}}))},u=0;u<t.length;u++)l(u);i.contexts.forEach((function(e){a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}}({dataPoints:o,action:n,chart:r,trigger:i})}function Na(e){var t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));var s=o.map((function(e){return e.node}));return Ra({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function Oa(e,t,n){var r=n.element().getBoundingClientRect(),i=Z(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&Z(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!Z(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Pa(e,t,n){return e?"function"==typeof e?e(t):e:n}function La(e){var t=e.e,n=e.t,r=e.config;return Na({collisions:Oa(t,n,r.renderer),t:n,config:r,action:Pa(n.action,t,"toggle")})}function ja(e){var t=e.e,n=e.t,r=e.config;return Na({collisions:Oa(t,n,r.renderer),t:n,config:r,action:Pa(n.action,t,"set")})}var za={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Fa(e,t){Object.keys(za).forEach((function(n){var r=t[n];void 0!==r&&(e[za[n]]=r)}))}function Ha(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var i=e[r];n+=0===r?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Ba(e,t,n,r){var i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Va(e){return-e/180*Math.PI}function Wa(e){return function(e){var t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Va(e))}function Ua(e,t){return{x:e.x+t.x,y:e.y+t.y}}function $a(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ya(e,t){return{x:e.x*t,y:e.y*t}}function Xa(e,t){return e.x-t.x}function Ka(e,t){return e.y-t.y}function Ga(e,t){return Math.pow(Xa(e,t),2)+Math.pow(Ka(e,t),2)}function Ja(e,t){return Math.sqrt(Ga(e,t))}function Za(e,t){return e.x*t.x+e.y*t.y}function Qa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0},r=Math.cos(t),i=Math.sin(t),o=$a(e,n),a={x:r*o.x-i*o.y,y:i*o.x+r*o.y};return Ua(a,n)}var es={up:0,down:180,left:90,right:-90};function ts(e){var t=e.x,n=e.y,r=e.size,i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}var ns=ft();function rs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((function(n){void 0!==za[n]&&"transform"!==n&&(e[n]=t[n])}))}ns.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),ns.add("diamond",(function(e){var t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:Ha([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),ns.add("saltire",(function(e){var t=Va(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n),o=e.size,a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;var s={x:e.x,y:e.y},l=Ba(e.x,e.y,o,i).map((function(e){return Qa(e,t,s)}));return{type:"path",fill:"black",d:Ha(l)}})),ns.add("square",(function(e){var t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),ns.add("triangle",(function(e){var t=e.size,n={x:e.x,y:e.y},r=es[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i,s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}],l=Va(r);return{type:"path",fill:"black",d:Ha(s=s.map((function(e){return Qa(e,l,n)})))}})),ns.add("line",(function(e){var t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:ts(e)}})),ns.add("star",(function(e){for(var t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i,l=1;l<=i;l++){var u=s*l+a,c=Va(u),h=Va(u+s/2),d=Math.sin(c),f=Math.cos(c),p=Math.sin(h),m=Math.cos(h);n.push({x:e.x+f*r,y:e.y+d*r}),n.push({x:e.x+m*o,y:e.y+p*o})}return{type:"path",fill:"black",d:Ha(n)}})),ns.add("n-polygon",(function(e){for(var t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle,a=1;a<=r;a++){var s=Va(i*a+o),l=Math.sin(s),u=Math.cos(s);t.push({x:e.x+u*n,y:e.y+l*n})}return{type:"path",fill:"black",d:Ha(t)}})),ns.add("cross",(function(e){var t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:Ha(Ba(t,n,e.size,o))}})),ns.add("bar",(function(e){var t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2,o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){var a=Va(90);o=o.map((function(e){return Qa(e,a,t)}))}var s=ie(o);return s.type="rect",s.fill="black",s})),ns.add("rect",(function(e){var t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));var is=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ns;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.get(t.type);if(n){var r=n(t);return rs(r,t),void 0!==t.data&&(r.data=t.data),r}return n}};function os(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,u=void 0===l?0:l,c=e.minimumLayoutMode,h=e.show,d=void 0===h||h;r=r||"center";var f={computePreferredSize:function(e){var n=e.inner,r=e.outer,i=e.children;return"function"==typeof u?u({inner:n,outer:r,children:i,dock:this.dock()},t):u},dock:function(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder:function(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder:function(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode:function(e){return void 0!==e?(c=e,this):"function"==typeof c?c(t):c},show:function(e){return void 0!==e?(d=e,this):"function"==typeof d?d(t):d}};return f}function as(e,t,n){var r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,u=n.data,c=n.renderer,h=n.chart,d=n.dockConfig,f=n.mediator,p=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,q=n.isVisible;e.emit=function(){},q&&(e.isVisible=q),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:u}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach((function(n){var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((function(e){return e===r}))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((function(t){"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:h}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})})),Object.keys(o).forEach((function(t){e.mediator.on(t,o[t].bind(e))}))}function ss(e,t,n){var r=function(t){return e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0},i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function ls(e,t,n){Object.keys(n.on||{}).forEach((function(r){e.eventListeners=e.eventListeners||[];var i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit.apply(t,[e].concat(r))}}function us(e,t){e.eventListeners&&(e.eventListeners.forEach((function(e){var n=e.event,r=e.listener;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=function(){}}function cs(e,t,n){var r=Ua(function(e,t){var n=Za(e,t)/Za(t,t)||1;return{x:t.x*n,y:t.y*n}}($a(n,e),$a(t,e)),e);return r}function hs(e,t,n){return Ja(e,n)+Ja(t,n)-Ja(e,t)<1e-12}function ds(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function fs(e){return e.x1===e.x2&&e.y1===e.y2}function ps(e){return e.width<=0||e.height<=0}function ms(e){return e.r<=0}function gs(e){return e.edges.length<=2}function ys(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===Ds(e,oe(t.edges[n])))return!0;return!1}function vs(e,t){for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++){if(!0===Rs(e,r[i]))return!0}return!1}function bs(e,t){return!ms(e)&&Ga({x:e.cx,y:e.cy},t)<=Math.pow(e.r,2)}function xs(e,t){if(ps(t)||ms(e))return!1;var n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,u=Math.abs(s-i),c=Math.abs(l-o);return!(u>n+a||c>r+a)&&(u<=n||c<=r||Math.pow(u-n,2)+Math.pow(c-r,2)<=Math.pow(a,2))}function ws(e,t){if(ms(e)||fs(t))return!1;var n=X(ne(t),2),r=n[0],i=n[1];if(bs(e,r)||bs(e,i))return!0;var o={x:e.cx,y:e.cy},a=cs(r,i,o);return Ga(a,o)<=Math.pow(e.r,2)&&hs(r,i,a)}function qs(e,t){if(gs(t)||ms(e))return!1;if(Ms(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.edges.length,r=0;r<n;r++){if(ws(e,oe(t.edges[r])))return!0}return!1}function Ms(e,t){if(gs(e)||!Cs(e.boundingRect(),t))return!1;var n,r,i,o,a,s=t.x,l=t.y,u=e.vertices;for(n=!1,o=-1,i=(r=u.length)-1;++o<r;i=o){if(u[o].x===s&&u[o].y===l)return!0;if(u[o].y===u[i].y&&u[o].y===l&&(s-u[o].x)*(s-u[i].x)<=0)return!0;if(u[o].y<l&&l<=u[i].y||u[i].y<l&&l<=u[o].y){if(s===(a=(u[i].x-u[o].x)*(l-u[o].y)/(u[i].y-u[o].y)+u[o].x))return!0;s<a&&(n=!n)}}return n}function Ds(e,t){if(gs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(As(t,oe(e.edges[n])))return!0}var i=X(ne(t),2),o=i[0],a=i[1];return Ms(e,o)||Ms(e,a)}function Ss(e,t){if(gs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Es(t,oe(e.edges[n])))return!0}var i=X(re(t),4),o=i[0],a=i[1],s=i[2],l=i[3];return Ms(e,o)||Ms(e,a)||Ms(e,s)||Ms(e,l)}function ks(e,t){return!ps(e)&&!ps(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function _s(e,t){return!ps(e)&&!ps(t)&&[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((function(t){return Cs(e,t)}))}function Cs(e,t){return!ps(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Es(e,t){if(fs(t)||ps(e))return!1;var n=X(ne(t),2),r=n[0],i=n[1];if(Cs(e,r)||Cs(e,i))return!0;for(var o=re(e),a=o.length,s=0;s<a;s++){if(As(oe([o[s],o[3!==s?s+1:0]]),t))return!0}return!1}function As(e,t){var n,r,i=X(ne(e),2),o=i[0],a=i[1],s=X(ne(t),2),l=s[0],u=s[1],c=Xa(a,o),h=Ka(a,o),d=Xa(u,l),f=Ka(u,l),p=Xa(o,l),m=Ka(o,l),g=f*c-d*h,y=d*m-f*p,v=c*m-h*p;if(0===c&&0===h)return!1;if(0===d&&0===f)return!1;if(0===g){if(0===y&&0===v){if(0===c){if(0===h)return o.x===a.x&&o.y===a.y;n=Ka(l,o)/h,r=Ka(u,o)/h}else n=(l.x-o.x)/c,r=(u.x-o.x)/c;return!(n<0&&r<0||n>1&&r>1)}return!1}var b=y/g;return g=v/g,b>=0&&b<=1&&g>=0&&g<=1}function Ts(e,t){if(fs(e))return!1;var n=X(ne(e),2);return hs(n[0],n[1],t)}function Is(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!ks(n,r)&&(_s(n,r)?ys(e,t):ys(t,e))}function Rs(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!ks(n,r)&&(_s(r,n)?function(e,t){for(var n=e.numPolygons,r=e.polygons,i=0;i<n;i++)if(!0===Is(t,r[i]))return!0;return!1}(e,t):function(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===Ps(e,oe(t.edges[n])))return!0;return!1}(e,t))}function Ns(e,t){if(ms(e))return!1;if(Os(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++)for(var o=r[i],a=o.edges.length,s=0;s<a;s++){if(ws(e,oe(o.edges[s])))return!0}return!1}function Os(e,t){if(!Cs(e.boundingRect(),t))return!1;var n,r,i,o,a,s,l=t.x,u=t.y,c=e.numPolygons,h=!1;for(r=0;r<c;r++)for(a=-1,o=(i=(n=e.vertices[r]).length)-1;++a<i;o=a){if(n[a].x===l&&n[a].y===u)return!0;if(n[a].y===n[o].y&&n[a].y===u&&(l-n[a].x)*(l-n[o].x)<=0)return!0;if(n[a].y<u&&u<=n[o].y||n[o].y<u&&u<=n[a].y){if(l===(s=(n[o].x-n[a].x)*(u-n[a].y)/(n[o].y-n[a].y)+n[a].x))return!0;l<s&&(h=!h)}}return h}function Ps(e,t){var n=X(ne(t),2),r=n[0],i=n[1];if(Os(e,r)||Os(e,i))return!0;for(var o=e.numPolygons,a=e.polygons,s=0;s<o;s++)for(var l=a[s],u=0,c=l.edges.length;u<c;u++){if(As(t,oe(l.edges[u])))return!0}return!1}function Ls(e,t){var n=X(re(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(Os(e,r)||Os(e,i)||Os(e,o)||Os(e,a))return!0;for(var s=e.numPolygons,l=e.polygons,u=0;u<s;u++)for(var c=l[u],h=0,d=c.edges.length;h<d;h++){if(Es(t,oe(c.edges[h])))return!0}return!1}var js=/^\$/,zs="@extend";function Fs(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Hs(e,t,n){if("string"==typeof e){var r=t[e];return-1!==n.indexOf(e)&&Fs(e),js.test(r)?(n.push(e),Hs(r,t,n)):r}var i=e,o=E(!0,{},t,e),a={};if(e[zs]){var s=e[zs];-1!==n.indexOf(s)&&Fs(s);var l=n.slice();l.push(s),i=E(!0,{},Hs(o[s],t,l),e)}return Object.keys(i).forEach((function(e){var t=n.slice();if(e!==zs&&!js.test(e)){a[e]=i[e];var r=a[e];js.test(r)&&r in o?(-1!==n.indexOf(r)&&Fs(r),t.push(r),"object"===R(r=o[r])||js.test(r)&&r in o?a[e]=Hs(r,o,t):a[e]=r):"object"===R(r)&&(a[e]=Hs(r,o,t))}})),a}function Bs(e,t){return Hs(e,t,[])}function Vs(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Ws(e,t){var n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Vs(r),Vs(n),{logicalContainerRect:r,containerRect:n}}function Us(e){var t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return E(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function $s(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Ys(e,t,n){if(void 0===e.cachedSize){var r,i=e.config.dock(),o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Xs(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Ks(e,t){var n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Gs(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);var r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);var i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Js(e,t,n,r,i){var o=E({},t),a=E({},n);Xs(o,r),Ks(a,r),Gs(e,o,a);var s=function(e,t,n){var r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(Xs(t,r),Ks(n,r),!0)}function Zs(e){var t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings,o=$s(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((function(e,t){return e.config.prioOrder()-t.config.prioOrder()}));for(var l=0;l<s.length;++l){var u=s[l];Ys(u,o,t),Js(t,o,a,u,i)||(r.push(s.splice(l,1)[0]),--l)}!function(e,t){if(0!==t.length)for(var n=0;n<e.length;++n){var r=e[n];if(r.referencedDocks.length){var i=r.referencedDocks.every((function(e){return t.some((function(t){return t.key===e}))}));i&&t.push(e.splice(n,1)[0])}}}(n,r);var c=n.filter((function(e){return-1!==s.indexOf(e)}));return n.length=0,n.push.apply(n,K(c)),Gs(t,o,a),o}function Qs(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function el(e){var t;return ie((t=[]).concat.apply(t,K(e.map(re))))}function tl(e){var t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation,a=$s(r.x,r.y,r.width,r.height),s=$s(r.x,r.y,r.width,r.height),l={},u=t.slice(),c=u.slice().sort((function(e,t){return e.config.displayOrder()-t.config.displayOrder()}));return t.sort((function(e,t){if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;var n=e.config.displayOrder()-t.config.displayOrder();return 0===n?u.indexOf(e)-u.indexOf(t):n})).forEach((function(e){var t={},u={};switch(e.config.dock()){case"top":t.height=u.height=e.cachedSize,t.width=n.width,u.width=a.width,t.x=n.x,u.x=a.x,t.y=u.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,u.x=a.x,t.y=u.y=a.y+a.height,t.width=n.width,u.width=a.width,t.height=u.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=u.x=s.x-e.cachedSize,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=u.x=s.x+s.width,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=u.x=r.x,t.y=u.y=r.y,t.width=u.width=r.width,t.height=u.height=r.height;break;default:if(e.referencedDocks.length>0){var c=e.referencedDocks.map((function(e){return l[e]})).filter((function(e){return!!e}));c.length>0&&(t=el(c.map((function(e){return e.outerRect}))),u=el(c.map((function(e){return e.r}))))}}e.key&&(l[e.key]={r:u,outerRect:t}),function(e,t,n,r){var i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){var a=i.x<i.y,s=Math.min(i.x,i.y);i.x=s,i.y=s;var l=a?"height":"width",u=(r[l]-n[l]*i.x)*n.align;o.left=a?0:u,o.top=a?u:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(u,t,n,i),u.edgeBleed=e.edgeBleed,u.computed=Qs(u),t.edgeBleed=e.edgeBleed,t.computed=Qs(t),u.x+=o.x,u.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(u,t),e.cachedSize=void 0,e.edgeBleed=void 0})),c}function nl(e,t,n){var r=e.layoutModes||{},i=t.minimumLayoutMode(),o=t.show();return o&&"object"===R(i)?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function rl(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function il(e,t,n){for(var r=[],i=[],o=0;o<e.length;++o){var a=e[o];rl(a);var s=a.dockConfig,l=a.key,u=s.dock(),c=/@/.test(u)?u.split(",").map((function(e){return e.replace(/^\s*@/,"")})):[];nl(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:c}):i.push({comp:a,key:l,config:s,referencedDocks:c})}return[r,i]}var ol=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},al=function e(t){return null==t?void 0:t.map((function(t){var n=t.instance.dockConfig();return{preferredSize:function(r){return n.computePreferredSize(I(I({},r),{},{children:e(t.children)}))}}}))},sl=function(e,t){return{visible:[],hidden:t,ordered:[]}},ll=function(e){return function(t,n){var r,i=n.map((function(e,t){var n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:function(t){return n.computePreferredSize(I(I({},t),{},{children:al(e.children)}))}}})),o=function(e){return n[e.index]},a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,u=a.hidden,c=void 0===u?[]:u,h=a.ordered,d=void 0===h?l:h;return{visible:l.map(o),hidden:c.map(o),ordered:d.map(o)}}},ul=function(e){var t=function(e){var t=Us(e),n={layout:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};var r=Ws(e,t),i=r.logicalContainerRect,o=r.containerRect,a=X(il(n,t,i),2),s=a[0],l=a[1],u=tl({visible:s,layoutRect:i,reducedRect:Zs({layoutRect:i,visible:s,hidden:l,settings:t}),containerRect:o,translation:{x:e.x,y:e.y}});return l.forEach((function(e){e.comp.visible=!1;var t=$s();e.comp.resize(t,t)})),{visible:s.map((function(e){return e.comp})),hidden:l.map((function(e){return e.comp})),ordered:u.map((function(e){return e.comp}))}},settings:function(e){t=Us(e)}};return n}(e);return ll((function(e,n){return t.layout(e,n)}))},cl=function(e){return"function"==typeof e?ll(e):ul(e)};function hl(e){var t=e.createComponent,n={},r=[],i=[],o=function e(n){var i=t(n);return i&&(r.push(i),n.components&&(i.children=n.components.map((function(t){return e(t)})).filter((function(e){return!!e})))),i},a=function e(t,n){for(var i=function(i){var o=t[i],a=n.find((function(e){return o.hasKey&&o.key===e.key}));a?o.children&&a.components&&e(o.children,a.components):(t.splice(i,1),function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}(o),o.children&&e(o.children,[]),o.instance.destroy())},o=t.length-1;o>=0;o--)i(o)},s=function e(t){var n=t.compList,r=t.data,i=t.excludeFromUpdate,a=t.formatters,s=t.scales;return t.settingsList.map((function(t){var l=ol(n,t.key);return i.indexOf(t.key)>-1?(delete l.updateWith,l):l?(t.rendererSettings&&"function"==typeof l.instance.renderer().settings&&l.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(l.applyTransform=!0,l):(l.updateWith={formatters:a,scales:s,data:r,settings:t},t.components&&(l.children=e({compList:l.children||[],data:r,excludeFromUpdate:i,formatters:a,scales:s,settingsList:t.components})),l)):o(t)})).filter((function(e){return!!e}))},l=function e(t){var n=t.components,r=t.hidden,i=t.layoutFn,o=t.ordered,a=t.rect,s=t.visible,l=i(a,n),u=l.visible,c=l.hidden,h=l.ordered;s.push.apply(s,K(u)),r.push.apply(r,K(c)),o.push.apply(o,K(h)),u.forEach((function(t){if(t.children){var n,i,a=cl(null!==(n=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==n?n:{});e({components:t.children,hidden:r,layoutFn:a,ordered:o,rect:t.instance.getRect(),visible:s})}})),c.forEach((function(t){t.children&&e({components:t.children,hidden:r,layoutFn:sl,ordered:o,rect:null,visible:s})}))};return n.destroy=function(){r.forEach((function(e){return e.instance.destroy()})),r=[],i=[]},n.findComponentByKey=function(e){return ol(r,e)},n.forEach=function(e){r.forEach(e)},n.layout=function(e){var t=e.layoutSettings,n=e.rect,r=[],o=[],a=[],s=cl(t);return l({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=function(e){var t=e.components;i=t.map((function(e){return o(e)})).filter((function(e){return!!e}))},n.update=function(e){var t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,l=e.scales;a(i,t),i=s({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:l,settingsList:t})},n}function dl(e,t,n){var r=t.left-n.left,i=t.top-n.top,o=ae(e),a=E(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(var s=0,l=a.vertices.length;s<l;s++){var u=a.vertices[s];u.x+=r,u.y+=i}break;case"geopolygon":for(var c=0;c<a.vertices.length;c++)for(var h=a.vertices[c],d=0,f=h.length;d<f;d++){var p=h[d];p.x+=r,p.y+=i}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function fl(e,t){var n=[],r=0;t.forEach((function(e){n.push(r),r++;var t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach((function(t,r){return function(e,t,n){var r=t.instance.renderer().element();if(!isNaN(n)&&r&&e&&e.children){var i=e.children[Math.max(0,n)];if(r!==i){var o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((function(t){e.insertBefore(t,r)}))):(o&&o.forEach((function(t){e.appendChild(t,r)})),e.appendChild(r))}}}(e,t,n[r])}))}function pl(e,t){var n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s,u=t.registries,c=t.logger,h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={},r=e,i=function(e){e.forEach((function(e){var t=Array.isArray(e.colors[0])?e.colors:[e.colors];n[e.key]={colors:t,sizes:t.map((function(e){return e?e.length:0}))}}))},o=function(e,t){var r=n[e];if(!r)return[];for(var i=r.sizes,o=0;o<i.length;o++)if(t<=i[o])return r.colors[o];return r.colors[i.length-1]},a={palette:function(e,t){return o(e,t)},setPalettes:i,style:function(e){return Bs(e,r)},setStyle:function(t){r=E({},e,t)}};return i(t),a}(t.style,t.palettes),d=[],f=E({},e),p=function(){var e={};return Xo(e),e}(),m=[],g=null,y=null,v=null,b=[],x=function(){},w=function(){},q={},M=!1,D=hl({createComponent:function(e){if(!u.component.has(e.type))return c.warn("Unknown component: ".concat(e.type)),!1;var t=function(e){var t,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e.defaultSettings,l=void 0===s?{}:s,u=e._DO_NOT_USE_getInfo,c=void 0===u?function(){return{}}:u,h=a.chart,d=a.container,f=a.mediator,p=a.registries,m=a.theme,g=a.renderer,y=Xo({}),v=a.settings||{},b=E(!0,{},l,v),x=[],w=Aa({chart:h}),q=!1,M={nodes:[],chart:h,config:b.brush||{},renderer:null},D={tap:[],over:[]},S=[],k={},_=E({},v);function C(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i,o,a,s=void 0!==e[t],l=void 0!==v[t],u=arguments.length,c=new Array(u),h=0;h<u;h++)c[h]=arguments[h];return s&&("function"==typeof e[t]?i=(o=e[t]).call.apply(o,[k].concat(c)):r&&(i=e[t])),l&&("function"==typeof v[t]?i=(a=v[t]).call.apply(a,[_].concat(c)):r&&(i=v[t])),s||l||(i=n.call.apply(n,[k].concat(c))),i}}var A=C("preferredSize",(function(){return 0}),!0),T=C("resize",(function(e){return e.inner})),N=C("created"),O=C("beforeMount"),P=C("mounted"),L=C("beforeUnmount"),j=C("beforeUpdate"),z=C("updated"),F=C("beforeRender"),H=C("beforeDestroy"),B=C("destroyed"),V=e.render,W=function(){b.brush&&(b.brush.consume||[]).forEach((function(e){e.context&&e.style&&S.push(Ia(M,e))}))},U=function(){b.brush&&(b.brush.trigger||[]).forEach((function(e){"over"===e.on?D.over.push(e):D.tap.push(e)}))};Object.defineProperty(M,"data",{get:function(){return x}});var $=b.renderer||e.renderer,Y=$?g||p.renderer($)():g||p.renderer()();"function"==typeof Y.settings&&Y.settings(b.rendererSettings),M.renderer=Y;var X={resources:h.logger?{logger:h.logger()}:{}},G=os(ss(b,A,h.logger()),X),J=function(e){e.key=b.key,e.element=Y.element()},Z=function(){};Z.dockConfig=function(){return G},Z.set=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=E(!0,{},l,e.settings),G=os(ss(b,A,h.logger()),X),M.config=b.brush||{}),b.scale&&(t=h.scale(b.scale)),b.data){var r=b.rendererSettings,i="function"==typeof(null==r?void 0:r.progressive)&&r.progressive(),a=Ir(b.data,{dataset:h.dataset,collection:h.dataCollection},{logger:h.logger()},h.dataCollection);i?i.isFirst?(x=a).items&&(x.items=K(a.items)):x.items&&(x.items=[].concat(K(x.items),K(a.items||[]))):x=a}else x=t?t.data():[];"string"==typeof b.formatter||"object"===R(b.formatter)?n=h.formatter(b.formatter):t&&t.data().fields&&(n=t.data().fields[0].formatter()),o=m.style(b.style||{})},Z.resize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=T({inner:e,outer:t});i=n?Y.size(n):Y.size(e),_.rect=E(!0,{computedPhysical:i.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),i=E(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},i)},Z.getRect=function(){return _.rect};var Q,ee,te,ne=function(){var e=Y.renderArgs?Y.renderArgs.slice(0):[],t=b.rendererSettings,n=x,r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=I(I({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};function re(e){var t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?M.nodes=K(e||[]):M.nodes&&(M.nodes=[].concat(K(M.nodes),K(e||[]))):M.nodes=e}Z.beforeMount=O,Z.beforeRender=function(){F({size:i})},Z.render=function(){var e=V.call.apply(V,[k].concat(K(ne())));re(e),Y.render(e),Q=e,ee=_.rect.computed},Z.hide=function(){Z.unmount(),Y.size({x:0,y:0,width:0,height:0}),Y.clear()},Z.beforeUpdate=function(){j({settings:b,data:x})},Z.update=function(){te&&te.stop();var e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return Y.render(),void(Q=null);var i=V.call.apply(V,[k].concat(K(ne())));re(i),S.forEach((function(e){return e.cleanUp()})),S.length=0,D.tap=[],D.over=[],n&&(W(),U()),S.forEach((function(e){e.isActive()&&e.update()})),Q&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:Q,currentRect:_.rect.computed,previousRect:ee}),(te=Ma({old:Q,current:i},{renderer:Y},r)).start()):Y.render(i),Q=i,ee=_.rect.computed,Y.setKey&&"string"==typeof v.key&&Y.setKey(v.key)},Z.updated=z,Z.destroy=function(){Z.unmount(),H(r),Y.destroy(),B(),r=null};var ie=function(e){M.nodes=e,S.forEach((function(e){e.isActive()&&e.update()})),Y.render(e)};return as(k,e,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return h},dockConfig:function(){return G},mediator:function(){return f},instance:function(){return _},rect:function(){return _.rect},style:function(){return o},update:function(){return ie},registries:function(){return p},resolver:function(){return w},symbol:function(){return is(p.symbol)}}),as(_,v,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return h},dockConfig:function(){return G},mediator:function(){return f},style:function(){return o},_DO_NOT_USE_getInfo:c.bind(k),isVisible:function(){return q}}),Z.getBrushedShapes=function(e,t,n){var r=[];if(b.brush&&b.brush.consume){var i=h.brush(e),o=Y.findShapes("*");b.brush.consume.filter((function(t){return t.context===e})).forEach((function(e){for(var a=0;a<o.length;a++){var s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(J(s),r.push(s),o.splice(a,1),a--)}}))}return r},Z.findShapes=function(e){for(var t,n=(null!==(t=te)&&void 0!==t&&t.inProgress()?te.targetScene:Y).findShapes(e),r=0,i=n.length;r<i;r++)J(n[r]);return n},Z.shapesAt=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Y.itemsAt(e);t=n&&"stop"===n.propagation&&r.length>0?[r.pop().node]:r.map((function(e){return e.node}));for(var i=0,o=t.length;i<o;i++)J(t[i]);return t},Z.brushFromShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[],Ra({nodes:e,action:t.action||"toggle",trigger:t,chart:h,data:M.data})},Z.mount=function(){r=Y.element&&Y.element()?r:Y.appendTo(d),Y.setKey&&"string"==typeof v.key&&Y.setKey(v.key),b.brush&&(W(),U()),ls(_,y,v),ls(k,y,e),q=!0},Z.mounted=function(){return P(r)},Z.unmount=function(){[_,k].forEach((function(e){us(e,y)})),D.tap=[],D.over=[],S.forEach((function(e){e.cleanUp()})),S.length=0,L(),q=!1},Z.onBrushTap=function(e){D.tap.forEach((function(t){La({e:e,t:t,config:M})&&"stop"===t.globalPropagation&&h.toggleBrushing(!0)}))},Z.onBrushOver=function(e){D.over.forEach((function(t){ja({e:e,t:t,config:M})&&"stop"===t.globalPropagation&&h.toggleBrushing(!0)}))},Z.def=k,Z.ctx=_,Z.renderer=function(){return Y},Z.set({settings:v}),N(),Z}(u.component(e.type),{settings:e,chart:f,mediator:p,registries:u,theme:h,container:n});return{instance:t,settings:E(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return function(){for(var r,i,o="function"==typeof e[t],a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];o?r=(i=e[t]).call.apply(i,[f].concat(s)):r=n.call.apply(n,[f].concat(s));return r}}var k=function(){var e;a.dockLayout?(c.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;var t=function(e){if("function"==typeof e.getBoundingClientRect){var t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return D.layout({layoutSettings:e,rect:t})},_=S("created"),C=S("beforeMount"),A=S("mounted"),T=S("beforeUpdate"),N=S("updated"),O=S("beforeRender"),P=S("beforeDestroy"),L=S("destroyed"),j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.partialData,i=t.formatters,o=void 0===i?{}:i,a=t.scales,s=void 0===a?{}:a,l=t.scroll,d=void 0===l?{}:l;x=le(e,{logger:c,types:u.data}),r||Object.keys(q).forEach((function(e){return q[e].clear()})),t.palettes&&h.setPalettes(t.palettes),t.style&&h.setStyle(t.style),w=Rr(t.collections,{dataset:x},{logger:c});var f={theme:h,logger:c};g=Wo(s,{dataset:x,collection:w},I(I({},f),{},{scale:u.scale})),y=Or(o,{dataset:x,collection:w},I(I({},f),{},{formatter:u.formatter})),v=Jo(d,v)};function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={},r=e.filter((function(e){return!!e.key})).map((function(e){return e.key}));b.forEach((function(e){e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),b=e.map((function(e){var r=e.key&&t[e.key]?t[e.key]:u.interaction(e.type)(f,p,n);return r.set(e),r}))}var F=function(e){var t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach((function(e){var t=e.instance.getRect();Cs(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},H=function(){if(!d.length&&n){Object.keys(l).forEach((function(e){var t=l[e].bind(f);n.addEventListener(e,t),d.push({key:e,listener:t})}));var e={},t=function(t){t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=F(e)},r=function(t){var n=e.comps||F(t);if(!n.every((function(e){return e.instance.def.disableTriggers}))&&("touchend"===t.type&&t.preventDefault(),function(e,t){var n=Z(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(var r=n.length-1;r>=0;r--){if(n[r].instance.onBrushTap(t),M){M=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:function(e){for(var t=F(e),n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),M){M=!1;break}}}}),i.forEach((function(e){n.addEventListener(e.key,e.listener),d.push(e)}))}},B=function(){d.forEach((function(e){var t=e.key,r=e.listener;return n.removeEventListener(t,r)})),d.length=0};return f.layoutComponents=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,z(e.settings.interactions)),T(),j(i,a);var r=a,o=r.formatters,s=r.scales,l=r.components,u=void 0===l?[]:l;D.update({components:u,data:i,excludeFromUpdate:n,formatters:o,scales:s}),D.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),D.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()})),k()},f.update=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.partialData,o=t.excludeFromUpdate,s=void 0===o?[]:o;t.data&&(i=t.data),t.settings&&(a=t.settings,z(t.settings.interactions)),T(),j(i,a,{partialData:r});var l=a,u=l.formatters,c=l.scales,h=l.components,d=void 0===h?[]:h;D.update({components:d,data:i,excludeFromUpdate:s,formatters:u,scales:c}),D.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),D.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()}));var f,p=[],g=[];if(r)D.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible&&p.push(e)})),f=p;else{var y=k(),v=y.visible,b=y.hidden,x=y.ordered;m=v,f=v,e=x,v.forEach((function(e){e.updateWith&&e.visible?p.push(e):g.push(e)})),b.forEach((function(e){e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}g.forEach((function(e){return e.instance.beforeMount()})),g.forEach((function(e){return e.instance.mount()})),f.forEach((function(e){return e.instance.beforeRender()})),f.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),r||fl(n,e),g.forEach((function(e){return e.instance.mounted()})),p.forEach((function(e){return e.instance.updated()})),m.forEach((function(e){delete e.updateWith,e.visible=!0,e.applyTransform=!1})),N()},f.destroy=function(){P(),D.destroy(),B(),z(),delete f.update,delete f.destroy,L()},f.getAffectedShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter((function(e){return null==r||e.key===r})).forEach((function(r){var o=r.instance.getBrushedShapes(e,t,n);i=[].concat(K(i),K(o))})),i},f.findShapes=function(e){var t=[];return m.forEach((function(n){var r=n.instance.findShapes(e);t=[].concat(K(t),K(r))})),t},f.componentsFromPoint=function(e){return F(e).map((function(e){return e.instance.ctx}))},f.shapesAt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=n.getBoundingClientRect(),o=m;if(Array.isArray(t.components)&&t.components.length>0){var a=t.components.map((function(e){return e.key}));o=m.filter((function(e){return-1!==a.indexOf(e.key)})).map((function(e){return{instance:e.instance,opts:t.components[a.indexOf(e.key)]}}))}for(var s=o.length-1;s>=0;s--){var l=o[s],u=l.instance.renderer().element().getBoundingClientRect(),c=dl(e,i,u),h=l.instance.shapesAt(c,l.opts),d=h.length>0&&"stop"===t.propagation;if((r=[].concat(K(r),K(h))).length>0&&d)return r}return r},f.brushFromShapes=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]},n=function(n){var r=t.components[n].key;m.filter((function(e){return r===e.key})).forEach((function(r){var i=e.filter((function(e){return e.key===r.key}));r.instance.brushFromShapes(i,t.components[n])}))},r=0;r<t.components.length;r++)n(r)},f.scroll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Zo(e,v)},f.dataset=function(e){return x(e)},f.dataCollection=function(e){return w(e)},f.scales=function(){return g.all()},f.formatters=function(){return y.all()},f.brush=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return q[e]||(q[e]=ya()),q[e]},f.scale=function(e){return g.get(e)},f.formatter=function(e){return y.get(e)},f.toggleBrushing=function(e){M=void 0!==e?e:!M},f.component=function(e){var t=D.findComponentByKey(e);return null==t?void 0:t.instance.ctx},f.logger=function(){return c},f.theme=function(){return h},Object.defineProperty(f,"interactions",{get:function(){return{instances:b,on:function(){H(),b.forEach((function(e){return e.on()}))},off:function(){B(),b.forEach((function(e){return e.off()}))}}}}),_(),n&&(C(),n.innerHTML="",function(){var e=a.components,t=void 0===e?[]:e;O(),j(i,a),D.set({components:t});var r=k(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach((function(e){e.instance.hide(),e.visible=!1})),o.forEach((function(e){return e.instance.beforeMount()})),o.forEach((function(e){return e.instance.mount()})),o.forEach((function(e){return e.instance.beforeRender()})),o.forEach((function(e){return e.instance.render()})),o.forEach((function(e){return e.instance.mounted()})),o.forEach((function(e){e.visible=!0})),fl(n,l)}(),H(),z(a.interactions),A(n),f.element=n),f}var ml=function(e){var t=ft(e);return t.prio=function(e){return e?t.default(e[0]):[t.default()]},t.types=function(){return t.getKeys()},t},gl=ft();function yl(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];for(var r=0;r<n.fields.length;r++)if(n.fields[r].key()===e)return n.fields[r];for(var i=0;i<n.fields.length;i++)if(n.fields[i].title()===e)return n.fields[i];return null}var vl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))},bl=function(e){return e.reduce((function(e,t){return e+t}),0)},xl={first:function(e){return e[0]},last:function(e){return e[e.length-1]},min:function(e){var t=vl(e);return t.length?Math.min.apply(null,t):NaN},max:function(e){var t=vl(e);return t.length?Math.max.apply(null,t):NaN},sum:function(e){var t=vl(e);return t.length?t.reduce((function(e,t){return e+t}),0):NaN},avg:function(e){var t=vl(e),n=t.length;return n?bl(t)/n:NaN}};function wl(e,t,n,r){var i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((function(a){var s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(R(s))?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"===R(s)&&(s.fields?l.fields=s.fields.map((function(n){return wl(e,t,{main:n},r).main})):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=xl[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?xl[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=xl[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?xl[l.field.reduceLabel]:l.field.reduceLabel))})),i}function ql(e,t){var n=wl(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:wl(e,t,e.props||{},n),main:n}}function Ml(e,t,n,r){for(var i,o=Array(e.length),a=Array(e.length),s=0;s<e.length;s++)i=r?e[s][r]:e[s],o[s]=i.value,a[s]=i.label;var l=t.reduce,u=t.reduceLabel,c=l?l(o):o,h={value:c,label:u?u(a,c):n?n(c):String(c)};return r&&e[0][r].source?(h.source=e[0][r].source,h):!r&&e[0].source?(h.source=e[0].source,h):h}function Dl(e,t){var n=t.main,r=t.propsArr,i=t.props,o=[],a=n.field.formatter(),s={};return r.forEach((function(e){s[e]=i[e].field?i[e].field.formatter():function(e){return e}})),o.push.apply(o,K(e.map((function(e){var t=Ml(e.items,n,a);return r.forEach((function(n){t[n]=Ml(e.items,i[n],s[n],n)})),t})))),o}function Sl(e){var t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker,a="function"===e.trackType?t.trackBy(n):n[t.trackBy],s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function kl(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function _l(e,t){var n=Array.isArray(e)?e:[e],r=[];return n.forEach((function(e){void 0!==e.field&&function(){var n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));for(var o=ql(e,t),a=o.props,s=o.main,l=Object.keys(a),u=!!e.trackBy,c=R(e.trackBy),h={},d=[],f=n.items(),p=[],m=function(t){var n=f[t];if(s.filter&&!s.filter(n))return"continue";var r=kl(s,n,{key:i});l.forEach((function(e){var o=a[e],s=o.field?o.field.items()[t]:n;r[e]=kl(o,s,{key:i})})),u&&Sl({cfg:e,itemData:n,obj:r,target:d,tracker:h,trackType:c}),p.push(r)},g=0;g<f.length;g++)m(g);r=[].concat(K(r),u?K(Dl(d,{main:s,propsArr:l,props:a})):p)}()})),r}var Cl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))};var El=function(e){var t=e.key,n=e.data,r=e.cache,i=e.config;if(n){var o=n;"string"==typeof o&&(o=function(e){var t=e.data,n=e.config,r=t.split("\n"),i=r[0],o=r[1],a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i)for(var s=[/,/,/\t/,/;/],l=0;l<s.length;l++){var u=s[l];if(i&&o){if(u.test(i)&&u.test(o)&&i.split(u).length===o.split(u).length){a=u;break}}else u.test(i)&&(a=u)}return r.map((function(e){return e.split(a)}))}({data:n,config:i})),Array.isArray(o)&&function(e){var t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r,s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((function(e,t){return t})):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);var l,u=!!s&&"function"==typeof s.row&&s.row,c=t;c=s&&"function"==typeof s.fields?s.fields(c.slice()):t.map((function(e){return{key:e,title:e}})),Array.isArray(r[0])?l=c.map((function(){return[]})):(l={},c.forEach((function(e){l[e.key]=[]})));for(var h=0;h<a.length;h++){var d=u?u(a[h],h,c):a[h];if(d)if(Array.isArray(d))for(var f=0;f<c.length;f++)l[f].push(d[f]);else for(var p=0;p<c.length;p++)l[c[p].key].push(d[c[p].key])}for(var m=Array.isArray(l)?function(e){return l[e]}:function(e){return l[c[e].key]},g=0;g<c.length;g++){var y=m(g),v=Cl(y),b=v.length>0,x=b?"measure":"dimension",w=b?Math.min.apply(Math,K(v)):NaN,q=b?Math.max.apply(Math,K(v)):NaN;i.fields.push(Cr(E({source:n,key:g,title:c[g].title,values:y,min:w,max:q,type:x},c[g]),{value:c[g].value,label:c[g].label}))}}({data:o,cache:r,source:t,config:i})}};function Al(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i={fields:[]},o={key:function(){return t},raw:function(){return n},field:function(e){return yl(e,{cache:i,matrix:n})},fields:function(){return i.fields.slice()},extract:function(e){return _l(e,o)},hierarchy:function(){return null}};return El({key:t,data:n,config:r,cache:i}),o}Al.util={normalizeConfig:ql,collect:Dl,track:Sl};var Tl=ft();Tl.default("matrix"),Tl("matrix",Al),Tl("default",Al);var Il=ft();function Rl(e,t,n){return Math.max(e,Math.min(t,n))}function Nl(e){var t,n=e.item,r=e.value,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u=o,c=a,h=r<.5?90:-90;return e.flipXY&&(s="y",l="x",u=a,c=o,h=r<.5?180:0),(0,e.symbol)(E({},n.oob,(L(t={},s,i*u),L(t,l,Math.max(n.oob.size/2,Math.min(r*c,c-n.oob.size/2))),L(t,"startAngle",h),t)))}function Ol(e){var t,n=e.item,r=e.boxWidth,i=e.boxPadding,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u="width",c="height",h=o,d=a;e.flipXY&&(s="y",l="x",u="height",c="width",h=a,d=o);var f=function(e){var t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o,s=Math.max(t,n),l=Math.min(t,n),u=Rl(-.1,1.2,s),c=Rl(-.1,1.2,l),h=u*a-c*a,d=Math.max(i,h),f=(d-h)/2;return{actualDiff:d,startModifier:f,actualLow:c*a-f}}({start:n.start,end:n.end,minPx:n.box.minHeightPx,maxPx:d}),p=f.actualDiff,m=f.actualLow;return E({},n.box,(L(t={type:"rect"},s,(i+n.major)*h),L(t,l,m),L(t,c,p),L(t,u,r*h),L(t,"data",n.data||{}),L(t,"collider",{type:null}),t))}function Pl(e){var t,n=e.item,r=e.from,i=e.to,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",u="y1",c="x2",h="y2",d=a,f=s;return e.flipXY&&(l="y1",u="x1",c="y2",h="x2",d=s,f=a),E({},n.line,(L(t={type:"line"},h,Math.floor(r*f)),L(t,l,o*d),L(t,u,Math.floor(i*f)),L(t,c,o*d),L(t,"data",n.data||{}),L(t,"collider",{type:null}),t))}function Ll(e){var t,n=e.item,r=e.key,i=e.position,o=e.width,a=e.boxCenter,s=e.rendWidth,l=e.rendHeight,u="x1",c="y1",h="x2",d="y2",f=s,p=l;e.flipXY&&(u="y1",c="x1",h="y2",d="x2",f=l,p=s);var m=o/2;return E({type:"line"},n[r],(L(t={},c,Math.floor(i*p)),L(t,u,(a-m)*f),L(t,d,Math.floor(i*p)),L(t,h,(a+m)*f),L(t,"r",m*f),L(t,"cx",a*f),L(t,"cy",i*p),L(t,"width",o*f),L(t,"data",n.data||{}),L(t,"collider",{type:null}),t))}function jl(e,t,n){var r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1,l=Math.min(s*e*i,isNaN(o)?n:o/n);return(l=isNaN(a)?l:Math.max(a/n,l))*s}Il("native",(function(e,t,n){var r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((function(e){var t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function u(){a.forEach((function(e){var t=e.key,r=e.listener;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set:function(e){!function(e){i=e.key,(r=e).events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),u(),s&&l()},off:function(){s=!1,u()},on:function(){s=!0,0===a.length&&l()},destroy:function(){u(),o=null,r=null}}}));var zl={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Fl=Object.keys(zl),Hl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created:function(){this.state={}},render:function(e){var t=this,n=e.data,r=this.rect,i=r.width,o=r.height,a="horizontal"===this.settings.settings.orientation,s=this.style,l=this.resolver,u=this.symbol,c=Fl.filter((function(e){return!t.settings.settings[e]||!1!==t.settings.settings[e].show})),h={};c.forEach((function(e){return h[e]=zl[e]}));var d=function(e){var t,n=e.keys,r=e.data,i=e.defaultSettings,o=e.style,a=e.settings,s=e.width,l=e.height,u=e.resolver,c=E(!0,{},i||{},o||{}),h={major:"horizontal"===a.orientation?l:s,minor:"horizontal"===a.orientation?s:l},d=a.major;t="object"===R(d)&&"object"===R(d.ref)&&void 0!==d.ref.start&&void 0!==d.ref.end?u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:E(!0,{},{binStart:{scale:a.major.scale,ref:a.major.ref.start},binEnd:{scale:a.major.scale,ref:a.major.ref.end}})}):"object"===R(d)&&void 0!==d.binStart&&void 0!==d.binEnd?u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:E(!0,{},{binStart:{scale:a.major.scale,ref:"binStart"},binEnd:{scale:a.major.scale,ref:"binEnd"}},a.major)}):u.resolve({data:r,scaled:h,defaults:{major:.5},settings:{major:a.major}});var f=a.minor||{},p={};["start","end","min","max","med"].forEach((function(e){(f[e]||r.items&&r.items.length&&r.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));for(var m,g={major:t,minor:u.resolve({data:r,defaults:{start:0,end:1},scaled:h,settings:E(!0,{},p,f)})},y=0,v=n.length;y<v;y++)a[m]&&!1===a[m].show||(g[m=n[y]]=u.resolve({data:r,defaults:c[m],settings:a[m],scaled:h}));return g}({keys:c,data:n,defaultSettings:h,style:s,settings:this.settings.settings,width:i,height:o,resolver:l}),f=d.settings,p=function(e){var t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol,s=[],l=i.major.items;if(!l.length)return s;var u,c,h,d,f,p,m,g,y,v=t,b=n,x=r?n:t,w=i.major.settings,q=["start","end","min","max","med"].filter((function(e){return void 0!==i.minor.settings[e]})),M=q.length,D=o.filter((function(e){return"oob"!==e})),S=o?o.length:0,k=D?D.length:0,_={box:function(){h.box&&Q(h.start)&&Q(h.end)&&u.push(Ol({item:h,boxWidth:d,boxPadding:f,rendWidth:v,rendHeight:b,flipXY:r}))},line:function(){Q(h.min)&&Q(h.start)&&u.push(Pl({item:h,from:h.min,to:h.start,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r})),Q(h.max)&&Q(h.end)&&u.push(Pl({item:h,from:h.max,to:h.end,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))},median:function(){h.median&&Q(h.med)&&u.push(Ll({item:h,key:"median",position:h.med,width:d,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))},whisker:function(){if(h.whisker){var e=d*h.whisker.width;Q(h.min)&&u.push(Ll({item:h,key:"whisker",position:h.min,width:e,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r})),Q(h.max)&&u.push(Ll({item:h,key:"whisker",position:h.max,width:e,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r}))}}};function C(){for(var e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=0;r<M;r++)Q(e=h[q[r]])&&(t<e&&(t=e),n>e&&(n=e));m=t<0&&t!==-Number.MAX_VALUE,g=n>1&&n!==Number.MAX_VALUE,y=m||g}for(var A=0,T=l.length;A<T;A++){u=[],c=null;var I=l[A],R=I.data,N=null,O=null;void 0!==w.binStart?(N=I.binStart,O=I.binEnd,c=w.binStart.scale):N=(c=w.major.scale)?I.major:0;var P=0;c?c.bandwidth?N-=(P=c.bandwidth())/2:P=O-N:P=1,h=E({},{major:N,majorEnd:O},i.minor.items[A]);for(var L=0;L<S;L++)h[o[L]]=i[o[L]].items[A];if(d=jl(P,h,x),p=(f=(P-d)/2)+h.major+d/2,C(),y)h.oob&&(m?u.push(Nl({item:h,value:0,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r,symbol:a})):g&&u.push(Nl({item:h,value:1,boxCenter:p,rendWidth:v,rendHeight:b,flipXY:r,symbol:a})));else for(var j=0;j<k;j++)h[D[j]]&&!1===h[D[j]].show||_[D[j]]();var z={type:"container",data:R,collider:{type:"bounds"},children:u};s.push(z)}return s}({items:d.items,settings:f,width:i,height:o,flipXY:a,resolved:d,keys:c,symbol:u});return p}};var Bl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Vl=/px$/,Wl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Ul={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function $l(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Yl(e,t,n,r){var i=t.width,o=t.height;return e.filter((function(e){return!1!==e.show&&!isNaN(e.x+e.y)})).map((function(e){var t=e,a=Vl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);ee(a)&&(t=Bl,a=n.min+t.size*(n.max-n.min));var s=function(e){var t=Wl.shape,n={};return"object"===R(e.shape)&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),l=X(s,2),u=l[0],c=I(I({},l[1]),{},{type:u,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);var h=r(c);return h.data=e.data,h}))}var Xl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:function(e){return e.data.value}},style:{item:"$shape"}},render:function(e){var t=e.data,n=this.resolver.resolve({data:t,defaults:E({},Wl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=E({},Ul,this.settings.settings.sizeLimits),s=n.items,l=function(e,t,n,r,i){var o=$l(e?e.scale:void 0,n),a=$l(t?t.scale:void 0,r),s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Yl(s,this.rect,l,this.settings.shapeFn||this.symbol)}};Math.PI;var Kl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Gl(e,t,n,r){var i=t.x,o=t.y,a=t.width,s=t.height,l=Pe(),u={x:i+a/2,y:o+s/2},c=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return e.map((function(e,t){var i=n[t];i.type="path";var o=h*i.outerRadius,a=c*i.innerRadius,s=d*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;var f=l.centroid(e),p=i.offset?function(e,t,n,r){var i=X(e,2),o=i[0],a=i[1],s=Math.sqrt(o*o+a*a),l=n-r;return{x:(o/=s)*t*l,y:(a/=s)*t*l}}(f,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(u.x,", ").concat(u.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:u.x+p.x,y:u.y+p.y}}},i}))}function Jl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}var Zl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render:function(e){for(var t=e.data,n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:E({},Kl,this.style.slice),settings:i.slice}).items,a=0,s=0,l=o.length;s<l;s++){var u=Jl(i,o[s]);u>0&&o[s].outerRadius>=o[s].innerRadius&&(n.push(u),r.push(o[s]),a+=u)}var c=function(){var e=Ve,t=Be,n=null,r=me(0),i=me(ke),o=me(0);function a(a){var s,l,u,c,h,d=a.length,f=0,p=new Array(d),m=new Array(d),g=+r.apply(this,arguments),y=Math.min(ke,Math.max(-ke,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<d;++s)(h=m[p[s]=s]=+e(a[s],s,a))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,u=f?(y-d*b)/f:0;s<d;++s,g=c)l=p[s],c=g+((h=m[l])>0?h*u:0)+b,m[l]={data:a[l],index:s,value:h,startAngle:g,endAngle:c,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:me(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:me(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:me(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:me(+e),a):o},a}().sortValues(null);return c.startAngle(i.startAngle),c.endAngle(i.endAngle),c.padAngle(i.padAngle),Gl(c(n),E({},this.rect,{x:0,y:0}),r,a)}};var Ql=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){var n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((function(e){var n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:function(e){return e.x1===e.x2||e.y1===e.y2},conditionAppend:function(e){return e.strokeWidth%2!=0}},e.rect={append:["x","y"],round:["width","height"],condition:function(){return!0},conditionAppend:function(e){return e.strokeWidth%2!=0}}),Object.keys(e).forEach((function(t){var n=e[t];n.items=[],n.append.forEach((function(e){n.items.push({key:e,type:"append"})})),n.round.forEach((function(e){n.items.push({key:e,type:"round"})}))})),t.multiple=function(e){return e.forEach((function(e){return t(e)}))},t}(),eu=function(){function e(){N(this,e),this.reset(),this.push.apply(this,arguments)}return P(e,[{key:"transposeCoordinate",value:function(e,t,n){if("number"==typeof t&&isFinite(t)){var r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}},{key:"push",value:function(){var e;return(e=this.storage).push.apply(e,arguments),this}},{key:"processItem",value:function(t){var n={},r=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){var o=r?this.height:this.width,a=r?this.width:this.height;t=t.fn({width:o,height:a,flipXY:r});for(var s=Object.keys(t),l=0,u=s.length;l<u;l++){var c=s[l];n[e.evaluateKey(c,r)]=t[c]}}else for(var h=Object.keys(t),d=0,f=h.length;d<f;d++){var p=h[d],m=e.evaluateKey(p,r),g=this.transposeCoordinate(m,t[p],r);n[m]=g}return i&&Ql(n),n}},{key:"output",value:function(){for(var e=[],t=0,n=this.storage.length;t<n;t++){var r=this.processItem(this.storage[t]);e.push(r)}return e}},{key:"reset",value:function(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}],[{key:"evaluateKey",value:function(e,t){if(t){var n=e.substring(0,1),r=e.substring(1);if("x"===n)return"y".concat(r);if("y"===n)return"x".concat(r);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}}]),e}();function tu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(eu,t)}function nu(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}var ru={created:function(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender:function(){this.blueprint=tu(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this;if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,_a(this,"x",this.rect.width),_a(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=E({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=E({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=nu(this.x,this.rect.width),this.lines.y=nu(this.y,this.rect.height),this.lines.y=this.lines.y.map((function(e){return E(e,{flipXY:!0})}));var t=function(t){var n=t.dir,r=t.isMinor,i=e.lines[n].filter((function(e){return!!e.isMinor===r})),o=r?e.settings.minorTicks:e.settings.ticks;e.resolver.resolve({settings:o,data:{items:i,dir:n}}).items.forEach((function(t){var r,i,o=t.data;t.show&&e.blueprint.push({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:o.flipXY||!1,value:null!==(r=o.value)&&void 0!==r?r:null===(i=o.data)||void 0===i?void 0:i.value,dir:n})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function iu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(o?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function ou(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return t+=o?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function au(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function su(e){var t={value:e.value};return e.label&&(t.label=e.label.text),t}function lu(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function uu(e,t){var n=e.min();if(n===e.max()){var r=function(e){var t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}var cu={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:function(){return 30},beforeRender:function(){this.blueprint=tu(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this,t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];var n={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(lu).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=uu(n,t.value);return E(t,{scale:n,position:r})}return E(t,{position:t.value})})),this.lines.y=this.lines.y.filter(lu).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=uu(n,t.value);return E(t,{scale:n,position:r,flipXY:!0})}return E(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((function(e){return!(e.position<0||e.position>1)||(n["x".concat(e.position>1?1:0)].push(su(e)),!1)})),this.lines.y=this.lines.y.filter((function(e){return!(e.position<0||e.position>1)||(n["y".concat(e.position>1?1:0)].push(su(e)),!1)}));var r=[];return[].concat(K(this.lines.x),K(this.lines.y)).forEach((function(n){(!0===n.show||void 0===n.show)&&function(e){var t,n=e.chart,r=e.blueprint,i=e.renderer,o=e.p,a=e.settings,s=e.items,l=!0,u=!1,c=!1,h=!1,d=E(!0,{},a.style.line,o.line||{});if(t=r.processItem({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:d.stroke||"black",strokeWidth:d.strokeWidth||1,strokeDasharray:d.strokeDasharray,flipXY:o.flipXY||!1,value:o.valueInfo?o.valueInfo.id:o.value}),o.label){var f,p=E(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:d.stroke},o.label),m={width:0,height:0},g="";if("string"==typeof o.formatter)f=n.formatter(o.formatter);else if("object"===R(o.formatter))f=n.formatter(o.formatter);else if(void 0!==o.scale&&o.scale.data){var y=o.scale.data()&&o.scale.data().fields;f=y&&y[0]?y[0].formatter():null}!1!==o.label.showValue&&(f?g=" (".concat(f(o.value),")"):o.scale&&(g=" (".concat(o.value,")"))),g&&(m=i.measureText({text:g,fontFamily:p.fontFamily,fontSize:p.fontSize}));var v=i.measureText({text:p.text||"",fontFamily:p.fontFamily,fontSize:p.fontSize}),b={width:v.width+m.width,height:Math.max(v.height,m.height)},x=p.padding,w=au(o.flipXY?p.vAlign:p.align),q=au(o.flipXY?p.align:p.vAlign),M=Math.min(1+b.width+2*x,p.maxWidth*r.width,p.maxWidthPx),D=b.height+2*x,S=o.flipXY?D:M,k=o.flipXY?M:D;if(u=r.processItem({fn:function(e){var t=e.width,n=e.height,i=o.position*t-(o.flipXY?D:M)*(1-w);return{type:"rect",x:i=o.flipXY?i:Math.max(i,0),y:Math.max(Math.abs(q*n-k*q),0),width:o.flipXY?S:Math.min(S,r.width-i),height:k,stroke:p.background.stroke,strokeWidth:p.background.strokeWidth,fill:p.background.fill,opacity:p.background.opacity}},flipXY:o.flipXY||!1}),u.x<-1||u.x+u.width>r.width+1||u.y<-1||u.y+u.height>r.height+1)u=void 0;else{c={type:"text",text:p.text||"",fill:p.fill,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:u.x+x,y:u.y+u.height/2+b.height/3,maxWidth:u.width-2*x-m.width,anchor:"start"},g&&(h={type:"text",text:g||"",fill:p.fill,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:c.x+3+(u.width-(m.width+2*x)),y:c.y});for(var _=0,C=s.length;_<C;_++){var A=s[_];"rect"===A.type?ks(u,A)&&(l=!1):"line"===A.type&&o.flipXY===A.flipXY&&Es(u,A)&&(l=!1)}}}s.push(t),l&&u&&c&&(s.push(u,c),h&&s.push(h))}({chart:e.chart,blueprint:e.blueprint,renderer:e.renderer,p:n,settings:t,items:r})})),t.style.oob.show&&function(e){for(var t=e.blueprint,n=e.oob,r=e.settings,i=e.items,o=Object.keys(n),a=r.style.oob||{},s=function(e,r){var s=o[e],l=n[s];if(l.length>0){var u=s.charAt(1),c="y"===s.charAt(0),h=a.padding.x+a.width,d=a.padding.y+a.width,f="bottom";f=c?"1"===u?"bottom":"top":"1"===u?"right":"left";var p=t.processItem({fn:function(e){var t=e.width,n=e.height,r=u*t+("1"===u?-h:h),i=c?d:n-d;return"arc"===a.type?{type:"path",d:iu(c?i:r,c?r:i,a.width,f),x:r,y:i,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:r,cy:i,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:l}},flipXY:c}),m=p.cx||p.x,g=p.cy||p.y,y={type:"text",text:l.length||"",x:m-.4*a.width,y:g+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},v={type:"path",d:ou(m,g,a.width,f),x:m,y:g,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(p,y,v)}},l=0,u=o.length;l<u;l++)s(l)}({blueprint:this.blueprint,oob:n,settings:t,items:r}),r}};function hu(e){var t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){E(e,t.style)}(t,e),t}function du(e){return"string"==typeof e||"number"==typeof e?e:"-"}function fu(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){var r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),u=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((function(e){return Qa(e,r,{x:t.x,y:t.y})})),c={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=r>=0?[c,h]:[h,c];u.push.apply(u,d),t.collider={type:"polygon",vertices:u}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){var r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{var i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}var o=t.collider;o.x=Math.max(o.x,0),o.y=Math.max(o.y,0);var a=o.x+o.width-(n.outerRect.x+n.outerRect.width);o.width=a>0?o.width-a:o.width;var s=o.y+o.height-(n.outerRect.y+n.outerRect.height);o.height=s>0?o.height-s:o.height}(e,t,n)}function pu(e,t){var n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1),r=0;if(e.tilted)r=e.stepSize*n;else{var i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function mu(e,t){var n,r,i={type:"text",text:du(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+pu(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+pu(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((function(n){e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){var n=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),i=e.x-r,o=e.x+r;i<0?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):o>n&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{var a=t.outerRect.height,s=t.maxHeight/2,l=e.y-s,u=e.y+s;l<0?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):u>a&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){var n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";var i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){var o=t.outerRect.width-t.paddingEnd;e.x+i>o&&(e.maxWidth=(o-e.x-10)/Math.cos(r))}else{var a=t.paddingEnd;e.x-i<a&&(e.maxWidth=(e.x-a-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),fu(e,i,t),i}function gu(e,t){var n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){E(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){var n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function yu(e){return!e.isMinor&&e.position>=0&&e.position<=1}function vu(e){var t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){for(var t=e.majorTicks,n=e.measureText,r=e.rect,i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map((function(e){return e.label})).map((function(e){return"".concat(e.slice(0,1)).concat(e.length>1?"…":"")})).map(n).map((function(e){return e.width})),s=0;s<t.length;++s){var l=t[s];if(i*o*Math.abs(l.start-l.end)<a[s])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){var t=e.majorTicks,n=e.measureText,r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t,state:n})}function bu(e){var t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function xu(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0,u={left:0,top:0,right:0,bottom:0},c=a.labels,h=c.maxLengthPx,d=c.minLengthPx;if(a.labels.show){var f,p,m=a.align,g="top"===m||"bottom"===m,y=g?n.inner.width:n.inner.height,v=o.ticks({settings:a,distance:y,formatter:r}).filter(yu),b=function(e){var t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=bu({value:t.width,maxValue:h,minValue:d}),t};if(t&&g&&"auto"===a.labels.mode&&(!function(e){var t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings,a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,u=n("…").width,c=r.width,h=0;if(isNaN(a))for(var d=0;d<t.length;d++){var f=t[d],p=f.label;if(n(p).width*(p.length>1?l:1)+u>(h=s*c*Math.abs(f.start-f.end)))return!0}else if(h=s*c*t.reduce((function(e,t){return Math.min(Math.abs(t.start-t.end),e)}),1/0),n("M").width*l*a+u>h)return!0;return!1}({majorTicks:v,measure:b,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&vu({rect:n.inner,state:s,majorTicks:v,measure:b,horizontal:g}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0};if("tilted"===s.labels.activeMode){var x=Math.abs(a.labels.tiltAngle)*(Math.PI/180);f=function(e){return bu({value:e.width,maxValue:h,minValue:d})*Math.sin(x)+e.height*Math.cos(x)}}else f=g?function(e){return e.height}:function(e){return bu({value:e.width,maxValue:h,minValue:d})};if(g&&"tilted"!==s.labels.activeMode)p=["M"];else if(isNaN(a.labels.maxGlyphCount))p=v.map((function(e){return e.label}));else{for(var w="",q=0;q<a.labels.maxGlyphCount;q++)w+="M";p=[w]}var M=p.map(b),D=M.map(f),S=Math.max.apply(Math,K(D).concat([0]));if(l+=S,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){var k="bottom"===a.align==a.labels.tiltAngle>=0,_=Math.abs(a.labels.tiltAngle)*(Math.PI/180),C=(S-b("M").height*Math.cos(_))/Math.sin(_),E=Math.min(a.labels.maxEdgeBleed,Math.max.apply(Math,K(M.map((function(e){return Math.min(C,e.width)*Math.cos(_)+e.height})).map((function(e,t){var r=v[t]?v[t].position:0;return k?e-r*n.inner.width:e-(1-r)*n.inner.width}))).concat([0])))+a.paddingEnd;if(u[k?"left":"right"]=E,!a.labels.filterOverlapping&&function(e){var t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;var a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:v,measureText:b,rect:n,bleedSize:E,angle:a.labels.tiltAngle}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}return{size:l,edgeBleed:u}}var wu=function(e,t,n){return e.width*Math.abs(t.position-n.position)};function qu(e){var t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index,s=t?2:1,l=n[a-s],u=n[a+s],c=l?wu(r,o,l)/2-2:1/0,h=u?wu(r,o,u)/2-2:1/0;return n.length<2?r.width:l?u?2*Math.min(c,h):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth,o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),u=1===r.position?t.width/2-2:0;return Math.max(i,l,u)}({innerRect:r,outerRect:i,tick:o,prevWidth:c}):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth,o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)}({innerRect:r,outerRect:i,tick:o,nextWidth:h})}function Mu(e){var t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0}function Du(e){var t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Mu(e)+e.labels.margin}function Su(e,t){return e.map((function(e){return gu(e,t)}))}function ku(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function _u(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick,l=t.height,u=ku(i,s),c={width:0,height:l};if("left"===n.align||"right"===n.align)c.width=r.width-Du(n)-n.paddingEnd;else if(a)c.width=u*r.width*2;else if(o){var h=Math.abs(n.labels.tiltAngle)*(Math.PI/180);c.width=(r.height-Du(n)-n.paddingEnd-l*Math.cos(h))/Math.sin(h)}else c.width=u*r.width;return c.width=bu({value:c.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),c}function Cu(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,u=e.major,c=t.height,h={width:0,height:c};if("left"===n.align||"right"===n.align)h.width=r.width-Du(n)-n.paddingEnd;else if(o){var d=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(r.height-Du(n)-n.paddingEnd-c*Math.cos(d))/Math.sin(d)}else h.width=qu({layered:a,major:u,innerRect:r,outerRect:i,tick:s,index:l});return h.width=bu({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Eu(e){var t;function n(){return t=Cu,n}function r(){return t=_u,r}function i(e){var n,r=e.settings,i=e.scale,o=e.innerRect,a=e.outerRect,s=e.measureText,l=e.ticks,u=e.state,c=e.textBounds,h=[],d=function(e){return e.filter((function(e){return!e.isMinor}))}(l),f=function(e){return e.filter((function(e){return e.isMinor}))}(l),p={innerRect:o,align:r.align,outerRect:a},m="tilted"===u.labels.activeMode,g="layered"===u.labels.activeMode;if(r.line.show&&(p.style=r.line,p.padding=r.paddingStart,h.push(hu(p))),r.ticks.show&&(p.style=r.ticks,p.tickSize=r.ticks.tickSize,p.padding=Mu(r),n=Su(d,p)),r.labels.show){var y=Du(r);p.style=r.labels,p.padding=y,p.tilted=m,p.layered=g,p.angle=r.labels.tiltAngle,p.paddingEnd=r.paddingEnd,p.textBounds=c;var v=function(e,n){p.textRect=function(e){var t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:p.style});var u=t({textMetrics:p.textRect,settings:r,innerRect:o,outerRect:a,scale:i,tilted:m,layered:g,tick:e,major:d,index:n});p.maxWidth=u.width,p.maxHeight=u.height,p.stepSize=function(e){var t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*ku(n,i)}({innerRect:o,scale:i,ticks:l,settings:r,tick:e})},b=[];b=!g||"top"!==r.align&&"bottom"!==r.align?function(e,t,n){return e.map((function(e,r){n(e,r);var i=mu(e,t);return i.data=e.data,i}))}(d,p,v):function(e,t,n,r){var i=t.padding,o=Du(n);return e.map((function(e,a){r(e,a);var s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;var l=mu(e,t);return l.data=e.data,l}))}(d,p,r,v),r.labels.filterOverlapping&&function(e,t,n){var r=function(t,n){return ks(se(1,e[t].boundingRect),se(1,e[n].boundingRect))};if(n&&n.tilted){var i=Math.abs(n.angle);r=function(t,n){var r=1/Math.abs(e[t].x-e[n].x),o=Math.sin(i*(Math.PI/180))/r;return e[t].boundingRect.height>o}}for(var o=0;o<=e.length-1;o++)for(var a=o+1;a<=Math.min(o+5,o+(e.length-1));a++)e[o]&&e[a]&&r(o,a)&&(a===e.length-1?(e.splice(o,1),t&&t.splice(o,1)):(e.splice(a,1),t&&t.splice(a,1)),a--,o--)}(b,n,p),h.push.apply(h,K(b))}return r.minorTicks&&r.minorTicks.show&&f.length>0&&(p.style=r.minorTicks,p.tickSize=r.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(r),h.push.apply(h,K(Su(f,p)))),n&&h.push.apply(h,K(n)),h}return n.build=i,r.build=i,e?r():n()}var Au={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Tu={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};var Iu={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created:function(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState:function(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){var t=e.state,n=e.style,r=e.settings,i=E(!0,{},t.isDiscrete?Au:Tu,n),o=E(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){var n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));var s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Eu(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){var r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize:function(e){var t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Ca(r,i);var o=function(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0,l=xu({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),u=l.size,c=l.edgeBleed;if(s+=u,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){var h=a.minorTicks.margin+a.minorTicks.tickSize;h>s&&(s=h)}if(a.line.show){var d=a.line.strokeWidth/2;s+=d,c[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(d)}return s+=a.paddingStart,{size:s+=a.paddingEnd,edgeBleed:c}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.settings;this.setState(t)},resize:function(e){var t=e.inner,n=e.outer,r=E({},t,function(e){var t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return E(this.state.innerRect,r),E(this.state.outerRect,i),n},beforeRender:function(){var e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ca(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((function(e){return e.position>=0&&e.position<=1}))},render:function(){var e=this.state,t=[];return t.push.apply(t,K(this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e}))),Ql.multiple(t),t}};var Ru={render:function(){return[]}};function Nu(e,t,n){var r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){var i=(n.data().fields||[]).map((function(e){return e.title()}));r=i.join(t)}return r}function Ou(e,t){var n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}var Pu={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created:function(){this.definitionSettings=this.settings.settings;var e=this.settings.text,t=this.definitionSettings.join;this.title=Nu(e,t,this.scale)},preferredSize:function(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render:function(){var e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){var t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style,s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Ou(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};E(s,a.text);var l=o(s);if("top"===r||"bottom"===r){var u=i.width/2;"left"===n.anchor?u=n.paddingLeft||0:"right"===n.anchor&&(u=i.width-(n.paddingRight||0)),s.x=u,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{var c=i.height/2;"top"===n.anchor?c=n.paddingStart:"bottom"===n.anchor&&(c=i.height-n.paddingStart),s.y=c,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;var h="left"===r?270:90;s.transform="rotate(".concat(h,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate:function(e){e.settings&&(E(this.settings,e.settings),this.definitionSettings=e.settings.settings);var t=this.settings.text,n=this.definitionSettings.join;this.title=Nu(t,n,this.scale)}};function Lu(e,t){var n,r=e.settings.layout.dock,i=e.settings.settings.invert,o="top"===r||"bottom"===r,a=o?"width":"height",s=e.rect[a],l=e.chart.scroll(e.settings.scroll),u=t[o?"x":"y"];i&&(u=s-u);var c=l.getState();n={startOffset:u,startScroll:c.start,swipe:!1};var h=u/s*(c.max-c.min)+c.min;h<c.start?n.startScroll=h:h>c.start+c.viewSize&&(n.startScroll=h-c.viewSize);return{update:function(e){var t=e[o?"x":"y"];if(i&&(t=s-t),!n.swipe){if(Math.abs(n.startOffset-t)<=1)return;n.swipe=!0}var r=l.getState(),a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)},end:function(e){var t=e[o?"x":"y"];i&&(t=s-t);var r=l.getState();if(n.swipe){var a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)}else{var c=t/s*(r.max-r.min)+r.min-r.viewSize/2;l.moveTo(c)}}}}function ju(e,t){var n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}var zu={require:["chart","renderer"],on:{panStart:function(e){var t=ju(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Lu(this,n),this.currentMove.update(t)},panMove:function(e){if(this.currentMove){var t=ju(e,this.renderer);this.currentMove.update(t)}},panEnd:function(e){if(this.currentMove){var t=ju(e,this.renderer);this.currentMove.end(t),this.currentMove=null}},panCancel:function(){this.currentMove=null},tap:function(e){var t=ju(e,this.renderer);Lu(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){var t=this.chart.scroll(this.settings.scroll).getState();return t.viewSize>=t.max-t.min?Math.max(e.width,e.height):this.settings.settings.width},render:function(e){var t,n=this.settings.layout.dock,r=this.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=this.rect[o],s=this.chart.scroll(this.settings.scroll).getState(),l=a*(s.start-s.min)/(s.max-s.min),u=a*s.viewSize/(s.max-s.min);return r&&(l=a-l-u),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:(t={position:"absolute"},L(t,i?"left":"top","".concat(l,"px")),L(t,i?"top":"left","25%"),L(t,i?"height":"width","50%"),L(t,o,"".concat(Math.max(1,u),"px")),L(t,"background",this.settings.settings.thumbColor),t)})))},renderer:"dom"};function Fu(e){var t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx,u="end"!==o,c=u?{left:"0",top:"0"}:{right:"0",bottom:"0"},h=0,d="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(d="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(h=n?s.targetRect.x:s.targetRect.y,d="".concat(s.rect.width-h,"px"),f="".concat(s.rect.height-h,"px")),u||(i-=a),t("div",{onmouseover:function(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout:function(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:i,"px"),top:"".concat(n?i:h,"px"),height:n?"".concat(a,"px"):f,width:n?d:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:E({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},c)})])}function Hu(e){var t,n,r=e.h,i=e.isVertical,o=e.label,a=e.otherValue,s=e.rangeIdx,l=e.idx,u=e.pos,c=e.align,h=e.state,d=e.value,f="end"!==c,p="outside"===h.settings.bubbles.placement,m="none";i?(n=f?"left":"right",p&&(m=f?"translate(-100%, 0px)":"translate(100%, 0px)")):(n=f?"top":"bottom",p&&(m=f?"translate(0px, -100%)":"translate(0px, 100%)"));var g=h.edit&&h.edit.rangeIdx===s&&h.edit.bubbleIdx===l,y={position:"relative",borderRadius:"".concat(h.style.bubble.borderRadius,"px"),border:"".concat(h.style.bubble.strokeWidth,"px solid ").concat(h.style.bubble.stroke),backgroundColor:h.style.bubble.fill,color:h.style.bubble.color,fontFamily:h.style.bubble.fontFamily,fontSize:h.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:i?"translate(0,-50%)":"translate(-50%,0)",cursor:i?"ns-resize":"ew-resize"},v=h.style.bubble.stroke,b=g?r("input",{type:"text",value:d,style:I(I({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var t=parseFloat(e.target.value);isNaN(t)?(v="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(h.style.bubble.strokeWidth,"px solid ").concat(v)):h.onEditConfirmed(s,t,a)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),h.onEditCanceled())}}):r("div",{"data-key":[h.key,"bubble",s,l].join("-"),"data-other-value":a,"data-idx":s,"data-bidx":l,style:y},[o]);return r("div",{style:(t={position:"absolute"},L(t,n,"0"),L(t,i?"top":"left","".concat(u,"px")),L(t,"transform",m),t)},[b])}function Bu(e){var t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",E({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Vu(e){var t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);var u=!!i.scale,c=u?i.scale.norm(o)*i.size:o,h=u?i.scale.norm(a)*i.size:a,d=Math.abs(c-h),f=Math.min(c,h)+l,p=f+d;if(i.targetRect){var m=i.targetFillRect||i.targetRect,g=r?m.height:m.width,y=u?i.scale.norm(o)*g:o,v=u?i.scale.norm(a)*g:a,b=Math.abs(y-v),x=Math.min(y,v),w={h:i.h,isVertical:r,top:x,height:b,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(w.on={onmouseover:function(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout:function(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),height:"".concat(m.height,"px"),width:"".concat(m.width,"px")}},[Bu(w)]))}var q=c<h?o:a,M=c<h?a:o,D=X(u?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),S=D[0],k=D[1],_=q+1e-5>=S&&q-1e-5<=k,C=M-1e-5<=k&&M+1e-5>=S;_&&n.push(Fu({h:i.h,isVertical:r,borderHit:t,value:q,pos:f,align:"start",state:i,idx:s})),C&&n.push(Fu({h:i.h,isVertical:r,borderHit:t,value:M,pos:p,align:"end",state:i,idx:s}));var E=i.settings.bubbles;if(E&&E.show){var A={fontSize:E.fontSize,fontFamily:E.fontFamily,color:E.fill},T=[o,a];_&&n.push(Hu({h:i.h,isVertical:r,align:E.align,style:A,rangeIdx:s,idx:0,otherValue:M,value:q,label:"".concat(i.format(q,T)),pos:f,state:i})),C&&n.push(Hu({h:i.h,isVertical:r,align:E.align,style:A,rangeIdx:s,idx:1,otherValue:q,value:M,label:"".concat(i.format(M,T)),pos:p,state:i}))}}function Wu(e){var t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start,r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t)}function Uu(e){var t=[],n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((function(r,i){e.active&&i===e.active.idx||Vu({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){var r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{var o=Wu(e);r=e.active.start+o,i=e.active.end+o}Vu({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function $u(e){return{min:e.scale.min(),max:e.scale.max()}}function Yu(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Xu(e,t,n){var r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Ku(e){e.renderer.render(Uu(e))}function Gu(e,t){if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}function Ju(e,t){for(var n,r=1/0,i=t.domain(),o=t.bandwidth()/2,a=0;a<i.length;++a){var s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Zu(e,t){return Math.min.apply(Math,K(e))<=Math.max.apply(Math,K(t))&&Math.max.apply(Math,K(e))>=Math.min.apply(Math,K(t))}function Qu(e){return ie(e.reduce((function(e,t){return e.push.apply(e,K(re(t.bounds))),e}),[]))}var ec={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart:function(e){this.start(e)},rangeMove:function(e){this.move(e)},rangeEnd:function(e){this.end(e)},rangeClear:function(e){this.clear(e)},bubbleStart:function(e){this.bubbleStart(e)}},created:function(){this.state={key:this.settings.key||"brush-range"}},beforeRender:function(e){this.state.rect=e.size.computedInner},renderRanges:function(){this.state.started||(this.state.ranges=Gu(this.state,this.state.brushInstance),this.state.active=null,Ku(this.state))},render:function(e){var t=this,n=this.settings.settings;this.state.direction="vertical"===n.direction?0:1;var r=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"],o=Ca(this.chart.scale(n.scale),i),a=function(e){var t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((function(t){return e.chart.component(t)})).filter((function(e){return!!e&&!!e.rect})),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){var a=Qu(i);if(t.size=a[0===e.state.direction?"height":"width"],t.scale=Ca(e.chart.scale(n.scale),t.size),t.targetRect=a,o.length>0){var s=Qu(o);t.targetFillRect=s}}else if(r&&r.length>0){var l=r.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:l.x0-e.state.rect.x,y:l.y0-e.state.rect.y,width:l.x1-l.x0,height:l.y1-l.y0}}return t}(this);if(o=a.scale?a.scale:o,this.state.targetRect=a.targetRect,this.state.targetFillRect=a.targetFillRect,this.state.size=null===a.size?i:a.size,this.state.settings=n,this.state.style=this.style,this.state.offset=r,this.state.brush="object"===R(n.brush)?n.brush.context:n.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.onEditConfirmed=function(e,n,r){t.state.edit=null,function(e,t,n,r){var i=e.ranges.map((function(e){return{min:e.min,max:e.max}})),o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=I({},i[t]);var s=e.scale.data();s&&s.fields&&s.fields.forEach((function(t){e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(t.state,e,n,r),t.emit("bubbleEnd"),Ku(t.state)},this.state.onEditCanceled=function(){t.state.edit=null,Ku(t.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof n.bubbles.label&&function(e,r){return n.bubbles.label.call(void 0,{datum:e,data:r,scale:o,resources:{scale:t.chart.scale,formatter:t.chart.formatter}})},{}.hasOwnProperty.call(o,"norm")){this.state.editable=!0,this.state.observeBrush="object"===R(n.brush)&&n.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=o;var s=this.state.scale.data();!this.state.format&&s&&s.fields&&s.fields[0]&&(this.state.format=s.fields[0].formatter())}else this.state.editable=!1,this.state.scale=qo(),this.state.scale.data=o.data,this.state.format||(this.state.format=function(e,t){return Zu(o.range(),t)?function(e,t){var n=t.ticks(),r=t.domain().indexOf(Ju(e,t));return-1!==r?n[r].label:"-"}(e,o):"-"}),this.state.fauxBrushInstance=ya(),this.state.findValues=function(e){return function(e,t){var n=t.domain(),r=t.range(),i=[];return e.forEach((function(e){if(Zu(r,[e.min,e.max])){var o=n.indexOf(Ju(e.min,t)),a=n.indexOf(Ju(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}})),i}(e,o)};return this.state.ranges=Gu(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Uu(this.state)]:[]},mounted:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){t.edit=null;var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=E({},r.element().getBoundingClientRect());var c=a-t.offset.left,h=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);var d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];u.current=t.scale.normInvert(f/t.size),u.start=t.scale.normInvert(d/t.size);var p,m,g=t.ranges,y=$u(t),v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),y.min=v>0?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;else{for(p=0;p<g.length;p++){if(g[p].min<=u.start&&u.start<=g[p].max){v=p,y.min=p?g[p-1].max:y.min,y.max=p+1<g.length?g[p+1].min:y.max;break}if(u.start<g[p].min){y.max=g[p].min,y.min=p?g[p-1].max:y.min;break}}-1===v&&g.length&&p>=g.length&&(y.min=g[g.length-1].max)}if(-1!==v||t.multi||(u.ranges=[],y.min=t.scale.min(),y.max=t.scale.max()),-1!==v)if(m={idx:v,start:g[v].min,end:g[v].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),m.mode="modify";else{var b=t.scale.norm(m.start)*t.size,x=t.scale.norm(m.end)*t.size;Math.abs(d-b)<=o?(u.start=m.end,m.mode="modify"):Math.abs(d-x)<=o&&(u.start=m.start,m.mode="modify")}else m={idx:-1,start:u.start,end:u.current,limitLow:y.min,limitHigh:y.max,mode:"current"};u.active=m,"modify"!==m.mode&&t.targetRect&&!Cs(t.targetRect,{x:c,y:h})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:Gu,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);var n=$u(e);Xu(e,e.current,n)}(this.state,Gu),Ku(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move:function(e){this.state.started&&(!function(e,t){var n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Wu(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});var r=e.scale.data();r&&r.fields&&r.fields.forEach((function(n){if(e.fauxBrushInstance){var r=Gu(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((function(e){return-1===i.indexOf(e)})),s=i.filter((function(e){return-1===o.indexOf(e)})),l=a.map((function(e){return{key:n.id(),value:e}})),u=s.map((function(e){return{key:n.id(),value:e}}));e.brushInstance.addAndRemoveValues(l,u),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Ku(this.state))},clear:function(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart:function(e){if(this.state.editable){var t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(!isNaN(r.rangeIdx)&&JSON.stringify(r)!==JSON.stringify(this.state.edit)){this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();var i=n.parentNode;Ku(this.state);var o=i.querySelector("input");o.focus(),o.select()}}}};function tc(e){e.renderer.render(Uu(e))}function nc(e){return e.rc.ranges()}var rc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaClear:function(e){this.clear(e)}},created:function(){this.state={key:this.settings.key||"brush-area-dir"}},render:function(e){var t=this;this.state.rect=this.rect;var n=this.settings.settings,r="vertical"===n.direction?0:1,i=this.state.rect[0===r?"height":"width"],o=this.renderer.element().getBoundingClientRect(),a=(n.target?n.target.components||[n.target.component]:[]).map((function(e){return t.chart.component(e)})).filter((function(e){return!!e&&!!e.rect})),s=a[0]?a.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}}),{x0:a[0].rect.x,y0:a[0].rect.y,x1:a[0].rect.x+a[0].rect.width,y1:a[0].rect.y+a[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=r,this.state.settings=n,this.state.offset=o,this.state.rc=ra(),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){var r=Math.min.apply(Math,K(n)),i=Math.max.apply(Math,K(n)),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";var s=a.reduce((function(n,i){var o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce((function(e,t){return e.key===s.key?e:t}));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);var c=a-t.offset.left,h=s-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset],p=f,m=d;u.start=d,u.current=f;var g,y,v=t.ranges,b=Yu(t),x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),b.min=x>0?v[x-1].max:b.min,b.max=x+1<v.length?v[x+1].min:b.max;else{for(g=0;g<v.length;g++){if(v[g].min<=m&&m<=v[g].max){x=g,b.min=g?v[g-1].max:b.min,b.max=g+1<v.length?v[g+1].min:b.max;break}if(m<v[g].min){b.max=v[g].min,b.min=g?v[g-1].max:b.min;break}}-1===x&&v.length&&g>=v.length&&(b.min=v[v.length-1].max)}if(-1!==x||t.multi||(u.ranges=[],b.min=0,b.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(y={idx:x,start:v[x].min,end:v[x].max,limitLow:b.min,limitHigh:b.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{var w=y.start,q=y.end;Math.abs(d-w)<=o?(u.start=y.end,y.mode="modify"):Math.abs(d-q)<=o&&(u.start=y.start,y.mode="modify")}else y={idx:-1,start:m,end:p,limitLow:b.min,limitHigh:b.max,mode:"current"};u.active=y,"modify"!==y.mode&&t.targetRect&&!Cs(t.targetRect,{x:c,y:h})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:nc,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);var n=Yu(e);Xu(e,e.current,n)}(this.state,nc),tc(this.state))},move:function(e){this.state.started&&(!function(e,t){var n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Wu(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);var r=[];t.forEach((function(t){r=[].concat(K(r),K(function(e,t){var n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}(e,t)))})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,r)}(this.state),tc(this.state))},clear:function(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function ic(e){var t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){var t=e.brush;if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}(e).map((function(i){var o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function oc(e,t,n,r){function i(){!function(e){e.renderer.render(ic(e))}(e)}function o(){!function(e){e.renderer.render(ic(e))}(e)}function a(){!function(e){e.renderer.render(ic(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function ac(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}var sc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:function(){return 50},created:function(){this.state={}},render:function(){var e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Ca(this.chart.scale(e.scale),r);return ac(this.state),oc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,ic(this.state)},beforeDestroy:function(){ac(this.state)}};function lc(e,t){var n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function uc(e,t,n){return Ga(e,t.points[0])<Math.pow(n.settings.snapIndicator.threshold,2)}function cc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function hc(e){var t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function dc(e,t){e.snapIndicator.visible=t}var fc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart:function(e){this.start(e)},lassoEnd:function(e){this.end(e)},lassoMove:function(e){this.move(e)},lassoCancel:function(){this.cancel()}},created:function(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start:function(e){var t,n,r,i;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=(n=this.chart,r=this.state.rendererBounds,i=n.element.getBoundingClientRect(),{x:r.left-i.left,y:r.top-i.top}),this.state.brushConfig=function(e){return e.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}}))}(this.settings);var o=lc(this.state.rendererBounds,e);cc(this.state,o),hc({state:this.state,start:o}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,o)},move:function(e){if(this.state.active){var t=lc(this.state.rendererBounds,e);uc(t,this.state,this.settings)?dc(this.state,!0):dc(this.state,!1),cc(this.state,t),hc({state:this.state,end:t}),function(e,t){var n=[e.startPoint,e.path,e.snapIndicator].filter((function(e){return e.visible}));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){var n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;var i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)}},end:function(e){this.state.active&&(dc(this.state,!1),uc(lc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){var n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((function(e){return{x:e.x+n,y:e.y+r}})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render:function(){}};function pc(e,t,n,r,i){for(var o,a=0,s=t.length-1;a<s;){var l=Math.floor((a+s)/2);(o=i(t[l]))[n]+o[r]<e[n]?a=l+1:s=l}return a}function mc(e){var t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pc,a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",u=function(e){return e.textBounds},c=function(e){return e.node.localBounds};return function(e,t){var h=r[t],d=h.textBounds,f=h.node;if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(var p=o(d,a,s,l,u);p<a.length;p++)if(ks(d,a[p].textBounds))return!1;for(var m=o(d,n,s,l,c),g=d[s]+d[l],y=m;y<n.length;y++){var v=n[y].node;if(g<v.localBounds[s])break;if(ks(d,v.localBounds)&&f!==v)return!1}return a.push(r[t]),!0}}function gc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function yc(e){var t=R(e);return("string"===t||"number"===t)&&""!==e}function vc(e){return I({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds)}function bc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function xc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function wc(e,t,n,r,i){var o,a;return"v"===e?(o=r||i||bc(t,n,!0),a=xc(t,n,!r)):(o=bc(t,n),a=i||xc(t,n,!1)),o&&a}function qc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function Mc(e,t,n){var r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return bc(e,t,n.rotate)&&xc(e,t,n.rotate)}(e,i,n))return!1;var o=.5*i.height;return n.rotate?(r.x=qc(e.x,e.width,i.height,n.align)+o,r.y=qc(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=qc(e.x,e.width,i.width,n.align),r.y=qc(e.y,e.height,i.height,n.justify)+o),r}function Dc(e){var t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s={};if(E(s,t),i&&"inside"!==i)if("up"===r||"down"===r){var l=Math.max(0,Math.min(t.y,n.height)),u=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=l):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=u,s.height=n.height-u)}else{var c=Math.max(0,Math.min(t.x,n.width)),h=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=c):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=h,s.width=n.width-h)}else;return function(e,t){var n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.top,r=void 0===n?4:n,i=t.bottom,o=void 0===i?4:i,a=t.left,s=void 0===a?4:a,l=t.right,u=void 0===l?4:l;e.x+=s,e.width-=s+u,e.y+=r,e.height-=r+o}(s,a),s}function Sc(e){var t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,u=e.node,c=e.orientation,h=e.placementSettings,d=e.rect,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dc,p=[],m="h"===c?"width":"height";for(o=0;o<h.length;o++)if(r=h[o],i=f({bar:u.localBounds,view:d,direction:a,position:r.position,padding:r.padding}),p.push(i),t=!o||i[m]>t[m]?i:t,wc(c,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),{bounds:n,placement:r=h[o]}}function kc(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,u=i.left,c=void 0===u?4:u,h=i.right,d=void 0===h?4:h,f=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),y=.5*t.height,v=1e-9,b=n?f-y:f,x=n?p:p-y,w={x:b-c-v,y:x-a-v,width:g+(c+d)-v,height:m+(a+l)-v};return w}function _c(e){for(var t,n,r,i,o,a,s,l,u,c,h,d,f,p=e.chart,m=e.targetNodes,g=e.rect,y=e.fitsHorizontally,v=e.collectiveOrientation,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sc,x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mc,w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mc,q=[],M={container:g,targetNodes:m,labels:[],orientation:v},D=0,S=m.length;D<S;D++){a=null,d=gc(r=(n=m[D]).node,p),f="left"===(u=n.direction)||"right"===u?"h":"v";for(var k=0;k<n.texts.length;k++)if(yc(i=n.texts[k])){var _=b({direction:u,fitsHorizontally:y,lblStngs:c=n.labelSettings[k],measured:l=n.measurements[k],node:r,orientation:f,placements:c.placements,placementSettings:n.placementSettings[k],rect:g});if(a=_.bounds,h=_.placement,a&&h){o=h.justify;var C="function"==typeof c.linkData?c.linkData(d,D):void 0,E="function"==typeof h.overflow?h.overflow(d,D):h.overflow;"up"===u&&(o=1-o),"opposite"===h.position&&(o=1-o),"left"===u&&(o=1-o);var A=!("h"===v||y);if(t=x(a,i,{justify:"h"===f?h.align:o,align:"h"===f?o:h.align,fontSize:c.fontSize,fontFamily:c.fontFamily,textMetrics:l,rotate:A,overflow:!!E})){var T=kc(t,l,A,a,h.padding);s="function"==typeof h.fill?h.fill(I(I({},d),{},{textBounds:T}),D):h.fill,t.fill=s,void 0!==C&&(t.data=C),"object"===R(h.background)&&(t.backgroundColor="function"==typeof h.background.fill?h.background.fill(I(I({},d),{},{textBounds:T}),D):h.background.fill,void 0!==t.backgroundColor&&(t.backgroundBounds=kc(t,l,A,a,h.background.padding))),q.push(t),M.labels.push({node:r,textBounds:T})}}}}var N=q.filter(w(M)),O=N.filter((function(e){return void 0!==e.backgroundBounds})).map(vc);return[].concat(K(O),K(N))}function Cc(e){for(var t,n,r,i,o,a,s,l=e.nodes,u=e.rect,c=e.chart,h=e.labelSettings,d=e.placementSettings,f=e.settings,p=e.renderer,m={},g=[],y=!0,v=!1,b=0;b<l.length;b++)if(ks(i=(n=l[b]).localBounds,u)){var x=gc(n,c);t={node:n,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(var w=0;w<h.length;w++)yc(r="function"==typeof(a=h[w]).label?a.label(x,b):void 0)&&(s="function"==typeof f.direction?f.direction(x,b):f.direction||"up",v=v||"left"===s||"right"===s,m.fontFamily=a.fontFamily,m.fontSize="".concat(a.fontSize,"px"),m.text=r,o=p.measureText(m),t.measurements.push(o),t.texts.push(r),t.labelSettings.push(a),t.placementSettings.push(d[w]),t.direction=s,y=y&&o.width<=i.width-8);g.push(t)}return{targetNodes:g,fitsHorizontally:y,hasHorizontalDirection:v}}function Ec(e){var t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}function Ac(e){var t=2*Math.PI;return(e%t+t)%t}function Tc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Ic(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Rc(e,t,n){var r=t.x,i=t.y;if(r*r+i*i>e*e)return null;var o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;var u=Math.sqrt(l);return{x:s*a+o*u,y:-s*o+a*u}}function Nc(e){var t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(!(t=Rc(r,l,o)))return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(!(t=Rc(r,l,Math.PI-o)))return null;n={x:-a,y:-s};break;case 2:if(!(t=Rc(r,l,o-Math.PI)))return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(!(t=Rc(r,l,2*Math.PI-o)))return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Oc(e){var t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,u=o-i;if(u<Math.PI){var c=(n.height/2+r)/Math.tan(u/2);c>a&&(l=s-c-2*r)}if(l<0||l<n.minReqWidth)return null;var h=Ac((i+o)/2),d=s-r,f={x:Math.sin(h)*d,y:-Math.cos(h)*d,width:l,height:n.height};return h<Math.PI?(f.angle=h-Math.PI/2,f.anchor="end"):(f.angle=h+Math.PI/2,f.anchor="start"),f}function Pc(e){var t=e.context,n=e.node,r=e.bounds,i=n.desc.slice,o=Ac((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Lc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function jc(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){var i=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(i,", ").concat(r.x,", ").concat(r.y,")")}return r}function zc(e){var t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,u=e.context,c=e.store,h=r.start,d=r.end,f=r.innerRadius,p=r.offset;switch(o){case"into":t="rotate"===i?Oc({slice:r,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=Ac((i+o)/2),u=Nc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",Es(u,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Es(u,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||xs({cx:0,cy:0,r:a},u)?null:(Tc(u,n),u)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===i?Oc({slice:n,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=e.store,o=t.start,a=t.end,s=t.outerRadius,l=Ac((o+a)/2),u=Nc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",Tc(u,n),i.insideLabelBounds.some((function(e){return ks(e,u)}))?null:(i.insideLabelBounds.push({x:u.x-4,y:u.y,width:u.width+8,height:u.height}),u)):null}({slice:n,measured:s,padding:a,store:c});break;case"outside":t="rotate"===i?function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,u=s+r,c=a-o;if(c<Math.PI&&(n.height/2+r)/Math.tan(c/2)>u)return null;var h=Ac((o+a)/2),d=Math.sin(h)*u,f=-Math.cos(h)*u,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){var g=f<0?i.y:i.y+i.height,y=Math.abs(g-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;y<p&&(p=y)}if(Math.sin(m)>.001){var v=d<0?i.x:i.x+i.width,b=Math.abs(v-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;b<p&&(p=b)}if(p<=0||p<n.minReqWidth)return null;var x={x:d,y:f,width:p,height:n.height};return h<Math.PI?(x.angle=h-Math.PI/2,x.anchor="start"):(x.angle=h+Math.PI/2,x.anchor="end"),x}({slice:r,measured:s,padding:a,view:l}):function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,u=t.offset,c=Ac((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(c/(Math.PI/2)),i))return null;var h=l+r+n.height/2,d=Math.sin(c)*h,f=-Math.cos(c)*h,p=n.width+1;if(c<Math.PI){var m=Math.abs(i.x+i.width-(d+u.x));m<p&&(p=m)}else{var g=Math.abs(i.x-(d+u.x));g<p&&(p=g)}if(p<n.minReqWidth)return null;var y={x:d,y:f,width:p,height:n.height};return c<Math.PI?y.anchor="start":y.anchor="end",y}({slice:r,measured:s,padding:a,view:l,context:u});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){var r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=Ac((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){var l=Math.min(e.y,t.q1maxY-e.height),u=e.y-l;if(e.y=l,u>1){var c=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*c,y2:o.y-Math.cos(s)*c,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){var h=Math.max(e.y,t.q2minY),d=h-e.y;if(e.y=h,d>1){var f=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*f,y2:o.y-Math.cos(s)*f,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){var p=Math.max(e.y,t.q3minY),m=p-e.y;if(e.y=p,m>1){var g=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*g,y2:o.y-Math.cos(s)*g,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){var y=Math.min(e.y,t.q4maxY-e.height),v=e.y-y;if(e.y=y,v>1){var b=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*b,y2:o.y-Math.cos(s)*b,strokeWidth:1}}}}}(t,u,r)),t}function Fc(e){for(var t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zc,u=0;u<o.length;u++){var c=o[u],h=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(h)return{bounds:h,placement:c}}return{bounds:null,placement:null}}function Hc(e){for(var t=[],n=[],r=[],i=[],o=0;o<e.length;++o){var a=e[o].desc.slice,s=Ac((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}var l=function(e,t){return Ac((e.desc.slice.start+e.desc.slice.end)/2)-Ac((t.desc.slice.start+t.desc.slice.end)/2)},u=function(e,t){return l(t,e)};return t.sort(u),n.sort(l),r.sort(u),i.sort(l),t.concat(n,i,r)}function Bc(e,t,n){var r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}var Vc=/\n+|\r+|\r\n/,Wc=/\s/,Uc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function $c(e){return"string"==typeof e?-1!==e.search(Vc):-1!==String(e).search(Vc)}function Yc(e){return-1!==e.search(Wc)}function Xc(e){return-1!==e.search(Uc)}function Kc(e,t,n,r,i){return r.some((function(r){return r(e,t,n)}))?1:i.some((function(r){return r(e,t,n)}))?0:2}function Gc(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Jc(e,t,n){return Math.max(t,Math.min(n,e))}function Zc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?function(e){return{width:e.length,height:1}}:a,l=e.mandatoryBreakIdentifiers,u=void 0===l?[$c]:l,c=e.noBreakAllowedIdentifiers,h=void 0===c?[]:c,d=e.suppressIdentifier,f=void 0===d?[Yc,$c,function(e){return""===e}]:d,p=e.hyphenationIdentifiers,m=void 0===p?[Xc]:p,g=String(t).split(r);Gc(g);var y=g.length,v=o?function(e){return e>=0}:function(e){return e<y},b=o?y:-1;function x(e){var t=Jc(e,0,y-1),n=g[t],r=s(n),i=Kc(n,t,g,u,h);return{index:t,value:n,breakOpportunity:i,suppress:f.some((function(e){return e(n,t,g)})),hyphenation:m.some((function(e){return e(n,t,g)})),width:r.width,height:r.height,done:!1}}function w(e){return isNaN(e)?o?b--:b++:b=Jc(e,0,y-1),v(b)?x(b):{done:!0}}return{next:w,peek:x,length:y}}var Qc="…",eh=/^\s*\d+(\.\d+)?px\s*$/i;function th(e){return"string"===R(e)&&eh.test(e)}function nh(e){var t=e["font-size"]||e.fontSize;return th(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function rh(e){var t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;var r=nh(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function ih(e,t){return{lines:[],line:"",width:0,maxLines:rh(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function oh(e){e.lines.push(e.line),e.line="",e.width=0}function ah(e,t){e.line+=t.value,e.width+=t.width}function sh(e,t,n){if(t.width>e.maxWidth)return t;for(var r=t.index,i=1;i<5;i++){var o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function lh(e,t,n){for(var r=Zc({string:t.value,measureText:n});e.lines.length<e.maxLines;){var i=r.next();if(i.done)break;e.width+i.width>e.maxWidth&&2===i.breakOpportunity&&e.line.length>0?(i=e.hyphens.enabled?sh(e,i,r):i,oh(e),ah(e,i)):ah(e,i)}}function uh(e,t){for(var n=Zc({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[function(e,t){return 0===t}]}),r=ih(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){oh(r),i=!1;break}1===o.breakOpportunity?oh(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?r.width+=o.width:(o=r.hyphens.enabled?sh(r,o,n):o,oh(r),ah(r,o)):ah(r,o)}return{lines:r.lines,reduced:i}}function ch(e,t){for(var n=Zc({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=ih(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){oh(r),i=!1;break}1===o.breakOpportunity?oh(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?oh(r):o.width>r.maxWidth?lh(r,o,t):(oh(r),ah(r,o)):ah(r,o)}return{lines:r.lines,reduced:i}}function hh(e){return{"break-all":uh,"break-word":ch}[e.wordBreak]}function dh(e){return function(t){var n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){var r=hh(n);if(!r)return;var i=e(n);if(i.width>n.maxWidth||$c(n.text)){var o=(nh(n)-i.height)/2,a=r(n,function(e,t){return function(n){return t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}}(n,e));t.node=function(e,t,n,r){var i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);var o=0;return e.lines.forEach((function(a,s){var l=E({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Qc:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function fh(e,t){var n=e.text,r=e["font-size"],i=e["font-family"],o=e.maxWidth;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;var a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;for(var s=0,l=n.length-1;s<=l;){var u=Math.floor((s+l)/2);(a=t({text:n.substr(0,u)+Qc,fontSize:r,fontFamily:i}).width)<=o?s=u+1:l=u-1}return n.substr(0,l)+Qc}function ph(e){var t=e.baseline||e["dominant-baseline"],n=0,r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}var mh,gh={},yh={},vh={fontSize:void 0,fontFamily:void 0};function bh(e,t,n){var r=e+t+n;return"number"!=typeof yh[r]&&(mh=mh||document.createElement("canvas").getContext("2d"),function(e,t){vh.fontSize===e&&vh.fontFamily===t||(mh.font=e+" "+t,vh.fontSize=e,vh.fontFamily=t)}(t,n),yh[r]=mh.measureText(e).width),yh[r]}function xh(e){return"number"!=typeof gh[e]&&(gh[e]=function(e){if(th(e)){var t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),gh[e]}function wh(e){var t=e.text,n=e.fontSize;return{width:bh(t,n,e.fontFamily),height:xh(n)}}function qh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wh,n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,u=(e.dy||0)+ph(e),c={x:0,y:s+u-.75*i.height,width:o,height:i.height},h=e["text-anchor"]||e.anchor;return c.x="middle"===h?a+l-o/2:"end"===h?a+l-o:a+l,c}function Mh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wh,n=hh(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||$c(e.text))){for(var a=n(e,(function(e){return t({text:e,fontFamily:i,fontSize:r})})),s=E({},e),l=0,u="",c=0,h=a.lines.length;c<h;c++){var d=a.lines[c];d+=c===h-1&&a.reduced?Qc:"";var f=t({text:d,fontSize:r,fontFamily:i}).width;f>=l&&(l=f,u=d)}s.text=u;var p=qh(s,t);return p.height=nh(e)*a.lines.length,p}return qh(e,t)}var Dh=.9;function Sh(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function kh(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;var o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function _h(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Ch(e){return e.desc&&e.desc.slice?function(e){var t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};var a=0!==r?r:i;return _h({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?_h(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Eh={bar:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_c,l=E({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);var u=t.labels.map((function(e){return E({},l,t,e)})),c=t.labels.map((function(e){return e.placements.map((function(n){return E({},l,t,e,n)}))})),h=Cc({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:u,placementSettings:c}),d=h.fitsHorizontally,f=h.hasHorizontalDirection,p=h.targetNodes,m=Ec({orientation:t.orientation,defaultOrientation:f?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return p.sort((function(e,t){return e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])})),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:m})},slice:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jc,u=E({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);u.fontSize=parseInt(u.fontSize,10);for(var c=t.labels.map((function(e){return E({},u,t,e)})),h=t.labels.map((function(e){return e.placements.map((function(n){return E({},u,t,e,n)}))})),d=[],f={insideLabelBounds:[]},p={},m=0,g=(r=Hc(r)).length;m<g;m++)for(var y=r[m],v=Lc(y,n),b=0;b<c.length;b++){var x=c[b],w="function"==typeof x.label?x.label(v,m):"";if(w){var q="function"==typeof x.direction?x.direction(v,m):x.direction||"horizontal",M="function"==typeof x.linkData?x.linkData(v,m):void 0,D=Bc(w,x,o),S=s({context:p,direction:q,lblStngs:x,measured:D,node:y,placementSettings:h[b],rect:i,store:f}),k=S.bounds,_=S.placement;if(k&&_){if("outside"===_.position&&"rotate"!==q){Pc({context:p,node:y,bounds:k});var C=Ic(k);if(!ds(C,i))continue}var A="function"==typeof _.fill?_.fill(v,m):_.fill,T=l(k,w,{fill:A,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:D});T&&(void 0!==M&&(T.data=M),d.push(T),k.line&&(k.line.stroke=A,d.push(k.line)))}}}return d},rows:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kh,s=E({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);for(var l=E({},s,t),u=t.labels.map((function(e){return E({},l,e)})),c={},h=[],d=0,f=r.length;d<f;d++){var p=r[d],m=Sh(p,n),g=Ch(p),y=g.type,v=g.bounds;if(v){var b=0,x=[],w=[],q="circle"===y?2*v.r*Dh:v.height;b+=l.padding;var M=void 0;for(M=0;M<u.length;M++){var D=u[M],S="function"==typeof D.label?D.label(m,d):"";c.fontFamily=D.fontFamily,c.fontSize="".concat(D.fontSize,"px"),c.text=S;var k=i.measureText(c);if((b+=k.height+D.padding)>q)break;w.push(S),x.push(k)}var _=M,C=Math.max(0,q-b),A=void 0;for(A="circle"===y?v.cy-v.r*Dh:v.y,A+=l.justify*C+l.padding,M=0;M<_;M++){var T=u[M],I=void 0;if("circle"===y){var R=Math.max(Math.abs(A-v.cy),Math.abs(A+x[M].height-v.cy)),N=Math.sqrt(v.r*v.r-R*R);I={x:v.cx-N+l.padding,y:A,width:2*N-2*l.padding,height:x[M].height}}else I={x:v.x+l.padding,y:A,width:v.width-2*l.padding,height:x[M].height};A+=x[M].height+l.padding;var O="function"==typeof T.fill?T.fill(m,d):T.fill,P="function"==typeof T.linkData?T.linkData(m,d):void 0,L=a(I,w[M],{fill:O,align:T.align,fontSize:T.fontSize,fontFamily:T.fontFamily,textMetrics:x[M]});if(L){if(L.text&&L.text!==Qc){var j=fh(L,i.measureText);if(Qc===j)continue;L.ellipsed=j}void 0!==P&&(L.data=P),h.push(L)}}}}return h}};var Ah={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render:function(){var e=this,t=this.settings.settings,n=[];return(t.sources||[]).forEach((function(t){t.strategy&&Eh[t.strategy.type]&&t.component&&n.push.apply(n,K(function(e,t){var n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];var s=n.findShapes(r.selector).filter((function(e){return e.key===r.component}));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:e.chart,rect:e.rect,renderer:e.renderer,source:t,style:e.style},Eh[t.strategy.type])))})),n}};var Th={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Ih(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,u=i.label.displayObject,c=i.label.bounds,h=i.symbol.meta,d="rtl"===l,f={x:d?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},p=function(e,t,n){var r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:d?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:f.height},h.size,{align:void 0===h.align?.5:h.align,justify:void 0===h.justify?.5:h.justify}),m=a(E({},h,p));return delete m.collider,u.anchor=d?"end":"start",function(e,t,n){var r=n.textMetrics;if(e.height<r.height)return!1;var i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";var o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(f,u,{textMetrics:c,fontSize:parseInt(u.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,u],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:f}}function Rh(e,t){var n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Nh(e,t){var n,r,i,o,a=t.onScroll,s=void 0===a?function(){}:a,l=null,u=0,c={itemize:function(t){n=function(e,t){for(var n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,u=i.labels.items,c=0,h=0,d=0,f=0;f<s.length;f++)if(!1!==s[f].show){var p=void 0!==u[f].text?u[f].text:u[f].data.label||"";n=E({},u[f],{type:"text",fontSize:"".concat(parseInt(u[f].fontSize,10),"px"),text:p,title:p}),r={symbol:{meta:l[f]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),c=Math.max(l[f].size,c),h=Math.max(r.label.bounds.width,h),d=Math.max(r.label.bounds.height,d)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:c,maxItemBounds:{height:Math.max(c,d),width:c+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:function(t){i=t.viewRect,u=c.getContentOverflow(i);var a=c.extent();l=Math.max(0,Math.min(l,u)),o=E({},i);var s="horizontal"===c.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){for(var r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?Ih:o,s=n.parallels,l=n.createSymbol,u=i.layout.direction,c=i.globalMetrics,h=i.items,d="horizontal"===i.layout.orientation,f=0,p=[],m=c.maxItemBounds.height,g=c.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g,b=t.x,x=t.y,w=r.x-t.x,q=0;q<h.length;q++){var M=a({y:x,x:"rtl"===u?r.x+w+r.width-g-(b-t.x):b,item:h[q],globalMetrics:c,direction:u,createSymbol:l});if((d&&b>=r.x-g||!d&&x>=r.y-m)&&p.push(M.item),++f>=s?(f=0,d?(b+=v,x=t.y):(x+=y,b=t.x)):d?x+=y:b+=v,!d&&x>r.y+r.height)break;if(d&&b>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:function(e,t){return r=function(e,t,n){var r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o],s=Math.ceil(a/e);if(null!=t){var l="horizontal"===n.layout.orientation?"height":"width",u="width"===l?"horizontal":"vertical",c=n.layout.margin[u]||4,h=Math.floor((t+c)/(c+n.globalMetrics.maxItemBounds[l]));s=Math.min(s,h)}var d=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,d))}(e,t,n),r},hasContentOverflow:function(){var e="horizontal"===n.layout.orientation?"width":"height";return Rh(n,r)>i[e]},getContentOverflow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Rh(n,r)-e[t])},getNextSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:function(){return"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height},hasPrev:function(){return"horizontal"===c.orientation()?o.x<i.x:o.y<i.y},next:function(){c.scroll(-c.getNextSize())},prev:function(){c.scroll(c.getPrevSize())},scroll:function(e){var t=Math.max(0,Math.min(u,l-e));t!==l&&(l=t,s())},offset:function(){return l},orientation:function(){return n.layout.orientation},direction:function(){return n.layout.direction},extent:function(){return Rh(n,r)},spread:function(){return function(e,t){var n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)}};return c}function Oh(e){return Object.keys(e).filter((function(t){return e[t]})).join(" ")}var Ph={up:"▲",right:"▶",down:"▼",left:"◀"};function Lh(e,t){var n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="",l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));var u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",E({class:Oh(a),style:u},l),[s||e("span",{style:{pointerEvents:"none"}},[Ph[i]])])}function jh(e){var t,n={itemize:function(e){var n,r;r=(n=e).dock,t={layout:{orientation:"top"===r||"bottom"===r?"vertical":"horizontal"},navigation:n.navigation}},render:function(r){return function(e,t,n,r){var i=t.rect,o=t.itemRenderer;if(e&&e.renderArgs){e.size(i);var a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),u=o.hasNext(),c=o.hasPrev();if(c||u){var h=s?["right","left"]:["down","up"];l&&s&&h.reverse();var d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Lh(a,{size:32,isActive:u,direction:h[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Lh(a,{size:32,isActive:c,direction:h[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(d)}else e.render([])}}(n.renderer,r,t,e)},extent:function(){return 32},spread:function(){return 64}};return n}function zh(e){var t,n={itemize:function(n){t=function(e,t){var n=e.resolved;if(!1===n.title.item.show)return null;var r=E({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){var i=t.scale.data().fields;r.text=i&&i[0]?i[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:function(e){!function(e,t,n){var r=e.rect;if(t){var i=[];if(t.size(r),n){var o={start:0,end:r.width,middle:r.width/2};i.push(E({},n.displayObject,{x:o[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}}(e,n.renderer,t)},spread:function(){return t?t.bounds.height:0},extent:function(){return t?t.bounds.width:0}};return n}function Fh(e,t,n,r){var i,o,a,s=r.itemRenderer,l=r.navigationRenderer,u=r.titleRenderer,c=r.isPreliminary,h=void 0!==c&&c,d=0,f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:f.x,y:f.y,width:f.width,height:u.spread()},"horizontal"===n){i={x:f.x,y:f.y,width:u.extent(),height:u.spread()};var p=f.width-i.width-(i.width?t.spacing:0),m=f.height;s.parallelize(p,h?void 0:m);var g=s.extent()>p?l.extent():0,y=s.spread(),v=g?l.spread():0;a={x:(o={x:i.x+i.width+(i.width?t.spacing:0),y:f.y+Math.max(0,(v-y)/2),width:f.width-g-i.width-(g?t.spacing:0)-(i.width?t.spacing:0),height:m}).x+o.width+(g?t.spacing:0),y:f.y,width:g,height:f.height},i.y=o.y,"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,v,s.spread())}else{var b=f.height-i.height-(i.height?t.spacing:0),x=f.width;s.parallelize(b,h?void 0:x);var w=s.extent()>b?l.extent():0;a={x:f.x,y:f.y+f.height-w,width:f.width,height:w},o={x:f.x,y:i.y+i.height+(i.height?t.spacing:0),width:f.width,height:f.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(u.extent(),w?l.spread():0,s.spread())}return o=E({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:E({},e,i),content:E({},e,o),navigation:E({},e,a),orientation:n,preferredSize:d}}function Hh(e){e.state.resolved=function(e){var t=e.scale.domain(),n={items:[]},r=e.settings.layout.dock;if("threshold-color"===e.scale.type){var i=e.scale.data().fields[0],o=function(e){return String(e)};e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(var a=0;a<t.length-1;a++){var s={value:t[a],label:"".concat(o(t[a])," - < ").concat(o(t[a+1]))};i&&(s.source={field:i.id()}),n.items.push(s)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{var l=e.scale.labels?e.scale.labels():null;n.items=t.map((function(t,n){var r=e.scale.datum?E({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):l&&(r.label=l[n]),r}))}var u=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:E(!0,{},Th.title,e.style.title),settings:e.settings.settings.title}),c=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Th.layout,settings:e.settings.settings.layout}),h=e.resolver.resolve({data:n,defaults:E(!0,{},Th.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),d=E(!0,{},(e.settings.settings.item||{}).shape);void 0===d.fill&&e.settings.scale&&(d.fill={scale:e.settings.scale});var f=e.resolver.resolve({data:n,defaults:E(!0,{},Th.item.shape,e.style.item.shape),settings:d}),p=e.resolver.resolve({data:n,defaults:E(!0,{},{show:Th.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function m(e,n){var r=e.data.value,i=t[n+1];e.data.value=[r,i]}return"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(p.items.reverse().forEach(m),p.items.reverse()):p.items.forEach(m)),{title:u,labels:h,symbols:f,items:p,layout:c}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Bh(e){var t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",u=Fh(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(u.content);var c=i.getItemsToRender({viewRect:E({},u.content,{x:0,y:0})});return o.render({rect:u.navigation,itemRenderer:i}),a.render({rect:u.title}),e.state.views={layout:u},c}var Vh={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted:function(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount:function(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart:function(){this.state.interaction.started||this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove:function(e){if(this.state.interaction.started){var t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t}},panend:function(){this.state.interaction.started=!1},scroll:function(e){this.itemRenderer.scroll(-e)},next:function(){this.itemRenderer.next()},prev:function(){this.itemRenderer.prev()}},created:function(){var e=this;this.state={interaction:{}},this.onScroll=function(){var t=Bh(e);e.update(t)},this.itemRenderer=Nh(this,{onScroll:this.onScroll}),this.navigationRenderer=jh(this),this.titleRenderer=zh(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Hh(this)},preferredSize:function(e){return function(e,t){var n=0,r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=Fh(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+o.spacing}(this,e)},beforeUpdate:function(){Hh(this)},render:function(){return Bh(this)},beforeDestroy:function(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements:function(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo:function(){return{offset:this.itemRenderer.offset()}}};function Wh(e,t){var n=0,r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Uh(e,t,n){var r=n[e];return"object"===R(r)?-1!==r.valid.indexOf(t)?t:r.default:n.default}function $h(e){return Uh(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Yh(e,t){var n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function Xh(e){var t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){var n=t.domain(),r=n,i=e.stgns.tick.label;return!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String)),n.map((function(n,i){var o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}))}(e,i),a=function(e){return Uh(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){var s=i.data().fields;n.text=s&&s[0]?s[0].title():""}var l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),u=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:$h(e.settings),textMetrics:l,textBounds:u,requiredWidth:function(){if(!n.show)return 0;var e=u.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:function(){if(!n.show)return 0;var e=u.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max.apply(Math,K(o.map((function(e){return e.textMetrics.width})))),e.stgns.tick.maxLengthPx),requiredHeight:function(){return"top"===a?Math.max.apply(Math,K(c.ticks.values.map((function(e){return e.textMetrics.height}))))+e.stgns.tick.padding:0},height:Math.max.apply(Math,K(o.map((function(e){return e.textMetrics.height}))))},legend:{fillScale:r,majorScale:i,length:function(){var n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}var Kh={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize:function(e){var t=this.state;t.rect=Yh(this,e.inner);var n=this.stgns.size,r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;var i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){var o=t.ticks.values.reduce((function(e,t){return e+t.textMetrics.height}),0);if(o>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max.apply(Math,K(t.ticks.values.map((function(e){return e.textMetrics.height}))))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created:function(){this.stgns=this.settings.settings,this.state=Xh(this)},beforeUpdate:function(e){this.stgns=e.settings.settings,this.state=Xh(this)},beforeRender:function(e){if(this.state.nodes=[],this.state.rect=Yh(this,e.size),this.stgns.title.show){var t=function(e){var t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor,o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");var l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Wh(e,l),l}(this);this.state.nodes.push(t)}var n,r,i,o,a=(r=(n=this).state.legend.fillScale,i=n.state.legend.majorScale,o=r.domain().map((function(e){return{type:"stop",color:r(e),offset:Math.min(1,Math.max(0,i.norm(e)))}})),o.sort((function(e,t){return e.offset-t.offset}))),s=function(e,t){var n=e.state,r=e.stgns,i=n.rect,o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());var u={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Wh(e,u),u}(this,a),l=function(e,t){var n=e.state,r=e.stgns,i="start",o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((function(a){var s=0,l=0,u=0,c="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,c=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,u-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,u=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:u,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:c}}));return{type:"container",id:"legend-seq-ticks",children:[].concat(K(a),[o])}}(this,s),u={id:"legend-seq-target",type:"container",children:[s,l]};this.state.nodes.push(u)},render:function(){return this.state.nodes}};var Gh={step:function(e){return new st(e,.5)},stepAfter:function(e){return new st(e,1)},stepBefore:function(e){return new st(e,0)},linear:je,basis:function(e){return new $e(e)},cardinal:Ke.tension(0),catmullRom:Je,monotonex:function(e){return new nt(e)},monotoney:function(e){return new rt(e)},natural:function(e){return new ot(e)}},Jh={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Zh(e,t){var n=t.generator,r=t.item,i=t.data,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=n(e),s={type:"path",d:a,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:o||r.fill,data:i};return r.strokeDasharray&&(s.strokeDasharray=r.strokeDasharray),s}function Qh(e){var t=function(e){for(var t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain,s=r.width,l=r.height,u=i.resolve({data:t,defaults:Jh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),c=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"===R(n.coordinates.layerId)),h={},d=0,f=0;f<u.items.length;f++){var p=u.items[f],m=p.layerId;if(c){var g=h[m]?h[m].items[h[m].items.length-1]:null,y=g?a.indexOf(g.data.major?g.data.major.value:g.data.value):null;g&&a.indexOf(p.data.major?p.data.major.value:p.data.value)-1!==y&&h[m].items.push({dummy:!0})}h[m]=h[m]||{order:d++,id:m,items:[],dataItems:[],consumableData:{}},h[m].dataItems.push(p.data),h[m].items.push(p)}var v=Object.keys(h).map((function(e){return h[e].consumableData=I({points:h[e].dataItems},h[e].dataItems[0]),h[e]})),b={items:v.map((function(e){return e.consumableData}))},x=n.layers||{};return{coordinates:u,metaLayers:v,layers:i.resolve({data:b,defaults:{curve:Jh.layers.curve,show:Jh.layers.show},settings:{curve:x.curve,show:x.show}}),lines:i.resolve({data:b,defaults:E({},Jh.layers.line,o.line),settings:x.line}),areas:i.resolve({data:b,defaults:E({},Jh.layers.area,o.area),settings:x.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((function(t,n){var l=i.items[n];if(!1!==l.show){l.datum=l.data,l.data=[],l.id=t.id;for(var u,c,h=[],d=[],f=0;f<t.items.length;f++){if(c=(u=t.items[f]).data,!u.dummy){if(isNaN(u.major))continue;e.missingMinor0&&(u.minor0=r.settings.minor.scale?r.settings.minor.scale(c.minor0?c.minor0.value:0):0),isNaN(u.minor)||h.push(u.minor),l.data.push(u.data)}d.push(u)}var p=h.sort((function(e,t){return e-t}))[Math.floor((h.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:p,points:d,consumableData:t.consumableData})}})),s}var ed={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created:function(){},render:function(e){var t=e.data,n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};var o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Qh({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){var s=a.map((function(e){return{id:e.layerObj.id,data:e.layerObj.data}})).sort(this.stngs.layers.sort).map((function(e){return e.id}));a.sort((function(e,t){return s.indexOf(e.layerObj.id)-s.indexOf(t.layerObj.id)}))}else a.sort((function(e,t){return e.median-t.median}));return function(e,t){var n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs,a=[],s=o.layers||{};return e.forEach((function(e){var t,l,u=e.lineObj,c=e.layerObj,h=e.areaObj,d=e.points,f=He(),p=o.coordinates?o.coordinates.defined:null,m={size:r,p:"y"},g={size:n,p:"x"};if("vertical"===o.orientation){var y=E(!0,{},g);g=E(!0,{},m),m=E(!0,{},y)}f[g.p]((function(e){return e.major*g.size}))["".concat(m.p,"1")]((function(e){return e.minor*m.size}))["".concat(m.p,"0")]((function(e){return e.minor0*m.size})).curve(Gh["monotone"===c.curve?"monotone".concat(g.p):c.curve]),p?f.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined})):f.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)}));var v=o.connect?d.filter(f.defined()):d;t=f["line".concat(m.p.toUpperCase(),"1")](),l=f["line".concat(m.p.toUpperCase(),"0")](),s.area&&!1!==h.show&&a.push(Zh(v,{data:e.consumableData,item:h,generator:f})),u&&!1!==u.show&&(a.push(Zh(v,{data:e.consumableData,item:u,generator:t},"none")),!i&&s.area&&!1!==h.show&&!1!==u.showMinor0&&a.push(Zh(v,{data:e.consumableData,item:u,generator:l},"none")))})),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function td(e,t){var n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"===R(t.center)?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);var o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function nd(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function rd(e,t){var n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}var id={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaCancel:function(){this.cancel()}},created:function(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:function(){return 0},render:function(){},start:function(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();var t=td(this,e,!1);Cs({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}}))}(this.settings),this.state.start=td(this,e),this.state.active=!0)},move:function(e){var t;this.state.active&&(this.state.end=td(this,e),function(e){if(e.state.active){var t=nd(e,e.state.start),n=nd(e,e.state.end),r=e.chart.shapesAt(rd(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([E({type:"rect"},rd(t.state.start,t.state.end),t.style.area)]))},end:function(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){Array.isArray(e.contexts)&&e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function od(e,t,n){var r=n.renderer,i=n.style,o=n.props,a=n.h,s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),u=a("div",{dir:o.direction,class:Oh(E({"pic-tooltip":!0},s.tooltip)),style:E({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Oh(E({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Oh(E({"pic-tooltip-arrow":!0},s.arrow)),style:E({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(u),r.element().children[0]}function ad(e){var t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1,a=function(){var e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};return e.set=function(e){t[e].forEach((function(t){return t(e)}))},e.on=function(e,n){Array.isArray(e)?e.forEach((function(e){return t[e].push(n)})):t[e].push(n)},e.destroy=function(){Object.keys(t).forEach((function(e){t[e].length=0}))},e}(),s=function(){},l=function(){r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((function(){e(),o=!0,r=null,a.set("active")}),u),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(u,0)))},s.clear=function(){o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=function(e,t){a.on(e,t)},s.destroy=function(){s.clear(),a.destroy()},s}function sd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function ld(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function ud(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function cd(e,t,n,r,i,o){var a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function hd(e){var t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset,s=n+a.x,l=r+a.y,u=i,c=o,h=s<0?-s:0,d=l<0?-l:0;return{x:h+=s+u>t.width?-(s+u-t.width):0,y:d+=l+c>t.height?-(l+c-t.height):0}}function dd(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y,l=n.targetBounds,u=sd(t.offset),c=u[t.dock];if(c)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c},computedArrowStyle:ud(t.offset)[t.dock],dock:t.dock};for(var h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=ld(r,i,t.offset),f=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s,g=0;g<o.length;g+=1){var y=o[g],v=hd({area:h,vx:p,vy:m,width:r,height:i,offset:d[y]}),b={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u[y]},x=ud(t.offset)[y];0!==v.x&&(b.width="".concat(r-20-Math.abs(v.x),"px"),"top"!==y&&"bottom"!==y||(b.left="".concat(a+v.x,"px"),x.left="calc(50% ".concat(v.x>0?"-":"+"," ").concat(Math.abs(v.x),"px)")));var w={computedTooltipStyle:b,computedArrowStyle:x,dock:y,rect:{width:r,height:i}};if(0===v.x&&0===v.y)return w;w.offset=v,f.push(w)}return f.sort((function(e,t){return Math.abs(e.offset.x)-Math.abs(t.offset.x)})),f[0]}function fd(e,t,n){var r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};var i=r.rect;return E({scaleRatio:i.scaleRatio},i.computedInner)}var pd,md={bounds:function(e){var t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options,s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),u=l.x,c=l.y,h=l.width,d=l.height,f={left:{x:u,y:c+d/2},right:{x:u+h,y:c+d/2},top:{x:u+h/2,y:c},bottom:{x:u+h/2,y:c+d}},p=sd(a.offset),m=p[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:m},computedArrowStyle:ud(a.offset)[a.dock],dock:a.dock};for(var g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=ld(i,o,a.offset),v=["top","left","right","bottom"],b=0;b<v.length;b+=1){var x=v[b];if(cd(g,"target"===a.area?f[x].x:s.left+f[x].x,"target"===a.area?f[x].y:s.top+f[x].y,i,o,y[x]))return{computedTooltipStyle:{left:"".concat(f[x].x,"px"),top:"".concat(f[x].y,"px"),transform:p[x]},computedArrowStyle:ud(a.offset)[x],dock:x}}return{computedTooltipStyle:{left:"".concat(f.top.x,"px"),top:"".concat(f.top.y,"px"),transform:p.top},computedArrowStyle:ud(a.offset).top,dock:"top"}},pointer:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height;return dd({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources,s=o[0],l=n.dx,u=n.dy,c=a.getComponentBoundsFromNode(s),h=l+c.x+c.width/2,d=u+c.y+c.height/2,f=s.desc.slice,p=f.start,m=f.end,g=f.outerRadius,y=(p+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v,x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),dd({x:h+g*c.scaleRatio.x*Math.cos(b),y:d+g*c.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function gd(e,t){var n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props,s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:function(e){return fd(e,o.pointer,i)},getNodeBoundsRelativeToTarget:function(e){return function(e,t,n){var r=fd(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)}},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=R(a.placement);if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);var u={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(u=E(u,a.placement(s))),"object"===l&&md[a.placement.type]?u=E(u,a.placement):"string"===l&&md[a.placement]&&(u=E(u,{type:a.placement})),s.options=u;var c=md[u.type](s),h=s.resources.getComponentBoundsFromNode(s.nodes[0]),d=h.x,f=h.y,p=h.width,m=h.height;return p+=d+=s.pointer.dx,m+=f+=s.pointer.dy,c.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(c.computedTooltipStyle.left)),p),"px"),c.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(c.computedTooltipStyle.top)),m),"px"),c}function yd(){pd=null}var vd={duration:8e3,delay:500,filter:function(e){return e.filter((function(e){return e.data&&void 0!==e.data.value}))},extract:function(e){return e.node.data.value},content:function(e){var t=e.h;return e.data.map((function(e){return t("div",{},e)}))},isEqual:function(e,t){return e.length&&e.length===t.length&&e.every((function(e,n){return t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)}))},placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};function bd(e,t){var n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);var a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,u=o,c=a.left-s.left,h=a.top-s.top,d=i-a.left,f=o-a.top;return{x:i-=s.left,y:o-=s.top,dx:c,dy:h,cx:d,cy:f,clientX:l,clientY:u,targetBounds:s,chartBounds:a}}var xd={require:["chart","renderer"],defaultSettings:{settings:vd,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide:function(){this.hide()},show:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent:function(e){this.prevent(e)}},hide:function(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.nodes,o=r.duration,a=r.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=bd(e,this),t=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((function(){return n.invokeRenderer(n.state.activeNodes)}),o,a)))},prevent:function(e){this.state.prevent=!!e},init:function(e){var t=this;this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=ad({defaultDuration:this.props.duration,defaultDelay:this.props.delay});var n=this.dispatcher.clear;this.dispatcher.on("pending",(function(){!function(e){pd&&pd!==e&&pd()}(n),pd=n,"function"==typeof t.props.beforeShow&&t.props.beforeShow.call(void 0,{resources:{formatter:t.chart.formatter,scale:t.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(function(){var e={resources:{formatter:t.chart.formatter,scale:t.chart.scale}};"function"==typeof t.props.beforeHide&&t.props.beforeHide.call(void 0,E({element:t.state.tooltipElm},e)),"function"==typeof t.props.onHide?t.props.onHide.call(void 0,E({element:t.state.tooltipElm},e)):t.renderer.clear([]),"function"==typeof t.props.afterHide&&t.props.afterHide.call(void 0,e),pd===n&&(pd=null),t.state.tooltipElm=void 0})),this.dispatcher.on("active",(function(){"function"==typeof t.props.afterShow&&t.props.afterShow.call(void 0,{element:t.state.tooltipElm,resources:{formatter:t.chart.formatter,scale:t.chart.scale}})}))},created:function(){this.init(this.settings)},beforeUpdate:function(e){var t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),yd()),this.init(t)},render:function(e){return this.h=e,[]},beforeDestroy:function(){this.dispatcher.destroy(),yd()},appendTo:function(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;var e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted:function(){this.appendTo()},updated:function(){this.appendTo()},invokeRenderer:function(e){var t=function(e,t){var n=t.chart,r=t.scale,i=t.props,o=t.h,a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((function(e){if("function"==typeof i.extract){var t=E({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=gd(od(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=od(t,n,this)}};var wd={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes(this.props.selector).filter((function(t){return t.key===e.props.target})),n=t.filter((function(e){return e.collider})).map((function(e){return e.collider}));n.forEach((function(t){t.fill=e.props.fill,t.stroke=e.props.stroke,t.opacity=e.props.opacity,t.collider={type:null}})),this.renderer.render(n)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}},qd=2*Math.PI;function Md(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}function Dd(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Sd(e,t,n,r,i){var o=1-e;return Math.pow(o,3)*t+3*Math.pow(o,2)*e*n+3*o*Math.pow(e,2)*r+Math.pow(e,3)*i}function kd(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||Md(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;var a=.5,s=Dd(e,t),l=Dd(t,n),u=Dd(n,r),c={x:Sd(a,e.x,t.x,n.x,r.x),y:Sd(a,e.y,t.y,n.y,r.y)},h=Dd(s,l),d=Dd(l,u);return kd(e,s,h,c,i,o-1),kd(c,d,u,r,i,o-1),i}function _d(e,t,n){var r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return kd(e,r.cp1,r.cp2,n)}function Cd(e,t,n){var r,i,o,a,s=[],l=!!e[4],u=!!e[5],c=e[3],h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return s;if(!f||!p)return s.push({x:h,y:d}),s;var m=function(e,t,n,r,i,o,a,s,l){var u,c,h,d,f,p,m=Va(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;e=Math.abs(e),t=Math.abs(t),(p=Math.pow(x,2)/Math.pow(e,2)+Math.pow(w,2)/Math.pow(t,2))>1&&(e*=p=Math.sqrt(p),t*=p);var q=e*t,M=e*w,D=t*x,S=Math.pow(M,2)+Math.pow(D,2),k=Math.pow(q,2)-S,_=Math.sqrt(Math.max(k/S,0));r===i&&(_=-_);var C=_*(M/t),E=_*(-D/e);d=g*C-y*E+(s+o)/2,f=y*C+g*E+(l+a)/2;var A=(x-C)/e,T=(w-E)/t,I=(-x-C)/e,R=(-w-E)/t;return u=Math.atan2(T,A),u+=u<0?qd:0,c=Math.atan2(R,I),h=(c+=c<0?qd:0)-u,!i&&u<c?h-=qd:i&&c<u&&(h+=qd),{startAngle:u,sweepAngle:h%=qd,cx:d,cy:f,rx:e,ry:t}}(f,p,c,l,u,h,d,t,n);r=m.cx,i=m.cy,f=m.rx,p=m.ry,o=m.sweepAngle,a=m.startAngle;for(var g=Math.abs(o*Math.sqrt((Math.pow(f,2)+Math.pow(p,2))/2)),y=Math.ceil(g/10),v=o/y,b=1;b<=y;b++){var x=(a+v*b)%qd,w=Math.cos(x),q=Math.sin(x);s.push({x:r+w*f+-q*w,y:i+q*p+w*q})}return s}function Ed(e){for(var t=x.parsePath(e),n=[],r=[],i=0,o=0,a=null,s=null,l=null,u=null,c=0;c<t.length;++c){var h=t[c],d=h[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,u=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=h[1],o+=h[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=h[1],o=h[2],r.push({x:i,y:o});break;case"H":i=h[1],r.push({x:i,y:o});break;case"h":i+=h[1],r.push({x:i,y:o});break;case"V":o=h[1],r.push({x:i,y:o});break;case"v":o+=h[1],r.push({x:i,y:o});break;case"a":r.push.apply(r,K(Cd(h,i,o))),i+=h[6],o+=h[7];break;case"A":r.push.apply(r,K(Cd(h,i,o))),i=h[6],o=h[7];break;case"c":r.push.apply(r,K(kd({x:i,y:o},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o},{x:h[5]+i,y:h[6]+o}))),a=h[3]+i,s=h[4]+o,i+=h[5],o+=h[6];break;case"C":r.push.apply(r,K(kd({x:i,y:o},{x:h[1],y:h[2]},{x:h[3],y:h[4]},{x:h[5],y:h[6]}))),a=h[3],s=h[4],i=h[5],o=h[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,K(kd({x:i,y:o},{x:2*i-a,y:2*o-s},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o}))),a=h[1]+i,s=h[2]+o,i+=h[3],o+=h[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,K(kd({x:i,y:o},{x:2*i-a,y:2*o-s},{x:h[1],y:h[2]},{x:h[3],y:h[4]}))),a=h[1],s=h[2],i=h[3],o=h[4];break;case"Q":r.push.apply(r,K(_d({x:i,y:o},{x:h[1],y:h[2]},{x:h[3],y:h[4]}))),l=h[1],u=h[2],i=h[3],o=h[4];break;case"q":r.push.apply(r,K(_d({x:i,y:o},{x:h[1]+i,y:h[2]+o},{x:h[3]+i,y:h[4]+o}))),l=h[1]+i,u=h[2]+o,i+=h[3],o+=h[4];break;case"T":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,K(_d({x:i,y:o},{x:l,y:u},{x:h[1],y:h[2]}))),i=h[1],o=h[2];break;case"t":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,K(_d({x:i,y:o},{x:l,y:u},{x:h[1]+i,y:h[2]+o}))),i+=h[1],o+=h[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}var Ad={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes("path").filter((function(t){return t.key===e.props.target})),n=[];t.forEach((function(t){Ed(t.attrs.d).forEach((function(t){t.forEach((function(t){n.push({type:"circle",cx:t.x,cy:t.y,r:e.props.radius,fill:e.props.fill,stroke:e.props.stroke,opacity:e.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(n)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}};var Td=[function(e){e.component("box",Hl),e.component("box-marker",Hl)},function(e){e.component("point",Xl),e.component("point-marker",Xl)},function(e){e.component("pie",Zl)},function(e){e.component("grid-line",ru)},function(e){e.component("ref-line",cu)},function(e){e.component("axis",Iu)},function(e){e.component("container",Ru)},function(e){e.component("text",Pu)},function(e){e.component("scrollbar",zu)},function(e){e.component("brush-range",ec),e.component("brush-area-dir",rc)},function(e){e.component("range",sc)},function(e){e.component("brush-lasso",fc)},function(e){e.component("labels",Ah)},function(e){e.component("legend-cat",Vh)},function(e){e.component("legend-seq",Kh)},function(e){e.component("line",ed)},function(e){e.component("brush-area",id)},function(e){e.component("tooltip",xd)},function(e){e.component("debug-collider",wd)},function(e){e.component("debug-path-to-points",Ad)}],Id=function(){function e(t){N(this,e),this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}return P(e,[{key:"detach",value:function(){return this._parent&&this._parent.removeChild(this),this}},{key:"parent",get:function(){return this._parent}},{key:"isBranch",get:function(){return this._children&&this._children.length}},{key:"children",get:function(){return this._children}},{key:"ancestors",get:function(){var e;this._ancestors||(this._ancestors=[],this.parent&&(e=this._ancestors).push.apply(e,[this.parent].concat(K(this.parent.ancestors))));return this._ancestors}},{key:"descendants",get:function(){var e,t,n=[],r=this.children.length;for(e=0;e<r;e++)t=this.children[e],n.push(t),t.children.length&&(n=[].concat(K(n),K(t.descendants)));return n}},{key:"equals",value:function(e){var t=this.children,n=e.children;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(n[r]))return!1;return!0}},{key:"toJSON",value:function(){return{type:this.type,children:this.children.map((function(e){return e.toJSON()}))}}}]),e}(),Rd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,l=t.height,u=void 0===l?0:l,c=t.minWidth,h=void 0===c?0:c,d=t.minHeight,f=void 0===d?0:d;N(this,e),this.set({x:r,y:o,width:s,height:u,minWidth:h,minHeight:f})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,u=e.minWidth,c=void 0===u?0:u,h=e.minHeight,d=void 0===h?0:h;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,c)):(this.x=n+Math.min(a,-c),this.width=-Math.min(a,-c)),l>=0?(this.y=i,this.height=Math.max(l,d)):(this.y=i+Math.min(l,-d),this.height=-Math.min(l,-d))}},{key:"containsPoint",value:function(e){return Cs(this,e)}},{key:"intersectsLine",value:function(e){return Es(this,oe(e))}},{key:"intersectsRect",value:function(e){return ks(this,ie(e))}},{key:"intersectsCircle",value:function(e){return xs(e,this)}},{key:"intersectsPolygon",value:function(e){return Ss(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Ls(e,this)}},{key:"points",value:function(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}]),e}();var Nd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a,l=t.minRadius,u=void 0===l?0:l;N(this,e),this.set({cx:r,cy:o,r:s,minRadius:u})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}},{key:"containsPoint",value:function(e){return bs(this,e)}},{key:"intersectsLine",value:function(e){return ws(this,oe(e))}},{key:"intersectsRect",value:function(e){return xs(this,ie(e))}},{key:"intersectsCircle",value:function(e){return function(e,t){if(ms(e)||ms(t))return!1;var n=e.cx-t.cx,r=e.cy-t.cy;return Math.pow(n,2)+Math.pow(r,2)<=Math.pow(e.r+t.r,2)}(this,e)}},{key:"intersectsPolygon",value:function(e){return qs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Ns(this,e)}},{key:"points",value:function(){return[{x:this.cx,y:this.cy}]}}]),e}();var Od=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x1,r=void 0===n?0:n,i=t.y1,o=void 0===i?0:i,a=t.x2,s=void 0===a?0:a,l=t.y2,u=void 0===l?0:l,c=t.tolerance,h=void 0===c?0:c;N(this,e),this.set({x1:r,y1:o,x2:s,y2:u,tolerance:h})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,u=e.tolerance,c=void 0===u?0:u;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(c)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}},{key:"containsPoint",value:function(e){return this.tolerance>0?ws({cx:e.x,cy:e.y,r:this.tolerance},this):Ts(this,e)}},{key:"intersectsLine",value:function(e){return As(this,oe(e))}},{key:"intersectsRect",value:function(e){return Es(ie(e),this)}},{key:"intersectsCircle",value:function(e){return ws(e,this)}},{key:"intersectsPolygon",value:function(e){return Ds(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Ps(e,this)}},{key:"points",value:function(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}]),e}();function Pd(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ld(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var jd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[]:n;N(this,e),this.set({vertices:r})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;if(this.type="polygon",this.vertices=n.slice(),this.edges=[],Ld(this.vertices),!(this.vertices.length<=2)){Pd(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.vertices.length;r++)r<this.vertices.length-1&&this.edges.push([this.vertices[r],this.vertices[r+1]]),this.xMin=isNaN(this.xMin)?this.vertices[r].x:Math.min(this.xMin,this.vertices[r].x),this.xMax=isNaN(this.xMax)?this.vertices[r].x:Math.max(this.xMax,this.vertices[r].x),this.yMin=isNaN(this.yMin)?this.vertices[r].y:Math.min(this.yMin,this.vertices[r].y),this.yMax=isNaN(this.yMax)?this.vertices[r].y:Math.max(this.yMax,this.vertices[r].y);this._bounds=null,this._boundingRect=null}}},{key:"containsPoint",value:function(e){return Ms(this,e)}},{key:"intersectsCircle",value:function(e){return qs(e,this)}},{key:"intersectsLine",value:function(e){return Ds(this,oe(e))}},{key:"intersectsRect",value:function(e){return Ss(this,ie(e))}},{key:"intersectsPolygon",value:function(e){return Is(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Rs(e,this)}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function zd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(jd,t)}function Fd(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Hd(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var Bd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[[]]:n;N(this,e),this.set({vertices:r})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;this.type="geopolygon",this.vertices=n.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.numPolygons;r++)Hd(this.vertices[r]),this.vertices[r].length>2&&Fd(this.vertices[r]),this.polygons[r]=zd({vertices:this.vertices[r]}),this.xMin=isNaN(this.xMin)?this.polygons[r].xMin:Math.min(this.xMin,this.polygons[r].xMin),this.xMax=isNaN(this.xMax)?this.polygons[r].xMax:Math.max(this.xMax,this.polygons[r].xMax),this.yMin=isNaN(this.yMin)?this.polygons[r].yMin:Math.min(this.yMin,this.polygons[r].yMin),this.yMax=isNaN(this.yMax)?this.polygons[r].yMax:Math.max(this.yMax,this.polygons[r].yMax);this._bounds=null,this._boundingRect=null}},{key:"containsPoint",value:function(e){return Os(this,e)}},{key:"intersectsCircle",value:function(e){return Ns(e,this)}},{key:"intersectsLine",value:function(e){return Ps(this,oe(e))}},{key:"intersectsRect",value:function(e){return Ls(this,ie(e))}},{key:"intersectsPolygon",value:function(e){return Rs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return n=e,r=(t=this).boundingRect(),i=n.boundingRect(),!!ks(r,i)&&(_s(i,r)?vs(n,t):vs(t,n));var t,n,r,i}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Vd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Bd,t)}function Wd(e,t){return e.x!==t.x||e.y!==t.y}var Ud=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.points,r=void 0===n?[]:n;N(this,e),this.set({points:r})}return P(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.points,n=void 0===t?[]:t;if(this.type="polyline",this.segments=[],this._points=n.slice(),this._points.length>1)for(var r=0,i=this._points.length-1;r<i;r++)Wd(this._points[r],this._points[r+1])&&this.segments.push({x1:this._points[r].x,y1:this._points[r].y,x2:this._points[r+1].x,y2:this._points[r+1].y})}},{key:"containsPoint",value:function(e){return this.segments.some((function(t){return Ts(t,e)}))}},{key:"intersectsCircle",value:function(e){return this.segments.some((function(t){return ws(e,t)}))}},{key:"intersectsLine",value:function(e){var t=oe(e);return this.segments.some((function(e){return As(e,t)}))}},{key:"intersectsRect",value:function(e){var t=ie(e);return this.segments.some((function(e){return Es(t,e)}))}},{key:"intersectsPolygon",value:function(e){return this.segments.some((function(t){return Ds(e,t)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.segments.some((function(t){return Ps(e,t)}))}},{key:"points",value:function(){return this._points}}]),e}();var $d=ft();function Yd(e,t){return $d.get(e)(t)}$d.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Rd,t)})),$d.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Nd,t)})),$d.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Od,t)})),$d.add("polygon",zd),$d.add("geopolygon",Vd),$d.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Ud,t)}));var Xd=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];N(this,e),this.set(t)}return P(e,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((function(t){var n=Yd(t.type,t);n&&e.geometries.push(n)}))}},{key:"containsPoint",value:function(e){return this.geometries.some((function(t){return t.containsPoint(e)}))}},{key:"intersectsLine",value:function(e){return this.geometries.some((function(t){return t.intersectsLine(e)}))}},{key:"intersectsRect",value:function(e){return this.geometries.some((function(t){return t.intersectsRect(e)}))}},{key:"intersectsCircle",value:function(e){return this.geometries.some((function(t){return t.intersectsCircle(e)}))}},{key:"intersectsPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsPolygon(e)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsGeoPolygon(e)}))}}]),e}();var Kd=function(){function e(){N(this,e),this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}return P(e,[{key:"clone",value:function(){return(new e).multiply(this)}},{key:"set",value:function(e){return this._elements=e,this}},{key:"save",value:function(){return this._stack.push(this.elements),this}},{key:"restore",value:function(){return this._stack.length&&(this._elements=this._stack.pop()),this}},{key:"add",value:function(e){var t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}},{key:"translate",value:function(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}},{key:"rotate",value:function(e){var t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}},{key:"multiply",value:function(t){var n,r,i,o;if(t instanceof e&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)for(o=0;o<3;o++)i[n][r]+=this._elements[n][o]*t[o][r];this._elements=i}else for(n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)this._elements[n][r]*=t;return this}},{key:"scale",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}},{key:"transform",value:function(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}},{key:"determinant",value:function(){var e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2];return e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s}},{key:"invert",value:function(){var e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],u=this._elements[2][2];return this._elements=[[o*u-a*l,r*l-n*u,n*a-r*o],[a*s-i*u,t*u-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}},{key:"transpose",value:function(){var e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}},{key:"identity",value:function(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}},{key:"toString",value:function(){return"".concat(this._elements.map((function(e){return e.join("\t")})).join("\n"))}},{key:"isIdentity",value:function(){var e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}},{key:"transformPoint",value:function(e){var t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}},{key:"transformPoints",value:function(e){var t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}},{key:"elements",get:function(){var e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}]),e}(),Gd=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Jd(e,t){var n=t.args[0]*(Math.PI/180);if(t.args.length>2){var r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Zd(e,t){var n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Qd(e,t){var n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function ef(e,t){t.args.length>=6&&e.transform.apply(e,K(t.args))}function tf(e,t){for(var n,r=function(e){for(var t,n=[];null!==(t=Gd.exec(e));){var r=t[2].trim(),i=-1===r.indexOf(",")?r.split(" "):r.split(",");n.push({cmd:t[1],args:i.filter((function(e){return e.trim().length>0})).map((function(e){return Number(e)}))})}return n}(e),i=0,o=r.length;i<o;i++)"rotate"===(n=r[i]).cmd?Jd(t,n):"scale"===n.cmd?Zd(t,n):"matrix"===n.cmd?ef(t,n):"translate"===n.cmd&&Qd(t,n)}var nf={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},rf={type:function(e,t){return t.filter((function(t){var n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}))},attr:function(e,t,n,r){return r.filter((function(r){var i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}))},universal:function(e){return e},tag:function(e,t){return t.filter((function(t){var n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))}};var of={find:function(e,t){var n,r,i=[],o=[];if(t.isBranch){var a;n=function(e){var t,n,r,i,o=[];return e.split(/\s*,\s*/).forEach((function(e){e=e.trim(),t=[];for(var a=function(o){(r=e.match(nf[o]))&&(i=!0,e=e.slice(r[0].length),n={type:o,value:r[0]},"attr"===o&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),n.attribute=r[1],n.operator=r[2],n.attributeValue=r[3]),t.push(n))};e&&(i=!1,(r=e.match(/^\s*([>+~]|\s)\s*/))&&(i=!0,t.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(nf).forEach(a),t&&t.length&&o.indexOf(t)<0&&o.push(t),i););})),o}(e),r=t.descendants;for(var s=function(e,t){a=n[e];var i=[],s=r.slice(),l=!1;a.reverse().forEach((function(e){if(" "===e.type)return i.push(s),s=r.slice(),void(l=!1);s=function(e,t){if(!t||!t.length||!e||"function"!=typeof rf[e.type])return[];switch(e.type){case"type":case"tag":return rf[e.type](e.value,t);case"attr":return rf[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return rf[e.type](t);default:return[]}}(e,s),l=!0})),l&&i.push(s);var u=i[0].filter((function(e){for(var t,n=e.parent,r=1;r<i.length;r++){for(t=i[r].indexOf(n);n&&t<0;)n=n.parent,t=i[r].indexOf(n);if(t<0)return!1}return!0}));o.push(u)},l=0,u=n.length;l<u;l++)s(l);for(var c=0,h=o.length;c<h;c++)for(var d=0,f=o[c].length;d<f;d++)i.indexOf(o[c][d])<0&&i.push(o[c][d])}return i||[]}};function af(e,t,n){var r=e.type,i=e.points();n&&(i=i.every((function(e){return Array.isArray(e)}))?i.map((function(e){return n.transformPoints(e)})):n.transformPoints(i)),function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);var o=null;if("rect"===r||"bounds"===r)(o=ie(i)).type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)(o=oe(i)).type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:Ha(i,"polygon"===r)}}else if("geopolygon"===r){for(var a="",s=0;s<i.length;s++)a+=Ha(i[s],!0);o={type:"path",d:a}}return o}var sf=function(){function e(t){var n=this;N(this,e),this._bounds=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0},r=n.x,i=n.y,o=n.width,a=n.height;return{x:r,y:i,width:o,height:a}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=function(){return function(e,t){if(e.collider){var n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((function(e){return af(e,t,n)}))}:af(e.collider,t,n)}return null}(t,n._dpi)},this._desc=t.desc,this._tag=t.tag,this._children=function(){return t.children.map((function(t){return new e(t)}))},this._parent=function(){return t.parent?new e(t.parent):null},this._cache={elementBoundingRect:null},this._getElementBoundingRect=function(){return!n._cache.elementBoundingRect&&n.element&&(n._cache.elementBoundingRect=n.element.getBoundingClientRect()),n._cache.elementBoundingRect||{left:0,top:0}}}return P(e,[{key:"children",get:function(){return this._children()}},{key:"parent",get:function(){return this._parent()}},{key:"type",get:function(){return this._type}},{key:"data",get:function(){return this._data}},{key:"attrs",get:function(){return this._attrs}},{key:"element",get:function(){return this._element},set:function(e){this._cache.elementBoundingRect=null,this._element=e}},{key:"key",get:function(){return this._key},set:function(e){this._key=e}},{key:"bounds",get:function(){var e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}},{key:"localBounds",get:function(){return this._bounds(!1)}},{key:"boundsRelativeTo",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=R(e),r=t?this.bounds:this.localBounds,i=this._getElementBoundingRect(),o=i.left,a=i.top;if("object"===n&&null!==e&&"function"==typeof e.getBoundingClientRect){var s=e.getBoundingClientRect(),l=s.left,u=void 0===l?0:l,c=s.top,h=void 0===c?0:c;o-=u,a-=h}return r.x+=o,r.y+=a,r}},{key:"collider",get:function(){return this._collider()}},{key:"desc",get:function(){return this._desc}},{key:"tag",get:function(){return this._tag}}]),e}();function lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(sf,t)}var uf=function(){function e(t){N(this,e),this._node=lf(t),this._parent=null,this._input=null}return P(e,[{key:"node",get:function(){return this._node}},{key:"parent",get:function(){return this._parent},set:function(e){this._parent=e}},{key:"input",get:function(){return this._input},set:function(e){this._input=e}}]),e}();function cf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(uf,t)}function hf(e,t){var n=e.parent;if(n&&"stage"!==n.type){t.parent=cf(n);var r=n.parent;r&&"stage"!==r.type&&hf(r,t.parent)}}function df(e,t,n){if(null===e.colliderType)return null;var r=function(e,t){var n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{var r={x:t.cx,y:t.cy},i=e.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((function(e){return Array.isArray(e)}))?Vd(n):zd(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(var r=e.descendants.length-1;r>=0;r--){var i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){var o=cf(i);return hf(i,o),o}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){var r=cf(e);return hf(e,r),r}return null}(e,t,r)}function ff(e,t,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o],s=df(a,t,r);s&&n.push(s),!a.children||s||a.collider||ff(a.children,t,n,r)}}function pf(e,t,n){for(var r=e.length,i=0;i<r;i++){var o=e[i];if(null!==df(o,t,n))return!0;if(o.children&&!o.collider)return pf(o.children,t,n)}return!1}function mf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=ae(e),r={};switch(n){case"circle":return r.cx=e.cx*t,r.cy=e.cy*t,r.r=e.r,["intersectsCircle",r];case"rect":return r=re(e).map((function(e){return Ya(e,t)})),["intersectsRect",r];case"line":return r=ne(e).map((function(e){return Ya(e,t)})),["intersectsLine",r];case"point":return["containsPoint",r=Ya(e,t)];case"polygon":return r.vertices=e.vertices.map((function(e){return Ya(e,t)})),["intersectsPolygon",r];case"geopolygon":return r.vertices=e.vertices.map((function(e){return e.map((function(e){return Ya(e,t)}))})),["intersectsGeoPolygon",r];default:return[]}}function gf(e,t){var n=X(mf(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(ff([e],r,o,i),function(e,t){for(var n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function yf(e,t){var n=X(mf(t,e.dpi),2);return pf([e],n[0],n[1])}var vf=function(e){j(n,e);var t=U(n);function n(e){var r;return N(this,n),(r=t.call(this,e))._stage=null,r._collider={type:null,definition:null,fn:null},r._attrs={},r._node=null,r}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;var t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;Fa(this.attrs,e),void 0!==t&&(this.data=t),"object"===R(n)&&(this.desc=E(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}},{key:"findShapes",value:function(e){return of.find(e,this).map((function(e){return lf(e)}))}},{key:"getItemsFrom",value:function(e){return gf(this,e)}},{key:"containsPoint",value:function(e){return yf(this,e)}},{key:"intersectsLine",value:function(e){return yf(this,e)}},{key:"intersectsRect",value:function(e){return yf(this,e)}},{key:"intersectsCircle",value:function(e){return yf(this,e)}},{key:"intersectsPolygon",value:function(e){return yf(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return yf(this,e)}},{key:"resolveLocalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Kd;void 0!==this.attrs.transform&&tf(this.attrs.transform,e),this.modelViewMatrix=e.clone()}},{key:"resolveGlobalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Kd,t=this.ancestors;if(t.length>0)for(var n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}},{key:"attr",value:function(e){return this.attrs[e]}},{key:"equals",value:function(e){var t=this.attrs,r=Object.keys(t),i=e.attrs,o=Object.keys(i);if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++){var s=r[a];if(!Object.hasOwnProperty.call(i,s))return!1;if(t[s]!==i[s])return!1}return Y(z(n.prototype),"equals",this).call(this,e)}},{key:"toJSON",value:function(){var e=Y(z(n.prototype),"toJSON",this).call(this);return e.attrs=this.attrs,e}},{key:"attrs",get:function(){return this._attrs}},{key:"stage",get:function(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}},{key:"modelViewMatrix",get:function(){return this._mvm},set:function(e){this._mvm=e,this._imvm=null}},{key:"inverseModelViewMatrix",get:function(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}},{key:"node",get:function(){return this._node},set:function(e){this._node=e}},{key:"collider",get:function(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Xd,t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Yd("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Yd(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn},set:function(e){var t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}},{key:"colliderType",get:function(){return this._collider.type}}]),n}(Id),bf=function(e){j(n,e);var t=U(n);function n(){return N(this,n),t.apply(this,arguments)}return P(n,[{key:"addChild",value:function(e){if(!(e&&e instanceof Id))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}},{key:"addChildren",value:function(e){var t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}},{key:"removeChildren",value:function(e){var t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}]),n}(Id),xf=bf.prototype,wf=function(e){j(n,e);var t=U(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Y(z(n.prototype),"set",this).call(this,e);var t=e.collider,r=E({type:null},t);this.collider=r,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"appendChildRect",value:function(e,t){if(void 0!==e.bounds){var n=this.__boundingRect[t]||{},r=X(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,u=o.y,c=isNaN(n.width)?l:Math.max(l,n.width+n.x),h=isNaN(n.height)?u:Math.max(u,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=h-n.y,this.__boundingRect[t]=n}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];for(var t=this.children.length,n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=E({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}},{key:"addChild",value:function(e){var t=xf.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);var n=E({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=n}return t}},{key:"addChildren",value:function(e){var t=xf.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(var r=0;r<n;r++)this.appendChildRect(e[r],!0);var i=E({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=i}return t}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(xf.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var i=E(this.boundingRect(!0),{type:"bounds"});this.collider=i}return this}},{key:"removeChildren",value:function(e){if(xf.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var t=E(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}]),n}(vf);function qf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(wf,t)}var Mf=function(e){j(n,e);var t=U(n);function n(e){var r;return N(this,n),(r=t.call(this,"stage"))._stage=V(r),r._dpiRatio=e||1,r}return P(n,[{key:"dpi",get:function(){return this._dpiRatio}}]),n}(wf);var Df=bf.prototype,Sf=["x1","x2","y1","y2","id","offset","style"],kf=function(e){j(n,e);var t=U(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Y(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=Sf.length;i!==o;i++)void 0!==e[r=Sf[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return Df.addChild.call(this,e)}},{key:"addChildren",value:function(e){return Df.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Df.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return Df.removeChildren.call(this,e),this}}]),n}(vf);function _f(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(kf,t)}var Cf=bf.prototype,Ef=["patternUnits","x","y","width","height","id"],Af=function(e){j(n,e);var t=U(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Y(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=Ef.length;i!==o;i++)void 0!==e[r=Ef[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return Cf.addChild.call(this,e)}},{key:"addChildren",value:function(e){return Cf.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Cf.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return Cf.removeChildren.call(this,e),this}}]),n}(vf);var Tf=function(e){j(n,e);var t=U(n);function n(){var e,r;return N(this,n),(e=r=t.call(this,"rect")).set.apply(e,arguments),r}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.width,s=void 0===a?0:a,l=e.height,u=void 0===l?0:l,c=e.rx,h=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,p=e.collider,m=E({type:"rect",x:r,y:o,width:s,height:u},p);Y(z(n.prototype),"set",this).call(this,e),s>=0?(this.attrs.x=r,this.attrs.width=s):(this.attrs.x=r+s,this.attrs.width=-s),u>=0?(this.attrs.y=o,this.attrs.height=u):(this.attrs.y=o+u,this.attrs.height=-u),h>0&&(this.attrs.rx=h),f>0&&(this.attrs.ry=f),this.collider=m,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=re(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=te(n),i=X(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(vf);var If=function(e){j(n,e);var t=U(n);function n(){var e,r;return N(this,n),(e=r=t.call(this,"circle")).set.apply(e,arguments),r}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,r=void 0===t?0:t,i=e.cy,o=void 0===i?0:i,a=e.r,s=void 0===a?0:a,l=e.collider,u=E({type:"circle",cx:r,cy:o,r:s},l);Y(z(n.prototype),"set",this).call(this,e),this.attrs.cx=r,this.attrs.cy=o,this.attrs.r=s,this.collider=u,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o,l=2*i,u=2*o,c=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+u},{x:a,y:s+u}];if(e&&this.modelViewMatrix){var h=te(c=this.modelViewMatrix.transformPoints(c)),d=X(h,4),f=d[0],p=d[1],m=d[2],g=d[3];l=m-f,u=g-p,this.__bounds[e]=[{x:f,y:p},{x:f+l,y:p},{x:f+l,y:p+u},{x:f,y:p+u}]}else this.__bounds[e]=c;return this.__bounds[e]}}]),n}(vf);var Rf=function(e){j(n,e);var t=U(n);function n(){var e,r;return N(this,n),(e=r=t.call(this,"line")).set.apply(e,arguments),r}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,r=void 0===t?0:t,i=e.y1,o=void 0===i?0:i,a=e.x2,s=void 0===a?0:a,l=e.y2,u=void 0===l?0:l,c=e.collider;Y(z(n.prototype),"set",this).call(this,e),this.attrs.x1=r,this.attrs.y1=o,this.attrs.x2=s,this.attrs.y2=u;var h={type:"line",x1:r,y1:o,x2:s,y2:u};this.collider=E(h,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=ne(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));var n=te(t),r=X(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=i!==a||o!==s;return this.__boundingRect[e]={x:i,y:o,width:l?Math.max(1,a-i):0,height:l?Math.max(1,s-o):0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(vf);var Nf=Math.PI/2;function Of(e,t){var n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Pf(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Lf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=[];if("h"===n.forceOrientation){var o=e[0].x<e[1].x?-1:1,a=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+o,y:e[0].y}),e.push({x:e[e.length-1].x+a,y:e[e.length-1].y})}else if("v"===n.forceOrientation){var s=e[0].y<e[1].y?-1:1,l=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+s}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+l})}for(var u=e.length-1,c=1;c<u;c++){var h=e[c-1],d=e[c],f=e[c+1],p=Of(d,h),m=Of(d,f),g=(p+m)/2,y=g+Math.PI,v=Math.max(g,y),b=Math.min(g,y),x=p>m;if(1===c){var w=Of(h,d);r.push(Pf(h,w-Nf,t)),i.unshift(Pf(h,w+Nf,t))}var q=x?v:b,M=x?b:v;if(r.push(Pf(d,q,t)),i.unshift(Pf(d,M,t)),c===u-1){var D=Of(f,d);r.push(Pf(f,D+Nf,t)),i.unshift(Pf(f,D-Nf,t))}}return{type:"polygon",vertices:[].concat(r,i)}}function jf(e){for(var t,n=[],r=e.length,i=0;i<r;i++){t=e[i];for(var o=0;o<t.length;o++)n.push(t[o])}return n}function zf(e){if(e.length<2)return!1;var t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}var Ff=function(e){j(n,e);var t=U(n);function n(){var e,r;return N(this,n),(e=r=t.call(this,"path")).set.apply(e,arguments),r}return P(n,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Y(z(n.prototype),"set",this).call(this,t),this.segments=[],this.points=[],t.arcDatum){var r=Pe();r.innerRadius(t.desc.slice.innerRadius),r.outerRadius(t.desc.slice.outerRadius),r.cornerRadius(t.desc.slice.cornerRadius);var i=r(t.arcDatum);this.attrs.d=i}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"===R(t.collider)&&void 0!==t.collider.type)this.collider=t.collider;else if(t.arcDatum||t.d){if(this.segments=Ed(this.attrs.d),this.segments.length>1&&this.segments.every((function(e){return zf(e)})))return void(this.collider=E({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((function(n){if(n.length<=1);else if(zf(n))e.collider=E({type:"polygon",vertices:n},t.collider);else if("object"===R(t.collider)&&t.collider.visual){var r=e.attrs["stroke-width"]/2;e.collider=Lf(n,r,t.collider)}else e.collider=E({type:"polyline",points:n},t.collider)}))}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Ed(this.attrs.d),this.points=jf(this.segments));var t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,n=te(t),r=X(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[e]={x:i||0,y:o||0,width:a-i||0,height:s-o||0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(vf);function Hf(e){var t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}var Bf=function(e){j(n,e);var t=U(n);function n(){var e,r;return N(this,n),(e=r=t.call(this,"text")).set.apply(e,arguments),r}return P(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.dx,s=void 0===a?0:a,l=e.dy,u=void 0===l?0:l,c=e.textBoundsFn,h=e.text,d=e.title,f=e.collider,p=e.boundingRect,m=e.ellipsed;Y(z(n.prototype),"set",this).call(this,e),this.attrs.x=r,this.attrs.y=o,this.attrs.dx=s,this.attrs.dy=u,this.attrs.text=h,void 0!==d&&(this.attrs.title=String(d)),"object"===R(p)?this._textBoundsFn=function(){return p}:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof m&&(this.ellipsed=m),this.collider=E({type:Hf(this)?"bounds":null},f),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};var t=re(this._textBoundsFn(this.attrs)),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=te(n),i=X(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(vf);var Vf=ft();function Wf(e,t){return Vf.get(e)(t)}Vf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Tf,t)})),Vf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(If,t)})),Vf.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Bf,t)})),Vf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Rf,t)})),Vf.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Ff,t)})),Vf.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Mf,t)})),Vf.add("container",qf),Vf.add("defs",qf),Vf.add("linearGradient",_f),Vf.add("radialGradient",_f),Vf.add("stop",_f),Vf.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return B(Af,t)}));var Uf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[{}];function n(){return t[t.length-1]}return n.save=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n(),o={},a="",s=0;s<e.length;s++)void 0!==i[a=e[s]]&&(o[a]=i[a]);return E(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function $f(e,t){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)t[n](e)}function Yf(e,t,n){e.node=n[t],e.index=t}function Xf(e,t,n,r){for(var i={siblings:e,node:null,index:0},o=0,a=e.length;o<a;o++)if(Yf(i,o,e),$f(i,r.create),!("function"==typeof i.node.disabled?i.node.disabled():i.node.disabled)){i.node=Uf.save(i.node);var s=Wf(i.node.type,i.node);s&&(i.node.transform&&(n.save(),tf(i.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),i.node.children&&Xf(i.node.children,s,n,r),i.node.transform&&n.restore()),Uf.restore()}}function Kf(e){var t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=Wf("stage",r)),Xf(t,n,new Kd,o),n}function Gf(e,t,n){var r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o,s=null;if("radial"===r){var l=t.boundingRect();s=e.createRadialGradient(l.x+l.width/2,l.y+l.height/2,1e-5,l.x+l.width/2,l.y+l.height/2,Math.max(l.width,l.height)/2)}else{var u=Wa(i);["x1","x2","y1","y2"].forEach((function(e){e in n&&(u[e]=n[e])}));var c=t.boundingRect();s=e.createLinearGradient(c.x+u.x1*c.width,c.y+u.y1*c.height,c.x+u.x2*c.width,c.y+u.y2*c.height)}for(var h=0,d=a.length;h<d;h++){var f=a[h];s.addColorStop(f.offset,f.color)}return s}function Jf(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((function(e){if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Zf(e){var t=e.createElement("canvas"),n=t.getContext("2d"),r={};return{create:function(e){var i=e.key;return i?(r[i]=r[i]||Jf(e,t,n),r[i]):Jf(e,t,n)},clear:function(){r={}}}}function Qf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed,l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"===R(s)&&["left","right","top","bottom"].forEach((function(e){!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)})),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function ep(){var e={element:function(){},root:function(){},settings:function(){},appendTo:function(){},getScene:function(){return[]},render:function(){return!1},itemsAt:function(){return[]},findShapes:function(){return[]},clear:function(){},destory:function(){},size:function(){},measureText:wh,textBounds:Mh,setKey:function(t){e.element().setAttribute("data-key",t)}};return e}function tp(e){return function(t){var n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}var np=200,rp=200,ip=function(){function e(t){N(this,e),this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}return P(e,[{key:"updateSize",value:function(e){var t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*np,height:n.computedPhysical.height+2*rp},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}},{key:"apply",value:function(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}},{key:"clear",value:function(){this.bufferCanvas.width=this.bufferCanvas.width}},{key:"getContext",value:function(){return this.bufferCanvas.getContext("2d")}}]),e}(),op=ft();function ap(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function sp(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function lp(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function up(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.keys(r),o=0,a=n.length;o<a;o++){var s=n[o],l=s[0],u=s[1],c=s[2];if(l in t.attrs&&!(u in r)&&e[u]!==t.attrs[l]){var h=c?c(t.attrs[l]):t.attrs[l];"function"==typeof e[u]?e[u](h):e[u]=h}}for(var d=0,f=i.length;d<f;d++){var p=i[d];e[p]=r[p]}}function cp(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s={};t.save(),a.attrs&&(a.attrs.fill||a.attrs.stroke)&&(a.attrs.fill&&"object"===R(a.attrs.fill)&&"gradient"===a.attrs.fill.type?s.fillStyle=Gf(t,a,a.attrs.fill):a.attrs.fill&&"object"===R(a.attrs.fill)&&"pattern"===a.attrs.fill.type&&(s.fillStyle=r.patterns.create(a.attrs.fill)),a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"gradient"===a.attrs.stroke.type?s.strokeStyle=Gf(t,a,a.attrs.stroke):a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"pattern"===a.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(a.attrs.stroke))),up(t,a,n,s),a.modelViewMatrix&&lp(a.modelViewMatrix.elements,t),op.has(a.type)&&op.get(a.type)(a.attrs,{g:t,doFill:"fill"in a.attrs&&"none"!==a.attrs.fill,doStroke:"stroke"in a.attrs&&0!==a.attrs["stroke-width"],ellipsed:a.ellipsed}),a.children&&cp(a.children,t,n,r),t.restore()}}function hp(e){var t=e.el,n=e.dpiRatio,r=e.transform;if("object"===R(r)){var i=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n],o=t.getContext("2d");o.setTransform.apply(o,i)}}function dp(){var e,t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kf,o={transform:void 0,canvasBufferSize:void 0,progressive:void 0},a=!1,s=Qf(),l=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",ap]],u=ep();return u.element=function(){return e},u.root=function(){return e},u.settings=function(e){return e&&Object.keys(o).forEach((function(t){void 0!==e[t]&&(o[t]=e[t])})),o},u.appendTo=function(n){return e||((e=n.ownerDocument.createElement("canvas")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof o.transform||t||(t=new ip(e)),n.appendChild(e),e},u.getScene=function(n){var r=sp(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:n,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),i({items:[l],dpi:r,on:{create:[dh(u.measureText),tp(u)]}})},u.render=function(i){if(!e)return!1;r||(r=Zf(e.ownerDocument));var c=t&&t.getContext()||e.getContext("2d"),h=sp(c),d=t&&o.transform();if(d)return e.width=e.width,hp({el:e,dpiRatio:h,transform:d}),t.apply(),!0;a&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:o.canvasBufferSize}));var f=u.getScene(i),p=!n||!f.equals(n);r.clear();var m,g=a||p,y="function"==typeof o.progressive&&o.progressive();(g&&(y&&!y.isFirst||u.clear(),cp(f.children,c,l,{patterns:r})),t&&(e.width=e.width,t.apply()),a=!1,y&&!y.isFirst)&&(m=f.children).unshift.apply(m,K(n.children));return n=f,g},u.itemsAt=function(e){return n?n.getItemsFrom(e):[]},u.findShapes=function(e){return n?n.findShapes(e):[]},u.clear=function(){return e&&(e.width=e.width),t&&t.clear(),n=null,u},u.size=function(e){if(e){var t=Qf(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},u.destroy=function(){e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),n=null},u}function fp(e,t){op.add(e,t)}function pp(e,t){return Math.max(0,Math.min(e,t))}var mp=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),gp=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),yp=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function vp(e){return mp.test(e)}function bp(e){return gp.test(e)||yp.test(e)}function xp(e){var t,n,r=e?e.length:0;for(t=0;t<r;t++){if(vp(n=e[t]))return"ltr";if(bp(n))return"rtl"}return"ltr"}var wp={start:"end",end:"start",center:"center",middle:"middle"};function qp(e,t){return"rtl"===t?wp[e]:e}function Mp(e,t){var n,r,i,o=[],a=[],s=[],l=[],u=function(e){return e.id},c=function(e,t){var n;return n="object"===R(e)?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(c)),t=t.map(c),r=e.map(u),i=t.map(u);for(var h=0,d=t.length;h<d;h++){-1===r.indexOf(t[h].id)?o.push(t[h]):s.push(t[h])}for(var f=0,p=e.length;f<p;f++){-1===i.indexOf(e[f].id)?a.push(e[f]):l.push(e[f])}for(var m=0,g=o.length;m<g;m++)o[m].content.children&&(o[m].diff=Mp([],o[m].content.children),o[m].children=o[m].diff.updatedNew.concat(o[m].diff.added),o[m].children.isTree=!0);for(var y=0,v=s.length;y<v;y++)s[y].diff=Mp(l[y].children||[],s[y].content.children||[]),s[y].object=l[y].object,s[y].children=s[y].diff.items;return n=s.concat(o),o.isTree=!0,a.isTree=!0,s.isTree=!0,l.isTree=!0,n.isTree=!0,{added:o,updatedNew:s,updatedOld:l,removed:a,items:n}}function Dp(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function Sp(e,t){for(var n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function kp(e,t,n,r){for(var i,o=0,a=e.length;o<a;o++)null!==(i=e[o]).object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(Dp(i.diff.added,i.object,t),Sp(i.diff.removed,r),kp(i.diff.items,t,n,r)))}function _p(e,t,n,r,i,o){var a=Mp(e,t);return Dp(a.added,n,r),Sp(a.removed,o),kp(a.items,r,i,o),a.items}fp("rect",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=pp(r/2,o>0?o:a),a=pp(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),fp("circle",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),fp("line",(function(e,t){var n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),fp("path",(function(e,t){var n=t.g,r=t.doStroke,i=t.doFill,o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),fp("text",(function(e,t){var n=t.g,r=t.ellipsed,i=t.doStroke,o=r||fh(e,wh);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);var a=xp(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);var s=qp("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);var l=ph(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));var Cp="http://www.w3.org/2000/svg",Ep=function(e,t){if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));var n=t.ownerDocument.createElementNS(Cp,"container"===e?"g":e);return t.appendChild(n),n},Ap=function(e){e.parentNode&&e.parentNode.removeChild(e)},Tp=function(e,t){if(function(e){switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}}(t)){for(var n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||fh(t.attrs,wh);var r=xp(t.attrs.text);"rtl"===r&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",qp(e.getAttribute("text-anchor"),r)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){var i=e.ownerDocument.createElementNS(Cp,"title");i.textContent=t.attrs.title,e.appendChild(i)}else e.setAttribute(n,t.attrs[n]);else{var o=+e.getAttribute(n)||0,a=0;a="dominant-baseline"===n?ph(t.attrs):t.attrs[n],e.setAttribute("dy",a+o)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"===R(t.data)&&null!==t.data)for(var s in t.data)"string"!=typeof t.data[s]&&"number"!=typeof t.data[s]&&"boolean"!=typeof t.data[s]||e.setAttribute("data-".concat(s),t.data[s])}},Ip=function(){function e(t,n,r,i){N(this,e),this.create=t,this.nodeCreator=n,this.nodeMaintainer=r,this.nodeDestroyer=i}return P(e,[{key:"render",value:function(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}]),e}();function Rp(){return new Ip(_p,Ep,Tp,Ap)}function Np(e){var t,n,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,n=e.length;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r&=r;return r}function Op(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Np,n={},r=Date.now(),i={getOrCreateGradient:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){var u=i[o],c=u.orientation,h=u.degree,d=u.stops,f=void 0===d?[]:d,p={};void 0===h&&(h=90),"radial"===c?p.type="radialGradient":(p=Wa(h),["x1","x2","y1","y2"].forEach((function(e){e in i[o]&&(p[e]=i[o][e])})),p.type="linearGradient"),p.id=l,p.children=f.map((function(e){var t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(p),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate:function(e){var t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);var n=e.node;n.fill&&"object"===R(n.fill)&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"===R(n.stroke)&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear:function(){n={}}};return i}function Pp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Np,n={},r=Date.now(),i={onCreate:function(i){var o={};i.node&&"object"===R(i.node.fill)&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"===R(i.node.stroke)&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((function(a){var s="",l=o[a],u=t(l),c="picasso-pattern-".concat(r,"-").concat(u);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[u]){var h={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:c,children:[],fill:l.fill};l.shapes.forEach((function(e){h.children.push(e)})),e.push(h),n[u]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(c,"')")}))},clear:function(){n={}}};return i}function Lp(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rp,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cp,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Kf,a=r(),s=!1,l=Qf(),u={transform:void 0},c=ep(),h={type:"defs",children:[]},d=Pp(h.children),f=Op(h.children);return c.element=function(){return e},c.root=function(){return t},c.settings=function(e){return e&&Object.keys(u).forEach((function(t){void 0!==e[t]&&(u[t]=e[t])})),u},c.appendTo=function(n){return e||((e=n.ownerDocument.createElementNS(i,"svg")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none",e.setAttribute("xmlns",i),(t=n.ownerDocument.createElementNS(i,"g")).style.pointerEvents="auto",e.appendChild(t)),n.appendChild(e),e},c.getScene=function(e){var t=l.scaleRatio.x,n=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[].concat(K(e),[h]):e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*n,")"):""};return 1===t&&1===n||(r.transform+="scale(".concat(t,", ").concat(n,")")),o({items:[r],on:{create:[function(e){e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,dh(c.measureText),tp(c)]}})},c.render=function(r){if(!e)return!1;var i="function"==typeof u.transform&&u.transform();if(i){var o=i.a,p=i.b,m=i.c,g=i.d,y=i.e,v=i.f;return t.style.transform="matrix(".concat(o,", ").concat(p,", ").concat(m,", ").concat(g,", ").concat(y,", ").concat(v,")"),!0}t.style.transform="",s&&(e.style.left="".concat(l.computedPhysical.x,"px"),e.style.top="".concat(l.computedPhysical.y,"px"),e.setAttribute("width",l.computedPhysical.width),e.setAttribute("height",l.computedPhysical.height)),f.clear(),d.clear(),h.children.length=0;var b=c.getScene(r),x=!n||!b.equals(n),w=s||x;return w&&(c.clear(),a.render(b.children,t)),s=!1,n=b,w},c.itemsAt=function(e){return n?n.getItemsFrom(e):[]},c.findShapes=function(e){return n?n.findShapes(e):[]},c.clear=function(){if(!t)return c;n=null;var r=t.cloneNode(!1);return e.replaceChild(r,t),t=r,c},c.destroy=function(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,t=null},c.size=function(e){if(e){var t=Qf(e);JSON.stringify(l)!==JSON.stringify(t)&&(s=!0,l=t)}return l},c}var jp,zp,Fp,Hp,Bp,Vp={},Wp=[],Up=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function $p(e,t){for(var n in t)e[n]=t[n];return e}function Yp(e){var t=e.parentNode;t&&t.removeChild(e)}function Xp(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?jp.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Kp(e,a,r,i,null)}function Kp(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Fp:i};return null==i&&null!=zp.vnode&&zp.vnode(o),o}function Gp(e){return e.children}function Jp(e,t){this.props=e,this.context=t}function Zp(e,t){if(null==t)return e.__?Zp(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Zp(e):null}function Qp(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Qp(e)}}function em(e){(!e.__d&&(e.__d=!0)&&Hp.push(e)&&!tm.__r++||Bp!==zp.debounceRendering)&&((Bp=zp.debounceRendering)||setTimeout)(tm)}function tm(){for(var e;tm.__r=Hp.length;)e=Hp.sort((function(e,t){return e.__v.__b-t.__v.__b})),Hp=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=$p({},i)).__v=i.__v+1,um(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Zp(i):o,i.__h),cm(n,i),i.__e!=o&&Qp(i)))}))}function nm(e,t,n,r,i,o,a,s,l,u){var c,h,d,f,p,m,g,y=r&&r.__k||Wp,v=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(f=n.__k[c]=null==(f=t[c])||"boolean"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Kp(null,f,null,null,f):Array.isArray(f)?Kp(Gp,{children:f},null,null,null):f.__b>0?Kp(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[c])||d&&f.key==d.key&&f.type===d.type)y[c]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}um(e,f,d=d||Vp,i,o,a,s,l,u),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=rm(f,l,e):l=im(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Zp(d))}for(n.__e=m,c=v;c--;)null!=y[c]&&fm(y[c],y[c]);if(g)for(c=0;c<g.length;c++)dm(g[c],g[++c],g[++c])}function rm(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?rm(r,t,n):im(n,r,r,i,r.__e,t));return t}function im(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function om(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Up.test(t)?n:n+"px"}function am(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||om(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||om(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?lm:sm,o):e.removeEventListener(t,o?lm:sm,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function sm(e){this.l[e.type+!1](zp.event?zp.event(e):e)}function lm(e){this.l[e.type+!0](zp.event?zp.event(e):e)}function um(e,t,n,r,i,o,a,s,l){var u,c,h,d,f,p,m,g,y,v,b,x,w,q,M,D=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(u=zp.__b)&&u(t);try{e:if("function"==typeof D){if(g=t.props,y=(u=D.contextType)&&r[u.__c],v=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in D&&D.prototype.render?t.__c=c=new D(g,v):(t.__c=c=new Jp(g,v),c.constructor=D,c.render=pm),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=v,c.__n=r,h=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=D.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=$p({},c.__s)),$p(c.__s,D.getDerivedStateFromProps(g,c.__s))),d=c.props,f=c.state,h)null==D.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==D.getDerivedStateFromProps&&g!==d&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,v),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,v)||t.__v===n.__v){for(c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<c._sb.length;b++)c.__h.push(c._sb[b]);c._sb=[],c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,v),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(d,f,p)}))}if(c.context=v,c.props=g,c.__v=t,c.__P=e,x=zp.__r,w=0,"prototype"in D&&D.prototype.render){for(c.state=c.__s,c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),q=0;q<c._sb.length;q++)c.__h.push(c._sb[q]);c._sb=[]}else do{c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=$p($p({},r),c.getChildContext())),h||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(d,f)),M=null!=u&&u.type===Gp&&null==u.key?u.props.children:u,nm(e,Array.isArray(M)?M:[M],t,n,r,i,o,a,s,l),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=hm(n.__e,t,n,r,i,o,a,l);(u=zp.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),zp.__e(e,t,n)}}function cm(e,t){zp.__c&&zp.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){zp.__e(e,t.__v)}}))}function hm(e,t,n,r,i,o,a,s){var l,u,c,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&e.data===d||(e.data=d);else{if(o=o&&jp.call(e.childNodes),u=(h=n.props||Vp).dangerouslySetInnerHTML,c=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||am(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||am(e,o,t[o],n[o],r)}(e,d,h,i,s),c)t.__k=[];else if(p=t.props.children,nm(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&Zp(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&Yp(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&am(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&am(e,"checked",p,h.checked,!1))}return e}function dm(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){zp.__e(e,n)}}function fm(e,t,n){var r,i;if(zp.unmount&&zp.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||dm(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){zp.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&fm(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Yp(e.__e),e.__=e.__e=e.__d=void 0}function pm(e,t,n){return this.constructor(e,n)}function mm(e,t,n){var r,i,o;zp.__&&zp.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],um(t,e=(!r&&n||t).__k=Xp(Gp,null,[e]),i||Vp,Vp,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?jp.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),cm(o,e)}function gm(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.createElement,i=void 0===r?document.createElement.bind(document):r,o=Qf(),a={transform:void 0},s=ep();return s.element=function(){return e},s.root=function(){return e},s.settings=function(e){return e&&Object.keys(a).forEach((function(t){void 0!==e[t]&&(a[t]=e[t])})),a},s.appendTo=function(t){return e||((e=i("div")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),t.appendChild(e),e},s.render=function(n){if(!e)return!1;var r,i="function"==typeof a.transform&&a.transform();if(i){var s=i.a,l=i.b,u=i.c,c=i.d,h=i.e,d=i.f;return e.style.transform="matrix(".concat(s,", ").concat(l,", ").concat(u,", ").concat(c,", ").concat(h,", ").concat(d,")"),!0}return e.style.transform="",e.style.left="".concat(o.computedPhysical.x,"px"),e.style.top="".concat(o.computedPhysical.y,"px"),e.style.width="".concat(o.computedPhysical.width,"px"),e.style.height="".concat(o.computedPhysical.height,"px"),r=Array.isArray(n)?Xp("div",null,n):n,t=mm(r,e,t),!0},s.renderArgs=[Xp],s.clear=function(){if(e){for(var n=e.firstChild;n;)e.removeChild(n),n=e.firstChild;t=null}return s},s.destroy=function(){e&&e.parentElement&&e.parentElement.removeChild(e),e=null,t=null},s.size=function(e){return e&&(o=Qf(e)),o},s}jp=Wp.slice,zp={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Fp=0,Jp.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$p({},this.state),"function"==typeof e&&(e=e($p({},n),this.props)),e&&$p(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),em(this))},Jp.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),em(this))},Jp.prototype.render=Gp,Hp=[],tm.__r=0;var ym=[function(e){e.renderer("svg",Lp)},function(e){e.renderer("canvas",dp)},function(e){e.renderer("dom",gm)}],vm={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},bm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.level,r=void 0===n?vm.OFF:n,i=t.pipe,o=void 0===i?console:i,a=r,s=(L(e={},vm.OFF,(function(){})),L(e,vm.ERROR,(function(){return o.error.apply(o,arguments)})),L(e,vm.WARN,(function(){return o.warn.apply(o,arguments)})),L(e,vm.INFO,(function(){return o.info.apply(o,arguments)})),L(e,vm.DEBUG,(function(){return o.log.apply(o,arguments)})),e),l=function(e){if(e&&!(a<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(s[e]||s[vm.DEBUG]).apply(void 0,n)}};return{log:l,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[vm.ERROR].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[vm.WARN].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[vm.INFO].concat(t))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[vm.DEBUG].concat(t))},level:function(e){return"number"==typeof e&&(a=e),a},LOG_LEVEL:vm}};function xm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}var wm=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=bm(t.logger),i={component:ft(n.component,"component",r),data:ft(n.data,"data",r),formatter:ft(n.formatter,"formatter",r),interaction:ft(n.interaction,"interaction",r),renderer:ml(n.renderer),scale:ft(n.scale,"scale",r),symbol:ft(n.symbol,"symbol",r),logger:r};function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={palettes:t.palettes.concat(n.palettes||[]),style:E({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(r,i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xm(e,t,i)},o.chart=function(e){return pl(e,{registries:i,logger:r,style:t.style,palettes:t.palettes})},o.config=function(){return t},Object.keys(i).forEach((function(e){o[e]=i[e]})),o.version=A,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:gl,data:Tl,formatter:kr,interaction:Il,renderer:ml(),scale:Bo,symbol:ns});function qm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qm(Object(n),!0).forEach((function(t){Cm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dm(e){return Dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dm(e)}function Sm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _m(e,t,n){return t&&km(e.prototype,t),n&&km(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Em(e,t){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Em(e,t)}function Am(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Tm(e,t,n){return Tm=Am()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Em(i,n.prototype),i},Tm.apply(null,arguments)}function Im(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Nm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rm(e){return function(e){if(Array.isArray(e))return Om(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Nm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(e,t){if(e){if("string"==typeof e)return Om(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Om(e,t):void 0}}function Om(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Td.forEach(wm.use),ym.forEach(wm.use),[].forEach(wm.use);var Pm=Object.prototype.hasOwnProperty,Lm=Object.prototype.toString,jm=Object.defineProperty,zm=Object.getOwnPropertyDescriptor,Fm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Lm.call(e)},Hm=function(e){if(!e||"[object Object]"!==Lm.call(e))return!1;var t,n=Pm.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Pm.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Pm.call(e,t)},Bm=function(e,t){jm&&"__proto__"===t.name?jm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Vm=function(e,t){if("__proto__"===t){if(!Pm.call(e,t))return;if(zm)return zm(e,t).value}return e[t]},Wm=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Vm(s,n),s!==(i=Vm(t,n))&&(c&&i&&(Hm(i)||(o=Fm(i)))?(o?(o=!1,a=r&&Fm(r)?r:[]):a=r&&Hm(r)?r:{},Bm(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Bm(s,{name:n,newValue:i}));return s};function Um(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function $m(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Ym(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,h=r;if(i.field&&i.field!==n){var d=Um(i.field,o,{cache:t});if(-1===d)return;h=Wm({qRow:a},d(s))}u[c]=$m(i,h,{key:l})}function Xm(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===Dm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),h=c.props,d=c.main,f=Object.keys(h),p=!!i[a].trackBy,m=Dm(i[a].trackBy),g={},y=[],v=[],b=0;b<s.qDataPages.length;b++){var x=Um(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var q=s.qDataPages[b].qArea.qTop+w,M=Wm({qRow:q},x(s.qDataPages[b].qMatrix[w])),D=$m(d,M,{key:l});if(!(d.filter&&!d.filter(M))){for(var S=0;S<f.length;S++){var k=h[f[S]],_=k.fields||[k];k.fields&&(D[f[S]]=[]);for(var C=0;C<_.length;C++)Ym({cache:n,f:u,mainCell:M,p:_[C],prop:f[S],props:h,page:s.qDataPages[b],rowIdx:q,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:k.fields?D[f[S]]:D,targetProp:k.fields?C:f[S]});if(k.fields){var E=D[f[S]].map((function(e){return e.value})),A=D[f[S]].map((function(e){return e.label}));D[f[S]]={value:"function"==typeof k.value?k.value(E):void 0!==k.value?k.value:E,label:"function"==typeof k.label?k.label(A):void 0!==k.label?String(k.label):String(D[f[S]].value)}}}p&&r.track({cfg:i[a],itemData:M,obj:D,target:y,tracker:g,trackType:m}),v.push(D)}}}var T=p?r.collect(y,{main:d,propsArr:f,props:h}):v;o=[].concat(Rm(o),Rm(T))}return o}function Km(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Gm(e,t){var n,r,i,o,a,s=new eg(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Jm);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new eg(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Qm)}function Jm(e){return e.children}function Zm(e){e.data=e.data.data}function Qm(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function eg(e){this.data=e,this.depth=this.height=0,this.parent=null}function tg(e){if("function"!=typeof e)throw new Error;return e}eg.prototype=Gm.prototype={constructor:eg,count:function(){return this.eachAfter(Km)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Gm(this).eachBefore(Zm)}};var ng={depth:-1},rg={};function ig(e){return e.id}function og(e){return e.parentId}function ag(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=ag(n,i[s]);Array.isArray(l)?a.push.apply(a,Rm(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=ag(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function sg(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r=[].concat(Rm(r),Rm(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&(r=[].concat(Rm(r),Rm(sg(e[o].children,t-1,n))));return r}function lg(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return sg(e.children,i-1,n)}}return!1}function ug(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var cg=/^qDimensionInfo(?:\/(\d+))?/,hg=/^\/?qMeasureInfo\/(\d+)/,dg=/\/qAttrExprInfo\/(\d+)/,fg=/\/qAttrDimInfo\/(\d+)/;function pg(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function mg(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,h=n.qEffectiveInterColumnSortOrder,d=pg(n);return cg.test(c)&&(i=!0,o=+cg.exec(c)[1],c=r.replace(cg,"")),hg.test(c)&&("K"===n.qMode?l=+hg.exec(c)[1]:h&&-1!==h.indexOf(-1)?(l=+hg.exec(c)[1],u=0):u=+hg.exec(c)[1],c=c.replace(hg,"")),c&&(fg.exec(c)?s=+fg.exec(c)[1]:dg.exec(c)&&(a=+dg.exec(c)[1])),{fieldDepth:(i?"S"===n.qMode?d[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function gg(e,t){var n,r,i=lg(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(e){var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function yg(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function vg(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,h=void 0;l.fields&&(c=[],h=[]);for(var d=function(e){var n=u[e],d=void 0,f=void 0,p=void 0,m=void 0,g=void 0,y=void 0;if("primitive"===n.type?(p=n.value,y=String(n.value)):("function"==typeof n.value&&(d=function(e){return n.value(e,r)}),"function"==typeof n.label&&(f=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=n.reduce?n.reduce(p):p,y=n.reduceLabel?n.reduceLabel(y,p):String(p)):y=p=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(p=i,y=i)),l.fields){var v=d?d(p):p;c.push(v),h.push(f&&null!=y?f(y):null!=y?y:String(v))}else{var b=d?d(p):p;o[t[s]]={value:b,label:f?f(y):null!=y?y:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},f=0;f<u.length;f++)d(f);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(h,r):h})}}var bg=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ag(r,e);return o&&o[0]?(t.tree=Gm(o[0],n.children||function(e){return e[i]}),t.tree):null};function xg(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,h=0;h<i.length;h++){var d,f=l[i[h]],p="".concat(u,"__").concat(null!==(d=f.qElemNumber)&&void 0!==d?d:f.qElemNo);a[p]||(a[p]=Mm({__id:p,__parent:u,qValues:[]},f),c=!0),u=p}if(c)for(var m=0;m<o.length;m++){var g=l[o[m]];a[u].qValues.push(g)}}var y=Object.keys(a).map((function(e){return a[e]})),v=function(){var e=ig,t=og;function n(n){var r,i,o,a,s,l,u,c=n.length,h=new Array(c),d={};for(i=0;i<c;++i)r=n[i],s=h[i]=new eg(r),null!=(l=e(r,i,n))&&(l+="")&&(d[u="$"+(s.id=l)]=u in d?rg:s);for(i=0;i<c;++i)if(s=h[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=d["$"+l]))throw new Error("missing: "+l);if(a===rg)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=ng,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(Qm),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=tg(t),n):e},n.parentId=function(e){return arguments.length?(t=tg(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(y);return v}var wg=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var h=u[c];if(h.field!==a){var d=gg(o,mg(h.field,{cube:r,cache:i}));h.accessor=d.nodeFn,h.valueAccessor=d.valueFn,h.attrAccessor=d.attrFn}}};function qg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?xg(t):bg(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var h=pg(i),d=h[u-1];c=n.fields[d]}else{var f=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(f=i.qDimensionInfo.length),c=n.fields[f]}var p=r.normalizeConfig(Mm(Mm({},e),{},{field:c?c.key():void 0}),t),m=p.props,g=p.main,y=Object.keys(m);l[u]={propsArr:y,props:m,main:g};var v=c?mg(c,{cube:i,cache:n}):{fieldDepth:0};wg({propsArr:y,props:m,cube:i,cache:n,itemDepthObject:v,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),q=0;q<w.length;q++){var M=l[w[q].depth].propsArr,D=l[w[q].depth].props,S=l[w[q].depth].main,k=x[q],_=k.data,C=yg(S,_,{key:o});vg({propsArr:M,props:D,item:k,itemData:_,ret:C,sourceKey:o,isTree:!0}),w[q].data=C}return a}function Mg(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!bg(s,n,e))continue;var u="object"===Dm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),h=c.props,d=c.main,f=Object.keys(h),p=mg(u,{cube:s,cache:n}),m=gg({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;wg({propsArr:f,props:h,cube:s,cache:n,itemDepthObject:p,f:u});for(var b=!!i[a].trackBy,x=Dm(i[a].trackBy),w={},q=[],M=g(n.tree),D=[],S=0;S<M.length;S++){var k=M[S],_=y?y(v(k)):v(k);if(!(d.filter&&!d.filter(_))){var C=yg(d,_,{key:l});vg({propsArr:f,props:h,item:k,itemData:_,ret:C,sourceKey:l}),b&&r.track({cfg:i[a],itemData:_,obj:C,target:q,tracker:w,trackType:x}),D.push(C)}}var E=b?r.collect(q,{main:d,propsArr:f,props:h}):D;o=[].concat(Rm(o),Rm(E))}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Dg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
32
32
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
33
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,f=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,f=h.length,b=0;b<f;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function qg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Mg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Dg=/%$/,kg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Sg=/^\(oct\)/i,_g=/^\(dec\)/i,Cg=/^\(hex\)/i,Eg=/^\(bin\)/i,Ag=/^\(rom\)/i,Tg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ig=/#|0/g;function Rg(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ng(e,t,n){var r;return kg.test(t)?e=Rg(e,Number(/\d{2}/.exec(t)[0]),t,n):Sg.test(t)?e=Rg(e,8,t,n):_g.test(t)?e=Rg(e,10,t,n):Cg.test(t)?e=Rg(e,16,t,n):Eg.test(t)?e=Rg(e,2,t,n):Ag.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function Og(e,t,n){var r=qg(e);return n?r:new RegExp(r||"",t)}function Pg(e,t,n,r){var i,o,a,s,l,u,c,h,f,d,p,m=e.pattern;r&&(e.abbreviate=!0),d=t,(p=n)&&(p=qg(p)),d&&(d=qg(d)),f=new RegExp("(?:[#0]+".concat(d,")?[#0]+(?:").concat(p,"[#0]+)?")),s=(a=(a=m.match(f))?a[0]:"")?m.substr(0,m.indexOf(a)):m,l=a?m.substring(m.indexOf(a)+a.length):"",a||(a=m?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Og(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Og(c,"g"),n)),h=(h=a.match(/#/g))?h.length:0;var g,y=m.split(c);y[1]&&(g=y[1].match(Ig)),e.prefix=s||"",e.postfix=l||"",e.pattern=m,e.maxPrecision=g?g.length:2,e.percentage=Dg.test(m),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Og(t,null,!0),"|").concat(Og(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=h}var Lg=function(){function e(t,n,r,i,o){qm(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Mg;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}return Dm(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Tg.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Tg.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Tg.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||Pg(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Pg(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Pg(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",f="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Ng(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=wg(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=wg(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function jg(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),h=Object.create(null),f=0,d=0;return(t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return f>=o&&(delete c[h[d]],delete h[d],f--,d++),c[e]=t,h[f]=e,f++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),h=Object.create(null),f=0,d=0},t.size=function(){return f},t}function zg(e,t,n,r,i){var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Cm(Lg,t)}(i,e,t,n,r),a=jg(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Fg="D",Hg="T",Bg="TS",Vg="IV",Wg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ug=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$g=["January","February","March","April","May","June","July","August","September","October","November","December"],Yg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xg(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function Kg(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function Gg(e,t){var n,r=function(e){var t=e,n=24*Kg(t),r=60*Kg(n),i=60*Kg(r),o=1e3*Kg(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}var Jg=function(){function e(t,n,r){qm(this,e);var i,o=t||{};(o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Wg,qDayNames:Ug,qLongMonthNames:$g,qMonthNames:Yg}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n)||(n=(km(i={},Hg,o.qTimeFmt||"hh:mm:ss"),km(i,Fg,o.qDateFmt||"YYYY-MM-DD"),km(i,Bg,o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]);this.pattern=n}return Dm(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=function(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,r):(e<0&&(e=-e,t="-".concat(t)),n=Gg(e,t));var i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Xg("".concat(t.year).slice(-2),2),YYY:Xg("".concat(t.year).slice(-3),3),def:function(e){return Xg("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Xg("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Xg("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Xg("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Xg("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Xg("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Xg("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g");return t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function Zg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Cm(Jg,t)}function Qg(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=Zg(n,e,t),i=jg(r.format.bind(r),{toKey:function(e){return"object"===wm(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Vg?Qg(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),r.format(t,e)},a.locale=function(n){return r=Zg(n,e,t),i=jg(r.format.bind(r),{toKey:function(e){return"object"===wm(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function ty(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ey(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),zg(n,r,i,o,t)}function ny(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),h=function(e){return e.qText||""},f="dimension"===l?"first":"avg",d=ty(n,o),p="dimension"===l?"first":function(e,t){return d(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:h,reduce:f,reduceLabel:p,formatter:function(){return d},tags:function(){return n.qTags}};return m}function ry(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ny(Hm({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=ry("qAttrDimInfo",t,n,a,Hm({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=ry("qAttrExprInfo",t,n,a,Hm({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=ry("qMeasureInfo",t,n,a,Hm({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function iy(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.key,o=r.data,a=r.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=iy.util,h={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},f={key:function(){return i},raw:function(){return u},field:function(e){return ag(e,h)},fields:function(){return l.fields.slice()},extract:function(e){return h.extractor(e,f,l,c)},hierarchy:function(e){return h.hierarchy(e,f,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(h.extractor=xg,h.hierarchy=bg,h.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(h.extractor=Um,h.pages=u.qDataPages,h.hierarchy=bg):h.extractor=function(){return[]},h.fieldExtractor=function(e){return h.extractor({field:e},f,l,c)};var d="S"===u.qMode?function(e){return e.qElemNumber}:void 0,p="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,Am(ry("qDimensionInfo",u,i,"",Hm({},h,{value:d,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,Am(ry("qMeasureInfo",u,i,"",Hm({},h,{value:p,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var m=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return m(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=f.field(e.from),n=ny(xm({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return h.extractor({field:e},f,l,c)},key:e.key,type:t.type(),localeInfo:h.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(n)})),(n=l.allFields).push.apply(n,Am(l.virtualFields)),f}var oy=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ay=/\/qDimensionInfo(?:\/(\d+))?/,sy=/\/qMeasureInfo\/(\d+)/,ly=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,uy=/\/qAttrExprInfo\/(\d+)/,cy=/\/?qHyperCube/,hy=/\/?qTreeData/,fy=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},dy=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function py(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};cy.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=fy):hy.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=dy);var s=!0;if(ay.test(e)&&(r=+ay.exec(e)[1]),sy.test(e)&&(i=+sy.exec(e)[1]),ly.test(e)){i=-1,r=0;var l=+ly.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(uy.test(e)){var u=i;if(t){i=0;var c=rg(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+uy.exec(n)[1]}else r>-1?(r=-1,i=+uy.exec(n)[1]):i+=+uy.exec(n)[1]+1}return oy.forEach((function(e){var t=Em(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function my(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;if(e.brushes().forEach((function(e){var t=py(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var h=r.qHyperCube,f=h.qNoOfLeftDims,d=h.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===f||d>=f)&&f>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:d-f})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l)return[{method:"resetMadeSelections",params:[]}];s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]});return s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a}function gy(e){iy.util=e.data("matrix").util,e.data("q",iy),e.formatter("q-number",zg),e.formatter("q-time",ey)}gy.qBrushHelper=my,gy.selections=my;var yy={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function vy(e){return yy[e]||e}function by(e){return function(t,n,r){var i,o,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach((function(t){t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));var n=vy(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),(a=a||new e.Manager(r)).add(new e[n](t.options)),Object.keys(t.events).forEach((function(e){t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((function(t){var n=vy(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((function(e){return""!==e}))),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((function(e){return""!==e}))))})))}function h(){l.forEach((function(e){Object.keys(e.events).forEach((function(t){a.off(t,e.events[t])})),a.remove(e.options.event)})),l=[]}return{get key(){return s},set:function(e){!function(e){s=e.key,o={chart:t,mediator:n,settings:i=e},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),h(),u&&c()},off:function(){u=!1,h()},on:function(){u=!0,0===l.length&&c()},destroy:function(){h(),a&&a.destroy(),a=null,o=null,i=null}}}}var xy={exports:{}};
|
|
33
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}));function Sg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var kg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},_g=/%$/,Cg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Eg=/^\(oct\)/i,Ag=/^\(dec\)/i,Tg=/^\(hex\)/i,Ig=/^\(bin\)/i,Rg=/^\(rom\)/i,Ng=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Og=/#|0/g;function Pg(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Lg(e,t,n){var r;return Cg.test(t)?e=Pg(e,Number(/\d{2}/.exec(t)[0]),t,n):Eg.test(t)?e=Pg(e,8,t,n):Ag.test(t)?e=Pg(e,10,t,n):Tg.test(t)?e=Pg(e,16,t,n):Ig.test(t)?e=Pg(e,2,t,n):Rg.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function jg(e,t,n){var r=Sg(e);return n?r:new RegExp(r||"",t)}function zg(e,t,n,r){var i,o,a,s,l,u,c,h,d,f,p,m=e.pattern;r&&(e.abbreviate=!0),f=t,(p=n)&&(p=Sg(p)),f&&(f=Sg(f)),d=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(p,"[#0]+)?")),s=(a=(a=m.match(d))?a[0]:"")?m.substr(0,m.indexOf(a)):m,l=a?m.substring(m.indexOf(a)+a.length):"",a||(a=m?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(jg(u,"g"),t)),c=n,n=".",c&&(a=a.replace(jg(c,"g"),n)),h=(h=a.match(/#/g))?h.length:0;var g,y=m.split(c);y[1]&&(g=y[1].match(Og)),e.prefix=s||"",e.postfix=l||"",e.pattern=m,e.maxPrecision=g?g.length:2,e.percentage=_g.test(m),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(jg(t,null,!0),"|").concat(jg(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=h}var Fg=function(){function e(t,n,r,i,o){Sm(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return kg;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}return _m(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ng.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ng.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ng.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||zg(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&zg(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&zg(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Lg(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Dg(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Dg(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function Hg(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),h=Object.create(null),d=0,f=0;return t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))},t.set=function(e,t){return d>=o&&(delete c[h[f]],delete h[f],d--,f++),c[e]=t,h[d]=e,d++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),h=Object.create(null),d=0,f=0},t.size=function(){return d},t}function Bg(e,t,n,r,i){var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tm(Fg,t)}(i,e,t,n,r),a=Hg(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Vg="D",Wg="T",Ug="TS",$g="IV",Yg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Xg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Kg=["January","February","March","April","May","June","July","August","September","October","November","December"],Gg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Jg(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function Zg(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function Qg(e,t){var n,r=function(e){var t=e,n=24*Zg(t),r=60*Zg(n),i=60*Zg(r),o=1e3*Zg(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}var ey=function(){function e(t,n,r){Sm(this,e);var i,o=t||{};(o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Yg,qDayNames:Xg,qLongMonthNames:Kg,qMonthNames:Gg}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n)||(n=(Cm(i={},Wg,o.qTimeFmt||"hh:mm:ss"),Cm(i,Vg,o.qDateFmt||"YYYY-MM-DD"),Cm(i,Ug,o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]);this.pattern=n}return _m(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=function(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,r):(e<0&&(e=-e,t="-".concat(t)),n=Qg(e,t));var i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Jg("".concat(t.year).slice(-2),2),YYY:Jg("".concat(t.year).slice(-3),3),def:function(e){return Jg("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Jg("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Jg("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Jg("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Jg("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Jg("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Jg("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g"),l=t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return l}}]),e}();function ty(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tm(ey,t)}function ny(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function ry(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ty(n,e,t),i=Hg(r.format.bind(r),{toKey:function(e){return"object"===Dm(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==$g?ny(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),r.format(t,e)},a.locale=function(n){return r=ty(n,e,t),i=Hg(r.format.bind(r),{toKey:function(e){return"object"===Dm(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function iy(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ry(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Bg(n,r,i,o,t)}function oy(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),h=function(e){return e.qText||""},d="dimension"===l?"first":"avg",f=iy(n,o),p="dimension"===l?"first":function(e,t){return f(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:h,reduce:d,reduceLabel:p,formatter:function(){return f},tags:function(){return n.qTags}};return m}function ay(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:oy(Wm({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=ay("qAttrDimInfo",t,n,a,Wm({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=ay("qAttrExprInfo",t,n,a,Wm({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=ay("qMeasureInfo",t,n,a,Wm({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function sy(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.key,o=r.data,a=r.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=sy.util,h={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},d={key:function(){return i},raw:function(){return u},field:function(e){return ug(e,h)},fields:function(){return l.fields.slice()},extract:function(e){return h.extractor(e,d,l,c)},hierarchy:function(e){return h.hierarchy(e,d,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(h.extractor=Mg,h.hierarchy=qg,h.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(h.extractor=Xm,h.pages=u.qDataPages,h.hierarchy=qg):h.extractor=function(){return[]},h.fieldExtractor=function(e){return h.extractor({field:e},d,l,c)};var f="S"===u.qMode?function(e){return e.qElemNumber}:void 0,p="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,Rm(ay("qDimensionInfo",u,i,"",Wm({},h,{value:f,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,Rm(ay("qMeasureInfo",u,i,"",Wm({},h,{value:p,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var m=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return m(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=d.field(e.from),n=oy(Mm({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return h.extractor({field:e},d,l,c)},key:e.key,type:t.type(),localeInfo:h.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(n)})),(n=l.allFields).push.apply(n,Rm(l.virtualFields)),d}var ly=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],uy=/\/qDimensionInfo(?:\/(\d+))?/,cy=/\/qMeasureInfo\/(\d+)/,hy=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dy=/\/qAttrExprInfo\/(\d+)/,fy=/\/?qHyperCube/,py=/\/?qTreeData/,my=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},gy=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function yy(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};fy.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=my):py.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=gy);var s=!0;if(uy.test(e)&&(r=+uy.exec(e)[1]),cy.test(e)&&(i=+cy.exec(e)[1]),hy.test(e)){i=-1,r=0;var l=+hy.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(dy.test(e)){var u=i;if(t){i=0;var c=ag(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+dy.exec(n)[1]}else r>-1?(r=-1,i=+dy.exec(n)[1]):i+=+dy.exec(n)[1]+1}return ly.forEach((function(e){var t=Im(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vy(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;if(e.brushes().forEach((function(e){var t=yy(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var h=r.qHyperCube,d=h.qNoOfLeftDims,f=h.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===d||f>=d)&&d>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:f-d})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l)return[{method:"resetMadeSelections",params:[]}];s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]});return s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a}function by(e){sy.util=e.data("matrix").util,e.data("q",sy),e.formatter("q-number",Bg),e.formatter("q-time",ry)}by.qBrushHelper=vy,by.selections=vy;var xy={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function wy(e){return xy[e]||e}function qy(e){return function(t,n,r){var i,o,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach((function(t){t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));var n=wy(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),(a=a||new e.Manager(r)).add(new e[n](t.options)),Object.keys(t.events).forEach((function(e){t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((function(t){var n=wy(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((function(e){return""!==e}))),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((function(e){return""!==e}))))})))}function h(){l.forEach((function(e){Object.keys(e.events).forEach((function(t){a.off(t,e.events[t])})),a.remove(e.options.event)})),l=[]}return{get key(){return s},set:function(e){!function(e){s=e.key,o={chart:t,mediator:n,settings:i=e},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),h(),u&&c()},off:function(){u=!1,h()},on:function(){u=!0,0===l.length&&c()},destroy:function(){h(),a&&a.destroy(),a=null,o=null,i=null}}}}var My={exports:{}};
|
|
34
34
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
35
35
|
* http://hammerjs.github.io/
|
|
36
36
|
*
|
|
37
37
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
38
|
-
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,u=Math.abs,c=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(d(e,n[t],n),!0)}function d(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),g=p((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){d(k(t),(function(t){e.addEventListener(t,n,!1)}))}function q(e,t,n){d(k(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function k(e){return e.trim().split(/\s+/g)}function S(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function _(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];S(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,R=E(t,"PointerEvent")!==i,N=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,j=["x","y"],z=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,h=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,h),t.distance=$(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var f=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=u(f.x)>u(f.y)?f.x:f.y,t.scale=s?function(e,t){return $(t[0],t[1],z)/$(e[0],e[1],z)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,f=W(l,c,h);r=f.x,o=f.y,n=u(f.x)>u(f.y)?f.x:f.y,a=U(c,h),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var d=e.element;M(t.srcEvent.target,d)&&(d=t.srcEvent.target);t.target=d}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:c(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(T(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4},K="mousedown",G="mousemove mouseup";function J(){this.evEl=K,this.evWin=G,this.pressed=!1,F.apply(this,arguments)}y(J,F,{handler:function(e){var t=X[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:O,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,F,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==O,s=S(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,F.apply(this,arguments)}function se(e,t){var n=_(e.touches),r=_(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier",!0)),[n,r]}y(ae,F,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},F.apply(this,arguments)}function he(e,t){var n=_(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=_(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[C(o.concat(s),"identifier",!0),s]:void 0}y(ce,F,{handler:function(e){var t=le[e.type],n=he.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}});function fe(){F.apply(this,arguments);var e=v(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(fe,F,{handler:function(e,t,n){var r=n.pointerType==O,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=E(s.style,"touchAction"),ye=ge!==i,ve="compute",be="auto",xe="manipulation",we="none",qe="pan-x",Me="pan-y",De=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&De[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return d(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(D(e,we))return we;var t=D(e,qe),n=D(e,Me);if(t&&n)return we;if(t||n)return t?qe:Me;if(D(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=D(r,we)&&!De.none,o=D(r,Me)&&!De["pan-y"],a=D(r,qe)&&!De["pan-x"];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function _e(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ee(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ae(e,t){var n=t.manager;return n?n.get(e):e}function Te(){_e.apply(this,arguments)}function Ie(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Ne(){_e.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){_e.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function je(e,t){return(t=t||{}).recognizers=x(t.recognizers,je.defaults.preset),new ze(e,t)}_e.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ae(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Ae(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===S(t,e=Ae(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Ae(e,this);var t=S(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Te,_e,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Se}}),y(Ie,Te,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&L&&t.push(qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Te.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ee(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Re,Te,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,_e,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),y(Oe,Te,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Pe,Te,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ee(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,_e,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=h((function(){this.state=Se}),this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Re,{enable:!1},["rotate"]],[Pe,{direction:6}],[Ie,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function ze(e,t){var n;this.options=o({},je.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?ne:N?ce:I?fe:J))(n,H),this.touchAction=new ke(this,this.options.touchAction),Fe(this,!0),d(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Fe(e,t){var n,r=e.element;r.style&&(d(e.options.cssProps,(function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}ze.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof _e)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=S(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return d(k(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return d(k(e),(function(e){t?n[e]&&n[e].splice(S(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(je,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:ze,Input:F,TouchAction:ke,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:fe,SingleTouchInput:ae,Recognizer:_e,AttrRecognizer:Te,Tap:Le,Pan:Ie,Swipe:Pe,Pinch:Re,Rotate:Oe,Press:Ne,on:w,off:q,each:d,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=je,e.exports?e.exports=je:t.Hammer=je}(window,document)}(xy);var wy=xy.exports;function qy(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var My={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o="center"===r?t:"* "+t,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=t.height+"px",n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=t.height+"px",n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=t.width+"px",n.height=t.height+"px",n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:case"top":case"bottom":n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),dir:i},e("span",{ref:this.alignToRef,style:a,title:o},o))}};function Dy(){const e=vm();return e.renderer.prio(["canvas"]),e.use(gy),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",by(e))};e.interaction("hammer",by(Hammer))}(wy)),e.use(qy),e.component("disclaimer",My),e}const ky={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function Sy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sy(Object(n),!0).forEach((function(t){Ey(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cy(e){return(Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ey(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ay(e){return function(e){if(Array.isArray(e))return Ty(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ty(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ty(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ty(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Iy=Object.prototype.hasOwnProperty,Ry=Object.prototype.toString,Ny=Object.defineProperty,Oy=Object.getOwnPropertyDescriptor,Py=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ry.call(e)},Ly=function(e){if(!e||"[object Object]"!==Ry.call(e))return!1;var t,n=Iy.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Iy.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Iy.call(e,t)},jy=function(e,t){Ny&&"__proto__"===t.name?Ny(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},zy=function(e,t){if("__proto__"===t){if(!Iy.call(e,t))return;if(Oy)return Oy(e,t).value}return e[t]},Fy=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=zy(s,n),s!==(i=zy(t,n))&&(c&&i&&(Ly(i)||(o=Py(i)))?(o?(o=!1,a=r&&Py(r)?r:[]):a=r&&Ly(r)?r:{},jy(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&jy(s,{name:n,newValue:i}));return s};function Hy(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function By(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function Vy(e,t,n,r,i){var o,a=i.byRow,s=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(r,r.raw().qCardinal);if(r){var l=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,l)}return{}}function Wy(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Uy(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function $y(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xy(){}var Ky=1/.7,Gy="\\s*([+-]?\\d+)\\s*",Jy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qy=/^#([0-9a-f]{3,8})$/,ev=new RegExp("^rgb\\("+[Gy,Gy,Gy]+"\\)$"),tv=new RegExp("^rgb\\("+[Zy,Zy,Zy]+"\\)$"),nv=new RegExp("^rgba\\("+[Gy,Gy,Gy,Jy]+"\\)$"),rv=new RegExp("^rgba\\("+[Zy,Zy,Zy,Jy]+"\\)$"),iv=new RegExp("^hsl\\("+[Jy,Zy,Zy]+"\\)$"),ov=new RegExp("^hsla\\("+[Jy,Zy,Zy,Jy]+"\\)$"),av={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 sv(){return this.rgb().formatHex()}function lv(){return this.rgb().formatRgb()}function uv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?cv(t):3===n?new pv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?hv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?hv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ev.exec(e))?new pv(t[1],t[2],t[3],1):(t=tv.exec(e))?new pv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=nv.exec(e))?hv(t[1],t[2],t[3],t[4]):(t=rv.exec(e))?hv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=iv.exec(e))?vv(t[1],t[2]/100,t[3]/100,1):(t=ov.exec(e))?vv(t[1],t[2]/100,t[3]/100,t[4]):av.hasOwnProperty(e)?cv(av[e]):"transparent"===e?new pv(NaN,NaN,NaN,0):null}function cv(e){return new pv(e>>16&255,e>>8&255,255&e,1)}function hv(e,t,n,r){return r<=0&&(e=t=n=NaN),new pv(e,t,n,r)}function fv(e){return e instanceof Xy||(e=uv(e)),e?new pv((e=e.rgb()).r,e.g,e.b,e.opacity):new pv}function dv(e,t,n,r){return 1===arguments.length?fv(e):new pv(e,t,n,null==r?1:r)}function pv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mv(){return"#"+yv(this.r)+yv(this.g)+yv(this.b)}function gv(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function yv(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function vv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xv(e,t,n,r)}function bv(e){if(e instanceof xv)return new xv(e.h,e.s,e.l,e.opacity);if(e instanceof Xy||(e=uv(e)),!e)return new xv;if(e instanceof xv)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new xv(a,s,l,e.opacity)}function xv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function wv(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}$y(Xy,uv,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:sv,formatHex:sv,formatHsl:function(){return bv(this).formatHsl()},formatRgb:lv,toString:lv}),$y(pv,dv,Yy(Xy,{brighter:function(e){return e=null==e?Ky:Math.pow(Ky,e),new pv(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new pv(this.r*e,this.g*e,this.b*e,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:mv,formatHex:mv,formatRgb:gv,toString:gv})),$y(xv,(function(e,t,n,r){return 1===arguments.length?bv(e):new xv(e,t,n,null==r?1:r)}),Yy(Xy,{brighter:function(e){return e=null==e?Ky:Math.pow(Ky,e),new xv(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new xv(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pv(wv(e>=240?e-240:e+120,i,r),wv(e,i,r),wv(e<120?e+240:e-120,i,r),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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var qv=Math.PI/180,Mv=180/Math.PI,Dv=4/29,kv=6/29,Sv=3*kv*kv;function _v(e){if(e instanceof Cv)return new Cv(e.l,e.a,e.b,e.opacity);if(e instanceof Nv)return Ov(e);e instanceof pv||(e=fv(e));var t,n,r=Iv(e.r),i=Iv(e.g),o=Iv(e.b),a=Ev((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ev((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ev((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Cv(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Cv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ev(e){return e>.008856451679035631?Math.pow(e,1/3):e/Sv+Dv}function Av(e){return e>kv?e*e*e:Sv*(e-Dv)}function Tv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Iv(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Rv(e){if(e instanceof Nv)return new Nv(e.h,e.c,e.l,e.opacity);if(e instanceof Cv||(e=_v(e)),0===e.a&&0===e.b)return new Nv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Mv;return new Nv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Nv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ov(e){if(isNaN(e.h))return new Cv(e.l,0,0,e.opacity);var t=e.h*qv;return new Cv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Pv(e){return function(){return e}}function Lv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Pv(isNaN(e)?t:e)}$y(Cv,(function(e,t,n,r){return 1===arguments.length?_v(e):new Cv(e,t,n,null==r?1:r)}),Yy(Xy,{brighter:function(e){return new Cv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Cv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pv(Tv(3.1338561*(t=.96422*Av(t))-1.6168667*(e=1*Av(e))-.4906146*(n=.82521*Av(n))),Tv(-.9787684*t+1.9161415*e+.033454*n),Tv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),$y(Nv,(function(e,t,n,r){return 1===arguments.length?Rv(e):new Nv(e,t,n,null==r?1:r)}),Yy(Xy,{brighter:function(e){return new Nv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Nv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Ov(this).rgb()}}));var jv=function e(t){var n=function(e){return 1==(e=+e)?Lv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Pv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=dv(e)).r,(t=dv(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Lv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),zv=/^class(-pyramid)?/,Fv=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Ay(c))),o=Math.max.apply(Math,[o].concat(Ay(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:h,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[h[0]];for(var d=0;d<c.length;d+=1)if(f[d]){var p=h[d],m=h[d+1],g=jv(p,m)(.5);u.range.push(g),u.domain.push(c[d]),d<c.length-1&&f[d+1]&&(u.range.push(h[d+1]),u.domain.push((c[d]+c[d+1])/2))}else u.range.push(h[d]),u.range.push(h[d+1]),u.domain.push(c[d]),u.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));u.range.push(h[h.length-1]),u.domain.push(o)}else u.domain=c,u.range=h;return u};function Hv(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):Hv(e,t,n,r+1,i)}var Bv=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Ay(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!h)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Ay(c)),u.max=Math.max.apply(Math,Ay(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&zv.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Ay(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var d=h?Hv(u.max,u.min,c,1,o):o,p=(u.max-u.min)/d,m=[],g=0;g<d+1;g+=1)m.push(u.min+p*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),r=[],i=0;i<d;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function Vv(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function Wv(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),_y(_y({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return _y(_y({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function Uv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function $v(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Yv(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Vv:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=Bv(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var h=c.raw().coloring;h&&h.gradient&&Fy(u,Fv(e,h.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?Wy:i,a=r.getCByField,s=void 0===a?Uy:a,l=r.getPersistence,u=void 0===l?Vy:l,c=o(t,n),h=s(n,c),f=h?h.raw():{},d=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===f.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),Fy(p,u(t,n,c,h,{byRow:By,byElemNo:Hy})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Bv(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(c={categorical:h.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],d=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(r.primary):d.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:d}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return Wv({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(Uv(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=$v(e.measureOverrides,e.explicit),Uv(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=$v(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function Xv(e){var t=_y({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Fy(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=Fy(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=Fy(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=e.auxiliary||{},o=i.key;if("measure"===e.fieldType)return r.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?r.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Fv(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=_y({},e);Fy(a,Hy(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Fy(a,Hy(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Fy(a,Hy(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=_y(_y({},e),r.getDataColorSpecials())),n.settings=Fy(e,Yv(this,n,t,e))}return n.settings}};return i}var Kv=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},Gv=function(e){throw e.isHandled=!0,e},Jv=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},Zv=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},Qv=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Gv):Promise.reject()};function eb(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}function tb(e){return function(t){return"object"===Cy(t.datum[e])?t.datum[e].value:void 0}}function nb(e){return"object"===Cy(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function rb(e){return-3===e.datum.value}var ib=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},ob=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function ab(e,t){var n=e.styleReference,r=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:ib(o,r,i)},show:"function"==typeof o.show?function(){return ob(o,l,a)}:ob(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(n,"legend.title","color"):void 0,fontSize:s?s.getStyle(n,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(n,"legend.title","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"}}}}function sb(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=ab(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.viewState,l=e.rtl,u=e.settings,c=e.style,h=t.scaleKey,f=t.theme,d=t.scales,p=r.layout.dock,m="left"===p||"right"===p?{maxLines:3,wordBreak:"break-word"}:{},g={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var y="".concat(h,"Legend");return Fy(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:y in d?y:h,settings:{layout:{scrollOffset:function(){return s?s.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:i,label:_y({fill:f?f.getStyle(a,"legend.label","color"):void 0,fontSize:f?f.getStyle(a,"legend.label","fontSize"):void 0,fontFamily:f?f.getStyle(a,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},m)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:g[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:c})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n=e.key,r=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=ab(e,t);return!!u.show&&Fy(!0,u,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(r,"legend.label","color"):void 0,fontSize:l?l.getStyle(r,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(r,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}function lb(e,t,n){var r=[],i=[],o=sb(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},Ey(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),Ey(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),Ey(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var ub=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function cb(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=Xv(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return Jv(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return Zv(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return Qv(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=Kv,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=_y({},i),r={},!n.key)throw new Error("Missing key");t.set(_y(_y({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=_y(_y({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Ay(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Ay((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Ay((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,h=eb({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=_y(_y({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=Fy({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Fy({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,r;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(r=t.exclude)&&void 0!==r&&r.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=tb(r),o=tb("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,h=e.type;return a?function(e){return rb(e)||o(e)?u:l}:n[t]?function(e){return rb(e)?u:nb(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return rb(e)||o(e)?u:nb(e)?l:c}:"color"===h?function(e){return rb(e)||o(e)?u:nb(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=tb("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?ub(e.qNum):e.qText&&uv(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var h=Ey({},u,n);return r.qDimensionInfo.length>1&&(h["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(u,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,h=void 0===c?{}:c,f=e.style,d=void 0===f?{}:f,p=arguments.length>1?arguments[1]:void 0;return lb({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,settings:h,style:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var hb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function fb(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(hb),o=r.some(hb),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function db(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=_y(_y(_y({},e),t),{},{colorProps:_y(_y({},e.colorProps),t.colorProps||{})});return n}var pb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function mb(e){var t,n=e.qHyperCube.qDimensionInfo.some(pb),r=e.qHyperCube.qMeasureInfo.some(pb),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var gb=function(){};function yb(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function vb(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function bb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wb(e,t,n){return t&&xb(e.prototype,t),n&&xb(e,n),e}function qb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mb(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Db(e,t){var n,r,i,o,a,s=new Cb(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=kb);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Cb(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(_b)}function kb(e){return e.children}function Sb(e){e.data=e.data.data}function _b(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Cb(e){this.data=e,this.depth=this.height=0,this.parent=null}Cb.prototype=Db.prototype={constructor:Cb,count:function(){return this.eachAfter(Mb)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Db(this).eachBefore(Sb)}};var Eb,Ab=(function(e){
|
|
38
|
+
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,u=Math.abs,c=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),g=p((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(S(t),(function(t){e.addEventListener(t,n,!1)}))}function q(e,t,n){f(S(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function D(e,t){return e.indexOf(t)>-1}function S(e){return e.trim().split(/\s+/g)}function k(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function _(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];k(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,R=E(t,"PointerEvent")!==i,N=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,j=["x","y"],z=["clientX","clientY"];function F(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,h=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,h),t.distance=$(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var d=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=s?function(e,t){return $(t[0],t[1],z)/$(e[0],e[1],z)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=W(l,c,h);r=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,a=U(c,h),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:c(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=j);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}F.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(T(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4},K="mousedown",G="mousemove mouseup";function J(){this.evEl=K,this.evWin=G,this.pressed=!1,F.apply(this,arguments)}y(J,F,{handler:function(e){var t=X[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:O,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,F.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,F,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==O,s=k(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,F.apply(this,arguments)}function se(e,t){var n=_(e.touches),r=_(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier",!0)),[n,r]}y(ae,F,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.call(this,e,t);12&t&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},F.apply(this,arguments)}function he(e,t){var n=_(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=_(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[C(o.concat(s),"identifier",!0),s]:void 0}y(ce,F,{handler:function(e){var t=le[e.type],n=he.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}});function de(){F.apply(this,arguments);var e=v(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function fe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,pe.call(this,t)):12&e&&pe.call(this,t)}function pe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(de,F,{handler:function(e,t,n){var r=n.pointerType==O,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)fe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=E(s.style,"touchAction"),ye=ge!==i,ve="compute",be="auto",xe="manipulation",we="none",qe="pan-x",Me="pan-y",De=function(){if(!ye)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&De[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(D(e,we))return we;var t=D(e,qe),n=D(e,Me);if(t&&n)return we;if(t||n)return t?qe:Me;if(D(e,xe))return xe;return be}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=D(r,we)&&!De[we],o=D(r,Me)&&!De[Me],a=D(r,qe)&&!De[qe];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ke=32;function _e(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ee(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ae(e,t){var n=t.manager;return n?n.get(e):e}function Te(){_e.apply(this,arguments)}function Ie(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Ne(){_e.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){_e.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function je(e,t){return(t=t||{}).recognizers=x(t.recognizers,je.defaults.preset),new ze(e,t)}_e.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ae(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ae(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===k(t,e=Ae(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ae(e,this);var t=k(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=ke},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=ke);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Te,_e,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:ke}}),y(Ie,Te,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&L&&t.push(qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Te.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ee(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Re,Te,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ne,_e,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return ke},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}}),y(Oe,Te,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Pe,Te,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ie.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ee(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,_e,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return ke},failTimeout:function(){return this._timer=h((function(){this.state=ke}),this.options.interval,this),ke},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),je.VERSION="2.0.7",je.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Oe,{enable:!1}],[Re,{enable:!1},["rotate"]],[Pe,{direction:6}],[Ie,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function ze(e,t){var n;this.options=o({},je.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(R?ne:N?ce:I?de:J))(n,H),this.touchAction=new Se(this,this.options.touchAction),Fe(this,!0),f(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Fe(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,(function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}ze.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof _e)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=k(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(S(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(k(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(je,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ke,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:ze,Input:F,TouchAction:Se,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:ae,Recognizer:_e,AttrRecognizer:Te,Tap:Le,Pan:Ie,Swipe:Pe,Pinch:Re,Rotate:Oe,Press:Ne,on:w,off:q,each:f,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=je,e.exports?e.exports=je:t.Hammer=je}(window,document)}(My);var Dy=My.exports;function Sy(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var ky={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};function _y(){const e=wm();return e.renderer.prio(["canvas"]),e.use(by),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",qy(e))};e.interaction("hammer",qy(Hammer))}(Dy)),e.use(Sy),e.component("disclaimer",ky),e}const Cy={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function Ey(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ay(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ey(Object(n),!0).forEach((function(t){Iy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ey(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ty(e){return Ty="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ty(e)}function Iy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ry(e){return function(e){if(Array.isArray(e))return Ny(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ny(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ny(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ny(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Oy=Object.prototype.hasOwnProperty,Py=Object.prototype.toString,Ly=Object.defineProperty,jy=Object.getOwnPropertyDescriptor,zy=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Py.call(e)},Fy=function(e){if(!e||"[object Object]"!==Py.call(e))return!1;var t,n=Oy.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Oy.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Oy.call(e,t)},Hy=function(e,t){Ly&&"__proto__"===t.name?Ly(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},By=function(e,t){if("__proto__"===t){if(!Oy.call(e,t))return;if(jy)return jy(e,t).value}return e[t]},Vy=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=By(s,n),s!==(i=By(t,n))&&(c&&i&&(Fy(i)||(o=zy(i)))?(o?(o=!1,a=r&&zy(r)?r:[]):a=r&&Fy(r)?r:{},Hy(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Hy(s,{name:n,newValue:i}));return s};function Wy(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Uy(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function $y(e,t,n,r,i){var o,a=i.byRow,s=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(r,r.raw().qCardinal);if(r){var l=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,l)}return{}}function Yy(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Xy(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function Ky(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Gy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jy(){}var Zy=1/.7,Qy="\\s*([+-]?\\d+)\\s*",ev="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tv="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nv=/^#([0-9a-f]{3,8})$/,rv=new RegExp("^rgb\\("+[Qy,Qy,Qy]+"\\)$"),iv=new RegExp("^rgb\\("+[tv,tv,tv]+"\\)$"),ov=new RegExp("^rgba\\("+[Qy,Qy,Qy,ev]+"\\)$"),av=new RegExp("^rgba\\("+[tv,tv,tv,ev]+"\\)$"),sv=new RegExp("^hsl\\("+[ev,tv,tv]+"\\)$"),lv=new RegExp("^hsla\\("+[ev,tv,tv,ev]+"\\)$"),uv={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 cv(){return this.rgb().formatHex()}function hv(){return this.rgb().formatRgb()}function dv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?fv(t):3===n?new yv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?pv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?pv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=rv.exec(e))?new yv(t[1],t[2],t[3],1):(t=iv.exec(e))?new yv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ov.exec(e))?pv(t[1],t[2],t[3],t[4]):(t=av.exec(e))?pv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=sv.exec(e))?wv(t[1],t[2]/100,t[3]/100,1):(t=lv.exec(e))?wv(t[1],t[2]/100,t[3]/100,t[4]):uv.hasOwnProperty(e)?fv(uv[e]):"transparent"===e?new yv(NaN,NaN,NaN,0):null}function fv(e){return new yv(e>>16&255,e>>8&255,255&e,1)}function pv(e,t,n,r){return r<=0&&(e=t=n=NaN),new yv(e,t,n,r)}function mv(e){return e instanceof Jy||(e=dv(e)),e?new yv((e=e.rgb()).r,e.g,e.b,e.opacity):new yv}function gv(e,t,n,r){return 1===arguments.length?mv(e):new yv(e,t,n,null==r?1:r)}function yv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function vv(){return"#"+xv(this.r)+xv(this.g)+xv(this.b)}function bv(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"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===e?")":", "+e+")")}function xv(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function wv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mv(e,t,n,r)}function qv(e){if(e instanceof Mv)return new Mv(e.h,e.s,e.l,e.opacity);if(e instanceof Jy||(e=dv(e)),!e)return new Mv;if(e instanceof Mv)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Mv(a,s,l,e.opacity)}function Mv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Dv(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ky(Jy,dv,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:cv,formatHex:cv,formatHsl:function(){return qv(this).formatHsl()},formatRgb:hv,toString:hv}),Ky(yv,gv,Gy(Jy,{brighter:function(e){return e=null==e?Zy:Math.pow(Zy,e),new yv(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new yv(this.r*e,this.g*e,this.b*e,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:vv,formatHex:vv,formatRgb:bv,toString:bv})),Ky(Mv,(function(e,t,n,r){return 1===arguments.length?qv(e):new Mv(e,t,n,null==r?1:r)}),Gy(Jy,{brighter:function(e){return e=null==e?Zy:Math.pow(Zy,e),new Mv(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Mv(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yv(Dv(e>=240?e-240:e+120,i,r),Dv(e,i,r),Dv(e<120?e+240:e-120,i,r),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 e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Sv=Math.PI/180,kv=180/Math.PI,_v=4/29,Cv=6/29,Ev=3*Cv*Cv;function Av(e){if(e instanceof Tv)return new Tv(e.l,e.a,e.b,e.opacity);if(e instanceof Lv)return jv(e);e instanceof yv||(e=mv(e));var t,n,r=Ov(e.r),i=Ov(e.g),o=Ov(e.b),a=Iv((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Iv((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Iv((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Tv(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Tv(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Iv(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ev+_v}function Rv(e){return e>Cv?e*e*e:Ev*(e-_v)}function Nv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ov(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pv(e){if(e instanceof Lv)return new Lv(e.h,e.c,e.l,e.opacity);if(e instanceof Tv||(e=Av(e)),0===e.a&&0===e.b)return new Lv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*kv;return new Lv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Lv(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function jv(e){if(isNaN(e.h))return new Tv(e.l,0,0,e.opacity);var t=e.h*Sv;return new Tv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function zv(e){return function(){return e}}function Fv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):zv(isNaN(e)?t:e)}Ky(Tv,(function(e,t,n,r){return 1===arguments.length?Av(e):new Tv(e,t,n,null==r?1:r)}),Gy(Jy,{brighter:function(e){return new Tv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Tv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new yv(Nv(3.1338561*(t=.96422*Rv(t))-1.6168667*(e=1*Rv(e))-.4906146*(n=.82521*Rv(n))),Nv(-.9787684*t+1.9161415*e+.033454*n),Nv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ky(Lv,(function(e,t,n,r){return 1===arguments.length?Pv(e):new Lv(e,t,n,null==r?1:r)}),Gy(Jy,{brighter:function(e){return new Lv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Lv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return jv(this).rgb()}}));var Hv=function e(t){var n=function(e){return 1==(e=+e)?Fv:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):zv(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=gv(e)).r,(t=gv(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Fv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Bv=/^class(-pyramid)?/,Vv=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Ry(c))),o=Math.max.apply(Math,[o].concat(Ry(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:h,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[h[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Hv(p,m)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(h[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(h[f]),u.range.push(h[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(h[h.length-1]),u.domain.push(o)}else u.domain=c,u.range=h;return u};function Wv(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):Wv(e,t,n,r+1,i)}var Uv=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Ry(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!h)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Ry(c)),u.max=Math.max.apply(Math,Ry(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=d&&Bv.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Ry(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===u.type){for(var f=h?Wv(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,m=[],g=0;g<f+1;g+=1)m.push(u.min+p*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function $v(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function Yv(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),Ay(Ay({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return Ay(Ay({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function Xv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Kv(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Gv(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?$v:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=Uv(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var h=c.raw().coloring;h&&h.gradient&&Vy(u,Vv(e,h.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?Yy:i,a=r.getCByField,s=void 0===a?Xy:a,l=r.getPersistence,u=void 0===l?$y:l,c=o(t,n),h=s(n,c),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),Vy(p,u(t,n,c,h,{byRow:Uy,byElemNo:Wy})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Uv(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(c={categorical:h.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var d=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return Yv({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(Xv(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Kv(e.measureOverrides,e.explicit),Xv(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Kv(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function Jv(e){var t=Ay({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Vy(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=Vy(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=Vy(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=e.auxiliary||{},o=i.key;if("measure"===e.fieldType)return r.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?r.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Vv(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=Ay({},e);Vy(a,Wy(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Vy(a,Wy(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Vy(a,Wy(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=Ay(Ay({},e),r.getDataColorSpecials())),n.settings=Vy(e,Gv(this,n,t,e))}return n.settings}};return i}var Zv=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},Qv=function(e){throw e.isHandled=!0,e},eb=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},tb=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},nb=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Qv):Promise.reject()};function rb(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}function ib(e){return function(t){return"object"===Ty(t.datum[e])?t.datum[e].value:void 0}}function ob(e){return"object"===Ty(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function ab(e){return-3===e.datum.value}var sb=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},lb=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function ub(e,t){var n=e.styleReference,r=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:sb(o,r,i)},show:"function"==typeof o.show?function(){return lb(o,l,a)}:lb(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(n,"legend.title","color"):void 0,fontSize:s?s.getStyle(n,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(n,"legend.title","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"}}}}function cb(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=ub(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.viewState,l=e.rtl,u=e.settings,c=e.style,h=t.scaleKey,d=t.theme,f=t.scales,p=r.layout.dock,m="left"===p||"right"===p?{maxLines:3,wordBreak:"break-word"}:{},g={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var y="".concat(h,"Legend");return Vy(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:y in f?y:h,settings:{layout:{scrollOffset:function(){return s?s.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:i,label:Ay({fill:d?d.getStyle(a,"legend.label","color"):void 0,fontSize:d?d.getStyle(a,"legend.label","fontSize"):void 0,fontFamily:d?d.getStyle(a,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},m)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:g[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:c})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n=e.key,r=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=ub(e,t);return!!u.show&&Vy(!0,u,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(r,"legend.label","color"):void 0,fontSize:l?l.getStyle(r,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(r,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}function hb(e,t,n){var r=[],i=[],o=cb(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},Iy(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),Iy(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),Iy(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var db=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function fb(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=Jv(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return eb(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return tb(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return nb(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=Zv,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=Ay({},i),r={},!n.key)throw new Error("Missing key");t.set(Ay(Ay({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=Ay(Ay({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Ry(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Ry((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Ry((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,h=rb({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=Ay(Ay({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=Vy({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Vy({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,r;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(r=t.exclude)&&void 0!==r&&r.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=ib(r),o=ib("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,h=e.type;return a?function(e){return ab(e)||o(e)?u:l}:n[t]?function(e){return ab(e)?u:ob(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return ab(e)||o(e)?u:ob(e)?l:c}:"color"===h?function(e){return ab(e)||o(e)?u:ob(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=ib("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?db(e.qNum):e.qText&&dv(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var h=Iy({},u,n);return r.qDimensionInfo.length>1&&(h["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(u,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,h=void 0===c?{}:c,d=e.style,f=void 0===d?{}:d,p=arguments.length>1?arguments[1]:void 0;return hb({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,settings:h,style:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var pb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function mb(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(pb),o=r.some(pb),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function gb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ay(Ay(Ay({},e),t),{},{colorProps:Ay(Ay({},e.colorProps),t.colorProps||{})});return n}var yb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function vb(e){var t,n=e.qHyperCube.qDimensionInfo.some(yb),r=e.qHyperCube.qMeasureInfo.some(yb),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var bb=function(){};function xb(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function wb(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function qb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Db(e,t,n){return t&&Mb(e.prototype,t),n&&Mb(e,n),e}function Sb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kb(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function _b(e,t){var n,r,i,o,a,s=new Tb(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Cb);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Tb(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Ab)}function Cb(e){return e.children}function Eb(e){e.data=e.data.data}function Ab(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Tb(e){this.data=e,this.depth=this.height=0,this.parent=null}Tb.prototype=_b.prototype={constructor:Tb,count:function(){return this.eachAfter(kb)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return _b(this).eachBefore(Eb)}};var Ib,Rb,Nb=(Ib=function(e){
|
|
39
39
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
40
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,f=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,f=h.length,b=0;b<f;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}(Eb={exports:{}}),Eb.exports);function Tb(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Ib={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Rb=/%$/,Nb=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Ob=/^\(oct\)/i,Pb=/^\(dec\)/i,Lb=/^\(hex\)/i,jb=/^\(bin\)/i,zb=/^\(rom\)/i,Fb=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Hb=/#|0/g;function Bb(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Vb(e,t,n){var r=Tb(e);return n?r:new RegExp(r||"",t)}function Wb(e,t,n){var r,i,o,a,s,l,u,c,h,f,d,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),f=t,(d=n)&&(d=Tb(d)),f&&(f=Tb(f)),h=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(d,"[#0]+)?")),a=(o=(o=p.match(h))?o[0]:"")?p.substr(0,p.indexOf(o)):p,s=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(Vb(l,"g"),t)),u=n,n=".",u&&(o=o.replace(Vb(u,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var m,g=p.split(u);g[1]&&(m=g[1].match(Hb)),e.prefix=a||"",e.postfix=s||"",e.pattern=p,e.maxPrecision=m?m.length:2,e.percentage=Rb.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(Vb(t,null,!0),"|").concat(Vb(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=n,e.temp=c}!function(){function e(t,n,r,i,o){bb(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Ib;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}wb(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Fb.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Fb.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Fb.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||Wb(r.positive,t,n),r.negative&&!r.negative.isFunctional&&Wb(r.negative,t,n),r.zero&&!r.zero.isFunctional&&Wb(r.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",f="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return Nb.test(t)?e=Bb(e,Number(/\d{2}/.exec(t)[0]),t,n):Ob.test(t)?e=Bb(e,8,t,n):Pb.test(t)?e=Bb(e,10,t,n):Lb.test(t)?e=Bb(e,16,t,n):jb.test(t)?e=Bb(e,2,t,n):zb.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Ab(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Ab(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var Ub=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$b=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Yb=["January","February","March","April","May","June","July","August","September","October","November","December"],Xb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Kb(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function Gb(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,r){bb(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Ub,qDayNames:$b,qLongMonthNames:Yb,qMonthNames:Xb}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(qb(i={},"T",o.qTimeFmt||"hh:mm:ss"),qb(i,"D",o.qDateFmt||"YYYY-MM-DD"),qb(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}wb(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(r=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=r.getUTCDay()-1)<0&&(a=6),n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:a,date:r.getUTCDate(),h:o,m:r.getUTCMinutes(),s:r.getUTCSeconds(),f:r.getUTCMilliseconds(),t:r.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,r=function(e){var t=e,n=24*Gb(t),r=60*Gb(n),i=60*Gb(r),o=1e3*Gb(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Kb("".concat(t.year).slice(-2),2),YYY:Kb("".concat(t.year).slice(-3),3),def:function(e){return Kb("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Kb("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Kb("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Kb("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Kb("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Kb("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Kb("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var h=new RegExp(u.join("|"),"g");return t.replace(h,(function(e){var t,n,r;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in l[n])if(i===e||i.toLowerCase()===e){void 0===(r=l[n][i])&&(r=l[n][i.toLowerCase()]);break}return void 0===r&&(r=l[n].def),"function"==typeof r&&(r=r(e)),r}))}}])}();const Jb=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Zb=function(){};function Qb(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}Zb.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Jb.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},Qb.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Qb(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new Qb(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Qb(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Qb(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Qb(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const ex=new Qb(0,0,0,0),tx=new Qb(0,0,0,0),nx=Zb.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,ex.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tx.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=tx.intersection(ex,!0),r.push({coverage:i?i.clone():new Qb(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){ex.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tx.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=ex.intersection(tx,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map((e=>e.slice(i,i+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let rx;function ix(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function ox(e,t,n){let r,i,o;const a=[];let s=[],l=0,u=0;for(n.length&&(l=n[0].qUp||0,u=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(s=ox(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&rx>=e&&rx<=e+t||s.length>0)&&(o=ix(i,a),void 0!==o.qUp&&1===a.length&&(o.qUp=l+r),o.qSubNodes=s),0===i.qSubNodes.length&&rx++,rx===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return a}function ax(e,t,n){return rx=0,ox(e,t,n)}const sx=new Qb(0,0,0,0),lx=new Qb(0,0,0,0),ux=nx.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lx.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=lx.intersection(sx,!0),r.push({coverage:i?i.clone():new Qb(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lx.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=sx.intersection(lx,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map((e=>e.slice(i,i+n.width)));return{qLeft:ax(r,n.height,t.qLeft),qTop:ax(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function cx(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ux;else{if("table"!==e.visualization)return;this.slicer=new nx}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class hx{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,cx.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=yb(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const fx={version:"0.37.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function dx(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function px(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function mx(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){dx(t),px(t)},moved(e,t){dx(t),px(t)},removed(e,t){dx(t),px(t)}},measures:{min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}}}}var gx={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,h=arguments[0],f=1,d=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},f=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=c(h,n),h!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(h,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(h,{name:n,newValue:i}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,h=arguments[0],f=1,d=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},f=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=c(h,n),h!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(h,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(h,{name:n,newValue:i}));return h}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var h=c(r[0],i),f=c(r[1],i),d=p(0),m=p(1),g=y(h,d),v=y(f,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(d(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var h=p(0),f=p(1);return"If(Count(".concat(h,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var M=i.a.bind(null,!0),D={},k=Array.isArray;function S(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function _(e){return void 0===e}function C(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=_(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(S(e)&&S(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(k(e)&&k(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||C(t,i)||(_(a)?r.push({op:"add",path:s,value:o}):S(o)&&S(a)?r=r.concat(D.generate(a,o,s)):k(o)&&k(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&_(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!_(t[0])&&_(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){_(t[i])&&!C(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},D.apply=function(e,t){t.forEach((function(t){var n,r=E(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(k(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(k(o)&&k(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(S(o)&&S(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),M(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=E(e,t.from);k(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(k(r)?r.splice(+i,1):delete r[i])}))},D.clone=function(e){return M({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):M(e,t)};var T=D,I=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function N(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function O(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=w.getNumStepComp(n,l),f=w.getAboveComp(n,l,c,h),d=w.getRangeComp("RangeSum",f);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(d,p,m);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return d},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(O(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(O(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(O(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(O(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=N(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=N(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(O(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=N(t,e);return o&&!o.disabled}}}},j="movingAverage";function z(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function F(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,f=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:h}),d=w.getNumStepComp(r,u),p=w.getAboveComp(r,u,f,d);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(F(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}}}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=w.getAboveComp(n,l,c),f="".concat(c," - ").concat(h);if(w.needDimension({modifier:n,properties:r,layout:i})){var d=w.getDimComp(u,1),p=w.getDimComp(u,0),m=w.getAggrComp(f,d,p);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(U(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}}}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),h=ae(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(h," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,h,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe={accumulation:L,movingAverage:B,difference:Y,normalization:se},de=(t.default={modifiers:fe,apply:pe,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&de[e.id]&&de[e.id].masterItemSubscriber&&(de[e.id].masterItemSubscriber&&de[e.id].masterItemSubscriber.unsubscribe(),delete de[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return fe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return fe[e]&&fe[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ce({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;de[t.id]=de[t.id]||{isFirstTime:!0};var l=de[t.id].isFirstTime;if(de[t.id].isFirstTime=!1,n&&"object"===he(n))return me({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var h=a(u,"qHyperCube.qMeasureInfo"),f=de[t.id].lastReloadTime;if(de[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:u})){var d=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return _e({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:u,model:t,lastReloadTime:f});return d||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Me(n);var r=Ne(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return d&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(_e({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=fe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&ke(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ne(n);return Oe({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Me(r);var f=Ne(r);return Oe({model:t,libraryIds:f,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ne(n);return Ee({model:r,dimensionAndFieldList:s}).then((function(e){return Ae({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ce({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===he(e)&&!e.disabled){if(s++,"object"!==he(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");fe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=fe[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof fe[n.type].updateModifier&&fe[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=fe[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!fe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,De(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({modifiers:we(e),properties:n,layout:r})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(fe[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||fe[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function qe(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Me(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function De(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!fe[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function ke(e){return e.base||e.qDef&&e.qDef.base}function Se(e){var t=ke(e);return e.qLibraryId||t&&t.qLibraryId}function _e(e){var t=e.measure,n=e.properties,r=e.layout;return!Se(t)&&Ce({modifiers:we(t),properties:n,layout:r})}function Ce(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!fe[e.type])&&(void 0===i[e.type]&&(i[e.type]=fe[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ie(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&fe[e.type]&&fe[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ne(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ce({modifiers:r,properties:e})){var o=Se(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Oe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(de[t.id].masterItemSubscriber=de[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),de[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},f=n(1),d=n.n(f),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){d.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function q(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var S={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=q(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=D(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function _(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var C={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(m(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(m(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(m(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,h=e.supportedFilters,f=void 0===h||h,d=e.isHCModifierSupported,p=void 0===d||d,m={qChildren:[]},g=S.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=S.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,D=l.defaultDimension,k=void 0===D?S.getDefaultDimension():D,C=l.defaultMeasure,E=void 0===C?S.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,S.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&S.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),S.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:k}),S.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),S.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),S.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),S.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),S.copyPropertyIfExist("qMaxStackedCells",y,v),S.copyPropertyIfExist("qNoOfLeftDims",y,v),S.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),S.copyPropertyOrSetDefault("qMode",y,v,"S"),S.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),S.copyPropertyOrSetDefault("qSortbyYValue",y,v),S.copyPropertyOrSetDefault("qIndentMode",y,v),S.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),S.importCommonProperties(g,t,r),m.qProperty=g;var A=o.getValue(c||{},"support.modifiers");return S.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),f&&_(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&_(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(A(a,t,r,i),T(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},N={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},O={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:O,"sn-scatter-plot":O,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=I.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function F(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var d=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:d,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(d.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(d)):l.qAttributeExpressions.push(d)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:d.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return d.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=R.getItemLabel(t);switch(z(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;F({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;F({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||N).colorModeOptions||N.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=C.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=I.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(a,[],"qAttributeDimensions",u),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),h=c.qProperty,f=o.getValue(h,"visualization"),d=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,f),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:d});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(d),c}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?_(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):_(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),K.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(m(s,"measureAxis.min","supportedAutoMinMax"),m(s,"measureAxis.max","supportedAutoMinMax")):(m(s,"measureAxis.min","unsupportedAutoMinMax"),m(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),h=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:a}),G.setInterColumnSortOrder(h.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:C,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:_,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(gx);var yx=n(gx.exports);const vx=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function bx(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var xx={importColors:function(e){e.color.point=e.color.point||{},bx(e.color,e.color.point,vx),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){bx(e.color.point,e.color,vx),e.color.colorExpression=yb(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function wx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=yx.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),xx.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function qx({propertyTree:e,viewDataMode:t}){const n=yx.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return xx.exportColors(e.qProperty),n}var Mx=e=>{const t=mx(e);return{properties:fx,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>wx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:qx}},Dx=Object.prototype.hasOwnProperty,kx=Object.prototype.toString,Sx=Object.defineProperty,_x=Object.getOwnPropertyDescriptor,Cx=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===kx.call(e)},Ex=function(e){if(!e||"[object Object]"!==kx.call(e))return!1;var t,n=Dx.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Dx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Dx.call(e,t)},Ax=function(e,t){Sx&&"__proto__"===t.name?Sx(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Tx=function(e,t){if("__proto__"===t){if(!Dx.call(e,t))return;if(_x)return _x(e,t).value}return e[t]},Ix=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Tx(s,n),s!==(i=Tx(t,n))&&(c&&i&&(Ex(i)||(o=Cx(i)))?(o?(o=!1,a=r&&Cx(r)?r:[]):a=r&&Ex(r)?r:{},Ax(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Ax(s,{name:n,newValue:i}));return s};const Rx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Nx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Ox(o,!0),i);return a},createRegExp:Ox};function Ox(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Px={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Rx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Lx(t,i,e);n[t]=r}))}return Nx.replaceExpressionTokens(e,n)}};function Lx(e,t,n){if(""===t)return"";const r=Nx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const jx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach((e=>{o=Vx(e.match(Bx("Dim"))),o.forEach((e=>{s.push(zx(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=Vx(e.match(Bx("Mea"))),a.forEach((e=>{s.push(Fx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=s.length?Promise.all(s).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=Ix({},n,i),o=Ix(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:["="+Px.generateExpression(e,r)]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Px.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>zx(e,n,r,t))),i=e.qMeasures.map((e=>Fx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function zx(e,t,n,r){if(e.qLibraryId)return Hx(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Fx(e,t){return e.qLibraryId?Hx(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Hx(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function Bx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Vx(e){return e?e.map((e=>e.substr(6,1))):[]}function Wx(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Ux={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:Wx,invertedEnumConvertFunctions:function(e){return Wx((function(){return!e||!e()}))}};const $x=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Yx(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:$x,convertFunctions:n.sorting,show:t=>0!==yb(t,e,0)}}}}var Xx={state:function(e,t){return Yx(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Ux.booleanConvertFunctions(t),sorting:Ux.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Yx(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Ux.booleanConvertFunctions(t),sorting:Ux.enumConvertFunctions(t)})},numeric:function(e,t){return Yx(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Ux.booleanConvertFunctions(t,-1),sorting:Ux.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Ux.booleanConvertFunctions(t),sorting:Ux.enumConvertFunctions(t)},r=Yx(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==yb(t,e,0)},r},frequency:function(e,t){return Yx(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Ux.booleanConvertFunctions(t),sorting:Ux.invertedEnumConvertFunctions(t)})}};const Kx={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function Gx(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(Kx);const Jx={hasMultipleDimensions:Gx,getOuterDimensionCardinality:function(e){const t=yb(e,Kx.HYPERCUBE_PATH);return Gx(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return yb(e,Kx.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==yb(e,Kx.SORT_CRITERIA+".sortByExpression",0)},isSortByNumeric:function(e){return 0!==yb(e,Kx.SORT_CRITERIA+".sortByNumeric",0)},isSortByAscii:function(e){return 0!==yb(e,Kx.SORT_CRITERIA+".sortByAscii",0)}},Zx={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var Qx={create(e,t){if(!e||!Zx[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach(((e,i)=>{e[n]===t&&(r=i)}))),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),a=i.filter((e=>!(o.filter((t=>t[r]===e[r])).length>0)));return[...t,...a]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const a=e[o][n],s=t.length;if(this.moveById(a,t,r,i),s!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}};var ew={getColorByDefinition:function(e,t,n){const r={};let i,o,a;switch(e){case"dimension":n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,a=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:a?i.qFieldLabels[0]:i.qFieldDefs[0]));break;default:throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input")}return r}};var tw={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const nw=["scatterplot","map"],rw=["map"];var iw={baseColor:{isSupported:e=>e&&e.length&&-1===nw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==rw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=yb(n,"mode"),i=yb(n,"auto"),o=yb(e,t+"qDimensions",[]),a=yb(e,t+"qMeasures",[]);let s,l,u,c;if(!i&&"byDimension"===r&&o.length)s=yb(n,"byDimDef"),s&&cw(n,s.label),s&&s.activeDimensionIndex>-1?(s.activeDimensionIndex=Math.min(s.activeDimensionIndex,o.length-1),l=o[s.activeDimensionIndex],c=ew.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=s.activeDimensionIndex,lw(n,c)):s&&s.key||(l=o[o.length-1],u=Qx.getById(l.qAttributeDimensions,Qx.IDMAP.COLOR_BY_ALTERNATIVE),lw(n,ew.getColorByDefinition("dimension",!!u,u||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&a.length<2&&vb(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=yb(n,"mode"),i=yb(n,"auto"),o=yb(e,t+"qDimensions",[]),a=yb(e,t+"qMeasures",[]),s=yb(e,t+"qLayoutExclude.qHyperCubeDef.qDimensions",[]);!i&&"byDimension"===r&&o.length?uw(n,!0,o,s,a,yb(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?uw(n,!1,o,s,a,yb(n,"byMeasureDef.label")):ow(o,s)},setColorByPropertyDef:lw,resolveColorByPropertyDef:uw,clearColorByItem:ow};function ow(e,t){e.forEach((e=>{aw(e,Qx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),aw(e,Qx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{aw(e,Qx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),aw(e,Qx.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function aw(e,t,n){if(e[n]){const r=Qx.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function sw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function lw(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(cw(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||sw(t.name),key:sw(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&tw.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function uw(e,t,n,r,i,o){ow(n,r);const a=n[n.length-1];if(a){const n=yb(e,t?"byDimDef":"byMeasureDef"),r=yb(e,"formatting.qNumFormat"),s=yb(e,"formatting.isCustomFormatted");if(n){const e=Qx.create(Qx.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=s));break;case"libraryItem":if(!t){let t=-1;i.forEach(((e,r)=>{n.key===e.qLibraryId&&(t=r)})),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=s)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},a.qAttributeDimensions.push(e)):a.qAttributeExpressions.push(e)}}}function cw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function hw(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function fw(e){return"libraryItem"===yb(e,"color.point.byDimDef.type")}function dw(e){return"libraryItem"===yb(e,"color.point.byMeasureDef.type")}function pw(e){return!0===yb(e,"color.point.auto")}function mw(e){return!pw(e)&&"byDimension"===yb(e,"color.point.mode")}function gw(e){return!pw(e)&&"byMeasure"===yb(e,"color.point.mode")}var yw={measuresHasBaseColors:function(e){return yb(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!hw(e))).length>0},dimensionsHasBaseColors:function(e){return yb(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!hw(e))).length>0},onGlobalChangeColors:function(e){iw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)},isColorByDimension:mw,isColorByMeasure:gw,isColorAuto:pw,isColorByExpression:function(e){return!pw(e)&&"byExpression"===yb(e,"color.point.mode")},isColorBySingle:function(e){return!pw(e)&&"primary"===yb(e,"color.point.mode","primary")},isDimensionLibraryItem:fw,isMeasureLibraryItem:dw,showLegend:function(e){const t=yb(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===pw(e)},showColorByLabel:function(e){const t=mw(e)&&!1===fw(e),n=gw(e)&&!1===dw(e),r=yb(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){var n,r,i;return null===(n=null===(r=e.layout.qHyperCube.qDimensionInfo[t])||void 0===r||null===(i=r.coloring)||void 0===i?void 0:i.hasValueColors)||void 0===n||n}};function vw(e,t){this.getSettings=e,this.getElements=t}function bw(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();vb(n,"qSortByExpression",r.SORT_BY_EXPRESSION),vb(n,"qSortByAscii",r.SORT_BY_ASCII),vb(n,"qSortByNumeric",r.SORT_BY_NUMERIC),vb(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=xw(this.getElements());n.qExpression.qv=i.exp}function xw(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}vw.prototype.applyAutoSorting=bw,vw.prototype.applyDefaultCustomSorting=function(e,t){bw.call(this,e);const n=xw(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},vb(t.sortCriteria,"sortByExpression",r.qSortByExpression),vb(t.sortCriteria,"sortByAscii",r.qSortByAscii),vb(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),vb(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},vw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(vb(n,"qSortByExpression",t.sortCriteria.sortByExpression),vb(n,"qSortByAscii",t.sortCriteria.sortByAscii),vb(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),vb(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error("Sorter: "+e)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const ww={create:function(e,t){return new vw(e,t)}};const qw={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Mw={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Mw.ASCII),Object.freeze(Mw);const Dw=Ix(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Mw);const kw={getSettings:function(e){return yb(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Dw.DIST_MAX:Dw.ASCII}};function Sw(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Rx.wrapExpression(t):"",a=n?Rx.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,a).replace(/{{<outerDimString>}}/g,n?`<${a}>`:"").replace(/{{outerDimString,}}/g,n?a+",":"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const _w={getElementIds:function(){return[Kx.SORTING_ELEMENT_MIN_ID,Kx.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],a=e[0],s=Sw(0,i,o,a),l=Sw(1,i,o,a);return[{id:Kx.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:s,isDefault:Kx.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:Kx.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:Kx.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Sw};function Cw(e){throw new Error("distributionplot-sorter.applySorting: "+e)}function Ew(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return kw.getSettings(t)},a=ww.create(o,(function(){const e=o();return _w.getElements(n.measures,n.dimensions,e,r)})),s=i[0],l=e.sorting;qw.applySorting(a,s,l)}const Aw={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Cw("'qHyperCubeDef.qDimensions' has no outer dimension"):Cw("no 'qHyperCubeDef.qMeasures' in properties arg"):Cw("no 'qHyperCubeDef.qDimensions' in properties arg"):Cw("no 'qHyperCubeDef' in properties arg")}(e),r?Ew(e,t,r,i):jx.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Ew(e,t,n,i)}))}},Tw=Kx.SORT_CRITERIA+".sortByExpression";const Iw={updateSortOrder:function(e,t){if(!t)return;const n=yb(e,Tw);if(!(-1===n||1===n))return;const r=yb(e,Kx.SORTING_ELEMENT_ID),i=yb(t,Kx.SORTING_ELEMENT_ID),o=r===Kx.SORTING_ELEMENT_MAX_ID,a=r===Kx.SORTING_ELEMENT_MIN_ID&&i===Kx.SORTING_ELEMENT_MAX_ID,s=o&&(!!!i||i===Kx.SORTING_ELEMENT_MIN_ID),l=yb(t,Tw),u=o&&!(-1===l||1===l)&&1===n;a?vb(e,Tw,1):(s||u)&&vb(e,Tw,-1)}},Rw=e=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e});function Nw(e){return!yb(e,"color.point.auto")&&"byDimension"===yb(e,"color.point.mode")&&yb(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Ow(e){const{flags:t,translator:n}=e,r=e.anything.sense.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("DIST_BKG_OPTIONS"),a=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),s={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!yb(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Kx.CHART_ID,"box","fill");return a(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!yb(e,"color.point.auto",!0)&&"primary"===yb(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return a(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!yb(e,"color.point.auto")&&"byExpression"===yb(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},u={type:"items",translation:"properties.presentation",items:{styleEditor:i&&Rw(o),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};u.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:Kx.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},u.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const c={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxis)||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(vb(i,"measureAxis.autoMinMax",!1),vb(i,"measureAxis.minMax","min"),vb(i,"measureAxis.min",0)):vb(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},h={uses:"axis.picasso.dimensionAxis",show:(e,t)=>yb(t.layout,Kx.HYPERCUBE_PATH+".qDimensionInfo.length")>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>yb(t.layout,Kx.HYPERCUBE_PATH+".qDimensionInfo.length")>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>yb(t.layout,Kx.HYPERCUBE_PATH+".qDimensionInfo.length")>1&&"horizontal"!==yb(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>yb(t.layout,Kx.HYPERCUBE_PATH+".qDimensionInfo.length")>1}}}}};function f(e,t){const n=yb(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const d=(e,t)=>{var n,r,i;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,a,s,l,u;const n=null!==(o=null===(a=e.color.point.byDimDef)||void 0===a?void 0:a.key)&&void 0!==o?o:"",r=null!==(s=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(u=l.qHyperCube)||void 0===u?void 0:u.qDimensionInfo)&&void 0!==s?s:[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(r=null===(i=e.color.point.byDimDef)||void 0===i?void 0:i.label)&&void 0!==r?r:""},p=(e,t,r)=>{var i,o;if(null!==(i=e.qHyperCubeDef)&&void 0!==i&&null!==(o=i.qDimensions)&&void 0!==o&&o.length){var a,s,l,u,c;const t=null===(a=e.qHyperCubeDef)||void 0===a?void 0:a.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(s=null===(l=e.color)||void 0===l||null===(u=l.point)||void 0===u||null===(c=u.byDimDef)||void 0===c?void 0:c.activeDimensionIndex)&&void 0!==s?s:-1)<0&&t.push({value:-1,label:d(e,r)}),t}return[]},m=(e,t)=>{const n="measure"===yb(e,"color.point.useBaseColors")&&yw.measuresHasBaseColors(t),r="dimension"===yb(e,"color.point.useBaseColors")&&yw.dimensionsHasBaseColors(t);return yw.isColorBySingle(e)&&!n&&!r},g=(e,t)=>!yb(e,"color.point.auto",void 0)&&"primary"===yb(e,"color.point.mode",void 0)&&!m(e,t),y={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&g(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!g(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>yb(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{yb(e,"color.point.auto")||(vb(e,"color.point.mode","primary"),vb(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===yb(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!yw.isColorAuto(e),change(e){if("primary"===yb(e,"color.point.mode",void 0)){const t=yb(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&vb(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:p,show:(e,t,n)=>yw.isColorByDimension(e)&&p(e,0,n).length>1,change(e){f(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const r=yb(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!yw.isColorAuto(e)&&"primary"===r&&(yw.measuresHasBaseColors(n)||yw.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:m},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,r){var i,o,a;const s=null!==(i=null===(o=e.color.point)||void 0===o||null===(a=o.byDimDef)||void 0===a?void 0:a.activeDimensionIndex)&&void 0!==i?i:null,l=yw.hasDimValueColors(r.handler,s);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&yw.isColorByDimension(e)&&yw.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Kx.CHART_ID,"box","fill");return a(e)},show:e=>!yb(e,"color.point.auto",!0)}}}}},v={uses:"settings",items:{simpleLabels:{items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},general:l,presentation:u,colors:{uses:"colorsAndLegend",items:{colors:{globalChange:yw.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),yb(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!yw.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>yw.isColorByDimension(e),change(e){f(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>yw.isColorByMeasure(e),change(e){f(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:yw.showColorByLabel,change(e){const t=yb(e,"color.point.mode"),n=yb(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?"="+n.qStringExpression.qExpr:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=yb(e,"color.point.mode","primary");return!yw.isColorAuto(e)&&"primary"===n&&(yw.measuresHasBaseColors(t)||yw.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!yb(e,"color.point.auto")&&"byMultiple"===yb(e,"color.point.mode")&&"measure"===yb(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&yw.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===yb(e,"color.point.useBaseColors")&&yw.measuresHasBaseColors(t),r="dimension"===yb(e,"color.point.useBaseColors")&&yw.dimensionsHasBaseColors(t);return yw.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>yw.isColorByDimension(e)&&yw.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=yb(e,"color.point.auto"),n=yb(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===yb(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>yb(e,"color.point.auto")||"byDimension"!==yb(e,"color.point.mode")||"libraryItem"!==yb(e,"color.point.byDimDef.type")?Nw(e):Nw(e)&&!yb(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!yw.isColorAuto(e)&&yw.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!yw.isColorAuto(e)&&yw.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>yw.isColorByDimension(e)&&(!yw.isDimensionLibraryItem(e)||!yb(e,"color.point.useDimColVal"))},customRange:{show:e=>!yw.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>yw.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>yw.isColorByMeasure(e)&&!1===yb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yb(e,"color.point.minMax")&&yb(e,"color.point.measureMin")>=yb(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>yw.isColorByMeasure(e)&&!1===yb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yb(e,"color.point.minMax")&&yb(e,"color.point.measureMin")>=yb(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>yw.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Kx.CHART_ID,"box","fill");return a(e)},show:e=>!yb(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:yw.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>yw.showLegend(e)&&yb(e,"legend.show",!0)},showTitle:{show:e=>yw.showLegend(e)&&yb(e,"legend.show",!0)}}}}}||s,measureAxis:c,dimensionAxis:h}},b={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:yw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},x=Xx.expression(Kx.SORT_CRITERIA+".sortByExpression"),w={type:"items",items:{toggled:x.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:Kx.SORTING_EXPRESSION,elementRef:Kx.SORTING_ELEMENT_ID,show:Jx.isSortByExpression,elements:e=>jx.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const r=kw.getSettings(e.layout);return _w.getElements(t.measures,t.dimensions,r,n)}))},order:x.items.order}},q={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Iw.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:Kx.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:Jx.hasMultipleDimensions,change(e,t,r,i){if(e&&Jx.hasMultipleDimensions(e)&&t.layout)return Aw.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:Kx.SORTING_EXPRESSION,elementRef:Kx.SORTING_ELEMENT_ID,sortCriteriasRef:Kx.SORT_CRITERIA,show:e=>Jx.hasMultipleDimensions(e)&&!Jx.isAutoSort(e),elements:e=>jx.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const r=kw.getSettings(e.layout);return _w.getElements(t.measures,t.dimensions,r,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>Jx.hasMultipleDimensions(e)&&!Jx.isAutoSort(e),items:{expression:w,numeric:Xx.numeric(Kx.SORT_CRITERIA+".sortByNumeric"),ascii:Xx.ascii(Kx.SORT_CRITERIA+".sortByAscii"),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!Jx.isSortByExpression(e)&&!Jx.isSortByNumeric(e)&&!Jx.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!Jx.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:q,addons:b,settings:v}}}function Pw(e,t){const n={chart:"",dimension:""};return 0!==yb(e,t+"qSortByExpression",0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==yb(e,t+"qSortByNumeric",0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==yb(e,t+"qSortByAscii",0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Lw={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:{buildDefinition:function(e,t,n,r,i){const o=n+".qDef.qSortCriterias.0.";return{type:"items",translation:"properties.sorting",icon:"ascending",show:t=>yb(t,e+".qDimensions.length",0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[o+"qSortByExpression",o+"qSortByNumeric",o+"qSortByAscii"],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,a){const s=a.layout;let l=Pw(e,o).chart;l||(l="sortByAscii");const u=yb(e,t);if(u.sortCriteria||(u.sortCriteria={}),u.autoSort){const t=r(s);if(t.ELEMENT)u.elementId=t.ELEMENT;else{const t=i(e,s);u.elementId=t[0]}}u.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(u,l),u.sortCriteria[l]=n},getValue(e){const t=Pw(e,o).dimension;return t?yb(e,o+t):0}}}}}}.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",kw.getSettings,_w.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},jw={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>yw.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>yw.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>yw.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:yw.showLegend}}}}};function zw(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Ow(e),softDefinition:Lw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){yw.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=mx(e);r.mapProperties();return wx({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>qx({propertyTree:e,viewDataMode:n})}}Ix(!0,Lw,jw);const Fw={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=(""+n).charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Hw(){return Fw.id()}const Bw="scrollbar";function Vw(e,t,n){return"y"===e?Ww(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Ww(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Uw={getAxisDock:Vw,getOppositeAxisDock:function(e,t,n){return Vw(e,"far"===t?"near":"far",n)},getYAxisDock:Ww};const $w=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Yw=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Xw=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Kw(e){return $w.test(e)}function Gw(e){return Yw.test(e)||Xw.test(e)}var Jw={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Kw(r))return"ltr";if(Gw(r))return"rtl"}return"ltr"}};var Zw={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Ix(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Ix(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Jw.lrm}(${n})${Jw.lrm}`:`${Jw.lrm}(${n})${Jw.lrm}`:!1!==e.showLabel?t:""}};const Qw={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:-10},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Qw.DEFAULT_CHART_ORIENTATION=Qw.HORIZONTAL;function eq(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Qw.DEFAULT_CHART_ORIENTATION,a=o===Qw.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=Qw.SHOW_AXIS_LABELS_OPTIONS,c=Qw.SHOW_TITLE_OPTIONS,h=u.includes(r.show),f=!!n.measureTitleText&&c.includes(r.show),d=n.includeDimensionAxis&&u.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Ix(i,Qw.LAYOUTSETTINGS.measureAxis);const o=nq(t,n);e.addComponent(n+"-axis",i,o)}(e,n,s,r),f&&function(e,t,n){let r={text:t.measureTitleText};r=Ix(r,Qw.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return nq(e,t)}(t,n);e.addComponent(n+"-axis-title",r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Ix(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),d&&function(e,t,n){let r={scale:"dimension"};r=Ix(r,Qw.LAYOUTSETTINGS.dimensionAxis);const i=rq(t,n);Ix(!0,r,t.dimensionAxisSettings||{}),e.addComponent(n+"-axis",r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText};r=Ix(r,Qw.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return rq(e,t)}(t,n);e.addComponent(n+"-axis-title",r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Qw.HORIZONTAL?Qw.VERTICAL:Qw.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Ix(r,Qw.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){e.getSettings().scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const i={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},o=Ix({},Qw.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",o,i),tq(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Bw))}return[{type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Bw).emit("tap",e)}}},{type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Bw).emit("panStart",e)},pan(e){this.chart.component(Bw).emit("panMove",e)},panend(e){this.chart.component(Bw).emit("panEnd",e)},pancancel(e){this.chart.component(Bw).emit("panCancel",e)}}}]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=Uw.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Ix(o,Qw.LAYOUTSETTINGS.refLines);let a={key:"ref-line-labels-"+Hw(),require:["renderer","chart"],dock:Uw.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?" "+n:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=Ix(a,Qw.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=Ix(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=Zw.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=Zw.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Qw.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Ix(o,Qw.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,rq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Ix(o,Qw.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,nq(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Ix(o,Qw.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,rq(n,l).dock,n.isRtl)}n.brushActions&&tq(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function tq(e,t){t.forEach((t=>{e.push(t)}))}function nq(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function rq(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function iq(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Ix(!0,{},o,e||{})}function oq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),f=t.theme.getStyle(n,"axis.label.name","fontFamily"),d={key:"axis",type:"axis",dock:Uw.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:f,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}};return Ix(!0,{},d,e||{})}function aq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:Uw.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return Ix(!0,{},u,e||{})}iq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=iq(Ix(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},iq.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return iq(Ix(!0,n,e||{}),t)},oq.xAxis=function(e,t){return oq(Ix(!0,{key:"x-axis",scale:"x"},e||{}),t)},oq.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:Uw.getYAxisDock(n,r)};return oq(Ix(!0,i,e||{}),t)},aq.xAxisTitle=function(e,t){return aq(Ix(!0,{key:"x-axis-title"},e||{}),t)},aq.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:Uw.getYAxisDock(n,r)||"left"};return aq(Ix(!0,i,e||{}),t)};var sq={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push("@"+e),t&&n.push("@"+t),n.length&&(r=n.join(",")),r}};const lq={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function uq(){return lq}function cq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}uq.getLayoutModeKeys=function(){const e=[];let t;for(t in lq)e.push(t);return e};const hq={left:"left",right:"right",up:"top",down:"bottom"};function fq(e,t,n){switch(e){case"scale":return iq(t,n);case"measure-scale":return iq.measureScale(t,n);case"dimension-scale":return iq.dimensionScale(t,n);case"axis":return oq(t,n);case"box-marker":return function(e){return Ix(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Ix(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Ix(!0,{},o,e||{})}(t,n);case"text":return aq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),Ix(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:sq.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:sq.getBublesAlign(a,s,l)}}};return Ix(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let h=!0;const f={type:"brush-area-dir",key:"area",displayOrder:99,dock:sq.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:sq.getBublesAlign(s,l,u),label:e=>h?(h=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{f.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Ix(!0,{},f,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),h={key:"legend",type:"legend-cat",dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon","lui-icon--triangle-"+hq[t.direction]].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return Ix(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;case"middle":default:return.5}}const f={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return Ix(!0,{},f,e)}(t,n);case"x-axis":return oq.xAxis(t,n);case"y-axis":return oq.yAxis(t,n);case"x-axis-title":return aq.xAxisTitle(t,n);case"y-axis-title":return aq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Ix(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Ix(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Ix(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Ix(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o={key:"labels",type:"labels",displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:t.theme.getStyle(n,"label.value","fontFamily"),fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:cq}]}}}]}};return Ix(!0,{},o,e||{})}(t,n);default:return}}function dq(e){this.options=e||{},this.settings={dockLayout:{layoutModes:uq()},components:[],scales:{}}}dq.prototype.addComponent=function(e,t,n){const r=fq(e,t,Ix(!0,{},this.options,n||{}));return this.settings.components.push(r),r},dq.prototype.addInteraction=function(e,t){const n=fq("interaction",e,Ix(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},dq.prototype.addScale=function(e,t,n){const r=fq(e,t,Ix(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},dq.prototype.getSettings=function(){return this.settings},dq.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},dq.prototype.addPreset=function(e,t){!function(e,t,n){switch(e){case"dimension-measure-chart":eq(t,n);break;default:throw Error("There is no chart preset with that type")}}(e,this,t)},dq.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?"Duplicate key for component "+e.type:(t[n]=!0,null):"Missing key for component "+e.type})).filter((e=>!!e))},dq.create=function(e){return new dq(e)},dq.createComponent=fq;const pq={CENTER:0,BOTTOM:1};var mq={DISCLAIMERS:[{label:"NoDataExist",alignment:pq.CENTER,default:!0},{label:"RequireNumericDimension",alignment:pq.CENTER,default:!1},{label:"OnlyNanData",alignment:pq.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:pq.CENTER,default:!1},{label:"LimitedData",alignment:pq.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:pq.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:pq.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:pq.BOTTOM,default:!1}],ALIGNMENT:pq};const gq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,mq.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function yq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function vq(e,t){return e&&t&&t[e]}function bq(e){this.environment=e,this.clear()}yq.prototype.isValidAndSupported=function(e,t){return vq(e.label,this.dataAttributes)&&(e.default||vq(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},yq.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},yq.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=t.get("Object.Disclaimer."+i.label)+" ")})),n},bq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},bq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},bq.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=Ix(!0,{},this.vizAttributes.supportedDisclaimers),i=new yq(mq.DISCLAIMERS,this.dataAttributes,r);let o,a;if(i.isAnyValidDisclaimer(mq.ALIGNMENT.CENTER))o=i.getMessage(mq.ALIGNMENT.CENTER,n),a="center";else{if(!i.isAnyValidDisclaimer(mq.ALIGNMENT.BOTTOM))return;o=i.getMessage(mq.ALIGNMENT.BOTTOM,n),a="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:a},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},bq.prototype.set=function(e){if(this.clear(),!e)throw new Error(bq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=gq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},bq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const xq=Zb.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new bq(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[dq.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};switch(t.qMode){case"K":r="qStackedDataPages";break;case"S":default:r="qDataPages"}return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),dq.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Ix(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:yb(e,t.replace(/\//g,"."))})));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function wq(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const qq={generateHash:function(e){return wq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=qq.generateHash(t)}};const Mq={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:kq(t),dimensionExpressions:Dq(t),measureExpressions:e})))}};function Dq(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function kq(e){return function(e){return yb(e,"qDimensionInfo",[])}(e).map((e=>e.qGroupPos))}const Sq={},_q=Ix.bind(null,!0);function Cq(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Eq=Array.isArray,Aq=function(e){return void 0===e};function Tq(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Iq(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Aq(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Rq(e,t){if(Cq(e)&&Cq(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Rq(e[n],t[n]))return!1;return!0}if(Eq(e)&&Eq(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Rq(e[n],t[n]))return!1;return!0}return e===t}Sq.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=_q({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;Rq(o,a)||Tq(t,i)||(Aq(a)?r.push({op:"add",path:s,value:o}):Cq(o)&&Cq(a)?r=r.concat(Sq.generate(a,o,s)):Eq(o)&&Eq(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&Aq(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Rq(t,i))return r;if(null===t[0]||!Aq(t[0])&&Aq(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Sq.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Aq(t[i])&&!Tq(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Sq.apply=function(e,t){t.forEach((t=>{const n=Iq(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Eq(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Eq(i)&&Eq(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Cq(i)&&Cq(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Tq(a,e)&&delete a[e]})),_q(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Iq(e,t.from);Eq(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Eq(n)?n.splice(+r,1):delete n[r]);var a}))},Sq.clone=function(e){return _q({},e)},Sq.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Sq.updateObject=function(e,t){Object.keys(e).length?Sq.apply(e,Sq.generate(e,t)):_q(e,t)};class Nq{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Sq.generate(e,t);return Ix(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Sq.generate(n,r);Sq.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Oq={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Pq={saveDerivedProperties:function(e,t,n,r){if(Oq.canModifyHardProperties(t))return e.setProperties(n);return new Nq(e).saveSoftProperties(r,n)}};var Lq={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function jq(){this._generationInProgress=!1}function zq(e){Lq.validate(e);const t=e.properties,n=qq.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}jq.prototype.isDerivedUpToDate=zq,jq.prototype.updateDerivedProperties=function(e){if(Lq.validate(e),this._generationInProgress)return Promise.resolve(!0);if(zq(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Ix(!0,{},e.properties),o=Ix(!0,{},i);return this._generationInProgress=!0,qq.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Pq.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},jq.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Mq.getDefaultHashDataForHyperCube(e,t,n).then((e=>Ix(!0,r,e)))};var Fq={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=u()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&l(i,n.prototype),i}).apply(null,arguments)}function h(e,t){return p(e)||g(e,t)||y(e,t)||x()}function f(e){return d(e)||m(e)||y(e)||b()}function d(e){if(Array.isArray(e))return v(e)}function p(e){if(Array.isArray(e))return e}function m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}function y(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var w=Object.prototype.hasOwnProperty,q=Object.prototype.toString,M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,k=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===q.call(e)},S=function(e){if(!e||"[object Object]"!==q.call(e))return!1;var t,n=w.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&w.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||w.call(e,t)},_=function(e,t){M&&"__proto__"===t.name?M(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},C=function(e,t){if("__proto__"===t){if(!w.call(e,t))return;if(D)return D(e,t).value}return e[t]},E=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=C(s,n),s!==(i=C(t,n))&&(c&&i&&(S(i)||(o=k(i)))?(o?(o=!1,a=r&&k(r)?r:[]):a=r&&S(r)?r:{},_(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&_(s,{name:n,newValue:i}));return s};function A(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function T(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function I(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,h=r;if(i.field&&i.field!==n){var f=A(i.field,o,{cache:t});if(-1===f)return;h=E({qRow:a},f(s))}u[c]=T(i,h,{key:l})}function R(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){for(var l=t.raw(),u=t.key(),c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),h=i.normalizeConfig(o[s],t),d=h.props,p=h.main,m=Object.keys(d),g=!!o[s].trackBy,y=r(o[s].trackBy),v={},b=[],x=[],w=0;w<l.qDataPages.length;w++){var q=A(c,l.qDataPages[w],{cache:n});if(-1!==q)for(var M=0;M<l.qDataPages[w].qMatrix.length;M++){var D=l.qDataPages[w].qArea.qTop+M,k=E({qRow:D},q(l.qDataPages[w].qMatrix[M])),S=T(p,k,{key:u});if(!p.filter||p.filter(k)){for(var _=0;_<m.length;_++){var C=d[m[_]],R=C.fields||[C];C.fields&&(S[m[_]]=[]);for(var N=0;N<R.length;N++)I({cache:n,f:c,mainCell:k,p:R[N],prop:m[_],props:d,page:l.qDataPages[w],rowIdx:D,row:l.qDataPages[w].qMatrix[M],sourceKey:u,target:C.fields?S[m[_]]:S,targetProp:C.fields?N:m[_]});if(C.fields){var O=S[m[_]].map((function(e){return e.value})),P=S[m[_]].map((function(e){return e.label}));S[m[_]]={value:"function"==typeof C.value?C.value(O):void 0!==C.value?C.value:O,label:"function"==typeof C.label?C.label(P):void 0!==C.label?String(C.label):String(S[m[_]].value)}}}g&&i.track({cfg:o[s],itemData:k,obj:S,target:b,tracker:v,trackType:y}),x.push(S)}}}var L=g?i.collect(b,{main:p,propsArr:m,props:d}):x;a=[].concat(f(a),f(L))}return a}function N(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function O(){return this.eachAfter(N)}function P(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this}function L(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this}function j(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this}function z(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function F(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function H(e){for(var t=this,n=B(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function B(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function V(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function W(){var e=[];return this.each((function(t){e.push(t)})),e}function U(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function $(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function Y(e,t){var n,r,i,o,a,s=new Z(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=K);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Z(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(J)}function X(){return Y(this).eachBefore(G)}function K(e){return e.children}function G(e){e.data=e.data.data}function J(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Z(e){this.data=e,this.depth=this.height=0,this.parent=null}function Q(e){if("function"!=typeof e)throw new Error;return e}Z.prototype=Y.prototype={constructor:Z,count:O,each:P,eachAfter:j,eachBefore:L,sum:z,sort:F,path:H,ancestors:V,descendants:W,leaves:U,links:$,copy:X};var ee="$",te={depth:-1},ne={};function re(e){return e.id}function ie(e){return e.parentId}function oe(){var e=re,t=ie;function n(n){var r,i,o,a,s,l,u,c=n.length,h=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=h[i]=new Z(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u=ee+(s.id=l)]=u in f?ne:s);for(i=0;i<c;++i)if(s=h[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f[ee+l]))throw new Error("missing: "+l);if(a===ne)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=te,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(J),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Q(t),n):e},n.parentId=function(e){return arguments.length?(t=Q(e),n):t},n}function ae(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=ae(n,i[s]);Array.isArray(l)?a.push.apply(a,f(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=ae(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function se(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,f(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,f(se(e[o].children,t-1,n)));return r}function le(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return se(e.children,i-1,n)}}return!1}function ue(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var ce=/^qDimensionInfo(?:\/(\d+))?/,he=/^\/?qMeasureInfo\/(\d+)/,fe=/\/qAttrExprInfo\/(\d+)/,de=/\/qAttrDimInfo\/(\d+)/;function pe(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}function me(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function ge(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,h=n.qEffectiveInterColumnSortOrder,f=me(n);return ce.test(c)&&(i=!0,o=+ce.exec(c)[1],c=r.replace(ce,"")),he.test(c)&&("K"===n.qMode?l=+he.exec(c)[1]:h&&-1!==h.indexOf(-1)?(l=+he.exec(c)[1],u=0):u=+he.exec(c)[1],c=c.replace(he,"")),c&&(de.exec(c)?s=+de.exec(c)[1]:fe.exec(c)&&(a=+fe.exec(c)[1])),{fieldDepth:(i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function ye(e,t){var n,r,i=le(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(e){var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ve(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function be(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,h=void 0;l.fields&&(c=[],h=[]);for(var f=function(e){var n=u[e],f=void 0,d=void 0,p=void 0,m=void 0,g=void 0,y=void 0;if("primitive"===n.type?(p=n.value,y=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(d=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(p=g.map(f),f=null),d&&(y=g.map(d),d=null),p=n.reduce?n.reduce(p):p,y=n.reduceLabel?n.reduceLabel(y,p):String(p)):y=p=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(p=i,y=i)),l.fields){var v=f?f(p):p;c.push(v),h.push(d&&null!=y?d(y):null!=y?y:String(v))}else{var b=f?f(p):p;o[t[s]]={value:b,label:d?d(y):null!=y?y:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},d=0;d<u.length;d++)f(d);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(h,r):h})}}var xe=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ae(r,e);return o&&o[0]?(t.tree=Y(o[0],n.children||function(e){return e[i]}),t.tree):null};function we(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=pe(e),i=e.fields(),o=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),a=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),s={__root:{__id:"__root",qValues:[]}},l=0;l<t.length;l++){for(var u=t[l],c="__root",h=!1,f=0;f<o.length;f++){var d,p=u[o[f]],m="".concat(c,"__").concat(null!==(d=p.qElemNumber)&&void 0!==d?d:p.qElemNo);s[m]||(s[m]=n({__id:m,__parent:c,qValues:[]},p),h=!0),c=m}if(h)for(var g=0;g<a.length;g++){var y=u[a[g]];s[c].qValues.push(y)}}var v=Object.keys(s).map((function(e){return s[e]}));return oe().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(v)}var qe=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var h=u[c];if(h.field!==a){var f=ye(o,ge(h.field,{cube:r,cache:i}));h.accessor=f.nodeFn,h.valueAccessor=f.valueFn,h.attrAccessor=f.attrFn}}};function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t.raw(),a=t.key(),s="S"===o.qMode?we(t):xe(o,r,e);if(!s)return null;for(var l=s.height,u=[],c=0;c<=l;c++){var h=null;if(c>0)if("S"===o.qMode){var f=me(o)[c-1];h=r.fields[f]}else{var d=o.qEffectiveInterColumnSortOrder[c-1];c>o.qEffectiveInterColumnSortOrder.length&&(d=o.qDimensionInfo.length),h=r.fields[d]}var p=i.normalizeConfig(n(n({},e),{},{field:h?h.key():void 0}),t),m=p.props,g=p.main,y=Object.keys(m);u[c]={propsArr:y,props:m,main:g};var v=h?ge(h,{cube:o,cache:r}):{fieldDepth:0};qe({propsArr:y,props:m,cube:o,cache:r,itemDepthObject:v,f:h})}for(var b=s.copy().descendants(),x=s.descendants(),w=0;w<x.length;w++){var q=u[x[w].depth].propsArr,M=u[x[w].depth].props,D=u[x[w].depth].main,k=b[w],S=k.data,_=ve(D,S,{key:a});be({propsArr:q,props:M,item:k,itemData:S,ret:_,sourceKey:a,isTree:!0}),x[w].data=_}return s}function De(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){var l=t.raw(),u=t.key();if(!xe(l,n,e))continue;var c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),h=i.normalizeConfig(o[s],t),d=h.props,p=h.main,m=Object.keys(d),g=ge(c,{cube:l,cache:n}),y=ye({fieldDepth:0},g),v=y.nodeFn,b=y.attrFn,x=y.valueFn;qe({propsArr:m,props:d,cube:l,cache:n,itemDepthObject:g,f:c});for(var w=!!o[s].trackBy,q=r(o[s].trackBy),M={},D=[],k=v(n.tree),S=[],_=0;_<k.length;_++){var C=k[_],E=b?b(x(C)):x(C);if(!p.filter||p.filter(E)){var A=ve(p,E,{key:u});be({propsArr:m,props:d,item:C,itemData:E,ret:A,sourceKey:u}),w&&i.track({cfg:o[s],itemData:E,obj:A,target:D,tracker:M,trackType:q}),S.push(A)}}var T=w?i.collect(D,{main:p,propsArr:m,props:d}):S;a=[].concat(f(a),f(T))}return a}function ke(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var Se=ke((function(e){
|
|
40
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Ib(Rb={exports:{}}),Rb.exports);function Ob(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Pb={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Lb=/%$/,jb=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,zb=/^\(oct\)/i,Fb=/^\(dec\)/i,Hb=/^\(hex\)/i,Bb=/^\(bin\)/i,Vb=/^\(rom\)/i,Wb=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ub=/#|0/g;function $b(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Yb(e,t,n){var r=Ob(e);return n?r:new RegExp(r||"",t)}function Xb(e,t,n){var r,i,o,a,s,l,u,c,h,d,f,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),d=t,(f=n)&&(f=Ob(f)),d&&(d=Ob(d)),h=new RegExp("(?:[#0]+".concat(d,")?[#0]+(?:").concat(f,"[#0]+)?")),a=(o=(o=p.match(h))?o[0]:"")?p.substr(0,p.indexOf(o)):p,s=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(Yb(l,"g"),t)),u=n,n=".",u&&(o=o.replace(Yb(u,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var m,g=p.split(u);g[1]&&(m=g[1].match(Ub)),e.prefix=a||"",e.postfix=s||"",e.pattern=p,e.maxPrecision=m?m.length:2,e.percentage=Lb.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(Yb(t,null,!0),"|").concat(Yb(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=n,e.temp=c}!function(){function e(t,n,r,i,o){qb(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Pb;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}Db(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Wb.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Wb.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Wb.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||Xb(r.positive,t,n),r.negative&&!r.negative.isFunctional&&Xb(r.negative,t,n),r.zero&&!r.zero.isFunctional&&Xb(r.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return jb.test(t)?e=$b(e,Number(/\d{2}/.exec(t)[0]),t,n):zb.test(t)?e=$b(e,8,t,n):Fb.test(t)?e=$b(e,10,t,n):Hb.test(t)?e=$b(e,16,t,n):Bb.test(t)?e=$b(e,2,t,n):Vb.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Nb(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Nb(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var Kb=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Gb=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Jb=["January","February","March","April","May","June","July","August","September","October","November","December"],Zb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Qb(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function ex(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,r){qb(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Kb,qDayNames:Gb,qLongMonthNames:Jb,qMonthNames:Zb}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(Sb(i={},"T",o.qTimeFmt||"hh:mm:ss"),Sb(i,"D",o.qDateFmt||"YYYY-MM-DD"),Sb(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}Db(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(r=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=r.getUTCDay()-1)<0&&(a=6),n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:a,date:r.getUTCDate(),h:o,m:r.getUTCMinutes(),s:r.getUTCSeconds(),f:r.getUTCMilliseconds(),t:r.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,r=function(e){var t=e,n=24*ex(t),r=60*ex(n),i=60*ex(r),o=1e3*ex(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Qb("".concat(t.year).slice(-2),2),YYY:Qb("".concat(t.year).slice(-3),3),def:function(e){return Qb("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Qb("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Qb("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Qb("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Qb("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Qb("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Qb("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var h=new RegExp(u.join("|"),"g"),d=t.replace(h,(function(e){var t,n,r;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in l[n])if(i===e||i.toLowerCase()===e){void 0===(r=l[n][i])&&(r=l[n][i.toLowerCase()]);break}return void 0===r&&(r=l[n].def),"function"==typeof r&&(r=r(e)),r}));return d}}])}();const tx=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,nx=function(){};function rx(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}nx.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&tx.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},rx.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new rx(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new rx(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new rx(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new rx(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new rx(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const ix=new rx(0,0,0,0),ox=new rx(0,0,0,0),ax=nx.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ox.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=ox.intersection(ix,!0),r.push({coverage:i?i.clone():new rx(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length},_extract(e,t){ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),ox.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=ix.intersection(ox,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map((e=>e.slice(i,i+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let sx;function lx(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function ux(e,t,n){let r,i,o;const a=[];let s=[],l=0,u=0;for(n.length&&(l=n[0].qUp||0,u=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(s=ux(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&sx>=e&&sx<=e+t||s.length>0)&&(o=lx(i,a),void 0!==o.qUp&&1===a.length&&(o.qUp=l+r),o.qSubNodes=s),0===i.qSubNodes.length&&sx++,sx===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return a}function cx(e,t,n){return sx=0,ux(e,t,n)}const hx=new rx(0,0,0,0),dx=new rx(0,0,0,0),fx=ax.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,hx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),dx.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=dx.intersection(hx,!0),r.push({coverage:i?i.clone():new rx(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){hx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),dx.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=hx.intersection(dx,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map((e=>e.slice(i,i+n.width)));return{qLeft:cx(r,n.height,t.qLeft),qTop:cx(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function px(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new fx;else{if("table"!==e.visualization)return;this.slicer=new ax}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class mx{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,px.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=xb(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const gx={version:"0.37.2",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function yx(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function vx(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function bx(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){yx(t),vx(t)},moved(e,t){yx(t),vx(t)},removed(e,t){yx(t),vx(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var xx={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(h,n),h!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(h,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(h,{name:n,newValue:i}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(h,n),h!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(h,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(h,{name:n,newValue:i}));return h}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var h=c(r[0],i),d=c(r[1],i),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var M=i.a.bind(null,!0),D={},S=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function _(e){return void 0===e}function C(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=_(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){A(e[r],t[r])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||C(t,i)||(_(a)?r.push({op:"add",path:s,value:o}):k(o)&&k(a)?r=r.concat(D.generate(a,o,s)):S(o)&&S(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&_(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!_(t[0])&&_(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){_(t[i])&&!C(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},D.apply=function(e,t){t.forEach((function(t){var n,r=E(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(k(o)&&k(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!C(n,e)&&delete n[e]})),M(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=E(e,t.from);S(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},D.clone=function(e){return M({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):M(e,t)};var T=D,I=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},R="accumulation";function N(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function O(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,c,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(O(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(O(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(O(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(O(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=N(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=N(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(O(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=N(t,e);return o&&!o.disabled}};return n}},j="movingAverage";function z(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function F(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(r,u),p=w.getAboveComp(r,u,d,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var v=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(F(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=w.getAboveComp(n,l,c),d="".concat(c," - ").concat(h);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(u,1),p=w.getDimComp(u,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(U(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}};return n}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),h=ae(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(h," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var de={accumulation:L,movingAverage:B,difference:Y,normalization:se},fe=(t.default={modifiers:de,apply:pe,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ce({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===he(n))return me({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var h=a(u,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return _e({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:u,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ce({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Me(n);var r=Ne(n);return Ee({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(_e({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===he(e)&&!e.disabled){if(n++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===he(e.base)}))}(h)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ne(n);return Oe({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Ie({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Me(r);var d=Ne(r);return Oe({model:t,libraryIds:d,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ne(n);return Ee({model:r,dimensionAndFieldList:s}).then((function(e){return Ae({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ce({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===he(e)&&!e.disabled){if(s++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=de[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=de[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&!de[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,De(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({modifiers:we(e),properties:n,layout:r})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(de[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function qe(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Me(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&qe(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function De(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===he(t)&&(t.disabled||!de[t.type]&&qe(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function ke(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function _e(e){var t=e.measure,n=e.properties,r=e.layout;return!ke(t)&&Ce({modifiers:we(t),properties:n,layout:r})}function Ce(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===i[e.type]&&(i[e.type]=de[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ie(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===he(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ne(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ce({modifiers:r,properties:e})){var o=ke(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Oe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function q(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var k={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=q(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=D(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function _(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var C={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(m(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(m(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(m(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=k.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=k.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,D=l.defaultDimension,S=void 0===D?k.getDefaultDimension():D,C=l.defaultMeasure,E=void 0===C?k.getDefaultMeasure():C;v.qDimensions.length=0,v.qMeasures.length=0,k.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&k.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),k.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),k.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),k.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),k.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),k.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),k.copyPropertyIfExist("qMaxStackedCells",y,v),k.copyPropertyIfExist("qNoOfLeftDims",y,v),k.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),k.copyPropertyOrSetDefault("qMode",y,v,"S"),k.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),k.copyPropertyOrSetDefault("qSortbyYValue",y,v),k.copyPropertyOrSetDefault("qIndentMode",y,v),k.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),k.importCommonProperties(g,t,r),m.qProperty=g;var A=o.getValue(c||{},"support.modifiers");return k.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&_(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&_(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function T(e,t){return e.length!==t}var I={create:function(e,t){if(!e||!E[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(A(a,t,r,i),T(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},R={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},N={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},O={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:O,"sn-scatter-plot":O,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function j(e,t){var n=I.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function F(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;j(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=R.getItemLabel(t);switch(z(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;F({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;F({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||N).colorModeOptions||N.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=C.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=I.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(a,[],"qAttributeDimensions",u),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=C.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),h=c.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=Y.getCanColorBy(h,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:h})&&Y.addColorByExpression(h):Y.switchToAutoColor(h),y&&Y.updateColorBy(h,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(h)&&Y.changeProperty(h,"color.persistent",!0),Y.deleteTotalMode(f),c}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?_(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):_(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),K.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(m(s,"measureAxis.min","supportedAutoMinMax"),m(s,"measureAxis.max","supportedAutoMinMax")):(m(s,"measureAxis.min","unsupportedAutoMinMax"),m(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),h=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:a}),G.setInterColumnSortOrder(h.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:C,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:_,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(xx);var wx=n(xx.exports);const qx=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Mx(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var Dx={importColors:function(e){e.color.point=e.color.point||{},Mx(e.color,e.color.point,qx),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Mx(e.color.point,e.color,qx),e.color.colorExpression=xb(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Sx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=wx.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),Dx.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function kx({propertyTree:e,viewDataMode:t}){const n=wx.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Dx.exportColors(e.qProperty),n}var _x=e=>{const t=bx(e);return{properties:gx,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Sx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:kx}},Cx=Object.prototype.hasOwnProperty,Ex=Object.prototype.toString,Ax=Object.defineProperty,Tx=Object.getOwnPropertyDescriptor,Ix=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ex.call(e)},Rx=function(e){if(!e||"[object Object]"!==Ex.call(e))return!1;var t,n=Cx.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Cx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Cx.call(e,t)},Nx=function(e,t){Ax&&"__proto__"===t.name?Ax(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ox=function(e,t){if("__proto__"===t){if(!Cx.call(e,t))return;if(Tx)return Tx(e,t).value}return e[t]},Px=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Ox(s,n),s!==(i=Ox(t,n))&&(c&&i&&(Rx(i)||(o=Ix(i)))?(o?(o=!1,a=r&&Ix(r)?r:[]):a=r&&Rx(r)?r:{},Nx(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Nx(s,{name:n,newValue:i}));return s};const Lx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const jx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(zx(o,!0),i);return a},createRegExp:zx};function zx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Fx={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Lx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=Hx(t,i,e);n[t]=r}))}return jx.replaceExpressionTokens(e,n)}};function Hx(e,t,n){if(""===t)return"";const r=jx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Bx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach((e=>{o=Yx(e.match($x("Dim"))),o.forEach((e=>{s.push(Vx(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=Yx(e.match($x("Mea"))),a.forEach((e=>{s.push(Wx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=s.length?Promise.all(s).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=Px({},n,i),o=Px(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Fx.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Fx.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>Vx(e,n,r,t))),i=e.qMeasures.map((e=>Wx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Vx(e,t,n,r){if(e.qLibraryId)return Ux(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Wx(e,t){return e.qLibraryId?Ux(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Ux(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function $x(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Yx(e){return e?e.map((e=>e.substr(6,1))):[]}function Xx(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Kx={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:Xx,invertedEnumConvertFunctions:function(e){return Xx((function(){return!e||!e()}))}};const Gx=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Jx(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Gx,convertFunctions:n.sorting,show:t=>0!==xb(t,e,0)}}}}var Zx={state:function(e,t){return Jx(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Kx.booleanConvertFunctions(t),sorting:Kx.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Jx(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Kx.booleanConvertFunctions(t),sorting:Kx.enumConvertFunctions(t)})},numeric:function(e,t){return Jx(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Kx.booleanConvertFunctions(t,-1),sorting:Kx.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Kx.booleanConvertFunctions(t),sorting:Kx.enumConvertFunctions(t)},r=Jx(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==xb(t,e,0)},r},frequency:function(e,t){return Jx(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Kx.booleanConvertFunctions(t),sorting:Kx.invertedEnumConvertFunctions(t)})}};const Qx={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function ew(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(Qx);const tw={hasMultipleDimensions:ew,getOuterDimensionCardinality:function(e){const t=xb(e,Qx.HYPERCUBE_PATH);return ew(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return xb(e,Qx.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==xb(e,`${Qx.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==xb(e,`${Qx.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==xb(e,`${Qx.SORT_CRITERIA}.sortByAscii`,0)}},nw={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var rw={create(e,t){if(!e||!nw[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach((e=>{n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter((e=>e[n]===t))[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach(((e,i)=>{e[n]===t&&(r=i)}))),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),a=i.filter((e=>!(o.filter((t=>t[r]===e[r])).length>0)));return[...t,...a]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const a=e[o][n],s=t.length;if(this.moveById(a,t,r,i),s!==t.length)return t}return t},clean:e=>e.filter((e=>e&&e.id)),IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}};var iw={getColorByDefinition:function(e,t,n){const r={};let i,o,a;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,a=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:a?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var ow={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const aw=["scatterplot","map"],sw=["map"];var lw={baseColor:{isSupported:e=>e&&e.length&&-1===aw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==sw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=xb(n,"mode"),i=xb(n,"auto"),o=xb(e,`${t}qDimensions`,[]),a=xb(e,`${t}qMeasures`,[]);let s,l,u,c;if(!i&&"byDimension"===r&&o.length)s=xb(n,"byDimDef"),s&&pw(n,s.label),s&&s.activeDimensionIndex>-1?(s.activeDimensionIndex=Math.min(s.activeDimensionIndex,o.length-1),l=o[s.activeDimensionIndex],c=iw.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=s.activeDimensionIndex,dw(n,c)):s&&s.key||(l=o[o.length-1],u=rw.getById(l.qAttributeDimensions,rw.IDMAP.COLOR_BY_ALTERNATIVE),dw(n,iw.getColorByDefinition("dimension",!!u,u||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&a.length<2&&wb(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=xb(n,"mode"),i=xb(n,"auto"),o=xb(e,`${t}qDimensions`,[]),a=xb(e,`${t}qMeasures`,[]),s=xb(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?fw(n,!0,o,s,a,xb(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?fw(n,!1,o,s,a,xb(n,"byMeasureDef.label")):uw(o,s)},setColorByPropertyDef:dw,resolveColorByPropertyDef:fw,clearColorByItem:uw};function uw(e,t){e.forEach((e=>{cw(e,rw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),cw(e,rw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{cw(e,rw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),cw(e,rw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function cw(e,t,n){if(e[n]){const r=rw.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function hw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function dw(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(pw(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||hw(t.name),key:hw(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&ow.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function fw(e,t,n,r,i,o){uw(n,r);const a=n[n.length-1];if(a){const n=xb(e,t?"byDimDef":"byMeasureDef"),r=xb(e,"formatting.qNumFormat"),s=xb(e,"formatting.isCustomFormatted");if(n){const e=rw.create(rw.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=s));break;case"libraryItem":if(!t){let t=-1;i.forEach(((e,r)=>{n.key===e.qLibraryId&&(t=r)})),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=s)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},a.qAttributeDimensions.push(e)):a.qAttributeExpressions.push(e)}}}function pw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function mw(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function gw(e){return"libraryItem"===xb(e,"color.point.byDimDef.type")}function yw(e){return"libraryItem"===xb(e,"color.point.byMeasureDef.type")}function vw(e){return!0===xb(e,"color.point.auto")}function bw(e){return!vw(e)&&"byDimension"===xb(e,"color.point.mode")}function xw(e){return!vw(e)&&"byMeasure"===xb(e,"color.point.mode")}var ww={measuresHasBaseColors:function(e){return xb(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!mw(e))).length>0},dimensionsHasBaseColors:function(e){return xb(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!mw(e))).length>0},onGlobalChangeColors:function(e){lw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)},isColorByDimension:bw,isColorByMeasure:xw,isColorAuto:vw,isColorByExpression:function(e){return!vw(e)&&"byExpression"===xb(e,"color.point.mode")},isColorBySingle:function(e){return!vw(e)&&"primary"===xb(e,"color.point.mode","primary")},isDimensionLibraryItem:gw,isMeasureLibraryItem:yw,showLegend:function(e){const t=xb(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===vw(e)},showColorByLabel:function(e){const t=bw(e)&&!1===gw(e),n=xw(e)&&!1===yw(e),r=xb(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){var n,r,i;return null===(n=null===(r=e.layout.qHyperCube.qDimensionInfo[t])||void 0===r||null===(i=r.coloring)||void 0===i?void 0:i.hasValueColors)||void 0===n||n}};function qw(e,t){this.getSettings=e,this.getElements=t}function Mw(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();wb(n,"qSortByExpression",r.SORT_BY_EXPRESSION),wb(n,"qSortByAscii",r.SORT_BY_ASCII),wb(n,"qSortByNumeric",r.SORT_BY_NUMERIC),wb(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Dw(this.getElements());n.qExpression.qv=i.exp}function Dw(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}qw.prototype.applyAutoSorting=Mw,qw.prototype.applyDefaultCustomSorting=function(e,t){Mw.call(this,e);const n=Dw(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},wb(t.sortCriteria,"sortByExpression",r.qSortByExpression),wb(t.sortCriteria,"sortByAscii",r.qSortByAscii),wb(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),wb(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},qw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(wb(n,"qSortByExpression",t.sortCriteria.sortByExpression),wb(n,"qSortByAscii",t.sortCriteria.sortByAscii),wb(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),wb(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter((e=>e.id===t));0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Sw={create:function(e,t){return new qw(e,t)}};const kw={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const _w={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(_w.ASCII),Object.freeze(_w);const Cw=Px(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},_w);const Ew={getSettings:function(e){return xb(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Cw.DIST_MAX:Cw.ASCII}};function Aw(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Lx.wrapExpression(t):"",a=n?Lx.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,a).replace(/{{<outerDimString>}}/g,n?`<${a}>`:"").replace(/{{outerDimString,}}/g,n?`${a},`:"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const Tw={getElementIds:function(){return[Qx.SORTING_ELEMENT_MIN_ID,Qx.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],a=e[0],s=Aw(0,i,o,a),l=Aw(1,i,o,a);return[{id:Qx.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:s,isDefault:Qx.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:Qx.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:Qx.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Aw};function Iw(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Rw(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Ew.getSettings(t)},a=Sw.create(o,(function(){const e=o();return Tw.getElements(n.measures,n.dimensions,e,r)})),s=i[0],l=e.sorting;kw.applySorting(a,s,l)}const Nw={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Iw("'qHyperCubeDef.qDimensions' has no outer dimension"):Iw("no 'qHyperCubeDef.qMeasures' in properties arg"):Iw("no 'qHyperCubeDef.qDimensions' in properties arg"):Iw("no 'qHyperCubeDef' in properties arg")}(e),r?Rw(e,t,r,i):Bx.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Rw(e,t,n,i)}))}},Ow=`${Qx.SORT_CRITERIA}.sortByExpression`;const Pw={updateSortOrder:function(e,t){if(!t)return;const n=xb(e,Ow);if(!(-1===n||1===n))return;const r=xb(e,Qx.SORTING_ELEMENT_ID),i=xb(t,Qx.SORTING_ELEMENT_ID),o=r===Qx.SORTING_ELEMENT_MAX_ID,a=r===Qx.SORTING_ELEMENT_MIN_ID&&i===Qx.SORTING_ELEMENT_MAX_ID,s=o&&(!!!i||i===Qx.SORTING_ELEMENT_MIN_ID),l=xb(t,Ow),u=o&&!(-1===l||1===l)&&1===n;a?wb(e,Ow,1):(s||u)&&wb(e,Ow,-1)}},Lw=e=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e});function jw(e){return!xb(e,"color.point.auto")&&"byDimension"===xb(e,"color.point.mode")&&xb(e,"qHyperCubeDef.qMeasures.length",0)<=1}function zw(e){const{flags:t,translator:n}=e,r=e.anything.sense.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),a=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),s={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!xb(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Qx.CHART_ID,"box","fill");return a(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!xb(e,"color.point.auto",!0)&&"primary"===xb(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return a(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!xb(e,"color.point.auto")&&"byExpression"===xb(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},u={type:"items",translation:"properties.presentation",items:{styleEditor:i&&Lw(o),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};u.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:Qx.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},u.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const c={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxis)||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(wb(i,"measureAxis.autoMinMax",!1),wb(i,"measureAxis.minMax","min"),wb(i,"measureAxis.min",0)):wb(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},h={uses:"axis.picasso.dimensionAxis",show:(e,t)=>xb(t.layout,`${Qx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>xb(t.layout,`${Qx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>xb(t.layout,`${Qx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==xb(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>xb(t.layout,`${Qx.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function d(e,t){const n=xb(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const f=(e,t)=>{var n,r,i;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,a,s,l,u;const n=null!==(o=null===(a=e.color.point.byDimDef)||void 0===a?void 0:a.key)&&void 0!==o?o:"",r=null!==(s=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(u=l.qHyperCube)||void 0===u?void 0:u.qDimensionInfo)&&void 0!==s?s:[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(r=null===(i=e.color.point.byDimDef)||void 0===i?void 0:i.label)&&void 0!==r?r:""},p=(e,t,r)=>{var i,o;if(null!==(i=e.qHyperCubeDef)&&void 0!==i&&null!==(o=i.qDimensions)&&void 0!==o&&o.length){var a,s,l,u,c;const t=null===(a=e.qHyperCubeDef)||void 0===a?void 0:a.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(s=null===(l=e.color)||void 0===l||null===(u=l.point)||void 0===u||null===(c=u.byDimDef)||void 0===c?void 0:c.activeDimensionIndex)&&void 0!==s?s:-1)<0&&t.push({value:-1,label:f(e,r)}),t}return[]},m=(e,t)=>{const n="measure"===xb(e,"color.point.useBaseColors")&&ww.measuresHasBaseColors(t),r="dimension"===xb(e,"color.point.useBaseColors")&&ww.dimensionsHasBaseColors(t);return ww.isColorBySingle(e)&&!n&&!r},g=(e,t)=>!xb(e,"color.point.auto",void 0)&&"primary"===xb(e,"color.point.mode",void 0)&&!m(e,t),y={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&g(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!g(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>xb(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{xb(e,"color.point.auto")||(wb(e,"color.point.mode","primary"),wb(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===xb(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!ww.isColorAuto(e),change(e){if("primary"===xb(e,"color.point.mode",void 0)){const t=xb(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&wb(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:p,show:(e,t,n)=>ww.isColorByDimension(e)&&p(e,0,n).length>1,change(e){d(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const r=xb(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!ww.isColorAuto(e)&&"primary"===r&&(ww.measuresHasBaseColors(n)||ww.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:m},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,r){var i,o,a;const s=null!==(i=null===(o=e.color.point)||void 0===o||null===(a=o.byDimDef)||void 0===a?void 0:a.activeDimensionIndex)&&void 0!==i?i:null,l=ww.hasDimValueColors(r.handler,s);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&ww.isColorByDimension(e)&&ww.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Qx.CHART_ID,"box","fill");return a(e)},show:e=>!xb(e,"color.point.auto",!0)}}}}},v={uses:"colorsAndLegend",items:{colors:{globalChange:ww.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),xb(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!ww.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>ww.isColorByDimension(e),change(e){d(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>ww.isColorByMeasure(e),change(e){d(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:ww.showColorByLabel,change(e){const t=xb(e,"color.point.mode"),n=xb(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=xb(e,"color.point.mode","primary");return!ww.isColorAuto(e)&&"primary"===n&&(ww.measuresHasBaseColors(t)||ww.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!xb(e,"color.point.auto")&&"byMultiple"===xb(e,"color.point.mode")&&"measure"===xb(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&ww.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===xb(e,"color.point.useBaseColors")&&ww.measuresHasBaseColors(t),r="dimension"===xb(e,"color.point.useBaseColors")&&ww.dimensionsHasBaseColors(t);return ww.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>ww.isColorByDimension(e)&&ww.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=xb(e,"color.point.auto"),n=xb(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===xb(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>xb(e,"color.point.auto")||"byDimension"!==xb(e,"color.point.mode")||"libraryItem"!==xb(e,"color.point.byDimDef.type")?jw(e):jw(e)&&!xb(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!ww.isColorAuto(e)&&ww.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!ww.isColorAuto(e)&&ww.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>ww.isColorByDimension(e)&&(!ww.isDimensionLibraryItem(e)||!xb(e,"color.point.useDimColVal"))},customRange:{show:e=>!ww.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>ww.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>ww.isColorByMeasure(e)&&!1===xb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===xb(e,"color.point.minMax")&&xb(e,"color.point.measureMin")>=xb(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>ww.isColorByMeasure(e)&&!1===xb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===xb(e,"color.point.minMax")&&xb(e,"color.point.measureMin")>=xb(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>ww.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(Qx.CHART_ID,"box","fill");return a(e)},show:e=>!xb(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:ww.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>ww.showLegend(e)&&xb(e,"legend.show",!0)},showTitle:{show:e=>ww.showLegend(e)&&xb(e,"legend.show",!0)}}}}},b={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},x={uses:"settings",items:{simpleLabels:b,general:l,presentation:u,colors:v||s,measureAxis:c,dimensionAxis:h}},w={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:ww.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},q=Zx.expression(`${Qx.SORT_CRITERIA}.sortByExpression`),M={type:"items",items:{toggled:q.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:Qx.SORTING_EXPRESSION,elementRef:Qx.SORTING_ELEMENT_ID,show:tw.isSortByExpression,elements:e=>Bx.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const r=Ew.getSettings(e.layout);return Tw.getElements(t.measures,t.dimensions,r,n)}))},order:q.items.order}},D={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Pw.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:Qx.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:tw.hasMultipleDimensions,change(e,t,r,i){if(e&&tw.hasMultipleDimensions(e)&&t.layout)return Nw.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:Qx.SORTING_EXPRESSION,elementRef:Qx.SORTING_ELEMENT_ID,sortCriteriasRef:Qx.SORT_CRITERIA,show:e=>tw.hasMultipleDimensions(e)&&!tw.isAutoSort(e),elements:e=>Bx.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const r=Ew.getSettings(e.layout);return Tw.getElements(t.measures,t.dimensions,r,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>tw.hasMultipleDimensions(e)&&!tw.isAutoSort(e),items:{expression:M,numeric:Zx.numeric(`${Qx.SORT_CRITERIA}.sortByNumeric`),ascii:Zx.ascii(`${Qx.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!tw.isSortByExpression(e)&&!tw.isSortByNumeric(e)&&!tw.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!tw.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:D,addons:w,settings:x}}}const Fw={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,a={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>xb(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,a){const s=a.layout;let l=Hw(e,o).chart;l||(l="sortByAscii");const u=xb(e,t);if(u.sortCriteria||(u.sortCriteria={}),u.autoSort){const t=r(s);if(t.ELEMENT)u.elementId=t.ELEMENT;else{const t=i(e,s);u.elementId=t[0]}}u.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(u,l),u.sortCriteria[l]=n},getValue(e){const t=Hw(e,o).dimension;return t?xb(e,o+t):0}}}};return a}};function Hw(e,t){const n={chart:"",dimension:""};return 0!==xb(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==xb(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==xb(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Bw={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Fw.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Ew.getSettings,Tw.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Vw={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>ww.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>ww.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>ww.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:ww.showLegend}}}}};function Ww(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:zw(e),softDefinition:Bw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){ww.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=bx(e);r.mapProperties();return Sx({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>kx({propertyTree:e,viewDataMode:n})}}Px(!0,Bw,Vw);const Uw={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function $w(){return Uw.id()}const Yw="scrollbar";function Xw(e,t,n){return"y"===e?Kw(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Kw(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var Gw={getAxisDock:Xw,getOppositeAxisDock:function(e,t,n){return Xw(e,"far"===t?"near":"far",n)},getYAxisDock:Kw};const Jw=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Zw=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Qw=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function eq(e){return Jw.test(e)}function tq(e){return Zw.test(e)||Qw.test(e)}var nq={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],eq(r))return"ltr";if(tq(r))return"rtl"}return"ltr"}};var rq={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Px(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Px(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${nq.lrm}(${n})${nq.lrm}`:`${nq.lrm}(${n})${nq.lrm}`:!1!==e.showLabel?t:""}};const iq={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:-10},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};iq.DEFAULT_CHART_ORIENTATION=iq.HORIZONTAL;function oq(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||iq.DEFAULT_CHART_ORIENTATION,a=o===iq.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=iq.SHOW_AXIS_LABELS_OPTIONS,c=iq.SHOW_TITLE_OPTIONS,h=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Px(i,iq.LAYOUTSETTINGS.measureAxis);const o=sq(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText};r=Px(r,iq.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return sq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Px(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension"};r=Px(r,iq.LAYOUTSETTINGS.dimensionAxis);const i=lq(t,n);Px(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText};r=Px(r,iq.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return lq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===iq.HORIZONTAL?iq.VERTICAL:iq.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Px(r,iq.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=Px({},iq.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),aq(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Yw))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Yw).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Yw).emit("panStart",e)},pan(e){this.chart.component(Yw).emit("panMove",e)},panend(e){this.chart.component(Yw).emit("panEnd",e)},pancancel(e){this.chart.component(Yw).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=Gw.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Px(o,iq.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${$w()}`,require:["renderer","chart"],dock:Gw.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=Px(a,iq.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=Px(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=rq.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=rq.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",iq.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Px(o,iq.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,lq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Px(o,iq.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,sq(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Px(o,iq.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,lq(n,l).dock,n.isRtl)}n.brushActions&&aq(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function aq(e,t){t.forEach((t=>{e.push(t)}))}function sq(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function lq(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function uq(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Px(!0,{},o,e||{})}function cq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:Gw.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},p=Px(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function hq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:Gw.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return Px(!0,{},u,e||{})}uq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=uq(Px(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},uq.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return uq(Px(!0,n,e||{}),t)},cq.xAxis=function(e,t){return cq(Px(!0,{key:"x-axis",scale:"x"},e||{}),t)},cq.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:Gw.getYAxisDock(n,r)};return cq(Px(!0,i,e||{}),t)},hq.xAxisTitle=function(e,t){return hq(Px(!0,{key:"x-axis-title"},e||{}),t)},hq.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:Gw.getYAxisDock(n,r)||"left"};return hq(Px(!0,i,e||{}),t)};var dq={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const fq={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function pq(){return fq}function mq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}pq.getLayoutModeKeys=function(){const e=[];let t;for(t in fq)e.push(t);return e};const gq={left:"left",right:"right",up:"top",down:"bottom"};function yq(e,t,n){switch(e){case"scale":return uq(t,n);case"measure-scale":return uq.measureScale(t,n);case"dimension-scale":return uq.dimensionScale(t,n);case"axis":return cq(t,n);case"box-marker":return function(e){return Px(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Px(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Px(!0,{},o,e||{})}(t,n);case"text":return hq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),Px(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:dq.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:dq.getBublesAlign(a,s,l)}}};return Px(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:dq.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:dq.getBublesAlign(s,l,u),label:e=>h?(h=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Px(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),h={key:"legend",type:"legend-cat",dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${gq[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:t.theme.getStyle(n,"legend.label","fontFamily"),fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return Px(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return Px(!0,{},d,e)}(t,n);case"x-axis":return cq.xAxis(t,n);case"y-axis":return cq.yAxis(t,n);case"x-axis-title":return hq.xAxisTitle(t,n);case"y-axis-title":return hq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Px(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Px(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Px(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Px(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o={key:"labels",type:"labels",displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:t.theme.getStyle(n,"label.value","fontFamily"),fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:mq}]}}}]}};return Px(!0,{},o,e||{})}(t,n);default:return}}function vq(e){this.options=e||{},this.settings={dockLayout:{layoutModes:pq()},components:[],scales:{}}}vq.prototype.addComponent=function(e,t,n){const r=yq(e,t,Px(!0,{},this.options,n||{}));return this.settings.components.push(r),r},vq.prototype.addInteraction=function(e,t){const n=yq("interaction",e,Px(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},vq.prototype.addScale=function(e,t,n){const r=yq(e,t,Px(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},vq.prototype.getSettings=function(){return this.settings},vq.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},vq.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");oq(t,n)}(e,this,t)},vq.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},vq.create=function(e){return new vq(e)},vq.createComponent=yq;const bq={CENTER:0,BOTTOM:1};var xq={DISCLAIMERS:[{label:"NoDataExist",alignment:bq.CENTER,default:!0},{label:"RequireNumericDimension",alignment:bq.CENTER,default:!1},{label:"OnlyNanData",alignment:bq.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:bq.CENTER,default:!1},{label:"LimitedData",alignment:bq.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:bq.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:bq.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:bq.BOTTOM,default:!1}],ALIGNMENT:bq};const wq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,xq.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function qq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Mq(e,t){return e&&t&&t[e]}function Dq(e){this.environment=e,this.clear()}qq.prototype.isValidAndSupported=function(e,t){return Mq(e.label,this.dataAttributes)&&(e.default||Mq(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},qq.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},qq.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},Dq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Dq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Dq.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=Px(!0,{},this.vizAttributes.supportedDisclaimers),i=new qq(xq.DISCLAIMERS,this.dataAttributes,r);let o,a;if(i.isAnyValidDisclaimer(xq.ALIGNMENT.CENTER))o=i.getMessage(xq.ALIGNMENT.CENTER,n),a="center";else{if(!i.isAnyValidDisclaimer(xq.ALIGNMENT.BOTTOM))return;o=i.getMessage(xq.ALIGNMENT.BOTTOM,n),a="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:a},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Dq.prototype.set=function(e){if(this.clear(),!e)throw new Error(Dq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=wq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Dq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Sq=nx.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Dq(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[vq.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),vq.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Px(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:xb(e,t.replace(/\//g,"."))})));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function kq(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const _q={generateHash:function(e){return kq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=_q.generateHash(t)}};const Cq={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Aq(t),dimensionExpressions:Eq(t),measureExpressions:e})))}};function Eq(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Aq(e){const t=function(e){return xb(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Tq={},Iq=Px.bind(null,!0);function Rq(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Nq=Array.isArray,Oq=function(e){return void 0===e};function Pq(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Lq(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Oq(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function jq(e,t){if(Rq(e)&&Rq(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!jq(e[n],t[n]))return!1;return!0}if(Nq(e)&&Nq(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!jq(e[n],t[n]))return!1;return!0}return e===t}Tq.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=Iq({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;jq(o,a)||Pq(t,i)||(Oq(a)?r.push({op:"add",path:s,value:o}):Rq(o)&&Rq(a)?r=r.concat(Tq.generate(a,o,s)):Nq(o)&&Nq(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&Oq(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(jq(t,i))return r;if(null===t[0]||!Oq(t[0])&&Oq(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Tq.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Oq(t[i])&&!Pq(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Tq.apply=function(e,t){t.forEach((t=>{const n=Lq(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Nq(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Nq(i)&&Nq(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Rq(i)&&Rq(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Pq(a,e)&&delete a[e]})),Iq(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Lq(e,t.from);Nq(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Nq(n)?n.splice(+r,1):delete n[r]);var a}))},Tq.clone=function(e){return Iq({},e)},Tq.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Tq.updateObject=function(e,t){Object.keys(e).length?Tq.apply(e,Tq.generate(e,t)):Iq(e,t)};class zq{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Tq.generate(e,t);return Px(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Tq.generate(n,r);Tq.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Fq={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Hq={saveDerivedProperties:function(e,t,n,r){if(Fq.canModifyHardProperties(t))return e.setProperties(n);return new zq(e).saveSoftProperties(r,n)}};var Bq={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Vq(){this._generationInProgress=!1}function Wq(e){Bq.validate(e);const t=e.properties,n=_q.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Vq.prototype.isDerivedUpToDate=Wq,Vq.prototype.updateDerivedProperties=function(e){if(Bq.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Wq(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Px(!0,{},e.properties),o=Px(!0,{},i);return this._generationInProgress=!0,_q.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Hq.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Vq.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Cq.getDefaultHashDataForHyperCube(e,t,n).then((e=>Px(!0,r,e)))};var Uq={exports:{}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return c=u()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&l(i,n.prototype),i},c.apply(null,arguments)}function h(e,t){return p(e)||g(e,t)||y(e,t)||x()}function d(e){return f(e)||m(e)||y(e)||b()}function f(e){if(Array.isArray(e))return v(e)}function p(e){if(Array.isArray(e))return e}function m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}function y(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var w=Object.prototype.hasOwnProperty,q=Object.prototype.toString,M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,S=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===q.call(e)},k=function(e){if(!e||"[object Object]"!==q.call(e))return!1;var t,n=w.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&w.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||w.call(e,t)},_=function(e,t){M&&"__proto__"===t.name?M(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},C=function(e,t){if("__proto__"===t){if(!w.call(e,t))return;if(D)return D(e,t).value}return e[t]},E=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=C(s,n),s!==(i=C(t,n))&&(c&&i&&(k(i)||(o=S(i)))?(o?(o=!1,a=r&&S(r)?r:[]):a=r&&k(r)?r:{},_(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&_(s,{name:n,newValue:i}));return s};function A(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function T(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function I(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,h=r;if(i.field&&i.field!==n){var d=A(i.field,o,{cache:t});if(-1===d)return;h=E({qRow:a},d(s))}u[c]=T(i,h,{key:l})}function R(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){for(var l=t.raw(),u=t.key(),c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),h=i.normalizeConfig(o[s],t),f=h.props,p=h.main,m=Object.keys(f),g=!!o[s].trackBy,y=r(o[s].trackBy),v={},b=[],x=[],w=0;w<l.qDataPages.length;w++){var q=A(c,l.qDataPages[w],{cache:n});if(-1!==q)for(var M=0;M<l.qDataPages[w].qMatrix.length;M++){var D=l.qDataPages[w].qArea.qTop+M,S=E({qRow:D},q(l.qDataPages[w].qMatrix[M])),k=T(p,S,{key:u});if(!p.filter||p.filter(S)){for(var _=0;_<m.length;_++){var C=f[m[_]],R=C.fields||[C];C.fields&&(k[m[_]]=[]);for(var N=0;N<R.length;N++)I({cache:n,f:c,mainCell:S,p:R[N],prop:m[_],props:f,page:l.qDataPages[w],rowIdx:D,row:l.qDataPages[w].qMatrix[M],sourceKey:u,target:C.fields?k[m[_]]:k,targetProp:C.fields?N:m[_]});if(C.fields){var O=k[m[_]].map((function(e){return e.value})),P=k[m[_]].map((function(e){return e.label}));k[m[_]]={value:"function"==typeof C.value?C.value(O):void 0!==C.value?C.value:O,label:"function"==typeof C.label?C.label(P):void 0!==C.label?String(C.label):String(k[m[_]].value)}}}g&&i.track({cfg:o[s],itemData:S,obj:k,target:b,tracker:v,trackType:y}),x.push(k)}}}var L=g?i.collect(b,{main:p,propsArr:m,props:f}):x;a=[].concat(d(a),d(L))}return a}function N(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function O(){return this.eachAfter(N)}function P(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this}function L(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this}function j(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this}function z(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function F(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function H(e){for(var t=this,n=B(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function B(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function V(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function W(){var e=[];return this.each((function(t){e.push(t)})),e}function U(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function $(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function Y(e,t){var n,r,i,o,a,s=new Z(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=K);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Z(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(J)}function X(){return Y(this).eachBefore(G)}function K(e){return e.children}function G(e){e.data=e.data.data}function J(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Z(e){this.data=e,this.depth=this.height=0,this.parent=null}function Q(e){if("function"!=typeof e)throw new Error;return e}Z.prototype=Y.prototype={constructor:Z,count:O,each:P,eachAfter:j,eachBefore:L,sum:z,sort:F,path:H,ancestors:V,descendants:W,leaves:U,links:$,copy:X};var ee="$",te={depth:-1},ne={};function re(e){return e.id}function ie(e){return e.parentId}function oe(){var e=re,t=ie;function n(n){var r,i,o,a,s,l,u,c=n.length,h=new Array(c),d={};for(i=0;i<c;++i)r=n[i],s=h[i]=new Z(r),null!=(l=e(r,i,n))&&(l+="")&&(d[u=ee+(s.id=l)]=u in d?ne:s);for(i=0;i<c;++i)if(s=h[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=d[ee+l]))throw new Error("missing: "+l);if(a===ne)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=te,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(J),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Q(t),n):e},n.parentId=function(e){return arguments.length?(t=Q(e),n):t},n}function ae(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=ae(n,i[s]);Array.isArray(l)?a.push.apply(a,d(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=ae(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function se(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r=[].concat(d(r),d(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&(r=[].concat(d(r),d(se(e[o].children,t-1,n))));return r}function le(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return se(e.children,i-1,n)}}return!1}function ue(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var ce=/^qDimensionInfo(?:\/(\d+))?/,he=/^\/?qMeasureInfo\/(\d+)/,de=/\/qAttrExprInfo\/(\d+)/,fe=/\/qAttrDimInfo\/(\d+)/;function pe(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}function me(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function ge(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,h=n.qEffectiveInterColumnSortOrder,d=me(n);return ce.test(c)&&(i=!0,o=+ce.exec(c)[1],c=r.replace(ce,"")),he.test(c)&&("K"===n.qMode?l=+he.exec(c)[1]:h&&-1!==h.indexOf(-1)?(l=+he.exec(c)[1],u=0):u=+he.exec(c)[1],c=c.replace(he,"")),c&&(fe.exec(c)?s=+fe.exec(c)[1]:de.exec(c)&&(a=+de.exec(c)[1])),{fieldDepth:(i?"S"===n.qMode?d[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function ye(e,t){var n,r,i=le(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(e){var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ve(e,t,n){var r=n.key,i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function be(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,h=void 0;l.fields&&(c=[],h=[]);for(var d=function(e){var n=u[e],d=void 0,f=void 0,p=void 0,m=void 0,g=void 0,y=void 0;if("primitive"===n.type?(p=n.value,y=String(n.value)):("function"==typeof n.value&&(d=function(e){return n.value(e,r)}),"function"==typeof n.label&&(f=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=n.reduce?n.reduce(p):p,y=n.reduceLabel?n.reduceLabel(y,p):String(p)):y=p=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(p=i,y=i)),l.fields){var v=d?d(p):p;c.push(v),h.push(f&&null!=y?f(y):null!=y?y:String(v))}else{var b=d?d(p):p;o[t[s]]={value:b,label:f?f(y):null!=y?y:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},f=0;f<u.length;f++)d(f);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(h,r):h})}}var xe=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ae(r,e);return o&&o[0]?(t.tree=Y(o[0],n.children||function(e){return e[i]}),t.tree):null};function we(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=pe(e),i=e.fields(),o=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),a=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return r.indexOf(i.indexOf(e))})),s={__root:{__id:"__root",qValues:[]}},l=0;l<t.length;l++){for(var u=t[l],c="__root",h=!1,d=0;d<o.length;d++){var f,p=u[o[d]],m="".concat(c,"__").concat(null!==(f=p.qElemNumber)&&void 0!==f?f:p.qElemNo);s[m]||(s[m]=n({__id:m,__parent:c,qValues:[]},p),h=!0),c=m}if(h)for(var g=0;g<a.length;g++){var y=u[a[g]];s[c].qValues.push(y)}}var v=Object.keys(s).map((function(e){return s[e]})),b=oe().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(v);return b}var qe=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var h=u[c];if(h.field!==a){var d=ye(o,ge(h.field,{cube:r,cache:i}));h.accessor=d.nodeFn,h.valueAccessor=d.valueFn,h.attrAccessor=d.attrFn}}};function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t.raw(),a=t.key(),s="S"===o.qMode?we(t):xe(o,r,e);if(!s)return null;for(var l=s.height,u=[],c=0;c<=l;c++){var h=null;if(c>0)if("S"===o.qMode){var d=me(o)[c-1];h=r.fields[d]}else{var f=o.qEffectiveInterColumnSortOrder[c-1];c>o.qEffectiveInterColumnSortOrder.length&&(f=o.qDimensionInfo.length),h=r.fields[f]}var p=i.normalizeConfig(n(n({},e),{},{field:h?h.key():void 0}),t),m=p.props,g=p.main,y=Object.keys(m);u[c]={propsArr:y,props:m,main:g};var v=h?ge(h,{cube:o,cache:r}):{fieldDepth:0};qe({propsArr:y,props:m,cube:o,cache:r,itemDepthObject:v,f:h})}for(var b=s.copy().descendants(),x=s.descendants(),w=0;w<x.length;w++){var q=u[x[w].depth].propsArr,M=u[x[w].depth].props,D=u[x[w].depth].main,S=b[w],k=S.data,_=ve(D,k,{key:a});be({propsArr:q,props:M,item:S,itemData:k,ret:_,sourceKey:a,isTree:!0}),x[w].data=_}return s}function De(e,t,n,i){for(var o=Array.isArray(e)?e:[e],a=[],s=0;s<o.length;s++)if(void 0!==o[s].field){var l=t.raw(),u=t.key();if(!xe(l,n,e))continue;var c="object"===r(o[s].field)?o[s].field:t.field(o[s].field),h=i.normalizeConfig(o[s],t),f=h.props,p=h.main,m=Object.keys(f),g=ge(c,{cube:l,cache:n}),y=ye({fieldDepth:0},g),v=y.nodeFn,b=y.attrFn,x=y.valueFn;qe({propsArr:m,props:f,cube:l,cache:n,itemDepthObject:g,f:c});for(var w=!!o[s].trackBy,q=r(o[s].trackBy),M={},D=[],S=v(n.tree),k=[],_=0;_<S.length;_++){var C=S[_],E=b?b(x(C)):x(C);if(!p.filter||p.filter(E)){var A=ve(p,E,{key:u});be({propsArr:m,props:f,item:C,itemData:E,ret:A,sourceKey:u}),w&&i.track({cfg:o[s],itemData:E,obj:A,target:D,tracker:M,trackType:q}),k.push(A)}}var T=w?i.collect(D,{main:p,propsArr:m,props:f}):k;a=[].concat(d(a),d(T))}return a}function Se(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ke=Se((function(e){
|
|
41
41
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
42
|
-
!function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,f=e.length,d=e.search(/[0-9\-\+#]/),p=d>0?e.substring(0,d):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,f=h.length,b=0;b<f;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));function _e(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Ce={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Ee=/%$/,Ae=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Te=/^\(oct\)/i,Ie=/^\(dec\)/i,Re=/^\(hex\)/i,Ne=/^\(bin\)/i,Oe=/^\(rom\)/i,Pe=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Le=/#|0/g;function je(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ze(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Fe(e,t,n){var r;return Ae.test(t)?e=je(e,Number(/\d{2}/.exec(t)[0]),t,n):Te.test(t)?e=je(e,8,t,n):Ie.test(t)?e=je(e,10,t,n):Re.test(t)?e=je(e,16,t,n):Ne.test(t)?e=je(e,2,t,n):Oe.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=ze(e,t)):t+r+e.toExponential(0)),e}function He(e,t,n){var r=_e(e);return n?r:new RegExp(r||"",t)}function Be(e,t){return t&&(t=_e(t)),e&&(e=_e(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Ve(e,t){if(!e||!e.qNumericalAbbreviation)return Ce;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function We(e,t,n,r){var i,o,a,s,l,u,c,h,f,d=e.pattern;r&&(e.abbreviate=!0),f=Be(t,n),s=(a=(a=d.match(f))?a[0]:"")?d.substr(0,d.indexOf(a)):d,l=a?d.substring(d.indexOf(a)+a.length):"",a||(a=d?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(He(u,"g"),t)),c=n,n=".",c&&(a=a.replace(He(c,"g"),n)),h=(h=a.match(/#/g))?h.length:0;var p,m=d.split(c);m[1]&&(p=m[1].match(Le)),e.prefix=s||"",e.postfix=l||"",e.pattern=d,e.maxPrecision=p?p.length:2,e.percentage=Ee.test(d),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(He(t,null,!0),"|").concat(He(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=h}var Ue=function(){function e(t,n,r,o,a){i(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=o||".",this.type=a||"numeric",this.patternSeparator=";",this.abbreviations=Ve(t,this.patternSeparator),this.prepare()}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Pe.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Pe.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Pe.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||We(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&We(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&We(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",f="",d=e;if(isNaN(e))return"".concat(d);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Fe(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Se(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Se(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function $e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(Ue,t)}function Ye(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),h=Object.create(null),f=0,d=0;return(t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return f>=o&&(delete c[h[d]],delete h[d],f--,d++),c[e]=t,h[f]=e,f++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),h=Object.create(null),f=0,d=0},t.size=function(){return f},t}function Xe(e,t,n,r,i){var o=$e(i,e,t,n,r),a=Ye(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Ke={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ge=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ze=["January","February","March","April","May","June","July","August","September","October","November","December"],Qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],et=86400;function tt(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function nt(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function rt(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function it(e){var t=e,n=24*rt(t),r=60*rt(n),i=60*rt(r),o=1e3*rt(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function ot(e,t){var n,r=it(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(et*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}function at(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:tt("".concat(t.year).slice(-2),2),YYY:tt("".concat(t.year).slice(-3),3),def:function(e){return tt("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:tt("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:tt("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return tt("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return tt("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return tt("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return tt("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length)}}}}var st=function(){function e(t,n,r){i(this,e);var o,a=t||{};a.qCalendarStrings||(a.qCalendarStrings={qLongDayNames:Ge,qDayNames:Je,qLongMonthNames:Ze,qMonthNames:Qe}),this.localeInfo=a,this.locale_days=a.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=a.qCalendarStrings.qDayNames.slice(),this.locale_months=a.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=a.qCalendarStrings.qMonthNames.slice(),n||(n=(s(o={},Ke.TIME,a.qTimeFmt||"hh:mm:ss"),s(o,Ke.DATE,a.qDateFmt||"YYYY-MM-DD"),s(o,Ke.DATE_TIME,a.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),o)[r]),this.pattern=n}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=nt(e,r):(e<0&&(e=-e,t="-".concat(t)),n=ot(e,t));var i=at(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g");return t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(st,t)}var ut=864e5;function ct(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(ut*(e-Math.floor(e)))))}function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=lt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Ke.INTERVAL?ct(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(o){return n=lt(o,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function ft(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ht(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Xe(n,r,i,o,t)}function dt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),h=function(e){return e.qText||""},f="dimension"===l?"first":"avg",d=ft(n,o),p={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(p)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:h,reduce:f,reduceLabel:"dimension"===l?"first":function(e,t){return d(t)},formatter:function(){return d},tags:function(){return n.qTags}};return p}function pt(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:dt(E({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=pt("qAttrDimInfo",t,n,a,E({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=pt("qAttrExprInfo",t,n,a,E({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=pt("qMeasureInfo",t,n,a,E({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function mt(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.key,a=i.data,s=i.config,l=void 0===s?{}:s,u={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},c=a;if(!c)throw new Error('Missing "data" input');if(!c.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var h=mt.util,d={cache:u,cube:c,localeInfo:l.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:l.virtualFields},p={key:function(){return o},raw:function(){return c},field:function(e){return ue(e,d)},fields:function(){return u.fields.slice()},extract:function(e){return d.extractor(e,p,u,h)},hierarchy:function(e){return d.hierarchy(e,p,u,h)},_cache:function(){return u}};"K"===c.qMode||"T"===c.qMode||!c.qMode&&c.qNodesOnDim?(d.extractor=De,d.hierarchy=Me,d.pages="K"===c.qMode?c.qStackedDataPages:c.qTreeDataPages):"S"===c.qMode?(d.extractor=R,d.pages=c.qDataPages,d.hierarchy=Me):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},p,u,h)};var m="S"===c.qMode?function(e){return e.qElemNumber}:void 0,g="S"===c.qMode?function(e){return e.qNum}:void 0;return(e=u.wrappedFields).push.apply(e,f(pt("qDimensionInfo",c,o,"",E({},d,{value:m,type:"dimension"})))),(t=u.wrappedFields).push.apply(t,f(pt("qMeasureInfo",c,o,"",E({},d,{value:g,type:"measure"})))),u.fields=u.wrappedFields.map((function(e){return e.instance})),function e(t){t.forEach((function(t){u.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))}(u.wrappedFields),(l.virtualFields||[]).forEach((function(e){var t=p.field(e.from),r=dt(n({meta:t.raw(),id:"".concat(o,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},p,u,h)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));u.virtualFields.push(r)})),(r=u.allFields).push.apply(r,f(u.virtualFields)),p}var gt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],yt=/\/qDimensionInfo(?:\/(\d+))?/,vt=/\/qMeasureInfo\/(\d+)/,bt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,xt=/\/qAttrExprInfo\/(\d+)/,wt=/\/?qHyperCube/,qt=/\/?qTreeData/,Mt=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},Dt=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function kt(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};wt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Mt):qt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Dt);var s=!0;if(yt.test(e)&&(r=+yt.exec(e)[1]),vt.test(e)&&(i=+vt.exec(e)[1]),bt.test(e)){i=-1,r=0;var l=+bt.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(xt.test(e)){var u=i;if(t){i=0;var c=ae(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+xt.exec(n)[1]}else r>-1?(r=-1,i=+xt.exec(n)[1]):i+=+xt.exec(n)[1]+1}return gt.forEach((function(e){var t=h(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function St(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=kt(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var h=r.qHyperCube,f=h.qNoOfLeftDims,d=h.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===f||d>=f)&&f>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:d-f})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function _t(e){mt.util=e.data("matrix").util,e.data("q",mt),e.formatter("q-number",Xe),e.formatter("q-time",ht)}return _t.qBrushHelper=St,_t.selections=St,_t}()}(Fq);var Hq=Fq.exports;const Bq={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))})),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const Vq={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Wq(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Hq.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=Bq.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let h=!1;function f(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function d(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){a.forEach((e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function m(){a.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{a.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&p(),t},c.setUpBrush=function(e){const n=Ix(!0,{},Vq,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach((e=>{e!==s&&e.brush.end()}))},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&p()},c.tearDown=function(){l&&m(),a.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),a=[]},c.pauseEngineCalls=function(e){a.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){a.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){a.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",f),document.addEventListener("keyup",f);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",d),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",d)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",f),document.removeEventListener("keyup",f),document.removeEventListener("keyup",d),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class Uq{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var $q={create:e=>e.selectionsApi?Wq(e):new Uq};var Yq={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var Xq={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:wy.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Yq.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Yq.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Kq={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Yq.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yq.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function Gq(e,t){let n;return n="x-axis"===e?"horizontal"===t?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL:"horizontal"===t?wy.DIRECTION_HORIZONTAL:wy.DIRECTION_VERTICAL,n}var Jq={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Gq(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Yq.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yq.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Zq={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Yq.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:"lasso "+i,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Yq.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Qq={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?wy.DIRECTION_VERTICAL:wy.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?"lasso "+t.getBrushConfig():"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var eM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Yq.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var tM={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),f={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},d={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(d.gesture===e)return;let r=a;const i=t||d.chart;switch(d.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=u}d.gesture=e;const o="range"===e?"range":"item";d.type&&d.type!==o&&i.brush(r).clear(),d.chart=t,d.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:d,rangeSelStatus:i};function q(){y("none"),f.majoring=!1,f.measureSelecting=!1,f.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),f.majoring=!1,f.measureSelecting=!1,f.minoring=!1}}}],b.unshift(eM.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(Xq.callLassoGesture(f,x,w)),s?l?(b.push(Zq.callDimensionRangeGesture(f,x,w,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(Kq.callMeasureRangeGesture(f,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(Zq.callDimensionRangeGesture(f,x,w,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(Jq.callAreaRangeGesture(f,x,w,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(b.push(Kq.callMeasureRangeGesture(f,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(Jq.callAreaRangeGesture(f,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(Qq.callDragGesture(f,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function nM(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},s}var rM={create:(...e)=>nM(...e)},iM={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const oM=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=aM(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function aM(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach((e=>{const n=t.data[e];n&&s.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:u}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==l?u.get("properties.dimensionLimits.others"):o.label}}const sM="dist-flow-tooltip",lM="#dist-flow-tooltip";function uM(){if(!document.querySelector(lM)){const e=document.createElement("div");e.id=sM,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function cM({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){uM()},beforeUpdate(){uM()},destroyed(){!function(){const e=document.querySelector(lM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(lM),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:hM}=Jw;const fM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:iM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:hM(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:hM(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:hM(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:hM(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function dM(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Ix(!0,{},fM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:rM.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=cM({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:oM(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{a(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var pM={create:(e,t,n)=>dM(e,t,n)};const mM=".scrollHandler";function gM(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function yM(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function vM(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some((e=>e.settings.key===r)))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function bM(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}gM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},gM.prototype.setDisabled=function(e){this._disabled=e},gM.prototype.getDisabled=function(){return this._disabled},gM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,yM.call(this))},gM.prototype.getItemSize=function(){return this._itemSize},gM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||yM.call(this);return this._scrollViewSizeInItem},gM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",bM.bind(this)));this._$chartElement.on(`mousewheel${mM} DOMMouseScroll${mM}`,vM.bind(this)),this._$chartElement.on("touchstart"+mM,(e=>{e.preventDefault()})),this._on=!0},gM.prototype.isOn=function(){return this._on},gM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(mM),this._on=!1},gM.prototype.updateViewState=function(e){yM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},gM.prototype.onResize=function(){this._sizeChanged=!0,yM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},gM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},gM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},gM.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},gM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},gM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},gM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};function xM(e){return(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11}function wM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function qM(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=wM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=wM(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk}));const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function MM(e,t,n){return e*(e<=24?t:n)}var DM={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:xM,getCharacterRatios:wM,getTotalCharacterRatios:qM,getAdjustedMaxGlyphCount:function(e,t,n){const r=qM(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(xM(i)+1.0909090909090908*o)},estimateLatinLabelWidth:MM,estimateLabelWidth:function(e,t,n,r,i){return e*n+MM(t,r,i)}};const kM={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},SM=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,_M=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,CM=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,EM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,AM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,TM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,IM=Math.floor,RM=Math.round,NM=Zb.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,h,f=0,d=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof NM)f=arguments[0]._r,d=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))f=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))f=parseInt(c[1],10),d=parseInt(c[2],10),p=parseInt(c[3],10),m=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))f=parseInt(c[1],16),d=parseInt(c[2],16),p=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))f=parseInt(c[1]+c[1],16),d=parseInt(c[2]+c[2],16),p=parseInt(c[3]+c[3],16),m=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,f=l[0]+u,d=l[1]+u,p=l[2]+u,f=RM(255*f),d=RM(255*d),p=RM(255*p),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),m=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,f=l[0]+u,d=l[1]+u,p=l[2]+u,f=RM(255*f),d=RM(255*d),p=RM(255*p)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,f=l[0]+u,d=l[1]+u,p=l[2]+u,f=RM(255*f),d=RM(255*d),p=RM(255*p),m=1}else kM[h.toLowerCase()]?(n=h.toLowerCase(),f=kM[n].r,d=kM[n].g,p=kM[n].b,m="number"==typeof kM[n].a?kM[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,f=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(f=(16711680&arguments[0])>>16,d=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(f=arguments[0],d=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+f+d+p+m)&&(this._invalid=!0),this._r=IM(f),this._g=IM(d),this._b=IM(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=NM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=NM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=NM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=NM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=NM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=NM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=NM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=NM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof NM||(e=new NM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[IM(this._r+(e._r-this._r)*t),IM(this._g+(e._g-this._g)*t),IM(this._b+(e._b-this._b)*t),IM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new NM(r)}});NM.toRGB=function(e){if(e instanceof NM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=NM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},NM.toRGBA=function(e,t){if(e instanceof NM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=NM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},NM.toHex=function(e){let t,n,r;return e instanceof NM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),"#"+[t,n,r].join("")):("string"==typeof e&&(e=NM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t="0"+t),1===n.length&&(n="0"+n),1===r.length&&(r="0"+r),`#${t}${n}${r}`)},NM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new NM(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},NM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new NM(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),h=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+h)/2,c===h)n=0,o=0;else{switch(i=c-h,n=r>.5?i/(2-c-h):i/(c+h),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},NM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new NM(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},NM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof NM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},NM.blend=function(e,t,n){const r=(16711680&(e=NM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=NM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},NM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new NM(r,i,o,a)},NM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(SM.test(e)||_M.test(e)||CM.test(e)||EM.test(e)||AM.test(e)||TM.test(e)||kM[e.toLowerCase()])},NM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},NM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},NM.isDark=function(){const e={getLuminance:NM.prototype.getLuminance,isInvalid:NM.prototype.isInvalid};return NM.prototype.init.apply(e,[].slice.call(arguments)),NM.prototype.isDark.call(e)},NM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const OM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new NM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new NM(e);return 0===t.getAlpha()?this.DARK_GREY:NM.getBestContrast(t,new NM(OM.LIGHT_GREY),new NM(OM.DARK_GREY))},getBestContrast:(e,t,n)=>NM.getBestContrast(new NM(e),new NM(t),new NM(n)),getContrastingTransparent(e){const t=new NM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function PM(e,t){return yb(e,(t=t?t+".":"")+"qHyperCube.qDimensionInfo.length")>1}function LM(e,t){if(yb(e,(t=t?t+".":"")+"qHyperCube.qStackedDataPages.0.qData.length"))return yb(e,t+"qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length",0)+yb(e,t+"qHyperCube.qStackedDataPages.0.qData.0.qDown",0)+yb(e,t+"qHyperCube.qStackedDataPages.0.qData.0.qUp",0);const n=yb(e,t+"qHyperCube.qEffectiveInterColumnSortOrder.0");return jM(yb(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function jM(e){return e.qCardinalities.qHypercubeCardinal}var zM={getHyperCube:function(e,t){return e&&(e=t?yb(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:PM,hasSecondMeasure:function(e,t){return yb(e,(t=t?t+".":"")+"qHyperCube.qMeasureInfo.length")>1},getStackedCubeSizeOf2Dims:LM,getStackedCubeSizeOfMax2Dims:function(e,t){return PM(e,t)?LM(e,t):function(e,t){return yb(e,(t=t?t+".":"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return PM(e,t)?LM(e,t):1},getDimensionSize:jM};const FM=function(){this._maxJitter=1};FM.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},FM.prototype.getJitterValue=function(e){const t=Math.abs(wq(""+e)%10)/9;return this._maxJitter/2-t*this._maxJitter};var HM={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var BM={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Ix(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),iw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,a=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&a){i=[Qx.create(Qx.IDMAP.COLOR_BY_EXPRESSION,{qExpression:yb(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,Jx.hasMultipleDimensions(t)?jx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((i=>{Aw.applySorting(t,e,n,i,r);const o=i.dimensions[0],a=i.dimensions[1],s=i.measures[0],l=_w.getFractileExpression(1,o,a,s),u=_w.getFractileExpression(0,o,a,s);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:u,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const VM=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function WM(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(VM),i=n.some(VM),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function UM({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:a,translator:s}=i,l=Ix(!0,{},e.color.point);var u;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(u=l.byDimDef)?void 0:u.activeDimensionIndex)?u.activeDimensionIndex=1:1===(null==u?void 0:u.activeDimensionIndex)&&(u.activeDimensionIndex=0)),function(e){var t,n,r;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(r=e.qUndoExclude)||void 0===r||!r.legendData)}(e)&&(e=function(e){return(e=Ix({},e)).snapshotData=Ix({},e.snapshotData),e.snapshotData.content=Ix({},e.snapshotData.content),e.snapshotData.content.chartData=Ix({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,h=e.createConfig,f=void 0===h?gb:h,d=e.config,p=void 0===d?{}:d,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,M=p.definitionPath,D=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),k={theme:x,key:v,localeInfo:y,layout:D,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:_y(_y({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:D?fb(D):void 0})},S=cb({picasso:o,model:a,app:s,translator:l,auto:q});!1!==q&&S.auto((function(e){return q?q({layout:e,defaultAuto:mb}):mb(e)}));var _=!1;return{getColor:function(){return S.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return S.resolveUIColor({index:t,color:n})},getData:function(){return S.data()},getDatumProps:function(e){return S.datumProps(e)},getSnapshotData:function(){return S.getSnapshotData(M)},getSettingsForMeasure:function(e){return S.settingsForMeasure(e)},getSettings:function(){return S.settings()},getLegend:function(e,t){return S.legend(e,t)},getScales:function(){return S.scales()},getPalettes:function(){return S.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return S.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return _},custom:_y({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:fb}),n=db(k,t);return S.config(n),S.getAuxiliarySettings(M).then((function(){_=!0}))}}}({app:o,model:n,picasso:r,translator:s,config:{localeInfo:t,theme:a,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:WM(e)}})})}const $M=Kx.DATA_PATH,YM=Kx.HYPERCUBE_PATH,XM=Kx.HYPERCUBE_DEF_PATH;function KM(e){return Array.isArray(e)?e:e?[e]:[]}function GM(e){return Math.min(zM.getOuterDimensionSizeOfMax2Dims(e,$M),Kx.MAX_STACKED_VALUES)}function JM(e,t){return{viewSize:t,max:GM(e)}}function ZM(){const e=Kx.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function QM(){if(this.layout&&zM.hasSecondDimension(this.layout,$M)){this._scrollHandler.onResize();!!this.layout.snapshotData||ZM.call(this)}}function eD(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function tD(e,t){return yb(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const nD=xq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:a}){this._super(r,i,t,o,a),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new jq,this._selectionHandler=$q.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=pM.create(this.chartInstance,i,Kx.CHART_ID),this._scrollHandler=new gM(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=Kx.BUBBLE_SCALES_MAX,this._jitterTool=new FM,this.setDataPaths([`${$M}/${YM}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then((()=>{r.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[$M][YM],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!zM.hasSecondDimension(this.layout,$M)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(Kx.MAX_POINT_BASE_SIZE_PX,t*Kx.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(Kx.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=KM(t.trigger),r=KM(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=DM.getAdjustedMaxGlyphCount(function(e){const t=e[$M][YM].qDimensionInfo,n=zM.hasSecondDimension(e,$M)?t[0].qApprMaxGlyphCount:0;return Math.min(Kx.MAX_GLYPH_COUNT,n)}(this.layout||e),e[$M][YM].qStackedDataPages[0].qData[0].qSubNodes),a=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:a},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(Kx.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=KM(t.trigger),o=KM(t.consume),a=this;let s="qMeasureInfo/0",l="qMeasureInfo/0";zM.hasSecondDimension(e,$M)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(s="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const u={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(Kx.CHART_ID,"box","stroke"),strokeWidth:0,width:Kx.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:Kx.MAX_POINT_BASE_SIZE_PX,minWidthPx:Kx.MIN_POINT_PIXELS+2*Kx.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=a.layout.presentation&&a.layout.presentation.visibleComponents&&-1!==a.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;a._calcBandwidth(t,this.chart),a._calcPointMaxSize(e?a._getPointScale():1,a._bandwidthPx);let n=0;a._jitter&&(a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),n=a._pointSize*a._bandwidthPx*Kx.JITTER_PARAMETER);const r=a._pointMaxSizePx+n+2*Kx.BOX_PADDING,i=r/a._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(a._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:s,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return zM.hasSecondDimension(e,$M)&&(u.data.extract.field="qDimensionInfo/0",u.data.extract.trackBy=function(e){return e.qElemNo},u.settings.major={scale:"dimension"}),u},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=KM(t.trigger),o=KM(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const a=this,s=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:s,stroke:e=>{const t=s(e);return OM.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:Kx.MAX_POINT_BASE_SIZE_PX,minPx:Kx.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;if(a._calcBandwidth(e,this.chart),a._calcPointMaxSize(a._getPointScale(),a._bandwidthPx),a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),a._jitter){const t=2*Kx.BOX_PADDING/e;a._jitterTool.calcMaxJitter(a._pointSize*a._bandwidthRatio,Kx.JITTER_PARAMETER,a._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=a._pointMaxSizePx,this.settings.settings.size=a._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return zM.hasSecondDimension(e,$M)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${$M}/${YM}`]),l},_getPointSelectionLayerSettings(e){const t=Ix(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),a=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const s=e[$M][YM],l=s.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",h=dq.create({chartID:Kx.CHART_ID,theme:n,isRtl:t});if(0===s.qStackedDataPages[0].qData.length)return h.getSettings();let f={},d={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&zM.hasSecondDimension(e,$M);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:tD(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:tD(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:$M,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),a=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),f={trigger:Ix(!0,{},r.trigger,{data:[""]}),consume:[Ix(!0,{},r.consume,{data:[""]})]},d={trigger:t?r.trigger:null,consume:[n.consume,r.consume,a.consume]},p={trigger:n.trigger,consume:[n.consume,r.consume,a.consume,i.consume]},m={trigger:[Ix(!0,{},i.trigger,{data:[""]})],consume:[Ix(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:zM.hasSecondDimension(e,$M)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${YM}/qDimensionInfo/${zM.hasSecondDimension(e,$M)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:zM.hasSecondDimension(e,$M)?["inner","outer"]:["inner"]}));const y=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),tD(e,0),tD(e,1)),v={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},b={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=tM.create(v,e.orientation,t,b,y),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:zM.hasSecondDimension(e,$M),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:s.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,f),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:JM(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:a?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines}),a){const t=this._getBoxMarkerSettings(e,d);h.addComponent("box-marker",t)}if(o){const n=this._getPointMarkerSettings(e,p,g);if(n.data.extract.props[u]={field:"qMeasureInfo/0"},n.settings[u]={scale:"measure"},zM.hasSecondDimension(e,$M)&&(n.data.extract.props[c]={field:"qDimensionInfo/0",type:"qual"},n.settings[c]={scale:"dimension"}),this._jitter){n.settings[c]=n.settings[c]||{};const e=this._jitterTool;n.settings[c].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[c].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,Kx.JITTER_PARAMETER)}}h.addComponent("point-marker",n),h.addComponent("point-marker",this._getPointSelectionLayerSettings(n));(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode)&&this.addLegend(h,t,m)}const x=h.getSettings();return this.addSnapshotChartSettings(x,e),x.scales={...x.scales,...this.colorService.getScales()},x.palettes=this.colorService.getPalettes(),x},addLegend(e,t,n){const r={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},i=this.colorService.getLegend(r,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:o}=i;o=o.filter((e=>!!e)),o.length>0&&(this._selectionHandler.isOn()&&(o[0].brush={consume:n.consume.map((e=>Ix(!0,e,{style:{active:null}}))),trigger:n.trigger}),o[0].layout.displayOrder=200,o[0].layout.prioOrder=50),e.settings.components.push(...o),e.settings.interactions[0].gestures.unshift(...i.interactions)},resize(){this.layout&&(QM.call(this),this._super())},hasValidData(){const e=this.layout;return e[$M]&&e[$M][YM]&&e[$M][YM].qStackedDataPages.length&&e[$M][YM].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(QM.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&zM.hasSecondDimension(t,$M)&&this._scrollHandler.isDataSizeChanged(yb(t,`${$M}.${YM}.qStackedDataPages.0.qData.0.qSubNodes.length`),zM.getOuterDimensionSizeOfMax2Dims(t,$M))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>r.call(n))))):this._updateColorMapData(t).then((()=>r.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[$M][YM].qStackedDataPages=this.layout[$M][YM].qStackedDataPages,HM.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!zM.hasSecondDimension(e,$M)&&e.qHyperCube.qSize.qcy>1e4||zM.hasSecondDimension(e,$M)&&e.qHyperCube.qSize.qcy>3e3,r=t&&n,i=JM(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=UM({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${$M}/${YM}/${t}`)},_createColorLegendCube(e){const t=zM.hasSecondDimension(this.layout,$M)?1:0;return{qDimensionInfo:[this.layout[$M][YM].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[XM],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((a=>{const s={layout:t,properties:e,model:o,hashData:a,generateDerivedProperties:(e,t)=>BM.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(s)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return HM.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(GM(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),eD.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(ZM.call(t),t._cacheSizeInitialized=!0),i=zM.hasSecondDimension(e,$M)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[$M][YM],{height:e[$M][YM].qSize.qcy||1}),i.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&tD(e,0))}}),rD={enabled:!0,delay:50};function iD(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class oD{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Ix(!0,{},rD,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:iD(),wrapper:iD(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,a=this.recentRequests.length<1,s=a||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||a||s||l?aD.apply(this,[r,0]):aD.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function aD(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{sD.call(n)}),t):sD.call(n)}function sD(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&lD.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function lD(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&sD.call(t)})),this.onSend(e.data,n)}const uD=new Qb(0,0,0,0),cD=new Qb(0,0,0,0);class hD{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;uD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),cD.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=cD.intersection(uD,!0);if(t.push({coverage:i?i.clone():new Qb(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){uD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),cD.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=uD.intersection(cD,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,a={};for(const e in i)i.hasOwnProperty(e)&&(a[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return a.qUp+=r,a.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[a]}}}const fD={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},dD=Zb.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new hD:"P"===this.options.mode?this.cube=new ux:this.cube=new nx,this.throttle=new oD({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Ix(!0,{},fD,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,a,s,l,u,c,h;const f=[];let d=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(d=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,d-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,a=i*t-i,s=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,d),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+a,this.cubeHeight-l)),h=Math.max(0,Math.min(e[r].qLeft+s,this.cubeWidth-u)),f.push({qTop:c,qHeight:l,qLeft:h,qWidth:u});return f}}),pD=Kx.DATA_PATH,mD=Kx.HYPERCUBE_DEF_PATH;class gD{constructor(e){this.model=e,this.path=`/${pD}/${mD}`,this.cacheCube=new dD(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:Kx.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:zM.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=Dy();return{qae:Mx(t),ext:zw(t),component(){const r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),a=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:a})),[t,n,i.direction,i.freeResize,a.language(),o.name(),r])}(),a=e.useSelections(),s=e.useStaleLayout(),l=e.useModel(),u=e.useConstraints(),c=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),a=!!e.useLayout().qSelectionInfo.qInSelections,[s]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:ky,hidden:!n||!a,active:i,action(){o((e=>!e))}})),[a,i,n]),s.enabled=()=>n,s.active=()=>i,s}(),h=e.useRenderState(),[f,d]=e.useState();e.useEffect((()=>{const e=i(r),u=function(e,t){return t.snapshotData?new hx(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new gD(e)}(l,s),h=a,f=new nD({environment:o,lasso:c,flags:t.flags,picasso:n,$element:e,backendApi:u,selectionsApi:h});return d(f),()=>{f.destroy()}}),[]);const[,p]=e.usePromise((async()=>{if(!f)return;f.updateEnvironment(o),f.updateConstraints(u);if(!!!s.snapshotData){const e=await l.getEffectiveProperties();if(await f.updateDerivedProperties(e,s))return void h.pending();h.restore()}await f.updateData(s),await f.paint()}),[s,f,o]);if(p)throw p;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
|
|
42
|
+
!function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));function _e(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Ce={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Ee=/%$/,Ae=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Te=/^\(oct\)/i,Ie=/^\(dec\)/i,Re=/^\(hex\)/i,Ne=/^\(bin\)/i,Oe=/^\(rom\)/i,Pe=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Le=/#|0/g;function je(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ze(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Fe(e,t,n){var r;return Ae.test(t)?e=je(e,Number(/\d{2}/.exec(t)[0]),t,n):Te.test(t)?e=je(e,8,t,n):Ie.test(t)?e=je(e,10,t,n):Re.test(t)?e=je(e,16,t,n):Ne.test(t)?e=je(e,2,t,n):Oe.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=ze(e,t)):t+r+e.toExponential(0)),e}function He(e,t,n){var r=_e(e);return n?r:new RegExp(r||"",t)}function Be(e,t){return t&&(t=_e(t)),e&&(e=_e(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Ve(e,t){if(!e||!e.qNumericalAbbreviation)return Ce;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function We(e,t,n,r){var i,o,a,s,l,u,c,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Be(t,n),s=(a=(a=f.match(d))?a[0]:"")?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(He(u,"g"),t)),c=n,n=".",c&&(a=a.replace(He(c,"g"),n)),h=(h=a.match(/#/g))?h.length:0;var p,m=f.split(c);m[1]&&(p=m[1].match(Le)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=p?p.length:2,e.percentage=Ee.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(He(t,null,!0),"|").concat(He(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=h}var Ue=function(){function e(t,n,r,o,a){i(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=o||".",this.type=a||"numeric",this.patternSeparator=";",this.abbreviations=Ve(t,this.patternSeparator),this.prepare()}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Pe.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Pe.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Pe.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||We(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&We(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&We(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Fe(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var p,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),y=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&s<g.length;)y=g[++s];s>0&&(p=g[s-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=c.maxPrecision?m=y:p<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=ke(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,q=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=q.length;s<w;s++)q+="0";q&&(e+=o+q)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=ke(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+h+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function $e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(Ue,t)}function Ye(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),h=Object.create(null),d=0,f=0;return t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))},t.set=function(e,t){return d>=o&&(delete c[h[f]],delete h[f],d--,f++),c[e]=t,h[d]=e,d++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),h=Object.create(null),d=0,f=0},t.size=function(){return d},t}function Xe(e,t,n,r,i){var o=$e(i,e,t,n,r),a=Ye(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Ke={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ge=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ze=["January","February","March","April","May","June","July","August","September","October","November","December"],Qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],et=86400;function tt(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function nt(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function rt(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function it(e){var t=e,n=24*rt(t),r=60*rt(n),i=60*rt(r),o=1e3*rt(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function ot(e,t){var n,r=it(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(et*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}function at(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:tt("".concat(t.year).slice(-2),2),YYY:tt("".concat(t.year).slice(-3),3),def:function(e){return tt("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:tt("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:tt("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return tt("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return tt("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return tt("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return tt("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length)}}}}var st=function(){function e(t,n,r){i(this,e);var o,a=t||{};a.qCalendarStrings||(a.qCalendarStrings={qLongDayNames:Ge,qDayNames:Je,qLongMonthNames:Ze,qMonthNames:Qe}),this.localeInfo=a,this.locale_days=a.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=a.qCalendarStrings.qDayNames.slice(),this.locale_months=a.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=a.qCalendarStrings.qMonthNames.slice(),n||(n=(s(o={},Ke.TIME,a.qTimeFmt||"hh:mm:ss"),s(o,Ke.DATE,a.qDateFmt||"YYYY-MM-DD"),s(o,Ke.DATE_TIME,a.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),o)[r]),this.pattern=n}return a(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=nt(e,r):(e<0&&(e=-e,t="-".concat(t)),n=ot(e,t));var i=at(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g"),l=t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return l}}]),e}();function lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(st,t)}var ut=864e5;function ct(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(ut*(e-Math.floor(e)))))}function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=lt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Ke.INTERVAL?ct(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),n.format(t,e)},a.locale=function(o){return n=lt(o,e,t),i=Ye(n.format.bind(n),{toKey:function(e){return"object"===r(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function dt(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return ht(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Xe(n,r,i,o,t)}function ft(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),h=function(e){return e.qText||""},d="dimension"===l?"first":"avg",f=dt(n,o),p="dimension"===l?"first":function(e,t){return f(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:h,reduce:d,reduceLabel:p,formatter:function(){return f},tags:function(){return n.qTags}};return m}function pt(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ft(E({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=pt("qAttrDimInfo",t,n,a,E({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=pt("qAttrExprInfo",t,n,a,E({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=pt("qMeasureInfo",t,n,a,E({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function mt(){var e,t,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.key,a=i.data,s=i.config,l=void 0===s?{}:s,u={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},c=a;if(!c)throw new Error('Missing "data" input');if(!c.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var h=mt.util,f={cache:u,cube:c,localeInfo:l.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:l.virtualFields},p={key:function(){return o},raw:function(){return c},field:function(e){return ue(e,f)},fields:function(){return u.fields.slice()},extract:function(e){return f.extractor(e,p,u,h)},hierarchy:function(e){return f.hierarchy(e,p,u,h)},_cache:function(){return u}};"K"===c.qMode||"T"===c.qMode||!c.qMode&&c.qNodesOnDim?(f.extractor=De,f.hierarchy=Me,f.pages="K"===c.qMode?c.qStackedDataPages:c.qTreeDataPages):"S"===c.qMode?(f.extractor=R,f.pages=c.qDataPages,f.hierarchy=Me):f.extractor=function(){return[]},f.fieldExtractor=function(e){return f.extractor({field:e},p,u,h)};var m="S"===c.qMode?function(e){return e.qElemNumber}:void 0,g="S"===c.qMode?function(e){return e.qNum}:void 0;(e=u.wrappedFields).push.apply(e,d(pt("qDimensionInfo",c,o,"",E({},f,{value:m,type:"dimension"})))),(t=u.wrappedFields).push.apply(t,d(pt("qMeasureInfo",c,o,"",E({},f,{value:g,type:"measure"})))),u.fields=u.wrappedFields.map((function(e){return e.instance}));var y=function e(t){t.forEach((function(t){u.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return y(u.wrappedFields),(l.virtualFields||[]).forEach((function(e){var t=p.field(e.from),r=ft(n({meta:t.raw(),id:"".concat(o,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return f.extractor({field:e},p,u,h)},key:e.key,type:t.type(),localeInfo:f.localeInfo,value:t.value},e.override||{}));u.virtualFields.push(r)})),(r=u.allFields).push.apply(r,d(u.virtualFields)),p}var gt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],yt=/\/qDimensionInfo(?:\/(\d+))?/,vt=/\/qMeasureInfo\/(\d+)/,bt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,xt=/\/qAttrExprInfo\/(\d+)/,wt=/\/?qHyperCube/,qt=/\/?qTreeData/,Mt=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},Dt=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function St(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};wt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Mt):qt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Dt);var s=!0;if(yt.test(e)&&(r=+yt.exec(e)[1]),vt.test(e)&&(i=+vt.exec(e)[1]),bt.test(e)){i=-1,r=0;var l=+bt.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(xt.test(e)){var u=i;if(t){i=0;var c=ae(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+xt.exec(n)[1]}else r>-1?(r=-1,i=+xt.exec(n)[1]):i+=+xt.exec(n)[1]+1}return gt.forEach((function(e){var t=h(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function kt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=St(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}else{if("range"===e.type&&t.measureIdx>-1){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})})))}if("range"===e.type&&t.dimensionIdx>-1){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var h=r.qHyperCube,d=h.qNoOfLeftDims,f=h.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var p=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===d||f>=d)&&d>-1?p.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:f-d})})):p.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function _t(e){mt.util=e.data("matrix").util,e.data("q",mt),e.formatter("q-number",Xe),e.formatter("q-time",ht)}return _t.qBrushHelper=kt,_t.selections=kt,_t}()}(Uq);var $q=Uq.exports;const Yq={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))})),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const Xq={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Kq(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),$q.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=Yq.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){a.forEach((e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function m(){a.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{a.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&p(),t},c.setUpBrush=function(e){const n=Px(!0,{},Xq,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach((e=>{e!==s&&e.brush.end()}))},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&p()},c.tearDown=function(){l&&m(),a.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),a=[]},c.pauseEngineCalls=function(e){a.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){a.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){a.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class Gq{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Jq={create:e=>e.selectionsApi?Kq(e):new Gq};var Zq={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var Qq={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Dy.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Zq.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Zq.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var eM={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Dy.DIRECTION_HORIZONTAL:Dy.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Zq.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Zq.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function tM(e,t){let n;return n="x-axis"===e?"horizontal"===t?Dy.DIRECTION_VERTICAL:Dy.DIRECTION_HORIZONTAL:"horizontal"===t?Dy.DIRECTION_HORIZONTAL:Dy.DIRECTION_VERTICAL,n}var nM={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:tM(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Zq.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Zq.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var rM={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Dy.DIRECTION_VERTICAL:Dy.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Zq.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Zq.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var iM={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Dy.DIRECTION_VERTICAL:Dy.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var oM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Zq.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var aM={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(oM.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(Qq.callLassoGesture(d,x,w)),s?l?(b.push(rM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(eM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(rM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(nM.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(b.push(eM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(nM.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(iM.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function sM(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},s}var lM={create:(...e)=>sM(...e)},uM={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const cM=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=hM(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function hM(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach((e=>{const n=t.data[e];n&&s.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:u}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==l?u.get("properties.dimensionLimits.others"):o.label}}const dM="dist-flow-tooltip",fM=`#${dM}`;function pM(){if(!document.querySelector(fM)){const e=document.createElement("div");e.id=dM,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function mM({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){pM()},beforeUpdate(){pM()},destroyed(){!function(){const e=document.querySelector(fM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(fM),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:gM}=nq;const yM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:uM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:gM(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:gM(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:gM(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:gM(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function vM(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Px(!0,{},yM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:lM.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=mM({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:cM(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{a(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var bM={create:(e,t,n)=>vM(e,t,n)};const xM=".scrollHandler";function wM(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function qM(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function MM(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some((e=>e.settings.key===r)))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function DM(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then((t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)})).catch((e=>{}))}wM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},wM.prototype.setDisabled=function(e){this._disabled=e},wM.prototype.getDisabled=function(){return this._disabled},wM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,qM.call(this))},wM.prototype.getItemSize=function(){return this._itemSize},wM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||qM.call(this);return this._scrollViewSizeInItem},wM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",DM.bind(this)));this._$chartElement.on(`mousewheel${xM} DOMMouseScroll${xM}`,MM.bind(this)),this._$chartElement.on(`touchstart${xM}`,(e=>{e.preventDefault()})),this._on=!0},wM.prototype.isOn=function(){return this._on},wM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(xM),this._on=!1},wM.prototype.updateViewState=function(e){qM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},wM.prototype.onResize=function(){this._sizeChanged=!0,qM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},wM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},wM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},wM.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},wM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},wM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},wM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};function SM(e){return(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11}function kM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function _M(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=kM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=kM(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk}));const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function CM(e,t,n){return e*(e<=24?t:n)}var EM={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:SM,getCharacterRatios:kM,getTotalCharacterRatios:_M,getAdjustedMaxGlyphCount:function(e,t,n){const r=_M(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(SM(i)+1.0909090909090908*o)},estimateLatinLabelWidth:CM,estimateLabelWidth:function(e,t,n,r,i){return e*n+CM(t,r,i)}};const AM={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},TM=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,IM=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,RM=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,NM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,OM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,PM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,LM=Math.floor,jM=Math.round,zM=nx.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof zM)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(c[1],10),f=parseInt(c[2],10),p=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(c[1],10),f=parseInt(c[2],10),p=parseInt(c[3],10),m=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(c[1],16),f=parseInt(c[2],16),p=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),p=parseInt(c[3]+c[3],16),m=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,p=l[2]+u,d=jM(255*d),f=jM(255*f),p=jM(255*p),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),m=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,p=l[2]+u,d=jM(255*d),f=jM(255*f),p=jM(255*p)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,p=l[2]+u,d=jM(255*d),f=jM(255*f),p=jM(255*p),m=1}else AM[h.toLowerCase()]?(n=h.toLowerCase(),d=AM[n].r,f=AM[n].g,p=AM[n].b,m="number"==typeof AM[n].a?AM[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=LM(d),this._g=LM(f),this._b=LM(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=zM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=zM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=zM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=zM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=zM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=zM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=zM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=zM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof zM||(e=new zM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[LM(this._r+(e._r-this._r)*t),LM(this._g+(e._g-this._g)*t),LM(this._b+(e._b-this._b)*t),LM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new zM(r)}});zM.toRGB=function(e){if(e instanceof zM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=zM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},zM.toRGBA=function(e,t){if(e instanceof zM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=zM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},zM.toHex=function(e){let t,n,r;return e instanceof zM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=zM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},zM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new zM(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},zM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new zM(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),h=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+h)/2,c===h)n=0,o=0;else{switch(i=c-h,n=r>.5?i/(2-c-h):i/(c+h),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},zM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new zM(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},zM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof zM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},zM.blend=function(e,t,n){const r=(16711680&(e=zM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=zM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},zM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new zM(r,i,o,a)},zM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(TM.test(e)||IM.test(e)||RM.test(e)||NM.test(e)||OM.test(e)||PM.test(e)||AM[e.toLowerCase()])},zM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},zM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},zM.isDark=function(){const e={getLuminance:zM.prototype.getLuminance,isInvalid:zM.prototype.isInvalid};return zM.prototype.init.apply(e,[].slice.call(arguments)),zM.prototype.isDark.call(e)},zM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const FM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new zM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new zM(e);return 0===t.getAlpha()?this.DARK_GREY:zM.getBestContrast(t,new zM(FM.LIGHT_GREY),new zM(FM.DARK_GREY))},getBestContrast:(e,t,n)=>zM.getBestContrast(new zM(e),new zM(t),new zM(n)),getContrastingTransparent(e){const t=new zM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function HM(e,t){return xb(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function BM(e,t){if(xb(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return xb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+xb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+xb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=xb(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return VM(xb(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function VM(e){return e.qCardinalities.qHypercubeCardinal}var WM={getHyperCube:function(e,t){return e&&(e=t?xb(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:HM,hasSecondMeasure:function(e,t){return xb(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:BM,getStackedCubeSizeOfMax2Dims:function(e,t){return HM(e,t)?BM(e,t):function(e,t){return xb(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return HM(e,t)?BM(e,t):1},getDimensionSize:VM};const UM=function(){this._maxJitter=1};UM.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},UM.prototype.getJitterValue=function(e){const t=Math.abs(kq(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var $M={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var YM={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Px(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),lw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,a=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&a){i=[rw.create(rw.IDMAP.COLOR_BY_EXPRESSION,{qExpression:xb(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,tw.hasMultipleDimensions(t)?Bx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((i=>{Nw.applySorting(t,e,n,i,r);const o=i.dimensions[0],a=i.dimensions[1],s=i.measures[0],l=Tw.getFractileExpression(1,o,a,s),u=Tw.getFractileExpression(0,o,a,s);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:u,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const XM=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function KM(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(XM),i=n.some(XM),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function GM({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:a,translator:s}=i,l=Px(!0,{},e.color.point);var u;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(u=l.byDimDef)?void 0:u.activeDimensionIndex)?u.activeDimensionIndex=1:1===(null==u?void 0:u.activeDimensionIndex)&&(u.activeDimensionIndex=0)),function(e){var t,n,r;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(r=e.qUndoExclude)||void 0===r||!r.legendData)}(e)&&(e=function(e){return(e=Px({},e)).snapshotData=Px({},e.snapshotData),e.snapshotData.content=Px({},e.snapshotData.content),e.snapshotData.content.chartData=Px({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),function(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,h=e.createConfig,d=void 0===h?bb:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,M=p.definitionPath,D=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),S={theme:x,key:v,localeInfo:y,layout:D,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:Ay(Ay({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:D?mb(D):void 0})},k=fb({picasso:o,model:a,app:s,translator:l,auto:q});!1!==q&&k.auto((function(e){return q?q({layout:e,defaultAuto:vb}):vb(e)}));var _=!1,C={getColor:function(){return k.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return k.resolveUIColor({index:t,color:n})},getData:function(){return k.data()},getDatumProps:function(e){return k.datumProps(e)},getSnapshotData:function(){return k.getSnapshotData(M)},getSettingsForMeasure:function(e){return k.settingsForMeasure(e)},getSettings:function(){return k.settings()},getLegend:function(e,t){return k.legend(e,t)},getScales:function(){return k.scales()},getPalettes:function(){return k.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return k.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return _},custom:Ay({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:mb}),n=gb(S,t);return k.config(n),k.getAuxiliarySettings(M).then((function(){_=!0}))}};return C}({app:o,model:n,picasso:r,translator:s,config:{localeInfo:t,theme:a,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:KM(e)}})})}const JM=Qx.DATA_PATH,ZM=Qx.HYPERCUBE_PATH,QM=Qx.HYPERCUBE_DEF_PATH;function eD(e){return Array.isArray(e)?e:e?[e]:[]}function tD(e){return Math.min(WM.getOuterDimensionSizeOfMax2Dims(e,JM),Qx.MAX_STACKED_VALUES)}function nD(e,t){return{viewSize:t,max:tD(e)}}function rD(){const e=Qx.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function iD(){if(this.layout&&WM.hasSecondDimension(this.layout,JM)){this._scrollHandler.onResize();!!this.layout.snapshotData||rD.call(this)}}function oD(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function aD(e,t){return xb(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const sD=Sq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:a}){this._super(r,i,t,o,a),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Vq,this._selectionHandler=Jq.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=bM.create(this.chartInstance,i,Qx.CHART_ID),this._scrollHandler=new wM(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=Qx.BUBBLE_SCALES_MAX,this._jitterTool=new UM,this.setDataPaths([`${JM}/${ZM}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then((()=>{r.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[JM][ZM],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!WM.hasSecondDimension(this.layout,JM)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(Qx.MAX_POINT_BASE_SIZE_PX,t*Qx.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(Qx.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=eD(t.trigger),r=eD(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=EM.getAdjustedMaxGlyphCount(function(e){const t=e[JM][ZM].qDimensionInfo,n=WM.hasSecondDimension(e,JM)?t[0].qApprMaxGlyphCount:0;return Math.min(Qx.MAX_GLYPH_COUNT,n)}(this.layout||e),e[JM][ZM].qStackedDataPages[0].qData[0].qSubNodes),a=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:a},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(Qx.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=eD(t.trigger),o=eD(t.consume),a=this;let s="qMeasureInfo/0",l="qMeasureInfo/0";WM.hasSecondDimension(e,JM)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(s="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const u={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(Qx.CHART_ID,"box","stroke"),strokeWidth:0,width:Qx.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:Qx.MAX_POINT_BASE_SIZE_PX,minWidthPx:Qx.MIN_POINT_PIXELS+2*Qx.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=a.layout.presentation&&a.layout.presentation.visibleComponents&&-1!==a.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;a._calcBandwidth(t,this.chart),a._calcPointMaxSize(e?a._getPointScale():1,a._bandwidthPx);let n=0;a._jitter&&(a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),n=a._pointSize*a._bandwidthPx*Qx.JITTER_PARAMETER);const r=a._pointMaxSizePx+n+2*Qx.BOX_PADDING,i=r/a._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(a._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:s,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return WM.hasSecondDimension(e,JM)&&(u.data.extract.field="qDimensionInfo/0",u.data.extract.trackBy=function(e){return e.qElemNo},u.settings.major={scale:"dimension"}),u},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=eD(t.trigger),o=eD(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const a=this,s=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:s,stroke:e=>{const t=s(e);return FM.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:Qx.MAX_POINT_BASE_SIZE_PX,minPx:Qx.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;if(a._calcBandwidth(e,this.chart),a._calcPointMaxSize(a._getPointScale(),a._bandwidthPx),a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),a._jitter){const t=2*Qx.BOX_PADDING/e;a._jitterTool.calcMaxJitter(a._pointSize*a._bandwidthRatio,Qx.JITTER_PARAMETER,a._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=a._pointMaxSizePx,this.settings.settings.size=a._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return WM.hasSecondDimension(e,JM)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${JM}/${ZM}`]),l},_getPointSelectionLayerSettings(e){const t=Px(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach((e=>{e.style.inactive=void 0,e.style.active.opacity=1})),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),a=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const s=e[JM][ZM],l=s.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",h=vq.create({chartID:Qx.CHART_ID,theme:n,isRtl:t});if(0===s.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&WM.hasSecondDimension(e,JM);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:aD(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:aD(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:JM,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),a=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),d={trigger:Px(!0,{},r.trigger,{data:[""]}),consume:[Px(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,a.consume]},p={trigger:n.trigger,consume:[n.consume,r.consume,a.consume,i.consume]},m={trigger:[Px(!0,{},i.trigger,{data:[""]})],consume:[Px(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:WM.hasSecondDimension(e,JM)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${ZM}/qDimensionInfo/${WM.hasSecondDimension(e,JM)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:WM.hasSecondDimension(e,JM)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,aD(e,0),aD(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=aM.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:WM.hasSecondDimension(e,JM),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:s.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:nD(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:a?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines}),a){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const n=this._getPointMarkerSettings(e,p,g);if(n.data.extract.props[u]={field:"qMeasureInfo/0"},n.settings[u]={scale:"measure"},WM.hasSecondDimension(e,JM)&&(n.data.extract.props[c]={field:"qDimensionInfo/0",type:"qual"},n.settings[c]={scale:"dimension"}),this._jitter){n.settings[c]=n.settings[c]||{};const e=this._jitterTool;n.settings[c].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[c].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,Qx.JITTER_PARAMETER)}}h.addComponent("point-marker",n),h.addComponent("point-marker",this._getPointSelectionLayerSettings(n));(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode)&&this.addLegend(h,t,m)}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n){const r={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},i=this.colorService.getLegend(r,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:o}=i;o=o.filter((e=>!!e)),o.length>0&&(this._selectionHandler.isOn()&&(o[0].brush={consume:n.consume.map((e=>Px(!0,e,{style:{active:null}}))),trigger:n.trigger}),o[0].layout.displayOrder=200,o[0].layout.prioOrder=50),e.settings.components.push(...o),e.settings.interactions[0].gestures.unshift(...i.interactions)},resize(){this.layout&&(iD.call(this),this._super())},hasValidData(){const e=this.layout;return e[JM]&&e[JM][ZM]&&e[JM][ZM].qStackedDataPages.length&&e[JM][ZM].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(iD.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&WM.hasSecondDimension(t,JM)&&this._scrollHandler.isDataSizeChanged(xb(t,`${JM}.${ZM}.qStackedDataPages.0.qData.0.qSubNodes.length`),WM.getOuterDimensionSizeOfMax2Dims(t,JM))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>r.call(n))))):this._updateColorMapData(t).then((()=>r.call(n)))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[JM][ZM].qStackedDataPages=this.layout[JM][ZM].qStackedDataPages,$M.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!WM.hasSecondDimension(e,JM)&&e.qHyperCube.qSize.qcy>1e4||WM.hasSecondDimension(e,JM)&&e.qHyperCube.qSize.qcy>3e3,r=t&&n,i=nD(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=GM({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${JM}/${ZM}/${t}`)},_createColorLegendCube(e){const t=WM.hasSecondDimension(this.layout,JM)?1:0;return{qDimensionInfo:[this.layout[JM][ZM].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[QM],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((a=>{const s={layout:t,properties:e,model:o,hashData:a,generateDerivedProperties:(e,t)=>YM.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(s)}))},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return $M.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(tD(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),oD.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(rD.call(t),t._cacheSizeInitialized=!0),i=WM.hasSecondDimension(e,JM)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[JM][ZM],{height:e[JM][ZM].qSize.qcy||1}),i.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&aD(e,0))}}),lD={enabled:!0,delay:50};function uD(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class cD{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Px(!0,{},lD,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:uD(),wrapper:uD(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,a=this.recentRequests.length<1,s=a||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||a||s||l?hD.apply(this,[r,0]):hD.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach((t=>{e+=t.respondedAt-t.sentAt})),e/=this.resolvedRequests.length),e}}function hD(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{dD.call(n)}),t):dD.call(n)}function dD(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&fD.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function fD(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then((function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt}),(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)})).finally((()=>{t.waitingForResponse&&dD.call(t)})),this.onSend(e.data,n)}const pD=new rx(0,0,0,0),mD=new rx(0,0,0,0);class gD{constructor(){this.pages=[]}get(e){return e.map((e=>this.getPage(e)))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;pD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),mD.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=mD.intersection(pD,!0);if(t.push({coverage:i?i.clone():new rx(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter((e=>!this.containsArea(e))).length}_extract(e,t){pD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),mD.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=pD.intersection(mD,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,a={};for(const e in i)i.hasOwnProperty(e)&&(a[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return a.qUp+=r,a.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[a]}}}const yD={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},vD=nx.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new gD:"P"===this.options.mode?this.cube=new fx:this.cube=new ax,this.throttle=new cD({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then((e=>{this.cube?t.resolve(e):t.reject()}),(()=>{t.reject()}))}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Px(!0,{},yD,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,a,s,l,u,c,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,a=i*t-i,s=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+a,this.cubeHeight-l)),h=Math.max(0,Math.min(e[r].qLeft+s,this.cubeWidth-u)),d.push({qTop:c,qHeight:l,qLeft:h,qWidth:u});return d}}),bD=Qx.DATA_PATH,xD=Qx.HYPERCUBE_DEF_PATH;class wD{constructor(e){this.model=e,this.path=`/${bD}/${xD}`,this.cacheCube=new vD(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:Qx.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:WM.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then((e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some((e=>e.qDown>0))&&n.clear(),e)))}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=_y();return{qae:_x(t),ext:Ww(t),component(){const r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),a=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:a})),[t,n,i.direction,i.freeResize,a.language(),o.name(),r])}(),a=e.useSelections(),s=e.useStaleLayout(),l=e.useModel(),u=e.useConstraints(),c=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),a=!!e.useLayout().qSelectionInfo.qInSelections,[s]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Cy,hidden:!n||!a,active:i,action(){o((e=>!e))}})),[a,i,n]),s.enabled=()=>n,s.active=()=>i,s}(),h=e.useRenderState(),[d,f]=e.useState();e.useEffect((()=>{const e=i(r),u=function(e,t){return t.snapshotData?new mx(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new wD(e)}(l,s),h=a,d=new sD({environment:o,lasso:c,flags:t.flags,picasso:n,$element:e,backendApi:u,selectionsApi:h});return f(d),()=>{d.destroy()}}),[]);const[,p]=e.usePromise((async()=>{if(!d)return;d.updateEnvironment(o),d.updateConstraints(u);if(!!!s.snapshotData){const e=await l.getEffectiveProperties();if(await d.updateDerivedProperties(e,s))return void h.pending();h.restore()}await d.updateData(s),await d.paint()}),[s,d,o]);if(p)throw p;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(d),m=d,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
|
|
43
43
|
//# sourceMappingURL=sn-distplot.js.map
|