@nebula.js/sn-distributionplot 0.38.1 → 0.40.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.
@@ -1,43 +1,27 @@
1
1
  /*
2
- * @nebula.js/sn-distributionplot v0.38.1
2
+ * @nebula.js/sn-distributionplot v0.40.0
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- System.register(["@nebula.js/stardust","picasso.js","picasso-plugin-q"],(function(e){"use strict";var t,n,r,i,o,a,s,l,u,c,p,d,f,h,m,g,y,v,b,x,q,D,S;return{setters:[function(e){t=e.useConstraints,n=e.useState,r=e.useLayout,i=e.useEffect,o=e.useAction,a=e.useRect,s=e.useOptions,l=e.usePromise,u=e.useApp,c=e.useAppLayout,p=e.useDeviceType,d=e.useTheme,f=e.useTranslator,h=e.useMemo,m=e.onTakeSnapshot,g=e.useImperativeHandle,y=e.useElement,v=e.useSelections,b=e.useStaleLayout,x=e.useModel,q=e.useRenderState},function(e){D=e.default},function(e){S=e.default}],execute:function(){e("default",(function(e){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(T).forEach((t=>{e.add(T[t])}))}}(e.translator);const C=function(){const e=D();return e.renderer.prio(["canvas"]),e.use(S),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",L(e))};return void e.interaction("hammer",L(Hammer))}(_)),e.use(R),e.component("disclaimer",H),e}();return{qae:Tr(e),ext:Xi(e),component(){const D=y(),S=function(){const e=u(),t=c(),n=p(),r=s(),i=d(),o=f(),a=h((()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o})),[e,t,r.direction,r.freeResize,o.language(),i.name(),n]);return a}(),E=v(),w=b(),A=x(),M=t(),T=function(){const e=t(),[a,s]=n(!1),[l,u]=n(!1),c=!!r().qSelectionInfo.qInSelections,[p]=n((()=>({toggle(){u((e=>!e))}})));return i((()=>{e&&s(!e.select&&!e.active)}),[e]),o((()=>({key:"lasso",label:"Lasso",icon:F,hidden:!a||!c,active:l,action(){u((e=>!e))}})),[c,l,a]),p.enabled=()=>a,p.active=()=>l,p}(),k=q(),[O,L]=n();i((()=>{const t=I(D),n=function(e,t){const n=!!t.snapshotData;if(n)return new yr(t,"qUndoExclude.qHyperCube","qStackedDataPages");return new Is(e)}(A,w),r=E,i=new ms({environment:S,lasso:T,flags:e.flags,picasso:C,$element:t,backendApi:n,selectionsApi:r});return L(i),()=>{i.destroy()}}),[]);const[,N]=l((async()=>{if(!O)return;O.updateEnvironment(S),O.updateConstraints(M);if(!!!w.snapshotData){const e=await A.getEffectiveProperties();if(await O.updateDerivedProperties(e,w))return void k.pending();k.restore()}await O.updateData(w),await O.paint()}),[w,O,S]);if(N)throw N;var P;!function(e){const n=a(),r=s(),i=t(),[,o]=l((async()=>{e&&(e.updateConstraints(i),e.options=r,await e.resize())}),[n.width,n.height]);if(o)throw o}(O),P=O,m((e=>{if(P)return P.setSnapshotData(e)})),g((()=>({getViewState(){if(P)return P.getViewState()}})),[P])}}}));var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,A={},M={get exports(){return A},set exports(e){A=e}};
7
+ System.register(["@nebula.js/stardust","picasso.js","picasso-plugin-q"],(function(e){"use strict";var t,n,r,i,o,s,a,l,u,c,p,d,f,h,m,g,y,v,b,x,q,D,S;return{setters:[function(e){t=e.useConstraints,n=e.useState,r=e.useLayout,i=e.useEffect,o=e.useAction,s=e.useRect,a=e.useOptions,l=e.usePromise,u=e.useApp,c=e.useAppLayout,p=e.useDeviceType,d=e.useTheme,f=e.useTranslator,h=e.useMemo,m=e.onTakeSnapshot,g=e.useImperativeHandle,y=e.useElement,v=e.useSelections,b=e.useStaleLayout,x=e.useModel,q=e.useRenderState},function(e){D=e.default},function(e){S=e.default}],execute:function(){e("default",(function(e){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(T).forEach((t=>{e.add(T[t])}))}}(e.translator),{qae:wn(e),ext:Qr(e),component(){const m=y(),g=function(){const e=u(),t=c(),n=p(),r=a(),i=d(),o=f(),s=h((()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o})),[e,t,r.direction,r.freeResize,o.language(),i.name(),n]);return s}(),C=g.options.renderer,E=h((()=>function(e){const t=D();return t.renderer.prio([e||"canvas"]),t.use(S),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",L(e))};return void e.interaction("hammer",L(Hammer))}(P)),t.use(_),t.component("disclaimer",N),t}(C)),[C]),A=v(),w=b(),T=x(),M=t(),O=function(){const e=t(),[s,a]=n(!1),[l,u]=n(!1),c=!!r().qSelectionInfo.qInSelections,[p]=n((()=>({toggle(){u((e=>!e))}})));return i((()=>{e&&a(!e.select&&!e.active)}),[e]),o((()=>({key:"lasso",label:"Lasso",icon:R,hidden:!s||!c,active:l,action(){u((e=>!e))}})),[c,l,s]),p.enabled=()=>s,p.active=()=>l,p}(),k=q(),[F,B]=n();i((()=>{const t=I(m),n=function(e,t){const n=!!t.snapshotData;if(n)return new mn(t,"qUndoExclude.qHyperCube","qStackedDataPages");return new Hs(e)}(T,w),r=A,i=new Cs({environment:g,lasso:O,flags:e.flags,picasso:E,$element:t,backendApi:n,selectionsApi:r});return B(i),()=>{i.destroy()}}),[]);const[,j]=l((async()=>{if(!F)return;F.updateEnvironment(g),F.updateConstraints(M);if(!!!w.snapshotData){const e=await T.getEffectiveProperties();if(await F.updateDerivedProperties(e,w))return void k.pending();k.restore()}await F.updateData(w),await F.paint()}),[w,F,g]);if(j)throw j;!function(e){const n=s(),r=a(),i=t(),[,o]=l((async()=>{e&&(e.updateConstraints(i),e.options=r,await e.resize())}),[n.width,n.height]);if(o)throw o}(F),H(F)}}}));var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A,w={exports:{}};
8
8
  /*!
9
- * jQuery JavaScript Library v3.6.4
9
+ * jQuery JavaScript Library v3.7.0
10
10
  * https://jquery.com/
11
11
  *
12
- * Includes Sizzle.js
13
- * https://sizzlejs.com/
14
- *
15
12
  * Copyright OpenJS Foundation and other contributors
16
13
  * Released under the MIT license
17
14
  * https://jquery.org/license
18
15
  *
19
- * Date: 2023-03-08T15:28Z
20
- */
21
- w=M,function(e,t){w.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}}("undefined"!=typeof window?window:C,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,p=c.toString,d=p.call(Object),f={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var r,i,o=(n=n||g).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var x="3.6.4",q=function(e,t){return new q.fn.init(e,t)};function D(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!h(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}q.fn=q.prototype={jquery:x,constructor:q,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=q.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return q.each(this,e)},map:function(e){return this.pushStack(q.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(q.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(q.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},q.extend=q.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||h(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(q.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||q.isPlainObject(n)?n:{},i=!1,a[t]=q.extend(u,o,r)):void 0!==r&&(a[t]=r));return a},q.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||p.call(n)!==d))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(D(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(D(Object(e))?q.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,s=[];if(D(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&s.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&s.push(i);return o(s)},guid:1,support:f}),"function"==typeof Symbol&&(q.fn[Symbol.iterator]=n[Symbol.iterator]),q.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var S=
22
- /*!
23
- * Sizzle CSS Selector Engine v2.3.10
24
- * https://sizzlejs.com/
25
- *
26
- * Copyright JS Foundation and other contributors
27
- * Released under the MIT license
28
- * https://js.foundation/
29
- *
30
- * Date: 2023-02-14
31
- */
32
- function(e){var t,n,r,i,o,a,s,l,u,c,p,d,f,h,m,g,y,v,b,x="sizzle"+1*new Date,q=e.document,D=0,S=0,C=le(),E=le(),w=le(),A=le(),M=function(e,t){return e===t&&(p=!0),0},I={}.hasOwnProperty,T=[],k=T.pop,O=T.push,L=T.push,N=T.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},_="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",H="(?:\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",F="\\["+R+"*("+H+")(?:"+R+"*([*^$|!~]?=)"+R+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+H+"))|)"+R+"*\\]",j=":("+H+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+F+")*)|.*)\\)|)",B=new RegExp(R+"+","g"),z=new RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),V=new RegExp("^"+R+"*,"+R+"*"),$=new RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),U=new RegExp(R+"|>"),W=new RegExp(j),Y=new RegExp("^"+H+"$"),K={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),TAG:new RegExp("^("+H+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+_+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,X=/^(?: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}"+R+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(T=N.call(q.childNodes),q.childNodes),T[q.childNodes.length].nodeType}catch(e){L={apply:T.length?function(e,t){O.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,p,h,y,v=t&&t.ownerDocument,q=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==q&&9!==q&&11!==q)return r;if(!i&&(d(t),t=t||f,m)){if(11!==q&&(p=Q.exec(e)))if(o=p[1]){if(9===q){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(p[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=p[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!g||!g.test(e))&&(1!==q||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===q&&(U.test(e)||$.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=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+be(h[s]);y=h.join(",")}try{return L.apply(r,v.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(z,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ue(e){return e[x]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(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!G.test(t||n&&n.nodeName||"HTML")},d=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:q;return a!=f&&9===a.nodeType&&a.documentElement?(h=(f=a).documentElement,m=!o(f),q!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return h.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssHas=ce((function(){try{return f.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Z.test(f.getElementsByClassName),n.getById=ce((function(e){return h.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],g=[],(n.qsa=Z.test(f.querySelectorAll))&&(ce((function(e){var t;h.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+_+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Z.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce((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(h.compareDocumentPosition),b=t||Z.test(h.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},M=t?function(e,t){if(e===t)return p=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==q&&b(q,e)?-1:t==f||t.ownerDocument==q&&b(q,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return p=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==f?-1:t==f?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?de(a[r],s[r]):a[r]==q?-1:s[r]==q?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!A[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){A(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&I.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(p=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(M),p){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:K,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 K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.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=C[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&C(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(B," ")+" ").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,p,d,f,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s,b=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&v){for(b=(f=(u=(c=(p=(d=g)[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===D&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[D,f,b];break}}else if(v&&(b=f=(u=(c=(p=(d=t)[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]||[])[0]===D&&u[1]),!1===b)for(;(d=++f&&d&&d[m]||(b=f=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(v&&((c=(p=d[x]||(d[x]={}))[d.uniqueID]||(p[d.uniqueID]={}))[e]=[D,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=P(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(z,"$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===h},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=he(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=S++;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,p,d=[D,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=(p=t[x]||(t[x]={}))[t.uniqueID]||(p[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[o])&&u[0]===D&&u[1]===s)return d[2]=u[2];if(c[o]=d,d[2]=e(t,n,l))return!0}return!1}}function qe(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 De(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 Se(e,t,n,r,i,o){return r&&!r[x]&&(r=Se(r)),i&&!i[x]&&(i=Se(i,o)),ue((function(o,a,s,l){var u,c,p,d=[],f=[],h=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:De(m,d,e,s,l),y=n?i||(o?e:h||r)?[]:a:g;if(n&&n(g,y,s,l),r)for(u=De(y,f),r(u,[],s,l),c=u.length;c--;)(p=u[c])&&(y[f[c]]=!(g[f[c]]=p));if(o){if(i||e){if(i){for(u=[],c=y.length;c--;)(p=y[c])&&u.push(g[c]=p);i(null,y=[],u,l)}for(c=y.length;c--;)(p=y[c])&&(u=i?P(o,p):d[c])>-1&&(o[u]=!(a[u]=p))}}else y=De(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):L.apply(a,y)}))}function Ce(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),p=xe((function(e){return P(t,e)>-1}),s,!0),d=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r));return t=null,i}];l<o;l++)if(n=r.relative[e[l].type])d=[xe(qe(d),n)];else{if((n=r.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!r.relative[e[i].type];i++);return Se(l>1&&qe(d),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,l<i&&Ce(e.slice(l,i)),i<o&&Ce(e=e.slice(i)),i<o&&be(e))}d.push(n)}return qe(d)}return ve.prototype=r.filters=r.pseudos,r.setFilters=new ve,a=se.tokenize=function(e,t){var n,i,o,a,s,l,u,c=E[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=$.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(z," ")}),s=s.slice(n.length)),r.filter)!(i=K[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):E(e,l).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=w[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=Ce(t[n]))[x]?i.push(s):o.push(s);s=w(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var p,h,g,y=0,v="0",b=o&&[],x=[],q=u,S=o||i&&r.find.TAG("*",c),C=D+=null==q?1:Math.random()||.1,E=S.length;for(c&&(u=a==f||a||c);v!==E&&null!=(p=S[v]);v++){if(i&&p){for(h=0,a||p.ownerDocument==f||(d(p),s=!m);g=e[h++];)if(g(p,a||f,s)){l.push(p);break}c&&(D=C)}n&&((p=!g&&p)&&y--,o&&b.push(p))}if(y+=v,n&&v!==y){for(h=0;g=t[h++];)g(b,x,a,s);if(o){if(y>0)for(;v--;)b[v]||x[v]||(x[v]=k.call(l));x=De(x)}L.apply(l,x),c&&!o&&x.length>0&&y+t.length>1&&se.uniqueSort(l)}return c&&(D=C,u=q),b};return n?ue(o):o}(o,i)),s.selector=e}return s},l=se.select=function(e,t,n,i){var o,l,u,c,p,d="function"==typeof e&&e,f=!i&&a(e=d.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=K.needsContext.test(e)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((p=r.find[c])&&(i=p(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 L.apply(n,i),n;break}}return(d||s(e,f))(i,t,!m,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=x.split("").sort(M).join("")===x,n.detectDuplicates=!!p,d(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||pe("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")}))||pe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||pe(_,(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);q.find=S,q.expr=S.selectors,q.expr[":"]=q.expr.pseudos,q.uniqueSort=q.unique=S.uniqueSort,q.text=S.getText,q.isXMLDoc=S.isXML,q.contains=S.contains,q.escapeSelector=S.escape;var C=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&q(e).is(n))break;r.push(e)}return r},E=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},w=q.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function I(e,t,n){return h(t)?q.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?q.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?q.grep(e,(function(e){return s.call(t,e)>-1!==n})):q.filter(t,e,n)}q.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?q.find.matchesSelector(r,e)?[r]:[]:q.find.matches(e,q.grep(t,(function(e){return 1===e.nodeType})))},q.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(q(e).filter((function(){for(t=0;t<r;t++)if(q.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)q.find(e,i[t],n);return r>1?q.uniqueSort(n):n},filter:function(e){return this.pushStack(I(this,e||[],!1))},not:function(e){return this.pushStack(I(this,e||[],!0))},is:function(e){return!!I(this,"string"==typeof e&&w.test(e)?q(e):e||[],!1).length}});var T,k=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(q.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||T,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:k.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 q?t[0]:t,q.merge(this,q.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),M.test(r[1])&&q.isPlainObject(t))for(r in t)h(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):h(e)?void 0!==n.ready?n.ready(e):e(q):q.makeArray(e,this)}).prototype=q.fn,T=q(g);var O=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}q.fn.extend({has:function(e){var t=q(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(q.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&q(e);if(!w.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&&q.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?q.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(q(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(q.uniqueSort(q.merge(this.get(),q(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),q.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,n){return C(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,n){return C(e,"nextSibling",n)},prevUntil:function(e,t,n){return C(e,"previousSibling",n)},siblings:function(e){return E((e.parentNode||{}).firstChild,e)},children:function(e){return E(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),q.merge([],e.childNodes))}},(function(e,t){q.fn[e]=function(n,r){var i=q.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=q.filter(r,i)),this.length>1&&(L[e]||q.uniqueSort(i),O.test(e)&&i.reverse()),this.pushStack(i)}}));var P=/[^\x20\t\r\n\f]+/g;function _(e){return e}function R(e){throw e}function H(e,t,n,r){var i;try{e&&h(i=e.promise)?i.call(e).done(t).fail(n):e&&h(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}q.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return q.each(e.match(P)||[],(function(e,n){t[n]=!0})),t}(e):q.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){q.each(n,(function(n,r){h(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 q.each(arguments,(function(e,t){for(var n;(n=q.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?q.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},q.extend({Deferred:function(t){var n=[["notify","progress",q.Callbacks("memory"),q.Callbacks("memory"),2],["resolve","done",q.Callbacks("once memory"),q.Callbacks("once memory"),0,"resolved"],["reject","fail",q.Callbacks("once memory"),q.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 q.Deferred((function(t){q.each(n,(function(n,r){var i=h(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&h(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,h(u)?i?u.call(e,a(o,n,_,i),a(o,n,R,i)):(o++,u.call(e,a(o,n,_,i),a(o,n,R,i),a(o,n,_,n.notifyWith))):(r!==_&&(s=void 0,l=[e]),(i||n.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(e){q.Deferred.exceptionHook&&q.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==R&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?c():(q.Deferred.getStackHook&&(c.stackTrace=q.Deferred.getStackHook()),e.setTimeout(c))}}return q.Deferred((function(e){n[0][3].add(a(0,e,h(i)?i:_,e.notifyWith)),n[1][3].add(a(0,e,h(t)?t:_)),n[2][3].add(a(0,e,h(r)?r:R))})).promise()},promise:function(e){return null!=e?q.extend(e,i):i}},o={};return q.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=q.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&&(H(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||h(o[n]&&o[n].then)))return a.then();for(;n--;)H(o[n],s(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;q.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},q.readyException=function(t){e.setTimeout((function(){throw t}))};var j=q.Deferred();function B(){g.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),q.ready()}q.fn.ready=function(e){return j.then(e).catch((function(e){q.readyException(e)})),this},q.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--q.readyWait:q.isReady)||(q.isReady=!0,!0!==e&&--q.readyWait>0||j.resolveWith(g,[q]))}}),q.ready.then=j.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(q.ready):(g.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var z=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)z(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,h(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(q(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-/,$=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function W(e){return e.replace(V,"ms-").replace($,U)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=q.expando+K.uid++}K.uid=1,K.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[W(t)]=n;else for(r in t)i[W(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][W(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(W):(t=W(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||q.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&&!q.isEmptyObject(t)}};var G=new K,X=new K,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){}X.set(e,t,n)}else n=void 0;return n}q.extend({hasData:function(e){return X.hasData(e)||G.hasData(e)},data:function(e,t,n){return X.access(e,t,n)},removeData:function(e,t){X.remove(e,t)},_data:function(e,t,n){return G.access(e,t,n)},_removeData:function(e,t){G.remove(e,t)}}),q.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=X.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=W(r.slice(5)),Q(o,r,i[r]));G.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){X.set(this,e)})):z(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=X.get(o,e))||void 0!==(n=Q(o,e))?n:void 0;this.each((function(){X.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){X.remove(this,e)}))}}),q.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,q.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=q.queue(e,t),r=n.length,i=n.shift(),o=q._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){q.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:q.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),q.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?q.queue(this[0],e):void 0===t?this:this.each((function(){var n=q.queue(this,e,t);q._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&q.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){q.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=q.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=G.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var 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 q.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return q.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"===q.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return q.css(e,t,"")},l=s(),u=n&&n[3]||(q.cssNumber[t]?"":"px"),c=e.nodeType&&(q.cssNumber[t]||"px"!==u&&+l)&&te.exec(q.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)q.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,q.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=q.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]=G.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ue(r))):"none"!==n&&(i[o]="none",G.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}q.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)?q(this).show():q(this).hide()}))}});var pe,de,fe=/^(?:checkbox|radio)$/i,he=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;pe=g.createDocumentFragment().appendChild(g.createElement("div")),(de=g.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),pe.appendChild(de),f.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="<option></option>",f.option=!!pe.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&&A(e,t)?q.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)G.set(e[n],"globalEval",!t||G.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,f.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,p=t.createDocumentFragment(),d=[],f=0,h=e.length;f<h;f++)if((o=e[f])||0===o)if("object"===b(o))q.merge(d,o.nodeType?[o]:o);else if(be.test(o)){for(a=a||p.appendChild(t.createElement("div")),s=(he.exec(o)||["",""])[1].toLowerCase(),l=ge[s]||ge._default,a.innerHTML=l[1]+q.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;q.merge(d,a.childNodes),(a=p.firstChild).textContent=""}else d.push(t.createTextNode(o));for(p.textContent="",f=0;o=d[f++];)if(r&&q.inArray(o,r)>-1)i&&i.push(o);else if(u=ie(o),a=ye(p.appendChild(o),"script"),u&&ve(a),n)for(c=0;o=a[c++];)me.test(o.type||"")&&n.push(o);return p}var qe=/^([^.]*)(?:\.(.+)|)/;function De(){return!0}function Se(){return!1}function Ce(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function Ee(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)Ee(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=Se;else if(!i)return e;return 1===o&&(a=i,i=function(e){return q().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=q.guid++)),e.each((function(){q.event.add(this,t,i,r,n)}))}function we(e,t,n){n?(G.set(e,t,!1),q.event.add(e,t,{namespace:!1,handler:function(e){var r,o,a=G.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(q.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),G.set(this,t,a),r=n(this,t),this[t](),a!==(o=G.get(this,t))||r?G.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(G.set(this,t,{value:q.event.trigger(q.extend(a[0],q.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&q.event.add(e,t,De)}q.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,p,d,f,h,m,g=G.get(e);if(Y(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&q.find.matchesSelector(re,i),n.guid||(n.guid=q.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==q&&q.event.triggered!==t.type?q.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(P)||[""]).length;u--;)f=m=(s=qe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(p=q.event.special[f]||{},f=(i?p.delegateType:p.bindType)||f,p=q.event.special[f]||{},c=q.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&q.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(f,a)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),q.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,d,f,h,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(P)||[""]).length;u--;)if(f=m=(s=qe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(p=q.event.special[f]||{},d=l[f=(r?p.delegateType:p.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,p.remove&&p.remove.call(e,c));a&&!d.length&&(p.teardown&&!1!==p.teardown.call(e,h,g.handle)||q.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)q.event.remove(e,f+t[u],n,r,!0);q.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=q.event.fix(e),u=(G.get(this,"events")||Object.create(null))[l.type]||[],c=q.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=q.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=((q.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?q(i,this).index(u)>-1:q.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(q.Event.prototype,e,{enumerable:!0,configurable:!0,get:h(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[q.expando]?e:new q.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return fe.test(t.type)&&t.click&&A(t,"input")&&we(t,"click",De),!1},trigger:function(e){var t=this||e;return fe.test(t.type)&&t.click&&A(t,"input")&&we(t,"click"),!0},_default:function(e){var t=e.target;return fe.test(t.type)&&t.click&&A(t,"input")&&G.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},q.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},q.Event=function(e,t){if(!(this instanceof q.Event))return new q.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?De:Se,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&&q.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[q.expando]=!0},q.Event.prototype={constructor:q.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=De,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=De,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=De,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},q.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},q.event.addProp),q.each({focus:"focusin",blur:"focusout"},(function(e,t){q.event.special[e]={setup:function(){return we(this,e,Ce),!1},trigger:function(){return we(this,e),!0},_default:function(t){return G.get(t.target,e)},delegateType:t}})),q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){q.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||q.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),q.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,q(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=Se),this.each((function(){q.event.remove(this,e,n,t)}))}});var Ae=/<script|<style|<link/i,Me=/checked\s*(?:[^=]|=\s*.checked.)/i,Ie=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Te(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&q(e).children("tbody")[0]||e}function ke(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(G.hasData(e)&&(s=G.get(e).events))for(i in G.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)q.event.add(t,i,s[i][n]);X.hasData(e)&&(o=X.access(e),a=q.extend({},o),X.set(t,a))}}function Ne(e,t){var n=t.nodeName.toLowerCase();"input"===n&&fe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Pe(e,t,n,r){t=o(t);var i,a,s,l,u,c,p=0,d=e.length,m=d-1,g=t[0],y=h(g);if(y||d>1&&"string"==typeof g&&!f.checkClone&&Me.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),Pe(o,t,n,r)}));if(d&&(a=(i=xe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(l=(s=q.map(ye(i,"script"),ke)).length;p<d;p++)u=i,p!==m&&(u=q.clone(u,!0,!0),l&&q.merge(s,ye(u,"script"))),n.call(e[p],u,p);if(l)for(c=s[s.length-1].ownerDocument,q.map(s,Oe),p=0;p<l;p++)u=s[p],me.test(u.type||"")&&!G.access(u,"globalEval")&&q.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?q._evalUrl&&!u.noModule&&q._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):v(u.textContent.replace(Ie,""),u,c))}return e}function _e(e,t,n){for(var r,i=t?q.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||q.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}q.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=ie(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||q.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++)Le(o[r],a[r]);else Le(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=q.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[G.expando]){if(t.events)for(r in t.events)i[r]?q.event.remove(n,r):q.removeEvent(n,r,t.handle);n[G.expando]=void 0}n[X.expando]&&(n[X.expando]=void 0)}}}),q.fn.extend({detach:function(e){return _e(this,e,!0)},remove:function(e){return _e(this,e)},text:function(e){return z(this,(function(e){return void 0===e?q.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&&(q.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 q.clone(this,e,t)}))},html:function(e){return z(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&&!Ae.test(e)&&!ge[(he.exec(e)||["",""])[1].toLowerCase()]){e=q.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(q.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 Pe(this,arguments,(function(t){var n=this.parentNode;q.inArray(this,e)<0&&(q.cleanData(ye(this)),n&&n.replaceChild(t,this))}),e)}}),q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){q.fn[e]=function(e){for(var n,r=[],i=q(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),q(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}}));var Re=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),He=/^--/,Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},je=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Be=new RegExp(ne.join("|"),"i"),ze="[\\x20\\t\\r\\n\\f]",Ve=new RegExp("^"+ze+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ze+"+$","g");function $e(e,t,n){var r,i,o,a,s=He.test(t),l=e.style;return(n=n||Fe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(Ve,"$1")||void 0),""!==a||ie(e)||(a=q.style(e,t)),!f.pixelBoxStyles()&&Re.test(a)&&Be.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function Ue(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="",f.clearCloneStyle="content-box"===c.style.backgroundClip,q.extend(f,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==s&&(t=g.createElement("table"),n=g.createElement("tr"),r=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",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 We=["Webkit","Moz","ms"],Ye=g.createElement("div").style,Ke={};function Ge(e){var t=q.cssProps[e]||Ke[e];return t||(e in Ye?e:Ke[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in Ye)return e}(e)||e)}var Xe=/^(none|table(?!-c[ea]).+)/,Je={position:"absolute",visibility:"hidden",display:"block"},Ze={letterSpacing:"0",fontWeight:"400"};function Qe(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(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+=q.css(e,n+ne[a],!0,i)),r?("content"===n&&(l-=q.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(l-=q.css(e,"border"+ne[a]+"Width",!0,i))):(l+=q.css(e,"padding"+ne[a],!0,i),"padding"!==n?l+=q.css(e,"border"+ne[a]+"Width",!0,i):s+=q.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 tt(e,t,n){var r=Fe(e),i=(!f.boxSizingReliable()||n)&&"border-box"===q.css(e,"boxSizing",!1,r),o=i,a=$e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Re.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&i||!f.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===q.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===q.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}q.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(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=W(t),l=He.test(t),u=e.style;if(l||(t=Ge(s)),a=q.cssHooks[t]||q.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]||(q.cssNumber[s]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=W(t);return He.test(t)||(t=Ge(s)),(a=q.cssHooks[t]||q.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=$e(e,t,r)),"normal"===i&&t in Ze&&(i=Ze[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),q.each(["height","width"],(function(e,t){q.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(q.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,t,r):je(e,Je,(function(){return tt(e,t,r)}))},set:function(e,n,r){var i,o=Fe(e),a=!f.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===q.css(e,"boxSizing",!1,o),l=r?et(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-et(e,t,"border",!1,o)-.5)),l&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=q.css(e,t)),Qe(0,n,l)}}})),q.cssHooks.marginLeft=Ue(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-je(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),q.each({margin:"",padding:"",border:"Width"},(function(e,t){q.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&&(q.cssHooks[e+t].set=Qe)})),q.fn.extend({css:function(e,t){return z(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=q.css(e,t[a],!1,r);return o}return void 0!==n?q.style(e,t,n):q.css(e,t)}),e,t,arguments.length>1)}}),q.Tween=nt,nt.prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||q.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(q.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=q.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):nt.propHooks._default.set(this),this}},nt.prototype.init.prototype=nt.prototype,nt.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=q.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){q.fx.step[e.prop]?q.fx.step[e.prop](e):1!==e.elem.nodeType||!q.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:q.style(e.elem,e.prop,e.now+e.unit)}}},nt.propHooks.scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},q.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},q.fx=nt.prototype.init,q.fx.step={};var rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){it&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(st):e.setTimeout(st,q.fx.interval),q.fx.tick())}function lt(){return e.setTimeout((function(){rt=void 0})),rt=Date.now()}function ut(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 ct(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=q.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=rt||lt(),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:q.extend({},t),opts:q.extend(!0,{specialEasing:{},easing:q.easing._default},n),originalProperties:t,originalOptions:n,startTime:rt||lt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=q.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=W(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=q.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=pt.prefilters[o].call(u,e,c,u.opts))return h(r.stop)&&(q._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return q.map(c,ct,u),h(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),q.fx.timer(q.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}q.Animation=q.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){h(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,p="width"in t||"height"in t,d=this,f={},h=e.style,m=e.nodeType&&ae(e),g=G.get(e,"fxshow");for(r in n.queue||(null==(a=q._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,q.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}f[r]=g&&g[r]||q.style(e,r)}if((l=!q.isEmptyObject(t))||!q.isEmptyObject(f))for(r in p&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=g&&g.display)&&(u=G.get(e,"display")),"none"===(c=q.css(e,"display"))&&(u?c=u:(ce([e],!0),u=e.style.display||u,c=q.css(e,"display"),ce([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===q.css(e,"float")&&(l||(d.done((function(){h.display=u})),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=G.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&ce([e],!0),d.done((function(){for(r in m||ce([e]),G.remove(e,"fxshow"),f)q.style(e,r,f[r])}))),l=ct(m?g[r]:0,r,d),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),q.speed=function(e,t,n){var r=e&&"object"==typeof e?q.extend({},e):{complete:n||!n&&t||h(e)&&e,duration:e,easing:n&&t||t&&!h(t)&&t};return q.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in q.fx.speeds?r.duration=q.fx.speeds[r.duration]:r.duration=q.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){h(r.old)&&r.old.call(this),r.queue&&q.dequeue(this,r.queue)},r},q.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=q.isEmptyObject(e),o=q.speed(t,n,r),a=function(){var t=pt(this,q.extend({},e),o);(i||G.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=q.timers,a=G.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&at.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||q.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=G.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=q.timers,a=r?r.length:0;for(n.finish=!0,q.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}))}}),q.each(["toggle","show","hide"],(function(e,t){var n=q.fn[t];q.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}})),q.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){q.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),q.timers=[],q.fx.tick=function(){var e,t=0,n=q.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||q.fx.stop(),rt=void 0},q.fx.timer=function(e){q.timers.push(e),q.fx.start()},q.fx.interval=13,q.fx.start=function(){it||(it=!0,st())},q.fx.stop=function(){it=null},q.fx.speeds={slow:600,fast:200,_default:400},q.fn.delay=function(t,n){return t=q.fx&&q.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var dt,ft=q.expr.attrHandle;q.fn.extend({attr:function(e,t){return z(this,q.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){q.removeAttr(this,e)}))}}),q.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?q.prop(e,t,n):(1===o&&q.isXMLDoc(e)||(i=q.attrHooks[t.toLowerCase()]||(q.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void q.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=q.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?q.removeAttr(e,n):e.setAttribute(n,n),n}},q.each(q.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ft[t]||q.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 ht=/^(?:input|select|textarea|button)$/i,mt=/^(?:a|area)$/i;function gt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}q.fn.extend({prop:function(e,t){return z(this,q.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[q.propFix[e]||e]}))}}),q.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&q.isXMLDoc(e)||(t=q.propFix[t]||t,i=q.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=q.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(q.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)}}),q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){q.propFix[this.toLowerCase()]=this})),q.fn.extend({addClass:function(e){var t,n,r,i,o,a;return h(e)?this.each((function(t){q(this).addClass(e.call(this,t,yt(this)))})):(t=vt(e)).length?this.each((function(){if(r=yt(this),n=1===this.nodeType&&" "+gt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=gt(n),r!==a&&this.setAttribute("class",a)}})):this},removeClass:function(e){var t,n,r,i,o,a;return h(e)?this.each((function(t){q(this).removeClass(e.call(this,t,yt(this)))})):arguments.length?(t=vt(e)).length?this.each((function(){if(r=yt(this),n=1===this.nodeType&&" "+gt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=gt(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 h(e)?this.each((function(n){q(this).toggleClass(e.call(this,n,yt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=vt(e),this.each((function(){if(s)for(o=q(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=yt(this))&&G.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":G.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+gt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;q.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=h(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,q(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=q.map(i,(function(e){return null==e?"":e+""}))),(t=q.valHooks[this.type]||q.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=q.valHooks[i.type]||q.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n:void 0}}),q.extend({valHooks:{option:{get:function(e){var t=q.find.attr(e,"value");return null!=t?t:gt(q.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||!A(n.parentNode,"optgroup"))){if(t=q(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=q.makeArray(t),a=i.length;a--;)((r=i[a]).selected=q.inArray(q.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),q.each(["radio","checkbox"],(function(){q.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=q.inArray(q(e).val(),t)>-1}},f.checkOn||(q.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),f.focusin="onfocusin"in e;var xt=/^(?:focusinfocus|focusoutblur)$/,qt=function(e){e.stopPropagation()};q.extend(q.event,{trigger:function(t,n,r,i){var o,a,s,l,u,p,d,f,y=[r||g],v=c.call(t,"type")?t.type:t,b=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=s=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!xt.test(v+q.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),u=v.indexOf(":")<0&&"on"+v,(t=t[q.expando]?t:new q.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]:q.makeArray(n,[t]),d=q.event.special[v]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!m(r)){for(l=d.delegateType||v,xt.test(l+v)||(a=a.parentNode);a;a=a.parentNode)y.push(a),s=a;s===(r.ownerDocument||g)&&y.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=y[o++])&&!t.isPropagationStopped();)f=a,t.type=o>1?l:d.bindType||v,(p=(G.get(a,"events")||Object.create(null))[t.type]&&G.get(a,"handle"))&&p.apply(a,n),(p=u&&a[u])&&p.apply&&Y(a)&&(t.result=p.apply(a,n),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!Y(r)||u&&h(r[v])&&!m(r)&&((s=r[u])&&(r[u]=null),q.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,qt),r[v](),t.isPropagationStopped()&&f.removeEventListener(v,qt),q.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=q.extend(new q.Event,n,{type:e,isSimulated:!0});q.event.trigger(r,null,t)}}),q.fn.extend({trigger:function(e,t){return this.each((function(){q.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return q.event.trigger(e,t,n,!0)}}),f.focusin||q.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){q.event.simulate(t,e.target,q.event.fix(e))};q.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t);i||r.addEventListener(e,n,!0),G.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t)-1;i?G.access(r,t,i):(r.removeEventListener(e,n,!0),G.remove(r,t))}}}));var Dt=e.location,St={guid:Date.now()},Ct=/\?/;q.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||q.error("Invalid XML: "+(r?q.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Et=/\[\]$/,wt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Mt=/^(?:input|select|textarea|keygen)/i;function It(e,t,n,r){var i;if(Array.isArray(t))q.each(t,(function(t,i){n||Et.test(e)?r(e,i):It(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)It(e+"["+i+"]",t[i],n,r)}q.param=function(e,t){var n,r=[],i=function(e,t){var n=h(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!q.isPlainObject(e))q.each(e,(function(){i(this.name,this.value)}));else for(n in e)It(n,e[n],t,i);return r.join("&")},q.fn.extend({serialize:function(){return q.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=q.prop(this,"elements");return e?q.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!q(this).is(":disabled")&&Mt.test(this.nodeName)&&!At.test(e)&&(this.checked||!fe.test(e))})).map((function(e,t){var n=q(this).val();return null==n?null:Array.isArray(n)?q.map(n,(function(e){return{name:t.name,value:e.replace(wt,"\r\n")}})):{name:t.name,value:n.replace(wt,"\r\n")}})).get()}});var Tt=/%20/g,kt=/#.*$/,Ot=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,Pt=/^\/\//,_t={},Rt={},Ht="*/".concat("*"),Ft=g.createElement("a");function jt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(h(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Bt(e,t,n,r){var i={},o=e===Rt;function a(s){var l;return i[s]=!0,q.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 zt(e,t){var n,r,i=q.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&q.extend(!0,e,r),e}Ft.href=Dt.href,q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ht,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":q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,q.ajaxSettings),t):zt(q.ajaxSettings,e)},ajaxPrefilter:jt(_t),ajaxTransport:jt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,l,u,c,p,d,f=q.ajaxSetup({},n),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?q(h):q.event,y=q.Deferred(),v=q.Callbacks("once memory"),b=f.statusCode||{},x={},D={},S="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Lt.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=D[e.toLowerCase()]=D[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)C.always(e[C.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||S;return r&&r.abort(t),E(0,t),this}};if(y.promise(C),f.url=((t||f.url||Dt.href)+"").replace(Pt,Dt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(P)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ft.protocol+"//"+Ft.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=q.param(f.data,f.traditional)),Bt(_t,f,n,C),u)return C;for(p in(c=q.event&&f.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Nt.test(f.type),i=f.url.replace(kt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Tt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Ct.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(Ot,"$1"),d=(Ct.test(i)?"&":"?")+"_="+St.guid+++d),f.url=i+d),f.ifModified&&(q.lastModified[i]&&C.setRequestHeader("If-Modified-Since",q.lastModified[i]),q.etag[i]&&C.setRequestHeader("If-None-Match",q.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ht+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,C,f)||u))return C.abort();if(S="abort",v.add(f.complete),C.done(f.success),C.fail(f.error),r=Bt(Rt,f,n,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,f]),u)return C;f.async&&f.timeout>0&&(s=e.setTimeout((function(){C.abort("timeout")}),f.timeout));try{u=!1,r.send(x,E)}catch(e){if(u)throw e;E(-1,e)}}else E(-1,"No Transport");function E(t,n,a,l){var p,d,g,x,D,S=n;u||(u=!0,s&&e.clearTimeout(s),r=void 0,o=l||"",C.readyState=t>0?4:0,p=t>=200&&t<300||304===t,a&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,C,a)),!p&&q.inArray("script",f.dataTypes)>-1&&q.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,C,p),p?(f.ifModified&&((D=C.getResponseHeader("Last-Modified"))&&(q.lastModified[i]=D),(D=C.getResponseHeader("etag"))&&(q.etag[i]=D)),204===t||"HEAD"===f.type?S="nocontent":304===t?S="notmodified":(S=x.state,d=x.data,p=!(g=x.error))):(g=S,!t&&S||(S="error",t<0&&(t=0))),C.status=t,C.statusText=(n||S)+"",p?y.resolveWith(h,[d,S,C]):y.rejectWith(h,[C,S,g]),C.statusCode(b),b=void 0,c&&m.trigger(p?"ajaxSuccess":"ajaxError",[C,f,p?d:g]),v.fireWith(h,[C,S]),c&&(m.trigger("ajaxComplete",[C,f]),--q.active||q.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return q.get(e,t,n,"json")},getScript:function(e,t){return q.get(e,void 0,t,"script")}}),q.each(["get","post"],(function(e,t){q[t]=function(e,n,r,i){return h(n)&&(i=i||r,r=n,n=void 0),q.ajax(q.extend({url:e,type:t,dataType:i,data:n,success:r},q.isPlainObject(e)&&e))}})),q.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),q._evalUrl=function(e,t,n){return q.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){q.globalEval(e,t,n)}})},q.fn.extend({wrapAll:function(e){var t;return this[0]&&(h(e)&&(e=e.call(this[0])),t=q(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 h(e)?this.each((function(t){q(this).wrapInner(e.call(this,t))})):this.each((function(){var t=q(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h(e);return this.each((function(n){q(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){q(this).replaceWith(this.childNodes)})),this}}),q.expr.pseudos.hidden=function(e){return!q.expr.pseudos.visible(e)},q.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},q.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},$t=q.ajaxSettings.xhr();f.cors=!!$t&&"withCredentials"in $t,f.ajax=$t=!!$t,q.ajaxTransport((function(t){var n,r;if(f.cors||$t&&!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(Vt[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()}}})),q.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),q.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 q.globalEval(e),e}}}),q.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),q.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=q("<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 Ut,Wt=[],Yt=/(=)\?(?=&|$)|\?\?/;q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||q.expando+"_"+St.guid++;return this[e]=!0,e}}),q.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Yt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Yt,"$1"+i):!1!==t.jsonp&&(t.url+=(Ct.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||q.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?q(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Wt.push(i)),a&&h(o)&&o(a[0]),a=o=void 0})),"script"})),f.createHTMLDocument=((Ut=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),q.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),o=!n&&[],(i=M.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&q(o).remove(),q.merge([],i.childNodes)));var r,i,o},q.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=gt(e.slice(s)),e=e.slice(0,s)),h(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&q.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(r?q("<div>").append(q.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},q.expr.pseudos.animated=function(e){return q.grep(q.timers,(function(t){return e===t.elem})).length},q.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=q.css(e,"position"),c=q(e),p={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=q.css(e,"top"),l=q.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),h(t)&&(t=t.call(e,n,q.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):c.css(p)}},q.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){q.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"===q.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"===q.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=q(e).offset()).top+=q.css(e,"borderTopWidth",!0),i.left+=q.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-q.css(r,"marginTop",!0),left:t.left-i.left-q.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===q.css(e,"position");)e=e.offsetParent;return e||re}))}}),q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;q.fn[e]=function(r){return z(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)}})),q.each(["top","left"],(function(e,t){q.cssHooks[t]=Ue(f.pixelPosition,(function(e,n){if(n)return n=$e(e,t),Re.test(n)?q(e).position()[t]+"px":n}))})),q.each({Height:"height",Width:"width"},(function(e,t){q.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){q.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(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?q.css(t,n,s):q.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){q.fn[t]=function(e){return this.on(t,e)}})),q.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)}}),q.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){q.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;q.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),h(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||q.guid++,o},q.holdReady=function(e){e?q.readyWait++:q.ready(!0)},q.isArray=Array.isArray,q.parseJSON=JSON.parse,q.nodeName=A,q.isFunction=h,q.isWindow=m,q.camelCase=W,q.type=b,q.now=Date.now,q.isNumeric=function(e){var t=q.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},q.trim=function(e){return null==e?"":(e+"").replace(Kt,"$1")};var Gt=e.jQuery,Xt=e.$;return q.noConflict=function(t){return e.$===q&&(e.$=Xt),t&&e.jQuery===q&&(e.jQuery=Gt),q},void 0===t&&(e.jQuery=e.$=q),q}));var I=A,T={"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-й процентиль"}}};const k={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function O(e){return k[e]||e}function L(e){return function(t,n,r){let i,o,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.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=O(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(r),a.add(new e[n](t.options)),Object.keys(t.events).forEach((e=>{t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((t=>{const n=O(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((e=>""!==e))),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((e=>""!==e))))})))}function p(){l.forEach((e=>{Object.keys(e.events).forEach((t=>{a.off(t,e.events[t])})),a.remove(e.options.event)})),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),p(),u&&c()},off(){u=!1,p()},on(){u=!0,0===l.length&&c()},destroy(){p(),a&&a.destroy(),a=null,o=null,i=null}}}}var N={},P={get exports(){return N},set exports(e){N=e}};
16
+ * Date: 2023-05-11T18:29Z
17
+ */A=w,function(e,t){A.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}}("undefined"!=typeof window?window:C,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},s=n.push,a=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,p=c.toString,d=p.call(Object),f={},h=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){var r,i,o=(n=n||g).createElement("script");if(o.text=e,t)for(r in y)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var x="3.7.0",q=/HTML$/i,D=function(e,t){return new D.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!h(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}D.fn=D.prototype={jquery:x,constructor:D,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return D.each(this,e)},map:function(e){return this.pushStack(D.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(D.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(D.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},D.extend=D.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||h(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(e=arguments[a]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(u&&r&&(D.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],o=i&&!Array.isArray(n)?[]:i||D.isPlainObject(n)?n:{},i=!1,s[t]=D.extend(u,o,r)):void 0!==r&&(s[t]=r));return s},D.extend({expando:"jQuery"+(x+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||p.call(n)!==d))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(S(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i)return e.textContent;if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=D.text(t);return n},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?D.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)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!q.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,s=!n;i<o;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,s=0,a=[];if(S(e))for(r=e.length;s<r;s++)null!=(i=t(e[s],s,n))&&a.push(i);else for(s in e)null!=(i=t(e[s],s,n))&&a.push(i);return o(a)},guid:1,support:f}),"function"==typeof Symbol&&(D.fn[Symbol.iterator]=n[Symbol.iterator]),D.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var E=n.pop,A=n.sort,w=n.splice,I="[\\x20\\t\\r\\n\\f]",T=new RegExp("^"+I+"+|((?:^|[^\\\\])(?:\\\\.)*)"+I+"+$","g");D.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var M=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}D.escapeSelector=function(e){return(e+"").replace(M,O)};var L=g,k=s;!function(){var t,r,o,s,l,u,p,d,h,m,g=k,y=D.expando,v=0,b=0,x=ee(),q=ee(),S=ee(),M=ee(),O=function(e,t){return e===t&&(l=!0),0},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",_="(?:\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",N="\\["+I+"*("+_+")(?:"+I+"*([*^$|!~]?=)"+I+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+_+"))|)"+I+"*\\]",R=":("+_+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",H=new RegExp(I+"+","g"),F=new RegExp("^"+I+"*,"+I+"*"),B=new RegExp("^"+I+"*([>+~]|"+I+")"+I+"*"),j=new RegExp(I+"|>"),z=new RegExp(R),V=new RegExp("^"+_+"$"),$={ID:new RegExp("^#("+_+")"),CLASS:new RegExp("^\\.("+_+")"),TAG:new RegExp("^("+_+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,G=new RegExp("\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\([^\\r\\n\\f])","g"),X=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))},J=function(){le()},Z=de((function(e){return!0===e.disabled&&C(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(n=i.call(L.childNodes),L.childNodes),n[L.childNodes.length].nodeType}catch(e){g={apply:function(e,t){k.apply(e,i.call(t))},call:function(e){k.apply(e,i.call(arguments,1))}}}function Q(e,t,n,r){var i,o,s,a,l,c,p,m=t&&t.ownerDocument,v=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==v&&9!==v&&11!==v)return n;if(!r&&(le(t),t=t||u,d)){if(11!==v&&(l=K.exec(e)))if(i=l[1]){if(9===v){if(!(s=t.getElementById(i)))return n;if(s.id===i)return g.call(n,s),n}else if(m&&(s=m.getElementById(i))&&Q.contains(t,s)&&s.id===i)return g.call(n,s),n}else{if(l[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(M[e+" "]||h&&h.test(e))){if(p=e,m=t,1===v&&(j.test(e)||B.test(e))){for((m=Y.test(e)&&ae(t.parentNode)||t)==t&&f.scope||((a=t.getAttribute("id"))?a=D.escapeSelector(a):t.setAttribute("id",a=y)),o=(c=ce(e)).length;o--;)c[o]=(a?"#"+a:":scope")+" "+pe(c[o]);p=c.join(",")}try{return g.apply(n,m.querySelectorAll(p)),n}catch(t){M(e,!0)}finally{a===y&&t.removeAttribute("id")}}}return ve(e.replace(T,"$1"),t,n,r)}function ee(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function te(e){return e[y]=!0,e}function ne(e){var t=u.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return C(t,"input")&&t.type===e}}function ie(e){return function(t){return(C(t,"input")||C(t,"button"))&&t.type===e}}function oe(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&&Z(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var t,n=e?e.ownerDocument||e:L;return n!=u&&9===n.nodeType&&n.documentElement?(p=(u=n).documentElement,d=!D.isXMLDoc(u),m=p.matches||p.webkitMatchesSelector||p.msMatchesSelector,L!=u&&(t=u.defaultView)&&t.top!==t&&t.addEventListener("unload",J),f.getById=ne((function(e){return p.appendChild(e).id=D.expando,!u.getElementsByName||!u.getElementsByName(D.expando).length})),f.disconnectedMatch=ne((function(e){return m.call(e,"*")})),f.scope=ne((function(){return u.querySelectorAll(":scope")})),f.cssHas=ne((function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),f.getById?(r.filter.ID=function(e){var t=e.replace(G,X);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(G,X);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&&d){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=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},r.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},h=[],ne((function(e){var t;p.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+I+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+y+"-]").length||h.push("~="),e.querySelectorAll("a#"+y+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll(":checked").length||h.push(":checked"),(t=u.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(t=u.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+I+"*name"+I+"*="+I+"*(?:''|\"\")")})),f.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),O=function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===u||e.ownerDocument==L&&Q.contains(L,e)?-1:t===u||t.ownerDocument==L&&Q.contains(L,t)?1:s?a.call(s,e)-a.call(s,t):0:4&n?-1:1)},u):u}for(t in Q.matches=function(e,t){return Q(e,null,null,t)},Q.matchesSelector=function(e,t){if(le(e),d&&!M[t+" "]&&(!h||!h.test(t)))try{var n=m.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){M(t,!0)}return Q(t,u,null,[e]).length>0},Q.contains=function(e,t){return(e.ownerDocument||e)!=u&&le(e),D.contains(e,t)},Q.attr=function(e,t){(e.ownerDocument||e)!=u&&le(e);var n=r.attrHandle[t.toLowerCase()],i=n&&c.call(r.attrHandle,t.toLowerCase())?n(e,t,!d):void 0;return void 0!==i?i:e.getAttribute(t)},Q.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},D.uniqueSort=function(e){var t,n=[],r=0,o=0;if(l=!f.sortStable,s=!f.sortStable&&i.call(e,0),A.call(e,O),l){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)w.call(e,n[r],1)}return s=null,e},D.fn.uniqueSort=function(){return this.pushStack(D.uniqueSort(i.apply(this)))},r=D.expr={cacheLength:50,createPseudo:te,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(G,X),e[3]=(e[3]||e[4]||e[5]||"").replace(G,X),"~="===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]||Q.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]&&Q.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&z.test(n)&&(t=ce(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(G,X).toLowerCase();return"*"===e?function(){return!0}:function(e){return C(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&x(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=Q.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),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,d,f,h=o!==s?"nextSibling":"previousSibling",m=t.parentNode,g=a&&t.nodeName.toLowerCase(),b=!l&&!a,x=!1;if(m){if(o){for(;h;){for(p=t;p=p[h];)if(a?C(p,g):1===p.nodeType)return!1;f=h="only"===e&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&b){for(x=(d=(u=(c=m[y]||(m[y]={}))[e]||[])[0]===v&&u[1])&&u[2],p=d&&m.childNodes[d];p=++d&&p&&p[h]||(x=d=0)||f.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[v,d,x];break}}else if(b&&(x=d=(u=(c=t[y]||(t[y]={}))[e]||[])[0]===v&&u[1]),!1===x)for(;(p=++d&&p&&p[h]||(x=d=0)||f.pop())&&(!(a?C(p,g):1===p.nodeType)||!++x||(b&&((c=p[y]||(p[y]={}))[e]=[v,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Q.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=a.call(e,o[s])]=!(n[r]=o[s])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=ye(e.replace(T,"$1"));return r[y]?te((function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Q(e,t).length>0}})),contains:te((function(e){return e=e.replace(G,X),function(t){return(t.textContent||D.text(t)).indexOf(e)>-1}})),lang:te((function(e){return V.test(e||"")||Q.error("unsupported lang: "+e),e=e.replace(G,X).toLowerCase(),function(t){var n;do{if(n=d?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===function(){try{return u.activeElement}catch(e){}}()&&u.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return C(e,"input")&&!!e.checked||C(e,"option")&&!!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 W.test(e.nodeName)},input:function(e){return U.test(e.nodeName)},button:function(e){return C(e,"input")&&"button"===e.type||C(e,"button")},text:function(e){var t;return C(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:se((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=re(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ie(t);function ue(){}function ce(e,t){var n,i,o,s,a,l,u,c=q[e+" "];if(c)return t?0:c.slice(0);for(a=e,l=[],u=r.preFilter;a;){for(s in n&&!(i=F.exec(a))||(i&&(a=a.slice(i[0].length)||a),l.push(o=[])),n=!1,(i=B.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(T," ")}),a=a.slice(n.length)),r.filter)!(i=$[s].exec(a))||u[s]&&!(i=u[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Q.error(e):q(e,l).slice(0)}function pe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function de(e,t,n){var r=t.dir,i=t.next,o=i||r,s=n&&"parentNode"===o,a=b++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,l){var u,c,p=[v,a];if(l){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(c=t[y]||(t[y]={}),i&&C(t,i))t=t[r]||t;else{if((u=c[o])&&u[0]===v&&u[1]===a)return p[2]=u[2];if(c[o]=p,p[2]=e(t,n,l))return!0}return!1}}function fe(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 he(e,t,n,r,i){for(var o,s=[],a=0,l=e.length,u=null!=t;a<l;a++)(o=e[a])&&(n&&!n(o,r,i)||(s.push(o),u&&t.push(a)));return s}function me(e,t,n,r,i,o){return r&&!r[y]&&(r=me(r)),i&&!i[y]&&(i=me(i,o)),te((function(o,s,l,u){var c,p,d,f,h=[],m=[],y=s.length,v=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)Q(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),b=!e||!o&&t?v:he(v,h,e,l,u);if(n?n(b,f=i||(o?e:y||r)?[]:s,l,u):f=b,r)for(c=he(f,m),r(c,[],l,u),p=c.length;p--;)(d=c[p])&&(f[m[p]]=!(b[m[p]]=d));if(o){if(i||e){if(i){for(c=[],p=f.length;p--;)(d=f[p])&&c.push(b[p]=d);i(null,f=[],c,u)}for(p=f.length;p--;)(d=f[p])&&(c=i?a.call(o,d):h[p])>-1&&(o[c]=!(s[c]=d))}}else f=he(f===s?f.splice(y,f.length):f),i?i(null,s,f,u):g.apply(s,f)}))}function ge(e){for(var t,n,i,s=e.length,l=r.relative[e[0].type],u=l||r.relative[" "],c=l?1:0,p=de((function(e){return e===t}),u,!0),d=de((function(e){return a.call(t,e)>-1}),u,!0),f=[function(e,n,r){var i=!l&&(r||n!=o)||((t=n).nodeType?p(e,n,r):d(e,n,r));return t=null,i}];c<s;c++)if(n=r.relative[e[c].type])f=[de(fe(f),n)];else{if((n=r.filter[e[c].type].apply(null,e[c].matches))[y]){for(i=++c;i<s&&!r.relative[e[i].type];i++);return me(c>1&&fe(f),c>1&&pe(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(T,"$1"),n,c<i&&ge(e.slice(c,i)),i<s&&ge(e=e.slice(i)),i<s&&pe(e))}f.push(n)}return fe(f)}function ye(e,t){var n,i=[],s=[],a=S[e+" "];if(!a){for(t||(t=ce(e)),n=t.length;n--;)(a=ge(t[n]))[y]?i.push(a):s.push(a);a=S(e,function(e,t){var n=t.length>0,i=e.length>0,s=function(s,a,l,c,p){var f,h,m,y=0,b="0",x=s&&[],q=[],S=o,C=s||i&&r.find.TAG("*",p),A=v+=null==S?1:Math.random()||.1,w=C.length;for(p&&(o=a==u||a||p);b!==w&&null!=(f=C[b]);b++){if(i&&f){for(h=0,a||f.ownerDocument==u||(le(f),l=!d);m=e[h++];)if(m(f,a||u,l)){g.call(c,f);break}p&&(v=A)}n&&((f=!m&&f)&&y--,s&&x.push(f))}if(y+=b,n&&b!==y){for(h=0;m=t[h++];)m(x,q,a,l);if(s){if(y>0)for(;b--;)x[b]||q[b]||(q[b]=E.call(c));q=he(q)}g.apply(c,q),p&&!s&&q.length>0&&y+t.length>1&&D.uniqueSort(c)}return p&&(v=A,o=S),x};return n?te(s):s}(s,i)),a.selector=e}return a}function ve(e,t,n,i){var o,s,a,l,u,c="function"==typeof e&&e,p=!i&&ce(e=c.selector||e);if(n=n||[],1===p.length){if((s=p[0]=p[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===t.nodeType&&d&&r.relative[s[1].type]){if(!(t=(r.find.ID(a.matches[0].replace(G,X),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=$.needsContext.test(e)?0:s.length;o--&&(a=s[o],!r.relative[l=a.type]);)if((u=r.find[l])&&(i=u(a.matches[0].replace(G,X),Y.test(s[0].type)&&ae(t.parentNode)||t))){if(s.splice(o,1),!(e=i.length&&pe(s)))return g.apply(n,i),n;break}}return(c||ye(e,p))(i,t,!d,n,!t||Y.test(e)&&ae(t.parentNode)||t),n}ue.prototype=r.filters=r.pseudos,r.setFilters=new ue,f.sortStable=y.split("").sort(O).join("")===y,le(),f.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(u.createElement("fieldset"))})),D.find=Q,D.expr[":"]=D.expr.pseudos,D.unique=D.uniqueSort,Q.compile=ye,Q.select=ve,Q.setDocument=le,Q.escape=D.escapeSelector,Q.getText=D.text,Q.isXML=D.isXMLDoc,Q.selectors=D.expr,Q.support=D.support,Q.uniqueSort=D.uniqueSort}();var P=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&D(e).is(n))break;r.push(e)}return r},_=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=D.expr.match.needsContext,R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function H(e,t,n){return h(t)?D.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?D.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?D.grep(e,(function(e){return a.call(t,e)>-1!==n})):D.filter(t,e,n)}D.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?D.find.matchesSelector(r,e)?[r]:[]:D.find.matches(e,D.grep(t,(function(e){return 1===e.nodeType})))},D.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(D(e).filter((function(){for(t=0;t<r;t++)if(D.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)D.find(e,i[t],n);return r>1?D.uniqueSort(n):n},filter:function(e){return this.pushStack(H(this,e||[],!1))},not:function(e){return this.pushStack(H(this,e||[],!0))},is:function(e){return!!H(this,"string"==typeof e&&N.test(e)?D(e):e||[],!1).length}});var F,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(D.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||F,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:B.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 D?t[0]:t,D.merge(this,D.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),R.test(r[1])&&D.isPlainObject(t))for(r in t)h(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):h(e)?void 0!==n.ready?n.ready(e):e(D):D.makeArray(e,this)}).prototype=D.fn,F=D(g);var j=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function V(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}D.fn.extend({has:function(e){var t=D(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(D.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],s="string"!=typeof e&&D(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&D.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?D.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(D(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(D.uniqueSort(D.merge(this.get(),D(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),D.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return P(e,"parentNode")},parentsUntil:function(e,t,n){return P(e,"parentNode",n)},next:function(e){return V(e,"nextSibling")},prev:function(e){return V(e,"previousSibling")},nextAll:function(e){return P(e,"nextSibling")},prevAll:function(e){return P(e,"previousSibling")},nextUntil:function(e,t,n){return P(e,"nextSibling",n)},prevUntil:function(e,t,n){return P(e,"previousSibling",n)},siblings:function(e){return _((e.parentNode||{}).firstChild,e)},children:function(e){return _(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),D.merge([],e.childNodes))}},(function(e,t){D.fn[e]=function(n,r){var i=D.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=D.filter(r,i)),this.length>1&&(z[e]||D.uniqueSort(i),j.test(e)&&i.reverse()),this.pushStack(i)}}));var $=/[^\x20\t\r\n\f]+/g;function U(e){return e}function W(e){throw e}function K(e,t,n,r){var i;try{e&&h(i=e.promise)?i.call(e).done(t).fail(n):e&&h(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}D.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return D.each(e.match($)||[],(function(e,n){t[n]=!0})),t}(e):D.extend({},e);var t,n,r,i,o=[],s=[],a=-1,l=function(){for(i=i||e.once,r=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,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(a=o.length-1,s.push(n)),function t(n){D.each(n,(function(n,r){h(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 D.each(arguments,(function(e,t){for(var n;(n=D.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(e){return e?D.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},D.extend({Deferred:function(t){var n=[["notify","progress",D.Callbacks("memory"),D.Callbacks("memory"),2],["resolve","done",D.Callbacks("once memory"),D.Callbacks("once memory"),0,"resolved"],["reject","fail",D.Callbacks("once memory"),D.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 D.Deferred((function(t){D.each(n,(function(n,r){var i=h(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&h(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 s(t,n,r,i){return function(){var a=this,l=arguments,u=function(){var e,u;if(!(t<o)){if((e=r.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==typeof e||"function"==typeof e)&&e.then,h(u)?i?u.call(e,s(o,n,U,i),s(o,n,W,i)):(o++,u.call(e,s(o,n,U,i),s(o,n,W,i),s(o,n,U,n.notifyWith))):(r!==U&&(a=void 0,l=[e]),(i||n.resolveWith)(a,l))}},c=i?u:function(){try{u()}catch(e){D.Deferred.exceptionHook&&D.Deferred.exceptionHook(e,c.error),t+1>=o&&(r!==W&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?c():(D.Deferred.getErrorHook?c.error=D.Deferred.getErrorHook():D.Deferred.getStackHook&&(c.error=D.Deferred.getStackHook()),e.setTimeout(c))}}return D.Deferred((function(e){n[0][3].add(s(0,e,h(i)?i:U,e.notifyWith)),n[1][3].add(s(0,e,h(t)?t:U)),n[2][3].add(s(0,e,h(r)?r:W))})).promise()},promise:function(e){return null!=e?D.extend(e,i):i}},o={};return D.each(n,(function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add((function(){r=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})),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),s=D.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||s.resolveWith(r,o)}};if(t<=1&&(K(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||h(o[n]&&o[n].then)))return s.then();for(;n--;)K(o[n],a(n),s.reject);return s.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;D.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Y.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},D.readyException=function(t){e.setTimeout((function(){throw t}))};var G=D.Deferred();function X(){g.removeEventListener("DOMContentLoaded",X),e.removeEventListener("load",X),D.ready()}D.fn.ready=function(e){return G.then(e).catch((function(e){D.readyException(e)})),this},D.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--D.readyWait:D.isReady)||(D.isReady=!0,!0!==e&&--D.readyWait>0||G.resolveWith(g,[D]))}}),D.ready.then=G.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(D.ready):(g.addEventListener("DOMContentLoaded",X),e.addEventListener("load",X));var J=function(e,t,n,r,i,o,s){var a=0,l=e.length,u=null==n;if("object"===b(n))for(a in i=!0,n)J(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,h(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(D(e),n)})),t))for(;a<l;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:u?t.call(e):l?t(e[0],n):o},Z=/^-ms-/,Q=/-([a-z])/g;function ee(e,t){return t.toUpperCase()}function te(e){return e.replace(Z,"ms-").replace(Q,ee)}var ne=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function re(){this.expando=D.expando+re.uid++}re.uid=1,re.prototype={cache:function(e){var t=e[this.expando];return t||(t={},ne(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[te(t)]=n;else for(r in t)i[te(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][te(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(te):(t=te(t))in r?[t]:t.match($)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||D.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&&!D.isEmptyObject(t)}};var ie=new re,oe=new re,se=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ae=/[A-Z]/g;function le(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ae,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:se.test(e)?JSON.parse(e):e)}(n)}catch(e){}oe.set(e,t,n)}else n=void 0;return n}D.extend({hasData:function(e){return oe.hasData(e)||ie.hasData(e)},data:function(e,t,n){return oe.access(e,t,n)},removeData:function(e,t){oe.remove(e,t)},_data:function(e,t,n){return ie.access(e,t,n)},_removeData:function(e,t){ie.remove(e,t)}}),D.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=oe.get(o),1===o.nodeType&&!ie.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=te(r.slice(5)),le(o,r,i[r]));ie.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){oe.set(this,e)})):J(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=oe.get(o,e))||void 0!==(n=le(o,e))?n:void 0;this.each((function(){oe.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){oe.remove(this,e)}))}}),D.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ie.get(e,t),n&&(!r||Array.isArray(n)?r=ie.access(e,t,D.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=D.queue(e,t),r=n.length,i=n.shift(),o=D._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){D.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ie.get(e,n)||ie.access(e,n,{empty:D.Callbacks("once memory").add((function(){ie.remove(e,[t+"queue",n])}))})}}),D.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?D.queue(this[0],e):void 0===t?this:this.each((function(){var n=D.queue(this,e,t);D._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&D.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){D.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=D.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=ie.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var ue=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ce=new RegExp("^(?:([+-])=|)("+ue+")([a-z%]*)$","i"),pe=["Top","Right","Bottom","Left"],de=g.documentElement,fe=function(e){return D.contains(e.ownerDocument,e)},he={composed:!0};de.getRootNode&&(fe=function(e){return D.contains(e.ownerDocument,e)||e.getRootNode(he)===e.ownerDocument});var me=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&fe(e)&&"none"===D.css(e,"display")};function ge(e,t,n,r){var i,o,s=20,a=r?function(){return r.cur()}:function(){return D.css(e,t,"")},l=a(),u=n&&n[3]||(D.cssNumber[t]?"":"px"),c=e.nodeType&&(D.cssNumber[t]||"px"!==u&&+l)&&ce.exec(D.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)D.style(e,t,c+u),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),c/=o;c*=2,D.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 ye={};function ve(e){var t,n=e.ownerDocument,r=e.nodeName,i=ye[r];return i||(t=n.body.appendChild(n.createElement(r)),i=D.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ye[r]=i,i)}function be(e,t){for(var n,r,i=[],o=0,s=e.length;o<s;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=ie.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&me(r)&&(i[o]=ve(r))):"none"!==n&&(i[o]="none",ie.set(r,"display",n)));for(o=0;o<s;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}D.fn.extend({show:function(){return be(this,!0)},hide:function(){return be(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){me(this)?D(this).show():D(this).hide()}))}});var xe,qe,De=/^(?:checkbox|radio)$/i,Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=g.createDocumentFragment().appendChild(g.createElement("div")),(qe=g.createElement("input")).setAttribute("type","radio"),qe.setAttribute("checked","checked"),qe.setAttribute("name","t"),xe.appendChild(qe),f.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",f.option=!!xe.lastChild;var Ee={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 Ae(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)?D.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n<r;n++)ie.set(e[n],"globalEval",!t||ie.get(t[n],"globalEval"))}Ee.tbody=Ee.tfoot=Ee.colgroup=Ee.caption=Ee.thead,Ee.th=Ee.td,f.option||(Ee.optgroup=Ee.option=[1,"<select multiple='multiple'>","</select>"]);var Ie=/<|&#?\w+;/;function Te(e,t,n,r,i){for(var o,s,a,l,u,c,p=t.createDocumentFragment(),d=[],f=0,h=e.length;f<h;f++)if((o=e[f])||0===o)if("object"===b(o))D.merge(d,o.nodeType?[o]:o);else if(Ie.test(o)){for(s=s||p.appendChild(t.createElement("div")),a=(Se.exec(o)||["",""])[1].toLowerCase(),l=Ee[a]||Ee._default,s.innerHTML=l[1]+D.htmlPrefilter(o)+l[2],c=l[0];c--;)s=s.lastChild;D.merge(d,s.childNodes),(s=p.firstChild).textContent=""}else d.push(t.createTextNode(o));for(p.textContent="",f=0;o=d[f++];)if(r&&D.inArray(o,r)>-1)i&&i.push(o);else if(u=fe(o),s=Ae(p.appendChild(o),"script"),u&&we(s),n)for(c=0;o=s[c++];)Ce.test(o.type||"")&&n.push(o);return p}var Me=/^([^.]*)(?:\.(.+)|)/;function Oe(){return!0}function Le(){return!1}function ke(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,a,n,r,t[a],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=Le;else if(!i)return e;return 1===o&&(s=i,i=function(e){return D().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=D.guid++)),e.each((function(){D.event.add(this,t,i,r,n)}))}function Pe(e,t,n){n?(ie.set(e,t,!1),D.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ie.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(D.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),ie.set(this,t,r),this[t](),n=ie.get(this,t),ie.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(ie.set(this,t,D.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Oe)}})):void 0===ie.get(e,t)&&D.event.add(e,t,Oe)}D.event={global:{},add:function(e,t,n,r,i){var o,s,a,l,u,c,p,d,f,h,m,g=ie.get(e);if(ne(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&D.find.matchesSelector(de,i),n.guid||(n.guid=D.guid++),(l=g.events)||(l=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(t){return void 0!==D&&D.event.triggered!==t.type?D.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match($)||[""]).length;u--;)f=m=(a=Me.exec(t[u])||[])[1],h=(a[2]||"").split(".").sort(),f&&(p=D.event.special[f]||{},f=(i?p.delegateType:p.bindType)||f,p=D.event.special[f]||{},c=D.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&D.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,r,h,s)||e.addEventListener&&e.addEventListener(f,s)),p.add&&(p.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),D.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,s,a,l,u,c,p,d,f,h,m,g=ie.hasData(e)&&ie.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match($)||[""]).length;u--;)if(f=m=(a=Me.exec(t[u])||[])[1],h=(a[2]||"").split(".").sort(),f){for(p=D.event.special[f]||{},d=l[f=(r?p.delegateType:p.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,p.remove&&p.remove.call(e,c));s&&!d.length&&(p.teardown&&!1!==p.teardown.call(e,h,g.handle)||D.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)D.event.remove(e,f+t[u],n,r,!0);D.isEmptyObject(l)&&ie.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),l=D.event.fix(e),u=(ie.get(this,"events")||Object.create(null))[l.type]||[],c=D.event.special[l.type]||{};for(a[0]=l,t=1;t<arguments.length;t++)a[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=D.event.handlers.call(this,l,u),t=0;(i=s[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=((D.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!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,s,a=[],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=[],s={},n=0;n<l;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?D(i,this).index(u)>-1:D.find(i,this,null,[u]).length),s[i]&&o.push(r);o.length&&a.push({elem:u,handlers:o})}return u=this,l<t.length&&a.push({elem:u,handlers:t.slice(l)}),a},addProp:function(e,t){Object.defineProperty(D.Event.prototype,e,{enumerable:!0,configurable:!0,get:h(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[D.expando]?e:new D.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return De.test(t.type)&&t.click&&C(t,"input")&&Pe(t,"click",!0),!1},trigger:function(e){var t=this||e;return De.test(t.type)&&t.click&&C(t,"input")&&Pe(t,"click"),!0},_default:function(e){var t=e.target;return De.test(t.type)&&t.click&&C(t,"input")&&ie.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},D.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},D.Event=function(e,t){if(!(this instanceof D.Event))return new D.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Oe:Le,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&&D.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[D.expando]=!0},D.Event.prototype={constructor:D.Event,isDefaultPrevented:Le,isPropagationStopped:Le,isImmediatePropagationStopped:Le,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Oe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Oe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Oe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},D.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},D.event.addProp),D.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(g.documentMode){var n=ie.get(this,"handle"),r=D.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else D.event.simulate(t,e.target,D.event.fix(e))}D.event.special[e]={setup:function(){var r;if(Pe(this,e,!0),!g.documentMode)return!1;(r=ie.get(this,t))||this.addEventListener(t,n),ie.set(this,t,(r||0)+1)},trigger:function(){return Pe(this,e),!0},teardown:function(){var e;if(!g.documentMode)return!1;(e=ie.get(this,t)-1)?ie.set(this,t,e):(this.removeEventListener(t,n),ie.remove(this,t))},_default:function(t){return ie.get(t.target,e)},delegateType:t},D.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=g.documentMode?this:r,o=ie.get(i,t);o||(g.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),ie.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=g.documentMode?this:r,o=ie.get(i,t)-1;o?ie.set(i,t,o):(g.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),ie.remove(i,t))}}})),D.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){D.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||D.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),D.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,D(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=Le),this.each((function(){D.event.remove(this,e,n,t)}))}});var _e=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,Re=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function He(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&D(e).children("tbody")[0]||e}function Fe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Be(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var n,r,i,o,s,a;if(1===t.nodeType){if(ie.hasData(e)&&(a=ie.get(e).events))for(i in ie.remove(t,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)D.event.add(t,i,a[i][n]);oe.hasData(e)&&(o=oe.access(e),s=D.extend({},o),oe.set(t,s))}}function ze(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 Ve(e,t,n,r){t=o(t);var i,s,a,l,u,c,p=0,d=e.length,m=d-1,g=t[0],y=h(g);if(y||d>1&&"string"==typeof g&&!f.checkClone&&Ne.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),Ve(o,t,n,r)}));if(d&&(s=(i=Te(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(l=(a=D.map(Ae(i,"script"),Fe)).length;p<d;p++)u=i,p!==m&&(u=D.clone(u,!0,!0),l&&D.merge(a,Ae(u,"script"))),n.call(e[p],u,p);if(l)for(c=a[a.length-1].ownerDocument,D.map(a,Be),p=0;p<l;p++)u=a[p],Ce.test(u.type||"")&&!ie.access(u,"globalEval")&&D.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?D._evalUrl&&!u.noModule&&D._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):v(u.textContent.replace(Re,""),u,c))}return e}function $e(e,t,n){for(var r,i=t?D.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||D.cleanData(Ae(r)),r.parentNode&&(n&&fe(r)&&we(Ae(r,"script")),r.parentNode.removeChild(r));return e}D.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),l=fe(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||D.isXMLDoc(e)))for(s=Ae(a),r=0,i=(o=Ae(e)).length;r<i;r++)ze(o[r],s[r]);if(t)if(n)for(o=o||Ae(e),s=s||Ae(a),r=0,i=o.length;r<i;r++)je(o[r],s[r]);else je(e,a);return(s=Ae(a,"script")).length>0&&we(s,!l&&Ae(e,"script")),a},cleanData:function(e){for(var t,n,r,i=D.event.special,o=0;void 0!==(n=e[o]);o++)if(ne(n)){if(t=n[ie.expando]){if(t.events)for(r in t.events)i[r]?D.event.remove(n,r):D.removeEvent(n,r,t.handle);n[ie.expando]=void 0}n[oe.expando]&&(n[oe.expando]=void 0)}}}),D.fn.extend({detach:function(e){return $e(this,e,!0)},remove:function(e){return $e(this,e)},text:function(e){return J(this,(function(e){return void 0===e?D.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 Ve(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||He(this,e).appendChild(e)}))},prepend:function(){return Ve(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=He(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ve(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ve(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&&(D.cleanData(Ae(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return D.clone(this,e,t)}))},html:function(e){return J(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)&&!Ee[(Se.exec(e)||["",""])[1].toLowerCase()]){e=D.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(D.cleanData(Ae(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ve(this,arguments,(function(t){var n=this.parentNode;D.inArray(this,e)<0&&(D.cleanData(Ae(this)),n&&n.replaceChild(t,this))}),e)}}),D.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){D.fn[e]=function(e){for(var n,r=[],i=D(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),D(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}}));var Ue=new RegExp("^("+ue+")(?!px)[a-z%]+$","i"),We=/^--/,Ke=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ye=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},Ge=new RegExp(pe.join("|"),"i");function Xe(e,t,n){var r,i,o,s,a=We.test(t),l=e.style;return(n=n||Ke(e))&&(s=n.getPropertyValue(t)||n[t],a&&s&&(s=s.replace(T,"$1")||void 0),""!==s||fe(e)||(s=D.style(e,t)),!f.pixelBoxStyles()&&Ue.test(s)&&Ge.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==s?s+"":s}function Je(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%",de.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,l=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),de.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,s,a,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,D.extend(f,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==a&&(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",de.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,de.removeChild(t)),a}}))}();var Ze=["Webkit","Moz","ms"],Qe=g.createElement("div").style,et={};function tt(e){var t=D.cssProps[e]||et[e];return t||(e in Qe?e:et[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Ze.length;n--;)if((e=Ze[n]+t)in Qe)return e}(e)||e)}var nt=/^(none|table(?!-c[ea]).+)/,rt={position:"absolute",visibility:"hidden",display:"block"},it={letterSpacing:"0",fontWeight:"400"};function ot(e,t,n){var r=ce.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function st(e,t,n,r,i,o){var s="width"===t?1:0,a=0,l=0,u=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(u+=D.css(e,n+pe[s],!0,i)),r?("content"===n&&(l-=D.css(e,"padding"+pe[s],!0,i)),"margin"!==n&&(l-=D.css(e,"border"+pe[s]+"Width",!0,i))):(l+=D.css(e,"padding"+pe[s],!0,i),"padding"!==n?l+=D.css(e,"border"+pe[s]+"Width",!0,i):a+=D.css(e,"border"+pe[s]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-a-.5))||0),l+u}function at(e,t,n){var r=Ke(e),i=(!f.boxSizingReliable()||n)&&"border-box"===D.css(e,"boxSizing",!1,r),o=i,s=Xe(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(s)){if(!n)return s;s="auto"}return(!f.boxSizingReliable()&&i||!f.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===D.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===D.css(e,"boxSizing",!1,r),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+st(e,t,n||(i?"border":"content"),o,r,s)+"px"}function lt(e,t,n,r,i){return new lt.prototype.init(e,t,n,r,i)}D.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Xe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!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,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=te(t),l=We.test(t),u=e.style;if(l||(t=tt(a)),s=D.cssHooks[t]||D.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:u[t];"string"==(o=typeof n)&&(i=ce.exec(n))&&i[1]&&(n=ge(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(D.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,s,a=te(t);return We.test(t)||(t=tt(a)),(s=D.cssHooks[t]||D.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Xe(e,t,r)),"normal"===i&&t in it&&(i=it[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),D.each(["height","width"],(function(e,t){D.cssHooks[t]={get:function(e,n,r){if(n)return!nt.test(D.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?at(e,t,r):Ye(e,rt,(function(){return at(e,t,r)}))},set:function(e,n,r){var i,o=Ke(e),s=!f.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===D.css(e,"boxSizing",!1,o),l=r?st(e,t,r,a,o):0;return a&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-st(e,t,"border",!1,o)-.5)),l&&(i=ce.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=D.css(e,t)),ot(0,n,l)}}})),D.cssHooks.marginLeft=Je(f.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Xe(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),D.each({margin:"",padding:"",border:"Width"},(function(e,t){D.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(D.cssHooks[e+t].set=ot)})),D.fn.extend({css:function(e,t){return J(this,(function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=Ke(e),i=t.length;s<i;s++)o[t[s]]=D.css(e,t[s],!1,r);return o}return void 0!==n?D.style(e,t,n):D.css(e,t)}),e,t,arguments.length>1)}}),D.Tween=lt,lt.prototype={constructor:lt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||D.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(D.cssNumber[n]?"":"px")},cur:function(){var e=lt.propHooks[this.prop];return e&&e.get?e.get(this):lt.propHooks._default.get(this)},run:function(e){var t,n=lt.propHooks[this.prop];return this.options.duration?this.pos=t=D.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):lt.propHooks._default.set(this),this}},lt.prototype.init.prototype=lt.prototype,lt.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=D.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){D.fx.step[e.prop]?D.fx.step[e.prop](e):1!==e.elem.nodeType||!D.cssHooks[e.prop]&&null==e.elem.style[tt(e.prop)]?e.elem[e.prop]=e.now:D.style(e.elem,e.prop,e.now+e.unit)}}},lt.propHooks.scrollTop=lt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},D.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},D.fx=lt.prototype.init,D.fx.step={};var ut,ct,pt=/^(?:toggle|show|hide)$/,dt=/queueHooks$/;function ft(){ct&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(ft):e.setTimeout(ft,D.fx.interval),D.fx.tick())}function ht(){return e.setTimeout((function(){ut=void 0})),ut=Date.now()}function mt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function gt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,s=i.length;o<s;o++)if(r=i[o].call(n,t,e))return r}function yt(e,t,n){var r,i,o=0,s=yt.prefilters.length,a=D.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=ut||ht(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,s=u.tweens.length;o<s;o++)u.tweens[o].run(r);return a.notifyWith(e,[u,r,n]),r<1&&s?n:(s||a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u]),!1)},u=a.promise({elem:e,props:D.extend({},t),opts:D.extend(!0,{specialEasing:{},easing:D.easing._default},n),originalProperties:t,originalOptions:n,startTime:ut||ht(),duration:n.duration,tweens:[],createTween:function(t,n){var r=D.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?(a.notifyWith(e,[u,1,0]),a.resolveWith(e,[u,t])):a.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,s;for(n in e)if(i=t[r=te(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(s=D.cssHooks[r])&&"expand"in s)for(n in o=s.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<s;o++)if(r=yt.prefilters[o].call(u,e,c,u.opts))return h(r.stop)&&(D._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return D.map(c,gt,u),h(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),D.fx.timer(D.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}D.Animation=D.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ge(n.elem,e,ce.exec(t),n),n}]},tweener:function(e,t){h(e)?(t=e,e=["*"]):e=e.match($);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,s,a,l,u,c,p="width"in t||"height"in t,d=this,f={},h=e.style,m=e.nodeType&&me(e),g=ie.get(e,"fxshow");for(r in n.queue||(null==(s=D._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--,D.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],pt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}f[r]=g&&g[r]||D.style(e,r)}if((l=!D.isEmptyObject(t))||!D.isEmptyObject(f))for(r in p&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=g&&g.display)&&(u=ie.get(e,"display")),"none"===(c=D.css(e,"display"))&&(u?c=u:(be([e],!0),u=e.style.display||u,c=D.css(e,"display"),be([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===D.css(e,"float")&&(l||(d.done((function(){h.display=u})),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=ie.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&be([e],!0),d.done((function(){for(r in m||be([e]),ie.remove(e,"fxshow"),f)D.style(e,r,f[r])}))),l=gt(m?g[r]:0,r,d),r in g||(g[r]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),D.speed=function(e,t,n){var r=e&&"object"==typeof e?D.extend({},e):{complete:n||!n&&t||h(e)&&e,duration:e,easing:n&&t||t&&!h(t)&&t};return D.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in D.fx.speeds?r.duration=D.fx.speeds[r.duration]:r.duration=D.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){h(r.old)&&r.old.call(this),r.queue&&D.dequeue(this,r.queue)},r},D.fn.extend({fadeTo:function(e,t,n,r){return this.filter(me).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=D.isEmptyObject(e),o=D.speed(t,n,r),s=function(){var t=yt(this,D.extend({},e),o);(i||ie.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===o.queue?this.each(s):this.queue(o.queue,s)},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=D.timers,s=ie.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&dt.test(i)&&r(s[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||D.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=ie.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=D.timers,s=r?r.length:0;for(n.finish=!0,D.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<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),D.each(["toggle","show","hide"],(function(e,t){var n=D.fn[t];D.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(mt(t,!0),e,r,i)}})),D.each({slideDown:mt("show"),slideUp:mt("hide"),slideToggle:mt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){D.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),D.timers=[],D.fx.tick=function(){var e,t=0,n=D.timers;for(ut=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||D.fx.stop(),ut=void 0},D.fx.timer=function(e){D.timers.push(e),D.fx.start()},D.fx.interval=13,D.fx.start=function(){ct||(ct=!0,ft())},D.fx.stop=function(){ct=null},D.fx.speeds={slow:600,fast:200,_default:400},D.fn.delay=function(t,n){return t=D.fx&&D.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=g.createElement("input"),t=g.createElement("select").appendChild(g.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=g.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var vt,bt=D.expr.attrHandle;D.fn.extend({attr:function(e,t){return J(this,D.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){D.removeAttr(this,e)}))}}),D.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?D.prop(e,t,n):(1===o&&D.isXMLDoc(e)||(i=D.attrHooks[t.toLowerCase()]||(D.expr.match.bool.test(t)?vt:void 0)),void 0!==n?null===n?void D.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=D.find.attr(e,t))?void 0:r)},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,r=0,i=t&&t.match($);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),vt={set:function(e,t,n){return!1===t?D.removeAttr(e,n):e.setAttribute(n,n),n}},D.each(D.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=bt[t]||D.find.attr;bt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=bt[s],bt[s]=i,i=null!=n(e,t,r)?s:null,bt[s]=o),i}}));var xt=/^(?:input|select|textarea|button)$/i,qt=/^(?:a|area)$/i;function Dt(e){return(e.match($)||[]).join(" ")}function St(e){return e.getAttribute&&e.getAttribute("class")||""}function Ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match($)||[]}D.fn.extend({prop:function(e,t){return J(this,D.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[D.propFix[e]||e]}))}}),D.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&D.isXMLDoc(e)||(t=D.propFix[t]||t,i=D.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=D.find.attr(e,"tabindex");return t?parseInt(t,10):xt.test(e.nodeName)||qt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(D.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)}}),D.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){D.propFix[this.toLowerCase()]=this})),D.fn.extend({addClass:function(e){var t,n,r,i,o,s;return h(e)?this.each((function(t){D(this).addClass(e.call(this,t,St(this)))})):(t=Ct(e)).length?this.each((function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=Dt(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,o,s;return h(e)?this.each((function(t){D(this).removeClass(e.call(this,t,St(this)))})):arguments.length?(t=Ct(e)).length?this.each((function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=Dt(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,s=typeof e,a="string"===s||Array.isArray(e);return h(e)?this.each((function(n){D(this).toggleClass(e.call(this,n,St(this),t),t)})):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=Ct(e),this.each((function(){if(a)for(o=D(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==s||((r=St(this))&&ie.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":ie.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Dt(St(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\r/g;D.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=h(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,D(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=D.map(i,(function(e){return null==e?"":e+""}))),(t=D.valHooks[this.type]||D.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=D.valHooks[i.type]||D.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Et,""):null==n?"":n:void 0}}),D.extend({valHooks:{option:{get:function(e){var t=D.find.attr(e,"value");return null!=t?t:Dt(D.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=D(n).val(),s)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=D.makeArray(t),s=i.length;s--;)((r=i[s]).selected=D.inArray(D.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),D.each(["radio","checkbox"],(function(){D.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=D.inArray(D(e).val(),t)>-1}},f.checkOn||(D.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var At=e.location,wt={guid:Date.now()},It=/\?/;D.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||D.error("Invalid XML: "+(r?D.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Tt=/^(?:focusinfocus|focusoutblur)$/,Mt=function(e){e.stopPropagation()};D.extend(D.event,{trigger:function(t,n,r,i){var o,s,a,l,u,p,d,f,y=[r||g],v=c.call(t,"type")?t.type:t,b=c.call(t,"namespace")?t.namespace.split("."):[];if(s=f=a=r=r||g,3!==r.nodeType&&8!==r.nodeType&&!Tt.test(v+D.event.triggered)&&(v.indexOf(".")>-1&&(b=v.split("."),v=b.shift(),b.sort()),u=v.indexOf(":")<0&&"on"+v,(t=t[D.expando]?t:new D.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]:D.makeArray(n,[t]),d=D.event.special[v]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!m(r)){for(l=d.delegateType||v,Tt.test(l+v)||(s=s.parentNode);s;s=s.parentNode)y.push(s),a=s;a===(r.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,(p=(ie.get(s,"events")||Object.create(null))[t.type]&&ie.get(s,"handle"))&&p.apply(s,n),(p=u&&s[u])&&p.apply&&ne(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=v,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!ne(r)||u&&h(r[v])&&!m(r)&&((a=r[u])&&(r[u]=null),D.event.triggered=v,t.isPropagationStopped()&&f.addEventListener(v,Mt),r[v](),t.isPropagationStopped()&&f.removeEventListener(v,Mt),D.event.triggered=void 0,a&&(r[u]=a)),t.result}},simulate:function(e,t,n){var r=D.extend(new D.Event,n,{type:e,isSimulated:!0});D.event.trigger(r,null,t)}}),D.fn.extend({trigger:function(e,t){return this.each((function(){D.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return D.event.trigger(e,t,n,!0)}});var Ot=/\[\]$/,Lt=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;function _t(e,t,n,r){var i;if(Array.isArray(t))D.each(t,(function(t,i){n||Ot.test(e)?r(e,i):_t(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)_t(e+"["+i+"]",t[i],n,r)}D.param=function(e,t){var n,r=[],i=function(e,t){var n=h(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,(function(){i(this.name,this.value)}));else for(n in e)_t(n,e[n],t,i);return r.join("&")},D.fn.extend({serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&Pt.test(this.nodeName)&&!kt.test(e)&&(this.checked||!De.test(e))})).map((function(e,t){var n=D(this).val();return null==n?null:Array.isArray(n)?D.map(n,(function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}})):{name:t.name,value:n.replace(Lt,"\r\n")}})).get()}});var Nt=/%20/g,Rt=/#.*$/,Ht=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:GET|HEAD)$/,jt=/^\/\//,zt={},Vt={},$t="*/".concat("*"),Ut=g.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match($)||[];if(h(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Kt(e,t,n,r){var i={},o=e===Vt;function s(a){var l;return i[a]=!0,D.each(e[a]||[],(function(e,a){var u=a(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),s(u),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Yt(e,t){var n,r,i=D.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&D.extend(!0,e,r),e}Ut.href=At.href,D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:At.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(At.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,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":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Yt(Yt(e,D.ajaxSettings),t):Yt(D.ajaxSettings,e)},ajaxPrefilter:Wt(zt),ajaxTransport:Wt(Vt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,i,o,s,a,l,u,c,p,d,f=D.ajaxSetup({},n),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?D(h):D.event,y=D.Deferred(),v=D.Callbacks("once memory"),b=f.statusCode||{},x={},q={},S="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=Ft.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 u?o:null},setRequestHeader:function(e,t){return null==u&&(e=q[e.toLowerCase()]=q[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)C.always(e[C.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||S;return r&&r.abort(t),E(0,t),this}};if(y.promise(C),f.url=((t||f.url||At.href)+"").replace(jt,At.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match($)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=D.param(f.data,f.traditional)),Kt(zt,f,n,C),u)return C;for(p in(c=D.event&&f.global)&&0==D.active++&&D.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Bt.test(f.type),i=f.url.replace(Rt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Nt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(It.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(Ht,"$1"),d=(It.test(i)?"&":"?")+"_="+wt.guid+++d),f.url=i+d),f.ifModified&&(D.lastModified[i]&&C.setRequestHeader("If-Modified-Since",D.lastModified[i]),D.etag[i]&&C.setRequestHeader("If-None-Match",D.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+$t+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,C,f)||u))return C.abort();if(S="abort",v.add(f.complete),C.done(f.success),C.fail(f.error),r=Kt(Vt,f,n,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,f]),u)return C;f.async&&f.timeout>0&&(a=e.setTimeout((function(){C.abort("timeout")}),f.timeout));try{u=!1,r.send(x,E)}catch(e){if(u)throw e;E(-1,e)}}else E(-1,"No Transport");function E(t,n,s,l){var p,d,g,x,q,S=n;u||(u=!0,a&&e.clearTimeout(a),r=void 0,o=l||"",C.readyState=t>0?4:0,p=t>=200&&t<300||304===t,s&&(x=function(e,t,n){for(var r,i,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[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}s||(s=i)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,C,s)),!p&&D.inArray("script",f.dataTypes)>-1&&D.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,s,a,l,u={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];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(!(s=u[l+" "+o]||u["* "+o]))for(i in u)if((a=i.split(" "))[1]===o&&(s=u[l+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[i]:!0!==u[i]&&(o=a[0],c.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,C,p),p?(f.ifModified&&((q=C.getResponseHeader("Last-Modified"))&&(D.lastModified[i]=q),(q=C.getResponseHeader("etag"))&&(D.etag[i]=q)),204===t||"HEAD"===f.type?S="nocontent":304===t?S="notmodified":(S=x.state,d=x.data,p=!(g=x.error))):(g=S,!t&&S||(S="error",t<0&&(t=0))),C.status=t,C.statusText=(n||S)+"",p?y.resolveWith(h,[d,S,C]):y.rejectWith(h,[C,S,g]),C.statusCode(b),b=void 0,c&&m.trigger(p?"ajaxSuccess":"ajaxError",[C,f,p?d:g]),v.fireWith(h,[C,S]),c&&(m.trigger("ajaxComplete",[C,f]),--D.active||D.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return D.get(e,t,n,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],(function(e,t){D[t]=function(e,n,r,i){return h(n)&&(i=i||r,r=n,n=void 0),D.ajax(D.extend({url:e,type:t,dataType:i,data:n,success:r},D.isPlainObject(e)&&e))}})),D.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),D._evalUrl=function(e,t,n){return D.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){D.globalEval(e,t,n)}})},D.fn.extend({wrapAll:function(e){var t;return this[0]&&(h(e)&&(e=e.call(this[0])),t=D(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 h(e)?this.each((function(t){D(this).wrapInner(e.call(this,t))})):this.each((function(){var t=D(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h(e);return this.each((function(n){D(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){D(this).replaceWith(this.childNodes)})),this}}),D.expr.pseudos.hidden=function(e){return!D.expr.pseudos.visible(e)},D.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},D.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Gt={0:200,1223:204},Xt=D.ajaxSettings.xhr();f.cors=!!Xt&&"withCredentials"in Xt,f.ajax=Xt=!!Xt,D.ajaxTransport((function(t){var n,r;if(f.cors||Xt&&!t.crossDomain)return{send:function(i,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||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=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(Gt[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(),r=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),D.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),D.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 D.globalEval(e),e}}}),D.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),D.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=D("<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 Jt,Zt=[],Qt=/(=)\?(?=&|$)|\?\?/;D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Zt.pop()||D.expando+"_"+wt.guid++;return this[e]=!0,e}}),D.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,s,a=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||D.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always((function(){void 0===o?D(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Zt.push(i)),s&&h(o)&&o(s[0]),s=o=void 0})),"script"})),f.createHTMLDocument=((Jt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),D.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(r)):t=g),o=!n&&[],(i=R.exec(e))?[t.createElement(i[1])]:(i=Te([e],t,o),o&&o.length&&D(o).remove(),D.merge([],i.childNodes)));var r,i,o},D.fn.load=function(e,t,n){var r,i,o,s=this,a=e.indexOf(" ");return a>-1&&(r=Dt(e.slice(a)),e=e.slice(0,a)),h(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&D.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,s.html(r?D("<div>").append(D.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},D.expr.pseudos.animated=function(e){return D.grep(D.timers,(function(t){return e===t.elem})).length},D.offset={setOffset:function(e,t,n){var r,i,o,s,a,l,u=D.css(e,"position"),c=D(e),p={};"static"===u&&(e.style.position="relative"),a=c.offset(),o=D.css(e,"top"),l=D.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(l)||0),h(t)&&(t=t.call(e,n,D.extend({},a))),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):c.css(p)}},D.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){D.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"===D.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"===D.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=D(e).offset()).top+=D.css(e,"borderTopWidth",!0),i.left+=D.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-D.css(r,"marginTop",!0),left:t.left-i.left-D.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===D.css(e,"position");)e=e.offsetParent;return e||de}))}}),D.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;D.fn[e]=function(r){return J(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)}})),D.each(["top","left"],(function(e,t){D.cssHooks[t]=Je(f.pixelPosition,(function(e,n){if(n)return n=Xe(e,t),Ue.test(n)?D(e).position()[t]+"px":n}))})),D.each({Height:"height",Width:"width"},(function(e,t){D.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){D.fn[r]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return J(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?D.css(t,n,a):D.style(t,n,i,a)}),t,s?i:void 0,s)}}))})),D.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){D.fn[t]=function(e){return this.on(t,e)}})),D.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)}}),D.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){D.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;D.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),h(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||D.guid++,o},D.holdReady=function(e){e?D.readyWait++:D.ready(!0)},D.isArray=Array.isArray,D.parseJSON=JSON.parse,D.nodeName=C,D.isFunction=h,D.isWindow=m,D.camelCase=te,D.type=b,D.now=Date.now,D.isNumeric=function(e){var t=D.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},D.trim=function(e){return null==e?"":(e+"").replace(en,"$1")};var tn=e.jQuery,nn=e.$;return D.noConflict=function(t){return e.$===D&&(e.$=nn),t&&e.jQuery===D&&(e.jQuery=tn),D},void 0===t&&(e.jQuery=e.$=D),D}));var I=E(w.exports),T={"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-й процентиль"}}};const M={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function O(e){return M[e]||e}function L(e){return function(t,n,r){let i,o,s,a,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.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=O(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),s=s||new e.Manager(r),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))})),i.gestures.forEach((t=>{const n=O(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 p(){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,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),p(),u&&c()},off(){u=!1,p()},on(){u=!0,0===l.length&&c()},destroy(){p(),s&&s.destroy(),s=null,o=null,i=null}}}}var k={exports:{}};
33
18
  /*! Hammer.JS - v2.0.7 - 2016-04-22
34
19
  * http://hammerjs.github.io/
35
20
  *
36
21
  * Copyright (c) 2016 Jorik Tangelder;
37
- * Licensed under the MIT license */
38
- !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 p(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function h(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=h((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=h((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 q(e,t,n){f(E(t),(function(t){e.addEventListener(t,n,!1)}))}function D(e,t,n){f(E(t),(function(t){e.removeEventListener(t,n,!1)}))}function S(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function C(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function w(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 A(e){return Array.prototype.slice.call(e,0)}function M(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];w(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 I(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 T=1;function k(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var O="ontouchstart"in t,L=I(t,"PointerEvent")!==i,N=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",_="mouse",R=24,H=["x","y"],F=["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 B(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=z(t));o>1&&!n.firstMultiple?n.firstMultiple=z(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,p=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,p),t.distance=W(l,p),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=u(d.x)>u(d.y)?d.x:d.y,t.scale=s?(f=s.pointers,h=r,W(h[0],h[1],F)/W(f[0],f[1],F)):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(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,p=t.deltaY-s.deltaY,d=$(l,c,p);r=d.x,o=d.y,n=u(d.x)>u(d.y)?d.x:d.y,a=U(c,p),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var f,h;var m=e.element;S(t.srcEvent.target,m)&&(m=t.srcEvent.target);t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function z(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 $(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 W(e,t,n){n||(n=H);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=H);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(k(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},G="mousedown",X="mousemove mouseup";function J(){this.evEl=G,this.evWin=X,this.pressed=!1,j.apply(this,arguments)}y(J,j,{handler:function(e){var t=K[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:_,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:P,3:"pen",4:_,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,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==P,s=w(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,j.apply(this,arguments)}function se(e,t){var n=A(e.touches),r=A(e.changedTouches);return 12&t&&(n=M(n.concat(r),"identifier",!0)),[n,r]}y(ae,j,{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:P,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},j.apply(this,arguments)}function pe(e,t){var n=A(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=A(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return S(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?[M(o.concat(s),"identifier",!0),s]:void 0}y(ce,j,{handler:function(e){var t=le[e.type],n=pe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}});function de(){j.apply(this,arguments);var e=v(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function fe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,he.call(this,t)):12&e&&he.call(this,t)}function he(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(de,j,{handler:function(e,t,n){var r=n.pointerType==P,i=n.pointerType==_;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)fe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=I(s.style,"touchAction"),ye=ge!==i,ve="compute",be="auto",xe="manipulation",qe="none",De="pan-x",Se="pan-y",Ce=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 Ee(e,t){this.manager=e,this.set(t)}Ee.prototype={set:function(e){e==ve&&(e=this.compute()),ye&&this.manager.element.style&&Ce[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(C(e,qe))return qe;var t=C(e,De),n=C(e,Se);if(t&&n)return qe;if(t||n)return t?De:Se;if(C(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=C(r,qe)&&!Ce[qe],o=C(r,Se)&&!Ce[Se],a=C(r,De)&&!Ce[De];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&R?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var we=32;function Ae(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Me(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ie(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Te(e,t){var n=t.manager;return n?n.get(e):e}function ke(){Ae.apply(this,arguments)}function Oe(){ke.apply(this,arguments),this.pX=null,this.pY=null}function Le(){ke.apply(this,arguments)}function Ne(){Ae.apply(this,arguments),this._timer=null,this._input=null}function Pe(){ke.apply(this,arguments)}function _e(){ke.apply(this,arguments)}function Re(){Ae.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function He(e,t){return(t=t||{}).recognizers=x(t.recognizers,He.defaults.preset),new Fe(e,t)}Ae.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=Te(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Te(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===w(t,e=Te(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Te(e,this);var t=w(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+Me(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Me(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=we},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=we);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(ke,Ae,{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:we}}),y(Oe,ke,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Se),e&R&&t.push(De),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 ke.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=Ie(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Le,ke,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[qe]},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,Ae,{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=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return we},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(Pe,ke,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[qe]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(_e,ke,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Oe.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&R&&(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=Ie(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Re,Ae,{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||W(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=p((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return we},failTimeout:function(){return this._timer=p((function(){this.state=we}),this.options.interval,this),we},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),He.VERSION="2.0.7",He.defaults={domEvents:!1,touchAction:ve,enable:!0,inputTarget:null,inputClass:null,preset:[[Pe,{enable:!1}],[Le,{enable:!1},["rotate"]],[_e,{direction:6}],[Oe,{direction:6},["swipe"]],[Re],[Re,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},He.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||(L?ne:N?ce:O?de:J))(n,B),this.touchAction=new Ee(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,r=e.element;r.style&&(f(e.options.cssProps,(function(i,o){n=I(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.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 Ae)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=w(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(E(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(E(e),(function(e){t?n[e]&&n[e].splice(w(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&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(He,{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:we,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:R,DIRECTION_ALL:30,Manager:Fe,Input:j,TouchAction:Ee,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:de,SingleTouchInput:ae,Recognizer:Ae,AttrRecognizer:ke,Tap:Re,Pan:Oe,Swipe:_e,Pinch:Le,Rotate:Pe,Press:Ne,on:q,off:D,each:f,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:I}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=He,e.exports?e.exports=He:t.Hammer=He}(window,document)}(P);var _=N;function R(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var H={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};const F={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 j(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 B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function z(e){return z="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},z(e)}function V(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 r=n.call(e,"string");if("object"!=typeof r)return r;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 $(e){return function(e){if(Array.isArray(e))return U(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 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}var W=Object.prototype.hasOwnProperty,Y=Object.prototype.toString,K=Object.defineProperty,G=Object.getOwnPropertyDescriptor,X=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Y.call(e)},J=function(e){if(!e||"[object Object]"!==Y.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)},Z=function(e,t){K&&"__proto__"===t.name?K(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Q=function(e,t){if("__proto__"===t){if(!W.call(e,t))return;if(G)return G(e,t).value}return e[t]},ee=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=Q(s,n),s!==(i=Q(t,n))&&(c&&i&&(J(i)||(o=X(i)))?(o?(o=!1,a=r&&X(r)?r:[]):a=r&&J(r)?r:{},Z(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Z(s,{name:n,newValue:i}));return s};function te(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 ne(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 re(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function ie(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 oe(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 ae(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function se(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function le(){}var ue=1/.7,ce="\\s*([+-]?\\d+)\\s*",pe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",de="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fe=/^#([0-9a-f]{3,8})$/,he=new RegExp("^rgb\\("+[ce,ce,ce]+"\\)$"),me=new RegExp("^rgb\\("+[de,de,de]+"\\)$"),ge=new RegExp("^rgba\\("+[ce,ce,ce,pe]+"\\)$"),ye=new RegExp("^rgba\\("+[de,de,de,pe]+"\\)$"),ve=new RegExp("^hsl\\("+[pe,de,de]+"\\)$"),be=new RegExp("^hsla\\("+[pe,de,de,pe]+"\\)$"),xe={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 qe(){return this.rgb().formatHex()}function De(){return this.rgb().formatRgb()}function Se(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ce(t):3===n?new Me(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ee(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ee(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=he.exec(e))?new Me(t[1],t[2],t[3],1):(t=me.exec(e))?new Me(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ge.exec(e))?Ee(t[1],t[2],t[3],t[4]):(t=ye.exec(e))?Ee(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ve.exec(e))?Oe(t[1],t[2]/100,t[3]/100,1):(t=be.exec(e))?Oe(t[1],t[2]/100,t[3]/100,t[4]):xe.hasOwnProperty(e)?Ce(xe[e]):"transparent"===e?new Me(NaN,NaN,NaN,0):null}function Ce(e){return new Me(e>>16&255,e>>8&255,255&e,1)}function Ee(e,t,n,r){return r<=0&&(e=t=n=NaN),new Me(e,t,n,r)}function we(e){return e instanceof le||(e=Se(e)),e?new Me((e=e.rgb()).r,e.g,e.b,e.opacity):new Me}function Ae(e,t,n,r){return 1===arguments.length?we(e):new Me(e,t,n,null==r?1:r)}function Me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ie(){return"#"+ke(this.r)+ke(this.g)+ke(this.b)}function Te(){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 ke(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Oe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ne(e,t,n,r)}function Le(e){if(e instanceof Ne)return new Ne(e.h,e.s,e.l,e.opacity);if(e instanceof le||(e=Se(e)),!e)return new Ne;if(e instanceof Ne)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 Ne(a,s,l,e.opacity)}function Ne(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Pe(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 _e(e){return function(){return e}}function Re(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):_e(isNaN(e)?t:e)}ae(le,Se,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:qe,formatHex:qe,formatHsl:function(){return Le(this).formatHsl()},formatRgb:De,toString:De}),ae(Me,Ae,se(le,{brighter:function(e){return e=null==e?ue:Math.pow(ue,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Me(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:Ie,formatHex:Ie,formatRgb:Te,toString:Te})),ae(Ne,(function(e,t,n,r){return 1===arguments.length?Le(e):new Ne(e,t,n,null==r?1:r)}),se(le,{brighter:function(e){return e=null==e?ue:Math.pow(ue,e),new Ne(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new Ne(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 Me(Pe(e>=240?e-240:e+120,i,r),Pe(e,i,r),Pe(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 He=function e(t){var n=function(e){return 1==(e=+e)?Re: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):_e(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ae(e)).r,(t=Ae(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Re(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),Fe=/^class(-pyramid)?/,je=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,p=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat($(c))),o=Math.max.apply(Math,[o].concat($(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:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var h=p[f],m=p[f+1],g=He(h,m)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(p[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(p[f]),u.range.push(p[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function Be(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):Be(e,t,n,r+1,i)}var ze=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=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("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,$(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&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,$(c)),u.max=Math.max.apply(Math,$(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=d&&Fe.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,$(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===u.type){for(var f=p?Be(u.max,u.min,c,1,o):o,h=(u.max-u.min)/f,m=[],g=0;g<f+1;g+=1)m.push(u.min+h*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function Ve(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 $e(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)),B(B({},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 B(B({},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 Ue(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function We(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 Ye(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?Ve:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=ze(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(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 p=c.raw().coloring;p&&p.gradient&&ee(u,je(e,p.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?ie:i,a=r.getCByField,s=void 0===a?oe:a,l=r.getPersistence,u=void 0===l?re:l,c=o(t,n),p=s(n,c),d=p?p.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===d.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&p&&(h.label=p.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),ee(h,u(t,n,c,p,{byRow:ne,byElemNo:te})),h}(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=ze(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,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var d=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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 $e({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(Ue(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=We(e.measureOverrides,e.explicit),Ue(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=We(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 Ke(e){var t=B({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(ee(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=ee(!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=ee(!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 je(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=B({},e);ee(a,te(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,ee(a,te(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),ee(a,te(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=B(B({},e),r.getDataColorSpecials())),n.settings=ee(e,Ye(this,n,t,e))}return n.settings}};return i}var Ge=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},Xe=function(e){throw e.isHandled=!0,e},Je=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()},Ze=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()},Qe=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(Xe):Promise.reject()};function et(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 tt(e){return function(t){return"object"===z(t.datum[e])?t.datum[e].value:void 0}}function nt(e){return"object"===z(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function rt(e){return-3===e.datum.value}var it={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},ot={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function at(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:it.COLOR,fontSize:it.FONT_SIZE,fontFamily:it.FONT_FAMILY},label:{color:ot.COLOR,fontSize:ot.FONT_SIZE,fontFamily:ot.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",it.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",it.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",it.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",ot.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",ot.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",ot.FONT_FAMILY),i}var st=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"},lt=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 ut(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=at({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:st(a,i,o)},show:"function"==typeof a.show?function(){return lt(a,u,s)}:lt(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function ct(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=ut(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,d=t.scaleKey,f=t.theme,h=t.scales,m=at({theme:f,key:a,styleOverrides:s}),g=r.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&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return ee(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in h?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:B({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:c,style:p})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),d=ut(e,t);if(!d.show)return!1;var f=at({theme:c,key:i,styleOverrides:o}),h=d.layout.dock,m="right"===h||"left"===h,g=null===(n=t.scales)||void 0===n?void 0:n[p];return m&&g&&(g.invert=!0),ee(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}function pt(e,t,n){var r=[],i=[],o=ct(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={},V(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),V(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),V(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}}function dt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ft(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ht(){}var mt=1/.7,gt="\\s*([+-]?\\d+)\\s*",yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bt=/^#([0-9a-f]{3,8})$/,xt=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),qt=new RegExp(`^rgb\\(${vt},${vt},${vt}\\)$`),Dt=new RegExp(`^rgba\\(${gt},${gt},${gt},${yt}\\)$`),St=new RegExp(`^rgba\\(${vt},${vt},${vt},${yt}\\)$`),Ct=new RegExp(`^hsl\\(${yt},${vt},${vt}\\)$`),Et=new RegExp(`^hsla\\(${yt},${vt},${vt},${yt}\\)$`),wt={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 At(){return this.rgb().formatHex()}function Mt(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Tt(t):3===n?new Lt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?kt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?kt(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=xt.exec(e))?new Lt(t[1],t[2],t[3],1):(t=qt.exec(e))?new Lt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Dt.exec(e))?kt(t[1],t[2],t[3],t[4]):(t=St.exec(e))?kt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ct.exec(e))?Ft(t[1],t[2]/100,t[3]/100,1):(t=Et.exec(e))?Ft(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?Tt(wt[e]):"transparent"===e?new Lt(NaN,NaN,NaN,0):null}function Tt(e){return new Lt(e>>16&255,e>>8&255,255&e,1)}function kt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lt(e,t,n,r)}function Ot(e){return e instanceof ht||(e=It(e)),e?new Lt((e=e.rgb()).r,e.g,e.b,e.opacity):new Lt}function Lt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Nt(){return`#${Ht(this.r)}${Ht(this.g)}${Ht(this.b)}`}function Pt(){const e=_t(this.opacity);return`${1===e?"rgb(":"rgba("}${Rt(this.r)}, ${Rt(this.g)}, ${Rt(this.b)}${1===e?")":`, ${e})`}`}function _t(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ht(e){return((e=Rt(e))<16?"0":"")+e.toString(16)}function Ft(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Bt(e,t,n,r)}function jt(e){if(e instanceof Bt)return new Bt(e.h,e.s,e.l,e.opacity);if(e instanceof ht||(e=It(e)),!e)return new Bt;if(e instanceof Bt)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 Bt(a,s,l,e.opacity)}function Bt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function zt(e){return(e=(e||0)%360)<0?e+360:e}function Vt(e){return Math.max(0,Math.min(1,e||0))}function $t(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}dt(ht,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:At,formatHex:At,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jt(this).formatHsl()},formatRgb:Mt,toString:Mt}),dt(Lt,(function(e,t,n,r){return 1===arguments.length?Ot(e):new Lt(e,t,n,null==r?1:r)}),ft(ht,{brighter(e){return e=null==e?mt:Math.pow(mt,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(Rt(this.r),Rt(this.g),Rt(this.b),_t(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:Nt,formatHex:Nt,formatHex8:function(){return`#${Ht(this.r)}${Ht(this.g)}${Ht(this.b)}${Ht(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Pt,toString:Pt})),dt(Bt,(function(e,t,n,r){return 1===arguments.length?jt(e):new Bt(e,t,n,null==r?1:r)}),ft(ht,{brighter(e){return e=null==e?mt:Math.pow(mt,e),new Bt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Bt(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Lt($t(e>=240?e-240:e+120,i,r),$t(e,i,r),$t(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Bt(zt(this.h),Vt(this.s),Vt(this.l),_t(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=_t(this.opacity);return`${1===e?"hsl(":"hsla("}${zt(this.h)}, ${100*Vt(this.s)}%, ${100*Vt(this.l)}%${1===e?")":`, ${e})`}`}}));const Ut=Math.PI/180,Wt=180/Math.PI,Yt=4/29,Kt=6/29,Gt=3*Kt*Kt;function Xt(e){if(e instanceof Jt)return new Jt(e.l,e.a,e.b,e.opacity);if(e instanceof rn)return on(e);e instanceof Lt||(e=Ot(e));var t,n,r=tn(e.r),i=tn(e.g),o=tn(e.b),a=Zt((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Zt((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Zt((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Jt(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Jt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Zt(e){return e>.008856451679035631?Math.pow(e,1/3):e/Gt+Yt}function Qt(e){return e>Kt?e*e*e:Gt*(e-Yt)}function en(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function tn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function nn(e){if(e instanceof rn)return new rn(e.h,e.c,e.l,e.opacity);if(e instanceof Jt||(e=Xt(e)),0===e.a&&0===e.b)return new rn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Wt;return new rn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function rn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function on(e){if(isNaN(e.h))return new Jt(e.l,0,0,e.opacity);var t=e.h*Ut;return new Jt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}dt(Jt,(function(e,t,n,r){return 1===arguments.length?Xt(e):new Jt(e,t,n,null==r?1:r)}),ft(ht,{brighter(e){return new Jt(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Jt(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 Lt(en(3.1338561*(t=.96422*Qt(t))-1.6168667*(e=1*Qt(e))-.4906146*(n=.82521*Qt(n))),en(-.9787684*t+1.9161415*e+.033454*n),en(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),dt(rn,(function(e,t,n,r){return 1===arguments.length?nn(e):new rn(e,t,n,null==r?1:r)}),ft(ht,{brighter(e){return new rn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new rn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return on(this).rgb()}}));var an=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function sn(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=Ke(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 Je(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return Ze(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return Qe(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=Ge,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=B({},i),r={},!n.key)throw new Error("Missing key");t.set(B(B({},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=B(B({},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($(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($((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat($((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=et({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var h={data:p,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]=h,c&&(s["".concat(l,"Legend")]=B(B({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.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]=ee({},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")]=ee({},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=tt(r),o=tt("".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,p=e.type;return a?function(e){return rt(e)||o(e)?u:l}:n[t]?function(e){return rt(e)?u:nt(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 rt(e)||o(e)?u:nt(e)?l:c}:"color"===p?function(e){return rt(e)||o(e)?u:nt(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=tt("".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?an(e.qNum):e.qText&&It(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 p=V({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({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.styleOverrides,p=e.settings,d=void 0===p?{}:p,f=e.style,h=void 0===f?{}:f,m=arguments.length>1?arguments[1]:void 0;return pt({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:d,style:h},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var ln=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function un(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(ln),o=r.some(ln),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function cn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=B(B(B({},e),t),{},{colorProps:B(B({},e.colorProps),t.colorProps||{})});return n}var pn=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function dn(e){var t,n=e.qHyperCube.qDimensionInfo.some(pn),r=e.qHyperCube.qMeasureInfo.some(pn),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 fn=function(){};function hn(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 mn(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 gn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yn(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 vn(e,t,n){return t&&yn(e.prototype,t),n&&yn(e,n),e}function bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xn(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 qn(e,t){var n,r,i,o,a,s=new En(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Dn);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 En(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Cn)}function Dn(e){return e.children}function Sn(e){e.data=e.data.data}function Cn(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function En(e){this.data=e,this.depth=this.height=0,this.parent=null}En.prototype=qn.prototype={constructor:En,count:function(){return this.eachAfter(xn)},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 qn(this).eachBefore(Sn)}};var wn,An,Mn=(wn=function(e){
22
+ * Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",u=Math.round,c=Math.abs,p=Date.now;function d(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(h(e,n[t],n),!0)}function h(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 m(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 g=m((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`."),y=m((function(e,t){return g(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function b(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||i,t):e}function q(e,t){return e===i?t:e}function D(e,t,n){h(A(t),(function(t){e.addEventListener(t,n,!1)}))}function S(e,t,n){h(A(t),(function(t){e.removeEventListener(t,n,!1)}))}function C(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return e.indexOf(t)>-1}function A(e){return e.trim().split(/\s+/g)}function w(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 I(e){return Array.prototype.slice.call(e,0)}function T(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];w(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function M(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var O=1;function L(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var k="ontouchstart"in t,P=M(t,"PointerEvent")!==i,_=k&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),N="touch",R="mouse",H=25,F=1,B=4,j=8,z=1,V=2,$=4,U=8,W=16,K=V|$,Y=U|W,G=K|Y,X=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=t&F&&r-o==0,a=t&(B|j)&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,u=t.center=te(r);t.timeStamp=p(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,u),t.distance=ie(l,u),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==F&&o.eventType!==B||(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=re(t.deltaX,t.deltaY);var d=ne(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?(f=a.pointers,h=r,ie(h[0],h[1],J)/ie(f[0],f[1],J)):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.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,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=j&&(l>H||a.velocity===i)){var u=t.deltaX-a.deltaX,p=t.deltaY-a.deltaY,d=ne(l,u,p);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=re(u,p),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f,h;var m=e.element;C(t.srcEvent.target,m)&&(m=t.srcEvent.target);t.target=m}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:u(e.pointers[n].clientX),clientY:u(e.pointers[n].clientY)},n++;return{timeStamp:p(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:u(n/t),y:u(r/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function re(e,t){return e===t?z:c(e)>=c(t)?e<0?V:$:t<0?U:W}function ie(e,t,n){n||(n=X);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function oe(e,t,n){n||(n=X);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(L(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(L(this.element),this.evWin,this.domHandler)}};var se={mousedown:F,mousemove:2,mouseup:B},ae="mousedown",le="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}v(ue,Z,{handler:function(e){var t=se[e.type];t&F&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=B),this.pressed&&(t&B&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:R,srcEvent:e}))}});var ce={pointerdown:F,pointermove:2,pointerup:B,pointercancel:j,pointerout:j},pe={2:N,3:"pen",4:R,5:"kinect"},de="pointerdown",fe="pointermove pointerup pointercancel";function he(){this.evEl=de,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(de="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),v(he,Z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ce[r],o=pe[e.pointerType]||e.pointerType,s=o==N,a=w(t,e.pointerId,"pointerId");i&F&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):i&(B|j)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var me={touchstart:F,touchmove:2,touchend:B,touchcancel:j};function ge(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=I(e.touches),r=I(e.changedTouches);return t&(B|j)&&(n=T(n.concat(r),"identifier",!0)),[n,r]}v(ge,Z,{handler:function(e){var t=me[e.type];if(t===F&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(B|j)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:N,srcEvent:e})}}});var ve={touchstart:F,touchmove:2,touchend:B,touchcancel:j},be="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}function qe(e,t){var n=I(e.touches),r=this.targetIds;if(t&(2|F)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=I(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return C(e.target,l)})),t===F)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(B|j)&&delete r[s[i].identifier],i++;return a.length?[T(o.concat(a),"identifier",!0),a]:void 0}v(xe,Z,{handler:function(e){var t=ve[e.type],n=qe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:N,srcEvent:e})}});var De=2500;function Se(){Z.apply(this,arguments);var e=b(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ue(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function Ce(e,t){e&F?(this.primaryTouch=t.changedPointers[0].identifier,Ee.call(this,t)):e&(B|j)&&Ee.call(this,t)}function Ee(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)}),De)}}function Ae(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),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}v(Se,Z,{handler:function(e,t,n){var r=n.pointerType==N,i=n.pointerType==R;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)Ce.call(this,t,n);else if(i&&Ae.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var we=M(a.style,"touchAction"),Ie=we!==i,Te="compute",Me="auto",Oe="manipulation",Le="none",ke="pan-x",Pe="pan-y",_e=function(){if(!Ie)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 Ne(e,t){this.manager=e,this.set(t)}Ne.prototype={set:function(e){e==Te&&(e=this.compute()),Ie&&this.manager.element.style&&_e[e]&&(this.manager.element.style[we]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(E(e,Le))return Le;var t=E(e,ke),n=E(e,Pe);if(t&&n)return Le;if(t||n)return t?ke:Pe;if(E(e,Oe))return Oe;return Me}(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=E(r,Le)&&!_e[Le],o=E(r,Pe)&&!_e[Pe],s=E(r,ke)&&!_e[ke];if(i){var a=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(a&&l&&u)return}if(!s||!o)return i||o&&n&K||s&&n&Y?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Re=1,He=32;function Fe(e){this.options=o({},this.defaults,e||{}),this.id=O++,this.manager=null,this.options.enable=q(this.options.enable,!0),this.state=Re,this.simultaneous={},this.requireFail=[]}function Be(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function je(e){return e==W?"down":e==U?"up":e==V?"left":e==$?"right":""}function ze(e,t){var n=t.manager;return n?n.get(e):e}function Ve(){Fe.apply(this,arguments)}function $e(){Ve.apply(this,arguments),this.pX=null,this.pY=null}function Ue(){Ve.apply(this,arguments)}function We(){Fe.apply(this,arguments),this._timer=null,this._input=null}function Ke(){Ve.apply(this,arguments)}function Ye(){Ve.apply(this,arguments)}function Ge(){Fe.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Xe(e,t){return(t=t||{}).recognizers=q(t.recognizers,Xe.defaults.preset),new Je(e,t)}Fe.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=ze(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=ze(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===w(t,e=ze(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=ze(e,this);var t=w(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+Be(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Be(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=He},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(He|Re)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=He);56&this.state&&(this.state=Re),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(Ve,Fe,{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&&(n&j||!i)?16|t:r||i?n&B?8|t:2&t?4|t:2:He}}),v($e,Ve,{defaults:{event:"pan",threshold:10,pointers:1,direction:G},getTouchAction:function(){var e=this.options.direction,t=[];return e&K&&t.push(Pe),e&Y&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&K?(i=0===o?z:o<0?V:$,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?z:s<0?U:W,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ve.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=je(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(Ue,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Le]},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)}}),v(We,Fe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Me]},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||e.eventType&(B|j)&&!i)this.reset();else if(e.eventType&F)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&B)return 8;return He},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&B?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),v(Ke,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Ye,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:K|Y,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(K|Y)?t=e.overallVelocity:n&K?t=e.overallVelocityX:n&Y&&(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&&e.eventType&B},emit:function(e){var t=je(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Ge,Fe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Oe]},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(),e.eventType&F&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=B)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||ie(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=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return He},failTimeout:function(){return this._timer=d((function(){this.state=He}),this.options.interval,this),He},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Xe.VERSION="2.0.7",Xe.defaults={domEvents:!1,touchAction:Te,enable:!0,inputTarget:null,inputClass:null,preset:[[Ke,{enable:!1}],[Ue,{enable:!1},["rotate"]],[Ye,{direction:K}],[$e,{direction:K},["swipe"]],[Ge],[Ge,{event:"doubletap",taps:2},["tap"]],[We]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Xe.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||(P?he:_?xe:k?Se:ue))(n,Q),this.touchAction=new Ne(this,this.options.touchAction),Ze(this,!0),h(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 Ze(e,t){var n,r=e.element;r.style&&(h(e.options.cssProps,(function(i,o){n=M(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.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 Fe)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=w(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 h(A(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return h(A(e),(function(e){t?n[e]&&n[e].splice(w(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&&Ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Xe,{INPUT_START:F,INPUT_MOVE:2,INPUT_END:B,INPUT_CANCEL:j,STATE_POSSIBLE:Re,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:He,DIRECTION_NONE:z,DIRECTION_LEFT:V,DIRECTION_RIGHT:$,DIRECTION_UP:U,DIRECTION_DOWN:W,DIRECTION_HORIZONTAL:K,DIRECTION_VERTICAL:Y,DIRECTION_ALL:G,Manager:Je,Input:Z,TouchAction:Ne,TouchInput:xe,MouseInput:ue,PointerEventInput:he,TouchMouseInput:Se,SingleTouchInput:ge,Recognizer:Fe,AttrRecognizer:Ve,Tap:Ge,Pan:$e,Swipe:Ye,Pinch:Ue,Rotate:Ke,Press:We,on:D,off:S,each:h,merge:y,extend:g,assign:o,inherit:v,bindFn:b,prefixed:M}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Xe,"function"==typeof i&&i.amd?i((function(){return Xe})):e.exports?e.exports=Xe:t.Hammer=Xe}(window,document)}(k);var P=E(k.exports);function _(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var N={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};const R={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"}}]};const H=e=>{m((t=>{if(e)return e.setSnapshotData(t)})),g((()=>({getViewState(){if(e)return e.getViewState()}})),[e])};function F(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 B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e){return j="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},j(e)}function z(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 r=n.call(e,"string");if("object"!=typeof r)return r;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 V(e){return function(e){if(Array.isArray(e))return $(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 $(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)?$(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 $(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 U=Object.prototype.hasOwnProperty,W=Object.prototype.toString,K=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,G=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===W.call(e)},X=function(e){if(!e||"[object Object]"!==W.call(e))return!1;var t,n=U.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&U.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||U.call(e,t)},J=function(e,t){K&&"__proto__"===t.name?K(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Z=function(e,t){if("__proto__"===t){if(!U.call(e,t))return;if(Y)return Y(e,t).value}return e[t]},Q=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Z(a,n),a!==(i=Z(t,n))&&(c&&i&&(X(i)||(o=G(i)))?(o?(o=!1,s=r&&G(r)?r:[]):s=r&&X(r)?r:{},J(a,{name:n,newValue:e(c,s,i)})):void 0!==i&&J(a,{name:n,newValue:i}));return a}));function ee(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 te(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 ne(e,t,n,r,i){var o,s,a=i.byRow,l=i.byElemNo;if(r&&(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(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,u)}return{}}function re(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 ie(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 oe(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function se(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ae(){}var le=1/.7,ue="\\s*([+-]?\\d+)\\s*",ce="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",de=/^#([0-9a-f]{3,8})$/,fe=new RegExp(`^rgb\\(${ue},${ue},${ue}\\)$`),he=new RegExp(`^rgb\\(${pe},${pe},${pe}\\)$`),me=new RegExp(`^rgba\\(${ue},${ue},${ue},${ce}\\)$`),ge=new RegExp(`^rgba\\(${pe},${pe},${pe},${ce}\\)$`),ye=new RegExp(`^hsl\\(${ce},${pe},${pe}\\)$`),ve=new RegExp(`^hsla\\(${ce},${pe},${pe},${ce}\\)$`),be={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 xe(){return this.rgb().formatHex()}function qe(){return this.rgb().formatRgb()}function De(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=de.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Se(t):3===n?new we(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ce(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ce(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=fe.exec(e))?new we(t[1],t[2],t[3],1):(t=he.exec(e))?new we(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=me.exec(e))?Ce(t[1],t[2],t[3],t[4]):(t=ge.exec(e))?Ce(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ye.exec(e))?ke(t[1],t[2]/100,t[3]/100,1):(t=ve.exec(e))?ke(t[1],t[2]/100,t[3]/100,t[4]):be.hasOwnProperty(e)?Se(be[e]):"transparent"===e?new we(NaN,NaN,NaN,0):null}function Se(e){return new we(e>>16&255,e>>8&255,255&e,1)}function Ce(e,t,n,r){return r<=0&&(e=t=n=NaN),new we(e,t,n,r)}function Ee(e){return e instanceof ae||(e=De(e)),e?new we((e=e.rgb()).r,e.g,e.b,e.opacity):new we}function Ae(e,t,n,r){return 1===arguments.length?Ee(e):new we(e,t,n,null==r?1:r)}function we(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ie(){return`#${Le(this.r)}${Le(this.g)}${Le(this.b)}`}function Te(){const e=Me(this.opacity);return`${1===e?"rgb(":"rgba("}${Oe(this.r)}, ${Oe(this.g)}, ${Oe(this.b)}${1===e?")":`, ${e})`}`}function Me(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Le(e){return((e=Oe(e))<16?"0":"")+e.toString(16)}function ke(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _e(e,t,n,r)}function Pe(e){if(e instanceof _e)return new _e(e.h,e.s,e.l,e.opacity);if(e instanceof ae||(e=De(e)),!e)return new _e;if(e instanceof _e)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new _e(s,a,l,e.opacity)}function _e(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ne(e){return(e=(e||0)%360)<0?e+360:e}function Re(e){return Math.max(0,Math.min(1,e||0))}function He(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}oe(ae,De,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xe,formatHex:xe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pe(this).formatHsl()},formatRgb:qe,toString:qe}),oe(we,Ae,se(ae,{brighter(e){return e=null==e?le:Math.pow(le,e),new we(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new we(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new we(Oe(this.r),Oe(this.g),Oe(this.b),Me(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:Ie,formatHex:Ie,formatHex8:function(){return`#${Le(this.r)}${Le(this.g)}${Le(this.b)}${Le(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Te,toString:Te})),oe(_e,(function(e,t,n,r){return 1===arguments.length?Pe(e):new _e(e,t,n,null==r?1:r)}),se(ae,{brighter(e){return e=null==e?le:Math.pow(le,e),new _e(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new _e(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new we(He(e>=240?e-240:e+120,i,r),He(e,i,r),He(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _e(Ne(this.h),Re(this.s),Re(this.l),Me(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=Me(this.opacity);return`${1===e?"hsl(":"hsla("}${Ne(this.h)}, ${100*Re(this.s)}%, ${100*Re(this.l)}%${1===e?")":`, ${e})`}`}}));const Fe=Math.PI/180,Be=180/Math.PI,je=4/29,ze=6/29,Ve=3*ze*ze;function $e(e){if(e instanceof Ue)return new Ue(e.l,e.a,e.b,e.opacity);if(e instanceof Xe)return Je(e);e instanceof we||(e=Ee(e));var t,n,r=Ge(e.r),i=Ge(e.g),o=Ge(e.b),s=We((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=We((.4360747*r+.3850649*i+.1430804*o)/.96422),n=We((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ue(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ue(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function We(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ve+je}function Ke(e){return e>ze?e*e*e:Ve*(e-je)}function Ye(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ge(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Xe(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Je(e){if(isNaN(e.h))return new Ue(e.l,0,0,e.opacity);var t=e.h*Fe;return new Ue(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}oe(Ue,(function(e,t,n,r){return 1===arguments.length?$e(e):new Ue(e,t,n,null==r?1:r)}),se(ae,{brighter(e){return new Ue(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ue(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 we(Ye(3.1338561*(t=.96422*Ke(t))-1.6168667*(e=1*Ke(e))-.4906146*(n=.82521*Ke(n))),Ye(-.9787684*t+1.9161415*e+.033454*n),Ye(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),oe(Xe,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Xe)return new Xe(e.h,e.c,e.l,e.opacity);if(e instanceof Ue||(e=$e(e)),0===e.a&&0===e.b)return new Xe(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Be;return new Xe(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Xe(e,t,n,null==r?1:r)}),se(ae,{brighter(e){return new Xe(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Xe(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Je(this).rgb()}}));var Ze=e=>()=>e;function Qe(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ze(isNaN(e)?t:e)}var et=function e(t){var n=function(e){return 1==(e=+e)?Qe: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):Ze(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ae(e)).r,(t=Ae(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Qe(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),tt=/^class(-pyramid)?/,nt=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),s=i,a=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,p=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(V(c))),o=Math.max.apply(Math,[o].concat(V(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=[],s=[];if(r.length)if(r[r.length-1]<t)s.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)s.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)s.push(t),o.push(i[0]);else{s.push(t);for(var a=0;a<r.length;a++)if(t<r[a]){o.push(i[a]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(s.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)s.push(n),o.push(i[r.length]),o.push(i[r.length]);else{s.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:s}}({min:"percent"===t.limitType?i:s,max:"percent"===t.limitType?o:a,range:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var h=p[f],m=p[f+1],g=et(h,m)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(p[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(p[f]),u.range.push(p[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function rt(e,t,n,r,i){var o,s,a,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(s/c),Number.isNaN(a)||(u[a]?u[a]+=1:u[a]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):rt(e,t,n,r+1,i)}var it=function(e,t,n,r){var i,o,s=t.theme,a=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=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("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:a.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,V(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&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,V(c)),u.max=Math.max.apply(Math,V(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=d&&tt.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,V(d.colors.map((function(e){return e?e.length:0})))):d.colors.length)}if("categorical"===u.type){for(var f=p?rt(u.max,u.min,c,1,o):o,h=(u.max-u.min)/f,m=[],g=0;g<f+1;g+=1)m.push(u.min+h*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function ot(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 st(e){var t,n=e.cm,r=e.defaults,i=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 r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),B(B({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===a?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 B(B({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,s,r):null}function at(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function lt(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 s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),r.push(s.primary)):r[a]=s.primary,e[o]=null}else if(s){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 ut(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,s=void 0===o?ot:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),u=it(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(u.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=a.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"===a.type)if(c){var p=c.raw().coloring;p&&p.gradient&&Q(u,nt(e,p.gradient,u,c))}else u.auxiliary=a;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?re:i,s=r.getCByField,a=void 0===s?ie:s,l=r.getPersistence,u=void 0===l?ne:l,c=o(t,n),p=a(n,c),d=p?p.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===d.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&p&&(h.label=p.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),Q(h,u(t,n,c,p,{byRow:te,byElemNo:ee})),h}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=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:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=it(0,{hc:i,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.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,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(a="measure"),"measure"===a){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,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===a){var d=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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 st({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(at(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=lt(e.measureOverrides,e.explicit),at(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.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=lt(e.measureOverrides),s}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ct(e){var t=B({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(Q(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=Q(!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!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=Q(!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||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,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 nt(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=r[0],l=r[1]?r[1].colorMap:null;if(a){var u=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=u}return l?function(e,t,n,r){var i=r.external,o=r.field,s=B({},e);Q(s,ee(o,o.raw().qCardinal));var a=i.theme?i.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,Q(s,ee(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),Q(s,ee(o))),t.colors&&t.colors.length&&(s.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,s=[];o=[];for(var a=0;a<i.items.length;a++){var l=i.items[a],u=(l.text||l).label;r[u]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(r[u])))}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,i,{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"},r=t.theme;r&&(e=B(B({},e),r.getDataColorSpecials())),n.settings=Q(e,ut(this,n,t,e))}return n.settings}};return i}var pt=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],s=t[1];o&&(r.legendDataPage=o),s&&(r.dimValsData=s.colorMap)}return r},dt=function(e){throw e.isHandled=!0,e},ft=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()},ht=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()},mt=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(dt):Promise.reject()};function gt(e){return function(t){return"object"===j(t.datum[e])?t.datum[e].value:void 0}}function yt(e){return"object"===j(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function vt(e){return-3===e.datum.value}var bt={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function xt(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:bt.TITLE.COLOR,fontSize:bt.TITLE.FONT_SIZE,fontFamily:bt.TITLE.FONT_FAMILY},label:{color:bt.LABEL.COLOR,fontSize:bt.LABEL.FONT_SIZE,fontFamily:bt.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==s?void 0:s.color,"legend.title","color",bt.TITLE.COLOR),i.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",bt.TITLE.FONT_SIZE),i.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",bt.TITLE.FONT_FAMILY),i.label.color=l(null==a?void 0:a.color,"legend.label","color",bt.LABEL.COLOR),i.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",bt.LABEL.FONT_SIZE),i.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",bt.LABEL.FONT_FAMILY),i}var qt=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"},Dt=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 St(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,u=t.hc,c=xt({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:qt(s,i,o)},show:"function"==typeof s.show?function(){return Dt(s,u,a)}:Dt(s,u,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:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function Ct(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=St(e,t);if(!r.show)return!1;var i,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,d=t.scaleKey,f=t.theme,h=t.scales,m=xt({theme:f,key:s,styleOverrides:a}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,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&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return Q(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in h?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:B({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:c,style:p})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),d=St(e,t);if(!d.show)return!1;var f=xt({theme:c,key:i,styleOverrides:o}),h=d.layout.dock,m="right"===h||"left"===h,g=null===(n=t.scales)||void 0===n?void 0:n[p];return m&&g&&(g.invert=!0),Q(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,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 Et(e,t,n){var r=[],i=[],o=Ct(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,s=(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!=s&&null!==(i=s.interact)&&void 0!==i&&i.enabled&&!s.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},z(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),z(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),z(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 At=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function wt(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ct(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 ft(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return ht(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return mt(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=pt,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=B({},i),r={},!n.key)throw new Error("Missing key");t.set(B(B({},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=B(B({},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,s=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&s&&i.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===a}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(V(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,s=e.picasso,a={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(V((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(V((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=function(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}({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]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var h={data:p,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}};a[l]=h,c&&(a["".concat(l,"Legend")]=B(B({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.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]=Q({},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")]=Q({},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"};a[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"};a[l]=y}}return a}({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=gt(r),o=gt("".concat(r,"IsAnOther")),s=function(e,t){var r=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,u=e.others,c=e.primary,p=e.type;return s?function(e){return vt(e)||o(e)?u:l}:n[t]?function(e){return vt(e)?u:yt(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===a?function(e){return vt(e)||o(e)?u:yt(e)?l:c}:"color"===p?function(e){return vt(e)||o(e)?u:yt(e)?l:i(e)||u}:null},a=s(t,r);if(t.measureOverrides){var l=gt("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&s(e)}));return function(e){var t=l(e);return u[t]?u[t](e):a(e)}}return a}({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,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=s,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[s]&&"field"===i.mode&&(t=o[s].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?At(e.qNum):e.qText&&De(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 p=z({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),a&&(p["".concat(u,"MeasureIdx")]=l),p}({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,s=e.chart,a=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,p=e.settings,d=void 0===p?{}:p,f=e.style,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Et({eventName:t,key:r,rtl:a,viewState:o,chart:s,styleReference:u,styleOverrides:c,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var It=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Tt(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(It),o=r.some(It),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!i?"off":s}function Mt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(B(B({},e),t),{},{colorProps:B(B({},e.colorProps),t.colorProps||{})})}var Ot=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Lt(e){var t,n=e.qHyperCube.qDimensionInfo.some(Ot),r=e.qHyperCube.qMeasureInfo.some(Ot),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 kt=function(){};function Pt(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 s=r[o];if(void 0===i[s])return n;i=i[s]}return i}var _t,Nt=["__proto__","constructor"];function Rt(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Nt.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function Ht(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 Ft(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=jt)):void 0===t&&(t=Bt);for(var n,r,i,o,s,a=new $t(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new $t(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(Vt)}function Bt(e){return e.children}function jt(e){return Array.isArray(e)?e[1]:null}function zt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Vt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $t(e){this.data=e,this.depth=this.height=0,this.parent=null}$t.prototype=Ft.prototype={constructor:$t,count:function(){return this.eachAfter(Ht)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},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(){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 Ft(this).eachBefore(zt)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},_t=function(e){
39
23
  /*! 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,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)m+=p.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},wn(An={exports:{}}),An.exports);function In(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var Tn={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"},kn=/%$/,On=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Ln=/^\(oct\)/i,Nn=/^\(dec\)/i,Pn=/^\(hex\)/i,_n=/^\(bin\)/i,Rn=/^\(rom\)/i,Hn=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Fn=/#|0/g;function jn(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 Bn(e,t,n){var r=In(e);return n?r:new RegExp(r||"",t)}function zn(e,t,n){var r,i,o,a,s,l,u,c,p,d,f,h=e.pattern;h.indexOf("A")>=0&&(h=h.replace("A",""),e.abbreviate=!0),d=t,(f=n)&&(f=In(f)),d&&(d=In(d)),p=new RegExp("(?:[#0]+".concat(d,")?[#0]+(?:").concat(f,"[#0]+)?")),a=(o=(o=h.match(p))?o[0]:"")?h.substr(0,h.indexOf(o)):h,s=o?h.substring(h.indexOf(o)+o.length):"",o||(o=h?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(Bn(l,"g"),t)),u=n,n=".",u&&(o=o.replace(Bn(u,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var m,g=h.split(u);g[1]&&(m=g[1].match(Fn)),e.prefix=a||"",e.postfix=s||"",e.pattern=h,e.maxPrecision=m?m.length:2,e.percentage=kn.test(h),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(Bn(t,null,!0),"|").concat(Bn(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){gn(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 Tn;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()}vn(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],Hn.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Hn.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Hn.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||zn(r.positive,t,n),r.negative&&!r.negative.isFunctional&&zn(r.negative,t,n),r.zero&&!r.zero.isFunctional&&zn(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,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return On.test(t)?e=jn(e,Number(/\d{2}/.exec(t)[0]),t,n):Ln.test(t)?e=jn(e,8,t,n):Nn.test(t)?e=jn(e,10,t,n):Pn.test(t)?e=jn(e,16,t,n):_n.test(t)?e=jn(e,2,t,n):Rn.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 h,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&&(h=g[s-1]),h&&n>0&&h>0?m=h:(n<0&&h<0||!h)&&(y<0&&y-n<=c.maxPrecision?m=y:h<=n&&!(y>0&&-n<=c.maxPrecision)&&(m=h)),m&&(p=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=Mn(b+=o,v)||"0",u){var x=Math.max(0,Math.min(14,u.length)),q=u.replace(/#+$/,"").length,D=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=D.length;s<q;s++)D+="0";D&&(e+=o+D)}else 0===v&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Mn(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var Vn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$n=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Un=["January","February","March","April","May","June","July","August","September","October","November","December"],Wn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Yn(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function Kn(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}!function(){function e(t,n,r){gn(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Vn,qDayNames:$n,qLongMonthNames:Un,qMonthNames:Wn}),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=(bn(i={},"T",o.qTimeFmt||"hh:mm:ss"),bn(i,"D",o.qDateFmt||"YYYY-MM-DD"),bn(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}vn(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*Kn(t),r=60*Kn(n),i=60*Kn(r),o=1e3*Kn(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:Yn("".concat(t.year).slice(-2),2),YYY:Yn("".concat(t.year).slice(-3),3),def:function(e){return Yn("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Yn("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Yn("".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 Yn("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Yn("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Yn("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Yn("".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 p=new RegExp(u.join("|"),"g"),d=t.replace(p,(function(e){var t,n,r;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in l[n])if(i===e||i.toLowerCase()===e){void 0===(r=l[n][i])&&(r=l[n][i.toLowerCase()]);break}return void 0===r&&(r=l[n].def),"function"==typeof r&&(r=r(e)),r}));return d}}])}();var Gn=["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"],Xn=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function Jn(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?i.push.apply(i,$(new Set([r].concat($(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(", ")}))))))):i.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat($(i.map((function(e){return Xn(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],$(Gn.map((function(e){return Xn(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}var Zn=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Qn=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function er(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,$(new Set([n].concat($(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat($(r.map((function(e){return Qn(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],$(Zn.map((function(e){return Qn(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function tr(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Jn({theme:t,translator:n,id:r,path:i}),fontSize:er({theme:t,translator:n,id:r,path:i})}}function nr(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach((function(e){for(var r=e.split("."),i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=tr({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var l=function(e){for(var t=e.split("."),n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}const rr=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,ir=function(){};function or(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}ir.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]&&rr.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},or.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new or(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 or(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 or(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new or(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 or(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 ar=new or(0,0,0,0),sr=new or(0,0,0,0),lr=ir.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,ar.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),sr.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=sr.intersection(ar,!0),r.push({coverage:i?i.clone():new or(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){ar.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),sr.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=ar.intersection(sr,!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 ur;function cr(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 pr(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=pr(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&ur>=e&&ur<=e+t||s.length>0)&&(o=cr(i,a),void 0!==o.qUp&&1===a.length&&(o.qUp=l+r),o.qSubNodes=s),0===i.qSubNodes.length&&ur++,ur===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return a}function dr(e,t,n){return ur=0,pr(e,t,n)}const fr=new or(0,0,0,0),hr=new or(0,0,0,0),mr=lr.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,fr.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),hr.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=hr.intersection(fr,!0),r.push({coverage:i?i.clone():new or(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){fr.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),hr.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=fr.intersection(hr,!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:dr(r,n.height,t.qLeft),qTop:dr(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function gr(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new mr;else{if("table"!==e.visualization)return;this.slicer=new lr}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class yr{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,gr.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=hn(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const vr={version:"0.38.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 br(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function xr(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function qr(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){br(t),xr(t)},moved(e,t){br(t),xr(t)},removed(e,t){br(t),xr(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var Dr={},Sr={get exports(){return Dr},set exports(e){Dr=e}};!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,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p}},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,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p}},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 p(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 h(){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),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=h(0),m=h(1),g=y(p,f),v=y(d,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var q={isFullRange:p,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=h(0),d=h(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function D(e){return(D="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 S=i.a.bind(null,!0),C={},E=Array.isArray;function w(e){return null!=e&&!Array.isArray(e)&&"object"===D(e)}function A(e){return void 0===e}function M(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function I(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]=A(e[n||t])?o:e[t],e=e[n||t]}})),e}function T(e,t){var n=!0;if(w(e)&&w(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){T(e[r],t[r])||(n=!1)})),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!T(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);T(o,a)||M(t,i)||(A(a)?r.push({op:"add",path:s,value:o}):w(o)&&w(a)?r=r.concat(C.generate(a,o,s)):E(o)&&E(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&A(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(T(t,i))return r;if(!A(t[0])&&A(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(C.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){A(t[i])&&!M(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},C.apply=function(e,t){t.forEach((function(t){var n,r=I(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(E(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(E(o)&&E(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(w(o)&&w(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!M(n,e)&&delete n[e]})),S(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=I(e,t.from);E(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(E(r)?r.splice(+i,1):delete r[i])}))},C.clone=function(e){return S({},e)},C.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},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):S(e,t)};var k=C,O=function(e,t,n){if(!e)return Promise.resolve();var r=k.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()},L="accumulation";function N(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function P(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===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var _={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},R={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.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=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=q.getNumStepComp(n,l),d=q.getAboveComp(n,l,c,p),f=q.getRangeComp("RangeSum",d);if(q.needDimension({modifier:n,properties:r,layout:i})){var h=q.getDimComp(u,1),m=q.getDimComp(u,0),g=q.getAggrComp(f,h,m);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,_)},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!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(P(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(P(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(P(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(P(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(P(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=N(t,e);return o&&!o.disabled}};return n}},H="movingAverage";function F(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===H)return n[r]}function j(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===H)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},z={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.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=q.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=q.getNumStepComp(r,u),h=q.getAboveComp(r,u,d,f);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",h);else{var m=q.getRangeComp("RangeSum",h),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.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(q.needDimension({modifier:r,properties:i,layout:o})){var v=q.getDimComp(c,1),b=q.getDimComp(c,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,B)},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!q.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=F(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=F(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 q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(H))return!1;var o=F(t,e);return o&&!o.disabled}};return n}},V="difference";function $(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 W={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.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=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=q.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(q.needDimension({modifier:n,properties:r,layout:i})){var f=q.getDimComp(u,1),h=q.getDimComp(u,0),m=q.getAggrComp(d,f,h);d=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(W).forEach((function(t){void 0===e[t]&&(e[t]=W[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!q.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 q.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=$(t,e);return o&&!o.disabled}};return n}},K={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},G={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},X="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)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===X)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:G.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:G.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:G.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:K.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.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:G.DISREGARD_ALL_DIMENSIONS,selectionScope:K.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(q.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(q.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.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=q.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),p=ae(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,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!q.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:K.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===K.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===K.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:G.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)===G.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function pe(e){return(pe="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:R,movingAverage:z,difference:Y,normalization:se},fe=(t.default={modifiers:de,apply:he,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=qe(e);Me({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Le({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function he(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===pe(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 p=a(u,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:p,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ae({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:p,layout:u,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Me({modifiers:qe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:p,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Se(n);var r=Ne(n);return Ie({model:t}).then((function(i){return Te({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ae({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===pe(e)&&!e.disabled){if(n++,"object"!==pe(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ee(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.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"===pe(e.base)}))}(p)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ne(n);return Pe({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Oe({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,p=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Se(r);var d=Ne(r);return Pe({model:t,libraryIds:d,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ne(n);return Ie({model:r,dimensionAndFieldList:s}).then((function(e){return Te({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Me({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"===pe(e)&&!e.disabled){if(s++,"object"!==pe(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");de[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=de[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=de[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Ce(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Oe({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=qe(e);return Array.isArray(t)&&t.some((function(e){return"object"===pe(e)&&!e.disabled&&!de[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ce(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Me({modifiers:qe(e),properties:n,layout:r})}))}function ve(e){var t=qe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(de[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function qe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function De(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Se(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&De(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Ce(e){var t=qe(e);Array.isArray(t)&&t.forEach((function(t){"object"===pe(t)&&(t.disabled||!de[t.type]&&De(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ee(e){return e.base||e.qDef&&e.qDef.base}function we(e){var t=Ee(e);return e.qLibraryId||t&&t.qLibraryId}function Ae(e){var t=e.measure,n=e.properties,r=e.layout;return!we(t)&&Me({modifiers:qe(t),properties:n,layout:r})}function Me(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==pe(e)||e.disabled||!de[e.type])&&(void 0===i[e.type]&&(i[e.type]=de[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ie(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 Te(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 ke(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Oe(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),ke)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),ke)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),ke)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),ke);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):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Le(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===pe(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ne(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=qe(t);if(Me({modifiers:r,properties:e})){var o=we(t);o&&n.push(o),i=i||Le({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Pe(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return he({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&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,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&&null!=e[Symbol.iterator]||null!=e["@@iterator"])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 p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},d=n(1),f=n.n(d),h={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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;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,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e){return function(e){if(Array.isArray(e))return E(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 E(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)?E(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 E(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 w={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,q),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,q),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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.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=D(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=C(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function A(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 M={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=[]),h.addDimensions({exportFormat:i,qHyperCubeDef:l}),h.addMeasures({exportFormat:i,qHyperCubeDef:l}),h.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,h.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),h.updateLayoutExclude({exportFormat:i,properties:a}),r||h.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,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=w.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=w.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,E=void 0===C?w.getDefaultDimension():C,M=l.defaultMeasure,I=void 0===M?w.getDefaultMeasure():M;v.qDimensions.length=0,v.qMeasures.length=0,w.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&w.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),w.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:E}),w.addMeasures({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),w.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),w.copyPropertyIfExist("qMaxStackedCells",y,v),w.copyPropertyIfExist("qNoOfLeftDims",y,v),w.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),w.copyPropertyOrSetDefault("qMode",y,v,"S"),w.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),w.copyPropertyOrSetDefault("qSortbyYValue",y,v),w.copyPropertyOrSetDefault("qIndentMode",y,v),w.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),w.importCommonProperties(g,t,r),m.qProperty=g;var T=o.getValue(c||{},"support.modifiers");return w.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:T}),d&&A(m.qProperty,"storedFilters"),"S"===v.qMode&&h&&A(m.qProperty,"dynamicScript"),m}},I={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function T(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 k(e,t){return e.length!==t}var O={create:function(e,t){if(!e||!I[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(T(a,t,r,i),k(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"}},L={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 L.getNumDimensions(e)>0&&L.getNumMeasures(e)<=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>0},expression:function(e){return L.getNumMeasures(e)>=1}}},P={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},_={scatterplot:P,"sn-scatter-plot":P,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)<=1},expression:function(e){return L.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>=1},expression:function(e){return L.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 L.getNumDimensions(e)>=1}}}};function R(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function H(e,t){var n=O.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){R(e,"qAttributeDimensions",n),R(e,"qAttributeExpressions",n)})),t.forEach((function(e){R(e,"qAttributeDimensions",n),R(e,"qAttributeExpressions",n)}))}function F(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,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;H(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=O.create(O.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function B(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var z={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=L.getItemLabel(t);switch(F(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||L.wrapFieldName(t.name),key:L.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&&z.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function $(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=O.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,B("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&&F(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=B("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&$(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function W(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&&F(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=B("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=O.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,B("measure",!!s,s||r[0])),!!s}(e,t))return;j({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=(_[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?H(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})?W(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"),H(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}},K={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=M.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=O.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return O.moveByIdFromGroup(a,[],"qAttributeDimensions",u),O.moveByIdFromGroup(a,[],"qAttributeExpressions",u),O.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=M.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),h=o.getValue(p,"color.mode",""),m=o.getValue(p,"color.auto",""),g=Y.getCanColorBy(p,d),y=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:p})&&Y.addColorByExpression(p):Y.switchToAutoColor(p),y&&Y.updateColorBy(p,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(p)&&Y.changeProperty(p,"color.persistent",!0),Y.deleteTotalMode(f),c}},G=["bar","marker","line"],X={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?A(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):A(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}}),G.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=K.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=K.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return X.handleAutoMinMax({initialProperties:n,properties:p}),X.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:p,measureType:a}),X.setInterColumnSortOrder(p.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:M,colorChart:K,axisChart:J,quarantineProperty:m,unquarantineProperty:A,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Sr);var Cr=E(Dr);const Er=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function wr(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 Ar={importColors:function(e){e.color.point=e.color.point||{},wr(e.color,e.color.point,Er),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){wr(e.color.point,e.color,Er),e.color.colorExpression=hn(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Mr({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=Cr.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]),Ar.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function Ir({propertyTree:e,viewDataMode:t}){const n=Cr.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Ar.exportColors(e.qProperty),n}var Tr=e=>{const t=qr(e);return{properties:vr,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Mr({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Ir}},kr=Object.prototype.hasOwnProperty,Or=Object.prototype.toString,Lr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,Pr=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Or.call(e)},_r=function(e){if(!e||"[object Object]"!==Or.call(e))return!1;var t,n=kr.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&kr.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||kr.call(e,t)},Rr=function(e,t){Lr&&"__proto__"===t.name?Lr(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Hr=function(e,t){if("__proto__"===t){if(!kr.call(e,t))return;if(Nr)return Nr(e,t).value}return e[t]},Fr=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=Hr(s,n),s!==(i=Hr(t,n))&&(c&&i&&(_r(i)||(o=Pr(i)))?(o?(o=!1,a=r&&Pr(r)?r:[]):a=r&&_r(r)?r:{},Rr(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Rr(s,{name:n,newValue:i}));return s};const jr={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Br={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(zr(o,!0),i);return a},createRegExp:zr};function zr(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Vr={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?jr.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=$r(t,i,e);n[t]=r}))}return Br.replaceExpressionTokens(e,n)}};function $r(e,t,n){if(""===t)return"";const r=Br.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Ur={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=Xr(e.match(Gr("Dim"))),o.forEach((e=>{s.push(Wr(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=Xr(e.match(Gr("Mea"))),a.forEach((e=>{s.push(Yr(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=Fr({},n,i),o=Fr(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Vr.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:Vr.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>Wr(e,n,r,t))),i=e.qMeasures.map((e=>Yr(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Wr(e,t,n,r){if(e.qLibraryId)return Kr(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Yr(e,t){return e.qLibraryId?Kr(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Kr(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 Gr(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Xr(e){return e?e.map((e=>e.substr(6,1))):[]}function Jr(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 Zr={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:Jr,invertedEnumConvertFunctions:function(e){return Jr((function(){return!e||!e()}))}};const Qr=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function ei(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:Qr,convertFunctions:n.sorting,show:t=>0!==hn(t,e,0)}}}}var ti={state:function(e,t){return ei(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Zr.booleanConvertFunctions(t),sorting:Zr.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return ei(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Zr.booleanConvertFunctions(t),sorting:Zr.enumConvertFunctions(t)})},numeric:function(e,t){return ei(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Zr.booleanConvertFunctions(t,-1),sorting:Zr.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Zr.booleanConvertFunctions(t),sorting:Zr.enumConvertFunctions(t)},r=ei(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==hn(t,e,0)},r},frequency:function(e,t){return ei(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Zr.booleanConvertFunctions(t),sorting:Zr.invertedEnumConvertFunctions(t)})}};const ni=(e,t)=>(t.components||[]).find((t=>t.key===e)),ri=(e,t,n,r)=>{var i,o,a,s,l;const u=r.isEnabled("CLIENT_IM_3364")?null===(i=ni("axis",n))||void 0===i?void 0:i.axis:{};return{text:{fontFamily:(null==u||null===(o=u.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==u||null===(a=u.title)||void 0===a?void 0:a.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==u||null===(s=u.title)||void 0===s||null===(l=s.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},ii=(e,t,n,r)=>{var i,o,a,s,l,u,c,p;const d=r.isEnabled("CLIENT_IM_3364")?null===(i=ni("axis",n))||void 0===i?void 0:i.axis:{};return{labels:{fontFamily:(null==d||null===(o=d.label)||void 0===o||null===(a=o.name)||void 0===a?void 0:a.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==d||null===(s=d.label)||void 0===s||null===(l=s.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==d||null===(u=d.label)||void 0===u||null===(c=u.name)||void 0===c||null===(p=c.fontColor)||void 0===p?void 0:p.color)||t.getStyle(e,"axis.label.name","color")}}},oi={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 ai(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(oi);const si={hasMultipleDimensions:ai,getOuterDimensionCardinality:function(e){const t=hn(e,oi.HYPERCUBE_PATH);return ai(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return hn(e,oi.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==hn(e,`${oi.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==hn(e,`${oi.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==hn(e,`${oi.SORT_CRITERIA}.sortByAscii`,0)}},li={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var ui={create(e,t){if(!e||!li[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 ci={getColorByDefinition:function(e,t,n){const r={};let i,o,a;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,a=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:a?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var pi={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 di=["scatterplot","map"],fi=["map"];var hi={baseColor:{isSupported:e=>e&&e.length&&-1===di.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==fi.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=hn(n,"mode"),i=hn(n,"auto"),o=hn(e,`${t}qDimensions`,[]),a=hn(e,`${t}qMeasures`,[]);let s,l,u,c;if(!i&&"byDimension"===r&&o.length)s=hn(n,"byDimDef"),s&&xi(n,s.label),s&&s.activeDimensionIndex>-1?(s.activeDimensionIndex=Math.min(s.activeDimensionIndex,o.length-1),l=o[s.activeDimensionIndex],c=ci.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=s.activeDimensionIndex,vi(n,c)):s&&s.key||(l=o[o.length-1],u=ui.getById(l.qAttributeDimensions,ui.IDMAP.COLOR_BY_ALTERNATIVE),vi(n,ci.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&&mn(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=hn(n,"mode"),i=hn(n,"auto"),o=hn(e,`${t}qDimensions`,[]),a=hn(e,`${t}qMeasures`,[]),s=hn(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?bi(n,!0,o,s,a,hn(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?bi(n,!1,o,s,a,hn(n,"byMeasureDef.label")):mi(o,s)},setColorByPropertyDef:vi,resolveColorByPropertyDef:bi,clearColorByItem:mi};function mi(e,t){e.forEach((e=>{gi(e,ui.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gi(e,ui.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{gi(e,ui.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gi(e,ui.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function gi(e,t,n){if(e[n]){const r=ui.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function yi(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function vi(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(xi(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||yi(t.name),key:yi(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&&pi.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function bi(e,t,n,r,i,o){mi(n,r);const a=n[n.length-1];if(a){const n=hn(e,t?"byDimDef":"byMeasureDef"),r=hn(e,"formatting.qNumFormat"),s=hn(e,"formatting.isCustomFormatted");if(n){const e=ui.create(ui.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 xi(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function qi(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Di(e){return"libraryItem"===hn(e,"color.point.byDimDef.type")}function Si(e){return"libraryItem"===hn(e,"color.point.byMeasureDef.type")}function Ci(e){return!0===hn(e,"color.point.auto")}function Ei(e){return!Ci(e)&&"byDimension"===hn(e,"color.point.mode")}function wi(e){return!Ci(e)&&"byMeasure"===hn(e,"color.point.mode")}var Ai={measuresHasBaseColors:function(e){return hn(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!qi(e))).length>0},dimensionsHasBaseColors:function(e){return hn(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!qi(e))).length>0},onGlobalChangeColors:function(e){hi.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:Ei,isColorByMeasure:wi,isColorAuto:Ci,isColorByExpression:function(e){return!Ci(e)&&"byExpression"===hn(e,"color.point.mode")},isColorBySingle:function(e){return!Ci(e)&&"primary"===hn(e,"color.point.mode","primary")},isDimensionLibraryItem:Di,isMeasureLibraryItem:Si,showLegend:function(e){const t=hn(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Ci(e)},showColorByLabel:function(e){const t=Ei(e)&&!1===Di(e),n=wi(e)&&!1===Si(e),r=hn(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 Mi(e,t){this.getSettings=e,this.getElements=t}function Ii(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();mn(n,"qSortByExpression",r.SORT_BY_EXPRESSION),mn(n,"qSortByAscii",r.SORT_BY_ASCII),mn(n,"qSortByNumeric",r.SORT_BY_NUMERIC),mn(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Ti(this.getElements());n.qExpression.qv=i.exp}function Ti(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Mi.prototype.applyAutoSorting=Ii,Mi.prototype.applyDefaultCustomSorting=function(e,t){Ii.call(this,e);const n=Ti(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},mn(t.sortCriteria,"sortByExpression",r.qSortByExpression),mn(t.sortCriteria,"sortByAscii",r.qSortByAscii),mn(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),mn(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},Mi.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(mn(n,"qSortByExpression",t.sortCriteria.sortByExpression),mn(n,"qSortByAscii",t.sortCriteria.sortByAscii),mn(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),mn(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 ki={create:function(e,t){return new Mi(e,t)}};const Oi={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 Li={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Li.ASCII),Object.freeze(Li);const Ni=Fr(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Li);const Pi={getSettings:function(e){return hn(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Ni.DIST_MAX:Ni.ASCII}};function _i(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?jr.wrapExpression(t):"",a=n?jr.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 Ri={getElementIds:function(){return[oi.SORTING_ELEMENT_MIN_ID,oi.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],a=e[0],s=_i(0,i,o,a),l=_i(1,i,o,a);return[{id:oi.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:s,isDefault:oi.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:oi.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:oi.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:_i};function Hi(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Fi(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 Pi.getSettings(t)},a=ki.create(o,(function(){const e=o();return Ri.getElements(n.measures,n.dimensions,e,r)})),s=i[0],l=e.sorting;Oi.applySorting(a,s,l)}const ji={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)&&Hi("'qHyperCubeDef.qDimensions' has no outer dimension"):Hi("no 'qHyperCubeDef.qMeasures' in properties arg"):Hi("no 'qHyperCubeDef.qDimensions' in properties arg"):Hi("no 'qHyperCubeDef' in properties arg")}(e),r?Fi(e,t,r,i):Ur.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{Fi(e,t,n,i)}))}},Bi=`${oi.SORT_CRITERIA}.sortByExpression`;const zi={updateSortOrder:function(e,t){if(!t)return;const n=hn(e,Bi);if(!(-1===n||1===n))return;const r=hn(e,oi.SORTING_ELEMENT_ID),i=hn(t,oi.SORTING_ELEMENT_ID),o=r===oi.SORTING_ELEMENT_MAX_ID,a=r===oi.SORTING_ELEMENT_MIN_ID&&i===oi.SORTING_ELEMENT_MAX_ID,s=o&&(!!!i||i===oi.SORTING_ELEMENT_MIN_ID),l=hn(t,Bi),u=o&&!(-1===l||1===l)&&1===n;a?mn(e,Bi,1):(s||u)&&mn(e,Bi,-1)}},Vi=(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 $i(e){return!hn(e,"color.point.auto")&&"byDimension"===hn(e,"color.point.mode")&&hn(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Ui(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=>!hn(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(oi.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=>!hn(e,"color.point.auto",!0)&&"primary"===hn(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=>!hn(e,"color.point.auto")&&"byExpression"===hn(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=((e,t,n,r)=>r({theme:e,translator:t,config:{id:n,paths:["axis.title","axis.label.name","label.value"]}}))(r,n,oi.CHART_ID,nr),c=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(u,r,oi.CHART_ID),p={type:"items",translation:"properties.presentation",items:{styleEditor:i&&Vi(o,c,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}}}}};p.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:oi.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},p.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,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?(mn(i,"measureAxis.autoMinMax",!1),mn(i,"measureAxis.minMax","min"),mn(i,"measureAxis.min",0)):mn(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>hn(t.layout,`${oi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>hn(t.layout,`${oi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>hn(t.layout,`${oi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==hn(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)=>hn(t.layout,`${oi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function h(e,t){const n=hn(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,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:""},g=(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:m(e,r)}),t}return[]},y=(e,t)=>{const n="measure"===hn(e,"color.point.useBaseColors")&&Ai.measuresHasBaseColors(t),r="dimension"===hn(e,"color.point.useBaseColors")&&Ai.dimensionsHasBaseColors(t);return Ai.isColorBySingle(e)&&!n&&!r},v=(e,t)=>!hn(e,"color.point.auto",void 0)&&"primary"===hn(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=>hn(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{hn(e,"color.point.auto")||(mn(e,"color.point.mode","primary"),mn(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"===hn(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Ai.isColorAuto(e),change(e){if("primary"===hn(e,"color.point.mode",void 0)){const t=hn(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&mn(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Ai.isColorByDimension(e)&&g(e,0,n).length>1,change(e){h(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const r=hn(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Ai.isColorAuto(e)&&"primary"===r&&(Ai.measuresHasBaseColors(n)||Ai.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},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=Ai.hasDimValueColors(r.handler,s);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Ai.isColorByDimension(e)&&Ai.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(oi.CHART_ID,"box","fill");return a(e)},show:e=>!hn(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Ai.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"}),hn(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Ai.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Ai.isColorByDimension(e),change(e){h(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Ai.isColorByMeasure(e),change(e){h(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Ai.showColorByLabel,change(e){const t=hn(e,"color.point.mode"),n=hn(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=hn(e,"color.point.mode","primary");return!Ai.isColorAuto(e)&&"primary"===n&&(Ai.measuresHasBaseColors(t)||Ai.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!hn(e,"color.point.auto")&&"byMultiple"===hn(e,"color.point.mode")&&"measure"===hn(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Ai.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===hn(e,"color.point.useBaseColors")&&Ai.measuresHasBaseColors(t),r="dimension"===hn(e,"color.point.useBaseColors")&&Ai.dimensionsHasBaseColors(t);return Ai.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Ai.isColorByDimension(e)&&Ai.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=hn(e,"color.point.auto"),n=hn(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===hn(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>hn(e,"color.point.auto")||"byDimension"!==hn(e,"color.point.mode")||"libraryItem"!==hn(e,"color.point.byDimDef.type")?$i(e):$i(e)&&!hn(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Ai.isColorAuto(e)&&Ai.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Ai.isColorAuto(e)&&Ai.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Ai.isColorByDimension(e)&&(!Ai.isDimensionLibraryItem(e)||!hn(e,"color.point.useDimColVal"))},customRange:{show:e=>!Ai.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Ai.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Ai.isColorByMeasure(e)&&!1===hn(e,"color.point.autoMinMax"),invalid:e=>"minMax"===hn(e,"color.point.minMax")&&hn(e,"color.point.measureMin")>=hn(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Ai.isColorByMeasure(e)&&!1===hn(e,"color.point.autoMinMax"),invalid:e=>"minMax"===hn(e,"color.point.minMax")&&hn(e,"color.point.measureMin")>=hn(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Ai.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(oi.CHART_ID,"box","fill");return a(e)},show:e=>!hn(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Ai.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Ai.showLegend(e)&&hn(e,"legend.show",!0)},showTitle:{show:e=>Ai.showLegend(e)&&hn(e,"legend.show",!0)}}}}},q={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"}}}}}}},D={uses:"settings",items:{simpleLabels:q,general:l,presentation:p,colors:x||s,measureAxis:d,dimensionAxis:f}},S={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Ai.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},C=ti.expression(`${oi.SORT_CRITERIA}.sortByExpression`),E={type:"items",items:{toggled:C.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:oi.SORTING_EXPRESSION,elementRef:oi.SORTING_ELEMENT_ID,show:si.isSortByExpression,elements:e=>Ur.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const r=Pi.getSettings(e.layout);return Ri.getElements(t.measures,t.dimensions,r,n)}))},order:C.items.order}},w={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&zi.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:oi.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:si.hasMultipleDimensions,change(e,t,r,i){if(e&&si.hasMultipleDimensions(e)&&t.layout)return ji.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:oi.SORTING_EXPRESSION,elementRef:oi.SORTING_ELEMENT_ID,sortCriteriasRef:oi.SORT_CRITERIA,show:e=>si.hasMultipleDimensions(e)&&!si.isAutoSort(e),elements:e=>Ur.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const r=Pi.getSettings(e.layout);return Ri.getElements(t.measures,t.dimensions,r,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>si.hasMultipleDimensions(e)&&!si.isAutoSort(e),items:{expression:E,numeric:ti.numeric(`${oi.SORT_CRITERIA}.sortByNumeric`),ascii:ti.ascii(`${oi.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!si.isSortByExpression(e)&&!si.isSortByNumeric(e)&&!si.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!si.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:w,addons:S,settings:D}}}const Wi={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,a={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>hn(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=Yi(e,o).chart;l||(l="sortByAscii");const u=hn(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=Yi(e,o).dimension;return t?hn(e,o+t):0}}}};return a}};function Yi(e,t){const n={chart:"",dimension:""};return 0!==hn(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==hn(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==hn(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Ki={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Wi.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Pi.getSettings,Ri.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}}}}},Gi={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=>Ai.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Ai.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Ai.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Ai.showLegend}}}}};function Xi(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Ui(e),softDefinition:Ki,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Ai.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=qr(e);r.mapProperties();return Mr({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Ir({propertyTree:e,viewDataMode:n})}}Fr(!0,Ki,Gi);const Ji={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 Zi(){return Ji.id()}const Qi="scrollbar";function eo(e,t,n){return"y"===e?to(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function to(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var no={getAxisDock:eo,getOppositeAxisDock:function(e,t,n){return eo(e,"far"===t?"near":"far",n)},getYAxisDock:to};const ro=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),io=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),oo=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ao(e){return ro.test(e)}function so(e){return io.test(e)||oo.test(e)}var lo={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],ao(r))return"ltr";if(so(r))return"rtl"}return"ltr"}};var uo={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 Fr(!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"),Fr(!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} ${lo.lrm}(${n})${lo.lrm}`:`${lo.lrm}(${n})${lo.lrm}`:!1!==e.showLabel?t:""}};const co={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}}};co.DEFAULT_CHART_ORIENTATION=co.HORIZONTAL;function po(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||co.DEFAULT_CHART_ORIENTATION,a=o===co.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=co.SHOW_AXIS_LABELS_OPTIONS,c=co.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),h=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(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Fr(i,co.LAYOUTSETTINGS.measureAxis);const o=ho(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Fr(r,co.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return ho(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=Fr(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Fr(r,co.LAYOUTSETTINGS.dimensionAxis);const i=mo(t,n);Fr(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),h&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Fr(r,co.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return mo(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===co.HORIZONTAL?co.VERTICAL:co.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=Fr(r,co.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=Fr({},co.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),fo(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===Qi))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Qi).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Qi).emit("panStart",e)},pan(e){this.chart.component(Qi).emit("panMove",e)},panend(e){this.chart.component(Qi).emit("panEnd",e)},pancancel(e){this.chart.component(Qi).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=no.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Fr(o,co.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${Zi()}`,require:["renderer","chart"],dock:no.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=Fr(a,co.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=Fr(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=uo.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=uo.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",co.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Fr(o,co.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,mo(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Fr(o,co.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,ho(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Fr(o,co.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,mo(n,l).dock,n.isRtl)}n.brushActions&&fo(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function fo(e,t){t.forEach((t=>{e.push(t)}))}function ho(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function mo(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function go(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 Fr(!0,{},o,e||{})}function yo(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"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:no.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},h=Fr(!0,{},f,e||{});return h.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),h}function vo(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:no.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return Fr(!0,{},u,e||{})}go.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=go(Fr(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},go.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 go(Fr(!0,n,e||{}),t)},yo.xAxis=function(e,t){return yo(Fr(!0,{key:"x-axis",scale:"x"},e||{}),t)},yo.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:no.getYAxisDock(n,r)};return yo(Fr(!0,i,e||{}),t)},vo.xAxisTitle=function(e,t){return vo(Fr(!0,{key:"x-axis-title"},e||{}),t)},vo.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:no.getYAxisDock(n,r)||"left"};return vo(Fr(!0,i,e||{}),t)};var bo={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 xo={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 qo(){return xo}function Do(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}qo.getLayoutModeKeys=function(){const e=[];let t;for(t in xo)e.push(t);return e};const So={left:"left",right:"right",up:"top",down:"bottom"};function Co(e,t,n){switch(e){case"scale":return go(t,n);case"measure-scale":return go.measureScale(t,n);case"dimension-scale":return go.dimensionScale(t,n);case"axis":return yo(t,n);case"box-marker":return function(e){return Fr(!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 Fr(!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 Fr(!0,{},o,e||{})}(t,n);case"text":return vo(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})})),Fr(!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:bo.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:bo.getBublesAlign(a,s,l)}}};return Fr(!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 p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:bo.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:bo.getBublesAlign(s,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Fr(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),p={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-${So[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 Fr(!0,{},p,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 p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(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 Fr(!0,{},d,e)}(t,n);case"x-axis":return yo.xAxis(t,n);case"y-axis":return yo.yAxis(t,n);case"x-axis-title":return vo.xAxisTitle(t,n);case"y-axis-title":return vo.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 Fr(!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 Fr(!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 Fr(!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 Fr(!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:Do}]}}}]}};return Fr(!0,{},o,e||{})}(t,n);default:return}}function Eo(e){this.options=e||{},this.settings={dockLayout:{layoutModes:qo()},components:[],scales:{}}}Eo.prototype.addComponent=function(e,t,n){const r=Co(e,t,Fr(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Eo.prototype.addInteraction=function(e,t){const n=Co("interaction",e,Fr(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Eo.prototype.addScale=function(e,t,n){const r=Co(e,t,Fr(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Eo.prototype.getSettings=function(){return this.settings},Eo.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Eo.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");po(t,n)}(e,this,t)},Eo.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))},Eo.create=function(e){return new Eo(e)},Eo.createComponent=Co;const wo={CENTER:0,BOTTOM:1};var Ao={DISCLAIMERS:[{label:"NoDataExist",alignment:wo.CENTER,default:!0},{label:"RequireNumericDimension",alignment:wo.CENTER,default:!1},{label:"OnlyNanData",alignment:wo.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:wo.CENTER,default:!1},{label:"LimitedData",alignment:wo.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:wo.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:wo.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:wo.BOTTOM,default:!1}],ALIGNMENT:wo};const Mo={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,Ao.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 Io(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function To(e,t){return e&&t&&t[e]}function ko(e){this.environment=e,this.clear()}Io.prototype.isValidAndSupported=function(e,t){return To(e.label,this.dataAttributes)&&(e.default||To(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Io.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},Io.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},ko.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},ko._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},ko.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=Fr(!0,{},this.vizAttributes.supportedDisclaimers),i=new Io(Ao.DISCLAIMERS,this.dataAttributes,r);let o,a;if(i.isAnyValidDisclaimer(Ao.ALIGNMENT.CENTER))o=i.getMessage(Ao.ALIGNMENT.CENTER,n),a="center";else{if(!i.isAnyValidDisclaimer(Ao.ALIGNMENT.BOTTOM))return;o=i.getMessage(Ao.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)}}},ko.prototype.set=function(e){if(this.clear(),!e)throw new Error(ko.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Mo.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},ko.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Oo=ir.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 ko(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:[Eo.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Eo.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=Fr(!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:hn(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 Lo(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 No={generateHash:function(e){return Lo(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=No.generateHash(t)}};const Po={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:Ro(t),dimensionExpressions:_o(t),measureExpressions:e})))}};function _o(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Ro(e){const t=function(e){return hn(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Ho={},Fo=Fr.bind(null,!0);function jo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Bo=Array.isArray,zo=function(e){return void 0===e};function Vo(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function $o(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]=zo(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Uo(e,t){if(jo(e)&&jo(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Uo(e[n],t[n]))return!1;return!0}if(Bo(e)&&Bo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Uo(e[n],t[n]))return!1;return!0}return e===t}Ho.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=Fo({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;Uo(o,a)||Vo(t,i)||(zo(a)?r.push({op:"add",path:s,value:o}):jo(o)&&jo(a)?r=r.concat(Ho.generate(a,o,s)):Bo(o)&&Bo(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]&&zo(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(Uo(t,i))return r;if(null===t[0]||!zo(t[0])&&zo(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(Ho.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=>{zo(t[i])&&!Vo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Ho.apply=function(e,t){t.forEach((t=>{const n=$o(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(Bo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Bo(i)&&Bo(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else jo(i)&&jo(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Vo(a,e)&&delete a[e]})),Fo(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=$o(e,t.from);Bo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Bo(n)?n.splice(+r,1):delete n[r]);var a}))},Ho.clone=function(e){return Fo({},e)},Ho.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},Ho.updateObject=function(e,t){Object.keys(e).length?Ho.apply(e,Ho.generate(e,t)):Fo(e,t)};class Wo{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Ho.generate(e,t);return Fr(!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=Ho.generate(n,r);Ho.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Yo={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 Ko={saveDerivedProperties:function(e,t,n,r){if(Yo.canModifyHardProperties(t))return e.setProperties(n);return new Wo(e).saveSoftProperties(r,n)}};var Go={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Xo(){this._generationInProgress=!1}function Jo(e){Go.validate(e);const t=e.properties,n=No.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Xo.prototype.isDerivedUpToDate=Jo,Xo.prototype.updateDerivedProperties=function(e){if(Go.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Jo(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=Fr(!0,{},e.properties),o=Fr(!0,{},i);return this._generationInProgress=!0,No.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Ko.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},Xo.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Po.getDefaultHashDataForHyperCube(e,t,n).then((e=>Fr(!0,r,e)))};var Zo={},Qo={get exports(){return Zo},set exports(e){Zo=e}};!function(e,t){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 t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return(t=i(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 r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){s&&"__proto__"===t.name?s(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,f=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(s,n),s!==(i=d(t,n))&&(h&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&c(r)?r:{},p(s,{name:n,newValue:e(h,a,i)})):void 0!==i&&p(s,{name:n,newValue:i}));return s};function h(e,t,n){if(!e)return-1;const r=n.cache,i=e.origin?e.origin():null;i&&(e=i);let o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(let t=0;t<r.wrappedFields.length;t++)if(s=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==s||-1!==a){o=t;break}return o-=t.qArea.qLeft,o<0||o>=t.qArea.qWidth?-1:s>=0?e=>e[o].qAttrDims.qValues[s]:a>=0?e=>e[o].qAttrExps.qValues[a]:e=>e[o]}function m(e,t,n){let{key:r}=n;const 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 g(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:p}=e,d=r;if(i.field&&i.field!==n){const e=h(i.field,a,{cache:t});if(-1===e)return;d=f({qRow:s},e(l))}c[p]=m(i,d,{key:u})}function y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),p=Object.keys(u),d=!!i[e].trackBy,y=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<a.qDataPages.length;t++){const o=h(l,a.qDataPages[t],{cache:n});if(-1!==o)for(let h=0;h<a.qDataPages[t].qMatrix.length;h++){const q=a.qDataPages[t].qArea.qTop+h,D=f({qRow:q},o(a.qDataPages[t].qMatrix[h])),S=m(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],props:u,page:a.qDataPages[t],rowIdx:q,row:a.qDataPages[t].qMatrix[h],sourceKey:s,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e]});if(r.fields){const t=S[p[e]].map((e=>e.value)),n=S[p[e]].map((e=>e.label));S[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:b,tracker:v,trackType:y}),x.push(S)}}}const q=d?r.collect(b,{main:c,propsArr:p,props:u}):x;o=[...o,...q]}return o}function v(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function b(){return this.eachAfter(v)}function x(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function q(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function D(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function E(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 w(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function A(e){for(var t=this,n=M(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 M(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 I(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function T(){return Array.from(this)}function k(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function O(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*L(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function N(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=R)):void 0===t&&(t=_);for(var n,r,i,o,a,s=new j(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new j(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(F)}function P(){return N(this).eachBefore(H)}function _(e){return e.children}function R(e){return Array.isArray(e)?e[1]:null}function H(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(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 B(e){return null==e?null:z(e)}function z(e){if("function"!=typeof e)throw new Error;return e}j.prototype=N.prototype={constructor:j,count:b,each:x,eachAfter:D,eachBefore:q,find:S,sum:E,sort:w,path:A,ancestors:I,descendants:T,leaves:k,links:O,copy:P,[Symbol.iterator]:L};var V={depth:-1},$={},U={};function W(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=W,n=Y;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>G(e(t,n,r)))),n=t.map(X),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(X(e)),d.push(U));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new j(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?$:u)),null!=(c=h(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===$)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===U&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===U;--e)u.data=null}if(s.parent=V,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(F),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=B(e),r):t},r.parentId=function(e){return arguments.length?(n=B(e),r):n},r.path=function(t){return arguments.length?(e=B(t),r):e},r}function G(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 X(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 r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}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 r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function ae(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function se(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 r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=se(n);return ne.test(p)&&(i=!0,o=+ne.exec(p)[1],p=r.replace(ne,"")),re.test(p)&&("K"===n.qMode?u=+re.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+re.exec(p)[1],c=0):c=+re.exec(p)[1],p=p.replace(re,"")),p&&(oe.exec(p)?s=+oe.exec(p)[1]:ie.exec(p)&&(a=+ie.exec(p)[1])),l=i?"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:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function ue(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=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 ce(e,t,n){let{key:r}=n;const 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 pe(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=N(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const n=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=ae(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<n.length;e++){const r=n[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const n=r[o[e]],a="".concat(i,"__").concat(null!==(l=n.qElemNumber)&&void 0!==l?l:n.qElemNo);s[a]||(s[a]=t({__id:a,__parent:i,qValues:[]},n),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map((e=>s[e])),c=K().id((e=>e.__id)).parentId((e=>e.__parent))(u);return c}const he=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=ue(o,le(t.field,{cube:r,cache:i}));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]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=n.raw(),a=n.key(),s="S"===o.qMode?fe(n):de(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=se(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(t(t({},e),{},{field:s?s.key():void 0}),n),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?le(s,{cube:o,cache:r}):{fieldDepth:0};he({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=ce(r,o,{key:a});pe({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a,isTree:!0}),p[e].data=s}return s}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!de(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=le(u,{cube:s,cache:n}),{nodeFn:h,attrFn:m,valueFn:g}=ue({fieldDepth:0},f);he({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],q=h(n.tree),D=[];for(let e=0;e<q.length;e++){const t=q[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ce(p,n,{key:l});pe({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),D.push(o)}const S=y?r.collect(x,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==C||"undefined"!=typeof self&&self;var ve=ye((function(e){
24
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=a)&&(t=(+t).toFixed(a+1)),c=e[0].split(o),e[0]=c.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-s;)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=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)m+=p.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},_t({exports:{}});var Ut=["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"],Wt=["Abril Fatface, serif","Bangers, fantasy","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Nixie One, sans-serif","Noto Sans, sans-serif","PT Serif, serif","Permanent Marker, fantasy","Rammetto One, fantasy","Roboto, sans-serif","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Open Sans, sans-serif","Montserrat, sans-serif","Raleway, sans-serif","Bebas Neue, sans serif","Lobster, fantasy","Pacifico, cursive","Inter, sans-serif","Indie Flower, fantasy","Yanone Kaffeesatz, sans-serif"],Kt=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function Yt(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,V(new Set([r].concat(V(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(V(o.map((function(e){return Kt(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],V(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Wt:Ut}(i).map((function(e){return Kt(e)}))))}({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Gt=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Xt=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Jt(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,V(new Set([n].concat(V(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(V(r.map((function(e){return Xt(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],V(Gt.map((function(e){return Xt(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Zt(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Yt({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Jt({theme:t,translator:n,id:r,path:i})}}function Qt(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Zt({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}const en=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,tn=function(){};function nn(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}tn.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]&&en.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},nn.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new nn(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 nn(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 nn(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new nn(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 nn(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 rn=new nn(0,0,0,0),on=new nn(0,0,0,0),sn=tn.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,rn.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),on.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=on.intersection(rn,!0),r.push({coverage:i?i.clone():new nn(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){rn.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),on.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=rn.intersection(on,!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 an;function ln(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 un(e,t,n){let r,i,o;const s=[];let a=[],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&&(a=un(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&an>=e&&an<=e+t||a.length>0)&&(o=ln(i,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+r),o.qSubNodes=a),0===i.qSubNodes.length&&an++,an===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return s}function cn(e,t,n){return an=0,un(e,t,n)}const pn=new nn(0,0,0,0),dn=new nn(0,0,0,0),fn=sn.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,pn.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),dn.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=dn.intersection(pn,!0),r.push({coverage:i?i.clone():new nn(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){pn.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),dn.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=pn.intersection(dn,!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:cn(r,n.height,t.qLeft),qTop:cn(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function hn(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new fn;else{if("table"!==e.visualization)return;this.slicer=new sn}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter((e=>e)))}class mn{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,hn.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=Pt(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const gn={version:"0.40.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 yn(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function vn(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function bn(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){yn(t),vn(t)},moved(e,t){yn(t),vn(t)},removed(e,t){yn(t),vn(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var xn={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,s=Object.getOwnPropertyDescriptor,a=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(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,s,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p}},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,s=Object.getOwnPropertyDescriptor,a=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(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,s,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p}},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],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];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 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},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return a+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 s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function p(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 h(){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,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),h(0));return"".concat(s,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=h(0),m=h(1),g=y(p,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 q={isFullRange:p,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=u(f(t));if(!n.showExcludedValues)return s;var a=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var p=h(0),d=h(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.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,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function D(e){return(D="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 S=i.a.bind(null,!0),C={},E=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===D(e)}function w(e){return void 0===e}function I(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=w(e[n||t])?o:e[t],e=e[n||t]}})),e}function M(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){M(e[r],t[r])||(n=!1)})),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!M(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?S({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);M(o,s)||I(t,i)||(w(s)?r.push({op:"add",path:a,value:o}):A(o)&&A(s)?r=r.concat(C.generate(s,o,a)):E(o)&&E(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&w(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(M(t,i))return r;if(!w(t[0])&&w(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(C.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=s(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}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){w(t[i])&&!I(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},C.apply=function(e,t){t.forEach((function(t){var n,r=T(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(E(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(E(o)&&E(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(A(o)&&A(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!I(n,e)&&delete n[e]})),S(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=T(e,t.from);E(r)?r.splice(+i,0,u.splice(+s,1)[0]):(r[i]=u[s],delete u[s])}else"remove"===t.op&&(E(r)?r.splice(+i,1):delete r[i])}))},C.clone=function(e){return S({},e)},C.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},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):S(e,t)};var O=C,L=function(e,t,n){if(!e)return Promise.resolve();var r=O.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()},k="accumulation";function P(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===k)return n[r]}function _(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===k)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var N={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},R={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.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,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=s(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:a}),p=q.getNumStepComp(n,l),d=q.getAboveComp(n,l,c,p),f=q.getRangeComp("RangeSum",d);if(q.needDimension({modifier:n,properties:r,layout:i})){var h=q.getDimComp(u,1),m=q.getDimComp(u,0),g=q.getAggrComp(f,h,m);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:a,valueComp:g}):g}return f},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,N)},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!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(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(_(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(_(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(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(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=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(k))return!1;var o=P(t,e);return o&&!o.disabled}};return n}},H="movingAverage";function F(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===H)return n[r]}function B(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===H)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},z={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.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,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=a;void 0===u&&(u=q.getNumDimensions({properties:i,layout:o}));var c=s(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=q.getNumStepComp(r,u),h=q.getAboveComp(r,u,d,f);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",h);else{var m=q.getRangeComp("RangeSum",h),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.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(q.needDimension({modifier:r,properties:i,layout:o})){var v=q.getDimComp(c,1),b=q.getDimComp(c,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,j)},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!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(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(B(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(B(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(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(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=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(H))return!1;var o=F(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(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=s(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 W={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},K={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=s(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:a}),p=q.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(q.needDimension({modifier:n,properties:r,layout:i})){var f=q.getDimComp(u,1),h=q.getDimComp(u,0),m=q.getAggrComp(d,f,h);d=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(W).forEach((function(t){void 0===e[t]&&(e[t]=W[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!q.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 q.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=$(t,e);return o&&!o.disabled}};return n}},Y={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},G={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},X="normalization";function J(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)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:G.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:G.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:G.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:Y.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:Y.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:Y.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:G.DISREGARD_ALL_DIMENSIONS,selectionScope:Y.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(q.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(q.getDimDefWithWrapper(n),">"):""}var ae={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var u=s(r,"qHyperCubeDef.qDimensions",[]),c=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:a}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=re(t),l=ie(t,n,r),u=""===a&&""===l?"":a||l,c=oe(i,o),p=se(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,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!q.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:Y.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===Y.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===Y.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:G.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)===G.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,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"}},ue={initBase:function(e,t){(t||ue.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){ue.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}},ce=ue;function pe(e){return(pe="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:R,movingAverage:z,difference:K,normalization:ae},fe=(t.default={modifiers:de,apply:he,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return de[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return de[e]&&de[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=qe(e);Ie({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||ke({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function he(){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,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"===pe(n))return me({model:t,properties:n});var u=t?t.layout:void 0,c=s(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var p=s(u,"qHyperCube.qMeasureInfo"),d=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:p,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(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 we({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:p,layout:u,model:t,lastReloadTime:d});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ie({modifiers:qe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:p,layout:u,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Se(n);var r=Pe(n);return Te({model:t}).then((function(i){return Me({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(we({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===pe(e)&&!e.disabled){if(n++,"object"!==pe(de[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=de[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ee(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===pe(e.base)}))}(p)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Pe(n);return _e({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Le({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,a=e.runUpdateIfChange,l=void 0!==a&&a,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Se(r);var d=Pe(r);return _e({model:t,libraryIds:d,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=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:Pe(n);return Te({model:r,dimensionAndFieldList:a}).then((function(e){return Me({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ie({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,a=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"===pe(e)&&!e.disabled){if(a++,"object"!==pe(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||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=de[n.type].generateExpression({expression:a,modifier:n,properties:r,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=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof de[n.type].updateModifier&&de[n.type].updateModifier(n,r.qHyperCubeDef);var s=le.getExpression(t),a=de[n.type].generateExpression({expression:s,modifier:n,properties:r,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=i()(!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:r,dimensionAndFieldList:e}),Ce(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Le({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=qe(e);return Array.isArray(t)&&t.some((function(e){return"object"===pe(e)&&!e.disabled&&!de[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ce(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ie({modifiers:qe(e),properties:n,layout:r})}))}function ve(e){var t=qe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(de[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||de[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function qe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function De(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Se(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&De(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Ce(e){var t=qe(e);Array.isArray(t)&&t.forEach((function(t){"object"===pe(t)&&(t.disabled||!de[t.type]&&De(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ee(e){return e.base||e.qDef&&e.qDef.base}function Ae(e){var t=Ee(e);return e.qLibraryId||t&&t.qLibraryId}function we(e){var t=e.measure,n=e.properties,r=e.layout;return!Ae(t)&&Ie({modifiers:qe(t),properties:n,layout:r})}function Ie(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==pe(e)||e.disabled||!de[e.type])&&(void 0===i[e.type]&&(i[e.type]=de[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Te(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 s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Me(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.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 Oe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Le(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Oe)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Oe)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Oe)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Oe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):L(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function ke(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===pe(e)&&!e.disabled&&de[e.type]&&de[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Pe(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=qe(t);if(Ie({modifiers:r,properties:e})){var o=Ae(t);o&&n.push(o),i=i||ke({modifiers:r,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function _e(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},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 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,s=e.dimensionLibraryIds,a=[];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:s}),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]&&a.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&a.push(c(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return he({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}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 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,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&&null!=e[Symbol.iterator]||null!=e["@@iterator"])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 p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},d=n(1),f=n.n(d),h={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(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 s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}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 q=Math.pow(2,53)-1;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,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e){return function(e){if(Array.isArray(e))return E(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 E(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)?E(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 E(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 A={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,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<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var u=v(a.excludedDimensions[t],s);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,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<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var u=b(a.excludedMeasures[t],s);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},s=r.measures||{max:0},a=x(s.max,i.dimensions.length,q),l=x(s.min,i.dimensions.length,0);return{maxDimensions:x(o.max,a,q),minDimensions:x(o.min,l,0),maxMeasures:a,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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.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,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=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>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&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,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=D(i.qDimensions);i.qDimensions=[],s.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,s=C(i.qMeasures);i.qMeasures=[],s.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function w(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 I={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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h.addDimensions({exportFormat:i,qHyperCubeDef:l}),h.addMeasures({exportFormat:i,qHyperCubeDef:l}),h.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,h.copyProperties({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),h.updateLayoutExclude({exportFormat:i,properties:s}),r||h.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,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=A.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=A.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,C=l.defaultDimension,E=void 0===C?A.getDefaultDimension():C,I=l.defaultMeasure,T=void 0===I?A.getDefaultMeasure():I;v.qDimensions.length=0,v.qMeasures.length=0,A.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&A.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),A.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:E}),A.addMeasures({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:T}),A.updateDimensionsOnAdded({newProperties:g,dataDefinition:s,hypercubePath:u}),A.updateMeasuresOnAdded({newProperties:g,dataDefinition:s,hypercubePath:u}),A.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),A.copyPropertyIfExist("qMaxStackedCells",y,v),A.copyPropertyIfExist("qNoOfLeftDims",y,v),A.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A.copyPropertyOrSetDefault("qMode",y,v,"S"),A.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),A.copyPropertyOrSetDefault("qSortbyYValue",y,v),A.copyPropertyOrSetDefault("qIndentMode",y,v),A.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),A.importCommonProperties(g,t,r),m.qProperty=g;var M=o.getValue(c||{},"support.modifiers");return A.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:M}),d&&w(m.qProperty,"storedFilters"),"S"===v.qMode&&h&&w(m.qProperty,"dynamicScript"),m}},T={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function M(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function O(e,t){return e.length!==t}var L={create:function(e,t){if(!e||!T[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 s=e[o][n],a=t.length;if(M(s,t,r,i),O(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"}},k={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}},P={colorModeOptions:{primary:function(){return!0},dimension:function(e){return k.getNumDimensions(e)>0&&k.getNumMeasures(e)<=1},multiColor:function(e){return k.getNumMeasures(e)>1},measure:function(e){return k.getNumDimensions(e)>0},expression:function(e){return k.getNumMeasures(e)>=1}}},_={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return k.getNumMeasures(e)>=1}}},N={scatterplot:_,"sn-scatter-plot":_,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return k.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return k.getNumDimensions(e)>1},multiColor:function(e){return k.getNumMeasures(e)>1},measure:function(e){return k.getNumDimensions(e)<=1},expression:function(e){return k.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return k.getNumDimensions(e)>=1},multiColor:function(e){return k.getNumMeasures(e)>1},measure:function(e){return k.getNumDimensions(e)>=1},expression:function(e){return k.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 k.getNumDimensions(e)>=1}}}};function R(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function H(e,t){var n=L.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){R(e,"qAttributeDimensions",n),R(e,"qAttributeExpressions",n)})),t.forEach((function(e){R(e,"qAttributeDimensions",n),R(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function B(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;H(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=L.create(L.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,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;i||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function j(e,t,n,r){var i,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":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=i,a.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(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 z={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,s=o.mode,a=k.getItemLabel(t);switch(F(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||k.wrapFieldName(t.name),key:k.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&&z.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=s)}function $(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("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=L.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,j("dimension",!!s,s||r)),!!s}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"),[]),s=o.getValue(e,"color.byDimDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!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=j("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;B({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function W(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"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!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=j("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}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=L.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return V(e,j("measure",!!a,a||r[0])),!!a}(e,t))return;B({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var K={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=(N[t]||P).colorModeOptions||P.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"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?H(i,a):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,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:s,properties:e})?W(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"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),H(r,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,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}},Y={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=I.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=L.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return L.moveByIdFromGroup(s,[],"qAttributeDimensions",u),L.moveByIdFromGroup(s,[],"qAttributeExpressions",u),L.moveByIdFromGroup(a,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=I.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),h=o.getValue(p,"color.mode",""),m=o.getValue(p,"color.auto",""),g=K.getCanColorBy(p,d),y=K.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?K.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:p})&&K.addColorByExpression(p):K.switchToAutoColor(p),y&&K.updateColorBy(p,"qHyperCubeDef."),K.shouldSwitchToColorPersistent(p)&&K.changeProperty(p,"color.persistent",!0),K.deleteTotalMode(f),c}},G=["bar","marker","line"],X={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?w(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):w(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=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}}),G.includes(r)&&t[i].type[r]++,t[i].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,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=Y.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),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,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=Y.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return X.handleAutoMinMax({initialProperties:n,properties:p}),X.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:p,measureType:s}),X.setInterColumnSortOrder(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],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,s=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,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){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,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Z(n,r,a),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,s,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,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:I,colorChart:Y,axisChart:J,quarantineProperty:m,unquarantineProperty:w,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(xn);var qn=E(xn.exports);const Dn=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Sn(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 Cn={importColors:function(e){e.color.point=e.color.point||{},Sn(e.color,e.color.point,Dn),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Sn(e.color.point,e.color,Dn),e.color.colorExpression=Pt(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function En({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=qn.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]),Cn.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function An({propertyTree:e,viewDataMode:t}){const n=qn.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Cn.exportColors(e.qProperty),n}var wn=e=>{const t=bn(e);return{properties:gn,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>En({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:An}},In=Object.prototype.hasOwnProperty,Tn=Object.prototype.toString,Mn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,Ln=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Tn.call(e)},kn=function(e){if(!e||"[object Object]"!==Tn.call(e))return!1;var t,n=In.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&In.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||In.call(e,t)},Pn=function(e,t){Mn&&"__proto__"===t.name?Mn(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},_n=function(e,t){if("__proto__"===t){if(!In.call(e,t))return;if(On)return On(e,t).value}return e[t]},Nn=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=_n(a,n),a!==(i=_n(t,n))&&(c&&i&&(kn(i)||(o=Ln(i)))?(o?(o=!1,s=r&&Ln(r)?r:[]):s=r&&kn(r)?r:{},Pn(a,{name:n,newValue:e(c,s,i)})):void 0!==i&&Pn(a,{name:n,newValue:i}));return a},Rn=E(Nn);const Hn={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Fn={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(Bn(o,!0),i);return s},createRegExp:Bn};function Bn(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const jn={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Hn.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=zn(t,i,e);n[t]=r}))}return Fn.replaceExpressionTokens(e,n)}};function zn(e,t,n){if(""===t)return"";const r=Fn.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const Vn={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach((e=>{o=Yn(e.match(Kn("Dim"))),o.forEach((e=>{a.push($n(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=Yn(e.match(Kn("Mea"))),s.forEach((e=>{a.push(Un(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=Rn({},n,i),o=Rn(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${jn.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:jn.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>$n(e,n,r,t))),i=e.qMeasures.map((e=>Un(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function $n(e,t,n,r){if(e.qLibraryId)return Wn(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Un(e,t){return e.qLibraryId?Wn(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Wn(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 Kn(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Yn(e){return e?e.map((e=>e.substr(6,1))):[]}function Gn(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 Xn={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:Gn,invertedEnumConvertFunctions:function(e){return Gn((function(){return!e||!e()}))}};const Jn=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Zn(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:Jn,convertFunctions:n.sorting,show:t=>0!==Pt(t,e,0)}}}}var Qn={state:function(e,t){return Zn(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Xn.booleanConvertFunctions(t),sorting:Xn.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Zn(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Xn.booleanConvertFunctions(t),sorting:Xn.enumConvertFunctions(t)})},numeric:function(e,t){return Zn(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Xn.booleanConvertFunctions(t,-1),sorting:Xn.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Xn.booleanConvertFunctions(t),sorting:Xn.enumConvertFunctions(t)},r=Zn(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Pt(t,e,0)},r},frequency:function(e,t){return Zn(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Xn.booleanConvertFunctions(t),sorting:Xn.invertedEnumConvertFunctions(t)})}};const er=(e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r},tr=(e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),nr=(e,t)=>(t.components||[]).find((t=>t.key===e)),rr=(e,t,n,r)=>{var i,o,s,a,l;const u=r.isEnabled("CLIENT_IM_3364")?null===(i=nr("axis",n))||void 0===i?void 0:i.axis:{};return{text:{fontFamily:(null==u||null===(o=u.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==u||null===(s=u.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==u||null===(a=u.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},ir=(e,t,n,r)=>{var i,o,s,a,l,u,c,p;const d=r.isEnabled("CLIENT_IM_3364")?null===(i=nr("axis",n))||void 0===i?void 0:i.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===(u=d.label)||void 0===u||null===(c=u.name)||void 0===c||null===(p=c.fontColor)||void 0===p?void 0:p.color)||t.getStyle(e,"axis.label.name","color")}}},or=(e,t,n,r)=>{var i,o,s,a,l;const u=r.isEnabled("CLIENT_IM_3051")?null===(i=nr("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==u||null===(o=u.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==u||null===(s=u.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==u||null===(a=u.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.title","color")}},sr=(e,t,n,r)=>{var i,o,s,a,l;const u=r.isEnabled("CLIENT_IM_3051")?null===(i=nr("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==u||null===(o=u.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==u||null===(s=u.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==u||null===(a=u.label)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"legend.label","color")}},ar={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 lr(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(ar);const ur={hasMultipleDimensions:lr,getOuterDimensionCardinality:function(e){const t=Pt(e,ar.HYPERCUBE_PATH);return lr(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return Pt(e,ar.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==Pt(e,`${ar.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==Pt(e,`${ar.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==Pt(e,`${ar.SORT_CRITERIA}.sortByAscii`,0)}},cr={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var pr={create(e,t){if(!e||!cr[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)),s=i.filter((e=>!(o.filter((t=>t[r]===e[r])).length>0)));return[...t,...s]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,r,i),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 dr={getColorByDefinition:function(e,t,n){const r={};let i,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,s=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:s?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var fr={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 hr=["scatterplot","map"],mr=["map"];var gr={baseColor:{isSupported:e=>e&&e.length&&-1===hr.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==mr.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=Pt(n,"mode"),i=Pt(n,"auto"),o=Pt(e,`${t}qDimensions`,[]),s=Pt(e,`${t}qMeasures`,[]);let a,l,u,c;if(!i&&"byDimension"===r&&o.length)a=Pt(n,"byDimDef"),a&&Dr(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],c=dr.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=a.activeDimensionIndex,xr(n,c)):a&&a.key||(l=o[o.length-1],u=pr.getById(l.qAttributeDimensions,pr.IDMAP.COLOR_BY_ALTERNATIVE),xr(n,dr.getColorByDefinition("dimension",!!u,u||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&s.length<2&&Rt(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=Pt(n,"mode"),i=Pt(n,"auto"),o=Pt(e,`${t}qDimensions`,[]),s=Pt(e,`${t}qMeasures`,[]),a=Pt(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?qr(n,!0,o,a,s,Pt(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?qr(n,!1,o,a,s,Pt(n,"byMeasureDef.label")):yr(o,a)},setColorByPropertyDef:xr,resolveColorByPropertyDef:qr,clearColorByItem:yr};function yr(e,t){e.forEach((e=>{vr(e,pr.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),vr(e,pr.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})),t.forEach((e=>{vr(e,pr.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),vr(e,pr.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}))}function vr(e,t,n){if(e[n]){const r=pr.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function br(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function xr(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(Dr(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||br(t.name),key:br(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&&fr.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function qr(e,t,n,r,i,o){yr(n,r);const s=n[n.length-1];if(s){const n=Pt(e,t?"byDimDef":"byMeasureDef"),r=Pt(e,"formatting.qNumFormat"),a=Pt(e,"formatting.isCustomFormatted");if(n){const e=pr.create(pr.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=a));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=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function Dr(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function Sr(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Cr(e){return"libraryItem"===Pt(e,"color.point.byDimDef.type")}function Er(e){return"libraryItem"===Pt(e,"color.point.byMeasureDef.type")}function Ar(e){return!0===Pt(e,"color.point.auto")}function wr(e){return!Ar(e)&&"byDimension"===Pt(e,"color.point.mode")}function Ir(e){return!Ar(e)&&"byMeasure"===Pt(e,"color.point.mode")}var Tr={measuresHasBaseColors:function(e){return Pt(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!Sr(e))).length>0},dimensionsHasBaseColors:function(e){return Pt(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!Sr(e))).length>0},onGlobalChangeColors:function(e){gr.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:wr,isColorByMeasure:Ir,isColorAuto:Ar,isColorByExpression:function(e){return!Ar(e)&&"byExpression"===Pt(e,"color.point.mode")},isColorBySingle:function(e){return!Ar(e)&&"primary"===Pt(e,"color.point.mode","primary")},isDimensionLibraryItem:Cr,isMeasureLibraryItem:Er,showLegend:function(e){const t=Pt(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Ar(e)},showColorByLabel:function(e){const t=wr(e)&&!1===Cr(e),n=Ir(e)&&!1===Er(e),r=Pt(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 Mr(e,t){this.getSettings=e,this.getElements=t}function Or(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();Rt(n,"qSortByExpression",r.SORT_BY_EXPRESSION),Rt(n,"qSortByAscii",r.SORT_BY_ASCII),Rt(n,"qSortByNumeric",r.SORT_BY_NUMERIC),Rt(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Lr(this.getElements());n.qExpression.qv=i.exp}function Lr(e){const t=e.filter((e=>e.isDefault));return 0===t.length?e[0]:t[0]}Mr.prototype.applyAutoSorting=Or,Mr.prototype.applyDefaultCustomSorting=function(e,t){Or.call(this,e);const n=Lr(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Rt(t.sortCriteria,"sortByExpression",r.qSortByExpression),Rt(t.sortCriteria,"sortByAscii",r.qSortByAscii),Rt(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),Rt(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},Mr.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Rt(n,"qSortByExpression",t.sortCriteria.sortByExpression),Rt(n,"qSortByAscii",t.sortCriteria.sortByAscii),Rt(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Rt(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 kr={create:function(e,t){return new Mr(e,t)}};const Pr={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 _r={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(_r.ASCII),Object.freeze(_r);const Nr=Rn(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},_r);const Rr={getSettings:function(e){return Pt(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Nr.DIST_MAX:Nr.ASCII}};function Hr(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Hn.wrapExpression(t):"",s=n?Hn.wrapExpression(n):"";return`${i}( 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,(r||"").replace(/^=/,""))}const Fr={getElementIds:function(){return[ar.SORTING_ELEMENT_MIN_ID,ar.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],s=e[0],a=Hr(0,i,o,s),l=Hr(1,i,o,s);return[{id:ar.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:a,isDefault:ar.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:ar.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:ar.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Hr};function Br(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function jr(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 Rr.getSettings(t)},s=kr.create(o,(function(){const e=o();return Fr.getElements(n.measures,n.dimensions,e,r)})),a=i[0],l=e.sorting;Pr.applySorting(s,a,l)}const zr={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)&&Br("'qHyperCubeDef.qDimensions' has no outer dimension"):Br("no 'qHyperCubeDef.qMeasures' in properties arg"):Br("no 'qHyperCubeDef.qDimensions' in properties arg"):Br("no 'qHyperCubeDef' in properties arg")}(e),r?jr(e,t,r,i):Vn.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then((n=>{jr(e,t,n,i)}))}},Vr=`${ar.SORT_CRITERIA}.sortByExpression`;const $r={updateSortOrder:function(e,t){if(!t)return;const n=Pt(e,Vr);if(!(-1===n||1===n))return;const r=Pt(e,ar.SORTING_ELEMENT_ID),i=Pt(t,ar.SORTING_ELEMENT_ID),o=!!i,s=r===ar.SORTING_ELEMENT_MIN_ID,a=r===ar.SORTING_ELEMENT_MAX_ID,l=i===ar.SORTING_ELEMENT_MIN_ID,u=i===ar.SORTING_ELEMENT_MAX_ID,c=s&&u,p=a&&(!o||l),d=Pt(t,Vr),f=a&&!(-1===d||1===d)&&1===n;c?Rt(e,Vr,1):(p||f)&&Rt(e,Vr,-1)}},Ur=(e,t)=>{const n={};return null!=e&&e.isEnabled("CLIENT_IM_3364")&&(n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")}),null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Wr=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Ur(n,t)});function Kr(e){return!Pt(e,"color.point.auto")&&"byDimension"===Pt(e,"color.point.mode")&&Pt(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Yr(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"),s=e=>({color:e,index:r.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=>!Pt(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(ar.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=>!Pt(e,"color.point.auto",!0)&&"primary"===Pt(e,"color.point.mode","primary"),defaultValue(){const e=r.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=>!Pt(e,"color.point.auto")&&"byExpression"===Pt(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=tr(r,n,ar.CHART_ID,Qt,t),c=er(u,r,ar.CHART_ID),p={type:"items",translation:"properties.presentation",items:{styleEditor:i&&Wr(o,c,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}}}}};p.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:ar.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},p.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,r){const{autoMinMax:i,minMax:o,min:s}=(null==r?void 0:r.measureAxis)||{};return!0===i?"lowest":i||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(Rt(i,"measureAxis.autoMinMax",!1),Rt(i,"measureAxis.minMax","min"),Rt(i,"measureAxis.min",0)):Rt(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>Pt(t.layout,`${ar.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>Pt(t.layout,`${ar.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>Pt(t.layout,`${ar.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==Pt(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)=>Pt(t.layout,`${ar.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function h(e,t){const n=Pt(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,r,i;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l,u;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",r=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(u=l.qHyperCube)||void 0===u?void 0:u.qDimensionInfo)&&void 0!==a?a:[];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:""},g=(e,t,r)=>{var i,o;if(null!==(i=e.qHyperCubeDef)&&void 0!==i&&null!==(o=i.qDimensions)&&void 0!==o&&o.length){var s,a,l,u,c;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===(u=l.point)||void 0===u||null===(c=u.byDimDef)||void 0===c?void 0:c.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,r)}),t}return[]},y=(e,t)=>{const n="measure"===Pt(e,"color.point.useBaseColors")&&Tr.measuresHasBaseColors(t),r="dimension"===Pt(e,"color.point.useBaseColors")&&Tr.dimensionsHasBaseColors(t);return Tr.isColorBySingle(e)&&!n&&!r},v=(e,t)=>!Pt(e,"color.point.auto",void 0)&&"primary"===Pt(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=>Pt(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{Pt(e,"color.point.auto")||(Rt(e,"color.point.mode","primary"),Rt(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"===Pt(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Tr.isColorAuto(e),change(e){if("primary"===Pt(e,"color.point.mode",void 0)){const t=Pt(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&Rt(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Tr.isColorByDimension(e)&&g(e,0,n).length>1,change(e){h(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,n){const r=Pt(e,"color.point.mode","primary");return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!Tr.isColorAuto(e)&&"primary"===r&&(Tr.measuresHasBaseColors(n)||Tr.dimensionsHasBaseColors(n))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:y},useDimColVal:{ref:"color.point.useDimColVal",show(e,n,r){var i,o,s;const a=null!==(i=null===(o=e.color.point)||void 0===o||null===(s=o.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==i?i:null,l=Tr.hasDimValueColors(r.handler,a);return t.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&l&&Tr.isColorByDimension(e)&&Tr.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ar.CHART_ID,"box","fill");return s(e)},show:e=>!Pt(e,"color.point.auto",!0)}}}}},x={uses:"colorsAndLegend",items:{colors:{globalChange:Tr.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"}),Pt(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Tr.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Tr.isColorByDimension(e),change(e){h(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Tr.isColorByMeasure(e),change(e){h(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Tr.showColorByLabel,change(e){const t=Pt(e,"color.point.mode"),n=Pt(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=Pt(e,"color.point.mode","primary");return!Tr.isColorAuto(e)&&"primary"===n&&(Tr.measuresHasBaseColors(t)||Tr.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!Pt(e,"color.point.auto")&&"byMultiple"===Pt(e,"color.point.mode")&&"measure"===Pt(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Tr.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===Pt(e,"color.point.useBaseColors")&&Tr.measuresHasBaseColors(t),r="dimension"===Pt(e,"color.point.useBaseColors")&&Tr.dimensionsHasBaseColors(t);return Tr.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Tr.isColorByDimension(e)&&Tr.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=Pt(e,"color.point.auto"),n=Pt(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===Pt(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>Pt(e,"color.point.auto")||"byDimension"!==Pt(e,"color.point.mode")||"libraryItem"!==Pt(e,"color.point.byDimDef.type")?Kr(e):Kr(e)&&!Pt(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Tr.isColorAuto(e)&&Tr.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Tr.isColorAuto(e)&&Tr.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Tr.isColorByDimension(e)&&(!Tr.isDimensionLibraryItem(e)||!Pt(e,"color.point.useDimColVal"))},customRange:{show:e=>!Tr.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Tr.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Tr.isColorByMeasure(e)&&!1===Pt(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Pt(e,"color.point.minMax")&&Pt(e,"color.point.measureMin")>=Pt(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Tr.isColorByMeasure(e)&&!1===Pt(e,"color.point.autoMinMax"),invalid:e=>"minMax"===Pt(e,"color.point.minMax")&&Pt(e,"color.point.measureMin")>=Pt(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Tr.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(ar.CHART_ID,"box","fill");return s(e)},show:e=>!Pt(e,"color.point.auto",!0)}}},simpleColors:b,legend:{show:Tr.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Tr.showLegend(e)&&Pt(e,"legend.show",!0)},showTitle:{show:e=>Tr.showLegend(e)&&Pt(e,"legend.show",!0)}}}}},q={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"}}}}}}},D={uses:"settings",items:{simpleLabels:q,general:l,presentation:p,colors:x||a,measureAxis:d,dimensionAxis:f}},S={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Tr.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},C=Qn.expression(`${ar.SORT_CRITERIA}.sortByExpression`),E={type:"items",items:{toggled:C.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:ar.SORTING_EXPRESSION,elementRef:ar.SORTING_ELEMENT_ID,show:ur.isSortByExpression,elements:e=>Vn.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then((t=>{const r=Rr.getSettings(e.layout);return Fr.getElements(t.measures,t.dimensions,r,n)}))},order:C.items.order}},A={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&$r.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:ar.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:ur.hasMultipleDimensions,change(e,t,r,i){if(e&&ur.hasMultipleDimensions(e)&&t.layout)return zr.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:ar.SORTING_EXPRESSION,elementRef:ar.SORTING_ELEMENT_ID,sortCriteriasRef:ar.SORT_CRITERIA,show:e=>ur.hasMultipleDimensions(e)&&!ur.isAutoSort(e),elements:e=>Vn.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then((t=>{const r=Rr.getSettings(e.layout);return Fr.getElements(t.measures,t.dimensions,r,n)})),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>ur.hasMultipleDimensions(e)&&!ur.isAutoSort(e),items:{expression:E,numeric:Qn.numeric(`${ar.SORT_CRITERIA}.sortByNumeric`),ascii:Qn.ascii(`${ar.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!ur.isSortByExpression(e)&&!ur.isSortByNumeric(e)&&!ur.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!ur.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:A,addons:S,settings:D}}}const Gr={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Pt(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=Xr(e,o).chart;l||(l="sortByAscii");const u=Pt(e,t);if(u.sortCriteria||(u.sortCriteria={}),u.autoSort){const t=r(a);if(t.ELEMENT)u.elementId=t.ELEMENT;else{const t=i(e,a);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=Xr(e,o).dimension;return t?Pt(e,o+t):0}}}};return s}};function Xr(e,t){const n={chart:"",dimension:""};return 0!==Pt(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Pt(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Pt(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Jr={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Gr.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Rr.getSettings,Fr.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}}}}},Zr={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=>Tr.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Tr.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Tr.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Tr.showLegend}}}}};function Qr(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:Yr(e),softDefinition:Jr,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Tr.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=bn(e);r.mapProperties();return En({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>An({propertyTree:e,viewDataMode:n})}}Rn(!0,Jr,Zr);const ei={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 ti(){return ei.id()}const ni="scrollbar";function ri(e,t,n){return"y"===e?ii(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function ii(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var oi={getAxisDock:ri,getOppositeAxisDock:function(e,t,n){return ri(e,"far"===t?"near":"far",n)},getYAxisDock:ii};const si=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ai=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),li=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function ui(e){return si.test(e)}function ci(e){return ai.test(e)||li.test(e)}var pi={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],ui(r))return"ltr";if(ci(r))return"rtl"}return"ltr"}};var di={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 Rn(!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"),Rn(!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} ${pi.lrm}(${n})${pi.lrm}`:`${pi.lrm}(${n})${pi.lrm}`:!1!==e.showLabel?t:""}};const fi={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:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},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}}};fi.DEFAULT_CHART_ORIENTATION=fi.HORIZONTAL;const hi=100;function mi(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||fi.DEFAULT_CHART_ORIENTATION,s=o===fi.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",u=fi.SHOW_AXIS_LABELS_OPTIONS,c=fi.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),h=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(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Rn(i,fi.LAYOUTSETTINGS.measureAxis);const o=yi(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Rn(r,fi.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return yi(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),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=Rn(!0,i||{},{component:{ticks:{distance:r.spacing*hi}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Rn(r,fi.LAYOUTSETTINGS.dimensionAxis);const i=vi(t,n);Rn(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),h&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Rn(r,fi.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return vi(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===fi.HORIZONTAL?fi.VERTICAL:fi.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=Rn(r,fi.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Rn({},fi.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),gi(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===ni))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(ni).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(ni).emit("panStart",e)},pan(e){this.chart.component(ni).emit("panMove",e)},panend(e){this.chart.component(ni).emit("panEnd",e)},pancancel(e){this.chart.component(ni).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,r){const i=oi.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Rn(o,fi.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${ti()}`,require:["renderer","chart"],dock:oi.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=s.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 a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Rn(s,fi.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Rn(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=di.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(u);const c=di.lineLabelSettings({scale:"measure",value:a,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,s.lines[n].push(c)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",fi.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Rn(o,fi.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,vi(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Rn(o,fi.LAYOUTSETTINGS.rangeMeasure);const s={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,s)}(e,n.measureRange||{},s,yi(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Rn(o,fi.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:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,vi(n,l).dock,n.isRtl)}n.brushActions&&gi(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function gi(e,t){t.forEach((t=>{e.push(t)}))}function yi(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function vi(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function bi(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 Rn(!0,{},o,e||{})}function xi(e,t){const n=t&&t.chartID,r=t&&t.dock,i=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"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",dock:oi.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},h=Rn(!0,{},f,e||{});return h.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),h}function qi(e,t){const n=t&&t.chartID,r=t&&t.dock,i=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"),u={key:"text",type:"text",dock:oi.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Rn(!0,{},u,e||{})}bi.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=bi(Rn(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},bi.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 bi(Rn(!0,n,e||{}),t)},xi.xAxis=function(e,t){return xi(Rn(!0,{key:"x-axis",scale:"x"},e||{}),t)},xi.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:oi.getYAxisDock(n,r)};return xi(Rn(!0,i,e||{}),t)},qi.xAxisTitle=function(e,t){return qi(Rn(!0,{key:"x-axis-title"},e||{}),t)},qi.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:oi.getYAxisDock(n,r)||"left"};return qi(Rn(!0,i,e||{}),t)};var Di={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 Si={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 Ci(){return Si}function Ei(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}Ci.getLayoutModeKeys=function(){const e=[];let t;for(t in Si)e.push(t);return e};const Ai={left:"left",right:"right",up:"top",down:"bottom"};function wi(e,t,n){switch(e){case"scale":return bi(t,n);case"measure-scale":return bi.measureScale(t,n);case"dimension-scale":return bi.dimensionScale(t,n);case"axis":return xi(t,n);case"box-marker":return function(e){return Rn(!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 Rn(!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 Rn(!0,{},o,e||{})}(t,n);case"text":return qi(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})})),Rn(!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,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:Di.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Di.getBublesAlign(s,a,l)}}};return Rn(!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"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:Di.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:Di.getBublesAlign(a,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Rn(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=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"),p={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-${Ai[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:a,fontFamily:c,fill:s}}};return Rn(!0,{},p,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"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=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 p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return Rn(!0,{},d,e)}(t,n);case"x-axis":return xi.xAxis(t,n);case"y-axis":return xi.yAxis(t,n);case"x-axis-title":return qi.xAxisTitle(t,n);case"y-axis-title":return qi.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 Rn(!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 Rn(!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 Rn(!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 Rn(!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:Ei}]}}}]}};return Rn(!0,{},o,e||{})}(t,n);default:return}}function Ii(e){this.options=e||{},this.settings={dockLayout:{layoutModes:Ci()},components:[],scales:{}}}Ii.prototype.addComponent=function(e,t,n){const r=wi(e,t,Rn(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Ii.prototype.addInteraction=function(e,t){const n=wi("interaction",e,Rn(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Ii.prototype.addScale=function(e,t,n){const r=wi(e,t,Rn(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Ii.prototype.getSettings=function(){return this.settings},Ii.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},Ii.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");mi(t,n)}(e,this,t)},Ii.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))},Ii.create=function(e){return new Ii(e)},Ii.createComponent=wi;const Ti={CENTER:0,BOTTOM:1};var Mi={DISCLAIMERS:[{label:"NoDataExist",alignment:Ti.CENTER,default:!0},{label:"RequireNumericDimension",alignment:Ti.CENTER,default:!1},{label:"OnlyNanData",alignment:Ti.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:Ti.CENTER,default:!1},{label:"LimitedData",alignment:Ti.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:Ti.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:Ti.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:Ti.BOTTOM,default:!1}],ALIGNMENT:Ti};const Oi={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,s,a;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))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=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,Mi.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 Li(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function ki(e,t){return e&&t&&t[e]}function Pi(e){this.environment=e,this.clear()}Li.prototype.isValidAndSupported=function(e,t){return ki(e.label,this.dataAttributes)&&(e.default||ki(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Li.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},Li.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},Pi.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Pi._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},Pi.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=Rn(!0,{},this.vizAttributes.supportedDisclaimers),i=new Li(Mi.DISCLAIMERS,this.dataAttributes,r);let o,s;if(i.isAnyValidDisclaimer(Mi.ALIGNMENT.CENTER))o=i.getMessage(Mi.ALIGNMENT.CENTER,n),s="center";else{if(!i.isAnyValidDisclaimer(Mi.ALIGNMENT.BOTTOM))return;o=i.getMessage(Mi.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)}}},Pi.prototype.set=function(e){if(this.clear(),!e)throw new Error(Pi.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Oi.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Pi.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const _i=tn.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 Pi(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:[Ii.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Ii.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=Rn(!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:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Pt(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 Ni(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 Ri={generateHash:function(e){return Ni(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Ri.generateHash(t)}};const Hi={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:Bi(t),dimensionExpressions:Fi(t),measureExpressions:e})))}};function Fi(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Bi(e){const t=function(e){return Pt(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const ji={},zi=Rn.bind(null,!0);function Vi(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const $i=Array.isArray,Ui=function(e){return void 0===e},Wi=function(e){return"function"==typeof e};function Ki(e,t){return Wi(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Yi(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]=Ui(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Gi(e,t){if(Vi(e)&&Vi(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Gi(e[n],t[n]))return!1;return!0}if($i(e)&&$i(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Gi(e[n],t[n]))return!1;return!0}return e===t}ji.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=zi({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Gi(o,s)||Ki(t,i)||(Ui(s)?r.push({op:"add",path:a,value:o}):Vi(o)&&Vi(s)?r=r.concat(ji.generate(s,o,a)):$i(o)&&$i(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Ui(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(Gi(t,i))return r;if(null===t[0]||!Ui(t[0])&&Ui(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(ji.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Ui(t[i])&&!Ki(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},ji.apply=function(e,t){t.forEach((t=>{const n=Yi(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($i(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if($i(i)&&$i(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Vi(i)&&Vi(t.value)?(s=i,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Ki(s,e)&&delete s[e]})),zi(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Yi(e,t.from);$i(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&($i(n)?n.splice(+r,1):delete n[r]);var s}))},ji.clone=function(e){return zi({},e)},ji.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},ji.updateObject=function(e,t){Object.keys(e).length?ji.apply(e,ji.generate(e,t)):zi(e,t)};class Xi{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=ji.generate(e,t);return Rn(!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=ji.generate(n,r);ji.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Ji={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 Zi={saveDerivedProperties:function(e,t,n,r){if(Ji.canModifyHardProperties(t))return e.setProperties(n);return new Xi(e).saveSoftProperties(r,n)}};var Qi={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function eo(){this._generationInProgress=!1}function to(e){Qi.validate(e);const t=e.properties,n=Ri.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}eo.prototype.isDerivedUpToDate=to,eo.prototype.updateDerivedProperties=function(e){if(Qi.validate(e),this._generationInProgress)return Promise.resolve(!0);if(to(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=Rn(!0,{},e.properties),o=Rn(!0,{},i);return this._generationInProgress=!0,Ri.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>Zi.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},eo.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Hi.getDefaultHashDataForHyperCube(e,t,n).then((e=>Rn(!0,r,e)))};var no={exports:{}};!function(e,t){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 t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return(t=i(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 r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var o=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===s.call(e)},c=function(e){if(!e||"[object Object]"!==s.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,f=arguments.length,h=!1;for("boolean"==typeof a&&(h=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(a,n),a!==(i=d(t,n))&&(h&&i&&(c(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&c(r)?r:{},p(a,{name:n,newValue:e(h,s,i)})):void 0!==i&&p(a,{name:n,newValue:i}));return a};function h(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(e,t,n){let{key:r}=n;const 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 g(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:s,rowIdx:a,row:l,sourceKey:u,target:c,targetProp:p,columnOrder:d}=e,g=r;if(i.field&&i.field!==n){const e=h(i.field,s,{cache:t},d);if(-1===e)return;g=f({qRow:a},e(l))}c[p]=m(i,g,{key:u})}function y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),p=Object.keys(u),d=!!i[e].trackBy,y=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=h(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let h=0;h<s.qDataPages[t].qMatrix.length;h++){const q=s.qDataPages[t].qArea.qTop+h,D=f({qRow:q},o(s.qDataPages[t].qMatrix[h])),S=m(c,D,{key:a});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],props:u,page:s.qDataPages[t],rowIdx:q,row:s.qDataPages[t].qMatrix[h],sourceKey:a,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e],columnOrder:s.qColumnOrder});if(r.fields){const t=S[p[e]].map((e=>e.value)),n=S[p[e]].map((e=>e.label));S[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:b,tracker:v,trackType:y}),x.push(S)}}}const q=d?r.collect(b,{main:c,propsArr:p,props:u}):x;o=[...o,...q]}return o}function v(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function b(){return this.eachAfter(v)}function x(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function q(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function D(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function E(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 A(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function w(e){for(var t=this,n=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}function I(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 T(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function M(){return Array.from(this)}function O(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function L(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*k(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function P(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=R)):void 0===t&&(t=N);for(var n,r,i,o,s,a=new B(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new B(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(F)}function _(){return P(this).eachBefore(H)}function N(e){return e.children}function R(e){return Array.isArray(e)?e[1]:null}function H(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(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}function j(e){return null==e?null:z(e)}function z(e){if("function"!=typeof e)throw new Error;return e}B.prototype=P.prototype={constructor:B,count:b,each:x,eachAfter:D,eachBefore:q,find:S,sum:E,sort:A,path:w,ancestors:T,descendants:M,leaves:O,links:L,copy:_,[Symbol.iterator]:k};var V={depth:-1},$={},U={};function W(e){return e.id}function K(e){return e.parentId}function Y(){var e,t=W,n=K;function r(r){var i,o,s,a,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>G(e(t,n,r)))),n=t.map(X),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(X(e)),d.push(U));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],u=d[s]=new B(o),null!=(c=f(o,s,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?$:u)),null!=(c=h(o,s,r))&&(c+="")&&(u.parent=c);for(s=0;s<i;++s)if(c=(u=d[s]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===$)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(a)throw new Error("multiple roots");a=u}if(!a)throw new Error("no root");if(null!=e){for(;a.data===U&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===U;--e)u.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(F),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=j(e),r):t},r.parentId=function(e){return arguments.length?(n=j(e),r):n},r.path=function(t){return arguments.length?(e=j(t),r):e},r}function G(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 X(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 r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}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 r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/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 r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(p)&&(i=!0,o=+ne.exec(p)[1],p=r.replace(ne,"")),re.test(p)&&("K"===n.qMode?u=+re.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+re.exec(p)[1],c=0):c=+re.exec(p)[1],p=p.replace(re,"")),p&&(oe.exec(p)?a=+oe.exec(p)[1]:ie.exec(p)&&(s=+ie.exec(p)[1])),l=i?"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:u,measureIdx:c,attrDimIdx:a,attrIdx:s}}function ue(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=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 ce(e,t,n){let{key:r}=n;const 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 pe(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let u,c;a.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),a.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:s})}}u&&(o[t[e]]={value:"function"==typeof a.value?a.value(u,r):u,label:"function"==typeof a.label?a.label(c,r):c})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=P(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const n=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=se(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<n.length;e++){const r=n[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const n=r[o[e]],s="".concat(i,"__").concat(null!==(l=n.qElemNumber)&&void 0!==l?l:n.qElemNo);a[s]||(a[s]=t({__id:s,__parent:i,qValues:[]},n),u=!0),i=s}if(u)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const u=Object.keys(a).map((e=>a[e])),c=Y().id((e=>e.__id)).parentId((e=>e.__parent))(u);return c}const he=e=>{let{propsArr:t,props:n,cube:r,cache:i,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=ue(o,le(t.field,{cube:r,cache:i}));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]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=n.raw(),s=n.key(),a="S"===o.qMode?fe(n):de(o,r,e);if(!a)return null;const l=a.height,u=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(t(t({},e),{},{field:a?a.key():void 0}),n),p=Object.keys(l);u[s]={propsArr:p,props:l,main:c};const d=a?le(a,{cube:o,cache:r}):{fieldDepth:0};he({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const c=a.copy().descendants(),p=a.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,a=ce(r,o,{key:s});pe({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s,isTree:!0}),p[e].data=a}return a}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const u="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:c,main:p}=r.normalizeConfig(i[s],t),d=Object.keys(c),f=le(u,{cube:a,cache:n}),{nodeFn:h,attrFn:m,valueFn:g}=ue({fieldDepth:0},f);he({propsArr:d,props:c,cube:a,cache:n,itemDepthObject:f,f:u});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],q=h(n.tree),D=[];for(let e=0;e<q.length;e++){const t=q[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ce(p,n,{key:l});pe({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),D.push(o)}const S=y?r.collect(x,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==C||"undefined"!=typeof self&&self;var ve=ye((function(e){
41
25
  /*! 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,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",y=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)m+=p.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+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"},qe=/%\)?$/,De=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Se=/^\(oct\)/i,Ce=/^\(dec\)/i,Ee=/^\(hex\)/i,we=/^\(bin\)/i,Ae=/^\(rom\)/i,Me=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ie=/#|0/g;function Te(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 ke(e,t){let 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();for(;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 Oe(e,t,n){let r;return De.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Se.test(t)?e=Te(e,8,t,n):Ce.test(t)?e=Te(e,10,t,n):Ee.test(t)?e=Te(e,16,t,n):we.test(t)?e=Te(e,2,t,n):Ae.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=ke(e,t)):t+r+e.toExponential(0)),e}function Le(e,t,n){const r=be(e);return n?r:new RegExp(r||"",t)}function Ne(e,t){return t&&(t=be(t)),e&&(e=be(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(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 _e(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=Ne(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Le(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Le(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(Ie)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Le(t,null,!0),"|").concat(Le(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class Re{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Re(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Me.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Me.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Me.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_e(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_e(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_e(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Oe(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.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{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=ve(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function He(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Re(...t)}function Fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function je(e,t,n,r,i){const o=He(i,e,t,n,r),a=Fe(o.formatValue.bind(o),{toKey:e=>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}const Be={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},ze=["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"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=86400;function Ye(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ke(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(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 Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Xe(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Je(e,t){let n,r=Xe(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(We*(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,u<0&&(u=6));let 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 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),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<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 r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ze,qDayNames:Ve,qLongMonthNames:$e,qMonthNames:Ue}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.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 r;e instanceof Date?r=Ke(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Je(e,t));const i=Ze(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}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 rt(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),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?nt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=et(i,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function it(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let 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"),je(n,r,i,o,t)}function ot(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c=e=>(null==e?void 0:e.qText)||"",p="dimension"===s?"first":"avg",d=it(t,i),f="dimension"===s?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:c,reduce:p,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return h}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ot(f({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=at("qAttrDimInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=at("qAttrExprInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=at("qMeasureInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function st(){let{key:e,data:n,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=n;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=st.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=ge,s.hierarchy=me,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=y,s.pages=o.qDataPages,s.hierarchy=me):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",f({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",f({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const p=e=>{e.forEach((e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)}))};return p(i.wrappedFields),(r.virtualFields||[]).forEach((n=>{const r=l.field(n.from),o=ot(t({meta:r.raw(),id:"".concat(e,"/").concat(n.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:n.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},n.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const lt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ct=/\/qMeasureInfo\/(\d+)/,pt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dt=/\/qAttrExprInfo\/(\d+)/,ft=/\/?qHyperCube/,ht=/\/?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,r=-1,i=-1,o="",a=e=>e;ft.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=mt):ht.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=gt);let s=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ct.test(e)&&(i=+ct.exec(e)[1]),pt.test(e)){i=-1,r=0;const e=+pt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(dt.test(e)){const e=i;if(t){i=0;const a=Z(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+dt.exec(n)[1]}else r>-1?(r=-1,i=+dt.exec(n)[1]):i+=+dt.exec(n)[1]+1}return lt.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,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 r=t.byCells,i=t.primarySource,o=[],a={},s=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,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.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&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function bt(e){st.util=e.data("matrix").util,e.data("q",st),e.formatter("q-number",je),e.formatter("q-time",rt)}return bt.qBrushHelper=vt,bt.selections=vt,bt}()}(Qo);var ea=Zo;const ta={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 na={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function ra(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),ea.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=ta.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 p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function h(){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&&h(),t},c.setUpBrush=function(e){const n=Fr(!0,{},na,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&&h()},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,h(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class ia{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var oa={create:e=>e.selectionsApi?ra(e):new ia};var aa={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 sa={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:_.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=aa.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){aa.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 la={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?_.DIRECTION_HORIZONTAL:_.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=aa.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];aa.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 ua(e,t){let n;return n="x-axis"===e?"horizontal"===t?_.DIRECTION_VERTICAL:_.DIRECTION_HORIZONTAL:"horizontal"===t?_.DIRECTION_HORIZONTAL:_.DIRECTION_VERTICAL,n}var ca={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:ua(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=aa.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];aa.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 pa={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?_.DIRECTION_VERTICAL:_.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=aa.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];aa.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 da={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?_.DIRECTION_VERTICAL:_.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 fa={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&aa.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 ha={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,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},h="horizontal"===t,m=h?"y-axis":"x-axis",g=h?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},q={handlers:e,keys:r,isHorizontal:h,active:f,rangeSelStatus:i};function D(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(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(fa.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(sa.callLassoGesture(d,x,q)),s?l?(b.push(pa.callDimensionRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(la.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(pa.callDimensionRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),b.push(ca.callAreaRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(b.push(la.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(ca.callAreaRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(da.callDragGesture(d,x,q,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};function ma(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 ga={create:(...e)=>ma(...e)},ya={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 va=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=ba(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 ba(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 xa="dist-flow-tooltip",qa=`#${xa}`;function Da(){if(!document.querySelector(qa)){const e=document.createElement("div");e.id=xa,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 Sa({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Da()},beforeUpdate(){Da()},destroyed(){!function(){const e=document.querySelector(qa);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(qa),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:Ca}=lo;const Ea={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:ya.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:Ca(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:Ca(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:Ca(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:Ca(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function wa(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=Fr(!0,{},Ea,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:ga.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=Sa({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:va(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 Aa={create:(e,t,n)=>wa(e,t,n)};const Ma=".scrollHandler";function Ia(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 Ta(){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 ka(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 Oa(){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=>{}))}Ia.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Ia.prototype.setDisabled=function(e){this._disabled=e},Ia.prototype.getDisabled=function(){return this._disabled},Ia.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Ta.call(this))},Ia.prototype.getItemSize=function(){return this._itemSize},Ia.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Ta.call(this);return this._scrollViewSizeInItem},Ia.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Oa.bind(this)));this._$chartElement.on(`mousewheel${Ma} DOMMouseScroll${Ma}`,ka.bind(this)),this._$chartElement.on(`touchstart${Ma}`,(e=>{e.preventDefault()})),this._on=!0},Ia.prototype.isOn=function(){return this._on},Ia.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(Ma),this._on=!1},Ia.prototype.updateViewState=function(e){Ta.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Ia.prototype.onResize=function(){this._sizeChanged=!0,Ta.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Ia.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Ia.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Ia.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)},Ia.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Ia.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Ia.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};function La(e){return(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11}function Na(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 Pa(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=Na(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=Na(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 _a(e,t,n){return e*(e<=24?t:n)}var Ra={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:La,getCharacterRatios:Na,getTotalCharacterRatios:Pa,getAdjustedMaxGlyphCount:function(e,t,n){const r=Pa(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(La(i)+1.0909090909090908*o)},estimateLatinLabelWidth:_a,estimateLabelWidth:function(e,t,n,r,i){return e*n+_a(t,r,i)}};const Ha={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}},Fa=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,ja=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Ba=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,za=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Va=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,$a=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Ua=Math.floor,Wa=Math.round,Ya=ir.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,p,d=0,f=0,h=0,m=1;if(this._invalid=!1,arguments[0]instanceof Ya)d=arguments[0]._r,f=arguments[0]._g,h=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=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(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=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(p))d=parseInt(c[1],16),f=parseInt(c[2],16),h=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),h=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(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=Wa(255*d),f=Wa(255*f),h=Wa(255*h),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),m=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=Wa(255*d),f=Wa(255*f),h=Wa(255*h)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=Wa(255*d),f=Wa(255*f),h=Wa(255*h),m=1}else Ha[p.toLowerCase()]?(n=p.toLowerCase(),d=Ha[n].r,f=Ha[n].g,h=Ha[n].b,m="number"==typeof Ha[n].a?Ha[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,h=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],h=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+h+m)&&(this._invalid=!0),this._r=Ua(d),this._g=Ua(f),this._b=Ua(h),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=Ya.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Ya.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Ya.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Ya.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Ya.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Ya.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=Ya.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Ya.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 Ya||(e=new Ya(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Ua(this._r+(e._r-this._r)*t),Ua(this._g+(e._g-this._g)*t),Ua(this._b+(e._b-this._b)*t),Ua(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 Ya(r)}});Ya.toRGB=function(e){if(e instanceof Ya)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Ya.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Ya.toRGBA=function(e,t){if(e instanceof Ya)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Ya.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Ya.toHex=function(e){let t,n,r;return e instanceof Ya?(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=Ya.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}`)},Ya.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Ya(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})`},Ya.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Ya(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),p=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),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})`},Ya.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Ya(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}},Ya.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Ya)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},Ya.blend=function(e,t,n){const r=(16711680&(e=Ya.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Ya.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Ya.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 Ya(r,i,o,a)},Ya.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Fa.test(e)||ja.test(e)||Ba.test(e)||za.test(e)||Va.test(e)||$a.test(e)||Ha[e.toLowerCase()])},Ya.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Ya.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)},Ya.isDark=function(){const e={getLuminance:Ya.prototype.getLuminance,isInvalid:Ya.prototype.isInvalid};return Ya.prototype.init.apply(e,[].slice.call(arguments)),Ya.prototype.isDark.call(e)},Ya.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Ka={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 Ya(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Ya(e);return 0===t.getAlpha()?this.DARK_GREY:Ya.getBestContrast(t,new Ya(Ka.LIGHT_GREY),new Ya(Ka.DARK_GREY))},getBestContrast:(e,t,n)=>Ya.getBestContrast(new Ya(e),new Ya(t),new Ya(n)),getContrastingTransparent(e){const t=new Ya(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function Ga(e,t){return hn(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function Xa(e,t){if(hn(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return hn(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+hn(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+hn(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=hn(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return Ja(hn(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function Ja(e){return e.qCardinalities.qHypercubeCardinal}var Za={getHyperCube:function(e,t){return e&&(e=t?hn(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:Ga,hasSecondMeasure:function(e,t){return hn(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:Xa,getStackedCubeSizeOfMax2Dims:function(e,t){return Ga(e,t)?Xa(e,t):function(e,t){return hn(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return Ga(e,t)?Xa(e,t):1},getDimensionSize:Ja};const Qa=function(){this._maxJitter=1};Qa.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},Qa.prototype.getJitterValue=function(e){const t=Math.abs(Lo(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var es={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 ts={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Fr(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),hi.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=[ui.create(ui.IDMAP.COLOR_BY_EXPRESSION,{qExpression:hn(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,si.hasMultipleDimensions(t)?Ur.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((i=>{ji.applySorting(t,e,n,i,r);const o=i.dimensions[0],a=i.dimensions[1],s=i.measures[0],l=Ri.getFractileExpression(1,o,a,s),u=Ri.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 ns=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function rs(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(ns),i=n.some(ns),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function is({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:a,translator:s}=i,l=Fr(!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=Fr({},e)).snapshotData=Fr({},e.snapshotData),e.snapshotData.content=Fr({},e.snapshotData.content),e.snapshotData.content.chartData=Fr({},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,p=e.createConfig,d=void 0===p?fn:p,f=e.config,h=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=h.localeInfo,v=h.key,b=h.theme,x=void 0===b?void 0:b,q=h.auto,D=void 0===q?void 0:q,S=h.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),E={theme:x,key:v,localeInfo:y,layout:C,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:B(B({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?un(C):void 0})},w=sn({picasso:o,model:a,app:s,translator:l,auto:D});!1!==D&&w.auto((function(e){return D?D({layout:e,defaultAuto:dn}):dn(e)}));var A=!1,M={getColor:function(){return w.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return w.resolveUIColor({index:t,color:n})},getData:function(){return w.data()},getDatumProps:function(e){return w.datumProps(e)},getSnapshotData:function(){return w.getSnapshotData(S)},getSettingsForMeasure:function(e){return w.settingsForMeasure(e)},getSettings:function(){return w.settings()},getLegend:function(e,t){return w.legend(e,t)},getScales:function(){return w.scales()},getPalettes:function(){return w.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return w.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:B({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:un}),n=cn(E,t);return w.config(n),w.getAuxiliarySettings(S).then((function(){A=!0}))}};return M}({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:rs(e)}})})}const os=oi.DATA_PATH,as=oi.HYPERCUBE_PATH,ss=oi.HYPERCUBE_DEF_PATH;function ls(e){return Array.isArray(e)?e:e?[e]:[]}function us(e){return Math.min(Za.getOuterDimensionSizeOfMax2Dims(e,os),oi.MAX_STACKED_VALUES)}function cs(e,t){return{viewSize:t,max:us(e)}}function ps(){const e=oi.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function ds(){if(this.layout&&Za.hasSecondDimension(this.layout,os)){this._scrollHandler.onResize();!!this.layout.snapshotData||ps.call(this)}}function fs(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function hs(e,t){return hn(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const ms=Oo.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 Xo,this._selectionHandler=oa.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Aa.create(this.chartInstance,i,oi.CHART_ID),this._scrollHandler=new Ia(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=oi.BUBBLE_SCALES_MAX,this._jitterTool=new Qa,this.setDataPaths([`${os}/${as}`])},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[os][as],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!Za.hasSecondDimension(this.layout,os)||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(e=this.layout).dataPoint&&e.dataPoint.bubbleScales?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1;var e},_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(oi.MAX_POINT_BASE_SIZE_PX,t*oi.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(oi.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=ls(t.trigger),r=ls(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Ra.getAdjustedMaxGlyphCount(function(e){const t=e[os][as].qDimensionInfo,n=Za.hasSecondDimension(e,os)?t[0].qApprMaxGlyphCount:0;return Math.min(oi.MAX_GLYPH_COUNT,n)}(this.layout||e),e[os][as].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(oi.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=ls(t.trigger),o=ls(t.consume),a=this;let s="qMeasureInfo/0",l="qMeasureInfo/0";Za.hasSecondDimension(e,os)&&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(oi.CHART_ID,"box","stroke"),strokeWidth:0,width:oi.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:oi.MAX_POINT_BASE_SIZE_PX,minWidthPx:oi.MIN_POINT_PIXELS+2*oi.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*oi.JITTER_PARAMETER);const r=a._pointMaxSizePx+n+2*oi.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 Za.hasSecondDimension(e,os)&&(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=ls(t.trigger),o=ls(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 Ka.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:oi.MAX_POINT_BASE_SIZE_PX,minPx:oi.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*oi.BOX_PADDING/e;a._jitterTool.calcMaxJitter(a._pointSize*a._bandwidthRatio,oi.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 Za.hasSecondDimension(e,os)&&(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([`${os}/${as}`]),l},_getPointSelectionLayerSettings(e){const t=Fr(!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[os][as],l=s.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",p=Eo.create({chartID:oi.CHART_ID,theme:n,isRtl:t});if(0===s.qStackedDataPages[0].qData.length)return p.getSettings();let d={},f={},h={},m={};if(this._selectionHandler.isOn()){const t=!o&&Za.hasSecondDimension(e,os);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:hs(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:hs(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:os,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),a=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),d={trigger:Fr(!0,{},r.trigger,{data:[""]}),consume:[Fr(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,a.consume]},h={trigger:n.trigger,consume:[n.consume,r.consume,a.consume,i.consume]},m={trigger:[Fr(!0,{},i.trigger,{data:[""]})],consume:[Fr(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:p,colorService:this.colorService,data:Za.hasSecondDimension(e,os)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${as}/qDimensionInfo/${Za.hasSecondDimension(e,os)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:Za.hasSecondDimension(e,os)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,hs(e,0),hs(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=ha.create(b,e.orientation,t,x,v),p.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:Za.hasSecondDimension(e,os),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:s.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:cs(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,axisTitleStyle:ri(oi.CHART_ID,n,e,this.flags),axisLabelStyle:ii(oi.CHART_ID,n,e,this.flags)}),a){const t=this._getBoxMarkerSettings(e,f);p.addComponent("box-marker",t)}if(o){const n=this._getPointMarkerSettings(e,h,g);if(n.data.extract.props[u]={field:"qMeasureInfo/0"},n.settings[u]={scale:"measure"},Za.hasSecondDimension(e,os)&&(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,oi.JITTER_PARAMETER)}}p.addComponent("point-marker",n),p.addComponent("point-marker",this._getPointSelectionLayerSettings(n));(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode)&&this.addLegend(p,t,m)}const q=p.getSettings();return this.addSnapshotChartSettings(q,e),q.scales={...q.scales,...this.colorService.getScales()},q.palettes=this.colorService.getPalettes(),q},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=>Fr(!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&&(ds.call(this),this._super())},hasValidData(){const e=this.layout;return e[os]&&e[os][as]&&e[os][as].qStackedDataPages.length&&e[os][as].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&&(ds.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&&Za.hasSecondDimension(t,os)&&this._scrollHandler.isDataSizeChanged(hn(t,`${os}.${as}.qStackedDataPages.0.qData.0.qSubNodes.length`),Za.getOuterDimensionSizeOfMax2Dims(t,os))?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[os][as].qStackedDataPages=this.layout[os][as].qStackedDataPages,es.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!Za.hasSecondDimension(e,os)&&e.qHyperCube.qSize.qcy>1e4||Za.hasSecondDimension(e,os)&&e.qHyperCube.qSize.qcy>3e3,r=t&&n,i=cs(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=is({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",`${os}/${as}/${t}`)},_createColorLegendCube(e){const t=Za.hasSecondDimension(this.layout,os)?1:0;return{qDimensionInfo:[this.layout[os][as].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[ss],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((a=>{const s={layout:t,properties:e,model:o,hashData:a,generateDerivedProperties:(e,t)=>ts.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 es.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(us(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),fs.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(ps.call(t),t._cacheSizeInitialized=!0),i=Za.hasSecondDimension(e,os)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[os][as],{height:e[os][as].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&&hs(e,0))}}),gs={enabled:!0,delay:50};function ys(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class vs{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=Fr(!0,{},gs,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:ys(),wrapper:ys(),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?bs.apply(this,[r,0]):bs.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 bs(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{xs.call(n)}),t):xs.call(n)}function xs(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&qs.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function qs(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&&xs.call(t)})),this.onSend(e.data,n)}const Ds=new or(0,0,0,0),Ss=new or(0,0,0,0);class Cs{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;Ds.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Ss.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=Ss.intersection(Ds,!0);if(t.push({coverage:i?i.clone():new or(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){Ds.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Ss.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Ds.intersection(Ss,!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 Es={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},ws=ir.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 Cs:"P"===this.options.mode?this.cube=new mr:this.cube=new lr,this.throttle=new vs({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=Fr(!0,{},Es,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,p;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,a=i*t-i,s=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+a,this.cubeHeight-l)),p=Math.max(0,Math.min(e[r].qLeft+s,this.cubeWidth-u)),d.push({qTop:c,qHeight:l,qLeft:p,qWidth:u});return d}}),As=oi.DATA_PATH,Ms=oi.HYPERCUBE_DEF_PATH;class Is{constructor(e){this.model=e,this.path=`/${As}/${Ms}`,this.cacheCube=new ws(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:oi.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:Za.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)))}}}}}));
26
+ !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=a)&&(t=(+t).toFixed(a+1)),c=e[0].split(o),e[0]=c.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-s;)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=(p=t[0]).length%l,d=p.length,b=0;b<d;b++)m+=p.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}}))}));const be=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const qe={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"},De=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Ce=/^\(oct\)/i,Ee=/^\(dec\)/i,Ae=/^\(hex\)/i,we=/^\(bin\)/i,Ie=/^\(rom\)/i,Te=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Me=/#|0/g;function Oe(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 Le(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/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(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function ke(e,t,n){let r;return Se.test(t)?e=Oe(e,Number(/\d{2}/.exec(t)[0]),t,n):Ce.test(t)?e=Oe(e,8,t,n):Ee.test(t)?e=Oe(e,10,t,n):Ae.test(t)?e=Oe(e,16,t,n):we.test(t)?e=Oe(e,2,t,n):Ie.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Le(e,t)):t+r+e.toExponential(0)),e}function Pe(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function _e(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Ne(e,t){if(!e||!e.qNumericalAbbreviation)return qe;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Re(e,t,n,r){let i,o,s,a,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=_e(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&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(s=s.replace(Pe(u,"g"),t)),c=n,n=".",c&&(s=s.replace(Pe(c,"g"),n)),p=s.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(Me)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=De.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Pe(t,null,!0),"|").concat(Pe(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class He{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Ne(e,this.patternSeparator),this.prepare()}clone(){const e=new He(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Te.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Te.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Te.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Re(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Re(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Re(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,s=c.t,c.isFunctional)e=ke(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,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&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.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{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(c.numericRegex,(e=>e===s?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.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 He(...t)}function Be(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(u>=n&&(delete a[l[c]],delete l[c],u--,c++),a[e]=t,l[u]=e,u++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function je(e,t,n,r,i){const o=Fe(i,e,t,n,r),s=Be(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const ze={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ue=["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"],Ke=86400;function Ye(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ge(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(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 Xe(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Xe(t),r=60*Xe(n),i=60*Xe(r),o=1e3*Xe(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=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(Ke*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:s,s:a,f:l,t:c}}function Qe(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),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<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 et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:Ue,qMonthNames:We}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[ze.TIME]:r.qTimeFmt||"hh:mm:ss",[ze.DATE]:r.qDateFmt||"YYYY-MM-DD",[ze.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(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 r;e instanceof Date?r=Ge(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Be(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ze.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=Be(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(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="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),je(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c=e=>(null==e?void 0:e.qText)||"",p="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),h={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(h)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:c,reduce:p,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return h}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(f({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:n,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=n;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=lt.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"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=y,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",f({},a,{value:u,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",f({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const p=e=>{e.forEach((e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)}))};return p(i.wrappedFields),(r.virtualFields||[]).forEach((n=>{const r=l.field(n.from),o=st(t({meta:r.raw(),id:"".concat(e,"/").concat(n.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:n.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},n.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ut=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ct=/\/qDimensionInfo(?:\/(\d+))?/,pt=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,ht=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;ht.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ct.test(e)&&(r=+ct.exec(e)[1]),pt.test(e)&&(i=+pt.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ut.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=vt(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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){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!==i&&(i||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===(u=t.orMode)||void 0===u||u]}),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 u}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",je),e.formatter("q-time",it)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(no);var ro=E(no.exports);const io={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 s=0;const a=[];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")+10,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),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const oo={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function so(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 s=[];const a={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),ro.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const s=io.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),c={};let p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function h(){s.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(){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)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&h(),t},c.setUpBrush=function(e){const n=Rn(!0,{},oo,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},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 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,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:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&h()},c.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=[]},c.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(l)return;l=!0,h(),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)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.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 ao{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var lo={create:e=>e.selectionsApi?so(e):new ao};var uo={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 co={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:P.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=uo.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){uo.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 po={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?P.DIRECTION_HORIZONTAL:P.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=uo.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,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];uo.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 fo(e,t){let n;return n="x-axis"===e?"horizontal"===t?P.DIRECTION_VERTICAL:P.DIRECTION_HORIZONTAL:"horizontal"===t?P.DIRECTION_HORIZONTAL:P.DIRECTION_VERTICAL,n}var ho={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:fo(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=uo.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,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];uo.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 mo={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?P.DIRECTION_VERTICAL:P.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=uo.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,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];uo.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 go={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?P.DIRECTION_VERTICAL:P.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 yo={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&uo.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 vo={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},h="horizontal"===t,m=h?"y-axis":"x-axis",g=h?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},q={handlers:e,keys:r,isHorizontal:h,active:f,rangeSelStatus:i};function D(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(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(yo.callNavBtnGesture(x.isNavigationEnabled,c)),b.push(co.callLassoGesture(d,x,q)),a?l?(b.push(mo.callDimensionRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(po.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(mo.callDimensionRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(ho.callAreaRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(b.push(po.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(ho.callAreaRangeGesture(d,x,q,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(go.callDragGesture(d,x,q,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};function bo(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),u=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):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 xo={create:(...e)=>bo(...e)},qo={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 Do=-3;const So=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],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.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=Co(e,o);l&&s.rows.unshift(l),r.push(s)}}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 Co(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.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++)e[n]===Do&&(t=n);return t}(a),{translator:u}=e,c=s.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 Eo="dist-flow-tooltip",Ao=`#${Eo}`;function wo(){if(!document.querySelector(Ao)){const e=document.createElement("div");e.id=Eo,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 Io({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){wo()},beforeUpdate(){wo()},destroyed(){!function(){const e=document.querySelector(Ao);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Ao),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:To}=pi;const Mo={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:qo.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:To(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 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:a,direction:To(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:To(e.value)};s.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:a,direction:To(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Oo(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!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(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=Rn(!0,{},Mo,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:xo.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]]=a,i&&s(a);const u=Io({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=a.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:So(a,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:a.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&&a(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",c),u())},o}var Lo={create:(e,t,n)=>Oo(e,t,n)};const ko=".scrollHandler";function Po(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 _o(){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 No(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 Ro(){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=>{}))}Po.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Po.prototype.setDisabled=function(e){this._disabled=e},Po.prototype.getDisabled=function(){return this._disabled},Po.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,_o.call(this))},Po.prototype.getItemSize=function(){return this._itemSize},Po.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||_o.call(this);return this._scrollViewSizeInItem},Po.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",Ro.bind(this)));this._$chartElement.on(`mousewheel${ko} DOMMouseScroll${ko}`,No.bind(this)),this._$chartElement.on(`touchstart${ko}`,(e=>{e.preventDefault()})),this._on=!0},Po.prototype.isOn=function(){return this._on},Po.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(ko),this._on=!1},Po.prototype.updateViewState=function(e){_o.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Po.prototype.onResize=function(){this._sizeChanged=!0,_o.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Po.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Po.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Po.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)},Po.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Po.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Po.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const Ho=166/26,Fo=12,Bo=11,jo=12/Bo;function zo(e){return(Math.min(e,3)*Fo+Math.max(e-3,0)*Ho)/Bo}function Vo(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 $o(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach((e=>{const t=Vo(e.qText);n.latin+=t.latin,n.cjk+=t.cjk})):e.forEach((e=>{const r=Vo(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 Uo(e,t,n){return e*(e<=24?t:n)}var Wo={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:zo,getCharacterRatios:Vo,getTotalCharacterRatios:$o,getAdjustedMaxGlyphCount:function(e,t,n){const r=$o(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(zo(i)+o*jo)},estimateLatinLabelWidth:Uo,estimateLabelWidth:function(e,t,n,r,i){return e*n+Uo(t,r,i)}};const Ko={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}},Yo=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Go=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Xo=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Jo=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Zo=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Qo=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,es=Math.floor,ts=Math.round,ns=tn.extend({init(){let e,t,n,r,i,o,s,a,l,u,c,p,d=0,f=0,h=0,m=1;if(this._invalid=!1,arguments[0]instanceof ns)d=arguments[0]._r,f=arguments[0]._g,h=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=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(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=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(p))d=parseInt(c[1],16),f=parseInt(c[2],16),h=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),h=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(p)){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,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]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=ts(255*d),f=ts(255*f),h=ts(255*h),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){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,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]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=ts(255*d),f=ts(255*f),h=ts(255*h)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){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,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]}u=i-o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=ts(255*d),f=ts(255*f),h=ts(255*h),m=1}else Ko[p.toLowerCase()]?(n=p.toLowerCase(),d=Ko[n].r,f=Ko[n].g,h=Ko[n].b,m="number"==typeof Ko[n].a?Ko[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,h=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],h=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+h+m)&&(this._invalid=!0),this._r=es(d),this._g=es(f),this._b=es(h),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=ns.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=ns.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=ns.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=ns.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=ns.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=ns.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=ns.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=ns.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 s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof ns||(e=new ns(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[es(this._r+(e._r-this._r)*t),es(this._g+(e._g-this._g)*t),es(this._b+(e._b-this._b)*t),es(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 ns(r)}});ns.toRGB=function(e){if(e instanceof ns)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=ns.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},ns.toRGBA=function(e,t){if(e instanceof ns)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=ns.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},ns.toHex=function(e){let t,n,r;return e instanceof ns?(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=ns.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}`)},ns.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ns(e));const s=e._r/255,a=e._g/255,l=e._b/255,u=Math.max(s,a,l),c=Math.min(s,a,l);if(r=t?.21*s+.72*a+.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 s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},ns.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new ns(e));const s=e._r/255,a=e._g/255,l=e._b/255,u=e._a,c=Math.max(s,a,l),p=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},ns.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new ns(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),u=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/u,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},ns.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof ns)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},ns.blend=function(e,t,n){const r=(16711680&(e=ns.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=ns.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},ns.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,s=e._a+(t._a-e._a)*n;return new ns(r,i,o,s)},ns.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Yo.test(e)||Go.test(e)||Xo.test(e)||Jo.test(e)||Zo.test(e)||Qo.test(e)||Ko[e.toLowerCase()])},ns.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},ns.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)},ns.isDark=function(){const e={getLuminance:ns.prototype.getLuminance,isInvalid:ns.prototype.isInvalid};return ns.prototype.init.apply(e,[].slice.call(arguments)),ns.prototype.isDark.call(e)},ns.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const rs={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 ns(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new ns(e);return 0===t.getAlpha()?this.DARK_GREY:ns.getBestContrast(t,new ns(rs.LIGHT_GREY),new ns(rs.DARK_GREY))},getBestContrast:(e,t,n)=>ns.getBestContrast(new ns(e),new ns(t),new ns(n)),getContrastingTransparent(e){const t=new ns(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function is(e,t){return Pt(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function os(e,t){if(Pt(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Pt(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Pt(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Pt(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Pt(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return ss(Pt(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function ss(e){return e.qCardinalities.qHypercubeCardinal}var as={getHyperCube:function(e,t){return e&&(e=t?Pt(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:is,hasSecondMeasure:function(e,t){return Pt(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:os,getStackedCubeSizeOfMax2Dims:function(e,t){return is(e,t)?os(e,t):function(e,t){return Pt(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return is(e,t)?os(e,t):1},getDimensionSize:ss};const ls=function(){this._maxJitter=1};ls.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},ls.prototype.getJitterValue=function(e){const t=Math.abs(Ni(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var us={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 cs={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Rn(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),gr.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){i=[pr.create(pr.IDMAP.COLOR_BY_EXPRESSION,{qExpression:Pt(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,ur.hasMultipleDimensions(t)?Vn.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then((i=>{zr.applySorting(t,e,n,i,r);const o=i.dimensions[0],s=i.dimensions[1],a=i.measures[0],l=Fr.getFractileExpression(1,o,s,a),u=Fr.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:u,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]})):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const ps=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function ds(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(ps),i=n.some(ps),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function fs({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:s,translator:a}=i,l=Rn(!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=Rn({},e)).snapshotData=Rn({},e.snapshotData),e.snapshotData.content=Rn({},e.snapshotData.content),e.snapshotData.content.chartData=Rn({},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,s=e.model,a=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,p=e.createConfig,d=void 0===p?kt:p,f=e.config,h=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=h.localeInfo,v=h.key,b=h.theme,x=void 0===b?void 0:b,q=h.auto,D=void 0===q?void 0:q,S=h.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),E={theme:x,key:v,localeInfo:y,layout:C,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:B(B({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Tt(C):void 0})},A=wt({picasso:o,model:s,app:a,translator:l,auto:D});!1!==D&&A.auto((function(e){return D?D({layout:e,defaultAuto:Lt}):Lt(e)}));var w=!1,I={getColor:function(){return A.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return A.resolveUIColor({index:t,color:n})},getData:function(){return A.data()},getDatumProps:function(e){return A.datumProps(e)},getSnapshotData:function(){return A.getSnapshotData(S)},getSettingsForMeasure:function(e){return A.settingsForMeasure(e)},getSettings:function(){return A.settings()},getLegend:function(e,t){return A.legend(e,t)},getScales:function(){return A.scales()},getPalettes:function(){return A.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return A.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return w},custom:B({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Tt}),n=Mt(E,t);return A.config(n),A.getAuxiliarySettings(S).then((function(){w=!0}))}};return I}({app:o,model:n,picasso:r,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:ds(e)}})})}const hs=ar.DATA_PATH,ms=ar.HYPERCUBE_PATH,gs=ar.HYPERCUBE_DEF_PATH;function ys(e){return Array.isArray(e)?e:e?[e]:[]}function vs(e){return Math.min(as.getOuterDimensionSizeOfMax2Dims(e,hs),ar.MAX_STACKED_VALUES)}function bs(e,t){return{viewSize:t,max:vs(e)}}function xs(){const e=ar.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function qs(){if(this.layout&&as.hasSecondDimension(this.layout,hs)){this._scrollHandler.onResize();!!this.layout.snapshotData||xs.call(this)}}function Ds(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function Ss(e,t){return Pt(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const Cs=_i.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:s}){this._super(r,i,t,o,s),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new eo,this._selectionHandler=lo.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Lo.create(this.chartInstance,i,ar.CHART_ID),this._scrollHandler=new Po(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=ar.BUBBLE_SCALES_MAX,this._jitterTool=new ls,this.setDataPaths([`${hs}/${ms}`])},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[hs][ms],{top:e,height:t}).then((()=>n.layout))},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!as.hasSecondDimension(this.layout,hs)||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(e=this.layout).dataPoint&&e.dataPoint.bubbleScales?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1;var e},_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(ar.MAX_POINT_BASE_SIZE_PX,t*ar.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(ar.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=ys(t.trigger),r=ys(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Wo.getAdjustedMaxGlyphCount(function(e){const t=e[hs][ms].qDimensionInfo,n=as.hasSecondDimension(e,hs)?t[0].qApprMaxGlyphCount:0;return Math.min(ar.MAX_GLYPH_COUNT,n)}(this.layout||e),e[hs][ms].qStackedDataPages[0].qData[0].qSubNodes),s=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(ar.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=ys(t.trigger),o=ys(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";as.hasSecondDimension(e,hs)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const u={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(ar.CHART_ID,"box","stroke"),strokeWidth:0,width:ar.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:ar.MAX_POINT_BASE_SIZE_PX,minWidthPx:ar.MIN_POINT_PIXELS+2*ar.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*ar.JITTER_PARAMETER);const r=s._pointMaxSizePx+n+2*ar.BOX_PADDING,i=r/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,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 as.hasSecondDimension(e,hs)&&(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=ys(t.trigger),o=ys(t.consume);this._tooltipHandler.isOn()&&(i.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 rs.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:ar.MAX_POINT_BASE_SIZE_PX,minPx:ar.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*ar.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,ar.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._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 as.hasSecondDimension(e,hs)&&(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([`${hs}/${ms}`]),l},_getPointSelectionLayerSettings(e){const t=Rn(!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"),s=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[hs][ms],l=a.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",p=Ii.create({chartID:ar.CHART_ID,theme:n,isRtl:t});if(0===a.qStackedDataPages[0].qData.length)return p.getSettings();let d={},f={},h={},m={};if(this._selectionHandler.isOn()){const t=!o&&as.hasSecondDimension(e,hs);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:Ss(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:Ss(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:hs,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),d={trigger:Rn(!0,{},r.trigger,{data:[""]}),consume:[Rn(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,s.consume]},h={trigger:n.trigger,consume:[n.consume,r.consume,s.consume,i.consume]},m={trigger:[Rn(!0,{},i.trigger,{data:[""]})],consume:[Rn(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:p,colorService:this.colorService,data:as.hasSecondDimension(e,hs)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${ms}/qDimensionInfo/${as.hasSecondDimension(e,hs)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:as.hasSecondDimension(e,hs)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,Ss(e,0),Ss(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=vo.create(b,e.orientation,t,x,v),p.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:as.hasSecondDimension(e,hs),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:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:bs(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:rr(ar.CHART_ID,n,e,this.flags),axisLabelStyle:ir(ar.CHART_ID,n,e,this.flags)}),s){const t=this._getBoxMarkerSettings(e,f);p.addComponent("box-marker",t)}if(o){const r=this._getPointMarkerSettings(e,h,g);if(r.data.extract.props[u]={field:"qMeasureInfo/0"},r.settings[u]={scale:"measure"},as.hasSecondDimension(e,hs)&&(r.data.extract.props[c]={field:"qDimensionInfo/0",type:"qual"},r.settings[c]={scale:"dimension"}),this._jitter){r.settings[c]=r.settings[c]||{};const e=this._jitterTool;r.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,ar.JITTER_PARAMETER)}}p.addComponent("point-marker",r),p.addComponent("point-marker",this._getPointSelectionLayerSettings(r));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const r={title:or(ar.CHART_ID,n,e,this.flags),label:sr(ar.CHART_ID,n,e,this.flags)};this.addLegend(p,t,m,r)}}const q=p.getSettings();return this.addSnapshotChartSettings(q,e),q.scales={...q.scales,...this.colorService.getScales()},q.palettes=this.colorService.getPalettes(),q},addLegend(e,t,n,r){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:r,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter((e=>!!e)),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map((e=>Rn(!0,e,{style:{active:null}}))),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(qs.call(this),this._super())},hasValidData(){const e=this.layout;return e[hs]&&e[hs][ms]&&e[hs][ms].qStackedDataPages.length&&e[hs][ms].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&&(qs.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&&as.hasSecondDimension(t,hs)&&this._scrollHandler.isDataSizeChanged(Pt(t,`${hs}.${ms}.qStackedDataPages.0.qData.0.qSubNodes.length`),as.getOuterDimensionSizeOfMax2Dims(t,hs))?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[hs][ms].qStackedDataPages=this.layout[hs][ms].qStackedDataPages,us.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!as.hasSecondDimension(e,hs)&&e.qHyperCube.qSize.qcy>1e4||as.hasSecondDimension(e,hs)&&e.qHyperCube.qSize.qcy>3e3,r=t&&n,i=bs(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=fs({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",`${hs}/${ms}/${t}`)},_createColorLegendCube(e){const t=as.hasSecondDimension(this.layout,hs)?1:0;return{qDimensionInfo:[this.layout[hs][ms].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[gs],sorting:e.sorting,color:{point:e.color.point}}}(e)).then((s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>cs.generateHyperCube(e,t,n,r)};return i._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 us.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(vs(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),Ds.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(xs.call(t),t._cacheSizeInitialized=!0),i=as.hasSecondDimension(e,hs)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[hs][ms],{height:e[hs][ms].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&&Ss(e,0))}}),Es={enabled:!0,delay:50};function As(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}class ws{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=Rn(!0,{},Es,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:As(),wrapper:As(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?Is.apply(this,[r,0]):Is.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 Is(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout((()=>{Ts.call(n)}),t):Ts.call(n)}function Ts(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&Ms.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function Ms(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&&Ts.call(t)})),this.onSend(e.data,n)}const Os=new nn(0,0,0,0),Ls=new nn(0,0,0,0);class ks{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;Os.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Ls.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=Ls.intersection(Os,!0);if(t.push({coverage:i?i.clone():new nn(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){Os.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Ls.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Os.intersection(Ls,!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,s={};for(const e in i)i.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return s.qUp+=r,s.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const Ps={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},_s=tn.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 ks:"P"===this.options.mode?this.cube=new fn:this.cube=new sn,this.throttle=new ws({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=Rn(!0,{},Ps,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,s,a,l,u,c,p;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,s=i*t-i,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+s,this.cubeHeight-l)),p=Math.max(0,Math.min(e[r].qLeft+a,this.cubeWidth-u)),d.push({qTop:c,qHeight:l,qLeft:p,qWidth:u});return d}}),Ns=ar.DATA_PATH,Rs=ar.HYPERCUBE_DEF_PATH;class Hs{constructor(e){this.model=e,this.path=`/${Ns}/${Rs}`,this.cacheCube=new _s(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:ar.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:as.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)))}}}}}));
43
27
  //# sourceMappingURL=sn-distplot.systemjs.js.map