@nebula.js/sn-distributionplot 0.37.1 → 0.38.0
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/dist/sn-distplot.js +15 -13
- package/dist/sn-distplot.js.map +1 -1
- package/dist/sn-distplot.systemjs.js +14 -12
- package/dist/sn-distplot.systemjs.js.map +1 -1
- package/package.json +9 -8
- package/core/esm/index.js +0 -12
- package/core/esm/index.js.map +0 -1
package/dist/sn-distplot.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-distributionplot v0.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @nebula.js/sn-distributionplot v0.38.0
|
|
3
|
+
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-distributionplot"]=t(e.stardust)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-distributionplot"]=t(e.stardust)}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i={},r={get exports(){return i},set exports(e){i=e}};
|
|
8
8
|
/*!
|
|
9
|
-
* jQuery JavaScript Library v3.6.
|
|
9
|
+
* jQuery JavaScript Library v3.6.4
|
|
10
10
|
* https://jquery.com/
|
|
11
11
|
*
|
|
12
12
|
* Includes Sizzle.js
|
|
@@ -16,28 +16,30 @@
|
|
|
16
16
|
* Released under the MIT license
|
|
17
17
|
* https://jquery.org/license
|
|
18
18
|
*
|
|
19
|
-
* Date:
|
|
20
|
-
|
|
19
|
+
* Date: 2023-03-08T15:28Z
|
|
20
|
+
*/
|
|
21
|
+
!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=[],i=Object.getPrototypeOf,r=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},c=l.toString,u=l.hasOwnProperty,h=u.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 i,r,o=(n=n||g).createElement("script");if(o.text=e,t)for(i in y)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var x="3.6.4",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 r.call(this)},get:function(e){return null==e?r.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(r.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:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||p(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)i=e[t],"__proto__"!==t&&s!==i&&(c&&i&&(w.isPlainObject(i)||(r=Array.isArray(i)))?(n=s[t],o=r&&!Array.isArray(n)?[]:r||w.isPlainObject(n)?n:{},r=!1,s[t]=w.extend(c,o,i)):void 0!==i&&(s[t]=i));return s},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]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=u.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,i=0;if(q(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(q(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,o=e.length,s=!n;r<o;r++)!t(e[r],r)!==s&&i.push(e[r]);return i},map:function(e,t,n){var i,r,s=0,a=[];if(q(e))for(i=e.length;s<i;s++)null!=(r=t(e[s],s,n))&&a.push(r);else for(s in e)null!=(r=t(e[s],s,n))&&a.push(r);return o(a)},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
22
|
/*!
|
|
22
|
-
* Sizzle CSS Selector Engine v2.3.
|
|
23
|
+
* Sizzle CSS Selector Engine v2.3.10
|
|
23
24
|
* https://sizzlejs.com/
|
|
24
25
|
*
|
|
25
26
|
* Copyright JS Foundation and other contributors
|
|
26
27
|
* Released under the MIT license
|
|
27
28
|
* https://js.foundation/
|
|
28
29
|
*
|
|
29
|
-
* Date:
|
|
30
|
+
* Date: 2023-02-14
|
|
30
31
|
*/
|
|
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(),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}[\\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=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==d||a||c);v!==S&&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},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-]+))$/;(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(!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 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 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&&(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 Se(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)Se(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 ke(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")&&ke(t,"click",qe),!1},trigger:function(e){var t=this||e;return de.test(t.type)&&t.click&&_(t,"input")&&ke(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 ke(this,e,De),!1},trigger:function(){return ke(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 Se(this,e,t,n,r)},one:function(e,t,n,r){return Se(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=/\[\]$/,St=/\r?\n/g,kt=/^(?: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)&&!kt.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(St,"\r\n")}})):{name:t.name,value:n.replace(St,"\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),S(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,S)}catch(e){if(u)throw e;S(-1,e)}}else S(-1,"No Transport");function S(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,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?(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(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],f=N[5],y=N[6],e.bezierCurveTo(N[1],N[2],k,_,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),k=N[3]+f,_=N[4]+y,f+=N[5],y+=N[6];break;case"S":null!==k&&null!==_||(k=f,_=y),e.bezierCurveTo(2*f-k,2*y-_,N[1],N[2],N[3],N[4]),k=N[1],_=N[2],f=N[3],y=N[4];break;case"s":null!==k&&null!==_||(k=f,_=y),e.bezierCurveTo(2*f-k,2*y-_,N[1]+f,N[2]+y,N[3]+f,N[4]+y),k=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)},S=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)},k=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&&(S(i)||(o=D(i)))?(o?(o=!1,a=r&&D(r)?r:[]):a=r&&S(r)?r:{},k(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&k(s,{name:n,newValue:i}));return s},E="1.9.9";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,Se=2*Me;function ke(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,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 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>Se-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,S=D>qe&&(r?+r.apply(this,arguments):we(c*c+h*h)),k=be(me(h-c)/2,+n.apply(this,arguments)),_=k,C=k;if(S>qe){var E=_e(S/c*xe(D)),A=_e(S/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(k>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(ke((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(k,(c-U)/(W-1)),C=be(k,(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<k?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),_<k?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,St=Array.prototype.map,kt=["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=St.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]}))}}(St.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?kt[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 S=f.length+e.length+M.length,k=S<p?new Array(p-S+1).join(t):"";switch(m&&d&&(e=r(k+e,k.length?p-M.length:1/0),k=""),n){case"<":e=f+e+M+k;break;case"=":e=f+k+e+M;break;case"^":e=k.slice(0,S=k.length>>1)+f+e+M+k.slice(S);break;default:e=k+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=kt[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:kn,e:kn,f:In,g:qn,G:wn,H:Cn,I:Cn,j:_n,L:Tn,m:Sn,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 Sn(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 kn(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 Sr=ft();Sr("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})),Sr("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 kr={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 Sr(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?kr.id:n,i=t.key,o=void 0===i?kr.key:i,a=t.min,s=void 0===a?kr.min:a,l=t.max,u=void 0===l?kr.max:l,c=t.type,h=void 0===c?kr.type:c,f=t.tags,d=void 0===f?kr.tags:f,p=t.title,m=void 0===p?kr.title:p,g=t.values,y=void 0===g?kr.values:g,v=t.value,b=void 0===v?kr.value:v,x=t.label,w=void 0===x?kr.label:x,q=t.formatter,M=void 0===q?kr.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 S=M[D],k=M[D].data[M.key];k&&(k[a]={value:S[0]},k[s]={value:S[1]},w.push(S[0],S[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"#"+ki(this.r)+ki(this.g)+ki(this.b)}function Si(){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 ki(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:Si,toString:Si})),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 So(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 ko=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(ko).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=So(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 Sa(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 ka(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:Sa};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)||!ks(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 Ss(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 ks(e,t)}))}function ks(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(ks(e,r)||ks(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)&&(Ss(n,r)?ms(e,t):ms(t,e))}function Ts(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ds(n,r)&&(Ss(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(!ks(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:[]},S=[],k={},_=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,[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=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&&S.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);i?i.isFirst?(x=a).items&&(x.items=X(a.items)):x.items&&(x.items=[].concat(X(x.items),X(a.items||[]))):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();n?n.isFirst?M.nodes=X(e||[]):M.nodes&&(M.nodes=[].concat(X(M.nodes),X(e||[]))):M.nodes=e}Z.beforeMount=O,Z.beforeRender=function(){F({size:i})},Z.render=function(){var e=V.call.apply(V,[k].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,[k].concat(X(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=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,S.forEach((function(e){e.isActive()&&e.update()})),Y.render(e)};return is(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 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(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:[],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(k,y,e),q=!0},Z.mounted=function(){return P(r)},Z.unmount=function(){[_,k].forEach((function(e){ss(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){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=k,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 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,[d].concat(s)):r=n.call.apply(n,[d].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"),E=S("beforeMount"),A=S("mounted"),R=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,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();ks(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()})),k()},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=k(),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){var o=r.instance.getBrushedShapes(e,t,n);i=[].concat(X(i),X(o))})),i},d.findShapes=function(e){var t=[];return m.forEach((function(n){var r=n.instance.findShapes(e);t=[].concat(X(t),X(r))})),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=[].concat(X(r),X(h))).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=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})),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 Sl(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);r=[].concat(X(r),u?X(ql(f,{main:s,propsArr:l,props:a})):p)}()})),r}var kl=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=kl(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 Sl(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})),S=o?o.length:0,k=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<S;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<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: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(Se),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(Se,Math.max(-Se,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,Sa(this,"x",this.rect.width),Sa(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,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})).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),S=Math.max.apply(Math,X(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,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 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 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 Su(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 ku(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=ku,n}function r(){return t=Su,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=ka(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=ka(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),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(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=ka(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=ka(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&&!ks(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&&!ks(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=[].concat(X(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=ka(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 Sc(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,S=m.length;D<S;D++){a=null,f=pc(r=(n=m[D]).node,p),d="left"===(u=n.direction)||"right"===u?"h":"v";for(var k=0;k<n.texts.length;k++)if(mc(i=n.texts[k])){var _=b({direction:u,fitsHorizontally:y,lblStngs:c=n.labelSettings[k],measured:l=n.measurements[k],node:r,orientation:d,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(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 kc(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 Sh(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function kh(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 Sh({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?Sh(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]:Sc,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=kc({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),S=s({context:p,direction:q,lblStngs:x,measured:D,node:y,placementSettings:h[b],rect:i,store:d}),k=S.bounds,_=S.placement;if(k&&_){if("outside"===_.position&&"rotate"!==q){Nc({context:p,node:y,bounds:k});var E=Ac(k);if(!cs(E,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),f.push(T),k.line&&(k.line.stroke=A,f.push(k.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=kh(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],S="function"==typeof D.label?D.label(m,f):"";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,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);ks({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 Sf(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 kf(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,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);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(kf(h,i,o))),i+=h[6],o+=h[7];break;case"A":r.push.apply(r,X(kf(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(Sf({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(Sf({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(Sf({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(Sf({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 ks(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)&&(Ss(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 Sd=gd.prototype,kd=["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=kd.length;i!==o;i++)void 0!==e[r=kd[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return Sd.addChild.call(this,e)}},{key:"addChildren",value:function(e){return Sd.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 Sd.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return Sd.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 Sp="http://www.w3.org/2000/svg",kp=function(e,t){if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));var n=t.ownerDocument.createElementNS(Sp,"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(Sp,"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,kp,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]:Sp,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:Sr,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){Sm(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 Sm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function km(e,t){return(km=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&&km(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 S=0;S<d.length;S++){var k=h[d[S]],_=k.fields||[k];k.fields&&(D[d[S]]=[]);for(var C=0;C<_.length;C++)Wm({cache:n,f:u,mainCell:M,p:_[C],prop:d[S],props:h,page:s.qDataPages[b],rowIdx:q,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:k.fields?D[d[S]]:D,targetProp:k.fields?C:d[S]});if(k.fields){var E=D[d[S]].map((function(e){return e.value})),A=D[d[S]].map((function(e){return e.label}));D[d[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[d[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: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=[].concat(Am(r),Am(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&(r=[].concat(Am(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,S=l[w[q].depth].main,k=x[q],_=k.data,C=pg(S,_,{key:o});mg({propsArr:M,props:D,item:k,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=[],S=0;S<M.length;S++){var k=M[S],_=y?y(v(k)):v(k);if(!(f.filter&&!f.filter(_))){var C=pg(f,_,{key:l});mg({propsArr:d,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: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){
|
|
32
|
+
function(e){var t,n,i,r,o,s,a,l,c,u,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(),_=le(),C=le(),k=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,i=e.length;n<i;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]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",j=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",H=new RegExp(L+"+","g"),B=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),V=new RegExp("^"+L+"*,"+L+"*"),$=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),U=new RegExp(j),Y=new RegExp("^"+F+"$"),X={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+j),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))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},se=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,i=0;e[n++]=t[i++];);e.length=n-1}}}function ae(e,t,i,r){var o,a,c,u,h,p,y,v=t&&t.ownerDocument,w=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return i;if(!r&&(d(t),t=t||f,m)){if(11!==w&&(h=Q.exec(e)))if(o=h[1]){if(9===w){if(!(c=t.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(v&&(c=v.getElementById(o))&&b(t,c)&&c.id===o)return i.push(c),i}else{if(h[2])return R.apply(i,t.getElementsByTagName(e)),i;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===w&&(W.test(e)||$.test(e))){for((v=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(ie,re):t.setAttribute("id",u=x)),a=(p=s(e)).length;a--;)p[a]=(u?"#"+u:":scope")+" "+be(p[a]);y=p.join(",")}try{return R.apply(i,v.querySelectorAll(y)),i}catch(t){C(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,i,r)}function le(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ce(e){return e[x]=!0,e}function ue(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("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;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&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=ae.setDocument=function(e){var t,r,s=e?e.ownerDocument||e:w;return s!=f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),w!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.scope=ue((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssHas=ue((function(){try{return f.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(f.getElementsByClassName),n.getById=ue((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.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}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.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,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.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))&&(ue((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]")})),ue((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))&&ue((function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",j)})),n.cssHas||g.push(":has"),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,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return h=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?O(u,e)-O(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],a=[t];if(!r||!o)return e==f?-1:t==f?1:r?-1:o?1:u?O(u,e)-O(u,t):0;if(r===o)return de(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?de(s[i],a[i]):s[i]==w?-1:a[i]==w?1:0},f):f},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!C[t+" "]&&(!y||!y.test(t))&&(!g||!g.test(t)))try{var i=v.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){C(t,!0)}return ae(t,f,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var r=i.attrHandle[t.toLowerCase()],o=r&&E.call(i.attrHandle,t.toLowerCase())?r(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},ae.escape=function(e){return(e+"").replace(ie,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,i=[],r=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(k),h){for(;t=e[o++];)t===e[o]&&(r=i.push(o));for(;r--;)e.splice(i[r],1)}return u=null,e},r=ae.getText=function(e){var t,n="",i=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+=r(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},i=ae.selectors={cacheLength:50,createPseudo:ce,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]||ae.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]&&ae.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&&U.test(n)&&(t=s(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(i){var r=ae.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,h,d,f,p,m=o!==s?"nextSibling":"previousSibling",g=t.parentNode,y=a&&t.nodeName.toLowerCase(),v=!l&&!a,b=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&v){for(b=(f=(c=(u=(h=(d=g)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&c[1])&&c[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){u[e]=[q,f,b];break}}else if(v&&(b=f=(c=(u=(h=(d=t)[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===q&&c[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(v&&((u=(h=d[x]||(d[x]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]=[q,b]),d!==t)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var i,o=r(e,t),s=o.length;s--;)e[i=O(e,o[s])]=!(n[i]=o[s])})):function(e){return r(e,0,n)}):r}},pseudos:{not:ce((function(e){var t=[],n=[],i=a(e.replace(B,"$1"));return i[x]?ce((function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return ae(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}})),lang:ce((function(e){return Y.test(e||"")||ae.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!i.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 i=n<0?n+t:n>t?t:n;--i>=0;)e.push(i);return e})),gt:ge((function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e}))}},i.pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=pe(t);function ve(){}function be(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function xe(e,t,n){var i=t.dir,r=t.next,o=r||i,s=n&&"parentNode"===o,a=M++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||s)return e(t,n,r);return!1}:function(t,n,l){var c,u,h,d=[q,a];if(l){for(;t=t[i];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||s)if(u=(h=t[x]||(t[x]={}))[t.uniqueID]||(h[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[i]||t;else{if((c=u[o])&&c[0]===q&&c[1]===a)return d[2]=c[2];if(u[o]=d,d[2]=e(t,n,l))return!0}return!1}}function we(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function qe(e,t,n,i,r){for(var o,s=[],a=0,l=e.length,c=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,i,r)||(s.push(o),c&&t.push(a)));return s}function Me(e,t,n,i,r,o){return i&&!i[x]&&(i=Me(i)),r&&!r[x]&&(r=Me(r,o)),ce((function(o,s,a,l){var c,u,h,d=[],f=[],p=s.length,m=o||function(e,t,n){for(var i=0,r=t.length;i<r;i++)ae(e,t[i],n);return n}(t||"*",a.nodeType?[a]:a,[]),g=!e||!o&&t?m:qe(m,d,e,a,l),y=n?r||(o?e:p||i)?[]:s:g;if(n&&n(g,y,a,l),i)for(c=qe(y,f),i(c,[],a,l),u=c.length;u--;)(h=c[u])&&(y[f[u]]=!(g[f[u]]=h));if(o){if(r||e){if(r){for(c=[],u=y.length;u--;)(h=y[u])&&c.push(g[u]=h);r(null,y=[],c,l)}for(u=y.length;u--;)(h=y[u])&&(c=r?O(o,h):d[u])>-1&&(o[c]=!(s[c]=h))}}else y=qe(y===s?y.splice(p,y.length):y),r?r(null,s,y,l):R.apply(s,y)}))}function De(e){for(var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,u=xe((function(e){return e===t}),a,!0),h=xe((function(e){return O(t,e)>-1}),a,!0),d=[function(e,n,i){var r=!s&&(i||n!==c)||((t=n).nodeType?u(e,n,i):h(e,n,i));return t=null,r}];l<o;l++)if(n=i.relative[e[l].type])d=[xe(we(d),n)];else{if((n=i.filter[e[l].type].apply(null,e[l].matches))[x]){for(r=++l;r<o&&!i.relative[e[r].type];r++);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<r&&De(e.slice(l,r)),r<o&&De(e=e.slice(r)),r<o&&be(e))}d.push(n)}return we(d)}return ve.prototype=i.filters=i.pseudos,i.setFilters=new ve,s=ae.tokenize=function(e,t){var n,r,o,s,a,l,c,u=S[e+" "];if(u)return t?0:u.slice(0);for(a=e,l=[],c=i.preFilter;a;){for(s in n&&!(r=V.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=$.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),i.filter)!(r=X[s].exec(a))||c[s]&&!(r=c[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):S(e,l).slice(0)},a=ae.compile=function(e,t){var n,r=[],o=[],a=_[e+" "];if(!a){for(t||(t=s(e)),n=t.length;n--;)(a=De(t[n]))[x]?r.push(a):o.push(a);a=_(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,s,a,l,u){var h,p,g,y=0,v="0",b=o&&[],x=[],w=c,M=o||r&&i.find.TAG("*",u),D=q+=null==w?1:Math.random()||.1,S=M.length;for(u&&(c=s==f||s||u);v!==S&&null!=(h=M[v]);v++){if(r&&h){for(p=0,s||h.ownerDocument==f||(d(h),a=!m);g=e[p++];)if(g(h,s||f,a)){l.push(h);break}u&&(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,s,a);if(o){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=T.call(l));x=qe(x)}R.apply(l,x),u&&!o&&x.length>0&&y+t.length>1&&ae.uniqueSort(l)}return u&&(q=D,c=w),b};return n?ce(o):o}(o,r)),a.selector=e}return a},l=ae.select=function(e,t,n,r){var o,l,c,u,h,d="function"==typeof e&&e,f=!r&&s(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&i.relative[l[1].type]){if(!(t=(i.find.ID(c.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--&&(c=l[o],!i.relative[u=c.type]);)if((h=i.find[u])&&(r=h(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ye(t.parentNode)||t))){if(l.splice(o,1),!(e=r.length&&be(l)))return R.apply(n,r),n;break}}return(d||a(e,f))(r,t,!m,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=x.split("").sort(k).join("")===x,n.detectDuplicates=!!h,d(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((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&&ue((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})),ue((function(e){return null==e.getAttribute("disabled")}))||he(P,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),ae}(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 i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&w(e).is(n))break;i.push(e)}return i},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},_=w.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var k=/^<([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,i){return!!t.call(e,i,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return a.call(t,e)>-1!==n})):w.filter(t,e,n)}w.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?w.find.matchesSelector(i,e)?[i]:[]:w.find.matches(e,w.grep(t,(function(e){return 1===e.nodeType})))},w.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(w(e).filter((function(){for(t=0;t<i;t++)if(w.contains(r[t],this))return!0})));for(n=this.pushStack([]),t=0;t<i;t++)w.find(e,r[t],n);return i>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&&_.test(e)?w(e):e||[],!1).length}});var A,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,I=w.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:T.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),k.test(i[1])&&w.isPlainObject(t))for(i in t)p(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=g.getElementById(i[2]))&&(this[0]=r,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,i=0,r=this.length,o=[],s="string"!=typeof e&&w(e);if(!_.test(e))for(;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.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?a.call(w(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(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&&i(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},(function(e,t){w.fn[e]=function(n,i){var r=w.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=w.filter(i,r)),this.length>1&&(N[e]||w.uniqueSort(r),R.test(e)&&r.reverse()),this.pushStack(r)}}));var P=/[^\x20\t\r\n\f]+/g;function L(e){return e}function F(e){throw e}function z(e,t,n,i){var r;try{e&&p(r=e.promise)?r.call(e).done(t).fail(n):e&&p(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}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,i,r,o=[],s=[],a=-1,l=function(){for(r=r||e.once,i=t=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,r&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){w.each(n,(function(n,i){p(i)?e.unique&&c.has(i)||o.push(i):i&&i.length&&"string"!==b(i)&&t(i)}))}(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<=a&&a--})),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||t||(o=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},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"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return w.Deferred((function(t){w.each(n,(function(n,i){var r=p(e[i[4]])&&e[i[4]];o[i[1]]((function(){var e=r&&r.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(t,i,r){var o=0;function s(t,n,i,r){return function(){var a=this,l=arguments,c=function(){var e,c;if(!(t<o)){if((e=i.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(c)?r?c.call(e,s(o,n,L,r),s(o,n,F,r)):(o++,c.call(e,s(o,n,L,r),s(o,n,F,r),s(o,n,L,n.notifyWith))):(i!==L&&(a=void 0,l=[e]),(r||n.resolveWith)(a,l))}},u=r?c:function(){try{c()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,u.stackTrace),t+1>=o&&(i!==F&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?u():(w.Deferred.getStackHook&&(u.stackTrace=w.Deferred.getStackHook()),e.setTimeout(u))}}return w.Deferred((function(e){n[0][3].add(s(0,e,p(r)?r:L,e.notifyWith)),n[1][3].add(s(0,e,p(t)?t:L)),n[2][3].add(s(0,e,p(i)?i:F))})).promise()},promise:function(e){return null!=e?w.extend(e,r):r}},o={};return w.each(n,(function(e,t){var s=t[2],a=t[5];r[t[1]]=s.add,a&&s.add((function(){i=a}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),o=r.call(arguments),s=w.Deferred(),a=function(e){return function(n){i[e]=this,o[e]=arguments.length>1?r.call(arguments):n,--t||s.resolveWith(i,o)}};if(t<=1&&(z(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||p(o[n]&&o[n].then)))return s.then();for(;n--;)z(o[n],a(n),s.reject);return s.promise()}});var j=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&j.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,i,r,o,s){var a=0,l=e.length,c=null==n;if("object"===b(n))for(a in r=!0,n)V(e,t,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,p(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(w(e),n)})),t))for(;a<l;a++)t(e[a],n,s?i:i.call(e[a],a,t(e[a],n)));return r?e:c?t.call(e):l?t(e[0],n):o},$=/^-ms-/,W=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function Y(e){return e.replace($,"ms-").replace(W,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 i,r=this.cache(e);if("string"==typeof t)r[Y(t)]=n;else for(i in t)r[Y(i)]=t[i];return r},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,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in i?[t]:t.match(P)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||w.isEmptyObject(i))&&(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 i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){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,i,r,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(r=J.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=Y(i.slice(5)),ee(o,i,r[i]));G.set(o,"hasDataAttrs",!0)}return r}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 i;if(e)return t=(t||"fx")+"queue",i=G.get(e,t),n&&(!i||Array.isArray(n)?i=G.access(e,t,w.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),i=n.length,r=n.shift(),o=w._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,(function(){w.dequeue(e,t)}),o)),!i&&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,i=1,r=w.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=G.get(o[s],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),ie=["Top","Right","Bottom","Left"],re=g.documentElement,oe=function(e){return w.contains(e.ownerDocument,e)},se={composed:!0};re.getRootNode&&(oe=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(se)===e.ownerDocument});var ae=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,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return w.css(e,t,"")},l=a(),c=n&&n[3]||(w.cssNumber[t]?"":"px"),u=e.nodeType&&(w.cssNumber[t]||"px"!==c&&+l)&&ne.exec(w.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)w.style(e,t,u+c),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),u/=o;u*=2,w.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}var ce={};function ue(e){var t,n=e.ownerDocument,i=e.nodeName,r=ce[i];return r||(t=n.body.appendChild(n.createElement(i)),r=w.css(t,"display"),t.parentNode.removeChild(t),"none"===r&&(r="block"),ce[i]=r,r)}function he(e,t){for(var n,i,r=[],o=0,s=e.length;o<s;o++)(i=e[o]).style&&(n=i.style.display,t?("none"===n&&(r[o]=G.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&&ae(i)&&(r[o]=ue(i))):"none"!==n&&(r[o]="none",G.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(e[o].style.display=r[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(){ae(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&&C(e,t)?w.merge([e],n):n}function be(e,t){for(var n=0,i=e.length;n<i;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,i,r){for(var o,s,a,l,c,u,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(s=s||h.appendChild(t.createElement("div")),a=(me.exec(o)||["",""])[1].toLowerCase(),l=ye[a]||ye._default,s.innerHTML=l[1]+w.htmlPrefilter(o)+l[2],u=l[0];u--;)s=s.lastChild;w.merge(d,s.childNodes),(s=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(i&&w.inArray(o,i)>-1)r&&r.push(o);else if(c=oe(o),s=ve(h.appendChild(o),"script"),c&&be(s),n)for(u=0;o=s[u++];)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 _e(e,t,n,i,r,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)_e(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=De;else if(!r)return e;return 1===o&&(s=r,r=function(e){return w().off(e),s.apply(this,arguments)},r.guid=s.guid||(s.guid=w.guid++)),e.each((function(){w.event.add(this,t,r,i,n)}))}function Ce(e,t,n){n?(G.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var i,o,s=G.get(this,t);if(1&e.isTrigger&&this[t]){if(s.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(s=r.call(arguments),G.set(this,t,s),i=n(this,t),this[t](),s!==(o=G.get(this,t))||i?G.set(this,t,!1):o={},s!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else s.length&&(G.set(this,t,{value:w.event.trigger(w.extend(s[0],w.Event.prototype),s.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,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=G.get(e);if(X(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&w.find.matchesSelector(re,r),n.guid||(n.guid=w.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(P)||[""]).length;c--;)f=m=(a=qe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(h=w.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=w.event.special[f]||{},u=w.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&w.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,s)||e.addEventListener&&e.addEventListener(f,s)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),w.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,s,a,l,c,u,h,d,f,p,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(P)||[""]).length;c--;)if(f=m=(a=qe.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(h=w.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)u=d[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(e,u));s&&!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[c],n,i,!0);w.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,s,a=new Array(arguments.length),l=w.event.fix(e),c=(G.get(this,"events")||Object.create(null))[l.type]||[],u=w.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=w.event.handlers.call(this,l,c),t=0;(r=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(i=((w.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,r,o,s,a=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],s={},n=0;n<l;n++)void 0===s[r=(i=t[n]).selector+" "]&&(s[r]=i.needsContext?w(r,this).index(c)>-1:w.find(r,this,null,[c]).length),s[r]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l<t.length&&a.push({elem:c,handlers:t.slice(l)}),a},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&&C(t,"input")&&Ce(t,"click",Me),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&C(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&C(t,"input")&&G.get(t,"click")||C(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 Ce(this,e,Se),!1},trigger:function(){return Ce(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,i=this,r=e.relatedTarget,o=e.handleObj;return r&&(r===i||w.contains(i,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),w.fn.extend({on:function(e,t,n,i){return _e(this,e,t,n,i)},one:function(e,t,n,i){return _e(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,w(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);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 ke=/<script|<style|<link/i,Ee=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Te(e,t){return C(e,"table")&&C(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,i,r,o,s,a;if(1===t.nodeType){if(G.hasData(e)&&(a=G.get(e).events))for(r in G.remove(t,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)w.event.add(t,r,a[r][n]);J.hasData(e)&&(o=J.access(e),s=w.extend({},o),J.set(t,s))}}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,i){t=o(t);var r,s,a,l,c,u,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(r){var o=e.eq(r);y&&(t[0]=g.call(this,r,o.html())),Pe(o,t,n,i)}));if(d&&(s=(r=we(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(l=(a=w.map(ve(r,"script"),Ie)).length;h<d;h++)c=r,h!==m&&(c=w.clone(c,!0,!0),l&&w.merge(a,ve(c,"script"))),n.call(e[h],c,h);if(l)for(u=a[a.length-1].ownerDocument,w.map(a,Re),h=0;h<l;h++)c=a[h],ge.test(c.type||"")&&!G.access(c,"globalEval")&&w.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?w._evalUrl&&!c.noModule&&w._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):v(c.textContent.replace(Ae,""),c,u))}return e}function Le(e,t,n){for(var i,r=t?w.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||w.cleanData(ve(i)),i.parentNode&&(n&&oe(i)&&be(ve(i,"script")),i.parentNode.removeChild(i));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(!0),l=oe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(s=ve(a),i=0,r=(o=ve(e)).length;i<r;i++)Oe(o[i],s[i]);if(t)if(n)for(o=o||ve(e),s=s||ve(a),i=0,r=o.length;i<r;i++)Ne(o[i],s[i]);else Ne(e,a);return(s=ve(a,"script")).length>0&&be(s,!l&&ve(e,"script")),a},cleanData:function(e){for(var t,n,i,r=w.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[G.expando]){if(t.events)for(i in t.events)r[i]?w.event.remove(n,i):w.removeEvent(n,i,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,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ye[(me.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<i;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,i=[],r=w(e),o=r.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(r[a])[t](n),s.apply(i,n.get());return this.pushStack(i)}}));var Fe=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),ze=/^--/,je=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},He=function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in i=n.call(e),t)e.style[r]=o[r];return i},Be=new RegExp(ie.join("|"),"i"),Ve="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Ve+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ve+"+$","g");function We(e,t,n){var i,r,o,s,a=ze.test(t),l=e.style;return(n=n||je(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace($e,"$1")||void 0),""!==s||oe(e)||(s=w.style(e,t)),!f.pixelBoxStyles()&&Fe.test(s)&&Be.test(t)&&(i=l.width,r=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=i,l.minWidth=r,l.maxWidth=o)),void 0!==s?s+"":s}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);i="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",s=36===n(t.right),r=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),re.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var i,r,o,s,a,l,c=g.createElement("div"),u=g.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===u.style.backgroundClip,w.extend(f,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,i,r;return null==a&&(t=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",re.appendChild(t).appendChild(n).appendChild(i),r=e.getComputedStyle(n),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===n.offsetHeight,re.removeChild(t)),a}}))}();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 i=ne.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function tt(e,t,n,i,r,o){var s="width"===t?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(l+=w.css(e,n+ie[s],!0,r)),i?("content"===n&&(l-=w.css(e,"padding"+ie[s],!0,r)),"margin"!==n&&(l-=w.css(e,"border"+ie[s]+"Width",!0,r))):(l+=w.css(e,"padding"+ie[s],!0,r),"padding"!==n?l+=w.css(e,"border"+ie[s]+"Width",!0,r):a+=w.css(e,"border"+ie[s]+"Width",!0,r));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l}function nt(e,t,n){var i=je(e),r=(!f.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,i),o=r,s=We(e,t,i),a="offset"+t[0].toUpperCase()+t.slice(1);if(Fe.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===w.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===w.css(e,"boxSizing",!1,i),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+tt(e,t,n||(r?"border":"content"),o,i,s)+"px"}function it(e,t,n,i,r){return new it.prototype.init(e,t,n,i,r)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(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,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,s,a=Y(t),l=ze.test(t),c=e.style;if(l||(t=Ge(a)),s=w.cssHooks[t]||w.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(e,!1,i))?r:c[t];"string"===(o=typeof n)&&(r=ne.exec(n))&&r[1]&&(n=le(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(w.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var r,o,s,a=Y(t);return ze.test(t)||(t=Ge(a)),(s=w.cssHooks[t]||w.cssHooks[a])&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=We(e,t,i)),"normal"===r&&t in Qe&&(r=Qe[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),w.each(["height","width"],(function(e,t){w.cssHooks[t]={get:function(e,n,i){if(n)return!Je.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,i):He(e,Ze,(function(){return nt(e,t,i)}))},set:function(e,n,i){var r,o=je(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===w.css(e,"boxSizing",!1,o),l=i?tt(e,t,i,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),l&&(r=ne.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),et(0,n,l)}}})),w.cssHooks.marginLeft=Ue(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(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 i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+ie[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(w.cssHooks[e+t].set=et)})),w.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var i,r,o={},s=0;if(Array.isArray(t)){for(i=je(e),r=t.length;s<r;s++)o[t[s]]=w.css(e,t[s],!1,i);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)}),e,t,arguments.length>1)}}),w.Tween=it,it.prototype={constructor:it,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.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):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.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)}}},it.propHooks.scrollTop=it.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=it.prototype.init,w.fx.step={};var rt,ot,st=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function lt(){ot&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(lt):e.setTimeout(lt,w.fx.interval),w.fx.tick())}function ct(){return e.setTimeout((function(){rt=void 0})),rt=Date.now()}function ut(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=ie[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ht(e,t,n){for(var i,r=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,t,e))return i}function dt(e,t,n){var i,r,o=0,s=dt.prefilters.length,a=w.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var t=rt||ct(),n=Math.max(0,c.startTime+c.duration-t),i=1-(n/c.duration||0),o=0,s=c.tweens.length;o<s;o++)c.tweens[o].run(i);return a.notifyWith(e,[c,i,n]),i<1&&s?n:(s||a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:rt||ct(),duration:n.duration,tweens:[],createTween:function(t,n){var i=w.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(!function(e,t){var n,i,r,o,s;for(n in e)if(r=t[i=Y(n)],o=e[n],Array.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(s=w.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete e[i],o)n in e||(e[n]=o[n],t[n]=r);else t[i]=r}(u,c.opts.specialEasing);o<s;o++)if(i=dt.prefilters[o].call(c,e,u,c.opts))return p(i.stop)&&(w._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return w.map(u,ht,c),p(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),w.fx.timer(w.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}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,i=0,r=e.length;i<r;i++)n=e[i],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,o,s,a,l,c,u,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&ae(e),g=G.get(e,"fxshow");for(i in n.queue||(null==(s=w._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,w.queue(e,"fx").length||s.empty.fire()}))}))),t)if(r=t[i],st.test(r)){if(delete t[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||w.style(e,i)}if((l=!w.isEmptyObject(t))||!w.isEmptyObject(f))for(i in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=G.get(e,"display")),"none"===(u=w.css(e,"display"))&&(c?u=c:(he([e],!0),c=e.style.display||c,u=w.css(e,"display"),he([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===w.css(e,"float")&&(l||(d.done((function(){p.display=c})),null==c&&(u=p.display,c="none"===u?"":u)),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:c}),o&&(g.hidden=!m),m&&he([e],!0),d.done((function(){for(i in m||he([e]),G.remove(e,"fxshow"),f)w.style(e,i,f[i])}))),l=ht(m?g[i]:0,i,d),i in g||(g[i]=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 i=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?i.duration=0:"number"!=typeof i.duration&&(i.duration in w.fx.speeds?i.duration=w.fx.speeds[i.duration]:i.duration=w.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&w.dequeue(this,i.queue)},i},w.fn.extend({fadeTo:function(e,t,n,i){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=w.isEmptyObject(e),o=w.speed(t,n,i),s=function(){var t=dt(this,w.extend({},e),o);(r||G.get(this,"finish"))&&t.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var i=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,r=null!=e&&e+"queueHooks",o=w.timers,s=G.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&at.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,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),i=n[e+"queue"],r=n[e+"queueHooks"],o=w.timers,s=i?i.length:0;for(n.finish=!0,w.queue(this,e,[]),r&&r.stop&&r.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<s;t++)i[t]&&i[t].finish&&i[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,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,i,r)}})),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){w.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}})),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),rt=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,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}}))},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 i,r,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)||(r=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?ft:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=w.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(P);if(r&&1===e.nodeType)for(;n=r[i++];)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,i){var r,o,s=t.toLowerCase();return i||(o=pt[s],pt[s]=r,r=null!=n(e,t,i)?s:null,pt[s]=o),r}}));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 i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,r=w.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i: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,i,r,o,s;return p(e)?this.each((function(t){w(this).addClass(e.call(this,t,vt(this)))})):(t=bt(e)).length?this.each((function(){if(i=vt(this),n=1===this.nodeType&&" "+yt(i)+" "){for(o=0;o<t.length;o++)r=t[o],n.indexOf(" "+r+" ")<0&&(n+=r+" ");s=yt(n),i!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,i,r,o,s;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(i=vt(this),n=1===this.nodeType&&" "+yt(i)+" "){for(o=0;o<t.length;o++)for(r=t[o];n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s=yt(n),i!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,i,r,o,s=typeof e,a="string"===s||Array.isArray(e);return p(e)?this.each((function(n){w(this).toggleClass(e.call(this,n,vt(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=bt(e),this.each((function(){if(a)for(o=w(this),r=0;r<n.length;r++)i=n[r],o.hasClass(i)?o.removeClass(i):o.addClass(i);else void 0!==e&&"boolean"!==s||((i=vt(this))&&G.set(this,"__className__",i),this.setAttribute&&this.setAttribute("class",i||!1===e?"":G.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)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,i,r=this[0];return arguments.length?(i=p(e),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,w(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=w.map(r,(function(e){return null==e?"":e+""}))),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=w.valHooks[r.type]||w.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.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,i,r=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=w(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,i,r=e.options,o=w.makeArray(t),s=r.length;s--;)((i=r[s]).selected=w.inArray(w.valHooks.option.get(i),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,i,r){var o,s,a,l,c,h,d,f,y=[i||g],v=u.call(t,"type")?t.type:t,b=u.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!wt.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),c=v.indexOf(":")<0&&"on"+v,(t=t[w.expando]?t:new w.Event(v,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[v]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!m(i)){for(l=d.delegateType||v,wt.test(l+v)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(i.ownerDocument||g)&&y.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=y[o++])&&!t.isPropagationStopped();)f=s,t.type=o>1?l:d.bindType||v,(h=(G.get(s,"events")||Object.create(null))[t.type]&&G.get(s,"handle"))&&h.apply(s,n),(h=c&&s[c])&&h.apply&&X(s)&&(t.result=h.apply(s,n),!1===t.result&&t.preventDefault());return t.type=v,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!X(i)||c&&p(i[v])&&!m(i)&&((a=i[c])&&(i[c]=null),w.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,qt),i[v](),t.isPropagationStopped()&&f.removeEventListener(v,qt),w.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(e,t,n){var i=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(i,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 i=this.ownerDocument||this.document||this,r=G.access(i,t);r||i.addEventListener(e,n,!0),G.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=G.access(i,t)-1;r?G.access(i,t,r):(i.removeEventListener(e,n,!0),G.remove(i,t))}}}));var Mt=e.location,Dt={guid:Date.now()},St=/\?/;w.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||w.error("Invalid XML: "+(i?w.map(i.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var _t=/\[\]$/,Ct=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function At(e,t,n,i){var r;if(Array.isArray(t))w.each(t,(function(t,r){n||_t.test(e)?i(e,r):At(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==b(t))i(e,t);else for(r in t)At(e+"["+r+"]",t[r],n,i)}w.param=function(e,t){var n,i=[],r=function(e,t){var n=p(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,(function(){r(this.name,this.value)}));else for(n in e)At(n,e[n],t,r);return i.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)&&!kt.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(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}});var Tt=/%20/g,It=/#.*$/,Rt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Lt={},Ft={},zt="*/".concat("*"),jt=g.createElement("a");function Ht(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(P)||[];if(p(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Bt(e,t,n,i){var r={},o=e===Ft;function s(a){var l;return r[a]=!0,w.each(e[a]||[],(function(e,a){var c=a(t,n,i);return"string"!=typeof c||o||r[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)})),l}return s(t.dataTypes[0])||!r["*"]&&s("*")}function Vt(e,t){var n,i,r=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&w.extend(!0,e,i),e}jt.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(Ft),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,r,o,s,a,l,c,u,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(c){if(!s)for(s={};t=Nt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=q[e.toLowerCase()]=q[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)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 i&&i.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=jt.protocol+"//"+jt.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),c)return D;for(h in(u=w.event&&f.global)&&0==w.active++&&w.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),r=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(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(St.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Rt,"$1"),d=(St.test(r)?"&":"?")+"_="+Dt.guid+++d),f.url=r+d),f.ifModified&&(w.lastModified[r]&&D.setRequestHeader("If-Modified-Since",w.lastModified[r]),w.etag[r]&&D.setRequestHeader("If-None-Match",w.etag[r])),(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)||c))return D.abort();if(M="abort",v.add(f.complete),D.done(f.success),D.fail(f.error),i=Bt(Ft,f,n,D)){if(D.readyState=1,u&&m.trigger("ajaxSend",[D,f]),c)return D;f.async&&f.timeout>0&&(a=e.setTimeout((function(){D.abort("timeout")}),f.timeout));try{c=!1,i.send(x,S)}catch(e){if(c)throw e;S(-1,e)}}else S(-1,"No Transport");function S(t,n,s,l){var h,d,g,x,q,M=n;c||(c=!0,a&&e.clearTimeout(a),i=void 0,o=l||"",D.readyState=t>0?4:0,h=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var i,r,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,D,s)),!h&&w.inArray("script",f.dataTypes)>-1&&w.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,i){var r,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(s=c[l+" "+o]||c["* "+o]))for(r in c)if((a=r.split(" "))[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[r]:!0!==c[r]&&(o=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?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[r]=q),(q=D.getResponseHeader("etag"))&&(w.etag[r]=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,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[D,f,h?d:g]),v.fireWith(p,[D,M]),u&&(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,i,r){return p(n)&&(r=r||i,i=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:r,data:n,success:i},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 $t={0:200,1223:204},Wt=w.ajaxSettings.xhr();f.cors=!!Wt&&"withCredentials"in Wt,f.ajax=Wt=!!Wt,w.ajaxTransport((function(t){var n,i;if(f.cors||Wt&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);n=function(e){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o($t[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&i()}))},n=n("abort");try{a.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(i,r){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Ut,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,i){var r,o,s,a=!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(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Xt,"$1"+r):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||w.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){s=arguments},i.always((function(){void 0===o?w(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(r)),s&&p(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Ut=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),o=!n&&[],(r=k.exec(e))?[t.createElement(r[1])]:(r=we([e],t,o),o&&o.length&&w(o).remove(),w.merge([],r.childNodes)));var i,r,o},w.fn.load=function(e,t,n){var i,r,o,s=this,a=e.indexOf(" ");return a>-1&&(i=yt(e.slice(a)),e=e.slice(0,a)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&w.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(i?w("<div>").append(w.parseHTML(e)).find(i):e)})).always(n&&function(e,t){s.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 i,r,o,s,a,l,c=w.css(e,"position"),u=w(e),h={};"static"===c&&(e.style.position="relative"),a=u.offset(),o=w.css(e,"top"),l=w.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(s=(i=u.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),p(t)&&(t=t.call(e,n,w.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):u.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,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.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,i=this[0],r={top:0,left:0};if("fixed"===w.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),r.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-w.css(i,"marginTop",!0),left:t.left-r.left-w.css(i,"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(i){return V(this,(function(e,i,r){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r}),e,i,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=Ue(f.pixelPosition,(function(e,n){if(n)return n=We(e,t),Fe.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,i){w.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return V(this,(function(t,n,r){var o;return m(t)?0===i.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===r?w.css(t,n,a):w.style(t,n,r,a)}),t,s?r:void 0,s)}}))})),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,i){return this.on(t,e,n,i)},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,i,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return i=r.call(arguments,2),o=function(){return e.apply(t||this,i.concat(r.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=C,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 o=i,s={"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},l=/([astvzqmhlc])([^astvzqmhlc]*)/gi,c=/-?[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(l,(function(e,n,i){var r=n.toLowerCase(),o=function(e){var t=e.match(c);return t?t.map(Number):[]}(i),s=n;if("m"===r&&o.length>2&&(t.push([s].concat(o.splice(0,2))),r="l",s="m"===s?"l":"L"),o.length<a[r])return"";for(t.push([s].concat(o.splice(0,a[r])));o.length>=a[r]&&o.length&&a[r];)t.push([s].concat(o.splice(0,a[r])));return""})),t};function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(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,i=new Array(t);n<t;n++)i[n]=e[n];return i}var p=u;function m(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),i=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=i}function g(e,t,n){e.x+=t,e.y+=n}function y(e,t){e.x*=t,e.y*=t}var 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,d(t.segments)):t&&(this.segments=p(t))}var t,n,i;return t=e,n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,d(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,i,r,o){this.segments.push(["AC",e,t,n,i,r,!!o])}},{key:"arcTo",value:function(e,t,n,i,r){this.segments.push(["AT",e,t,n,i,r])}},{key:"ellipse",value:function(e,t,n,i,r,o,s,a){this.segments.push(["E",e,t,n,i,r,o,s,!!a])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,i,r,o){this.segments.push(["C",e,t,n,i,r,o])}},{key:"quadraticCurveTo",value:function(e,t,n,i){this.segments.push(["Q",e,t,n,i])}},{key:"rect",value:function(e,t,n,i){this.segments.push(["R",e,t,n,i])}}],n&&h(t.prototype,n),i&&h(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,i=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var r="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(r=t[1]);var s=t[0];o(this,s.segments),n.call(this,r)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),i.call(this)):i.call(this)};var r=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 i=t[1],s=t[2],a=t[3]||"nonzero",l=t[0];return o(this,l.segments),r.apply(this,[i,s,a])}return r.apply(this,t)},e.Path2D=t}function o(e,t){var n,i,r,o,s,a,l,c,u,h,d,f,p,v,b,x,w,q,M,D,S,_,C,k,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&&(_=null,C=null),"T"!==D&&"t"!==D&&"Q"!==D&&"q"!==D&&(k=null,E=null),D){case"m":case"M":"m"===D?(d+=N[1],p+=N[2]):(d=N[1],p=N[2]),"M"!==D&&T||(T={x:d,y:p}),e.moveTo(d,p);break;case"l":d+=N[1],p+=N[2],e.lineTo(d,p);break;case"L":d=N[1],p=N[2],e.lineTo(d,p);break;case"H":d=N[1],e.lineTo(d,p);break;case"h":d+=N[1],e.lineTo(d,p);break;case"V":p=N[1],e.lineTo(d,p);break;case"v":p+=N[1],e.lineTo(d,p);break;case"a":case"A":"a"===D?(d+=N[6],p+=N[7]):(d=N[6],p=N[7]),x=N[1],w=N[2],l=N[3]*Math.PI/180,r=!!N[4],o=!!N[5],s={x:d,y:p},m(a={x:(I.x-s.x)/2,y:(I.y-s.y)/2},-l),(c=a.x*a.x/(x*x)+a.y*a.y/(w*w))>1&&(x*=c=Math.sqrt(c),w*=c),u=x*x*w*w,h=x*x*a.y*a.y+w*w*a.x*a.x,y(S={x:x*a.y/w,y:-w*a.x/x},o!==r?Math.sqrt((u-h)/h)||0:-Math.sqrt((u-h)/h)||0),i=Math.atan2((a.y-S.y)/w,(a.x-S.x)/x),n=Math.atan2(-(a.y+S.y)/w,-(a.x+S.x)/x),m(S,l),g(S,(s.x+I.x)/2,(s.y+I.y)/2),e.save(),e.translate(S.x,S.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,!o),e.restore();break;case"C":_=N[3],C=N[4],d=N[5],p=N[6],e.bezierCurveTo(N[1],N[2],_,C,d,p);break;case"c":e.bezierCurveTo(N[1]+d,N[2]+p,N[3]+d,N[4]+p,N[5]+d,N[6]+p),_=N[3]+d,C=N[4]+p,d+=N[5],p+=N[6];break;case"S":null!==_&&null!==C||(_=d,C=p),e.bezierCurveTo(2*d-_,2*p-C,N[1],N[2],N[3],N[4]),_=N[1],C=N[2],d=N[3],p=N[4];break;case"s":null!==_&&null!==C||(_=d,C=p),e.bezierCurveTo(2*d-_,2*p-C,N[1]+d,N[2]+p,N[3]+d,N[4]+p),_=N[1]+d,C=N[2]+p,d+=N[3],p+=N[4];break;case"Q":k=N[1],E=N[2],d=N[3],p=N[4],e.quadraticCurveTo(k,E,d,p);break;case"q":k=N[1]+d,E=N[2]+p,d+=N[3],p+=N[4],e.quadraticCurveTo(k,E,d,p);break;case"T":null!==k&&null!==E||(k=d,E=p),k=2*d-k,E=2*p-E,d=N[1],p=N[2],e.quadraticCurveTo(k,E,d,p);break;case"t":null!==k&&null!==E||(k=d,E=p),k=2*d-k,E=2*p-E,d+=N[1],p+=N[2],e.quadraticCurveTo(k,E,d,p);break;case"z":case"Z":d=T.x,p=T.y,T=void 0,e.closePath();break;case"AC":d=N[1],p=N[2],b=N[3],i=N[4],n=N[5],A=N[6],e.arc(d,p,b,i,n,A);break;case"AT":f=N[1],v=N[2],d=N[3],p=N[4],b=N[5],e.arcTo(f,v,d,p,b);break;case"E":d=N[1],p=N[2],x=N[3],w=N[4],l=N[5],i=N[6],n=N[7],A=N[8],e.save(),e.translate(d,p),e.rotate(l),e.scale(x,w),e.arc(0,0,1,i,n,A),e.restore();break;case"R":d=N[1],p=N[2],q=N[3],M=N[4],T={x:d,y:p},e.rect(d,p,q,M)}I.x=d,I.y=p}}},b=u,x=v;"undefined"!=typeof window&&x(window);var w={path2dPolyfill:x,parsePath:b},q=Object.prototype.hasOwnProperty,M=Object.prototype.toString,D=Object.defineProperty,S=Object.getOwnPropertyDescriptor,_=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===M.call(e)},C=function(e){if(!e||"[object Object]"!==M.call(e))return!1;var t,n=q.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&q.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||q.call(e,t)},k=function(e,t){D&&"__proto__"===t.name?D(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},E=function(e,t){if("__proto__"===t){if(!q.call(e,t))return;if(S)return S(e,t).value}return e[t]},A=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=E(a,n),a!==(r=E(t,n))&&(u&&r&&(C(r)||(o=_(r)))?(o?(o=!1,s=i&&_(i)?i:[]):s=i&&C(i)?i:{},k(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&k(a,{name:n,newValue:r}));return a},T="2.2.2";function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){return!!e.changedTouches}function P(e){return"number"==typeof e&&!isNaN(e)}function L(e){return"number"!=typeof e||isNaN(e)}function F(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),i=isNaN(i)?e[s].x:Math.max(i,e[s].x),r=isNaN(r)?e[s].y:Math.min(r,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,r,i,o]}function z(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function j(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 H(e){const[t,n,i,r]=F(e);return{x:t,y:n,width:i-t,height:r-n}}function B(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function V(e){const{x:t,y:n,width:i,height:r,x1:o,x2:s,y1:a,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return P(c)&&P(u)&&P(h)?"circle":P(o)&&P(s)&&P(a)&&P(l)?"line":P(t)&&P(n)&&P(i)&&P(r)?"rect":P(t)&&P(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function $(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function W(e,t){let{types:n,logger:i}=t;const r={},o=[];Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});r[n]=s}}));return e=>e?r[e]:r[Object.keys(r)[0]]}var U=Math.PI,Y=2*U,X=1e-6,K=Y-X;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function J(){return new G}function Z(e){return function(){return e}}G.prototype=J.prototype={constructor:G,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,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-e,l=i-t,c=o-e,u=s-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>X)if(Math.abs(u*a-l*c)>X&&r){var d=n-o,f=i-s,p=a*a+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((U-Math.acos((p+h-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>X&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+x*a)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var s=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=e+s,c=t+a,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>X||Math.abs(this._y1-c)>X)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Y+Y),h>K?this._+="A"+n+","+n+",0,1,"+u+","+(e-s)+","+(t-a)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>X&&(this._+="A"+n+","+n+",0,"+ +(h>=U)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var Q=Math.abs,ee=Math.atan2,te=Math.cos,ne=Math.max,ie=Math.min,re=Math.sin,oe=Math.sqrt,se=1e-12,ae=Math.PI,le=ae/2,ce=2*ae;function ue(e){return e>1?0:e<-1?ae:Math.acos(e)}function he(e){return e>=1?le:e<=-1?-le:Math.asin(e)}function de(e){return e.innerRadius}function fe(e){return e.outerRadius}function pe(e){return e.startAngle}function me(e){return e.endAngle}function ge(e){return e&&e.padAngle}function ye(e,t,n,i,r,o,s,a){var l=n-e,c=i-t,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<se))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}function ve(e,t,n,i,r,o,s){var a=e-n,l=t-i,c=(s?o:-o)/oe(a*a+l*l),u=c*l,h=-c*a,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,v=p-d,b=m-f,x=v*v+b*b,w=r-o,q=d*m-p*f,M=(b<0?-1:1)*oe(ne(0,w*w*x-q*q)),D=(q*b-v*M)/x,S=(-q*v-b*M)/x,_=(q*b+v*M)/x,C=(-q*v+b*M)/x,k=D-g,E=S-y,A=_-g,T=C-y;return k*k+E*E>A*A+T*T&&(D=_,S=C),{cx:D,cy:S,x01:-u,y01:-h,x11:D*(r/w-1),y11:S*(r/w-1)}}function be(){var e=de,t=fe,n=Z(0),i=null,r=pe,o=me,s=ge,a=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-le,f=o.apply(this,arguments)-le,p=Q(f-d),m=f>d;if(a||(a=l=J()),h<u&&(c=h,h=u,u=c),h>se)if(p>ce-se)a.moveTo(h*te(d),h*re(d)),a.arc(0,0,h,d,f,!m),u>se&&(a.moveTo(u*te(f),u*re(f)),a.arc(0,0,u,f,d,m));else{var g,y,v=d,b=f,x=d,w=f,q=p,M=p,D=s.apply(this,arguments)/2,S=D>se&&(i?+i.apply(this,arguments):oe(u*u+h*h)),_=ie(Q(h-u)/2,+n.apply(this,arguments)),C=_,k=_;if(S>se){var E=he(S/u*re(D)),A=he(S/h*re(D));(q-=2*E)>se?(x+=E*=m?1:-1,w-=E):(q=0,x=w=(d+f)/2),(M-=2*A)>se?(v+=A*=m?1:-1,b-=A):(M=0,v=b=(d+f)/2)}var T=h*te(v),I=h*re(v),R=u*te(w),N=u*re(w);if(_>se){var O,P=h*te(b),L=h*re(b),F=u*te(x),z=u*re(x);if(p<ae&&(O=ye(T,I,F,z,P,L,R,N))){var j=T-O[0],H=I-O[1],B=P-O[0],V=L-O[1],$=1/re(ue((j*B+H*V)/(oe(j*j+H*H)*oe(B*B+V*V)))/2),W=oe(O[0]*O[0]+O[1]*O[1]);C=ie(_,(u-W)/($-1)),k=ie(_,(h-W)/($+1))}}M>se?k>se?(g=ve(F,z,T,I,h,k,m),y=ve(P,L,R,N,h,k,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),k<_?a.arc(g.cx,g.cy,k,ee(g.y01,g.x01),ee(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,k,ee(g.y01,g.x01),ee(g.y11,g.x11),!m),a.arc(0,0,h,ee(g.cy+g.y11,g.cx+g.x11),ee(y.cy+y.y11,y.cx+y.x11),!m),a.arc(y.cx,y.cy,k,ee(y.y11,y.x11),ee(y.y01,y.x01),!m))):(a.moveTo(T,I),a.arc(0,0,h,v,b,!m)):a.moveTo(T,I),u>se&&q>se?C>se?(g=ve(R,N,P,L,u,-C,m),y=ve(T,I,F,z,u,-C,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),C<_?a.arc(g.cx,g.cy,C,ee(g.y01,g.x01),ee(y.y01,y.x01),!m):(a.arc(g.cx,g.cy,C,ee(g.y01,g.x01),ee(g.y11,g.x11),!m),a.arc(0,0,u,ee(g.cy+g.y11,g.cx+g.x11),ee(y.cy+y.y11,y.cx+y.x11),m),a.arc(y.cx,y.cy,C,ee(y.y11,y.x11),ee(y.y01,y.x01),!m))):a.arc(0,0,u,w,x,m):a.lineTo(R,N)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-ae/2;return[te(i)*n,re(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Z(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Z(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),l):o},l.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:Z(+e),l):s},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}function xe(e){this._context=e}function we(e){return new xe(e)}function qe(e){return e[0]}function Me(e){return e[1]}function De(){var e=qe,t=null,n=Z(0),i=Me,r=Z(!0),o=null,s=we,a=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(a=s(f=J())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=u;--h)a.point(g[h],y[h]);a.lineEnd(),a.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),a.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return a=null,f+""||null}function c(){return function(){var e=qe,t=Me,n=Z(!0),i=null,r=we,o=null;function s(s){var a,l,c,u=s.length,h=!1;for(null==i&&(o=r(c=J())),a=0;a<=u;++a)!(a<u&&n(l=s[a],a,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,a,s),+t(l,a,s));if(c)return o=null,c+""||null}return s.x=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:Z(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:Z(!!e),s):n},s.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),s):r},s.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),s):i},s}().defined(r).curve(s).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:Z(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:Z(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:Z(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Z(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:Z(!!e),l):r},l.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),l):s},l.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),l):o},l}function Se(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function _e(e){return e}xe.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 Ce=Array.prototype.slice;function ke(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 Ee(e){this._context=e}function Ae(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 Te(e,t){this._context=e,this._k=(1-t)/6}Ee.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:ke(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:ke(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Te.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:Ae(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:Ae(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 Ie=function e(t){function n(e){return new Te(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Re(e,t){this._context=e,this._alpha=t}Re.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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(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 i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>se){var a=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);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>se){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,s,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 Ne=function e(t){function n(e){return t?new Re(e,t):new Te(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Oe(e){return e<0?-1:1}function Pe(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(Oe(o)+Oe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Le(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Fe(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function ze(e){this._context=e}function je(e){this._context=new He(e)}function He(e){this._context=e}function Be(e){this._context=e}function Ve(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(r[i-1]=s[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function $e(e,t){this._context=e,this._t=t}function We(e,t){if((r=e.length)>1)for(var n,i,r,o=1,s=e[t[0]],a=s.length;o<r;++o)for(i=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Ue(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ye(e,t){return e[t]}function Xe(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function Ke(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function Ge(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function a(e){return r[e]||o.get(e)}function l(e){return!!r[e]||o.has(e)}function c(e){const t=r[e];return delete r[e],t}function u(){return Object.keys(r)}function h(){return Object.keys(r).map((e=>r[e]))}function d(e){return void 0!==e&&(t=e),t}function f(e,r){if(void 0!==r)return s(e,r);const o=a(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),f.add=s,f.get=a,f.has=l,f.remove=c,f.getKeys=u,f.getValues=h,f.default=d,f.register=s,f}function Je(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Ze(e){return(e=Je(Math.abs(e)))?e[1]:NaN}ze.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:Fe(this,this._t0,Le(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,Fe(this,Le(this,n=Pe(this,e,t)),n);break;default:Fe(this,this._t0,n=Pe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(je.prototype=Object.create(ze.prototype)).point=function(e,t){ze.prototype.point.call(this,t,e)},He.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,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},Be.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 i=Ve(e),r=Ve(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(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)}},$e.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 Qe,et=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tt(e){if(!(t=et.exec(e)))throw new Error("invalid format: "+e);var t;return new nt({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 nt(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 it(e,t){var n=Je(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}tt.prototype=nt.prototype,nt.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 rt={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>it(100*e,t),r:it,s:function(e,t){var n=Je(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(Qe=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Je(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ot(e){return e}var st,at,lt,ct=Array.prototype.map,ut=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ht(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?ot:(t=ct.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?ot:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(ct.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=tt(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"):rt[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",w=rt[v],q=/[defgprs%]/.test(v);function M(e){var r,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)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),D&&0==+e&&"+"!==h&&(D=!1),d=(D?"("===h?h:c:"-"===h||"("===h?"":h)+d,M=("s"===v?ut[8+Qe/3]:"")+M+(D&&"("===h?")":""),q)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){M=(46===l?s+e.slice(r+1):e.slice(r))+M,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var S=d.length+e.length+M.length,_=S<p?new Array(p-S+1).join(t):"";switch(m&&f&&(e=i(_+e,_.length?p-M.length:1/0),_=""),n){case"<":e=d+e+M+_;break;case"=":e=d+_+e+M;break;case"^":e=_.slice(0,S=_.length>>1)+d+e+M+_.slice(S);break;default:e=_+d+e+M}return a(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=tt(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Ze(t)/3))),r=Math.pow(10,-i),o=ut[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){st=ht(e),at=st.format,lt=st.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const dt=new Date,ft=new Date;function pt(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<i);return s},r.filter=n=>pt((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(dt.setTime(+t),ft.setTime(+i),e(dt),e(ft),Math.floor(n(dt,ft))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const mt=6e4,gt=864e5,yt=6048e5,vt=pt((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mt)/gt),(e=>e.getDate()-1));vt.range;const bt=pt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>e.getUTCDate()-1));bt.range;const xt=pt((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/gt),(e=>Math.floor(e/gt)));function wt(e){return pt((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*mt)/yt))}xt.range;const qt=wt(0),Mt=wt(1),Dt=wt(2),St=wt(3),_t=wt(4),Ct=wt(5),kt=wt(6);function Et(e){return pt((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/yt))}qt.range,Mt.range,Dt.range,St.range,_t.range,Ct.range,kt.range;const At=Et(0),Tt=Et(1),It=Et(2),Rt=Et(3),Nt=Et(4),Ot=Et(5),Pt=Et(6);At.range,Tt.range,It.range,Rt.range,Nt.range,Ot.range,Pt.range;const Lt=pt((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Lt.every=e=>isFinite(e=Math.floor(e))&&e>0?pt((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Lt.range;const Ft=pt((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function zt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=zt,n=(t,n)=>zt(e(t),n),i=(t,n)=>e(t)-n):(t=e===zt||e===jt?e:Bt,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const s=r(e,t,n,o-1);return s>n&&i(e[s-1],t)>-i(e[s],t)?s-1:s},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function Bt(){return 0}Ft.every=e=>isFinite(e=Math.floor(e))&&e>0?pt((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Ft.range;const Vt=Ht(zt).right;Ht((function(e){return null===e?NaN:+e})).center;var $t=Vt;class Wt extends Map{constructor(e,t=Yt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Ut(this,e))}has(e){return super.has(Ut(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function Ut({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Yt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Xt=Math.sqrt(50),Kt=Math.sqrt(10),Gt=Math.sqrt(2);function Jt(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=Xt?10:o>=Kt?5:o>=Gt?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?Jt(e,t,2*n):[a,l,c]}function Zt(e,t,n){return Jt(e=+e,t=+t,n=+n)[2]}function Qt(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}function en(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 tn(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 nn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rn(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=hn(r),u=dn(r),h=hn(o),d=dn(o),f=hn(s),p=dn(s),m=hn(a),g=dn(a),y=hn(l),v=dn(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:Rn,e:Rn,f:Fn,g:Kn,G:Jn,H:Nn,I:On,j:Pn,L:Ln,m:zn,M:jn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:xi,s:wi,S:Hn,u:Bn,U:Vn,V:Wn,w:Un,W:Yn,x:null,X:null,y:Xn,Y:Gn,Z:Zn,"%":bi},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Qn,e:Qn,f:ri,g:mi,G:yi,H:ei,I:ti,j:ni,L:ii,m:oi,M:si,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:xi,s:wi,S:ai,u:li,U:ci,V:hi,w:di,W:fi,x:null,X:null,y:pi,Y:gi,Z:vi,"%":bi},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return D(e,t,n,i)},d:Mn,e:Mn,f:En,g:bn,G:vn,H:Sn,I:Sn,j:Dn,L:kn,m:qn,M:_n,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:wn,Q:Tn,s:In,S:Cn,u:pn,U:mn,V:gn,w:fn,W:yn,x:function(e,t,i){return D(e,n,t,i)},X:function(e,t,n){return D(e,i,t,n)},y:bn,Y:vn,Z:xn,"%":An};function q(e,t){return function(n){var i,r,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(r=on[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function M(e,t){return function(n){var i,r,o=nn(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?(r=(i=tn(nn(o.y,0,1))).getUTCDay(),i=r>4||0===r?Tt.ceil(i):Tt(i),i=bt.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=en(nn(o.y,0,1))).getDay(),i=r>4||0===r?Mt.ceil(i):Mt(i),i=vt.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.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),r="Z"in o?tn(nn(o.y,0,1)).getUTCDay():en(nn(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,tn(o)):en(o)}}function D(e,t,n,i){for(var r,o,s=0,a=t.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(s++))){if(r=t.charAt(s++),!(o=w[r in on?t.charAt(s++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=q(n,b),b.X=q(i,b),b.c=q(t,b),x.x=q(n,x),x.X=q(i,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}}}var on={"-":"",_:" ",0:"0"},sn=/^\s*\d+/,an=/^%/,ln=/[\\^$*+?|[\]().{}]/g;function cn(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function un(e){return e.replace(ln,"\\$&")}function hn(e){return new RegExp("^(?:"+e.map(un).join("|")+")","i")}function dn(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function fn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function pn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function mn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function gn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function yn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function vn(e,t,n){var i=sn.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function bn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function xn(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function wn(e,t,n){var i=sn.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function qn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Mn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Dn(e,t,n){var i=sn.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Sn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function _n(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Cn(e,t,n){var i=sn.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function kn(e,t,n){var i=sn.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function En(e,t,n){var i=sn.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function An(e,t,n){var i=an.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Tn(e,t,n){var i=sn.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function In(e,t,n){var i=sn.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Rn(e,t){return cn(e.getDate(),t,2)}function Nn(e,t){return cn(e.getHours(),t,2)}function On(e,t){return cn(e.getHours()%12||12,t,2)}function Pn(e,t){return cn(1+vt.count(Lt(e),e),t,3)}function Ln(e,t){return cn(e.getMilliseconds(),t,3)}function Fn(e,t){return Ln(e,t)+"000"}function zn(e,t){return cn(e.getMonth()+1,t,2)}function jn(e,t){return cn(e.getMinutes(),t,2)}function Hn(e,t){return cn(e.getSeconds(),t,2)}function Bn(e){var t=e.getDay();return 0===t?7:t}function Vn(e,t){return cn(qt.count(Lt(e)-1,e),t,2)}function $n(e){var t=e.getDay();return t>=4||0===t?_t(e):_t.ceil(e)}function Wn(e,t){return e=$n(e),cn(_t.count(Lt(e),e)+(4===Lt(e).getDay()),t,2)}function Un(e){return e.getDay()}function Yn(e,t){return cn(Mt.count(Lt(e)-1,e),t,2)}function Xn(e,t){return cn(e.getFullYear()%100,t,2)}function Kn(e,t){return cn((e=$n(e)).getFullYear()%100,t,2)}function Gn(e,t){return cn(e.getFullYear()%1e4,t,4)}function Jn(e,t){var n=e.getDay();return cn((e=n>=4||0===n?_t(e):_t.ceil(e)).getFullYear()%1e4,t,4)}function Zn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+cn(t/60|0,"0",2)+cn(t%60,"0",2)}function Qn(e,t){return cn(e.getUTCDate(),t,2)}function ei(e,t){return cn(e.getUTCHours(),t,2)}function ti(e,t){return cn(e.getUTCHours()%12||12,t,2)}function ni(e,t){return cn(1+bt.count(Ft(e),e),t,3)}function ii(e,t){return cn(e.getUTCMilliseconds(),t,3)}function ri(e,t){return ii(e,t)+"000"}function oi(e,t){return cn(e.getUTCMonth()+1,t,2)}function si(e,t){return cn(e.getUTCMinutes(),t,2)}function ai(e,t){return cn(e.getUTCSeconds(),t,2)}function li(e){var t=e.getUTCDay();return 0===t?7:t}function ci(e,t){return cn(At.count(Ft(e)-1,e),t,2)}function ui(e){var t=e.getUTCDay();return t>=4||0===t?Nt(e):Nt.ceil(e)}function hi(e,t){return e=ui(e),cn(Nt.count(Ft(e),e)+(4===Ft(e).getUTCDay()),t,2)}function di(e){return e.getUTCDay()}function fi(e,t){return cn(Tt.count(Ft(e)-1,e),t,2)}function pi(e,t){return cn(e.getUTCFullYear()%100,t,2)}function mi(e,t){return cn((e=ui(e)).getUTCFullYear()%100,t,2)}function gi(e,t){return cn(e.getUTCFullYear()%1e4,t,4)}function yi(e,t){var n=e.getUTCDay();return cn((e=n>=4||0===n?Nt(e):Nt.ceil(e)).getUTCFullYear()%1e4,t,4)}function vi(){return"+0000"}function bi(){return"%"}function xi(e){return+e}function wi(e){return Math.floor(+e/1e3)}const qi=Ge();qi("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=ht(t),r=i.format(e),this},s(),o.format=function(e,r,o,a){return(o||a)&&(t=o,n=a,s()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),qi("d3-time",(function(e){let t=rn({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 i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=rn(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Mi={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return qi(t.type||"d3-number")(t.format||"")})(e)};function Di(e){let{id:t=Mi.id,key:n=Mi.key,min:i=Mi.min,max:r=Mi.max,type:o=Mi.type,tags:s=Mi.tags,title:a=Mi.title,values:l=Mi.values,value:c=Mi.value,label:u=Mi.label,formatter:h=Mi.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const d={id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>s(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>a(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u};return d}function Si(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}const _i=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Ci=e=>e.reduce(((e,t)=>e+t),0),ki={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=_i(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=_i(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=_i(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=_i(e),n=t.length;return n?Ci(t)/n:NaN}};function Ei(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((s=>{const a=n[s],l=r[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map((n=>Ei(e,t,{main:n},i).main)):void 0!==a.field?(l.type="field",l.field=t.field(a.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 a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=ki[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?ki[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=ki[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?ki[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Ai(e,t){const{main:n}=Ei(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Ei(e,t,e.props||{},n),main:n}}function Ti(e,t,n,i){const r=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=i?e[t][i]:e[t],r[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function Ii(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const s=n.field.formatter(),a={};return i.forEach((e=>{a[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Ti(e.items,n,s);return i.forEach((n=>{t[n]=Ti(e.items,r[n],a[n],n)})),t}))),o}function Ri(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:s}=e;const a="function"===s?t.trackBy(n):n[t.trackBy];let l=o[a];l||(l=o[a]={items:[],id:a},r.push(l)),l.items.push(i)}function Ni(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function Oi(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const Pi={diverging:function(e,t){if((a=e.length)>0)for(var n,i,r,o,s,a,l=0,c=e[t[0]].length;l<c;++l)for(o=s=0,n=0;n<a;++n)(r=(i=e[t[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=s,i[0]=s+=r):i[0]=o},none:We,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var s=0,a=0;s<n;++s)a+=e[s][i][1]||0;r[i][1]+=r[i][0]=-a/2}We(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,s=e[0].length;o<s;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}We(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,s=1;s<i;++s){for(var a=0,l=0,c=0;a<r;++a){for(var u=e[t[a]],h=u[s][1]||0,d=(h-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];d+=(p[s][1]||0)-(p[s-1][1]||0)}l+=h,c+=d*h}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,We(e,t)}}},Li={ascending:function(e){var t=e.map(Ke);return Ue(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(Ke),o=function(e){var t=e.map(Xe);return Ue(e).sort((function(e,n){return t[e]-t[n]}))}(e),s=0,a=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],s<a?(s+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},none:Ue,reverse:function(e){return Ue(e).reverse()}};function Fi(e,t,n){const i={},r=t.stackKey,o=t.value,s=t.startProp||"start",a=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let s=r(n);i[s]=i[s]||{items:[]},i[s].items.push(n),h=Math.max(h,i[s].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((e=>i[e].items)),m=function(){var e=Z([]),t=Ue,n=We,i=Ye;function r(r){var o,s,a=e.apply(this,arguments),l=r.length,c=a.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=a[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,s=t(u);o<c;++o)u[s[o]].index=o;return n(u,s),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:Z(Ce.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:Z(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?Ue:"function"==typeof e?e:Z(Ce.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?We:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(Li[c]).offset(Pi[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[s]={value:n[0]},i[a]={value:n[1]},y.push(n[0],n[1]))}}let v=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const b=Di({title:v.map((e=>e.title())).join(", "),min:Oi(y),max:Ni(y),type:"measure",formatter:v[0]?v[0].formatter:void 0});e.fields.push(b)}function zi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};const r=n.logger;if(Array.isArray(e))i.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)i=R({},t.collection(e.collection));else{const n=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),i.items=[];else if(e.hierarchy)i.root=n.hierarchy?n.hierarchy(e.hierarchy):null,i.fields=n.fields();else if(e.items)i.items=e.items.map((e=>({value:o(e),label:String(s(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];i.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):n;r&&(i.items=[...i.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(i.fields=o),e.amend&&Array.isArray(e.amend)&&(i.items=[...i.items,...e.amend])}else if(void 0!==e.field&&n){const t=n.field(e.field);t&&(i.fields||(i.fields=[]),i.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),i.value=o),i.items=t.items().map((t=>({value:o(t),label:String(s(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):n;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(i.fields||(i.fields=[]),i.fields.push(o))}));i.items&&e.map&&(i.items=i.items.map(e.map))}e&&e.stack&&Fi(i,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&i.items&&(i.items=i.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&i.items&&(i.items=i.items.sort(e.sort)),i}function ji(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zi;const r={};(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)}));const o=e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=A(i,{fields:e}))}return i};return o}function Hi(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zi;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Bi(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hi;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}function Vi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const $i=Symbol("implicit");function Wi(){var e=new Wt,t=[],n=[],i=$i;function r(r){let o=e.get(r);if(void 0===o){if(i!==$i)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Wt;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return Wi(t,n).unknown(i)},Vi.apply(r,arguments),r}function Ui(){var e,t,n=Wi().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;e=(f-d)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),a&&(d=Math.round(d),t=Math.round(t));var p=Qt(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,h()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return Ui(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},Vi.apply(h(),arguments)}function Yi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ki(){}var Gi=.7,Ji=1/Gi,Zi="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tr=/^#([0-9a-f]{3,8})$/,nr=new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`),ir=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),rr=new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${Qi}\\)$`),or=new RegExp(`^rgba\\(${er},${er},${er},${Qi}\\)$`),sr=new RegExp(`^hsl\\(${Qi},${er},${er}\\)$`),ar=new RegExp(`^hsla\\(${Qi},${er},${er},${Qi}\\)$`),lr={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 cr(){return this.rgb().formatHex()}function ur(){return this.rgb().formatRgb()}function hr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?dr(t):3===n?new gr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?fr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?fr(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=nr.exec(e))?new gr(t[1],t[2],t[3],1):(t=ir.exec(e))?new gr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=rr.exec(e))?fr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?fr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=sr.exec(e))?qr(t[1],t[2]/100,t[3]/100,1):(t=ar.exec(e))?qr(t[1],t[2]/100,t[3]/100,t[4]):lr.hasOwnProperty(e)?dr(lr[e]):"transparent"===e?new gr(NaN,NaN,NaN,0):null}function dr(e){return new gr(e>>16&255,e>>8&255,255&e,1)}function fr(e,t,n,i){return i<=0&&(e=t=n=NaN),new gr(e,t,n,i)}function pr(e){return e instanceof Ki||(e=hr(e)),e?new gr((e=e.rgb()).r,e.g,e.b,e.opacity):new gr}function mr(e,t,n,i){return 1===arguments.length?pr(e):new gr(e,t,n,null==i?1:i)}function gr(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function yr(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}`}function vr(){const e=br(this.opacity);return`${1===e?"rgb(":"rgba("}${xr(this.r)}, ${xr(this.g)}, ${xr(this.b)}${1===e?")":`, ${e})`}`}function br(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wr(e){return((e=xr(e))<16?"0":"")+e.toString(16)}function qr(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Dr(e,t,n,i)}function Mr(e){if(e instanceof Dr)return new Dr(e.h,e.s,e.l,e.opacity);if(e instanceof Ki||(e=hr(e)),!e)return new Dr;if(e instanceof Dr)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Dr(s,a,l,e.opacity)}function Dr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Sr(e){return(e=(e||0)%360)<0?e+360:e}function _r(e){return Math.max(0,Math.min(1,e||0))}function Cr(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Yi(Ki,hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cr,formatHex:cr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Mr(this).formatHsl()},formatRgb:ur,toString:ur}),Yi(gr,mr,Xi(Ki,{brighter(e){return e=null==e?Ji:Math.pow(Ji,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Gi:Math.pow(Gi,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gr(xr(this.r),xr(this.g),xr(this.b),br(this.opacity))},displayable(){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:yr,formatHex:yr,formatHex8:function(){return`#${wr(this.r)}${wr(this.g)}${wr(this.b)}${wr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:vr,toString:vr})),Yi(Dr,(function(e,t,n,i){return 1===arguments.length?Mr(e):new Dr(e,t,n,null==i?1:i)}),Xi(Ki,{brighter(e){return e=null==e?Ji:Math.pow(Ji,e),new Dr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Gi:Math.pow(Gi,e),new Dr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new gr(Cr(e>=240?e-240:e+120,r,i),Cr(e,r,i),Cr(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Dr(Sr(this.h),_r(this.s),_r(this.l),br(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=br(this.opacity);return`${1===e?"hsl(":"hsla("}${Sr(this.h)}, ${100*_r(this.s)}%, ${100*_r(this.l)}%${1===e?")":`, ${e})`}`}}));var kr=e=>()=>e;function Er(e){return 1==(e=+e)?Ar: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(i){return Math.pow(e+i*t,n)}}(t,n,e):kr(isNaN(t)?n:t)}}function Ar(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kr(isNaN(e)?t:e)}var Tr=function e(t){var n=Er(t);function i(e,t){var i=n((e=mr(e)).r,(t=mr(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=Ar(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);function Ir(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Rr(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=jr(e[n],t[n]);for(;n<i;++n)s[n]=t[n];return function(e){for(n=0;n<r;++n)s[n]=o[n](e);return s}}function Nr(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Or(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pr(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=jr(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Lr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fr=new RegExp(Lr.source,"g");function zr(e,t){var n,i,r,o=Lr.lastIndex=Fr.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=Lr.exec(e))&&(i=Fr.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Or(n,i)})),o=Fr.lastIndex;return o<t.length&&(r=t.slice(o),a[s]?a[s]+=r:a[++s]=r),a.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,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function jr(e,t){var n,i=typeof t;return null==t||"boolean"===i?kr(t):("number"===i?Or:"string"===i?(n=hr(t))?(t=n,Tr):zr:t instanceof hr?Tr:t instanceof Date?Nr:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ir:Array.isArray(t)?Rr:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pr:Or)(e,t)}function Hr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Br(e){return+e}var Vr=[0,1];function $r(e){return e}function Wr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ur(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=Wr(r,i),o=n(s,o)):(i=Wr(i,r),o=n(o,s)),function(e){return o(i(e))}}function Yr(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=Wr(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=$t(e,t,1,i)-1;return o[n](r[n](t))}}function Xr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kr(){var e,t,n,i,r,o,s=Vr,a=Vr,l=jr,c=$r;function u(){var e=Math.min(s.length,a.length);return c!==$r&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),i=e>2?Yr:Ur,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(a,s.map(e),Or)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,Br),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=Hr,u()},h.clamp=function(e){return arguments.length?(c=!!e||$r,u()):c!==$r},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function Gr(){return Kr()($r,$r)}function Jr(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?Zt(t,e,n):Zt(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=tt(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ze(t)/3)))-Ze(Math.abs(e)))}(o,s))||(i.precision=r),lt(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ze(t)-Ze(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-Ze(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return at(i)}function Zr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,s]=i?Jt(t,e,n):Jt(e,t,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(r+e)/-s;else for(let e=0;e<a;++e)l[e]=(r+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Jr(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=Zt(l,c,n))===i)return o[s]=l,o[a]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function Qr(){var e=Gr();return e.copy=function(){return Xr(e,Qr())},Vi.apply(e,arguments),Zr(e)}function eo(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[$t(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return eo().domain(t).range(n).unknown(e)},Vi.apply(r,arguments)}function to(e){return void 0===e?e=>e:t=>e(t)}function no(e){return Math.max(0,Math.min(1,e))}function io(e){return"object"==typeof e}function ro(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function oo(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],s=e[r+1];0===r&&o!==n.start()?(i.push(...ro(t,o,s)),o-=s-o,s=e[r],i.push(...ro(t,o,s))):r===e.length-1&&s!==n.end()?(s=o+(o-e[r-1]),i.push(...ro(t,o,s))):i.push(...ro(t,o,s))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function so(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=L(r)||L(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s));let l=n.ticks(a);l.length<=1&&(l=n.ticks(a+1));const c=i>0?oo(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(to(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function ao(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const s=L(r)||L(t)?2:Math.max(t/r,2),a=Math.min(1e3,Math.round(s)),l=a>10?10:a;n.nice(l);const c=n.ticks(a),u=i>0?oo(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(to(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function lo(e){let t,{settings:n,scale:i,distance:r,formatter:o=(e=>e)}=e;const s=n.minorTicks&&!L(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!L(e.value):!L(e)));t=function(e){let{values:t,scale:n,formatter:i=(e=>e)}=e;return t.sort(((e,t)=>(io(e)?e.value:e)-(io(t)?t.value:t))).filter(((e,t,i)=>{const r=io(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=io(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)?no(n(e.start)):o,end:t&&!isNaN(e.end)?no(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(L(n.ticks.count)){t=(n.ticks.tight?ao:so)({distance:r,minorCount:s,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:i.copy(),formatter:o})}return t}function co(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:s,end:s+o}}))}function uo(){let 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]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const ho={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},fo={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},po={count:NaN};function mo(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}function go(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 yo(){let 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]:{};const i=Qr(),r={instance:null,invert:!1},o={data:t,resources:n},s=uo(e,ho,o);let a;function l(e){return L(e)?NaN:i(e)}s.ticks=uo(e.ticks,fo,o),s.minorTicks=uo(e.minorTicks,po,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=A(!0,{},s,e.settings),e.scale=l,a=lo(e),a):(a=i.ticks(e),a)},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),r.instance&&r.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){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+r);n.push(o,o),i.push(s,s)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=yo(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return go(r,l),r.instance(e)},l.normInvert=function(e){return go(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=mo(s,t?t.fields:[]);return l.domain([c,u]),l.range(s.invert?[1,0]:[0,1]),r.invert=s.invert,l}const vo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function bo(){let 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]:{};const i={data:t,resources:n},r=uo(e,vo,i),o=t.items||[],s={},a=[],l=[];function c(e,n){e.data=()=>t,e.datum=e=>o[s[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>l,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,co(t,n.trackBy)}}const u=Ui();c(u,e),u.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return u;const i=u.domain().length,o=Math.max(1,i-u.paddingInner()+2*u.paddingOuter());if(o*n>=t)return u;const s=u.copy();s.type=u.type,c(s,e);const a=o*n/t,l=(1-a)*u.align();return s.range(r.invert?[a+l,l]:[l,a+l]),s};const h="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<o.length;e++){const t=A({datum:o[e]},i),n=h(t,e);-1===a.indexOf(n)&&(a.push(n),l.push(d(t,e)),s[n]=e)}return u.domain(a),u.range(r.invert?r.range.slice().reverse():r.range),u.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||u.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||u.paddingOuter(r.paddingOuter),u.align(isNaN(r.align)?.5:r.align),u}const xo={depth:0};function wo(e,t,n){return e.ancestors().map((e=>t(A({datum:e.data},n)))).reverse().slice(1).toString()}function qo(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=wo(e,r,n),h=e.leaves()||[e],d=r(A({datum:e.data},n)),f=o(A({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:wo(h[0],r,n),rightEdge:wo(h[Math.max(h.length-1,0)],r,n),node:e};p?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&s.splice(-h),{values:s,labels:a,items:l,ticks:c}}const Mo=e=>e.min(),Do=e=>e.max();function So(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Mo).filter(P);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Do).filter(P);o=e.length?Math.max(...e):o}}return[r,o]}const _o={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Co(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}function ko(){let 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]:{};const i=yo(e,t,n).clamp(!0).interpolate(Tr),r=uo(e,_o,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length,a=i;A(!0,a,i);const[l,c]=So(r,t?t.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=s?r.range:h;return a.range(r.invert?d.slice().reverse():d.slice()),a.domain(o?r.domain:Co(a.range(),l,c)),a}const Eo={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Ao(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}function To(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}function Io(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=ko().domain([n,i]).range(t);return[n,...To(e),i].map((e=>r(e)))}function Ro(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=Qr().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}const No={domain:[],range:[]};function Oo(){let 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]:{};const i=Wi(),r={data:t,resources:n},o=uo(e,No,r),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=A({datum:l[e]},r),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(a(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}const Po={domain:[],range:[],unknown:void 0},Lo={domain:[],range:[],override:!1};const Fo=Ge();function zo(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=zi(i,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===s&&(s=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=s),o}function jo(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zo;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}Fo("linear",yo),Fo("band",bo),Fo("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=uo(t,vo,r);o.ticks=uo(t.ticks,xo,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=bo(o);const{values:a,labels:l,items:c,ticks:u}=qo(n.root,o,r),h=function(e){const t=String(e),n=c[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};A(!0,h,s),h.bandwidth=function(e){const t=c[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=s.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=s.pxScale;return h.pxScale=function(e){return s=d(e),h},h.domain(a),h})),Fo("sequential-color",ko),Fo("threshold-color",(function(){let 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]:{};const i=eo(),r=uo(e,Eo,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length;function a(e){return L(e)?NaN:i(e)}Object.keys(i).forEach((e=>a[e]=i[e]));const l=t.fields,[c,u]=So(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=s?r.range:d,p=[];return p=o?r.domain:r.nice?Ro(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=Ao(f,c,u):f.length<p.length+1&&(f=Io(p,f,c,u)),a.data=()=>t,a.range(r.invert?f.slice().reverse():f),a.domain(p),a})),Fo("categorical-color",(function(){let 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]:{};const i=Oo(e,t,n),r=n.theme,o=uo(e,Po,{data:t,resources:n});let s;if(o.explicit=uo(e.explicit,Lo,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/s.length);for(let e=1;e<r+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(s[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])}))}s.length=e.length}return i.range(s),i}));var Ho={};function Bo(){Bo.init.call(this)}Ho.isObject=function(e){return"object"==typeof e&&null!==e},Ho.isNumber=function(e){return"number"==typeof e},Ho.isUndefined=function(e){return void 0===e},Ho.isFunction=function(e){return"function"==typeof e};var Vo=Bo;Bo.EventEmitter=Bo,Bo.prototype._events=void 0,Bo.prototype._maxListeners=void 0,Bo.defaultMaxListeners=10,Bo.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Bo.prototype.setMaxListeners=function(e){if(!Ho.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Bo.prototype.emit=function(e){var t,n,i,r,o,s;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],Ho.isUndefined(n))return!1;if(Ho.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(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(Ho.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(s=n.slice()).length,o=0;o<i;o++)s[o].apply(this,r)}return!0},Bo.prototype.addListener=function(e,t){var n;if(!Ho.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Ho.isFunction(t.listener)?t.listener:t),this._events[e]?Ho.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ho.isObject(this._events[e])&&!this._events[e].warned)&&((n=Ho.isUndefined(this._maxListeners)?Bo.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Ho.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),Ho.isFunction(console.trace)&&console.trace()));return this},Bo.prototype.on=Bo.prototype.addListener,Bo.prototype.once=function(e,t){if(!Ho.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},Bo.prototype.removeListener=function(e,t){var n,i,r,o;if(!Ho.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||Ho.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ho.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Bo.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],Ho.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},Bo.prototype.listeners=function(e){return this._events&&this._events[e]?Ho.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Bo.listenerCount=function(e,t){return e._events&&e._events[t]?Ho.isFunction(e._events[t])?1:e._events[t].length:0};var $o={mixin:e=>(Object.keys(Vo.prototype).forEach((t=>{e[t]=Vo.prototype[t]})),Vo.init(e),e)};function Wo(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-i,o));n!==s&&(n=s,r.emit("update"))},update(o){let s=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,s=!0);const a=Math.max(e,Math.min(t-i,n));n!==a&&(n=a,s=!0),s&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return $o.mixin(r),r}function Uo(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||Wo();return o.update({min:n,max:i,viewSize:r}),o}function Yo(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Uo(e[i],t?t[i]:null));return n}function Xo(e,t){return t[e]||(t[e]=Wo()),t[e]}function Ko(e,t){return e<=t}function Go(e,t){return e<t}function Jo(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function Zo(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}function Qo(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;e=i?Ko:Go,t=r?Ko:Go},r.add=e=>{let{min:t,max:n}=e;const r=Jo(i,t),o=Jo(i,n,!0),s=[r,o-r];r%2==0&&s.push(t),o%2==0&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Jo(i,t),o=Jo(i,n,!0),s=[r,o-r];r%2==1&&s.push(t),o%2==1&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>Zo(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Jo(i,t,!0),o=Jo(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function es(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const ts={key:void 0,includeMin:!0,includeMax:!0};function ns(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=i()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(r[s]=r[s]||[],r[s].push(a[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:r[s]});return o}function is(e){let{items:t,collection:n}=e;const i={},r=[];let o,s;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(i[o]=i[o]||[],i[o].push(s[e]))}const a=Object.keys(i);for(let e=0,t=a.length;e<t;e++)o=a[e],r.push({id:o,values:i[o]});return r}function rs(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function os(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function ss(e){let{items:t,values:n,vc:i}=e;const r={},o={},s=[],a=[],l=rs(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):os({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}function as(e,t){const n=[],i=Object.keys(e);let r,o;const s=e=>-1===t[r].indexOf(e);for(let a=0,l=i.length;a<l;a++)r=i[a],t[r]?(o=e[r].filter(s),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function ls(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=rs(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const h=e=>{n[s]&&n[s].contains(e)||os({key:s,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)s=d[e],o[s].forEach(h);return l=as(c,r),a=as(r,c),[a,l]}function cs(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?A({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function us(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function hs(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function ds(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:s,rangeConfig:a}=n;const l=cs(r["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(a.sources[n]||a.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function fs(){let{vc:e=es,rc:t=Qo}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},s={sources:{},default:A({},ts)};const a={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(s={sources:{},default:A({},ts)},e.ranges.forEach((e=>{const t={};Object.keys(ts).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:ts[n]})),void 0!==e.key?s.sources[e.key]=t:s.default=t})),Object.keys(i).forEach((e=>i[e].configure(s.sources[e]||s.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=cs(a.addValues,t,o),s=ns({vc:e,collection:r,items:i});u.emit("add-values",i),s.length&&(n||(n=!0,u.emit("start")),u.emit("update",s,[]),c.updateValues())},setValues:t=>{const i=cs(a.setValues,t,o),s=ls({items:i,vCollection:r,vc:e});u.emit("set-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},removeValue:(e,t)=>{u.removeValues([{key:e,value:t}])},removeValues:e=>{const t=cs(a.removeValues,e,o),n=is({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},addAndRemoveValues:(t,i)=>{const s=cs(a.addValues,t,o),l=cs(a.removeValues,i,o),h=ns({vc:e,collection:r,items:s}),d=is({collection:r,items:l});u.emit("add-values",s),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},toggleValue:(e,t)=>{u.toggleValues([{key:e,value:t}])},toggleValues:t=>{const i=cs(a.toggleValues,t,o),s=ss({items:i,values:r,vc:e});u.emit("toggle-values",i),(s[0].length>0||s[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",s[0],s[1]),c.updateValues())},containsValue:(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},addRange:(e,t)=>{u.addRanges([{key:e,range:t}])},addRanges:e=>{ds(e,"add",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},removeRange:(e,t)=>{u.removeRanges([{key:e,range:t}])},removeRanges:e=>{ds(e,"remove",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},setRange:(e,t)=>{u.setRanges([{key:e,range:t}])},setRanges:e=>{ds(e,"set",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},toggleRange:(e,t)=>{u.toggleRanges([{key:e,range:t}])},toggleRanges:e=>{ds(e,"toggle",{ranges:i,rc:t,interceptors:a,aliases:o,rangeConfig:s})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},containsRangeValue:(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},containsRange:(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},containsMappedData:(e,t,n)=>{let s=[];const a=Object.keys(e);let l,c,u,h;for(let t=0,n=a.length;t<n;t++){if(l=a[t],"value"===l)c=e,s[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],s[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?s[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(s[t].bool=!0))}return t?(s=s.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!s.length&&!s.some((e=>!1===e.bool)):"xor"===n?!!s.length&&s.some((e=>e.bool))&&s.some((e=>!1===e.bool)):s.some((e=>e.bool))):s.some((e=>e.bool))},intercept:(e,t)=>{const n=us(e);a[n]&&a[n].push(t)},removeInterceptor:(e,t)=>{const n=us(e);if(!a[n])return;const i=a[n].indexOf(t);-1!==i&&a[n].splice(i,1)},removeAllInterceptors:e=>{const t=[];if(e){const n=us(e);a[n]&&a[n].length&&t.push({name:e,handlers:a[n]})}else Object.keys(a).forEach((e=>{a[e].length&&t.push({name:hs(e),handlers:a[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},addKeyAlias:(e,t)=>{o[e]=t},removeKeyAlias:e=>{delete o[e]}};return $o.mixin(u),u}function ps(e){return e*e*e}function ms(e){return--e*e*e+1}function gs(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function ys(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}function vs(e,t,n,i){let r,{old:o,current:s}=e,{renderer:a}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||ys,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),s.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),s=n.filter((e=>o.includes(e.data.major.value))),a=i.filter((e=>o.includes(e.data.major.value)));return{old:s,current:a}}(e[i],t);h.ips.push(Pr(A({},e[i],{points:n.old}),A({},t,{points:n.current}))),l.push(A({},e[i],{commonPoints:n.old}))}else h.ips.push(Pr(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(Pr(A({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(Pr(e[t],A({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:ps,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:gs,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:ms,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:s}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===r)}d.length&&(f=a.getScene(s),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,n=[],o=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));if(n.push(...o),n.push(...e.nodes),a.render(n),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}Ge();const bs={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},xs=/^\$/;function ws(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function qs(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Ms(e,t){return e.pxScale?e.pxScale(t):e}const Ds={normalizeSettings:function(e,t,n){const i=A({},e),r=A({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],s=typeof o;if("function"==typeof o)r[e].fn=o;else if(ws(o)){let n=t[e];"string"==typeof n&&xs.test(n)&&(n=bs[n]);const i=typeof n;r[e]="undefined"===i||i===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&xs.test(n)?r[e]=bs[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof a&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in a,f=h?a[c.ref]:d?a[o]:s;ws(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:qs};function Ss(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ds,n={};function i(i){let{data:r,settings:o,defaults:s={},scaled:a}=i;const l=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};a&&Object.keys(a).forEach((e=>{l[e]&&t.updateScaleSize(l,e,a[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}return{resolve:i}}function _s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>Array.isArray(t.children)?(e.push(..._s(t.children)),e):(e.push(t),e)),[])}function Cs(e,t){let{context:n,data:i,style:r,filter:o,mode:s}=t;const a=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=_s(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:a}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=a.containsMappedData(n,r,s),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=A({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const 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 a.on("start",g),a.on("end",y),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){a.removeListener("start",g),a.removeListener("end",y),a.removeListener("update",v)}}}function ks(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;if(!r)return;const o=r.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}}))}r.contexts.forEach((e=>{s.items.length?i.brush(e)[s.actionFn](s.items):i.brush(e)[a.actionFn](a.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function Es(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map((e=>e.node));return ks({nodes:a,action:r,chart:i.chart,data:i.data,trigger:n}),s}function As(e,t,n){const i=n.element().getBoundingClientRect();let r=O(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,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&O(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!O(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Ts(e,t,n){return e?"function"==typeof e?e(t):e:n}function Is(e){let{e:t,t:n,config:i}=e;return Es({collisions:As(t,n,i.renderer),t:n,config:i,action:Ts(n.action,t,"toggle")})}function Rs(e){let{e:t,t:n,config:i}=e;return Es({collisions:As(t,n,i.renderer),t:n,config:i,action:Ts(n.action,t,"set")})}const Ns={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 Os(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Ps(e,t,n,i){const r=n/2,o=e-i/2,s=t-i/2,a=e-r,l=t-r;return[{x:o,y:s},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:s},{x:a+n,y:s},{x:a+n,y:s+i},{x:o+i,y:s+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:s+i},{x:a,y:s+i},{x:a,y:s}]}function Ls(e){return-e/180*Math.PI}function Fs(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Ls(e))}function zs(e,t){return{x:e.x+t.x,y:e.y+t.y}}function js(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hs(e,t){return{x:e.x*t,y:e.y*t}}function Bs(e,t){return e.x-t.x}function Vs(e,t){return e.y-t.y}function $s(e,t){return Bs(e,t)**2+Vs(e,t)**2}function Ws(e,t){return Math.sqrt($s(e,t))}function Us(e,t){return e.x*t.x+e.y*t.y}function Ys(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=js(e,n),s={x:i*o.x-r*o.y,y:r*o.x+i*o.y};return zs(s,n)}const Xs={up:0,down:180,left:90,right:-90};function Ks(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const Gs=Ge();function Js(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==Ns[n]&&"transform"!==n&&(e[n]=t[n])}))}Gs.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Gs.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Os([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),Gs.add("saltire",(function(e){const t=Ls(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=Ps(e.x,e.y,o,r).map((e=>Ys(e,t,a)));return{type:"path",fill:"black",d:Os(l)}})),Gs.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Gs.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Xs[e.direction]||0,r=t/2,o=e.x-r,s=e.y-r;let a=[{x:o,y:s+t},{x:o+r,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=Ls(i);return a=a.map((e=>Ys(e,l,n))),{type:"path",fill:"black",d:Os(a)}})),Gs.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Ks(e)}})),Gs.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/r;for(let t=1;t<=r;t++){const r=a*t+s,l=Ls(r),c=Ls(r+a/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Os(n)}})),Gs.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=i;s++){const i=Ls(r*s+o),a=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:Os(t)}})),Gs.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Os(Ps(t,n,e.size,o))}})),Gs.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Ls(90);o=o.map((n=>Ys(n,e,t)))}const s=H(o);return s.type="rect",s.fill="black",s})),Gs.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Zs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gs;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return Js(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Qs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:s,show:a=!0}=e;n=n||"center";const l={computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},show(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a}};return l}function ea(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:s,scale:a,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:a}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((n=>{var i;i=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((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function ta(e,t,n){const i=t=>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,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function na(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function ia(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}function ra(e){const t=A(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function oa(e,t,n){const i=zs(function(e,t){const n=Us(e,t)/Us(t,t)||1;return{x:t.x*n,y:t.y*n}}(js(n,e),js(t,e)),e);return i}function sa(e,t,n){return Ws(e,n)+Ws(t,n)-Ws(e,t)<1e-12}function aa(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 la(e){return e.x1===e.x2&&e.y1===e.y2}function ca(e){return e.width<=0||e.height<=0}function ua(e){return e.r<=0}function ha(e){return e.edges.length<=2}function da(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=ba(e,B(t.edges[i])),!0===n)return!0;return!1}function fa(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=ka(e,r[t]),!0===n)return!0}return!1}function pa(e,t){if(ua(e))return!1;return $s({x:e.cx,y:e.cy},t)<=e.r**2}function ma(e,t){if(ca(t)||ua(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-r),u=Math.abs(l-o);if(c>n+s||u>i+s)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=s**2}function ga(e,t){if(ua(e)||la(t))return!1;const[n,i]=z(t);if(pa(e,n)||pa(e,i))return!0;const r={x:e.cx,y:e.cy},o=oa(n,i,r);return $s(o,r)<=e.r**2&&sa(n,i,o)}function ya(e,t){if(ha(t)||ua(e))return!1;if(va(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(ga(e,B(t.edges[i])))return!0}return!1}function va(e,t){if(ha(e)||!Ma(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=r.length,a=s-1;++l<s;a=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[a].y&&r[l].y===i&&(n-r[l].x)*(n-r[a].x)<=0)return!0;if(r[l].y<i&&i<=r[a].y||r[a].y<i&&i<=r[l].y){if(c=(r[a].x-r[l].x)*(i-r[l].y)/(r[a].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function ba(e,t){if(ha(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Sa(t,B(e.edges[n])))return!0}const[n,i]=z(t);return va(e,n)||va(e,i)}function xa(e,t){if(ha(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Da(t,B(e.edges[n])))return!0}const[n,i,r,o]=j(t);return va(e,n)||va(e,i)||va(e,r)||va(e,o)}function wa(e,t){return!ca(e)&&!ca(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 qa(e,t){if(ca(e)||ca(t))return!1;return[{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((t=>Ma(e,t)))}function Ma(e,t){return!ca(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Da(e,t){if(la(t)||ca(e))return!1;const[n,i]=z(t);if(Ma(e,n)||Ma(e,i))return!0;const r=j(e);let o=r.length;for(let e=0;e<o;e++){if(Sa(B([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function Sa(e,t){const[n,i]=z(e),[r,o]=z(t),s=Bs(i,n),a=Vs(i,n),l=Bs(o,r),c=Vs(o,r),u=Bs(n,r),h=Vs(n,r);let d=c*s-l*a;const f=l*h-c*u,p=s*h-a*u;let m,g;if(0===s&&0===a)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===s){if(0===a)return n.x===i.x&&n.y===i.y;m=Vs(r,n)/a,g=Vs(o,n)/a}else m=(r.x-n.x)/s,g=(o.x-n.x)/s;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function _a(e,t){if(la(e))return!1;const[n,i]=z(e);return sa(n,i,t)}function Ca(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(n,i)?da(e,t):da(t,e))}function ka(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=Ca(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Ta(e,B(t.edges[i])),!0===n)return!0;return!1}(e,t))}function Ea(e,t){if(ua(e))return!1;if(Aa(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(ga(e,B(n.edges[t])))return!0}}return!1}function Aa(e,t){if(!Ma(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,s,a,l,c,u,h=!1;for(s=0;s<r;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function Ta(e,t){const[n,i]=z(t);if(Aa(e,n)||Aa(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(Sa(t,B(n.edges[e])))return!0}}return!1}function Ia(e,t){const[n,i,r,o]=j(t);if(Aa(e,n)||Aa(e,i)||Aa(e,r)||Aa(e,o))return!0;const{numPolygons:s,polygons:a}=e;for(let e=0;e<s;e++){const n=a[e];for(let e=0,i=n.edges.length;e<i;e++){if(Da(t,B(n.edges[e])))return!0}}return!1}const Ra=/^\$/,Na="@extend";function Oa(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Pa(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Oa(e),Ra.test(i)?(n.push(e),Pa(i,t,n)):i}let i=e;const r=A(!0,{},t,e),o={};if(e[Na]){const o=e[Na];-1!==n.indexOf(o)&&Oa(o);let s=n.slice();s.push(o),i=A(!0,{},Pa(r[o],t,s),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===Na||Ra.test(e))return;o[e]=i[e];let s=o[e];Ra.test(s)&&s in r?(-1!==n.indexOf(s)&&Oa(s),t.push(s),s=r[s],"object"==typeof s||Ra.test(s)&&s in r?o[e]=Pa(s,r,t):o[e]=s):"object"==typeof s&&(o[e]=Pa(s,r,t))})),o}function La(e,t){return Pa(e,t,[])}function Fa(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 za(e,t){const n={x:0,y:0,width:0,height:0},i={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?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Fa(i),Fa(n),{logicalContainerRect:i,containerRect:n}}function ja(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return A(!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 Ha(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function Ba(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,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 Va(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 $a(e,t){const 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 Wa(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Ua(e,t,n,i,r){const o=A({},t),s=A({},n);Va(o,i),$a(s,i),Wa(e,o,s);const a=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!a&&(Va(t,i),$a(n,i),!0)}function Ya(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=Ha(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<a.length;++e){const n=a[e];Ba(n,o,t),Ua(t,o,s,n,r)||(i.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==a.indexOf(e)));return n.length=0,n.push(...l),Wa(t,o,s),o}function Xa(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 Ka(e){return H([].concat(...e.map(j)))}function Ga(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const s=Ha(i.x,i.y,i.width,i.height),a=Ha(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((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;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Ka(n.map((e=>e.outerRect))),c=Ka(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const s=e?"height":"width",a=(i[s]-n[s]*r.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=Xa(c),t.edgeBleed=e.edgeBleed,t.computed=Xa(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Ja(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function Za(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 Qa(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const s=e[o];Za(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Ja(t,a,n)?i.push({comp:s,key:l,config:a,referencedDocks:u}):r.push({comp:s,key:l,config:a,referencedDocks:u})}return[i,r]}const el=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},tl=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(R(R({},n),{},{children:tl(e.children)}))}})),nl=(e,t)=>({visible:[],hidden:t,ordered:[]}),il=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(R(R({},t),{},{children:tl(e.children)}))}})),o=e=>n[e.index],{visible:s=r,hidden:a=[],ordered:l=s}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:s.map(o),hidden:a.map(o),ordered:l.map(o)}},rl=e=>{const t=function(e){let t=ja(e);const n={layout:function(e){let 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:[]};const{logicalContainerRect:i,containerRect:r}=za(e,t),[o,s]=Qa(n,t,i),a=Ga({visible:o,layoutRect:i,reducedRect:Ya({layoutRect:i,visible:o,hidden:s,settings:t}),containerRect:r,translation:{x:e.x,y:e.y}});return s.forEach((e=>{e.comp.visible=!1;const t=Ha();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:s.map((e=>e.comp)),ordered:a.map((e=>e.comp))}},settings:function(e){t=ja(e)}};return n}(e);return il(((e,n)=>t.layout(e,n)))},ol=e=>"function"==typeof e?il(e):rl(e);function sl(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=V(e),s=A(!0,{},e);switch(o){case"circle":s.cx+=i,s.cy+=r;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":s.x1+=i,s.y1+=r,s.x2+=i,s.y2+=r;break;case"point":case"rect":s.x+=i,s.y+=r}return s}function al(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function ll(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const s=t.registries,a=t.logger,l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={},i=e;const r=e=>{e.forEach((e=>{const t=Array.isArray(e.colors[0])?e.colors:[e.colors];n[e.key]={colors:t,sizes:t.map((e=>e?e.length:0))}}))},o=(e,t)=>{const i=n[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(t<=r[e])return i.colors[e];return i.colors[r.length-1]},s={palette:(e,t)=>o(e,t),setPalettes:r,style:e=>La(e,i),setStyle:t=>{i=A({},e,t)}};return r(t),s}(t.style,t.palettes),c=[],u=A({},e),h=function(){const e={};return $o.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},s=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&a(i.children,r.components):(e.splice(n,1),s(i),i.children&&a(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:a}=e;return a.map((e=>{const a=el(t,e.key);return i.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:r,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:e.components})),a)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:s}=e;const{visible:a,hidden:l,ordered:u}=i(o,t);s.push(...a),n.push(...l),r.push(...u),a.forEach((e=>{if(e.children){var t,i;const o=ol(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:s})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:nl,ordered:r,rect:null,visible:s})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>el(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],s=[],a=ol(t);return c({components:r,hidden:o,layoutFn:a,ordered:s,rect:n,visible:i}),{visible:i,hidden:o,ordered:s}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:s}=e;a(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!s.component.has(e.type))return a.warn("Unknown component: ".concat(e.type)),!1;const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=(()=>({}))}=e,{chart:r,container:o,mediator:s,registries:a,theme:l,renderer:c}=t,u=$o.mixin({});let h,d,f,p,m,g=t.settings||{},y=A(!0,{},n,g),v=[],b=Ss({chart:r}),x=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},q={tap:[],over:[]},M=[],D={},S=A({},g);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==g[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?s=e[t].call(D,...l):i&&(s=e[t])),o&&("function"==typeof g[t]?s=g[t].call(S,...l):i&&(s=g[t])),r||o||(s=n.call(D,...l)),s}}const C=_("preferredSize",(()=>0),!0),k=_("resize",(e=>{let{inner:t}=e;return t})),E=_("created"),T=_("beforeMount"),I=_("mounted"),N=_("beforeUnmount"),O=_("beforeUpdate"),P=_("updated"),L=_("beforeRender"),F=_("beforeDestroy"),z=_("destroyed"),j=e.render,H=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&M.push(Cs(w,e))}))},B=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?q.over.push(e):q.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const V=y.renderer||e.renderer,$=V?c||a.renderer(V)():c||a.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const W={resources:r.logger?{logger:r.logger()}:{}};let U=Qs(ta(y,C,r.logger()),W);const Y=e=>{e.key=y.key,e.element=$.element()},X=()=>{};X.dockConfig=()=>U,X.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=A(!0,{},n,e.settings),U=Qs(ta(y,C,r.logger()),W),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=zi(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),m=l.style(y.style||{})},X.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=k({inner:e,outer:t});p=n?$.size(n):$.size(e),S.rect=A(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=A(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},X.getRect=()=>S.rect;const K=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&i&&(n=R(R({},v),{},{items:v.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,J,Z;function Q(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}X.beforeMount=T,X.beforeRender=()=>{L({size:p})},X.render=()=>{const e=j.call(D,...K());Q(e),$.render(e),G=e,J=S.rect.computed},X.hide=()=>{X.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},X.beforeUpdate=()=>{O({settings:y,data:v})},X.update=()=>{Z&&Z.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(G=null);const i=j.call(D,...K());Q(i),M.forEach((e=>e.cleanUp())),M.length=0,q.tap=[],q.over=[],t&&(H(),B()),M.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:S.rect.computed,previousRect:J}),Z=vs({old:G,current:i},{renderer:$},n,r.storage),Z.start()):$.render(i),G=i,J=S.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},X.updated=P,X.destroy=()=>{X.unmount(),F(f),$.destroy(),z(),f=null};const ee=e=>{w.nodes=e,M.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return ea(D,e,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,instance:()=>S,rect:()=>S.rect,style:()=>m,update:()=>ee,registries:()=>a,resolver:()=>b,symbol:()=>Zs(a.symbol)}),ea(S,g,{settings:()=>y,data:()=>v,scale:()=>h,formatter:()=>d,renderer:()=>$,chart:()=>r,dockConfig:()=>U,mediator:()=>s,style:()=>m,_DO_NOT_USE_getInfo:i.bind(D),isVisible:()=>x}),X.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),s=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<s.length;r++){const a=s[r];a.data&&o.containsMappedData(a.data,n||e.data,t)&&(Y(a),i.push(a),s.splice(r,1),r--)}}))}return i},X.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},X.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)Y(i[e]);return i},X.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];ks({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},X.mount=()=>{f=$.element&&$.element()?f:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(H(),B()),na(S,u,g),na(D,u,e),x=!0},X.mounted=()=>I(f),X.unmount=()=>{[S,D].forEach((e=>{ia(e,u)})),q.tap=[],q.over=[],M.forEach((e=>{e.cleanUp()})),M.length=0,N(),x=!1},X.onBrushTap=e=>{q.tap.forEach((t=>{Is({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.onBrushOver=e=>{q.over.forEach((t=>{Rs({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},X.def=D,X.ctx=S,X.renderer=()=>$,X.set({settings:g}),E(),X}(s.component(e.type),{settings:e,chart:u,mediator:h,registries:s,theme:l,container:n});return{instance:t,settings:A(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r=i?e[t].call(u,...s):n.call(u,...s),r}}const M=()=>{let e;r.dockLayout?(a.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},D=q("created"),S=q("beforeMount"),_=q("mounted"),C=q("beforeUpdate"),k=q("updated"),E=q("beforeRender"),T=q("beforeDestroy"),I=q("destroyed"),N=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=W(e,{logger:a,types:s.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=ji(t.collections,{dataset:y},{logger:a});const c={theme:l,logger:a};f=jo(r,{dataset:y,collection:v},R(R({},c),{},{scale:s.scale})),p=Bi(i,{dataset:y,collection:v},R(R({},c),{},{formatter:s.formatter})),m=Yo(o,m)};function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:s.interaction(e.type)(u,h,n);return i.set(e),i}))}const L=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},s=[];return d.forEach((e=>{const t=e.instance.getRect();Ma(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)&&s.push(e)})),s},F=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=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=L(e)},i=t=>{const n=e.comps||L(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=O(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),s=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},z=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},j=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;E(),N(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:s}=M();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),al(n,s)})(),F(),P(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r);const{formatters:n,scales:o,components:s=[]}=r;w.update({components:s,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),M()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let s;e.data&&(i=e.data),e.settings&&(r=e.settings,P(e.settings.interactions)),C(),N(i,r,{partialData:t});const{formatters:a,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:a,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=M();d=e,f=e,s=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||al(n,s),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),k()},u.destroy=()=>{T(),w.destroy(),z(),P(),delete u.update,delete u.destroy,I()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>L(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=sl(e,r,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Xo(e,m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=fs()),b[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>a,u.theme=()=>l,u.storage=ra({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){F(),g.forEach((e=>e.on()))},off(){z(),g.forEach((e=>e.off()))}})}),D(),n&&(S(),j(),_(n),u.element=n),u}const cl=e=>{let t=Ge(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var ul=Ge();function hl(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function dl(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:s}=Ai(e,t),a=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(s.filter&&!s.filter(n))continue;const i=hl(s,n,{key:r});a.forEach((e=>{const s=o[e];let a=s.field?s.field.items()[t]:n;i[e]=hl(s,a,{key:r})})),l&&Ri({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Ii(h,{main:s,propsArr:a,props:o})]:[...i,...f]}})),i}const fl=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const pl=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.split("\n"),r=i[0],o=i[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){s=n;break}}else n.test(r)&&(s=n)}}return i.map((e=>e.split(s)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,s=i;const a=o&&o.parse;Array.isArray(i[0])?a&&!1===a.headers?t=i[0].map(((e,t)=>t)):(t=i[0],s=i.slice(1)):t=Object.keys(i[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,u):s[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=fl(t),o=i.length>0,s=o?"measure":"dimension",a=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Di(A({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function ml(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>Si(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>dl(e,r),hierarchy:()=>null};return pl({key:e,data:t,config:n,cache:i}),r}ml.util={normalizeConfig:Ai,collect:Ii,track:Ri};const gl=Ge();gl.default("matrix"),gl("matrix",ml),gl("default",ml);const yl=Ge();function vl(e,t,n){return Math.max(e,Math.min(t,n))}function bl(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:s,symbol:a}=e,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return s&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),a(A({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function xl(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:s}=e,a="x",l="y",c="width",u="height",h=r,d=o;s&&(a="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),s=Math.min(t,n),a=vl(-.1,1.2,o),l=vl(-.1,1.2,s),c=a*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return A({},t.box,{type:"rect",[a]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function wl(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:s,flipXY:a}=e,l="x1",c="y1",u="x2",h="y2",d=o,f=s;return a&&(l="y1",c="x1",u="y2",h="x2",d=s,f=o),A({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function ql(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:s,rendHeight:a,flipXY:l}=e,c="x1",u="y1",h="x2",d="y2",f=s,p=a;l&&(c="y1",u="x1",h="y2",d="x2",f=a,p=s);const m=r/2;return A({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function Ml(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,s=e>=0?1:-1;let a=Math.min(s*e*i,isNaN(r)?n:r/n);return a=isNaN(o)?a:Math.max(o/n,a),a*s}yl("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})}))}function c(){s.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),s=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,i=null}}}));const Dl={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}},Sl=Object.keys(Dl),_l={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:s,symbol:a}=this,l=Sl.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=Dl[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:s,height:a,resolver:l}=e;const c=A(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:A(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:s}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:s}=e;const a=[],l=r.major.items;if(!l.length)return a;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,q,M,D;const S=o?o.length:0,_=m?m.length:0,C={box:function(){v.box&&P(v.start)&&P(v.end)&&g.push(xl({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){P(v.min)&&P(v.start)&&g.push(wl({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),P(v.max)&&P(v.end)&&g.push(wl({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){v.median&&P(v.med)&&g.push(ql({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;P(v.min)&&g.push(ql({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),P(v.max)&&g.push(ql({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function k(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=v[f[i]],P(e)&&(t<e&&(t=e),n>e&&(n=e));q=t<0&&t!==-Number.MAX_VALUE,M=n>1&&n!==Number.MAX_VALUE,D=q||M}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let E=0;y?y.bandwidth?(E=y.bandwidth(),f-=E/2):E=p-f:E=1,v=A({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<S;t++)v[o[t]]=r[o[t]].items[e];if(b=Ml(E,v,h),x=(E-b)/2,w=x+v.major+b/2,k(),D)v.oob&&(q?g.push(bl({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})):M&&g.push(bl({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:s})));else for(let e=0;e<_;e++)v[m[e]]&&!1===v[m[e]].show||C[m[e]]();const T={type:"container",data:n,collider:{type:"bounds"},children:g};a.push(T)}return a}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:a});return f}};const Cl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},kl=/px$/,El={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Al={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Tl(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 Il(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,s=kl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);L(s)&&(t=Cl,s=n.min+t.size*(n.max-n.min));const[a,l]=function(e){let t=El.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=R(R({},l),{},{type:a,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const Rl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:A({},El,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=A({},Al,this.settings.settings.sizeLimits),s=n.items,a=function(e,t,n,i,r){const o=Tl(e?e.scale:void 0,n),s=Tl(t?t.scale:void 0,i);let a=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*r[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*r[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return Il(s,this.rect,a,this.settings.shapeFn||this.symbol)}};Math.PI;const Nl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Ol(e,t,n,i){let{x:r,y:o,width:s,height:a}=t;const l=be(),c={x:r+s/2,y:o+a/2},u=Math.min(s,a)/2,h=Math.min(s,a)/2,d=h/100;return e.map(((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,s=u*r.innerRadius,a=d*r.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const s=Math.sqrt(r*r+o*o);r/=s,o/=s;const a=n-i;return{x:r*t*a,y:o*t*a}}(f,r.offset,o,s):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function Pl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ll={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:A({},Nl,this.style.slice),settings:r.slice});let s=0;for(let e=0,t=o.length;e<t;e++){const t=Pl(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),s+=t)}const a=function(){var e=_e,t=Se,n=null,i=Z(0),r=Z(ce),o=Z(0);function s(s){var a,l,c,u,h,d=s.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(ce,Math.max(-ce,r.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<d;++a)(h=m[p[a]=a]=+e(s[a],a,s))>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(s[e],s[t])})),a=0,c=f?(y-d*b)/f:0;a<d;++a,g=u)l=p[a],u=g+((h=m[l])>0?h*c:0)+b,m[l]={data:s[l],index:a,value:h,startAngle:g,endAngle:u,padAngle:v};return m}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:Z(+e),s):i},s.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:Z(+e),s):r},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),s):o},s}().sortValues(null);a.startAngle(r.startAngle),a.endAngle(r.endAngle),a.padAngle(r.padAngle);return Ol(a(n),A({},this.rect,{x:0,y:0}),i,s)}};const Fl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class zl{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"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"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[zl.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const s=zl.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return i&&Fl(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function jl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zl(...t)}function Hl(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Bl={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=jl(),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(){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,qs(this,"x",this.rect.width),qs(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=A({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=A({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Hl(this.x,this.rect.width),this.lines.y=Hl(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>A(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Vl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function $l(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?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(r?t+n:t-n," Z\n ")}function Wl(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 Ul(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Yl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Xl(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}const Kl={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:()=>30,beforeRender(){this.blueprint=jl(),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(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(Yl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Xl(t,e.value);return A(e,{scale:t,position:n})}return A(e,{position:e.value})})),this.lines.y=this.lines.y.filter(Yl).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Xl(t,e.value);return A(e,{scale:t,position:n,flipXY:!0})}return A(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Ul(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Ul(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach((t=>{(!0===t.show||void 0===t.show)&&function(e){let{chart:t,blueprint:n,renderer:i,p:r,settings:o,items:s}=e,a=!0,l=!1,c=!1,u=!1,h=!1,d=A(!0,{},o.style.line,r.line||{});if(l=n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:d.stroke||"black",strokeWidth:d.strokeWidth||1,strokeDasharray:d.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const e=A(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:d.stroke},r.label);let l,f={width:0,height:0},p="";if("string"==typeof r.formatter)l=t.formatter(r.formatter);else if("object"==typeof r.formatter)l=t.formatter(r.formatter);else if(void 0!==r.scale&&r.scale.data){const e=r.scale.data()&&r.scale.data().fields;l=e&&e[0]?e[0].formatter():null}!1!==r.label.showValue&&(l?p=" (".concat(l(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(f=i.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=i.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+f.width,height:Math.max(m.height,f.height)},y=e.padding,v=Wl(r.flipXY?e.vAlign:e.align),b=Wl(r.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,q=r.flipXY?w:x,M=r.flipXY?x:w;if(c=n.processItem({fn:t=>{let{width:i,height:o}=t,s=r.position*i-(r.flipXY?w:x)*(1-v);return s=r.flipXY?s:Math.max(s,0),{type:"rect",x:s,y:Math.max(Math.abs(b*o-M*b),0),width:r.flipXY?q:Math.min(q,n.width-s),height:M,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:r.flipXY||!1}),c.x<-1||c.x+c.width>n.width+1||c.y<-1||c.y+c.height>n.height+1)c=void 0;else{u={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:c.x+y,y:c.y+c.height/2+g.height/3,maxWidth:c.width-2*y-f.width,anchor:"start"},p&&(h={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+3+(c.width-(f.width+2*y)),y:u.y});for(let e=0,t=s.length;e<t;e++){let t=s[e];"rect"===t.type?wa(c,t)&&(a=!1):"line"===t.type&&r.flipXY===t.flipXY&&Da(c,t)&&(a=!1)}}}s.push(l),a&&c&&u&&(s.push(c,u),h&&s.push(h))}({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:t,settings:e,items:n})})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let s=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],a=n[i];if(a.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===s.type?{type:"path",d:Vl(n?h:u,n?u:h,s.width,c),x:u,y:h,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:a.length||"",x:h-.4*s.width,y:d+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},p={type:"path",d:$l(h,d,s.width,c),x:h,y:d,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Gl(e){const 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){A(e,t.style)}(t,e),t}function Jl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Zl(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){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&i<0,a="start"===t.anchor&&i>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Ys(e,i,{x:t.x,y:t.y}))),u={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=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const 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}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function Ql(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function ec(e,t){var n,i;const r={type:"text",text:Jl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+Ql(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+Ql(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,s=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,s=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,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)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Zl(e,r,t),r}function tc(e,t){const 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){A(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){const 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 nc(e){return!e.isMinor&&e.position>=0&&e.position<=1}function ic(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,s=i.width,a=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*s*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function rc(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function oc(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=s.labels;if(s.labels.show){const e=s.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:i}).filter(nc),m=e=>{const t=r({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=rc({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===s.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;const s=o.labels.maxGlyphCount,a="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(s))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=a*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=a*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*s,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&ic({rect:n.inner,state:a,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);g=t=>rc({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>rc({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),i=(x-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(r).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:m,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const sc=(e,t,n)=>e.width*Math.abs(t.position-n.position);function ac(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:s}=e;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?sc(i,o,l)/2-2:1/0,h=c?sc(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*i.position+s,l=2*Math.min(r,a),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,s=t.width*i.position+o,a=2*Math.min(r,s),l=0===i.position?t.width/2-2:0;return Math.max(r,a,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function lc(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function cc(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=lc(e)+e.labels.margin,t}function uc(e,t){return e.map((e=>tc(e,t)))}function hc(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function dc(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:s,tick:a}=e;const l=t.height,c=hc(r,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-cc(n)-n.paddingEnd;else if(s)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-cc(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=rc({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function fc(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:s,tick:a,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-cc(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-cc(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=ac({layered:s,major:c,innerRect:i,outerRect:r,tick:a,index:l});return h.width=rc({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function pc(e){let t;function n(){return t=fc,n}function i(){return t=dc,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:s,ticks:a,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(a),d=function(e){return e.filter((e=>e.isMinor))}(a),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.line.show&&(f.style=n.line,f.padding=n.paddingStart,u.push(Gl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=lc(n),g=uc(h,f)),n.labels.show){const e=cc(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*hc(n,r)}({innerRect:r,scale:i,ticks:a,settings:n,tick:e})};let d=[];d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=ec(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=cc(n);return e.map(((e,s)=>{i(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?r:a;const l=ec(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>wa($(1,e[t].boundingRect),$(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...uc(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const mc={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"},gc={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"};const yc={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(){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(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:i}=e;const r=A(!0,{},t.isDiscrete?mc:gc,n),o=A(!0,{},r,i.settings),s=i.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:a,paddingEnd:l}=o;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=pc(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){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Ms(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=oc({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:a});if(l+=c,h)return{size:l};if(s.ticks.show&&(l+=s.ticks.margin,l+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>l&&(l=e)}if(s.line.show){const e=s.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return l+=s.paddingStart,l+=s.paddingEnd,{size:l,edgeBleed:u}}({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(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=A({},t,function(e){let{align:t,inner:n}=e;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})),r=n||i;return A(this.state.innerRect,i),A(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ms(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...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})),Fl.multiple(t),t}};const vc={render:()=>[]};function bc(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function xc(e,t){let 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}const wc={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(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=bc(e,t,this.scale)},preferredSize(){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(){const{title:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:s}=e;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:xc(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};A(a,s.text);const l=o(a);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),a.x=e,a.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===i?-l.height/6:-l.height/3,a.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),a.y=e,a.x="left"===i?r.width-n.paddingStart:n.paddingStart,a.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(A(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=bc(t,n,this.scale)}};function qc(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),i=l.startScroll+e;a.moveTo(i)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function Mc(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Dc={require:["chart","renderer"],on:{panStart(e){const t=Mc(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=qc(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Mc(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Mc(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Mc(e,this.renderer);qc(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(a,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Sc(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:s,state:a,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(d="".concat(a.targetRect.x+a.targetRect.width,"px"),f="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(h=n?a.targetRect.x:a.targetRect.y,d="".concat(a.rect.width-h,"px"),f="".concat(a.rect.height-h,"px")),c||(r-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(s,"px"):f,width:n?d:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:A({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function _c(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:s,pos:a,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:R(R({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":s,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[v])}function Cc(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:s,opacity:a}=e;return t("div",A({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},s),[])}function kc(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:s,idx:a}=e,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(s)*r.size:s,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,a=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(s)*t:s,u=Math.abs(a-l),h=Math.min(a,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[Cc(d)]))}const m=u<h?o:s,g=u<h?s:o,[y,v]=c?r.scale.domain():[Math.min(o,s),Math.max(o,s)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(Sc({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:a})),x&&n.push(Sc({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:a}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,s];b&&n.push(_c({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),x&&n.push(_c({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:a,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function Ec(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Ac(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||kc({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Ec(e);i=e.active.start+t,r=e.active.end+t}kc({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Tc(e){return{min:e.scale.min(),max:e.scale.max()}}function Ic(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Rc(e,t,n){let i,r,o=e.ranges,s=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){s=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===s&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(r={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function Nc(e){e.renderer.render(Ac(e))}function Oc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Pc(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let s=0;s<r.length;++s){const a=Math.abs(e-o-t(r[s]));a<i&&(i=a,n=r[s])}return n}function Lc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Fc(e){return H(e.reduce(((e,t)=>(e.push(...j(t.bounds)),e)),[]))}const zc={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(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Oc(this.state,this.state.brushInstance),this.state.active=null,Nc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Ms(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=Fc(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Ms(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=Fc(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({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:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),s=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(s,Math.max(n,i))},e.ranges[t]=R({},r[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Nc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Nc(this.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 t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=yo(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>Lc(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Pc(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=fs(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!Lc(i,[e.min,e.max]))return;const o=n.indexOf(Pc(e.min,t)),s=n.indexOf(Pc(e.max,t));r.push.apply(r,n.slice(Math.min(o,s),Math.max(o,s)+1))})),r}(e,r);return this.state.ranges=Oc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Ac(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=A({},i.element().getBoundingClientRect());const u=s-t.offset.left,h=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const 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];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=Tc(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!Ma(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Oc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Tc(e);Rc(e,e.current,n)}(this.state,Oc),Nc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({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{const n=Ec(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)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Oc(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),s=o.filter((e=>-1===r.indexOf(e))),a=r.filter((e=>-1===o.indexOf(e))),l=s.map((e=>({key:n.id(),value:e}))),c=a.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Nc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;Nc(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function jc(e){e.renderer.render(Ac(e))}function Hc(e){return e.rc.ranges()}function Bc(e,t){const 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)}const Vc={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(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),s=o[0]?o.slice(1).reduce(((e,t)=>({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:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[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=n,this.state.settings=t,this.state.offset=r,this.state.rc=Qo(),this.state.renderer=this.renderer,this.state.multi=!!t.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){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce(((n,r)=>{const o=n.bounds,s=r.bounds;return t===i?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===a.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=s-t.offset.left,h=a-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];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=Ic(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(d-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(d-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!Ma(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Hc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Ic(e);Rc(e,e.current,n)}(this.state,Hc),jc(this.state))},move(e){this.state.started&&(!function(e,t){const 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){const t=e.ranges.map((e=>({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{const n=Ec(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);let n=[];t.forEach((t=>{n=[...n,...Bc(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),jc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function $c(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,s=e.scale(r.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?i:l,y:t?a:0,height:t?l:i}}))}function Wc(e,t,n,i){function r(){!function(e){e.renderer.render($c(e))}(e)}function o(){!function(e){e.renderer.render($c(e))}(e)}function s(){!function(e){e.renderer.render($c(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",s),e.start=r,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=i)}function Uc(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}const Yc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Ms(this.chart.scale(e.scale),i);return Uc(this.state),Wc(this.state,t,r,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,$c(this.state)},beforeDestroy(){Uc(this.state)}};function Xc(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function Kc(e,t,n){return $s(e,t.points[0])<n.settings.snapIndicator.threshold**2}function Gc(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 Jc(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function Zc(e,t){e.snapIndicator.visible=t}const Qc={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(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){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(e){var t;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=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=Xc(this.state.rendererBounds,e);Gc(this.state,n),Jc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=Xc(this.state.rendererBounds,e);Kc(t,this.state,this.settings)?Zc(this.state,!0):Zc(this.state,!1),Gc(this.state,t),Jc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=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=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Zc(this.state,!1);Kc(Xc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{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(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{e.contexts.forEach((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 eu(e,t,n,i,r){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=r(t[l]),o[n]+o[i]<e[n]?s=l+1:a=l}return s}function tu(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eu;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[a]<r[a]||h[a]+h[l]>r[a]+r[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(wa(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),p=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[a])break;if(wa(h,t.localBounds)&&d!==t)return!1}return s.push(i[t]),!0}}const nu=4;function iu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ru(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function ou(e){return R(R({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function su(e,t,n){return n?e.width>=t.height:e.width>=t.width}function au(e,t,n){return n?e.height>=t.width:e.height>=t.height}function lu(e,t,n,i,r){let o,s;return"v"===e?(o=i||r||su(t,n,!0),s=au(t,n,!i)):(o=su(t,n),s=r||au(t,n,!1)),o&&s}function cu(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function uu(e,t,n){const i={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},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return su(e,t,n.rotate)&&au(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=cu(e.x,e.width,r.height,n.align)+o,i.y=cu(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=cu(e.x,e.width,r.width,n.align),i.y=cu(e.y,e.height,r.height,n.justify)+o),i}function hu(e){let{bar:t,view:n,direction:i,position:r,padding:o=nu}=e;const s={};if(A(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{top:n=nu,bottom:i=nu,left:r=nu,right:o=nu}=t;e.x+=r,e.width-=r+o,e.y+=n,e.height-=n+i}(s,o),s}function du(e){let t,n,i,r,o,{direction:s,fitsHorizontally:a,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hu;const p=[],m="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:s,position:i.position,padding:i.padding}),p.push(r),t=!o||r[m]>t[m]?r:t,lu(u,r,l,a,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function fu(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=nu,bottom:s=nu,left:a=nu,right:l=nu}=r,c=e.x+e.dx,u=e.y+e.dy,h=n?Math.min(t.width,i.height):Math.min(t.height,i.width),d=n?Math.min(t.height,i.height):Math.min(t.width,i.width),f=.5*t.height,p=1e-9,m=n?c-f:c,g=n?u:u-f,y={x:m-a-p,y:g-o-p,width:d+(a+l)-p,height:h+(o+s)-p};return y}function pu(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:du,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uu,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:tu;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,v,b,x,w,q,M,D;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,M=iu(f,t),b=d.direction,D="left"===b||"right"===b?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!ru(p))continue;x=d.labelSettings[t],v=d.measurements[t],q=x.placements;const n=s({direction:b,fitsHorizontally:r,lblStngs:x,measured:v,node:f,orientation:D,placements:q,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof x.linkData?x.linkData(M,e):void 0,n="function"==typeof w.overflow?w.overflow(M,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=a(g,p,{justify:"h"===D?w.align:m,align:"h"===D?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:i,overflow:!!n}),h){const n=fu(h,v,i,g,w.padding);y="function"==typeof w.fill?w.fill(R(R({},M),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(R(R({},M),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=fu(h,v,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const S=c.filter(l(u)),_=S.filter((e=>void 0!==e.backgroundBounds)).map(ou);return[..._,...S]}function mu(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:s,renderer:a}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!wa(f,n))continue;let b=iu(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(b,e):void 0,ru(d)&&(g="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=a.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*nu);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}function gu(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}function yu(e){const t=2*Math.PI;return(e%t+t)%t}function vu(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function bu(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function xu(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=i*s-r*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function wu(e){let t,n,{radius:i,size:r,angle:o}=e,{width:s,height:a}=r,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=xu(i,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=xu(i,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=xu(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=xu(i,l,2*Math.PI-o),!t)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:s,height:a}}function qu(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t,l=a-s-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>s&&(l=a-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=yu((r+o)/2);let h=a-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Mu(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const s=yu((r+o)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Du(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Su(e,t,n){const i={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)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function _u(e){let t,n,{slice:i,direction:r,position:o,padding:s,measured:a,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?qu({slice:i,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:s,outerRadius:a}=t;const l=yu((r+o)/2);let c=wu({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",Da(c,{x1:0,y1:0,x2:Math.sin(r)*a,y2:-Math.cos(r)*a})||Da(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||ma({cx:0,cy:0,r:s},c)?null:(vu(c,n),c)):null}({slice:i,measured:a,padding:s});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?qu({slice:n,measured:a,padding:s}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:s,outerRadius:a}=t,l=yu((o+s)/2);let c=wu({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",vu(c,n),r.insideLabelBounds.some((e=>wa(e,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:s,outerRadius:a,offset:l}=t,c=a+i,u=s-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=yu((o+s)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-a;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:a,padding:s,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:s,end:a,outerRadius:l,offset:c}=t;const u=yu((s+a)/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(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:s}=n,a=yu((i+r)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,i)),t}function Cu(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:s,store:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_u;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:s,direction:n,position:c.position,measured:i,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function ku(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:s,end:a}=e[o].desc.slice,l=yu((s+a)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>yu((e.desc.slice.start+e.desc.slice.end)/2)-yu((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),i.sort(s),r.sort(o),t.concat(n,r,i)}function Eu(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Au=/\n+|\r+|\r\n/,Tu=/\s/,Iu=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Ru(e){return"string"==typeof e?-1!==e.search(Au):-1!==String(e).search(Au)}function Nu(e){return-1!==e.search(Tu)}function Ou(e){return-1!==e.search(Iu)}function Pu(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}function Lu(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Fu(e,t,n){return Math.max(t,Math.min(n,e))}function zu(){let{string:e,separator:t="",reverse:n=!1,measureText:i=(e=>({width:e.length,height:1})),mandatoryBreakIdentifiers:r=[Ru],noBreakAllowedIdentifiers:o=[],suppressIdentifier:s=[Nu,Ru,e=>""===e],hyphenationIdentifiers:a=[Ou]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);Lu(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=Fu(e,0,c-1),n=l[t],u=i(n),h=Pu(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:s.some((e=>e(n,t,l))),hyphenation:a.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}function f(e){return isNaN(e)?n?h--:h++:h=Fu(e,0,c-1),u(h)?d(h):{done:!0}}return{next:f,peek:d,length:c}}const ju="…",Hu=/^\s*\d+(\.\d+)?px\s*$/i;function Bu(e){return"string"===typeof e&&Hu.test(e)}function Vu(e){const t=e["font-size"]||e.fontSize;return Bu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function $u(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=Vu(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Wu(e,t){return{lines:[],line:"",width:0,maxLines:$u(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Uu(e){e.lines.push(e.line),e.line="",e.width=0}function Yu(e,t){e.line+=t.value,e.width+=t.width}function Xu(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const 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(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Ku(e,t,n){const i=zu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?Xu(e,t,i):t,Uu(e),Yu(e,t)):Yu(e,t)}}function Gu(e,t){const n=zu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Wu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Uu(i),r=!1;break}1===e.breakOpportunity?Uu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Xu(i,e,n):e,Uu(i),Yu(i,e)):Yu(i,e)}return{lines:i.lines,reduced:r}}function Ju(e,t){const n=zu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Wu(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Uu(i),r=!1;break}1===e.breakOpportunity?Uu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?Uu(i):e.width>i.maxWidth?Ku(i,e,t):(Uu(i),Yu(i,e)):Yu(i,e)}return{lines:i.lines,reduced:r}}function Zu(e){return{"break-all":Gu,"break-word":Ju}[e.wordBreak]}function Qu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=Zu(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Ru(n.text)){const o=(Vu(n)-r.height)/2,s=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((s,a)=>{const l=A({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=ju:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(s,n,o,r.height)}}}}function eh(e,t){let{text:n,"font-size":i,"font-family":r,maxWidth:o}=e;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let s=t({text:n,fontSize:i,fontFamily:r}).width;if(s<=o)return n;let a=0,l=n.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:n.substr(0,e)+ju,fontSize:i,fontFamily:r}).width,s<=o?a=e+1:l=e-1}return n.substr(0,l)+ju}function th(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const nh={},ih={},rh={fontSize:void 0,fontFamily:void 0};let oh;function sh(e,t,n){const i=e+t+n;return"number"!=typeof ih[i]&&(oh=oh||document.createElement("canvas").getContext("2d"),function(e,t){rh.fontSize===e&&rh.fontFamily===t||(oh.font=e+" "+t,rh.fontSize=e,rh.fontFamily=t)}(t,n),ih[i]=oh.measureText(e).width),ih[i]}function ah(e){return"number"!=typeof nh[e]&&(nh[e]=function(e){if(Bu(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),nh[e]}function lh(e){let{text:t,fontSize:n,fontFamily:i}=e;return{width:sh(t,n,i),height:ah(n)}}function ch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),s=e.x||0,a=e.y||0,l=e.dx||0,c=(e.dy||0)+th(e),u={x:0,y:a+c-.75*r.height,width:o,height:r.height},h=e["text-anchor"]||e.anchor;return u.x="middle"===h?s+l-o/2:"end"===h?s+l-o:s+l,u}function uh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lh;const n=Zu(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Ru(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),s=A({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?ju:"";const c=t({text:s,fontSize:i,fontFamily:r}).width;c>=a&&(a=c,l=s)}s.text=l;const c=ch(s,t);return c.height=Vu(e)*o.lines.length,c}return ch(e,t)}const hh=.9;function dh(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function fh(e,t,n){const i={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},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function ph(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function mh(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==i?i:r;return ph({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?ph(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var gh={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;const l=A({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>A({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>A({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=mu({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=gu({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),a({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:s}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cu,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Su;const c=A({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>A({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>A({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=ku(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],s=Du(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(s,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(s,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(s,e):void 0,y=Eu(c,i,o),v=a({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){Mu({context:p,node:t,bounds:b});if(!aa(bu(b),r))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),b.line&&(b.line.stroke=n,d.push(b.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fh;const a=A({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=A({},a,t),c=t.labels.map((e=>A({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=dh(t,n),{type:a,bounds:d}=mh(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===a?2*d.r*hh:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.push(i)}const v=f,b=Math.max(0,y-p);let x;for(x="circle"===a?d.cy-d.r*hh:d.y,x+=l.justify*b+l.padding,f=0;f<v;f++){let t,n=c[f];if("circle"===a){let e=Math.max(Math.abs(x-d.cy),Math.abs(x+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:x,width:d.width-2*l.padding,height:m[f].height};x+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=s(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==ju){const e=eh(p,r.measureText);if(ju===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const yh={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&gh[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:s}=e;if(!n.component(i.component))return[];const a=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({chart:n,settings:i.strategy.settings,nodes:a,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},gh[e.strategy.type]))})),t}};const vh={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 bh(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:s="ltr"}=e,a=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===s;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(A({},c,d));return delete f.collider,a.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,a,{textMetrics:l,fontSize:parseInt(a.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,a],collider:{type:"rect",x:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function xh(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function wh(e,t){let n,i,r,o,{onScroll:s=(()=>{})}=t,a=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,s=[],a=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=A({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(i),u=Math.max(l[e].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),a=isNaN(n.layout.scrollOffset)?a:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const s=c.extent();a=Math.max(0,Math.min(a,l)),o=A({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=a,o["x"===u?"width":"height"]=s,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=bh,parallels:s,createSymbol:a}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let v=t.x,b=t.y,x=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?i.x+x+i.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:a});if((h&&v>=i.x-m||!h&&b>=i.y-p)&&f.push(n.item),d++,d>=s?(d=0,h?(v+=y,b=t.y):(b+=g,v=t.x)):h?b+=g:v+=y,!h&&b>i.y+i.height)break;if(h&&v>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return xh(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,xh(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,a-e));t!==a&&(a=t,s())},offset:()=>a,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>xh(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function qh(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const Mh={up:"▲",right:"▶",down:"▼",left:"◀"};function Dh(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:s}=t,a={},l="";const c=s;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:r}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),e("button",A({class:qh(a),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[Mh[r]])])}function Sh(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=a?["right","left"]:["down","up"];l&&a&&h.reverse();const d=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[Dh(s,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),Dh(s,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function _h(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=A({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(A({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Ch(e,t,n,i){let r,o,s,{itemRenderer:a,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const e=d.width-r.width-(r.width?t.spacing:0),n=d.height;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0,f=a.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},s={x:o.x+o.width+(i?t.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===a.direction()&&(s.x=d.x,o.x=s.x+s.width+(s.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,a.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;a.parallelize(e,u?void 0:n);const i=a.extent()>e?l.extent():0;s={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,a.spread())}return o=A({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,r.x+=e.x,r.y+=e.y,{title:A({},e,r),content:A({},e,o),navigation:A({},e,s),orientation:n,preferredSize:h}}function kh(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?A({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:A(!0,{},vh.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:vh.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:A(!0,{},vh.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=A(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:A(!0,{},vh.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:A(!0,{},{show:vh.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:s,symbols:l,items:c,layout:o}}(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 Eh(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:s}=e,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=Ch(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:A({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),s.render({rect:c.title}),e.state.views={layout:c},u}const Ah={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(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(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const 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(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Eh(this);this.update(e)},this.itemRenderer=wh(this,{onScroll:this.onScroll}),this.navigationRenderer=Sh(this),this.titleRenderer=_h(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),kh(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,s=Ch(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){kh(this)},render(){return Eh(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Th(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Ih(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Rh(e){return Ih(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 Nh(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Oh(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;return!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String)),n.map(((n,r)=>{const o=i[r];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,r),s=function(e){return Ih(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){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const a=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=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:Rh(e.settings),textMetrics:a,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return c}const Ph={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(e){const t=this.state;t.rect=Nh(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>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+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Oh(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Oh(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Nh(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,s+=t.title.textMetrics.height,a=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,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:a,title:n.title.text};return Th(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,i=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return i.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,s=r.y,a=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(s+=n.rect.height-i.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Th(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map((s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*s.textMetrics.height,r=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*s.textMetrics.height,r=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const Lh={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 Fh(e,t){let{generatorType:n,item:i,data:r,major:o,minor:s,layerObj:a,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function zh(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:s}=e;const{width:a,height:l}=i,c=r.resolve({data:t,defaults:Lh.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=R({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:Lh.layers.curve,show:Lh.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:A({},Lh.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:A({},Lh.layers.area,o.area),settings:m.area})}}(e),s=[];return t.forEach(((t,a)=>{const l=i.items[a];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:r.items[a],areaObj:o.items[a],median:f,points:u,consumableData:t.consumableData})})),s}const jh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=zh({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,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){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const s=[],a=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=A(!0,{},d);d=A(!0,{},h),h=A(!0,{},e)}a.area&&!1!==c.show&&s.push(Fh(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(Fh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(Fh(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),s}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function Hh(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,s=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(s,e.rect.height)):s}}function Bh(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Vh(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const $h={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Hh(this,e,!1);Ma({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=Hh(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Hh(this,e),function(e){if(e.state.active){const t=Bh(e,e.state.start),n=Bh(e,e.state.end),i=e.chart.shapesAt(Vh(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([A({type:"rect"},Vh(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((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 Wh(e,t,n){let{renderer:i,style:r,props:o,h:s}=n;const a=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,i){return i.content({h:e,style:n,data:t})}(s,e,r,o),c=s("div",{dir:o.direction,class:qh(A({"pic-tooltip":!0},a.tooltip)),style:A({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:r.content,class:qh(A({"pic-tooltip-content":!0},a.content))},l),s("div",{class:qh(A({"pic-tooltip-arrow":!0},a.arrow)),style:A({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Uh(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),a=function(){},l=()=>{i=null,r=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),s.set("debounced")),s.set("pending"),i=setTimeout((()=>{e(),o=!0,i=null,s.set("active")}),c),a>0&&(r&&clearTimeout(r),r=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):i&&(clearTimeout(i),s.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function Yh(){let 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 Xh(e,t){let 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 Kh(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 Gh(e,t,n,i,r,o){const s=t+o.x,a=n+o.y,l=r;return!(s<0||a<0)&&!(s+i>e.width||a+l>e.height)}function Jh(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:s}=e;const a=n+s.x,l=i+s.y,c=r,u=o;let h=a<0?-a:0,d=l<0?-l:0;return h+=a+c>t.width?-(a+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function Zh(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:s,y:a}=e;const{targetBounds:l}=n,c=Yh(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:Kh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Xh(i,r,t.offset),f=[],p="target"===t.area?s:l.left+s,m="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=Jh({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},g=Kh(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function Qh(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return A({scaleRatio:r.scaleRatio},r.computedInner)}const ed={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:s}=e;const{targetBounds:a}=i,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h}},f=Yh(s.offset),p=f[s.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[s.dock].x,"px"),top:"".concat(d[s.dock].y,"px"),transform:p},computedArrowStyle:Kh(s.offset)[s.dock],dock:s.dock};const m={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},g=Xh(r,o,s.offset),y=["top","left","right","bottom"];for(let e=0;e<y.length;e+=1){const t=y[e];if(Gh(m,"target"===s.area?d[t].x:a.left+d[t].x,"target"===s.area?d[t].y:a.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Kh(s.offset)[t],dock:t}}return{computedTooltipStyle:{left:"".concat(d.top.x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Kh(s.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:s}=n;return Zh({x:o,y:s,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:s}=e;const a=o[0],{dx:l,dy:c}=n,u=s.getComponentBoundsFromNode(a),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:m}=a.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Zh({x:h+m*u.scaleRatio.x*Math.cos(v),y:d+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:i,height:r,options:t,dockOrder:b})}};function td(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:s}=t;const a={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>Qh(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=Qh(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=A(c,s.placement(a))),"object"===l&&ed[s.placement.type]?c=A(c,s.placement):"string"===l&&ed[s.placement]&&(c=A(c,{type:s.placement})),a.options=c;const u=ed[c.type](a);let{x:h,y:d,width:f,height:p}=a.resources.getComponentBoundsFromNode(a.nodes[0]);return h+=a.pointer.dx,f+=h,d+=a.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let nd;function id(){nd=null}const rd={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>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};const od={require:["chart","renderer"],defaultSettings:{settings:rd,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(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=i.targetElement.getBoundingClientRect(),l=r,c=o,u=s.left-a.left,h=s.top-a.top,d=r-s.left,f=o-s.top;return r-=a.left,o-=a.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(n)?this.props.filter(n):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((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Uh({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){nd&&nd!==e&&nd()}(t),nd=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,A({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,A({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),nd===t&&(nd=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),id()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),id()},appendTo(){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;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},a=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=A({node:e},s);a.push(r.extract(t))}})),a}(e,this),n=td(Wh(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Wh(t,n,this)}};const sd={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},ad=2*Math.PI;function ld(e,t,n,i){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+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}function cd(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function ud(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function hd(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||ld(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const s=.5,a=cd(e,t),l=cd(t,n),c=cd(n,i),u={x:ud(s,e.x,t.x,n.x,i.x),y:ud(s,e.y,t.y,n.y,i.y)},h=cd(a,l),d=cd(l,c);return hd(e,a,h,u,r,o-1),hd(u,d,c,i,r,o-1),r}function dd(e,t,n){const{cp1:i,cp2: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 hd(e,i,r,n)}function fd(e,t,n){const i=[],r=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,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 i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:a,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,i,r,o,s,a,l){let c,u,h,d,f,p;const m=Ls(n%360),g=Math.cos(m),y=Math.sin(m),v=(a-o)/2,b=(l-s)/2,x=g*v+y*b,w=g*b-y*v;p=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const q=e*w,M=t*x,D=q**2+M**2,S=(e*t)**2-D;let _=Math.sqrt(Math.max(S/D,0));i===r&&(_=-_);const C=_*(q/t),k=_*(-M/e);d=g*C-y*k+(a+o)/2,f=y*C+g*k+(l+s)/2;const E=(x-C)/e,A=(w-k)/t,T=(-x-C)/e,I=(-w-k)/t;return c=Math.atan2(A,E),c+=c<0?ad:0,u=Math.atan2(I,T),u+=u<0?ad:0,h=u-c,!r&&c<u?h-=ad:r&&u<c&&(h+=ad),h%=ad,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,s,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%ad,n=Math.cos(t),r=Math.sin(t);i.push({x:a+n*f+-r*n,y:l+r*p+n*r})}return i}function pd(e){const t=w.parsePath(e),n=[],i=[];let r=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(s=null,a=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...fd(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...fd(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...hd({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),s=u[3]+r,a=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...hd({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],r=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=r,a=o),i.push(...hd({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),s=u[1]+r,a=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=r,a=o),i.push(...hd({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],r=u[3],o=u[4];break;case"Q":i.push(...dd({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...dd({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...dd({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...dd({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const md={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{pd(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var gd=[function(e){e.component("box",_l),e.component("box-marker",_l)},function(e){e.component("point",Rl),e.component("point-marker",Rl)},function(e){e.component("pie",Ll)},function(e){e.component("grid-line",Bl)},function(e){e.component("ref-line",Kl)},function(e){e.component("axis",yc)},function(e){e.component("container",vc)},function(e){e.component("text",wc)},function(e){e.component("scrollbar",Dc)},function(e){e.component("brush-range",zc),e.component("brush-area-dir",Vc)},function(e){e.component("range",Yc)},function(e){e.component("brush-lasso",Qc)},function(e){e.component("labels",yh)},function(e){e.component("legend-cat",Ah)},function(e){e.component("legend-seq",Ph)},function(e){e.component("line",jh)},function(e){e.component("brush-area",$h)},function(e){e.component("tooltip",od)},function(e){e.component("debug-collider",sd)},function(e){e.component("debug-path-to-points",md)}];let yd=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class vd{constructor(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return Ma(this,e)}intersectsLine(e){return Da(this,B(e))}intersectsRect(e){return wa(this,H(e))}intersectsCircle(e){return ma(e,this)}intersectsPolygon(e){return xa(e,this)}intersectsGeoPolygon(e){return Ia(e,this)}points(){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}]}}class bd{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return pa(this,e)}intersectsLine(e){return ga(this,B(e))}intersectsRect(e){return ma(this,H(e))}intersectsCircle(e){return n=e,!ua(t=this)&&!ua(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return ya(this,e)}intersectsGeoPolygon(e){return Ea(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class xd{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return ga({cx:e.x,cy:e.y,r:this.tolerance},this)}return _a(this,e)}intersectsLine(e){return Sa(this,B(e))}intersectsRect(e){return Da(H(e),this)}intersectsCircle(e){return ga(e,this)}intersectsPolygon(e){return ba(e,this)}intersectsGeoPolygon(e){return Ta(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class wd{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return va(this,e)}intersectsCircle(e){return ya(e,this)}intersectsLine(e){return ba(this,B(e))}intersectsRect(e){return xa(this,H(e))}intersectsPolygon(e){return Ca(this,e)}intersectsGeoPolygon(e){return ka(e,this)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function qd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wd(...t)}function Md(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Dd(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Sd{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Dd(this.vertices[e]),this.vertices[e].length>2&&Md(this.vertices[e]),this.polygons[e]=qd({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Aa(this,e)}intersectsCircle(e){return Ea(e,this)}intersectsLine(e){return Ta(this,B(e))}intersectsRect(e){return Ia(this,H(e))}intersectsPolygon(e){return ka(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!wa(n,i)&&(qa(i,n)?fa(t,e):fa(e,t))}(this,e)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function _d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sd(...t)}class Cd{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>_a(t,e)))}intersectsCircle(e){return this.segments.some((t=>ga(e,t)))}intersectsLine(e){const t=B(e);return this.segments.some((e=>Sa(e,t)))}intersectsRect(e){const t=H(e);return this.segments.some((e=>Da(t,e)))}intersectsPolygon(e){return this.segments.some((t=>ba(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>Ta(e,t)))}points(){return this._points}}const kd=Ge();function Ed(e,t){return kd.get(e)(t)}kd.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vd(...t)})),kd.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bd(...t)})),kd.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xd(...t)})),kd.add("polygon",qd),kd.add("geopolygon",_d),kd.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cd(...t)}));class Ad{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=Ed(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Td{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Td).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let 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}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Td&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*s+n*i*a-n*r*s-t*i*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,i*l-n*c,n*s-i*o],[s*a-r*c,t*c-i*a,i*r-t*s],[r*l-o*a,a*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const 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}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const 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]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=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]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,s=this._elements,a=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*s[n][i];a.push({x:o[0],y:o[1]})}return a}get elements(){const 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]]]}}const Id=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Rd(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function Nd(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function Od(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function Pd(e,t){t.args.length>=6&&e.transform(...t.args)}function Ld(e,t){const n=function(e){let t,n=[];for(;null!==(t=Id.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Rd(t,i):"scale"===i.cmd?Nd(t,i):"matrix"===i.cmd?Pd(t,i):"translate"===i.cmd&&Od(t,i)}const Fd={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},zd={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function jd(e,t){if(!t||!t.length||!e||"function"!=typeof zd[e.type])return[];switch(e.type){case"type":case"tag":return zd[e.type](e.value,t);case"attr":return zd[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return zd[e.type](t);default:return[]}}var Hd={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let s;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const s=t=>{r=e.match(Fd[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Fd).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){s=r[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=jd(e,n),a=!0})),a&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Bd(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=H(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=B(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Os(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Os(r[t],!0);o={type:"path",d:e}}return o}class Vd{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Bd(e,t,n)))}:Bd(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Vd(e))),this._parent=()=>e.parent?new Vd(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function $d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vd(...t)}class Wd{constructor(e){this._node=$d(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Ud(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wd(...t)}function Yd(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Ud(n);const e=n.parent;e&&"stage"!==e.type&&Yd(e,t.parent)}}function Xd(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let 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{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?_d(n):qd(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Ud(r);return Yd(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Ud(e);return Yd(e,t),t}return null}(e,t,i)}function Kd(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],s=Xd(r,t,i);s&&n.push(s),!r.children||s||r.collider||Kd(r.children,t,n,i)}}function Gd(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Xd(i,t,n))return!0;if(i.children&&!i.collider)return Gd(i.children,t,n)}return!1}function Jd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=V(e);let i={};switch(n){case"circle":return i.cx=e.cx*t,i.cy=e.cy*t,i.r=e.r,["intersectsCircle",i];case"rect":return i=j(e).map((e=>Hs(e,t))),["intersectsRect",i];case"line":return i=z(e).map((e=>Hs(e,t))),["intersectsLine",i];case"point":return i=Hs(e,t),["containsPoint",i];case"polygon":return i.vertices=e.vertices.map((e=>Hs(e,t))),["intersectsPolygon",i];case"geopolygon":return i.vertices=e.vertices.map((e=>e.map((e=>Hs(e,t))))),["intersectsGeoPolygon",i];default:return[]}}function Zd(e,t){const[n,i]=Jd(t,e.dpi),r=[];return n&&(Kd([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function Qd(e,t){const[n,i]=Jd(t,e.dpi);return Gd([e],n,i)}class ef extends yd{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var s,a;s=this.attrs,a=e,Object.keys(Ns).forEach((e=>{const t=a[e];void 0!==t&&(s[Ns[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=A(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Hd.find(e,this).map((e=>$d(e)))}getItemsFrom(e){return Zd(this,e)}containsPoint(e){return Qd(this,e)}intersectsLine(e){return Qd(this,e)}intersectsRect(e){return Qd(this,e)}intersectsCircle(e){return Qd(this,e)}intersectsPolygon(e){return Qd(this,e)}intersectsGeoPolygon(e){return Qd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Td;void 0!==this.attrs.transform&&Ld(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Td;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const 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))}get collider(){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 new Ad(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Ed("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Ed(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class tf extends yd{addChild(e){if(!(e&&e instanceof yd))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}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let 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}}const nf=tf.prototype;class rf extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=A({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{x:o,y:s}=i,{x:a,y:l}=r,c=isNaN(n.width)?a:Math.max(a,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=A({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}addChild(e){const t=nf.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=A({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=nf.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=A({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(nf.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=A(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(nf.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=A(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function of(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rf(...t)}class sf extends rf{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const af=tf.prototype,lf=["x1","x2","y1","y2","id","offset","style"];class cf extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=lf.length;i!==r;i++)n=lf[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return af.addChild.call(this,e)}addChildren(e){return af.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return af.removeChild.call(this,e),this}removeChildren(e){return af.removeChildren.call(this,e),this}}function uf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cf(...t)}const hf=tf.prototype,df=["patternUnits","x","y","width","height","id"];class ff extends ef{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=df.length;i!==r;i++)n=df[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return hf.addChild.call(this,e)}addChildren(e){return hf.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return hf.removeChild.call(this,e),this}removeChildren(e){return hf.removeChildren.call(this,e),this}}let pf=class extends ef{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:s=0,collider:a}=e,l=A({type:"rect",x:t,y:n,width:i,height:r},a);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),s>0&&(this.attrs.ry=s),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=j(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,s]=F(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:s-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}};class mf extends ef{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=A({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const 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]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-i,s=n-r;let a=2*i,l=2*r,c=[{x:o,y:s},{x:o+a,y:s},{x:o+a,y:s+l},{x:o,y:s+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=F(c);a=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class gf extends ef{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const s={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=A(s,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=z(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=F(t),s=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:s?Math.max(1,r-n):0,height:s?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}const yf=Math.PI/2;function vf(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function bf(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const xf={step:function(e){return new $e(e,.5)},stepAfter:function(e){return new $e(e,1)},stepBefore:function(e){return new $e(e,0)},linear:we,basis:function(e){return new Ee(e)},cardinal:Ie.tension(0),catmullRom:Ne,monotonex:function(e){return new ze(e)},monotoney:function(e){return new je(e)},natural:function(e){return new Be(e)}};function wf(e){if(e.length<2)return!1;const 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}class qf extends ef{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=be();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:s}=e,a=De(),l=o.coordinates?o.coordinates.defined:null;a[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(xf["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):a.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(a.defined()):r,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=pd(this.attrs.d),this.segments.length>1&&this.segments.every((e=>wf(e))))return void(this.collider=A({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(wf(t))this.collider=A({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=vf(a,s),u=vf(a,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=vf(s,a);i.push(bf(s,e-yf,t)),r.unshift(bf(s,e+yf,t))}const g=m?f:p,y=m?p:f;if(i.push(bf(a,g,t)),r.unshift(bf(a,y,t)),n===o-1){const e=vf(l,a);i.push(bf(l,e+yf,t)),r.unshift(bf(l,e-yf,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=A({type:"polyline",points:t},e.collider)}))}}boundingRect(){let 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:pd(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=F(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}function Mf(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class Df extends ef{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:s,title:a,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=s,void 0!==a&&(this.attrs.title=String(a)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=A({type:Mf(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=j(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,s,a]=F(i);return this.__boundingRect[t]={x:r,y:o,width:s-r,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}const Sf=Ge();function _f(e,t){return Sf.get(e)(t)}Sf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pf(...t)})),Sf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mf(...t)})),Sf.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Df(...t)})),Sf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gf(...t)})),Sf.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qf(...t)})),Sf.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sf(...t)})),Sf.add("container",of),Sf.add("defs",of),Sf.add("linearGradient",uf),Sf.add("radialGradient",uf),Sf.add("stop",uf),Sf.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ff(...t)}));const Cf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==r[s]&&(o[s]=r[s]);return A(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function kf(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Ef(e,t,n){e.node=n[t],e.index=t}function Af(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Ef(o,s,e),kf(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Cf.save(o.node);const a=_f(o.node.type,o.node);a&&(o.node.transform&&(n.save(),Ld(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&Af(o.node.children,a,n,i),o.node.transform&&n.restore()),Cf.restore()}}function Tf(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=_f("stage",i)),Af(t,n,new Td,r),n}function If(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let s=null;if("radial"===i){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else{const i=Fs(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();s=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];s.addColorStop(t.offset,t.color)}return s}function Rf(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Nf(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Rf(e,t,n),i[r]):Rf(e,t,n)},clear(){i={}}}}function Of(){let{x:e,y:t,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a={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 a.x=isNaN(e)?a.x:e,a.y=isNaN(t)?a.y:t,a.width=isNaN(n)?a.width:n,a.height=isNaN(i)?a.height:i,void 0!==r&&(a.scaleRatio.x=isNaN(r.x)?a.scaleRatio.x:r.x,a.scaleRatio.y=isNaN(r.y)?a.scaleRatio.y:r.y),void 0!==o&&(a.margin.left=isNaN(o.left)?0:o.left,a.margin.top=isNaN(o.top)?0:o.top),"object"==typeof s&&["left","right","top","bottom"].forEach((e=>{!isNaN(s[e])&&s[e]>0&&(a.edgeBleed[e]=s[e],a.edgeBleed.bool=!0)})),a.computedPhysical={x:Math.round(a.margin.left+(a.x-a.edgeBleed.left)*a.scaleRatio.x),y:Math.round(a.margin.top+(a.y-a.edgeBleed.top)*a.scaleRatio.y),width:Math.round((a.width+a.edgeBleed.left+a.edgeBleed.right)*a.scaleRatio.x),height:Math.round((a.height+a.edgeBleed.top+a.edgeBleed.bottom)*a.scaleRatio.y)},a}function Pf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:lh,textBounds:uh,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Lf(e){return t=>{let{node:n}=t;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const Ff=200,zf=200;class jf{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*Ff,height:n.computedPhysical.height+2*zf},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Hf=Ge();function Bf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Vf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function $f(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Wf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in i)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Uf(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=If(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=If(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=i.patterns.create(o.attrs.stroke))),Wf(t,o,n,s),o.modelViewMatrix&&$f(o.modelViewMatrix.elements,t),Hf.has(o.type)&&Hf.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Uf(o.children,t,n,i),t.restore()}}function Yf(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}function Xf(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tf;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,s=Of();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Bf]];let l;const c=Pf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new jf(e)),n.appendChild(e),e),c.getScene=i=>{const r=Vf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:i,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,")")),n({items:[l],dpi:r,on:{create:[Qu(c.measureText),Lf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=Nf(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Vf(u),d=t&&i.transform();if(d)return e.width=e.width,Yf({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(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:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Uf(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Of(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function Kf(e,t){Hf.add(e,t)}function Gf(e,t){return Math.max(0,Math.min(e,t))}const Jf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Zf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Qf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ep(e){return Jf.test(e)}function tp(e){return Zf.test(e)||Qf.test(e)}function np(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],ep(n))return"ltr";if(tp(n))return"rtl"}return"ltr"}const ip={start:"end",end:"start",center:"center",middle:"middle"};function rp(e,t){return"rtl"===t?ip[e]:e}function op(e,t){const n=[];let i;const r=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=op([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=op(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,s.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:r,items:i}}function sp(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function ap(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function lp(e,t,n,i){let r;for(let o=0,s=e.length;o<s;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(sp(r.diff.added,r.object,t),ap(r.diff.removed,i),lp(r.diff.items,t,n,i)))}function cp(e,t,n,i,r,o){const s=op(e,t);return sp(s.added,n,i),ap(s.removed,o),lp(s.items,i,r,o),s.items}Kf("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,s){o=Gf(i/2,o>0?o:s),s=Gf(r/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+r-s),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-s),e.lineTo(t+i,n+s),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),Kf("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Kf("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),Kf("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),Kf("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||eh(e,lh);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"]);const s=np(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=rp("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=th(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const up="http://www.w3.org/2000/svg",hp=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(up,"container"===e?"g":e);return t.appendChild(n),n},dp=e=>{e.parentNode&&e.parentNode.removeChild(e)},fp=(e,t)=>{if((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(const 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||eh(t.attrs,lh);const n=np(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",rp(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(up,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?th(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class pp{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function mp(){return new pp(cp,hp,fp,dp)}function gp(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function yp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gp,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(a);if(!n[a]){let{orientation:t,degree:i,stops:s=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=Fs(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=s.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}function vp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gp,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")}))},clear(){n={}}};return r}function bp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mp,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:up,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Tf;const i=e();let r,o,s,a=!1,l=Of();const c={transform:void 0},u=Pf(),h={type:"defs",children:[]},d=vp(h.children),f=yp(h.children);return u.element=()=>r,u.root=()=>o,u.settings=e=>(e&&Object.keys(c).forEach((t=>{void 0!==e[t]&&(c[t]=e[t])})),c),u.appendTo=e=>(r||(r=e.ownerDocument.createElementNS(t,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",t),o=e.ownerDocument.createElementNS(t,"g"),o.style.pointerEvents="auto",r.appendChild(o)),e.appendChild(r),r),u.getScene=e=>{const t=l.scaleRatio.x,i=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,h]:e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*i,")"):""};return 1===t&&1===i||(r.transform+="scale(".concat(t,", ").concat(i,")")),n({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,Qu(u.measureText),Lf(u)]}})},u.render=e=>{if(!r)return!1;const t="function"==typeof c.transform&&c.transform();if(t){const{a:e,b:n,c:i,d:r,e:s,f:a}=t;return o.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(r,", ").concat(s,", ").concat(a,")"),!0}o.style.transform="",a&&(r.style.left="".concat(l.computedPhysical.x,"px"),r.style.top="".concat(l.computedPhysical.y,"px"),r.setAttribute("width",l.computedPhysical.width),r.setAttribute("height",l.computedPhysical.height)),f.clear(),d.clear(),h.children.length=0;const n=u.getScene(e),p=!s||!n.equals(s),m=a||p;return m&&(u.clear(),i.render(n.children,o)),a=!1,s=n,m},u.itemsAt=e=>s?s.getItemsFrom(e):[],u.findShapes=e=>s?s.findShapes(e):[],u.clear=()=>{if(!o)return u;s=null;const e=o.cloneNode(!1);return r.replaceChild(e,o),o=e,u},u.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,o=null},u.size=e=>{if(e){const t=Of(e);JSON.stringify(l)!==JSON.stringify(t)&&(a=!0,l=t)}return l},u}var xp,wp,qp,Mp,Dp,Sp={},_p=[],Cp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function kp(e,t){for(var n in t)e[n]=t[n];return e}function Ep(e){var t=e.parentNode;t&&t.removeChild(e)}function Ap(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?xp.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Tp(e,s,i,r,null)}function Tp(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++qp:r};return null==r&&null!=wp.vnode&&wp.vnode(o),o}function Ip(e){return e.children}function Rp(e,t){this.props=e,this.context=t}function Np(e,t){if(null==t)return e.__?Np(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?Np(e):null}function Op(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 Op(e)}}function Pp(e){(!e.__d&&(e.__d=!0)&&Mp.push(e)&&!Lp.__r++||Dp!==wp.debounceRendering)&&((Dp=wp.debounceRendering)||setTimeout)(Lp)}function Lp(){for(var e;Lp.__r=Mp.length;)e=Mp.sort((function(e,t){return e.__v.__b-t.__v.__b})),Mp=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=kp({},r)).__v=r.__v+1,Wp(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?Np(r):o,r.__h),Up(n,r),r.__e!=o&&Op(r)))}))}function Fp(e,t,n,i,r,o,s,a,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||_p,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Tp(null,f,null,null,f):Array.isArray(f)?Tp(Ip,{children:f},null,null,null):f.__b>0?Tp(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[u])||d&&f.key==d.key&&f.type===d.type)y[u]=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}Wp(e,f,d=d||Sp,r,o,s,a,l,c),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=zp(f,l,e):l=jp(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Np(d))}for(n.__e=m,u=v;u--;)null!=y[u]&&Kp(y[u],y[u]);if(g)for(u=0;u<g.length;u++)Xp(g[u],g[++u],g[++u])}function zp(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?zp(i,t,n):jp(n,i,i,r,i.__e,t));return t}function jp(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function Hp(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Cp.test(t)?n:n+"px"}function Bp(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Hp(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Hp(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?i||e.addEventListener(t,o?$p:Vp,o):e.removeEventListener(t,o?$p:Vp,o);else if("dangerouslySetInnerHTML"!==t){if(r)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 Vp(e){this.l[e.type+!1](wp.event?wp.event(e):e)}function $p(e){this.l[e.type+!0](wp.event?wp.event(e):e)}function Wp(e,t,n,i,r,o,s,a,l){var c,u,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,a=t.__e=n.__e,t.__h=null,o=[a]),(c=wp.__b)&&c(t);try{e:if("function"==typeof D){if(g=t.props,y=(c=D.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in D&&D.prototype.render?t.__c=u=new D(g,v):(t.__c=u=new Rp(g,v),u.constructor=D,u.render=Gp),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=D.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=kp({},u.__s)),kp(u.__s,D.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,h)null==D.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==D.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=v,u.props=g,u.__v=t,u.__P=e,x=wp.__r,w=0,"prototype"in D&&D.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=kp(kp({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),M=null!=c&&c.type===Ip&&null==c.key?c.props.children:c,Fp(e,Array.isArray(M)?M:[M],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Yp(n.__e,t,n,i,r,o,s,l);(c=wp.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),wp.__e(e,t,n)}}function Up(e,t){wp.__c&&wp.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wp.__e(e,t.__v)}}))}function Yp(e,t,n,i,r,o,s,a){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!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=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&xp.call(e.childNodes),c=(h=n.props||Sp).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||Bp(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Bp(e,o,t[o],n[o],i)}(e,d,h,r,a),u)t.__k=[];else if(p=t.props.children,Fp(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&Np(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Ep(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Bp(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&Bp(e,"checked",p,h.checked,!1))}return e}function Xp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){wp.__e(e,n)}}function Kp(e,t,n){var i,r;if(wp.unmount&&wp.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Xp(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){wp.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Kp(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Ep(e.__e),e.__=e.__e=e.__d=void 0}function Gp(e,t,n){return this.constructor(e,n)}function Jp(e,t,n){var i,r,o;wp.__&&wp.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Wp(t,e=(!i&&n||t).__k=Ap(Ip,null,[e]),r||Sp,Sp,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?xp.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Up(o,e)}function Zp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Of();const o={transform:void 0},s=Pf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{a:e,b:i,c:r,d:o,e:s,f:a}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}let s;return n.style.transform="",n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),s=Array.isArray(e)?Ap("div",null,e):e,i=Jp(s,n,i),!0},s.renderArgs=[Ap],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},s.size=e=>(e&&(r=Of(e)),r),s}xp=_p.slice,wp={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},qp=0,Rp.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=kp({},this.state),"function"==typeof e&&(e=e(kp({},n),this.props)),e&&kp(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Pp(this))},Rp.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Pp(this))},Rp.prototype.render=Ip,Mp=[],Lp.__r=0;var Qp=[function(e){e.renderer("svg",bp)},function(e){e.renderer("canvas",Xf)},function(e){e.renderer("dom",Zp)}];const em={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},tm=function(){let{level:e=em.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[em.OFF]:()=>{},[em.ERROR]:function(){return t.error(...arguments)},[em.WARN]:function(){return t.warn(...arguments)},[em.INFO]:function(){return t.info(...arguments)},[em.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[em.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(em.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:em}};function nm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}const im=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=tm(t.logger),r={component:Ge(n.component,"component",i),data:Ge(n.data,"data",i),formatter:Ge(n.formatter,"formatter",i),interaction:Ge(n.interaction,"interaction",i),renderer:cl(n.renderer),scale:Ge(n.scale,"scale",i),symbol:Ge(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i={palettes:t.palettes.concat(n.palettes||[]),style:A({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(i,r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nm(e,t,r)},o.chart=e=>ll(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=T,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:ul,data:gl,formatter:qi,interaction:yl,renderer:cl(),scale:Fo,symbol:Gs});function rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function om(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rm(Object(n),!0).forEach((function(t){sm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sm(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}gd.forEach(im.use),Qp.forEach(im.use),[].forEach(im.use);var am=Object.prototype.hasOwnProperty,lm=Object.prototype.toString,cm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,hm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===lm.call(e)},dm=function(e){if(!e||"[object Object]"!==lm.call(e))return!1;var t,n=am.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&am.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||am.call(e,t)},fm=function(e,t){cm&&"__proto__"===t.name?cm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pm=function(e,t){if("__proto__"===t){if(!am.call(e,t))return;if(um)return um(e,t).value}return e[t]},mm=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=pm(a,n),a!==(r=pm(t,n))&&(u&&r&&(dm(r)||(o=hm(r)))?(o?(o=!1,s=i&&hm(i)?i:[]):s=i&&dm(i)?i:{},fm(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&fm(a,{name:n,newValue:r}));return a};function gm(e,t,n){if(!e)return-1;const i=n.cache,r=e.origin?e.origin():null;r&&(e=r);let o=i.fields.indexOf(e),s=-1,a=-1;if(-1===o)for(let t=0;t<i.wrappedFields.length;t++)if(a=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==a||-1!==s){o=t;break}return o-=t.qArea.qLeft,o<0||o>=t.qArea.qWidth?-1:a>=0?e=>e[o].qAttrDims.qValues[a]:s>=0?e=>e[o].qAttrExps.qValues[s]:e=>e[o]}function ym(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function vm(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h}=e,d=i;if(r.field&&r.field!==n){const e=gm(r.field,s,{cache:t});if(-1===e)return;d=mm({qRow:a},e(l))}u[h]=ym(r,d,{key:c})}function bm(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<s.qDataPages.length;t++){const o=gm(l,s.qDataPages[t],{cache:n});if(-1!==o)for(let y=0;y<s.qDataPages[t].qMatrix.length;y++){const v=s.qDataPages[t].qArea.qTop+y,b=mm({qRow:v},o(s.qDataPages[t].qMatrix[y])),x=ym(u,b,{key:a});if(!(u.filter&&!u.filter(b))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(x[h[e]]=[]);for(let o=0;o<r.length;o++)vm({cache:n,f:l,mainCell:b,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:v,row:s.qDataPages[t].qMatrix[y],sourceKey:a,target:i.fields?x[h[e]]:x,targetProp:i.fields?o:h[e]});if(i.fields){const t=x[h[e]].map((e=>e.value)),n=x[h[e]].map((e=>e.label));x[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(x[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:b,obj:x,target:m,tracker:p,trackType:f}),g.push(x)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function xm(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function wm(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Mm)):void 0===t&&(t=qm);for(var n,i,r,o,s,a=new _m(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new _m(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Sm)}function qm(e){return e.children}function Mm(e){return Array.isArray(e)?e[1]:null}function Dm(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Sm(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function _m(e){this.data=e,this.depth=this.height=0,this.parent=null}function Cm(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}_m.prototype=wm.prototype={constructor:_m,count:function(){return this.eachAfter(xm)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].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(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},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 wm(this).eachBefore(Dm)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var km={depth:-1},Em={},Am={};function Tm(e){return e.id}function Im(e){return e.parentId}function Rm(){var e,t=Tm,n=Im;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Om(e,t-1)&&!Om(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(Nm),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(Nm(e)),d.push(Am));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new _m(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?Em:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===Em)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Am&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Am;--e)c.data=null}if(a.parent=km,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(Sm),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=Cm(e),i):t},i.parentId=function(e){return arguments.length?(n=Cm(e),i):n},i.path=function(t){return arguments.length?(e=Cm(t),i):e},i}function Nm(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Om(e,t););return e.slice(0,t)}function Om(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Pm(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Pm(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Pm(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Lm(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Lm(e[r].children,t-1,n)]);return i}function Fm(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Lm(e.children,i-1,n)}return!1}function zm(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const jm=/^qDimensionInfo(?:\/(\d+))?/,Hm=/^\/?qMeasureInfo\/(\d+)/,Bm=/\/qAttrExprInfo\/(\d+)/,Vm=/\/qAttrDimInfo\/(\d+)/;function $m(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function Wm(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=$m(n);return jm.test(h)&&(r=!0,o=+jm.exec(h)[1],h=i.replace(jm,"")),Hm.test(h)&&("K"===n.qMode?c=+Hm.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+Hm.exec(h)[1],u=0):u=+Hm.exec(h)[1],h=h.replace(Hm,"")),h&&(Vm.exec(h)?a=+Vm.exec(h)[1]:Bm.exec(h)&&(s=+Bm.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function Um(e,t){let n,i,r=Fm(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Ym(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Xm(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const Km=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Pm(i,e);return o&&o[0]?(t.tree=wm(o[0],n.children||(e=>e[r])),t.tree):null};function Gm(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var a;const t=n[r[e]],o="".concat(i,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=om({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[i].qValues.push(t)}}const l=Object.keys(s).map((e=>s[e])),c=Rm().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}const Jm=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=Um(o,Wm(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Zm(){let 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,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),s="S"===r.qMode?Gm(t):Km(r,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===r.qMode){let e=$m(r)[o-1];s=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),s=n.fields[e]}const{props:a,main:c}=i.normalizeConfig(om(om({},e),{},{field:s?s.key():void 0}),t),u=Object.keys(a);l[o]={propsArr:u,props:a,main:c};const h=s?Wm(s,{cube:r,cache:n}):{fieldDepth:0};Jm({propsArr:u,props:a,cube:r,cache:n,itemDepthObject:h,f:s})}const c=s.copy(),u=c.descendants(),h=s.descendants();for(let e=0;e<h.length;e++){const t=l[h[e].depth].propsArr,n=l[h[e].depth].props,i=l[h[e].depth].main,r=u[e],s=r.data,a=Ym(i,s,{key:o});Xm({propsArr:t,props:n,item:r,itemData:s,ret:a,sourceKey:o,isTree:!0}),h[e].data=a}return s}function Qm(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!Km(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=Wm(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=Um({fieldDepth:0},f);Jm({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=Ym(h,n,{key:l});Xm({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var eg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
32
33
|
/*! 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=/%$/,Sg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,kg=/^\(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 Sg.test(t)?e=Rg(e,Number(/\d{2}/.exec(t)[0]),t,n):kg.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=(Sm(i={},Hg,o.qTimeFmt||"hh:mm:ss"),Sm(i,Fg,o.qDateFmt||"YYYY-MM-DD"),Sm(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:{}};
|
|
34
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,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,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.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]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}));function tg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const ng={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"},ig=/%\)?$/,rg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,og=/^\(oct\)/i,sg=/^\(dec\)/i,ag=/^\(hex\)/i,lg=/^\(bin\)/i,cg=/^\(rom\)/i,ug=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,hg=/#|0/g;function dg(e,t,n,i){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(".",i||".")}function fg(e,t,n){let i;return rg.test(t)?e=dg(e,Number(/\d{2}/.exec(t)[0]),t,n):og.test(t)?e=dg(e,8,t,n):sg.test(t)?e=dg(e,10,t,n):ag.test(t)?e=dg(e,16,t,n):lg.test(t)?e=dg(e,2,t,n):cg.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function pg(e,t,n){const i=tg(e);return n?i:new RegExp(i||"",t)}function mg(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=tg(m)),p&&(p=tg(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(pg(c,"g"),t)),u=n,n=".",u&&(s=s.replace(pg(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(hg)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=ig.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(pg(t,null,!0),"|").concat(pg(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class gg{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return ng;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new gg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ug.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ug.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ug.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||mg(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&mg(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&mg(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=fg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=eg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.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(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=eg(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function yg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function vg(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gg(...t)}(r,e,t,n,i),s=yg(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const bg="D",xg="T",wg="TS",qg="IV",Mg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Sg=["January","February","March","April","May","June","July","August","September","October","November","December"],_g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cg(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function kg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Eg(e,t){let n,i=function(e){const t=e,n=24*kg(t),i=60*kg(n),r=60*kg(i),o=1e3*kg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=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*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}class Ag{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Mg,qDayNames:Dg,qLongMonthNames:Sg,qMonthNames:_g}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[xg]:i.qTimeFmt||"hh:mm:ss",[bg]:i.qDateFmt||"YYYY-MM-DD",[wg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Ag(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Eg(e,t));const r=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Cg("".concat(t.year).slice(-2),2),YYY:Cg("".concat(t.year).slice(-3),3),def:e=>Cg("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Cg("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Cg("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Cg("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Cg("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Cg("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Cg("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function Tg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ag(...t)}function Ig(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function Rg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Tg(n,e,t),r=yg(i.format.bind(i),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function o(e){return t!==qg?Ig(e):e}function s(e){return e=o(e),r(e)}return s.format=function(e,t){return r.clear(),t=o(t),i.format(t,e)},s.locale=function(n){return i=Tg(n,e,t),r=yg(i.format.bind(i),{toKey:e=>"object"==typeof e?e.getTime():e}),this},s.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},s}function Ng(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Rg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),vg(n,i,r,o,t)}function Og(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=Ng(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function Pg(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:Og(mm({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=Pg("qAttrDimInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Pg("qAttrExprInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Pg("qMeasureInfo",t,n,s,mm({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function Lg(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Lg.util,s={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},a={key:()=>e,raw:()=>r,field:e=>zm(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,a,i,o),hierarchy:e=>s.hierarchy(e,a,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(s.extractor=Qm,s.hierarchy=Zm,s.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(s.extractor=bm,s.pages=r.qDataPages,s.hierarchy=Zm):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},a,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Pg("qDimensionInfo",r,e,"",mm({},s,{value:l,type:"dimension"}))),i.wrappedFields.push(...Pg("qMeasureInfo",r,e,"",mm({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=a.field(t.from),r=Og(om({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>s.extractor({field:e},a,i,o),key:t.key,type:n.type(),localeInfo:s.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),a}const Fg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],zg=/\/qDimensionInfo(?:\/(\d+))?/,jg=/\/qMeasureInfo\/(\d+)/,Hg=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Bg=/\/qAttrExprInfo\/(\d+)/,Vg=/\/?qHyperCube/,$g=/\/?qTreeData/,Wg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Ug=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Yg(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;Vg.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Wg):$g.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=Ug);let a=!0;if(zg.test(e)&&(i=+zg.exec(e)[1]),jg.test(e)&&(r=+jg.exec(e)[1]),Hg.test(e)){r=-1,i=0;const e=+Hg.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Bg.test(e)){const e=r;if(t){r=0;const s=Pm(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+Bg.exec(n)[1]}else i>-1?(i=-1,r=+Bg.exec(n)[1]):r+=+Bg.exec(n)[1]+1}return Fg.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function Xg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=Yg(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>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){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>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){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>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(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function Kg(e){Lg.util=e.data("matrix").util,e.data("q",Lg),e.formatter("q-number",vg),e.formatter("q-time",Rg)}Kg.qBrushHelper=Xg,Kg.selections=Xg;const Gg={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function Jg(e){return Gg[e]||e}function Zg(e){return function(t,n,i){let r,o,s,a,l=[],c=!0;function u(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&(r.gestures.forEach((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));const n=Jg(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(i),s.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),s.on(e,t.events[e])})),l.push(t))})),r.gestures.forEach((t=>{const n=Jg(t.type);e&&e[n]&&(t.recognizeWith&&s.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&s.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function h(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{s.off(t,e.events[t])})),s.remove(e.options.event)})),l=[]}return{get key(){return a},set(e){!function(e){a=e.key,r=e,o={chart:t,mediator:n,settings:r},r.gestures=r.gestures||[],void 0===r.enable&&(r.enable=!0)}(e),h(),c&&u()},off(){c=!1,h()},on(){c=!0,0===l.length&&u()},destroy(){h(),s&&s.destroy(),s=null,o=null,r=null}}}}var Qg={},ey={get exports(){return Qg},set exports(e){Qg=e}};
|
|
34
35
|
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
35
36
|
* http://hammerjs.github.io/
|
|
36
37
|
*
|
|
37
38
|
* 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(S(t),(function(t){e.addEventListener(t,n,!1)}))}function q(e,t,n){d(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 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=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 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 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 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 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(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===k(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=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?fe:J))(n,H),this.touchAction=new Se(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=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 d(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 d(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: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 Sy={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 ky(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?ky(Object(n),!0).forEach((function(t){Ey(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ky(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,Sv=6/29,kv=3*Sv*Sv;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/kv+Dv}function Av(e){return e>Sv?e*e*e:kv*(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=Sb);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 Sb(e){return e.children}function kb(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(kb)}};var Eb,Ab=(function(e){
|
|
39
|
+
* Licensed under the MIT license */
|
|
40
|
+
!function(e){!function(t,n,i,r){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=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 i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function p(e,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=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,r,i),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var m=p((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[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 i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&o(i,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]||r,t):e}function x(e,t){return e===r?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 _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];_(r,s)<0&&i.push(e[o]),r[o]=s,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function E(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((i=(n=s[a])?n+o:t)in e)return i;a++}return r}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")!==r,N=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,F=["x","y"],z=["clientX","clientY"];function j(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 i=n.pointers.length,o=n.changedPointers.length,s=1&t&&i-o==0,a=12&t&&i-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,i=t.pointers,o=i.length;n.firstInput||(n.firstInput=B(t));o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=V(i);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],z)/U(e[0],e[1],z)}(a.pointers,i):1,t.rotation=a?function(e,t){return Y(t[1],t[0],z)+Y(e[1],e[0],z)}(a.pointers,i):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,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===r)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);i=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}(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:u(),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,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:l(n/t),y:l(i/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=F);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function Y(e,t,n){n||(n=F);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}j.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,j.apply(this,arguments)}y(J,j,{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,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,j,{handler:function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=Z[i],o=Q[e.pointerType]||e.pointerType,s=o==O,a=_(t,e.pointerId,"pointerId");1&r&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&r&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ie={touchstart:1,touchmove:2,touchend:4,touchcancel:8},re="touchstart",oe="touchstart touchmove touchend touchcancel";function se(){this.evTarget=re,this.evWin=oe,this.started=!1,j.apply(this,arguments)}function ae(e,t){var n=C(e.touches),i=C(e.changedTouches);return 12&t&&(n=k(n.concat(i),"identifier",!0)),[n,i]}y(se,j,{handler:function(e){var t=ie[e.type];if(1===t&&(this.started=!0),this.started){var n=ae.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},ce="touchstart touchmove touchend touchcancel";function ue(){this.evTarget=ce,this.targetIds={},j.apply(this,arguments)}function he(e,t){var n=C(e.touches),i=this.targetIds;if(3&t&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=C(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),1===t)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<s.length;)i[s[r].identifier]&&a.push(s[r]),12&t&&delete i[s[r].identifier],r++;return a.length?[k(o.concat(a),"identifier",!0),a]:void 0}y(ue,j,{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(){j.apply(this,arguments);var e=v(this.handler,this);this.touch=new ue(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 i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),s=Math.abs(n-r.y);if(o<=25&&s<=25)return!0}return!1}y(de,j,{handler:function(e,t,n){var i=n.pointerType==O,r=n.pointerType==P;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)fe.call(this,t,n);else if(r&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=E(a.style,"touchAction"),ye=ge!==r,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(i){e[i]=!n||t.CSS.supports("touch-action",i)})),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 i=this.actions,r=D(i,we)&&!De[we],o=D(i,Me)&&!De[Me],s=D(i,qe)&&!De[qe];if(r){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var _e=32;function Ce(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 ke(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(){Ce.apply(this,arguments)}function Ie(){Te.apply(this,arguments),this.pX=null,this.pY=null}function Re(){Te.apply(this,arguments)}function Ne(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Oe(){Te.apply(this,arguments)}function Pe(){Te.apply(this,arguments)}function Le(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Fe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Fe.defaults.preset),new ze(e,t)}Ce.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===_(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=_(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 i(n){t.manager.emit(n,e)}n<8&&i(t.options.event+ke(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=8&&i(t.options.event+ke(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=_e},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=_e);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,Ce,{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,i=6&t,r=this.attrTest(e);return i&&(8&n||!r)?16|t:i||r?4&n?8|t:2&t?4|t:2:_e}}),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,i=e.distance,r=e.direction,o=e.deltaX,s=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===s?1:s<0?8:16,n=s!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&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,Ce,{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,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||12&e.eventType&&!r)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 _e},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=u(),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&&c(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,Ce,{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,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(i&&r&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&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 _e},failTimeout:function(){return this._timer=h((function(){this.state=_e}),this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Fe.VERSION="2.0.7",Fe.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({},Fe.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?ue:I?de:J))(n,H),this.touchAction=new Se(this,this.options.touchAction),je(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 je(e,t){var n,i=e.element;i.style&&(f(e.options.cssProps,(function(r,o){n=E(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.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 i=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&14&n.state&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Ce)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=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){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!==r){var n=this.handlers;return f(S(e),(function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=n.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Fe,{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:_e,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:j,TouchAction:Se,TouchInput:ue,MouseInput:J,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:se,Recognizer:Ce,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=Fe,e.exports?e.exports=Fe:t.Hammer=Fe}(window,document)}(ey);var ty=Qg;function ny(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var iy={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:i}}=this.settings,r="top"!==i&&"bottom"!==i||!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}(i,this.rect),s="center"===i?t:`* ${t}`,a="center"!==i?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:r},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function ry(){const e=im();return e.renderer.prio(["canvas"]),e.use(Kg),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Zg(e))};e.interaction("hammer",Zg(Hammer))}(ty)),e.use(ny),e.component("disclaimer",iy),e}const oy={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 i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ay(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){cy(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 ly(e){return ly="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},ly(e)}function cy(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uy(e){return function(e){if(Array.isArray(e))return hy(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 hy(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)?hy(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 hy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var dy=Object.prototype.hasOwnProperty,fy=Object.prototype.toString,py=Object.defineProperty,my=Object.getOwnPropertyDescriptor,gy=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===fy.call(e)},yy=function(e){if(!e||"[object Object]"!==fy.call(e))return!1;var t,n=dy.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&dy.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||dy.call(e,t)},vy=function(e,t){py&&"__proto__"===t.name?py(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(!dy.call(e,t))return;if(my)return my(e,t).value}return e[t]},xy=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=by(a,n),a!==(r=by(t,n))&&(u&&r&&(yy(r)||(o=gy(r)))?(o?(o=!1,s=i&&gy(i)?i:[]):s=i&&yy(i)?i:{},vy(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&vy(a,{name:n,newValue:r}));return a};function wy(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function qy(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function My(e,t,n,i,r){var o,s,a=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return a(i,c)}return{}}function Dy(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Sy(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 Cy(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ky(){}var Ey=1/.7,Ay="\\s*([+-]?\\d+)\\s*",Ty="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Iy="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ry=/^#([0-9a-f]{3,8})$/,Ny=new RegExp("^rgb\\("+[Ay,Ay,Ay]+"\\)$"),Oy=new RegExp("^rgb\\("+[Iy,Iy,Iy]+"\\)$"),Py=new RegExp("^rgba\\("+[Ay,Ay,Ay,Ty]+"\\)$"),Ly=new RegExp("^rgba\\("+[Iy,Iy,Iy,Ty]+"\\)$"),Fy=new RegExp("^hsl\\("+[Ty,Iy,Iy]+"\\)$"),zy=new RegExp("^hsla\\("+[Ty,Iy,Iy,Ty]+"\\)$"),jy={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 Hy(){return this.rgb().formatHex()}function By(){return this.rgb().formatRgb()}function Vy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ry.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?$y(t):3===n?new Xy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wy(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=Ny.exec(e))?new Xy(t[1],t[2],t[3],1):(t=Oy.exec(e))?new Xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Py.exec(e))?Wy(t[1],t[2],t[3],t[4]):(t=Ly.exec(e))?Wy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fy.exec(e))?Zy(t[1],t[2]/100,t[3]/100,1):(t=zy.exec(e))?Zy(t[1],t[2]/100,t[3]/100,t[4]):jy.hasOwnProperty(e)?$y(jy[e]):"transparent"===e?new Xy(NaN,NaN,NaN,0):null}function $y(e){return new Xy(e>>16&255,e>>8&255,255&e,1)}function Wy(e,t,n,i){return i<=0&&(e=t=n=NaN),new Xy(e,t,n,i)}function Uy(e){return e instanceof ky||(e=Vy(e)),e?new Xy((e=e.rgb()).r,e.g,e.b,e.opacity):new Xy}function Yy(e,t,n,i){return 1===arguments.length?Uy(e):new Xy(e,t,n,null==i?1:i)}function Xy(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Ky(){return"#"+Jy(this.r)+Jy(this.g)+Jy(this.b)}function Gy(){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 Jy(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Zy(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ev(e,t,n,i)}function Qy(e){if(e instanceof ev)return new ev(e.h,e.s,e.l,e.opacity);if(e instanceof ky||(e=Vy(e)),!e)return new ev;if(e instanceof ev)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ev(s,a,l,e.opacity)}function ev(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function tv(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 nv(e){return function(){return e}}function iv(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):nv(isNaN(e)?t:e)}_y(ky,Vy,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Hy,formatHex:Hy,formatHsl:function(){return Qy(this).formatHsl()},formatRgb:By,toString:By}),_y(Xy,Yy,Cy(ky,{brighter:function(e){return e=null==e?Ey:Math.pow(Ey,e),new Xy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Xy(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:Ky,formatHex:Ky,formatRgb:Gy,toString:Gy})),_y(ev,(function(e,t,n,i){return 1===arguments.length?Qy(e):new ev(e,t,n,null==i?1:i)}),Cy(ky,{brighter:function(e){return e=null==e?Ey:Math.pow(Ey,e),new ev(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new ev(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,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Xy(tv(e>=240?e-240:e+120,r,i),tv(e,r,i),tv(e<120?e+240:e-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var 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 rv=function e(t){var n=function(e){return 1==(e=+e)?iv: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(i){return Math.pow(e+i*t,n)}}(t,n,e):nv(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=Yy(e)).r,(t=Yy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=iv(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1),ov=/^class(-pyramid)?/,sv=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(o-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(uy(u))),o=Math.max.apply(Math,[o].concat(uy(u))),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],s=[];if(i.length)if(i[i.length-1]<t)s.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)s.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)s.push(t),o.push(r[0]);else{s.push(t);for(var a=0;a<i.length;a++)if(t<i[a]){o.push(r[a]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(s.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)s.push(n),o.push(r[i.length]),o.push(r[i.length]);else{s.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=rv(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function av(e,t,n,i,r){var o,s,a,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):av(e,t,n,i+1,r)}var lv=function(e,t,n,i){var r,o,s=t.theme,a=t.hc,l=i.f,c={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")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,uy(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(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,uy(u)),c.max=Math.max.apply(Math,uy(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];c.type=d&&ov.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,uy(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===c.type){for(var f=h?av(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),i=[],r=0;r<f;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function cv(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 uv(e){var t,n=e.cm,i=e.defaults,r=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),ay(ay({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===a?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),o=r;return ay(ay({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,s,i):null}function hv(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function dv(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),i.push(s.primary)):i[a]=s.primary,e[o]=null}else if(s){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function fv(e,t,n,i){var r,o=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?cv:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=lv(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&xy(c,sv(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?Dy:r,s=i.getCByField,a=void 0===s?Sy:s,l=i.getPersistence,c=void 0===l?My:l,u=o(t,n),h=a(n,u),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"===u.type||u.activeDimensionIndex<0)&&(p.label=u.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"===u.type&&(p.auxiliary=u),xy(p,c(t,n,u,h,{byRow:qy,byElemNo:wy})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=lv(0,{hc:r,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.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,i)}return{}}(e,t,n,i);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,r){return uv({cm:e,input:n,defaults:i,index:r,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(hv(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=dv(e.measureOverrides,e.explicit),hv(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=dv(e.measureOverrides),s}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function pv(e){var t=ay({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(i.auto=e,r):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,r):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,r):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(xy(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=xy(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=xy(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}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 r=e.auxiliary||{},o=r.key;if("measure"===e.fieldType)return i.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var s="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(s,t).catch((function(){})):Promise.resolve(),o?i.getDimensionColorMap(o,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(e.field);return sv(r,i.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=i[0],l=i[1]?i[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,i){var r=i.external,o=i.field,s=ay({},e);xy(s,wy(o,o.raw().qCardinal));var a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,xy(s,wy(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),xy(s,wy(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,s=[];o=[];for(var a=0;a<r.items.length;a++){var l=r.items[a],c=(l.text||l).label;i[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(i[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,r,{external:t,field:n.pic.field(e.field)}):s}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"},i=t.theme;i&&(e=ay(ay({},e),i.getDataColorSpecials())),n.settings=xy(e,fv(this,n,t,e))}return n.settings}};return r}var mv=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(i.legendDataPage=o),s&&(i.dimValsData=s.colorMap)}return i},gv=function(e){throw e.isHandled=!0,e},yv=function(e,t){var n=t.layout,i=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():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},vv=function(e,t){var n=t.layout,i=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():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},bv=function(e,t){var n=t.layout,i=t.model,r=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():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(gv):Promise.reject()};function xv(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}function wv(e){return function(t){return"object"===ly(t.datum[e])?t.datum[e].value:void 0}}function qv(e){return"object"===ly(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Mv(e){return-3===e.datum.value}var Dv={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Sv={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function _v(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:Dv.COLOR,fontSize:Dv.FONT_SIZE,fontFamily:Dv.FONT_FAMILY},label:{color:Sv.COLOR,fontSize:Sv.FONT_SIZE,fontFamily:Sv.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==s?void 0:s.color,"legend.title","color",Dv.COLOR),r.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",Dv.FONT_SIZE),r.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",Dv.FONT_FAMILY),r.label.color=l(null==a?void 0:a.color,"legend.label","color",Sv.COLOR),r.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",Sv.FONT_SIZE),r.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",Sv.FONT_FAMILY),r}var Cv=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},kv=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 Ev(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=_v({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Cv(s,r,o)},show:"function"==typeof s.show?function(){return kv(s,c,a)}:kv(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function Av(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=Ev(e,t);if(!i.show)return!1;var r,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=_v({theme:f,key:s,styleOverrides:a}),g=i.layout.dock,y="left"===g||"right"===g?{maxLines:3,wordBreak:"break-word"}:{},v={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&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return xy(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:ay({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},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:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=Ev(e,t);if(!d.show)return!1;var f=_v({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),xy(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}function Tv(e,t,n){var i=[],r=[],o=Av(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.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)),r.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var r;return this.started===n||!t||!(null!=s&&null!==(r=s.interact)&&void 0!==r&&r.enabled&&!s.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:(e={},cy(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),cy(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),cy(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:r,components:i}}function Iv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Rv(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Nv(){}var Ov=1/.7,Pv="\\s*([+-]?\\d+)\\s*",Lv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zv=/^#([0-9a-f]{3,8})$/,jv=new RegExp(`^rgb\\(${Pv},${Pv},${Pv}\\)$`),Hv=new RegExp(`^rgb\\(${Fv},${Fv},${Fv}\\)$`),Bv=new RegExp(`^rgba\\(${Pv},${Pv},${Pv},${Lv}\\)$`),Vv=new RegExp(`^rgba\\(${Fv},${Fv},${Fv},${Lv}\\)$`),$v=new RegExp(`^hsl\\(${Lv},${Fv},${Fv}\\)$`),Wv=new RegExp(`^hsla\\(${Lv},${Fv},${Fv},${Lv}\\)$`),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 Yv(){return this.rgb().formatHex()}function Xv(){return this.rgb().formatRgb()}function Kv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Gv(t):3===n?new Qv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Jv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Jv(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=jv.exec(e))?new Qv(t[1],t[2],t[3],1):(t=Hv.exec(e))?new Qv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Bv.exec(e))?Jv(t[1],t[2],t[3],t[4]):(t=Vv.exec(e))?Jv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=$v.exec(e))?ob(t[1],t[2]/100,t[3]/100,1):(t=Wv.exec(e))?ob(t[1],t[2]/100,t[3]/100,t[4]):Uv.hasOwnProperty(e)?Gv(Uv[e]):"transparent"===e?new Qv(NaN,NaN,NaN,0):null}function Gv(e){return new Qv(e>>16&255,e>>8&255,255&e,1)}function Jv(e,t,n,i){return i<=0&&(e=t=n=NaN),new Qv(e,t,n,i)}function Zv(e){return e instanceof Nv||(e=Kv(e)),e?new Qv((e=e.rgb()).r,e.g,e.b,e.opacity):new Qv}function Qv(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function eb(){return`#${rb(this.r)}${rb(this.g)}${rb(this.b)}`}function tb(){const e=nb(this.opacity);return`${1===e?"rgb(":"rgba("}${ib(this.r)}, ${ib(this.g)}, ${ib(this.b)}${1===e?")":`, ${e})`}`}function nb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ib(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rb(e){return((e=ib(e))<16?"0":"")+e.toString(16)}function ob(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ab(e,t,n,i)}function sb(e){if(e instanceof ab)return new ab(e.h,e.s,e.l,e.opacity);if(e instanceof Nv||(e=Kv(e)),!e)return new ab;if(e instanceof ab)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new ab(s,a,l,e.opacity)}function ab(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function lb(e){return(e=(e||0)%360)<0?e+360:e}function cb(e){return Math.max(0,Math.min(1,e||0))}function ub(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Iv(Nv,Kv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yv,formatHex:Yv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sb(this).formatHsl()},formatRgb:Xv,toString:Xv}),Iv(Qv,(function(e,t,n,i){return 1===arguments.length?Zv(e):new Qv(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return e=null==e?Ov:Math.pow(Ov,e),new Qv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Qv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qv(ib(this.r),ib(this.g),ib(this.b),nb(this.opacity))},displayable(){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:eb,formatHex:eb,formatHex8:function(){return`#${rb(this.r)}${rb(this.g)}${rb(this.b)}${rb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:tb,toString:tb})),Iv(ab,(function(e,t,n,i){return 1===arguments.length?sb(e):new ab(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return e=null==e?Ov:Math.pow(Ov,e),new ab(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ab(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Qv(ub(e>=240?e-240:e+120,r,i),ub(e,r,i),ub(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ab(lb(this.h),cb(this.s),cb(this.l),nb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=nb(this.opacity);return`${1===e?"hsl(":"hsla("}${lb(this.h)}, ${100*cb(this.s)}%, ${100*cb(this.l)}%${1===e?")":`, ${e})`}`}}));const hb=Math.PI/180,db=180/Math.PI,fb=4/29,pb=6/29,mb=3*pb*pb;function gb(e){if(e instanceof yb)return new yb(e.l,e.a,e.b,e.opacity);if(e instanceof Mb)return Db(e);e instanceof Qv||(e=Zv(e));var t,n,i=wb(e.r),r=wb(e.g),o=wb(e.b),s=vb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=vb((.4360747*i+.3850649*r+.1430804*o)/.96422),n=vb((.0139322*i+.0971045*r+.7141733*o)/.82521)),new yb(116*s-16,500*(t-s),200*(s-n),e.opacity)}function yb(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function vb(e){return e>.008856451679035631?Math.pow(e,1/3):e/mb+fb}function bb(e){return e>pb?e*e*e:mb*(e-fb)}function xb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function wb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qb(e){if(e instanceof Mb)return new Mb(e.h,e.c,e.l,e.opacity);if(e instanceof yb||(e=gb(e)),0===e.a&&0===e.b)return new Mb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*db;return new Mb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Mb(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Db(e){if(isNaN(e.h))return new yb(e.l,0,0,e.opacity);var t=e.h*hb;return new yb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Iv(yb,(function(e,t,n,i){return 1===arguments.length?gb(e):new yb(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return new yb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new yb(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){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 Qv(xb(3.1338561*(t=.96422*bb(t))-1.6168667*(e=1*bb(e))-.4906146*(n=.82521*bb(n))),xb(-.9787684*t+1.9161415*e+.033454*n),xb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Iv(Mb,(function(e,t,n,i){return 1===arguments.length?qb(e):new Mb(e,t,n,null==i?1:i)}),Rv(Nv,{brighter(e){return new Mb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Mb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Db(this).rgb()}}));var Sb=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function _b(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=pv(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,i=t.app;return yv(e,{layout:n,app:i})})).getMeasure((function(e,t){var n=t.layout,i=t.app;return vv(e,{layout:n,app:i})})).getAttributeDimension((function(e,t){var n=t.layout,i=t.model,r=t.app;return bv(e,{layout:n,model:i,app:r})}));return n.getSnapshotData=mv,n}({resources:e}),n={},i={},r=function(e){return i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings},o={config:function(r){if(n=ay({},r),i={},!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 i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return i.auxiliarySettings=e||{},i.settings=ay(ay({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var n=r();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();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=r().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)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,s=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=i.getDataColorScales().filter((function(e){return e.key===a}))[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(uy(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,r=e.key,o=e.source,s=e.picasso,a={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(uy((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(uy((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=xv({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={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:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=ay(ay({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||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};a[l]=xy({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=xy({},m,{invert:!!i}))}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:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,i;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(i=t.exclude)&&void 0!==i&&i.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales},color:function(){return i.color=i.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=wv(i),o=wv("".concat(i,"IsAnOther")),s=function(e,t){var i=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return Mv(e)||o(e)?c:l}:n[t]?function(e){return Mv(e)?c:qv(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===a?function(e){return Mv(e)||o(e)?c:qv(e)?l:u}:"color"===h?function(e){return Mv(e)||o(e)?c:qv(e)?l:r(e)||c}:null},a=s(t,i);if(t.measureOverrides){var l=wv("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&s(e)}));return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(e){return function(e){var t,n,i=e.hc,r=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=r.nil;"field"===r.mode&&r.field?t=r.field:o[s]&&"field"===r.mode&&(t=o[s].data.field||r.field),t?(n={field:t,reduce:"first"},"color"===r.type&&(n.value=function(e){return"NaN"!==e.qNum?Sb(e.qNum):e.qText&&Kv(e.qText)?e.qText:u})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=cy({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),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,i=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=void 0===f?{}:f,m=arguments.length>1?arguments[1]:void 0;return Tv({eventName:t,key:i,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:p},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var Cb=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function kb(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(Cb),o=i.some(Cb),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!r?"off":s}function Eb(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 Ab=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Tb(e){var t,n=e.qHyperCube.qDimensionInfo.some(Ab),i=e.qHyperCube.qMeasureInfo.some(Ab),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Ib=function(){};function Rb(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(void 0===r[s])return n;r=r[s]}return r}function Nb(e,t,n){if(void 0!==e&&void 0!==t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0===o[a]&&(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}}function Ob(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pb(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Lb(e,t,n){return t&&Pb(e.prototype,t),n&&Pb(e,n),e}function Fb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zb(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function jb(e,t){var n,i,r,o,s,a=new $b(e),l=+e.value&&(a.value=e.value),c=[a];for(null==t&&(t=Hb);n=c.pop();)if(l&&(n.value=+n.data.value),(r=t(n.data))&&(s=r.length))for(n.children=new Array(s),o=s-1;o>=0;--o)c.push(i=n.children[o]=new $b(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Vb)}function Hb(e){return e.children}function Bb(e){e.data=e.data.data}function Vb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $b(e){this.data=e,this.depth=this.height=0,this.parent=null}$b.prototype=jb.prototype={constructor:$b,count:function(){return this.eachAfter(zb)},each:function(e){var t,n,i,r,o=this,s=[o];do{for(t=s.reverse(),s=[];o=t.pop();)if(e(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i])}while(s.length);return this},eachAfter:function(e){for(var t,n,i,r=this,o=[r],s=[];r=o.pop();)if(s.push(r),t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n]);for(;r=s.pop();)e(r);return this},eachBefore:function(e){for(var t,n,i=this,r=[i];i=r.pop();)if(e(i),t=i.children)for(n=t.length-1;n>=0;--n)r.push(t[n]);return this},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].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(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},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 jb(this).eachBefore(Bb)}};var Wb,Ub,Yb=(Wb=function(e){
|
|
39
41
|
/*! 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.1",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={},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),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&&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 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 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||!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=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)?(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 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&&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=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}),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,Sx=Object.prototype.toString,kx=Object.defineProperty,_x=Object.getOwnPropertyDescriptor,Cx=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Sx.call(e)},Ex=function(e){if(!e||"[object Object]"!==Sx.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){kx&&"__proto__"===t.name?kx(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 Sw={getSettings:function(e){return yb(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Dw.DIST_MAX:Dw.ASCII}};function kw(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=kw(0,i,o,a),l=kw(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:kw};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 Sw.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("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=>!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=Sw.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=Sw.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",Sw.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:Sq(t),dimensionExpressions:Dq(t),measureExpressions:e})))}};function Dq(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Sq(e){return function(e){return yb(e,"qDimensionInfo",[])}(e).map((e=>e.qGroupPos))}const kq={},_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}kq.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(kq.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(kq.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},kq.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}))},kq.clone=function(e){return _q({},e)},kq.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},kq.updateObject=function(e,t){Object.keys(e).length?kq.apply(e,kq.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=kq.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=kq.generate(n,r);kq.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,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 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,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=d[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:d,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: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=[].concat(f(r),f(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&(r=[].concat(f(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,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),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=[],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: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}),k.push(A)}}var T=w?i.collect(D,{main:p,propsArr:m,props:d}):k;a=[].concat(f(a),f(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){
|
|
42
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,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,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.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]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}},Wb(Ub={exports:{}}),Ub.exports);function Xb(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Kb={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"},Gb=/%$/,Jb=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Zb=/^\(oct\)/i,Qb=/^\(dec\)/i,ex=/^\(hex\)/i,tx=/^\(bin\)/i,nx=/^\(rom\)/i,ix=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,rx=/#|0/g;function ox(e,t,n,i){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(".",i||".")}function sx(e,t,n){var i=Xb(e);return n?i:new RegExp(i||"",t)}function ax(e,t,n){var i,r,o,s,a,l,c,u,h,d,f,p=e.pattern;p.indexOf("A")>=0&&(p=p.replace("A",""),e.abbreviate=!0),d=t,(f=n)&&(f=Xb(f)),d&&(d=Xb(d)),h=new RegExp("(?:[#0]+".concat(d,")?[#0]+(?:").concat(f,"[#0]+)?")),s=(o=(o=p.match(h))?o[0]:"")?p.substr(0,p.indexOf(o)):p,a=o?p.substring(p.indexOf(o)+o.length):"",o||(o=p?"#":"##########"),t&&t===n&&(r=(i=o.split(n)).pop(),o=i.join("")+n+r,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(sx(l,"g"),t)),c=n,n=".",c&&(o=o.replace(sx(c,"g"),n)),u=(u=o.match(/#/g))?u.length:0;var m,g=p.split(c);g[1]&&(m=g[1].match(rx)),e.prefix=s||"",e.postfix=a||"",e.pattern=p,e.maxPrecision=m?m.length:2,e.percentage=Gb.test(p),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(sx(t,null,!0),"|").concat(sx(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=c,e.t=t,e.d=n,e.temp=u}!function(){function e(t,n,i,r,o){Ob(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=i||",",this.decimalDelimiter=r||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Kb;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()}Lb(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,i){return this.prepare(t,n,i),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var i;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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ix.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ix.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ix.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1,i.positive.isFunctional||ax(i.positive,t,n),i.negative&&!i.negative.isFunctional&&ax(i.negative,t,n),i.zero&&!i.zero.isFunctional&&ax(i.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return(u=u.zero).pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=function(e,t,n){var i;return Jb.test(t)?e=ox(e,Number(/\d{2}/.exec(t)[0]),t,n):Zb.test(t)?e=ox(e,8,t,n):Qb.test(t)?e=ox(e,10,t,n):ex.test(t)?e=ox(e,16,t,n):tx.test(t)?e=ox(e,2,t,n):nx.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.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(a=0,n=Number(Number(e).toExponential().split("e")[1]);y<=n&&a<g.length;)y=g[++a];a>0&&(p=g[a-1]),p&&n>0&&p>0?m=p:(n<0&&p<0||!p)&&(y<0&&y-n<=u.maxPrecision?m=y:p<=n&&!(y>0&&-n<=u.maxPrecision)&&(m=p)),m&&(h=this.abbreviations[m],e/=Math.pow(10,m))}if(i=Math.abs(e),t=u.temp,c=(l=u.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var v=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]),b=l.split(o)[0];if(e=Yb(b+=o,v)||"0",c){var x=Math.max(0,Math.min(14,c.length)),w=c.replace(/#+$/,"").length,q=("I"===this.type?0:i%1).toFixed(x).slice(2).replace(/0+$/,"");for(a=q.length;a<w;a++)q+="0";q&&(e+=o+q)}else 0===v&&(r=0)}else if(i>=Math.pow(10,t)||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.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(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=Yb(l,e)}e=e.replace(u.numericRegex,(function(e){return e===s?u.groupTemp:e===o?u.decTemp:""})),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var lx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cx=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ux=["January","February","March","April","May","June","July","August","September","October","November","December"],hx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dx(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function fx(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,i){Ob(this,e);var r,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:lx,qDayNames:cx,qLongMonthNames:ux,qMonthNames:hx}),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=(Fb(r={},"T",o.qTimeFmt||"hh:mm:ss"),Fb(r,"D",o.qDateFmt||"YYYY-MM-DD"),Fb(r,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),r)[i]),this.pattern=n}Lb(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,i,r,o,s,a=/t+/gi.test(t);e instanceof Date?(r=a,o=(i=e).getUTCHours(),r&&((o%=12)||(o=12)),(s=i.getUTCDay()-1)<0&&(s=6),n={year:i.getUTCFullYear(),month:i.getUTCMonth(),day:s,date:i.getUTCDate(),h:o,m:i.getUTCMinutes(),s:i.getUTCSeconds(),f:i.getUTCMilliseconds(),t:i.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,i=function(e){var t=e,n=24*fx(t),i=60*fx(n),r=60*fx(i),o=1e3*fx(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=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*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0)<0&&(c=6);var u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:dx("".concat(t.year).slice(-2),2),YYY:dx("".concat(t.year).slice(-3),3),def:function(e){return dx("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:dx("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:dx("".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 dx("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return dx("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return dx("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return dx("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),i=e.length-n.length;if(i>0)for(var r=0;r<i;r++)n+="0";else i<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),c=[];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&c.push(u);var h=new RegExp(c.join("|"),"g"),d=t.replace(h,(function(e){var t,n,i;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var r in l[n])if(r===e||r.toLowerCase()===e){void 0===(i=l[n][r])&&(i=l[n][r.toLowerCase()]);break}return void 0===i&&(i=l[n].def),"function"==typeof i&&(i=i(e)),i}));return d}}])}();var px=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],mx=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function gx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?r.push.apply(r,uy(new Set([i].concat(uy(o.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):r.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(uy(r.map((function(e){return mx(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],uy(px.map((function(e){return mx(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}var yx=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],vx=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function bx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,uy(new Set([n].concat(uy(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(uy(i.map((function(e){return vx(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],uy(yx.map((function(e){return vx(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function xx(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:gx({theme:t,translator:n,id:i,path:r}),fontSize:bx({theme:t,translator:n,id:i,path:r})}}function wx(e){var t=e.theme,n=e.translator,i=e.config,r=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:void 0===i?{}:i}),o=r.id,s=r.paths,a={};s.forEach((function(e){for(var i=e.split("."),r=a,s=0;s<i.length;s++){var l=i[s];s===i.length-1?r[l]=xx({theme:t,translator:n,id:o,path:e}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var l=function(e){for(var t=e.split("."),n=a,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return a.getDefaultValue=function(e){return l(e).getDefaultValue()},a.getOptions=function(e){return l(e).getOptions()},a}const qx=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Mx=function(){};function Dx(e,t,n,i){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,i)}Mx.extend=function e(t,n){const i=this.prototype;"string"!=typeof t&&(n=t,t="Class");const r=Object.create(this.prototype);for(const e in n)r[e]="function"==typeof n[e]&&"function"==typeof i[e]&&qx.test(n[e])?function(e,t){return function(){const n=this._super;this._super=i[e];const r=t.apply(this,arguments);return this._super=n,r}}(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=r,o.prototype.constructor=o,o.extend=e,o},Dx.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Dx(this.x,this.y,this.width,this.height)},set(e,t,n,i){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),i>=0?(this.y=t,this.height=i):(this.y=t+i,this.height=-i)},setLTRB(e,t,n,i){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=i?(this.y=t,this.height=i-t):(this.y=i,this.height=t-i)},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()),i=Math.min(e.x,this.x),r=Math.min(e.y,this.y);return new Dx(i,r,Math.max(0,t-i),Math.max(0,n-r))},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 Dx(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Dx(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 Dx(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,i=t*this.height/2;this.x-=n,this.y-=i,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 Sx=new Dx(0,0,0,0),_x=new Dx(0,0,0,0),Cx=Mx.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map((e=>this.getPage(e)))},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_x.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=_x.intersection(Sx,!0),i.push({coverage:r?r.clone():new Dx(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 i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[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){Sx.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_x.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Sx.intersection(_x,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let kx;function Ex(e,t){let n;const i={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(i[n]=e[n]);return t.push(i),i}function Ax(e,t,n){let i,r,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),i=0;i<n.length;++i)if(r=n[i],r.qSubNodes.length>0&&(a=Ax(e,t,r.qSubNodes)),o=null,(0===r.qSubNodes.length&&kx>=e&&kx<=e+t||a.length>0)&&(o=Ex(r,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+i),o.qSubNodes=a),0===r.qSubNodes.length&&kx++,kx===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-i));break}return s}function Tx(e,t,n){return kx=0,Ax(e,t,n)}const Ix=new Dx(0,0,0,0),Rx=new Dx(0,0,0,0),Nx=Cx.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const i=[];let r;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Rx.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),r=Rx.intersection(Ix,!0),i.push({coverage:r?r.clone():new Dx(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 i.sort(((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height)),i[0].coverage.height>0&&i[0].coverage.width>0?this._extract(e,this.pages[i[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){Ix.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Rx.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Ix.intersection(Rx,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const i=Math.max(0,e.qTop-t.qArea.qTop),r=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(i,i+n.height).map((e=>e.slice(r,r+n.width)));return{qLeft:Tx(i,n.height,t.qLeft),qTop:Tx(r,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function Ox(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new Nx;else{if("table"!==e.visualization)return;this.slicer=new Cx}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class Px{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,Ox.call(this,e)}getData(e){!function(e,t,n,i){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[i]);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[i]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Rb(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const Lx={version:"0.38.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 Fx(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function zx(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function jx(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let i;return i=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(i)},added(e,t){Fx(t),zx(t)},moved(e,t){Fx(t),zx(t)},removed(e,t){Fx(t),zx(t)}},i={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:i}}var Hx={},Bx={get exports(){return Hx},set exports(e){Hx=e}};!function(e,t){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=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},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,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)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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 i=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},l=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,n=i.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||i.call(e,t)},c=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},u=function(e,t){if("__proto__"===t){if(!i.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,i,r,o,s,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)i=u(h,n),h!==(r=u(t,n))&&(p&&r&&(l(r)||(o=a(r)))?(o?(o=!1,s=i&&a(i)?i:[]):s=i&&l(i)?i:{},c(h,{name:n,newValue:e(p,s,r)})):void 0!==r&&c(h,{name:n,newValue:r}));return h}},function(e,t,n){n.r(t);var i=n(0),r=n.n(i),o=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],s=e;for(i=0;i<r.length-1;++i)void 0===s[r[i]]&&(s[r[i]]=Number.isNaN(+r[i+1])?{}:[]),s=s[r[i]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},s=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(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,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=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((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=i.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.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,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=y(u(i[0],r),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=y(h,f),v=y(d,m);return"".concat(s,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:h,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},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,i){return m(e,t)+n+g(i)},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,i=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:i})},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),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(s,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+a.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=r&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),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=r.a.bind(null,!0),D={},S=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function C(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){A(e[i],t[i])||(n=!1)})),n);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!A(e[i],t[i]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?M({},{val:e}).val:e}(t[r]),s=e[r],a="".concat(n,"/").concat(r);A(o,s)||k(t,r)||(C(s)?i.push({op:"add",path:a,value:o}):_(o)&&_(s)?i=i.concat(D.generate(s,o,a)):S(o)&&S(s)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function s(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(A(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var a=r.length-1;a>=0;a-=1)-1===(o=s(t,r[a].qInfo&&r[a].qInfo.qId,a))?(i.push({op:"remove",path:"".concat(n,"/").concat(a)}),r.splice(a,1)):i=i.concat(D.generate(r[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!k(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},D.apply=function(e,t){t.forEach((function(t){var n,i=E(e,t.path),r=t.path.split("/").splice(-1)[0],o=r&&Number.isNaN(+r)?i[r]:i[+r]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,o=e),"add"===t.op||"replace"===t.op)if(S(i))"-"===r&&(r=i.length),i.splice(+r,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,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(_(o)&&_(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),M(o,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[r]=t.value}else if("move"===t.op){var c=E(e,t.from);S(i)?i.splice(+r,0,c.splice(+s,1)[0]):(i[r]=c[s],delete c[s])}else"remove"===t.op&&(S(i)?i.splice(+r,1):delete i[r])}))},D.clone=function(e){return M({},e)},D.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},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 i=T.generate(t,n);return r()(!0,t,n),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()},R="accumulation";function N(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===R)return n[i]}function O(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===R)return i;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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getNumStepComp(n,l),d=w.getAboveComp(n,l,u,h),f=w.getRangeComp("RangeSum",d);if(w.needDimension({modifier:n,properties:i,layout:r})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(f,p,m);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,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 i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(R))return!1;var o=N(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===F)return n[i]}function j(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===F)return i;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,i=e.modifier,r=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:r,layout:o}));var u=s(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=w.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=w.getNumStepComp(i,c),p=w.getAboveComp(i,c,d,f);if(i.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 i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:i,properties:r,layout:o})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=i.showExcludedValues?w.getExcludedComp({modifier:i,dimensions:u,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(j(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(j(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(j(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(j(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 i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===V)return n[i]}function W(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===V)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=w.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(w.needDimension({modifier:n,properties:i,layout:r})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(d,f,p);d=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[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(W(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(W(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(W(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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(V))return!1;var o=$(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=s(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===G)return n[i]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===G)return i;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,i){var r=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===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var i=Q(t,0);t.splice(i,1)}return t}(r,o),function(e,t,n){if(0===e){var i=Q(t,1);t.splice(i,1)}return t}(J(e,i).selectionScope,o)}function te(e,t,n){var i=[{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 i=Q(t,0);t.splice(i,1)}return t}(J(e,n).dimensionalScope,i)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function ie(e){return 2===e?"{1}":""}function re(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 se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={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,i=e.properties,r=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:i,layout:r}));var c=s(i,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,s){var a=ie(t),l=re(t,n,i),c=""===a&&""===l?"":a||l,u=oe(r,o),h=se(r,o,s),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(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,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,i){return ee(n,i,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,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ie,getFieldSelectionComp:re,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;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:ae},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:ue.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,i=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:i})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=we(e);ke({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Re({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,i=e.isSnapshot,o=void 0!==i&&i,a=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 c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var h=s(c,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:h,layout:c})){var f=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ce({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:h,layout:c,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return ke({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=r()(!0,{},e);Me(n);var i=Ne(n);return Ee({model:t}).then((function(r){return Ae({libraryIds:i,model:t}).then((function(i){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ce({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.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 i=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:r})}))}))})):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,i=Ne(n);return Oe({model:t,libraryIds:i}).then((function(){var e=r()(!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,i=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===n&&(n=l?r()(!0,{},i):i),Me(i);var d=Ne(i);return Oe({model:t,libraryIds:d,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,i=e.model,o=e.libraryItemsProps,a=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:i,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:i,libraryItemsProps:o}).then((function(i){t.forEach((function(t){ke({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,i=e.libraryItemsProps,o=e.dimensionAndFieldList,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===he(e)&&!e.disabled){if(a++,"object"!==he(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,i.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=r()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(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:i,dimensionAndFieldList:e}),De(t)):ge(t)}))}))}))}({measures:o,properties:i,model:t,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ie({oldProperties:n,newProperties:i,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)?ue.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,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return ke({modifiers:we(e),properties:n,layout:i})}))}function ve(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(de[i.type]&&!i.disabled)return i}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function qe(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(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:!ue.isValid(e)&&t.base&&(e.qDef.base=r()(!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 _e(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function Ce(e){var t=e.measure,n=e.properties,i=e.layout;return!_e(t)&&ke({modifiers:we(t),properties:n,layout:i})}function ke(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==he(e)||e.disabled||!de[e.type])&&(void 0===r[e.type]&&(r[e.type]=de[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ee(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var s=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(s),Promise.all(i).then((function(){return r}))}function Ae(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ie(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&s(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):I(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Re(e){var t=e.modifiers,n=e.properties,i=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:i})}))}function Ne(e){var t=xe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=we(t);if(ke({modifiers:i,properties:e})){var o=_e(t);o&&n.push(o),r=r||Re({modifiers:i,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}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,i={},r={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach((function(n){t[n]=s(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,s=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:s}),Object.keys(i).forEach((function(e){r[e]||o[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!i[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({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 i(e){var t=function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?i(n)+t: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)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var s=i[o];if(""!==s){if(void 0===r[s]||null===r[s])return n;r=r[s]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,s=0;s<i.length-1;++s){var a=i[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+i[s+1])?{}:[]),o=o[a]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return i(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(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 a(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)?a(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(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 c(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)?c(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;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 i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}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,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u},d=n(1),f=n.n(d),p={addDimensions:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,s(i.qDimensions));var a,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=r.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var s,a=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=r.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.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 i,r,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((r=(r=(i=JSON.stringify(s)).match(/:\{/g))?r.length:0)>2)return;s=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}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&&null!=e[Symbol.iterator]||null!=e["@@iterator"])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,i=new Array(t);n<t;n++)i[n]=e[n];return i}function D(e){return function(e){if(Array.isArray(e))return S(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 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,i=new Array(t);n<t;n++)i[n]=e[n];return i}var _={importCommonProperties:function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},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,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=v(a.dimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=v(a.excludedDimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=b(a.measures[t],s);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=b(a.excludedMeasures[t],s);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},s=i.measures||{max:0},a=x(s.max,r.dimensions.length,w),l=x(s.min,r.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".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)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=y()(!0,{},n,r)).components&&(r.components=[]),r},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>r&&r>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>i||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!r&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>i)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>r&&r>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=q(r.qDimensions);r.qDimensions=[],s.forEach((function(e){r.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var r=o.getValue(t,i||"").qHyperCubeDef,s=D(r.qMeasures);r.qMeasures=[],s.forEach((function(e){r.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 C(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 k={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:r,qHyperCubeDef:l}),p.addMeasures({exportFormat:r,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:r,properties:s}),n&&(r.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:r,properties:s}),i||p.storeMeasuresModifiers(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(m(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(m(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(m(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,s=void 0===r?{}:r,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=_.createNewProperties({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,D=l.defaultDimension,S=void 0===D?_.getDefaultDimension():D,k=l.defaultMeasure,E=void 0===k?_.getDefaultMeasure():k;v.qDimensions.length=0,v.qMeasures.length=0,_.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&_.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),_.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:S}),_.addMeasures({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),_.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:c}),_.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),_.copyPropertyIfExist("qMaxStackedCells",y,v),_.copyPropertyIfExist("qNoOfLeftDims",y,v),_.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),_.copyPropertyOrSetDefault("qMode",y,v,"S"),_.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),_.copyPropertyOrSetDefault("qSortbyYValue",y,v),_.copyPropertyOrSetDefault("qIndentMode",y,v),_.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),_.importCommonProperties(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return _.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:A}),d&&C(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&C(m.qProperty,"dynamicScript"),m}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var s=e.splice(r,1);t.push(s[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,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(A(s,t,i,r),T(t,a))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 i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function F(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 j(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,s=e.measures,a=e.label;F(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=I.create(I.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;r||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,i){var r,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(r=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=r,a.id=r,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.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 a}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,i){var r=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(z(e,a||""),r){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=s)}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),s=Number(r[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===i&&"point"===a}(n,e,t)?0:n.length-1],r=I.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return V(e,H("dimension",!!s,s||i)),!!s}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=H("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,V(e,r)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&z(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=H("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,V(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],s=I.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(r.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||i[0])),!!a}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,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 i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var i=(P[t]||N).colorModeOptions||N.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?F(r,a):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions;return!t&&"byDimension"===n&&i.length>0}({auto:i,colorMode:n,dimensions:r})?W(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==a&&!r.length)}({auto:i,colorMode:n,dimensions:r,measures:s,properties:e})?U(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),F(i,s)}(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,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.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,i=e.viewDataMode,r=k.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=I.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return I.moveByIdFromGroup(s,[],"qAttributeDimensions",c),I.moveByIdFromGroup(s,[],"qAttributeExpressions",c),I.moveByIdFromGroup(a,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=k.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.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),u}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?C(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):C(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,s=r.qHyperCubeDef,a=r.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:i})){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,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),K.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(s);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()(a,n.properties.measureAxes[t[0].axis])):y()(a,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,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,s=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),a=s.properties;return o?(m(a,"measureAxis.min","supportedAutoMinMax"),m(a,"measureAxis.max","supportedAutoMinMax")):(m(a,"measureAxis.min","unsupportedAutoMinMax"),m(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:h}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:h,measureType:s}),G.setInterColumnSortOrder(h.qHyperCubeDef),u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,s);if(void 0!==a){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=Z(n,i,l);o.setValue(t,c,a),o.setValue(r,s,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,s=e.itemPath,a=o.getValue(r,"qDef.cId");if(a){var l=Z(n,i,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:s})}))}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:k,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:C,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Bx);var Vx=n(Hx);const $x=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Wx(e,t,n){for(let i=0;i<n.length;++i){const r=n[i];void 0!==e[r]&&(t[r]=e[r],delete e[r])}}var Ux={importColors:function(e){e.color.point=e.color.point||{},Wx(e.color,e.color.point,$x),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Wx(e.color.point,e.color,$x),e.color.colorExpression=Rb(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Yx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:i}){const r=Vx.axisChart.importProperties({exportFormat:n,initialProperties:i,dataDefinition:e,defaultPropertyValues:t}),o=r.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),Ux.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,r}function Xx({propertyTree:e,viewDataMode:t}){const n=Vx.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Ux.exportColors(e.qProperty),n}var Kx=e=>{const t=jx(e);return{properties:Lx,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Yx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Xx}},Gx=Object.prototype.hasOwnProperty,Jx=Object.prototype.toString,Zx=Object.defineProperty,Qx=Object.getOwnPropertyDescriptor,ew=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Jx.call(e)},tw=function(e){if(!e||"[object Object]"!==Jx.call(e))return!1;var t,n=Gx.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Gx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Gx.call(e,t)},nw=function(e,t){Zx&&"__proto__"===t.name?Zx(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},iw=function(e,t){if("__proto__"===t){if(!Gx.call(e,t))return;if(Qx)return Qx(e,t).value}return e[t]},rw=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=iw(a,n),a!==(r=iw(t,n))&&(u&&r&&(tw(r)||(o=ew(r)))?(o?(o=!1,s=i&&ew(i)?i:[]):s=i&&tw(i)?i:{},nw(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&nw(a,{name:n,newValue:r}));return a};const ow={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const sw={replaceExpressionTokens:function(e,t,n){const i={start:n&&n.start||"{{",end:n&&n.end||"}}"};let r,o,s=e;for(const e in t)r=t[e],o=i.start+e+i.end,s=s.replace(aw(o,!0),r);return s},createRegExp:aw};function aw(e,t,n){const i=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const r=n?`(${i})`:i;return t?new RegExp(r,"g"):new RegExp(r)}const lw={generateExpression:function(e,t){const n={};if(t)for(const e in t){const i=t[e],r=i.wrap?ow.wrapExpression(i.value):i.value;n[e]=r;(i.variations||[]).forEach((t=>{const i=cw(t,r,e);n[t]=i}))}return sw.replaceExpressionTokens(e,n)}};function cw(e,t,n){if(""===t)return"";const i=sw.createRegExp(n,!0,!0),r=e.split(i);let o="";return r.forEach((e=>{o+=e!==n?e:t})),o}const uw={generateHyperCubeDef:function(e,t,n,i,r){return function(e,t,n,i){const r={};let o,s;const a=[];let l;e.forEach((e=>{o=mw(e.match(pw("Dim"))),o.forEach((e=>{a.push(hw(t.qDimensions[e],i,e,n).then((t=>{r[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=mw(e.match(pw("Mea"))),s.forEach((e=>{a.push(dw(t.qMeasures[e],i).then((t=>{r[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(r))):Promise.resolve(r);return l}(e.dimensions.concat(e.measures),t,n,i).then((n=>{const i=rw({},n,r),o=rw(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${lw.generateExpression(e,i)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:lw.generateExpression(e,i)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const i=e.qDimensions.map(((e,i)=>hw(e,n,i,t))),r=e.qMeasures.map((e=>dw(e,n)));return{dimensions:await Promise.all(i),measures:await Promise.all(r)}}};function hw(e,t,n,i){if(e.qLibraryId)return fw(e.qLibraryId,"dimension",t,n,i);const r=i.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[r])}function dw(e,t){return e.qLibraryId?fw(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function fw(e,t,n,i,r){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[r.qDimensionInfo[i].qGroupPos]:e.qMeasure.qDef))))}function pw(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function mw(e){return e?e.map((e=>e.substr(6,1))):[]}function gw(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 i=e();switch(t){case"descending":n("integer",i?1:-1);break;case"ascending":n("integer",i?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var yw={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,i){if(n){let n=e()?-1:1;n*=t,i("integer",n)}else i("integer",0)}}},enumConvertFunctions:gw,invertedEnumConvertFunctions:function(e){return gw((function(){return!e||!e()}))}};const vw=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function bw(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:vw,convertFunctions:n.sorting,show:t=>0!==Rb(t,e,0)}}}}var xw={state:function(e,t){return bw(e=e||"qSortByState","properties.sorting.sortByState",{toggled:yw.booleanConvertFunctions(t),sorting:yw.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return bw(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:yw.booleanConvertFunctions(t),sorting:yw.enumConvertFunctions(t)})},numeric:function(e,t){return bw(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:yw.booleanConvertFunctions(t,-1),sorting:yw.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:yw.booleanConvertFunctions(t),sorting:yw.enumConvertFunctions(t)},i=bw(e,"properties.sorting.sortByExpression",n);return i.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Rb(t,e,0)},i},frequency:function(e,t){return bw(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:yw.booleanConvertFunctions(t),sorting:yw.invertedEnumConvertFunctions(t)})}};const ww=(e,t)=>(t.components||[]).find((t=>t.key===e)),qw=(e,t,n,i)=>{var r,o,s,a,l;const c=i.isEnabled("CLIENT_IM_3364")?null===(r=ww("axis",n))||void 0===r?void 0:r.axis:{};return{text:{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},Mw=(e,t,n,i)=>{var r,o,s,a,l,c,u,h;const d=i.isEnabled("CLIENT_IM_3364")?null===(r=ww("axis",n))||void 0===r?void 0:r.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(a=d.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(c=d.label)||void 0===c||null===(u=c.name)||void 0===u||null===(h=u.fontColor)||void 0===h?void 0:h.color)||t.getStyle(e,"axis.label.name","color")}}},Dw={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 Sw(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(Dw);const _w={hasMultipleDimensions:Sw,getOuterDimensionCardinality:function(e){const t=Rb(e,Dw.HYPERCUBE_PATH);return Sw(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Rb(e,Dw.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Rb(e,`${Dw.SORT_CRITERIA}.sortByAscii`,0)}},Cw={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var kw={create(e,t){if(!e||!Cw[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 i=-1;return e&&(n=n||"id",e.forEach(((e,r)=>{e[n]===t&&(i=r)}))),i},moveById(e,t,n,i){const r=this.getIndexById(e,n,i);t=t||[];const o=this.getIndexById(t,n,i);if(-1!==r&&-1===o){const n=e.splice(r,1);t.push(n[0])}return t},moveAllById(e,t,n,i){const r=e.filter((e=>e.id===n)),o=t.filter((e=>e.id===n)),s=r.filter((e=>!(o.filter((t=>t[i]===e[i])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,i,r),a!==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 i={};let r,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(i.type="dimension",i.name=n.qLibraryId,i.id=n.qLibraryId):(i.type="field",t?(i.name=n.label||n.qDef,i.id=n.qDef):(r=n.qDef,o=!!r.qLabelExpression,s=r.qFieldLabels&&r.qFieldLabels[0],i.name=r.qFieldDefs[0],i.label=o?r.qLabelExpression:s?r.qFieldLabels[0]:r.qFieldDefs[0])),i}};var Aw={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 Tw=["scatterplot","map"],Iw=["map"];var Rw={baseColor:{isSupported:e=>e&&e.length&&-1===Tw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==Iw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,i){this.updateColorDef(e,i,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const i=Rb(n,"mode"),r=Rb(n,"auto"),o=Rb(e,`${t}qDimensions`,[]),s=Rb(e,`${t}qMeasures`,[]);let a,l,c,u;if(!r&&"byDimension"===i&&o.length)a=Rb(n,"byDimDef"),a&&zw(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=Ew.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,Lw(n,u)):a&&a.key||(l=o[o.length-1],c=kw.getById(l.qAttributeDimensions,kw.IDMAP.COLOR_BY_ALTERNATIVE),Lw(n,Ew.getColorByDefinition("dimension",!!c,c||l)));else{if(!r&&"byMeasure"===i&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===i&&s.length<2&&Nb(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const i=Rb(n,"mode"),r=Rb(n,"auto"),o=Rb(e,`${t}qDimensions`,[]),s=Rb(e,`${t}qMeasures`,[]),a=Rb(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!r&&"byDimension"===i&&o.length?Fw(n,!0,o,a,s,Rb(n,"byDimDef.label")):!r&&"byMeasure"===i&&o.length?Fw(n,!1,o,a,s,Rb(n,"byMeasureDef.label")):Nw(o,a)},setColorByPropertyDef:Lw,resolveColorByPropertyDef:Fw,clearColorByItem:Nw};function Nw(e,t){e.forEach((e=>{Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ow(e,kw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function Ow(e,t,n){if(e[n]){const i=kw.getIndexById(e[n],t);i>=0&&e[n].splice(i,1)}else e[n]=[]}function Pw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function Lw(e,t,n,i){const r=n?"expression":t.type;let o=e.mode;switch(zw(e,t.label||t.name||""),r){case"field":o="byDimension",e.byDimDef={label:t.label||Pw(t.name),key:Pw(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&&Aw.useMasterNumberFormat(e.formatting)}i||(e.auto=!1,e.mode=o)}function Fw(e,t,n,i,r,o){Nw(n,i);const s=n[n.length-1];if(s){const n=Rb(e,t?"byDimDef":"byMeasureDef"),i=Rb(e,"formatting.qNumFormat"),a=Rb(e,"formatting.isCustomFormatted");if(n){const e=kw.create(kw.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,i&&(e.qNumFormat=i,e.isCustomFormatted=a));break;case"libraryItem":if(!t){let t=-1;r.forEach(((e,i)=>{n.key===e.qLibraryId&&(t=i)})),e.matchMeasure=t,i&&(e.qNumFormat=i,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function zw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function jw(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Hw(e){return"libraryItem"===Rb(e,"color.point.byDimDef.type")}function Bw(e){return"libraryItem"===Rb(e,"color.point.byMeasureDef.type")}function Vw(e){return!0===Rb(e,"color.point.auto")}function $w(e){return!Vw(e)&&"byDimension"===Rb(e,"color.point.mode")}function Ww(e){return!Vw(e)&&"byMeasure"===Rb(e,"color.point.mode")}var Uw={measuresHasBaseColors:function(e){return Rb(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!jw(e))).length>0},dimensionsHasBaseColors:function(e){return Rb(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!jw(e))).length>0},onGlobalChangeColors:function(e){Rw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&i&&(i.qCalcCond=n.qCalcCond,i.qCalcCondition=n.qCalcCondition)},isColorByDimension:$w,isColorByMeasure:Ww,isColorAuto:Vw,isColorByExpression:function(e){return!Vw(e)&&"byExpression"===Rb(e,"color.point.mode")},isColorBySingle:function(e){return!Vw(e)&&"primary"===Rb(e,"color.point.mode","primary")},isDimensionLibraryItem:Hw,isMeasureLibraryItem:Bw,showLegend:function(e){const t=Rb(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Vw(e)},showColorByLabel:function(e){const t=$w(e)&&!1===Hw(e),n=Ww(e)&&!1===Bw(e),i=Rb(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!i||n},hasDimValueColors:function(e,t){var n,i,r;return null===(n=null===(i=e.layout.qHyperCube.qDimensionInfo[t])||void 0===i||null===(r=i.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function Yw(e,t){this.getSettings=e,this.getElements=t}function Xw(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],i=this.getSettings();Nb(n,"qSortByExpression",i.SORT_BY_EXPRESSION),Nb(n,"qSortByAscii",i.SORT_BY_ASCII),Nb(n,"qSortByNumeric",i.SORT_BY_NUMERIC),Nb(n,"qSortByLoadOrder",i.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const r=Kw(this.getElements());n.qExpression.qv=r.exp}function Kw(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Yw.prototype.applyAutoSorting=Xw,Yw.prototype.applyDefaultCustomSorting=function(e,t){Xw.call(this,e);const n=Kw(this.getElements()),i=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Nb(t.sortCriteria,"sortByExpression",i.qSortByExpression),Nb(t.sortCriteria,"sortByAscii",i.qSortByAscii),Nb(t.sortCriteria,"sortByNumeric",i.qSortByNumeric),Nb(t.sortCriteria,"sortByLoadOrder",i.qSortByLoadOrder)},Yw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Nb(n,"qSortByExpression",t.sortCriteria.sortByExpression),Nb(n,"qSortByAscii",t.sortCriteria.sortByAscii),Nb(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Nb(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 Gw={create:function(e,t){return new Yw(e,t)}};const Jw={applySorting:function(e,t,n){const i=n.autoSort,r=!!n.sortCriteria;i?e.applyAutoSorting(t):r?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Zw={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Zw.ASCII),Object.freeze(Zw);const Qw=rw(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Zw);const eq={getSettings:function(e){return Rb(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Qw.DIST_MAX:Qw.ASCII}};function tq(e,t,n,i){let r="Fractile";0===e?r="Min":1===e&&(r="Max");const o=t?ow.wrapExpression(t):"",s=n?ow.wrapExpression(n):"";return`${r}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(i||"").replace(/^=/,""))}const nq={getElementIds:function(){return[Dw.SORTING_ELEMENT_MIN_ID,Dw.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,i){const r=t[0],o=t[1],s=e[0],a=tq(0,r,o,s),l=tq(1,r,o,s);return[{id:Dw.SORTING_ELEMENT_MIN_ID,label:i.get("properties.distributionPlot.min"),exp:a,isDefault:Dw.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:Dw.SORTING_ELEMENT_MAX_ID,label:i.get("properties.distributionPlot.max"),exp:l,isDefault:Dw.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:tq};function iq(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function rq(e,t,n,i){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const r=e.qUndoExclude.qHyperCubeDef.qDimensions;r.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return eq.getSettings(t)},s=Gw.create(o,(function(){const e=o();return nq.getElements(n.measures,n.dimensions,e,i)})),a=r[0],l=e.sorting;Jw.applySorting(s,a,l)}const oq={applySorting:function(e,t,n,i,r){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&iq("'qHyperCubeDef.qDimensions' has no outer dimension"):iq("no 'qHyperCubeDef.qMeasures' in properties arg"):iq("no 'qHyperCubeDef.qDimensions' in properties arg"):iq("no 'qHyperCubeDef' in properties arg")}(e),i?rq(e,t,i,r):uw.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{rq(e,t,n,r)}))}},sq=`${Dw.SORT_CRITERIA}.sortByExpression`;const aq={updateSortOrder:function(e,t){if(!t)return;const n=Rb(e,sq);if(!(-1===n||1===n))return;const i=Rb(e,Dw.SORTING_ELEMENT_ID),r=Rb(t,Dw.SORTING_ELEMENT_ID),o=i===Dw.SORTING_ELEMENT_MAX_ID,s=i===Dw.SORTING_ELEMENT_MIN_ID&&r===Dw.SORTING_ELEMENT_MAX_ID,a=o&&(!!!r||r===Dw.SORTING_ELEMENT_MIN_ID),l=Rb(t,sq),c=o&&!(-1===l||1===l)&&1===n;s?Nb(e,sq,1):(a||c)&&Nb(e,sq,-1)}},lq=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:n&&null!=n&&n.isEnabled("CLIENT_IM_3364")?{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}}:void 0});function cq(e){return!Rb(e,"color.point.auto")&&"byDimension"===Rb(e,"color.point.mode")&&Rb(e,"qHyperCubeDef.qMeasures.length",0)<=1}function uq(e){const{flags:t,translator:n}=e,i=e.anything.sense.theme,r=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:i.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={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=>!Rb(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!Rb(e,"color.point.auto",!0)&&"primary"===Rb(e,"color.point.mode","primary"),defaultValue(){const e=i.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!Rb(e,"color.point.auto")&&"byExpression"===Rb(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"}]}}},c=((e,t,n,i)=>i({theme:e,translator:t,config:{id:n,paths:["axis.title","axis.label.name","label.value"]}}))(i,n,Dw.CHART_ID,wx),u=((e,t,n)=>{const i={getOptions:(i,r)=>{const o=(e,t)=>({ref:`${r}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${r}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:i,items:{fontFamily:{ref:`${r}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${r}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${r}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${r}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${r}.fontSize`),defaultValue:()=>e.getDefaultValue(`${r}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return i})(c,i,Dw.CHART_ID),h={type:"items",translation:"properties.presentation",items:{styleEditor:r&&lq(o,u,t),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}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:Dw.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.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 d={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,i){const{autoMinMax:r,minMax:o,min:s}=(null==i?void 0:i.measureAxis)||{};return!0===r?"lowest":r||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,i,r){"zero"===e?(Nb(r,"measureAxis.autoMinMax",!1),Nb(r,"measureAxis.minMax","min"),Nb(r,"measureAxis.min",0)):Nb(r,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Rb(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)=>Rb(t.layout,`${Dw.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=Rb(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 m=(e,t)=>{var n,i,r;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l,c;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",i=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(c=l.qHyperCube)||void 0===c?void 0:c.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<i.length;e++){const t=i[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(i=null===(r=e.color.point.byDimDef)||void 0===r?void 0:r.label)&&void 0!==i?i:""},g=(e,t,i)=>{var r,o;if(null!==(r=e.qHyperCubeDef)&&void 0!==r&&null!==(o=r.qDimensions)&&void 0!==o&&o.length){var s,a,l,c,u;const t=null===(s=e.qHyperCubeDef)||void 0===s?void 0:s.qDimensions.map(((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)})));return(null!==(a=null===(l=e.color)||void 0===l||null===(c=l.point)||void 0===c||null===(u=c.byDimDef)||void 0===u?void 0:u.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,i)}),t}return[]},y=(e,t)=>{const n="measure"===Rb(e,"color.point.useBaseColors")&&Uw.measuresHasBaseColors(t),i="dimension"===Rb(e,"color.point.useBaseColors")&&Uw.dimensionsHasBaseColors(t);return Uw.isColorBySingle(e)&&!n&&!i},v=(e,t)=>!Rb(e,"color.point.auto",void 0)&&"primary"===Rb(e,"color.point.mode",void 0)&&!y(e,t),b={items:{disclaimer:{show:(e,n)=>!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&v(e,n)},simpleItems:{show:(e,n)=>!!t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")||!v(e,n),items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>Rb(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Rb(e,"color.point.auto")||(Nb(e,"color.point.mode","primary"),Nb(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"===Rb(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Uw.isColorAuto(e),change(e){if("primary"===Rb(e,"color.point.mode",void 0)){const t=Rb(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Nb(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Uw.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const i=Rb(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Uw.isColorAuto(e)&&"primary"===i&&(Uw.measuresHasBaseColors(n)||Uw.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,i){var r,o,s;const a=null!==(r=null===(o=e.color.point)||void 0===o||null===(s=o.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==r?r:null,l=Uw.hasDimValueColors(i.handler,a);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Uw.isColorByDimension(e)&&Uw.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)},show:e=>!Rb(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Uw.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"}),Rb(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Uw.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Uw.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Uw.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Uw.showColorByLabel,change(e){const t=Rb(e,"color.point.mode"),n=Rb(e,"color.point.altLabel","");let i;switch(t){case"byMeasure":i=e.color.point.byMeasureDef;break;case"byDimension":i=e.color.point.byDimDef}i&&(i.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=Rb(e,"color.point.mode","primary");return!Uw.isColorAuto(e)&&"primary"===n&&(Uw.measuresHasBaseColors(t)||Uw.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Rb(e,"color.point.auto")&&"byMultiple"===Rb(e,"color.point.mode")&&"measure"===Rb(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Uw.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Rb(e,"color.point.useBaseColors")&&Uw.measuresHasBaseColors(t),i="dimension"===Rb(e,"color.point.useBaseColors")&&Uw.dimensionsHasBaseColors(t);return Uw.isColorBySingle(e)&&!n&&!i}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Uw.isColorByDimension(e)&&Uw.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=Rb(e,"color.point.auto"),n=Rb(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Rb(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Rb(e,"color.point.auto")||"byDimension"!==Rb(e,"color.point.mode")||"libraryItem"!==Rb(e,"color.point.byDimDef.type")?cq(e):cq(e)&&!Rb(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Uw.isColorAuto(e)&&Uw.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Uw.isColorAuto(e)&&Uw.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Uw.isColorByDimension(e)&&(!Uw.isDimensionLibraryItem(e)||!Rb(e,"color.point.useDimColVal"))},customRange:{show:e=>!Uw.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Uw.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Uw.isColorByMeasure(e)&&!1===Rb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Rb(e,"color.point.minMax")&&Rb(e,"color.point.measureMin")>=Rb(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Uw.isColorByMeasure(e)&&!1===Rb(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Rb(e,"color.point.minMax")&&Rb(e,"color.point.measureMin")>=Rb(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Uw.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=i.getStyle(Dw.CHART_ID,"box","fill");return s(e)},show:e=>!Rb(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Uw.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Uw.showLegend(e)&&Rb(e,"legend.show",!0)},showTitle:{show:e=>Uw.showLegend(e)&&Rb(e,"legend.show",!0)}}}}},w={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,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,r){r.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,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:w,general:l,presentation:h,colors:x||a,measureAxis:d,dimensionAxis:f}},M={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Uw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},D=xw.expression(`${Dw.SORT_CRITERIA}.sortByExpression`),S={type:"items",items:{toggled:D.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:Dw.SORTING_EXPRESSION,elementRef:Dw.SORTING_ELEMENT_ID,show:_w.isSortByExpression,elements:e=>uw.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const i=eq.getSettings(e.layout);return nq.getElements(t.measures,t.dimensions,i,n)}))},order:D.items.order}},_={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&aq.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:Dw.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:_w.hasMultipleDimensions,change(e,t,i,r){if(e&&_w.hasMultipleDimensions(e)&&t.layout)return oq.applySorting(e,t.layout,r.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:Dw.SORTING_EXPRESSION,elementRef:Dw.SORTING_ELEMENT_ID,sortCriteriasRef:Dw.SORT_CRITERIA,show:e=>_w.hasMultipleDimensions(e)&&!_w.isAutoSort(e),elements:e=>uw.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const i=eq.getSettings(e.layout);return nq.getElements(t.measures,t.dimensions,i,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>_w.hasMultipleDimensions(e)&&!_w.isAutoSort(e),items:{expression:S,numeric:xw.numeric(`${Dw.SORT_CRITERIA}.sortByNumeric`),ascii:xw.ascii(`${Dw.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!_w.isSortByExpression(e)&&!_w.isSortByNumeric(e)&&!_w.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!_w.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:_,addons:M,settings:q}}}const hq={buildDefinition:function(e,t,n,i,r){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Rb(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,s){const a=s.layout;let l=dq(e,o).chart;l||(l="sortByAscii");const c=Rb(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=i(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=r(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=dq(e,o).dimension;return t?Rb(e,o+t):0}}}};return s}};function dq(e,t){const n={chart:"",dimension:""};return 0!==Rb(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Rb(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Rb(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const fq={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:hq.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",eq.getSettings,nq.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}}}}},pq={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=>Uw.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Uw.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Uw.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Uw.showLegend}}}}};function mq(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:uq(e),softDefinition:fq,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Uw.onGlobalChangeColors(t)},importProperties:(t,n,i)=>{const r=jx(e);i.mapProperties();return Yx({dataDefinition:r,defaultPropertyValues:{defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Xx({propertyTree:e,viewDataMode:n})}}rw(!0,fq,pq);const gq={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 yq(){return gq.id()}const vq="scrollbar";function bq(e,t,n){return"y"===e?xq(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function xq(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var wq={getAxisDock:bq,getOppositeAxisDock:function(e,t,n){return bq(e,"far"===t?"near":"far",n)},getYAxisDock:xq};const qq=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Mq=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Dq=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Sq(e){return qq.test(e)}function _q(e){return Mq.test(e)||Dq.test(e)}var Cq={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],Sq(i))return"ltr";if(_q(i))return"rtl"}return"ltr"}};var kq={lineSettings:function(e,t){var n;const i={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 rw(!0,i,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let i=t.theme.getStyle(n,"referenceLine.label.name","color");const r=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?i=t.theme.getColorPickerColor(t.paletteColor):i||(i="transparent"),rw(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:i,fontFamily:o,fontSize:r,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} ${Cq.lrm}(${n})${Cq.lrm}`:`${Cq.lrm}(${n})${Cq.lrm}`:!1!==e.showLabel?t:""}};const Eq={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}}};Eq.DEFAULT_CHART_ORIENTATION=Eq.HORIZONTAL;function Aq(e,t){const n=t||{},i=n.measureAxisProperties||{},r=n.dimensionAxisProperties||{},o=n.orientation||Eq.DEFAULT_CHART_ORIENTATION,s=o===Eq.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=Eq.SHOW_AXIS_LABELS_OPTIONS,u=Eq.SHOW_TITLE_OPTIONS,h=c.includes(i.show),d=!!n.measureTitleText&&u.includes(i.show),f=n.includeDimensionAxis&&c.includes(r.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(r.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,i){let r={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:i&&!i.autoMinMax&&i.showBounds};r=rw(r,Eq.LAYOUTSETTINGS.measureAxis);const o=Iq(t,n);e.addComponent(`${n}-axis`,r,o)}(e,n,a,i),d&&function(e,t,n){let i={text:t.measureTitleText,style:t.axisTitleStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.measureAxisTitle);const r=function(e,t){return Iq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,a),function(e,t,n,i){let r=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:i};i&&i.spacing>0&&(r=rw(!0,r||{},{component:{ticks:{distance:100*i.spacing}}}));e.addScale("measure-scale",r,o)}(e,n,o,i),f&&function(e,t,n){let i={scale:"dimension",settings:t.axisLabelStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.dimensionAxis);const r=Rq(t,n);rw(!0,i,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,i,r)}(e,n,l),p&&function(e,t,n){let i={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};i=rw(i,Eq.LAYOUTSETTINGS.dimensionAxisTitle);const r=function(e,t){return Rq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,i,r)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const i={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Eq.HORIZONTAL?Eq.VERTICAL:Eq.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,i)}(e,n,o),m&&function(e,t,n){let i={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};i=rw(i,Eq.LAYOUTSETTINGS.gridLines),i[n]={scale:"measure"},e.addComponent("grid-line",i)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,i){const r=e.getSettings();r.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:!i},s=rw({},Eq.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Tq(t,function(e){function t(t,n){if(!n||!e())return!1;const i={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(i).some((e=>e.settings.key===vq))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(vq).emit("tap",e)}}},i={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(vq).emit("panStart",e)},pan(e){this.chart.component(vq).emit("panMove",e)},panend(e){this.chart.component(vq).emit("panEnd",e)},pancancel(e){this.chart.component(vq).emit("panCancel",e)}}};return[n,i]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,i){const r=wq.getAxisDock(n,i.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=rw(o,Eq.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${yq()}`,require:["renderer","chart"],dock:wq.getOppositeAxisDock(n,i.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,i=this.chart.formatter({data:e.settings.scales.measure.data}),r=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${i(e.value)})`:"",r=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:r,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=r[0];for(let e=1;e<r.length;e++)r[e].wanted>o.wanted&&(o.wanted=r[e].wanted),r[e].required>o.required&&(o.required=r[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=rw(s,Eq.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((i=>{if(!i.show)return;const a=i.refLineExpr&&i.refLineExpr.value,l=rw(!0,{},t,{paletteColor:i.paletteColor,style:i.style,chartID:e.options.chartID}),c=kq.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=kq.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==i.showLabel?i.label:"",showValue:!1!==i.showValue}},l);"x"===n?u.label.vAlign="near"===r?1:0:u.label.align="near"===r?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,i),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Eq.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeDim"};o=rw(o,Eq.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Rq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMeasure"};o=rw(o,Eq.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:i,isRtl:r};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Iq(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,i,r){let o={key:"rangeMinor"};o=rw(o,Eq.LAYOUTSETTINGS.rangeMinor);const s={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:i,isRtl:r,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,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 Iq(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 Nq(e,t){const n=t||{},i=!n.orientation||"horizontal"===n.orientation,r=!!n.isRtl,o={name:n.name||"scale",component:{invert:i&&r,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return rw(!0,{},o,e||{})}function Oq(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=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:wq.getAxisDock(r,i,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=rw(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function Pq(e,t){const n=t&&t.chartID,i=t&&t.dock,r=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:wq.getAxisDock(r,i,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return rw(!0,{},c,e||{})}Nq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const i={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},r=t&&t.measureAxisProperties;r&&!r.autoMinMax&&(["min","minMax"].includes(r.minMax)&&(i.component.min=r.min),["max","minMax"].includes(r.minMax)&&(i.component.max=r.max));const o=Nq(rw(!0,i,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Nq.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 Nq(rw(!0,n,e||{}),t)},Oq.xAxis=function(e,t){return Oq(rw(!0,{key:"x-axis",scale:"x"},e||{}),t)},Oq.yAxis=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis",scale:"y",dock:wq.getYAxisDock(n,i)};return Oq(rw(!0,r,e||{}),t)},Pq.xAxisTitle=function(e,t){return Pq(rw(!0,{key:"x-axis-title"},e||{}),t)},Pq.yAxisTitle=function(e,t){const n=t&&t.dock,i=t&&t.isRtl,r={key:"y-axis-title",dock:wq.getYAxisDock(n,i)||"left"};return Pq(rw(!0,r,e||{}),t)};var Lq={getBublesAlign:function(e,t,n){let i=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(i=!i),i?"start":"end"},getDock:function(e,t){const n=[];let i;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(i=n.join(",")),i}};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 zq(){return Fq}function jq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}zq.getLayoutModeKeys=function(){const e=[];let t;for(t in Fq)e.push(t);return e};const Hq={left:"left",right:"right",up:"top",down:"bottom"};function Bq(e,t,n){switch(e){case"scale":return Nq(t,n);case"measure-scale":return Nq.measureScale(t,n);case"dimension-scale":return Nq.dimensionScale(t,n);case"axis":return Oq(t,n);case"box-marker":return function(e){return rw(!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 rw(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,i=t&&t.chartID,r=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:r?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(i,"","backgroundColor"),invert:n&&r}};return rw(!0,{},o,e||{})}(t,n);case"text":return Pq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushComponents?t.brushComponents:[],r=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 i.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:r})})),rw(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:Lq.getDock(i,r),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lq.getBublesAlign(s,a,l)}}};return rw(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,i=t&&t.brushAxis,r=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:Lq.getDock(i,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:i,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Lq.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return r.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),rw(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t&&t.dock||"auto";const o=t&&t.show;"auto"===r&&(r=t.chartHeight/t.chartWidth<1?i?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h={key:"legend",type:"legend-cat",dock:r,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:i?"rtl":"ltr",size:"top"===r||"bottom"===r?2:1,vertical:"top"===r||"bottom"===r?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:c,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(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return rw(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,i=t&&t.isRtl;let r=t.dock||"auto";"auto"===r&&(r=t.chartHeight<t.chartWidth?i?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=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:r,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(i?"right":"left"),major:{invert:"left"===r||"right"===r||i},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return rw(!0,{},d,e)}(t,n);case"x-axis":return Oq.xAxis(t,n);case"y-axis":return Oq.yAxis(t,n);case"x-axis-title":return Pq.xAxisTitle(t,n);case"y-axis-title":return Pq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"grid.line.major","color");return rw(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:i},minorTicks:{stroke:i}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return rw(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),r=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return rw(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:r,text:{fill:i},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return rw(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,i=t.theme.getStyle(n,"label.value","color"),r=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(r),align:.5,labels:[{placements:[{position:"outside",fill:i,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:jq}]}}}]}};return rw(!0,{},o,e||{})}(t,n);default:return}}function Vq(e){this.options=e||{},this.settings={dockLayout:{layoutModes:zq()},components:[],scales:{}}}Vq.prototype.addComponent=function(e,t,n){const i=Bq(e,t,rw(!0,{},this.options,n||{}));return this.settings.components.push(i),i},Vq.prototype.addInteraction=function(e,t){const n=Bq("interaction",e,rw(!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 i=Bq(e,t,rw(!0,{},this.options,n||{}));this.settings.scales[i.name]=i.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");Aq(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=Bq;const $q={CENTER:0,BOTTOM:1};var Wq={DISCLAIMERS:[{label:"NoDataExist",alignment:$q.CENTER,default:!0},{label:"RequireNumericDimension",alignment:$q.CENTER,default:!1},{label:"OnlyNanData",alignment:$q.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:$q.CENTER,default:!1},{label:"LimitedData",alignment:$q.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:$q.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:$q.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:$q.BOTTOM,default:!1}],ALIGNMENT:$q};const Uq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,i=!1;var r;return e?void 0!==t.explicitLimitedData?i=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?i=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(r=e.qStackedDataPages)&&r[0]&&r[0].qData[0]&&r[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,i=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):i=!0===t.explicitLimitedData,i},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 i,r,o,s,a;for(e&&(r=!(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))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=0;i<n;i++)if(s=Math.min(s,t[i].qMin),a=Math.max(a,t[i].qMax),s<=0&&a>=0)return!0;return s=r?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},i={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Wq.DISCLAIMERS.forEach((e=>{i[e.label]=!1})),t&&t.qHyperCube?(i.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),i.NoDataExist?i:(i.RequireNumericDimension=n.explicitRequireNumericDimension,i.RequireNumericDimension||(i.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),i.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),i.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),i.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),i)):i}};function Yq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Xq(e,t){return e&&t&&t[e]}function Kq(e){this.environment=e,this.clear()}Yq.prototype.isValidAndSupported=function(e,t){return Xq(e.label,this.dataAttributes)&&(e.default||Xq(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((i=>{n.isValidAndSupported(i,e)&&(t=!0)})),t},Yq.prototype.getMessage=function(e,t){let n="";const i=this;return t&&this.disclaimersConfig.forEach((r=>{i.isValidAndSupported(r,e)&&(n+=`${t.get(`Object.Disclaimer.${r.label}`)} `)})),n},Kq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Kq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Kq.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,i=rw(!0,{},this.vizAttributes.supportedDisclaimers),r=new Yq(Wq.DISCLAIMERS,this.dataAttributes,i);let o,s;if(r.isAnyValidDisclaimer(Wq.ALIGNMENT.CENTER))o=r.getMessage(Wq.ALIGNMENT.CENTER,n),s="center";else{if(!r.isAnyValidDisclaimer(Wq.ALIGNMENT.BOTTOM))return;o=r.getMessage(Wq.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},Kq.prototype.set=function(e){if(this.clear(),!e)throw new Error(Kq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Uq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Kq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Gq=Mx.extend({init(e,t,n,i,r){this.$element=t,this.environment=n,this.backendApi=i,this._selectionsApi=r,this._on=!1,this._disclaimer=new Kq(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 i,r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,i=Math.floor(1e4/e);r={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,i):i}}else r={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};i="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([r],null,t).then((e=>{t[i]=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),i=this.createChartSettings(this.layout);n?i.components=[t]:t&&i.components.push(t),Vq.validateComponentKeys(i.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,i),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=rw(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var i,r;const o=null!==(i=null===(r=this.environment.appLayout)||void 0===r?void 0:r.qLocaleInfo)&&void 0!==i?i:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Rb(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,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 Jq(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 Zq={generateHash:function(e){return Jq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Zq.generateHash(t)}};const Qq={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:tM(t),dimensionExpressions:eM(t),measureExpressions:e})))}};function eM(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function tM(e){const t=function(e){return Rb(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const nM={},iM=rw.bind(null,!0);function rM(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const oM=Array.isArray,sM=function(e){return void 0===e};function aM(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function lM(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach(((t,r)=>{r!==n.length&&(i=+t,e[i||t]=sM(e[i||t])?Number.isNaN(+i)?{}:[]:e[t],e=e[i||t])})),e}function cM(e,t){if(rM(e)&&rM(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!cM(e[n],t[n]))return!1;return!0}if(oM(e)&&oM(t)){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!cM(e[n],t[n]))return!1;return!0}return e===t}nM.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach((r=>{const o=function(e){return e&&(e=iM({},{val:e}).val),e}(t[r]),s=e[r],a=`${n}/${r}`;cM(o,s)||aM(t,r)||(sM(s)?i.push({op:"add",path:a,value:o}):rM(o)&&rM(s)?i=i.concat(nM.generate(s,o,a)):oM(o)&&oM(s)?i=i.concat(function(e,t,n){let i=[];const r=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&sM(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(cM(t,r))return i;if(null===t[0]||!sM(t[0])&&sM(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(o=r.length-1;o>=0;--o)a=l(t,r[o]&&r[o].qInfo&&r[o].qInfo.qId,o),-1===a?(i.push({op:"remove",path:`${n}/${o}`}),r.splice(o,1)):i=i.concat(nM.generate(r[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(r,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(i.push({op:"add",path:`${n}/${o}`,value:t[o]}),r.splice(o,0,t[o])):a!==o&&(i.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),r.splice(o,0,r.splice(a,1)[0]));return i}(s,o,a)):i.push({op:"replace",path:`${n}/${r}`,value:o}))})),Object.keys(e).forEach((r=>{sM(t[r])&&!aM(e,r)&&i.push({op:"remove",path:`${n}/${r}`})})),i},nM.apply=function(e,t){t.forEach((t=>{const n=lM(e,t.path);let i=t.path.split("/").splice(-1)[0];const r=i&&Number.isNaN(+i)?n[i]:n[+i]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(oM(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(oM(r)&&oM(t.value)){const e=t.value.slice();r.length=0,r.push.apply(r,e)}else rM(r)&&rM(t.value)?(s=r,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!aM(s,e)&&delete s[e]})),iM(r,t.value)):n[i]=t.value;else if("move"===t.op){const r=lM(e,t.from);oM(n)?n.splice(+i,0,r.splice(+o,1)[0]):(n[i]=r[o],delete r[o])}else"remove"===t.op&&(oM(n)?n.splice(+i,1):delete n[i]);var s}))},nM.clone=function(e){return iM({},e)},nM.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},nM.updateObject=function(e,t){Object.keys(e).length?nM.apply(e,nM.generate(e,t)):iM(e,t)};class uM{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=nM.generate(e,t);return rw(!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,i=await t;if(n.qExtendsId)return;const r=nM.generate(n,i);nM.apply(n,r);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var hM={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 dM={saveDerivedProperties:function(e,t,n,i){if(hM.canModifyHardProperties(t))return e.setProperties(n);return new uM(e).saveSoftProperties(i,n)}};var fM={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function pM(){this._generationInProgress=!1}function mM(e){fM.validate(e);const t=e.properties,n=Zq.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}pM.prototype.isDerivedUpToDate=mM,pM.prototype.updateDerivedProperties=function(e){if(fM.validate(e),this._generationInProgress)return Promise.resolve(!0);if(mM(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,i=e.layout,r=rw(!0,{},e.properties),o=rw(!0,{},r);return this._generationInProgress=!0,Zq.updateHash(r,e.hashData),e.generateDerivedProperties(i,r).then((()=>dM.saveDerivedProperties(n,i,r,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},pM.prototype.addDefaultHyperCubeHash=function(e,t,n,i){return Qq.getDefaultHashDataForHyperCube(e,t,n).then((e=>rw(!0,i,e)))};var gM={},yM={get exports(){return gM},set exports(e){gM=e}};!function(e,n){e.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}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){i(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 i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=f(a,n),a!==(r=f(t,n))&&(p&&r&&(h(r)||(o=u(r)))?(o?(o=!1,s=i&&u(i)?i:[]):s=i&&h(i)?i:{},d(a,{name:n,newValue:e(p,s,r)})):void 0!==r&&d(a,{name:n,newValue:r}));return a};function m(e,t,n){if(!e)return-1;const i=n.cache,r=e.origin?e.origin():null;r&&(e=r);let o=i.fields.indexOf(e),s=-1,a=-1;if(-1===o)for(let t=0;t<i.wrappedFields.length;t++)if(a=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==a||-1!==s){o=t;break}return o-=t.qArea.qLeft,o<0||o>=t.qArea.qWidth?-1:a>=0?e=>e[o].qAttrDims.qValues[a]:s>=0?e=>e[o].qAttrExps.qValues[s]:e=>e[o]}function g(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function y(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:h}=e,d=i;if(r.field&&r.field!==n){const e=m(r.field,s,{cache:t});if(-1===e)return;d=p({qRow:a},e(l))}u[h]=g(r,d,{key:c})}function v(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n});if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),M=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(M[h[e]]=[]);for(let o=0;o<r.length;o++)y({cache:n,f:l,mainCell:q,p:r[o],prop:h[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:i.fields?M[h[e]]:M,targetProp:i.fields?o:h[e]});if(i.fields){const t=M[h[e]].map((e=>e.value)),n=M[h[e]].map((e=>e.label));M[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(M[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:q,obj:M,target:b,tracker:v,trackType:f}),x.push(M)}}}const w=d?i.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function q(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this}function M(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function D(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function S(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))}function _(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function C(e){for(var t=this,n=k(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function k(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function I(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}function N(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,i,r,o,s,a=new j(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new j(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(z)}function O(){return N(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function z(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}j.prototype=N.prototype={constructor:j,count:x,each:w,eachAfter:M,eachBefore:q,find:D,sum:S,sort:_,path:C,ancestors:E,descendants:A,leaves:T,links:I,copy:O,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function X(){var e,t=U,n=Y;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>K(e(t,n,i)))),n=t.map(G),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new j(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(z),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=H(e),i):t},i.parentId=function(e){return arguments.length?(n=H(e),i):n},i.path=function(t){return arguments.length?(e=H(t),i):e},i}function K(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=Z(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=Z(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Q(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Q(e[r].children,t-1,n)]);return i}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,i-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,ie=/^\/?qMeasureInfo\/(\d+)/,re=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(r=!0,o=+ne.exec(h)[1],h=i.replace(ne,"")),ie.test(h)&&("K"===n.qMode?c=+ie.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ie.exec(h)[1],u=0):u=+ie.exec(h)[1],h=h.replace(ie,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:re.exec(h)&&(s=+re.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,i,r=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function ue(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function he(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const de=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=Z(i,e);return o&&o[0]?(t.tree=N(o[0],n.children||(e=>e[r])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],i=se(e),r=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>i.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const i=t[e];let r="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=i[o[e]],s="".concat(r,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:r,qValues:[]},t),c=!0),r=s}if(c)for(let e=0;e<s.length;e++){const t=i[s[e]];a[r].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=X().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,i,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=i.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=i.fields[e]}const{props:l,main:u}=r.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o,cache:i}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:i,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,i=c[h[e].depth].main,r=u[e],o=r.data,a=ue(i,o,{key:s});he({propsArr:t,props:n,item:r,itemData:o,ret:a,sourceKey:s,isTree:!0}),h[e].data=a}return a}function ge(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),{props:u,main:h}=i.normalizeConfig(r[s],t),d=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!r[s].trackBy,v=typeof r[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?i.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}function ye(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 ve=ye((function(e){
|
|
41
43
|
/*! 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=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)/,""),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=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+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 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,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=kt,_t.selections=kt,_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 SM={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}},kM=/^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 SM[h.toLowerCase()]?(n=h.toLowerCase(),f=SM[n].r,d=SM[n].g,p=SM[n].b,m="number"==typeof SM[n].a?SM[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)&&(kM.test(e)||_M.test(e)||CM.test(e)||EM.test(e)||AM.test(e)||TM.test(e)||SM[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),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:_y(_y({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:D?fb(D):void 0})},k=cb({picasso:o,model:a,app:s,translator:l,auto:q});!1!==q&&k.auto((function(e){return q?q({layout:e,defaultAuto:mb}):mb(e)}));var _=!1;return{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:_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(S,t);return k.config(n),k.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:Sy,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])}}}}));
|
|
44
|
+
!function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,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,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.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]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+x}}))}));function be(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const xe={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"},we=/%\)?$/,qe=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,De=/^\(dec\)/i,Se=/^\(hex\)/i,_e=/^\(bin\)/i,Ce=/^\(rom\)/i,ke=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ee=/#|0/g;function Ae(e,t,n,i){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(".",i||".")}function Te(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}function Ie(e,t,n){let i;return qe.test(t)?e=Ae(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=Ae(e,8,t,n):De.test(t)?e=Ae(e,10,t,n):Se.test(t)?e=Ae(e,16,t,n):_e.test(t)?e=Ae(e,2,t,n):Ce.test(t)&&(i="",e<0&&(i="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?i+(e=Te(e,t)):t+i+e.toExponential(0)),e}function Re(e,t,n){const i=be(e);return n?i:new RegExp(i||"",t)}function Ne(e,t){return t&&(t=be(t)),e&&(e=be(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Oe(e,t){if(!e||!e.qNumericalAbbreviation)return xe;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Pe(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;i&&(e.abbreviate=!0),d=Ne(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ee)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=we.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Le{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=Oe(e,this.patternSeparator),this.prepare()}clone(){const e=new Le(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});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:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],ke.test(e[0])&&(i.positive.isFunctional=!0),e[1]?ke.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?ke.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Pe(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Pe(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Pe(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Ie(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.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(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Le(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return s=r(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=r(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function je(e,t,n,i,r){const o=Fe(r,e,t,n,i),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const He={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ve=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$e=["January","February","March","April","May","June","July","August","September","October","November","December"],We=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ue=86400;function Ye(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ke(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ge(e){const t=e,n=24*Ke(t),i=60*Ke(n),r=60*Ke(i),o=1e3*Ke(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}function Je(e,t){let n,i=Ge(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ue*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}function Ze(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ye("".concat(t.year).slice(-2),2),YYY:Ye("".concat(t.year).slice(-3),3),def:e=>Ye("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ye("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ye("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ye("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ye("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ye("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ye("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class Qe{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Be,qDayNames:Ve,qLongMonthNames:$e,qMonthNames:We}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[He.TIME]:i.qTimeFmt||"hh:mm:ss",[He.DATE]:i.qDateFmt||"YYYY-MM-DD",[He.DATE_TIME]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Qe(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Je(e,t));const r=Ze(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return a}}function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qe(...t)}const tt=864e5;function nt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(tt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=et(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==He.INTERVAL?nt(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=et(r,e,t),i=ze(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function rt(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),je(n,i,r,o,t)}function ot(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=rt(t,r),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function st(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:ot(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=st("qAttrDimInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=st("qAttrExprInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=st("qMeasureInfo",t,n,s,p({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function at(){let{key:e,data:t,config:i={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=at.util,a={cache:r,cube:o,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,l,r,s),hierarchy:e=>a.hierarchy(e,l,r,s),_cache:()=>r};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,r,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...st("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),r.wrappedFields.push(...st("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const h=e=>{e.forEach((e=>{r.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)}))};return h(r.wrappedFields),(i.virtualFields||[]).forEach((t=>{const i=l.field(t.from),o=ot(n({meta:i.raw(),id:"".concat(e,"/").concat(t.key),sourceField:i,fieldExtractor:e=>a.extractor({field:e},l,r,s),key:t.key,type:i.type(),localeInfo:a.localeInfo,value:i.value},t.override||{}));r.virtualFields.push(o)})),r.allFields.push(...r.virtualFields),l}const lt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ct=/\/qDimensionInfo(?:\/(\d+))?/,ut=/\/qMeasureInfo\/(\d+)/,ht=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dt=/\/qAttrExprInfo\/(\d+)/,ft=/\/?qHyperCube/,pt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),gt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function yt(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;ft.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):pt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=gt);let a=!0;if(ct.test(e)&&(i=+ct.exec(e)[1]),ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)){r=-1,i=0;const e=+ht.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(dt.test(e)){const e=r;if(t){r=0;const s=Z(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+dt.exec(n)[1]}else i>-1?(i=-1,r=+dt.exec(n)[1]):r+=+dt.exec(n)[1]+1}return lt.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=yt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>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){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>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){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>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(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function bt(e){at.util=e.data("matrix").util,e.data("q",at),e.formatter("q-number",je),e.formatter("q-time",it)}return bt.qBrushHelper=vt,bt.selections=vt,bt}()}(yM);var vM=gM;const bM={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let i=[];n.length&&n.forEach((e=>{i=i.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return i.concat(t)},filterValues:function(e,t){const n=this;let i,r;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(r=function(e,t){const n=t.key.indexOf("qHyperCube")+"qHyperCube".length,i=t.key.substr(0,n),r=t.key.substr(n+1);return e.dataset(i).field(r)}(e,t),i=r&&r.raw(),i.qLocked?(o.push(i),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const xM={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function wM(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,i=e.dataPaths||[""],r=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function i(){}return i.update=function(e,i,r){t.isActive()||t.begin(n),vM.qBrushHelper(r).forEach((e=>{t.select(e)}))},i.toggleValues=function(i,r,o){const s=bM.brushInterceptors.filterValues(e,i),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),r.start(),r.emit("update",[],[])),a},i}(t,n,r),u={};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(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function m(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=rw(!0,{},xM,e),r={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},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const r=function(){const e=[];let n=i.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&&r.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:r,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),s.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)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=i.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class qM{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var MM={create:e=>e.selectionsApi?wM(e):new qM};var DM={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 SM={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:ty.DIRECTION_ALL,threshold:1,enable(i,r){if(e.lassoing)return t.isSelectionEnabled();const o=DM.isOnComponentForLasso(r,n,this);return t.isSelectionEnabled()&&r&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(i){DM.isOnComponentForLasso(i,n,this)&&(t.switchTo("lasso",this.chart,i),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",i))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(i){e.lassoing&&(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(i){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",i),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var _M={callMeasureRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_HORIZONTAL:ty.DIRECTION_VERTICAL,event:"measurerange",enable(r,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(r){const o="measurerange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,r),t.doEmit(this.chart,"rangeMeasure","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(i){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",i),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function CM(e,t){let n;return n="x-axis"===e?"horizontal"===t?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL:"horizontal"===t?ty.DIRECTION_HORIZONTAL:ty.DIRECTION_VERTICAL,n}var kM={callAreaRangeGesture:function(e,t,n,i){const r=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:CM(i,n.isHorizontal),event:"arearange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(r){const o="arearange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,r),t.doEmit(this.chart,"rangeMinor","areaStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(i){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",i))},arearangeend(i){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",i),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var EM={callDimensionRangeGesture:function(e,t,n,i){const r=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL,event:"majorrange",enable(r,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i],a=DM.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${r}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(r){const o="majorrange"===n.active.gesture?[i,n.keys.componentKey]:[i];DM.isOnComponentForRange(r,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,r),t.doEmit(this.chart,"rangeDim","rangeStart",r),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(i){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",i),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var AM={callDragGesture:function(e,t,n,i,r){let o={};return{type:"Pan",options:{direction:n.isHorizontal?ty.DIRECTION_VERTICAL:ty.DIRECTION_HORIZONTAL,event:"drag",enable(i,r){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!r&&!!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:i?`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&&r&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let i=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&r&&(i=-i),n.handlers.scrollHandler.getScrollApi().move(i),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var TM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,i){return!(!i||!e())&&DM.isOnComponentForNavBtn(i,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,i=n?n.getAttribute("data-action"):"";if(i)return t.emit(i)}))}}}}};var IM={create:function(e,t,n,i,r){const o={};t=t||"vertical";const s=i.lassoBrushKey||"select",a=i.dimRangeBrushKey||null,l=i.measureRangeBrushKey||null,c=i.areaBrushKey||null,u=i.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 i=s;const r=t||f.chart;switch(f.gesture){case"majorrange":v(r,"rangeDim","rangeClear",n),i=a;break;case"measurerange":v(r,"rangeMeasure","rangeClear",n),i=l;break;case"arearange":v(r,"rangeMinor","areaClear",n),i=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&r.brush(i).clear(),f.chart=t,f.type=o}function v(e,t,n,i){if(e){const r=e.component(t);r&&r.emit(n,i)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:i,isHorizontal:p,active:f,rangeSelStatus:r};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(TM.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(SM.callLassoGesture(d,x,w)),a?l?(b.push(EM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(_M.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(EM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(kM.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(_M.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(kM.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(AM.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 RM(e,t,n,i,r){let o=!1;i=i||"tooltip",n=n||["self"];const s=e.brush(i),a={};function l(){if(o){e.component(r).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(i,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(r).emit("show",{},n)}(c)):l()},a.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},a}var NM={create:(...e)=>RM(...e)},OM={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 PM=e=>({h:t,data:n,style:i})=>{const r=function(e,t){const n=e.chartInstance.dataset(e.dataPath),i=[],r=t.length-5,o=Math.min(5,t.length);for(let r=0;r<o;r++){const o=t[r],s={rows:[]};if(e.labelData){const t=[],r=e.labelData;let a=!1;for(let e=0;e<r.length;e++){const n=o.data[r[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[r[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const i=o.data;return e.rowResolver(n.field(i[t].source.field),i[t],i)})).filter((e=>!!e));const l=LM(e,o);l&&s.rows.unshift(l),i.push(s)}}r>0&&(i.numberInExcess=r);return i.rowCount=i[0]?i.length*i[0].rows.length:0,i}(e,n),o={h:t,style:i,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,r)};function LM(e,t){var n,i,r;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(i=n.getSettings)||void 0===i?void 0:i.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.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}(a),{translator:c}=e,u=s.label;return{color:null===(r=t.attrs)||void 0===r?void 0:r.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const FM="dist-flow-tooltip",zM=`#${FM}`;function jM(){if(!document.querySelector(zM)){const e=document.createElement("div");e.id=FM,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 HM({key:e="tooltip",rtl:t,fontFamily:n,filter:i,content:r}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){jM()},beforeUpdate(){jM()},destroyed(){!function(){const e=document.querySelector(zM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(zM),content:r,filter:i,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:BM}=Cq;const VM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:OM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:i,translator:r,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...i.cell,textAlign:a,fontWeight:"bold",direction:BM(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const i={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},r=n("div",{style:i});t=o?[e.value,r]:[r,e.value]}const r=o?[":",e.label]:[e.label,":"],l={...i.cell,textAlign:a,direction:BM(e.label)},c={...i.cell,textAlign:o?"left":"right",direction:BM(e.value)};s.push(n("tr",null,n("td",{style:l},r),n("td",{style:c},t)))}))})),t.numberInExcess){const e=r.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...i.cell,textAlign:a,direction:BM(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function $M(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let i={},r=!1;const o={};function s(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 a(){Object.keys(i).forEach((e=>{l(i[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 c(){Object.keys(i).forEach((e=>{i[e].action.closeTooltip()}))}function u(){c();for(const e in i)i[e].brush.clear()}return o.setUp=function(t){const o=rw(!0,{},VM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");i[o.contexts[0]]&&r&&l(i[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:NM.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);i[o.contexts[0]]=a,r&&s(a);const c=HM({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:PM(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){r&&a(),i=[]},o.closeTooltip=c,o.isOn=()=>r,o.on=function(){r||(r=!0,Object.keys(i).forEach((e=>{s(i[e])})),t&&t.on("mouseleave",u))},o.off=function(){r&&(r=!1,a(),t&&t.off("mouseleave",u),c())},o}var WM={create:(e,t,n)=>$M(e,t,n)};const UM=".scrollHandler";function YM(e,t,n,i,r){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=i,this._legendKey=r}function XM(){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 KM(e){const t=function(e){let t=0,n=0,i=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),i=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(i=0,n=-1*t),void 0!==e.wheelDeltaY&&(i=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:i,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,i){if(i&&n.componentsFromPoint(t).some((e=>e.settings.key===i)))return n.component(i).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 GM(){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=>{}))}YM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},YM.prototype.setDisabled=function(e){this._disabled=e},YM.prototype.getDisabled=function(){return this._disabled},YM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,XM.call(this))},YM.prototype.getItemSize=function(){return this._itemSize},YM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||XM.call(this);return this._scrollViewSizeInItem},YM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",GM.bind(this)));this._$chartElement.on(`mousewheel${UM} DOMMouseScroll${UM}`,KM.bind(this)),this._$chartElement.on(`touchstart${UM}`,(e=>{e.preventDefault()})),this._on=!0},YM.prototype.isOn=function(){return this._on},YM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(UM),this._on=!1},YM.prototype.updateViewState=function(e){XM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},YM.prototype.onResize=function(){this._sizeChanged=!0,XM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},YM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},YM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},YM.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)},YM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},YM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},YM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};function JM(e){return(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11}function ZM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const r=t+n+i;return{latin:e.length-r,cjk:r}}function QM(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=ZM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const i=ZM(e[t].qText);n.latin+=i.latin,n.cjk+=i.cjk}));const i=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/i,n.cjkRatio=n.cjk/i,n}function eD(e,t,n){return e*(e<=24?t:n)}var tD={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:JM,getCharacterRatios:ZM,getTotalCharacterRatios:QM,getAdjustedMaxGlyphCount:function(e,t,n){const i=QM(t,n),r=i.latinRatio*e,o=i.cjkRatio*e;return Math.ceil(JM(r)+1.0909090909090908*o)},estimateLatinLabelWidth:eD,estimateLabelWidth:function(e,t,n,i,r){return e*n+eD(t,i,r)}};const nD={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}},iD=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,rD=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,oD=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,sD=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,aD=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,lD=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,cD=Math.floor,uD=Math.round,hD=Mx.extend({init(){let e,t,n,i,r,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof hD)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],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^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(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[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<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),m=parseFloat(u[7]),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<=.5?2*i*t:(2-2*i)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[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*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=uD(255*d),f=uD(255*f),p=uD(255*p),m=1}else nD[h.toLowerCase()]?(n=h.toLowerCase(),d=nD[n].r,f=nD[n].g,p=nD[n].b,m="number"==typeof nD[n].a?nD[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=cD(d),this._g=cD(f),this._b=cD(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=hD.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=hD.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=hD.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=hD.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=hD.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=hD.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=hD.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=hD.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),i=parseFloat(n[1]),r=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${i},${r},${o},${s})`},isEqual(e){return e instanceof hD||(e=new hD(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[cD(this._r+(e._r-this._r)*t),cD(this._g+(e._g-this._g)*t),cD(this._b+(e._b-this._b)*t),cD(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,i=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new hD(i)}});hD.toRGB=function(e){if(e instanceof hD)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=hD.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},hD.toRGBA=function(e,t){if(e instanceof hD)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=hD.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},hD.toHex=function(e){let t,n,i;return e instanceof hD?(t=e._r.toString(16),n=e._g.toString(16),i=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${[t,n,i].join("")}`):("string"==typeof e&&(e=hD.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),i=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===i.length&&(i=`0${i}`),`#${t}${n}${i}`)},hD.toHSL=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new hD(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(r=c-u,n=i>.5?r/(2-c-u):r/(c+u),c){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsl(${360*o},${100*n},${100*i})`},hD.toHSLA=function(e,t){let n,i,r,o=0;"string"==typeof e&&(e=new hD(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(i=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(r=u-h,n=i>.5?r/(2-u-h):r/(u+h),u){case s:o=(a-l)/r+(a<l?6:0);break;case a:o=(l-s)/r+2;break;case l:o=(s-a)/r+4}o/=6}return`hsla(${360*o},${100*n},${100*i},${c})`},hD.toHSVComponents=function(e){let t,n,i=0;"string"==typeof e&&(e=new hD(e));const r=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(r,o,s),l=Math.min(r,o,s),c=a;if(a===l)t=0,i=0;else{switch(n=a-l,t=0===n?0:n/c,a){case r:i=(o-s)/n+(o<s?6:0);break;case o:i=(s-r)/n+2;break;case s:i=(r-o)/n+4}i/=6}return{h:360*i%360,s:100*t,v:100*c}},hD.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof hD)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,i=0,r=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),i=parseInt(e[2],10),r=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),i=parseInt(e[2],16),r=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16))),(n<<16)+(i<<8)+r},hD.blend=function(e,t,n){const i=(16711680&(e=hD.toNumber(e)))>>16,r=(65280&e)>>8,o=255&e;return(i+(((16711680&(t=hD.toNumber(t)))>>16)-i)*n<<16)+(r+(((65280&t)>>8)-r)*n<<8)+(o+((255&t)-o)*n)},hD.getBlend=function(e,t,n){const i=e._r+(t._r-e._r)*n,r=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new hD(i,r,o,s)},hD.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(iD.test(e)||rD.test(e)||oD.test(e)||sD.test(e)||aD.test(e)||lD.test(e)||nD[e.toLowerCase()])},hD.getBestContrast=function(e,t,n){const i=e.getLuminance();return Math.abs(i-t.getLuminance())>Math.abs(i-n.getLuminance())?t:n},hD.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,i=t.getLuminance()/100;return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},hD.isDark=function(){const e={getLuminance:hD.prototype.getLuminance,isInvalid:hD.prototype.isInvalid};return hD.prototype.init.apply(e,[].slice.call(arguments)),hD.prototype.isDark.call(e)},hD.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const dD={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 hD(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new hD(e);return 0===t.getAlpha()?this.DARK_GREY:hD.getBestContrast(t,new hD(dD.LIGHT_GREY),new hD(dD.DARK_GREY))},getBestContrast:(e,t,n)=>hD.getBestContrast(new hD(e),new hD(t),new hD(n)),getContrastingTransparent(e){const t=new hD(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function fD(e,t){return Rb(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function pD(e,t){if(Rb(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Rb(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Rb(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return mD(Rb(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function mD(e){return e.qCardinalities.qHypercubeCardinal}var gD={getHyperCube:function(e,t){return e&&(e=t?Rb(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:fD,hasSecondMeasure:function(e,t){return Rb(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:pD,getStackedCubeSizeOfMax2Dims:function(e,t){return fD(e,t)?pD(e,t):function(e,t){return Rb(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return fD(e,t)?pD(e,t):1},getDimensionSize:mD};const yD=function(){this._maxJitter=1};yD.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},yD.prototype.getJitterValue=function(e){const t=Math.abs(Jq(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var vD={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 bD={generateHyperCube:function(e,t,n,i){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=rw(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),Rw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let r=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){r=[kw.create(kw.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Rb(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=r,_w.hasMultipleDimensions(t)?uw.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((r=>{oq.applySorting(t,e,n,r,i);const o=r.dimensions[0],s=r.dimensions[1],a=r.measures[0],l=nq.getFractileExpression(1,o,s,a),c=nq.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const xD=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function wD(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,i=t.some(xD),r=n.some(xD),o=e.color.point.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}function qD({layout:e,localeInfo:t,model:n,picasso:i,environment:r}){const{app:o,theme:s,translator:a}=r,l=rw(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n,i;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(n=t.chartData)&&void 0!==n&&n.legendDataPage||null===(i=e.qUndoExclude)||void 0===i||!i.legendData)}(e)&&(e=function(e){return(e=rw({},e)).snapshotData=rw({},e.snapshotData),e.snapshotData.content=rw({},e.snapshotData.content),e.snapshotData.content.chartData=rw({},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,i,r,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?Ib: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==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),S={theme:x,key:v,localeInfo:y,layout:D,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:ay(ay({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:D?kb(D):void 0})},_=_b({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto((function(e){return q?q({layout:e,defaultAuto:Tb}):Tb(e)}));var C=!1,k={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(M)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return C},custom:ay({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:kb}),n=Eb(S,t);return _.config(n),_.getAuxiliarySettings(M).then((function(){C=!0}))}};return k}({app:o,model:n,picasso:i,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:wD(e)}})})}const MD=Dw.DATA_PATH,DD=Dw.HYPERCUBE_PATH,SD=Dw.HYPERCUBE_DEF_PATH;function _D(e){return Array.isArray(e)?e:e?[e]:[]}function CD(e){return Math.min(gD.getOuterDimensionSizeOfMax2Dims(e,MD),Dw.MAX_STACKED_VALUES)}function kD(e,t){return{viewSize:t,max:CD(e)}}function ED(){const e=Dw.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function AD(){if(this.layout&&gD.hasSecondDimension(this.layout,MD)){this._scrollHandler.onResize();!!this.layout.snapshotData||ED.call(this)}}function TD(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function ID(e,t){return Rb(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const RD=Gq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:i,$element:r,backendApi:o,selectionsApi:s}){this._super(i,r,t,o,s),this.flags=n,this.picasso=i,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new pM,this._selectionHandler=MM.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=WM.create(this.chartInstance,r,Dw.CHART_ID),this._scrollHandler=new YM(this.chartInstance,r,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=Dw.BUBBLE_SCALES_MAX,this._jitterTool=new yD,this.setDataPaths([`${MD}/${DD}`])},onScrollCallback(e,t,n){const i=this;this._updateColorMapData(e).then((()=>{i.updateChart(e,t,n)}))},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[MD][DD],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!gD.hasSecondDimension(this.layout,MD)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,i=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[i?"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(Dw.MAX_POINT_BASE_SIZE_PX,t*Dw.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(Dw.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=_D(t.trigger),i=_D(t.consume),r=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=tD.getAdjustedMaxGlyphCount(function(e){const t=e[MD][DD].qDimensionInfo,n=gD.hasSecondDimension(e,MD)?t[0].qApprMaxGlyphCount:0;return Math.min(Dw.MAX_GLYPH_COUNT,n)}(this.layout||e),e[MD][DD].qStackedDataPages[0].qData[0].qSubNodes),s=r/4;return{brush:{trigger:n,consume:i},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,i=e.color.point.auto?n.getStyle(Dw.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),r=_D(t.trigger),o=_D(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";gD.hasSecondDimension(e,MD)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:i,stroke:n.getStyle(Dw.CHART_ID,"box","stroke"),strokeWidth:0,width:Dw.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:Dw.MAX_POINT_BASE_SIZE_PX,minWidthPx:Dw.MIN_POINT_PIXELS+2*Dw.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*Dw.JITTER_PARAMETER);const i=s._pointMaxSizePx+n+2*Dw.BOX_PADDING,r=i/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,i),this.settings.settings.box.width=r},brush:{trigger:r,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return gD.hasSecondDimension(e,MD)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let i=1;e.dataPoint&&!1===e.dataPoint.border&&(i=0);const r=_D(t.trigger),o=_D(t.consume);this._tooltipHandler.isOn()&&(r.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return dD.getContrastingTransparent(t)},size:.3,strokeWidth:i,sizeLimits:{maxRelExtent:10,maxPx:Dw.MAX_POINT_BASE_SIZE_PX,minPx:Dw.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*Dw.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,Dw.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:r,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 gD.hasSecondDimension(e,MD)&&(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([`${MD}/${DD}`]),l},_getPointSelectionLayerSettings(e){const t=rw(!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,i=!!e.snapshotData,r=e.presentation&&e.presentation.visibleComponents,o=r&&-1!==e.presentation.visibleComponents.indexOf("point"),s=r&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[MD][DD],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=Vq.create({chartID:Dw.CHART_ID,theme:n,isRtl:t});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&gD.hasSecondDimension(e,MD);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:ID(e,0)},!0),i=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:ID(e,1)},!0),r=this._selectionHandler.setUpBrush({dataPath:MD,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:rw(!0,{},i.trigger,{data:[""]}),consume:[rw(!0,{},i.consume,{data:[""]})]},f={trigger:t?i.trigger:null,consume:[n.consume,i.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,i.consume,s.consume,r.consume]},m={trigger:[rw(!0,{},r.trigger,{data:[""]})],consume:[rw(!0,{},r.consume,{data:[""]}),n.consume,i.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:gD.hasSecondDimension(e,MD)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${DD}/qDimensionInfo/${gD.hasSecondDimension(e,MD)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:gD.hasSecondDimension(e,MD)?["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 i={};return 1===e.length?(i.isOpenDim=!1,e[0]?i.isOpenMea=!1:i.isOpenMea=!0):e[0]&&!e[1]?(i.isOpenDim=!1,i.isOpenMea=!0):!e[0]&&e[1]?(i.isOpenDim=!0,i.isOpenMea=!1):e[0]&&e[1]?(i.isOpenDim=!1,i.isOpenMea=!1):(i.isOpenDim=!0,i.isOpenMea=!0),t&&(i.isOpenMea=!1),n&&(i.isOpenDim=!1),i}(y,ID(e,0),ID(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=IM.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:gD.hasSecondDimension(e,MD),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!i,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:kD(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:s?"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,axisTitleStyle:qw(Dw.CHART_ID,n,e,this.flags),axisLabelStyle:Mw(Dw.CHART_ID,n,e,this.flags)}),s){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[c]={field:"qMeasureInfo/0"},n.settings[c]={scale:"measure"},gD.hasSecondDimension(e,MD)&&(n.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},n.settings[u]={scale:"dimension"}),this._jitter){n.settings[u]=n.settings[u]||{};const e=this._jitterTool;n.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,Dw.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 i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},r=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:o}=r;o=o.filter((e=>!!e)),o.length>0&&(this._selectionHandler.isOn()&&(o[0].brush={consume:n.consume.map((e=>rw(!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(...r.interactions)},resize(){this.layout&&(AD.call(this),this._super())},hasValidData(){const e=this.layout;return e[MD]&&e[MD][DD]&&e[MD][DD].qStackedDataPages.length&&e[MD][DD].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&&(AD.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,i=this._super;return!e&&gD.hasSecondDimension(t,MD)&&this._scrollHandler.isDataSizeChanged(Rb(t,`${MD}.${DD}.qStackedDataPages.0.qData.0.qSubNodes.length`),gD.getOuterDimensionSizeOfMax2Dims(t,MD))?this._scrollHandler.getViewData().finally((()=>n._updateColorMapData(t).then((()=>i.call(n))))):this._updateColorMapData(t).then((()=>i.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[MD][DD].qStackedDataPages=this.layout[MD][DD].qStackedDataPages,vD.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!gD.hasSecondDimension(e,MD)&&e.qHyperCube.qSize.qcy>1e4||gD.hasSecondDimension(e,MD)&&e.qHyperCube.qSize.qcy>3e3,i=t&&n,r=kD(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&i},options:{paddingBottom:i&&r&&r.viewSize<r.max,supportNegative:!0,explicitLimitedData:i}}},async _updateColorMapData(e){this.colorService=qD({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",`${MD}/${DD}/${t}`)},_createColorLegendCube(e){const t=gD.hasSecondDimension(this.layout,MD)?1:0;return{qDimensionInfo:[this.layout[MD][DD].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:i}=this.environment,r=this,o=r.backendApi.model;return r._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[SD],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>bD.generateHyperCube(e,t,n,i)};return r._derivedProperties.updateDerivedProperties(a)}))},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 vD.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:i}=t.environment.options;let r;return i?(t._scrollHandler.updateViewState(CD(e)),t._scrollHandler.setScrollState(i.scroll)):(t._scrollHandler.resetScroll(),TD.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(ED.call(t),t._cacheSizeInitialized=!0),r=gD.hasSecondDimension(e,MD)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[MD][DD],{height:e[MD][DD].qSize.qcy||1}),r.then((()=>t._destroyed?Promise.reject():t._updateColorData()))}))},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&ID(e,0))}}),ND={enabled:!0,delay:50};function OD(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class PD{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=rw(!0,{},ND,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(),i={data:e,dfd:OD(),wrapper:OD(),requestedAt:n},r=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>r,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?LD.apply(this,[i,0]):LD.apply(this,[i,Math.min(t,1e3)]),this.recentRequests.push(i),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),i.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 LD(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{FD.call(n)}),t):FD.call(n)}function FD(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&zD.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function zD(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&&FD.call(t)})),this.onSend(e.data,n)}const jD=new Dx(0,0,0,0),HD=new Dx(0,0,0,0);class BD{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 i=this.pages[n].qArea;jD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),HD.set(i.qLeft,i.qTop,i.qWidth,i.qHeight);const r=HD.intersection(jD,!0);if(t.push({coverage:r?r.clone():new Dx(0,0,0,0),idx:n}),i.qLeft<=e.qLeft&&i.qLeft+i.qWidth>=e.qLeft+e.qWidth&&i.qTop<=e.qTop&&i.qTop+i.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){jD.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),HD.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=jD.intersection(HD,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const i=Math.max(0,e.qTop-t.qArea.qTop),r=t.qData[0],o=r.qSubNodes,s={};for(const e in r)r.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(i,i+n.height):r[e]);return s.qUp+=i,s.qDown+=t.qArea.qHeight-n.height-i,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const VD={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},$D=Mx.extend("CacheCube",{init(e,t,n,i){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(i||{}),this.setPath(n),"K"===this.options.mode?this.cube=new BD:"P"===this.options.mode?this.cube=new Nx:this.cube=new Cx,this.throttle=new PD({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map((e=>({top:e.data[0].qTop,left:e.data[0].qLeft})))),i=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(i,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=rw(!0,{},VD,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 i=[];for(t=0;t<e.length;++t)n=e[t],i.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(i)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(i))):0===i[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(i,i)):this.throttle.queue(i)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,i=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:i<0?-1:i>0?1:0}},_getAreasToCache(e,t,n){let i,r,o,s,a,l,c,u,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))),i=0;i<e.length;++i)r=0!==t?Math.floor(.5*Math.max(0,f-e[i].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[i].qWidth)):0,s=r*t-r,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[i].qHeight,f),this.cubeHeight)):e[i].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[i].qWidth,this.cacheWidth),this.cubeWidth)):e[i].qWidth,u=Math.max(0,Math.min(e[i].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[i].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),WD=Dw.DATA_PATH,UD=Dw.HYPERCUBE_DEF_PATH;class YD{constructor(e){this.model=e,this.path=`/${WD}/${UD}`,this.cacheCube=new $D(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:Dw.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:gD.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(s).forEach((t=>{e.add(s[t])}))}}(t.translator);const n=ry();return{qae:Kx(t),ext:mq(t),component(){const i=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),i=e.useDeviceType(),r=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:i,options:r,theme:o,translator:s})),[t,n,r.direction,r.freeResize,s.language(),o.name(),i])}(),s=e.useSelections(),a=e.useStaleLayout(),l=e.useModel(),c=e.useConstraints(),u=function(){const t=e.useConstraints(),[n,i]=e.useState(!1),[r,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&i(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:oy,hidden:!n||!s,active:r,action(){o((e=>!e))}})),[s,r,n]),a.enabled=()=>n,a.active=()=>r,a}(),h=e.useRenderState(),[d,f]=e.useState();e.useEffect((()=>{const e=o(i),c=function(e,t){return t.snapshotData?new Px(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new YD(e)}(l,a),h=s,d=new RD({environment:r,lasso:u,flags:t.flags,picasso:n,$element:e,backendApi:c,selectionsApi:h});return f(d),()=>{d.destroy()}}),[]);const[,p]=e.usePromise((async()=>{if(!d)return;d.updateEnvironment(r),d.updateConstraints(c);if(!!!a.snapshotData){const e=await l.getEffectiveProperties();if(await d.updateDerivedProperties(e,a))return void h.pending();h.restore()}await d.updateData(a),await d.paint()}),[a,d,r]);if(p)throw p;var m;!function(t){const n=e.useRect(),i=e.useOptions(),r=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(r),t.options=i,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
45
|
//# sourceMappingURL=sn-distplot.js.map
|