/*! lineupjs - v4.1.2 - 2021
* https://lineup.js.org
* Copyright (c) 2021 Samuel Gratzl; Licensed BSD-3-Clause */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LineUpJS=e():t.LineUpJS=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([,,function(t,e,r){"use strict";var n=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty;t.exports=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){var a,s,u,l=n(e),c=n(r);if(l&&c){if((s=e.length)!=r.length)return!1;for(a=s;0!=a--;)if(!t(e[a],r[a]))return!1;return!0}if(l!=c)return!1;var p=e instanceof Date,f=r instanceof Date;if(p!=f)return!1;if(p&&f)return e.getTime()==r.getTime();var h=e instanceof RegExp,d=r instanceof RegExp;if(h!=d)return!1;if(h&&d)return e.toString()==r.toString();var g=i(e);if((s=g.length)!==i(r).length)return!1;for(a=s;0!=a--;)if(!o.call(r,g[a]))return!1;for(a=s;0!=a--;)if(!t(e[u=g[a]],r[u]))return!1;return!0}return e!=e&&r!=r}},,function(t,e){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,i=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=/^\[object .+?Constructor\]$/,u="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")();var p,f=Array.prototype,h=Function.prototype,d=Object.prototype,g=c["__core-js_shared__"],m=(p=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",y=h.toString,v=d.hasOwnProperty,b=d.toString,E=RegExp("^"+y.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=c.Symbol,N=f.splice,_=V(c,"Map"),T=V(Object,"create"),w=C?C.prototype:void 0,R=w?w.toString:void 0;function A(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function D(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function S(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function M(t,e){for(var r,n,i=t.length;i--;)if((r=t[i][0])===(n=e)||r!=r&&n!=n)return i;return-1}function L(t,e){for(var i,o=0,a=(e=function(t,e){if(H(t))return!1;var i=typeof t;if("number"==i||"symbol"==i||"boolean"==i||null==t||F(t))return!0;return n.test(t)||!r.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:H(i=e)?i:I(i)).length;null!=t&&o<a;)t=t[k(e[o++])];return o&&o==a?t:void 0}function x(t){return!(!P(t)||(e=t,m&&m in e))&&(function(t){var e=P(t)?b.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?E:s).test(function(t){if(null!=t){try{return y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function O(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function V(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return x(r)?r:void 0}A.prototype.clear=function(){this.__data__=T?T(null):{}},A.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},A.prototype.get=function(t){var e=this.__data__;if(T){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return v.call(e,t)?e[t]:void 0},A.prototype.has=function(t){var e=this.__data__;return T?void 0!==e[t]:v.call(e,t)},A.prototype.set=function(t,e){return this.__data__[t]=T&&void 0===e?"__lodash_hash_undefined__":e,this},D.prototype.clear=function(){this.__data__=[]},D.prototype.delete=function(t){var e=this.__data__,r=M(e,t);return!(r<0)&&(r==e.length-1?e.pop():N.call(e,r,1),!0)},D.prototype.get=function(t){var e=this.__data__,r=M(e,t);return r<0?void 0:e[r][1]},D.prototype.has=function(t){return M(this.__data__,t)>-1},D.prototype.set=function(t,e){var r=this.__data__,n=M(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},S.prototype.clear=function(){this.__data__={hash:new A,map:new(_||D),string:new A}},S.prototype.delete=function(t){return O(this,t).delete(t)},S.prototype.get=function(t){return O(this,t).get(t)},S.prototype.has=function(t){return O(this,t).has(t)},S.prototype.set=function(t,e){return O(this,t).set(t,e),this};var I=G((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(F(t))return R?R.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return i.test(t)&&r.push(""),t.replace(o,(function(t,e,n,i){r.push(n?i.replace(a,"$1"):e||t)})),r}));function k(t){if("string"==typeof t||F(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function G(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(G.Cache||S),r}G.Cache=S;var H=Array.isArray;function P(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function F(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==b.call(t)}t.exports=function(t,e,r){var n=null==t?void 0:L(t,e);return void 0===n?r:n}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,r){this.name=t,this.version=e,this.os=r};e.BrowserInfo=n;var i=function(t){this.version=t,this.name="node",this.os=process.platform};e.NodeInfo=i;var o=function(){this.bot=!0,this.name="bot",this.version=null,this.os=null};e.BotInfo=o;var a=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["vivaldi",/Vivaldi\/([0-9\.]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/Edg\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],s=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/],["Search Bot",/(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\/Teoma)|(ia_archiver)/]];function u(t){var e=""!==t&&a.reduce((function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]}),!1);if(!e)return null;var r=e[0],i=e[1];if("searchbot"===r)return new o;var s=i[1]&&i[1].split(/[._]/).slice(0,3);return s?s.length<3&&(s=s.concat(function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-s.length))):s=[],new n(r,s.join("."),l(t))}function l(t){for(var e=0,r=s.length;e<r;e++){var n=s[e],i=n[0];if(n[1].test(t))return i}return null}function c(){return"undefined"!=typeof process&&process.version?new i(process.version.slice(1)):null}e.detect=function(){return"undefined"!=typeof navigator?u(navigator.userAgent):c()},e.parseUserAgent=u,e.detectOS=l,e.getNodeVersion=c},function(t,e){
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r;!function(t){!function(e){var r="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),n=i(t);function i(t,e){return function(r,n){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0===r.Reflect?r.Reflect=t:n=i(r.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return x(Object.create(null))}:a?function(){return x({__proto__:null})}:function(){return x({})},has:s?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:s?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,n)},e.prototype.values=function(){return new r(this._keys,this._values,o)},e.prototype.entries=function(){return new r(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}():Map,f=c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new p}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}():Set,h=new(c||"function"!=typeof WeakMap?function(){var t=u.create(),r=n();return function(){function t(){this._key=n()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=n()},t}();function n(){var e;do{e="@@WeakMap@@"+a()}while(u.has(t,e));return t[e]=!0,e}function i(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function o(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",n=0;n<16;++n){var i=e[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}():WeakMap);function d(t,e,r){var n=h.get(t);if(E(n)){if(!r)return;n=new p,h.set(t,n)}var i=n.get(e);if(E(i)){if(!r)return;i=new p,n.set(e,i)}return i}function g(t,e,r){var n=d(e,r,!1);return!E(n)&&!!n.has(t)}function m(t,e,r){var n=d(e,r,!1);if(!E(n))return n.get(t)}function y(t,e,r,n){d(r,n,!0).set(t,e)}function v(t,e){var r=[],n=d(t,e,!1);if(E(n))return r;for(var o=function(t){var e=D(t,i);if(!R(e))throw new TypeError;var r=e.call(t);if(!N(r))throw new TypeError;return r}(n.keys()),a=0;;){var s=S(o);if(!s)return r.length=a,r;var u=s.value;try{r[a]=u}catch(t){try{M(o)}finally{throw t}}a++}}function b(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function C(t){return null===t}function N(t){return"object"==typeof t?null!==t:"function"==typeof t}function _(t,e){switch(b(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",i=D(t,n);if(void 0!==i){var o=i.call(t,r);if(N(o))throw new TypeError;return o}return function(t,e){if("string"===e){var r=t.toString;if(R(r))if(!N(i=r.call(t)))return i;if(R(n=t.valueOf))if(!N(i=n.call(t)))return i}else{var n;if(R(n=t.valueOf))if(!N(i=n.call(t)))return i;var i,o=t.toString;if(R(o))if(!N(i=o.call(t)))return i}throw new TypeError}(t,"default"===r?"number":r)}function T(t){var e=_(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function w(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function R(t){return"function"==typeof t}function A(t){return"function"==typeof t}function D(t,e){var r=t[e];if(null!=r){if(!R(r))throw new TypeError;return r}}function S(t){var e=t.next();return!e.done&&e}function M(t){var e=t.return;e&&e.call(t)}function L(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var i=n.constructor;return"function"!=typeof i||i===t?e:i}function x(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,n){if(E(r)){if(!w(t))throw new TypeError;if(!A(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!E(n)&&!C(n)){if(!A(n))throw new TypeError;e=n}}return e}(t,e)}if(!w(t))throw new TypeError;if(!N(e))throw new TypeError;if(!N(n)&&!E(n)&&!C(n))throw new TypeError;return C(n)&&(n=void 0),function(t,e,r,n){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,r,n);if(!E(o)&&!C(o)){if(!N(o))throw new TypeError;n=o}}return n}(t,e,r=T(r),n)})),t("metadata",(function(t,e){return function(r,n){if(!N(r))throw new TypeError;if(!E(n)&&!function(t){switch(b(t)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;y(t,e,r,n)}})),t("defineMetadata",(function(t,e,r,n){if(!N(r))throw new TypeError;return E(n)||(n=T(n)),y(t,e,r,n)})),t("hasMetadata",(function(t,e,r){if(!N(e))throw new TypeError;return E(r)||(r=T(r)),function t(e,r,n){if(g(e,r,n))return!0;var i=L(r);return!C(i)&&t(e,i,n)}(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!N(e))throw new TypeError;return E(r)||(r=T(r)),g(t,e,r)})),t("getMetadata",(function(t,e,r){if(!N(e))throw new TypeError;return E(r)||(r=T(r)),function t(e,r,n){if(g(e,r,n))return m(e,r,n);var i=L(r);return C(i)?void 0:t(e,i,n)}(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!N(e))throw new TypeError;return E(r)||(r=T(r)),m(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!N(t))throw new TypeError;return E(e)||(e=T(e)),function t(e,r){var n=v(e,r),i=L(e);if(null===i)return n;var o=t(i,r);if(o.length<=0)return n;if(n.length<=0)return o;for(var a=new f,s=[],u=0,l=n;u<l.length;u++){var c=l[u];a.has(c)||(a.add(c),s.push(c))}for(var p=0,h=o;p<h.length;p++){c=h[p];a.has(c)||(a.add(c),s.push(c))}return s}(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!N(t))throw new TypeError;return E(e)||(e=T(e)),v(t,e)})),t("deleteMetadata",(function(t,e,r){if(!N(e))throw new TypeError;E(r)||(r=T(r));var n=d(e,r,!1);if(E(n))return!1;if(!n.delete(t))return!1;if(n.size>0)return!0;var i=h.get(e);return i.delete(r),i.size>0||h.delete(e),!0}))}(n)}()}(r||(r={}))},function(t,e,r){},function(t,e,r){"use strict";r.r(e);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,r,n){var i,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,r,a):i(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a}function s(t){return t.every((function(){return!1}))}function u(t){return Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float64Array}var l=function(){function t(t,e){this.it=t,this.filters=e,this._length=-1}return Object.defineProperty(t.prototype,"length",{get:function(){if(this._length>=0)return this._length;var t=0;return this.forEach((function(){return t++})),this._length=t,t},enumerable:!0,configurable:!0}),t.prototype.filter=function(e){return new t(this.it,this.filters.concat(e))},t.prototype.map=function(t){return new p(this,t)},t.prototype.forEach=function(t){if(u(this.it))t:for(var e=0;e<this.it.length;++e){for(var r=this.it[e],n=0,i=this.filters;n<i.length;n++){if(!(0,i[n])(r,e))continue t}t(r,e)}else{var o=0,a=this.it[Symbol.iterator](),s=a.next(),l=0;t:for(;!s.done;){for(var c=0,p=this.filters;c<p.length;c++){if(!(0,p[c])(s.value,l)){s=a.next(),l++;continue t}}t(s.value,o++),s=a.next(),l++}}},t.prototype[Symbol.iterator]=function(){var t=this,e=this.it[Symbol.iterator]();return{next:function(){var r=e.next(),n=-1;t:for(;!r.done;){n++;for(var i=0,o=t.filters;i<o.length;i++){if(!(0,o[i])(r.value,n)){r=e.next();continue t}}return r}return r}}},t.prototype.some=function(t){if(u(this.it)){t:for(var e=0;e<this.it.length;++e){for(var r=this.it[e],n=0,i=this.filters;n<i.length;n++){if(!(0,i[n])(r,e))continue t}if(t(r,e))return!0}return!1}var o=0,a=this.it[Symbol.iterator](),s=a.next(),l=0;t:for(;!s.done;){for(var c=0,p=this.filters;c<p.length;c++){if(!(0,p[c])(s.value,l)){s=a.next(),l++;continue t}}if(t(s.value,o++))return!0;s=a.next(),l++}return!1},t.prototype.every=function(t){if(u(this.it)){t:for(var e=0;e<this.it.length;++e){for(var r=this.it[e],n=0,i=this.filters;n<i.length;n++){if(!(0,i[n])(r,e))continue t}if(!t(r,e))return!1}return!0}var o=0,a=this.it[Symbol.iterator](),s=a.next(),l=0;t:for(;!s.done;){for(var c=0,p=this.filters;c<p.length;c++){if(!(0,p[c])(s.value,l)){s=a.next(),l++;continue t}}if(!t(s.value,o++))return!1;s=a.next(),l++}return!0},t.prototype.reduce=function(t,e){if(u(this.it)){var r=e,n=0;t:for(var i=0;i<this.it.length;++i){for(var o=this.it[i],a=0,s=this.filters;a<s.length;a++){if(!(0,s[a])(o,i))continue t}r=t(r,o,n++)}return r}var l=0,c=this.it[Symbol.iterator](),p=c.next(),f=0,h=e;t:for(;!p.done;){for(var d=0,g=this.filters;d<g.length;d++){if(!(0,g[d])(p.value,f)){p=c.next(),f++;continue t}}h=t(h,p.value,l++),p=c.next(),f++}return h},t}(),c=function(){function t(t){this.it=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.it.length},enumerable:!0,configurable:!0}),t.prototype.filter=function(t){return new l(this,[t])},t.prototype.forEach=function(t){if(u(this.it))for(var e=0;e<this.it.length;++e)t(this.mapV(this.it[e],e),e);else{var r=this.it[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)t(this.mapV(n.value,e),e)}},t.prototype[Symbol.iterator]=function(){var t=this,e=this.it[Symbol.iterator](),r=0;return{next:function(){var n=e.next();if(n.done)return{value:void 0,done:!0};var i=t.mapV(n.value,r);return r++,{value:i,done:!1}}}},t.prototype.some=function(t){if(u(this.it)){for(var e=0;e<this.it.length;++e)if(t(this.mapV(this.it[e],e),e))return!0;return!1}var r=this.it[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)if(t(this.mapV(n.value,e),e))return!0;return!1},t.prototype.every=function(t){if(u(this.it)){for(var e=0;e<this.it.length;++e)if(!t(this.mapV(this.it[e],e),e))return!1;return!0}var r=this.it[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)if(!t(this.mapV(n.value,e),e))return!1;return!0},t.prototype.reduce=function(t,e){if(u(this.it)){for(var r=e,n=0;n<this.it.length;++n)r=t(r,this.mapV(this.it[n],n),n);return r}var i=this.it[Symbol.iterator](),o=e,a=i.next();for(n=0;!a.done;a=i.next(),n++)o=t(o,this.mapV(a.value,n),n);return o},t}(),p=function(t){function e(e,r){var n=t.call(this,e)||this;return n.map12=r,n}return i(e,t),e.prototype.mapV=function(t,e){return this.map12(t,e)},e.prototype.map=function(t){return new f(this.it,this.map12,t)},e}(c),f=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map12=r,i.map23=n,i}return i(e,t),e.prototype.map=function(t){return new h(this.it,this.map12,this.map23,t)},e.prototype.mapV=function(t,e){return this.map23(this.map12(t,e),e)},e}(c),h=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.map12=r,o.map23=n,o.map34=i,o}return i(e,t),e.prototype.map=function(t){var e=this;return new p(this.it,(function(r,n){return t(e.map34(e.map23(e.map12(r,n),n),n),n)}))},e.prototype.mapV=function(t,e){return this.map34(this.map23(this.map12(t,e),e),e)},e}(c),d=function(){function t(t){this.iterable=t,this._arr=null}return Object.defineProperty(t.prototype,"arr",{get:function(){return this._arr||(u(this.iterable)?this._arr=this.iterable:this._arr=Array.from(this.iterable)),this._arr},enumerable:!0,configurable:!0}),t.prototype[Symbol.iterator]=function(){return this.iterable[Symbol.iterator]()},t.prototype.filter=function(t){return new l(this.arr,[t])},t.prototype.map=function(t){return new p(this.arr,t)},t.prototype.forEach=function(t){if(u(this.iterable))for(var e=0;e<this.iterable.length;++e)t(this.iterable[e],e);else{var r=this[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)t(n.value,e)}},t.prototype.some=function(t){if(u(this.iterable)){for(var e=0;e<this.iterable.length;++e)if(t(this.iterable[e],e))return!0;return!1}var r=this[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)if(t(n.value,e))return!0;return!1},t.prototype.every=function(t){if(u(this.iterable)){for(var e=0;e<this.iterable.length;++e)if(!t(this.iterable[e],e))return!1;return!0}var r=this[Symbol.iterator](),n=r.next();for(e=0;!n.done;n=r.next(),e++)if(!t(n.value,e))return!1;return!0},t.prototype.reduce=function(t,e){if(u(this.iterable)){for(var r=e,n=0;n<this.iterable.length;++n)r=t(r,this.iterable[n],n);return r}var i=this[Symbol.iterator](),o=e,a=i.next();for(n=0;!a.done;a=i.next(),n++)o=t(o,a.value,n);return o},Object.defineProperty(t.prototype,"length",{get:function(){var t=this.iterable;return u(t)?t.length:t instanceof Set||t instanceof Map?t.size:this.arr.length},enumerable:!0,configurable:!0}),t}();function g(t){return new d(t)}var m=function(){function t(t){this.seqs=t}return t.prototype[Symbol.iterator]=function(){var t=Array.from(this.seqs),e=t.shift()[Symbol.iterator](),r=function(){var n=e.next();return n.done?0===t.length?n:(e=t.shift()[Symbol.iterator](),r()):n};return{next:r}},t.prototype.filter=function(t){return new l(this,[t])},t.prototype.map=function(t){return new p(this,t)},t.prototype.forEach=function(t){this.seqs.forEach((function(e){return e.forEach(t)}))},t.prototype.some=function(t){return this.seqs.some((function(e){return e.some(t)}))},t.prototype.every=function(t){return this.seqs.every((function(e){return e.every(t)}))},t.prototype.reduce=function(t,e){return this.seqs.reduce((function(e,r){return r.reduce(t,e)}),e)},Object.defineProperty(t.prototype,"length",{get:function(){return this.seqs.reduce((function(t,e){return t+e.length}),0)},enumerable:!0,configurable:!0}),t}();var y=Math.max(navigator.hardwareConcurrency-1,1),v=function(){function t(t){var e=this;this.blob=t,this.workers=[],this.cleanUpWorkerTimer=-1,this.workerTaskCounter=0,this.cleanUpWorker=function(){for(;e.workers.length>1;){var t=e.workers.findIndex((function(t){return 0===t.tasks.size}));if(t<0)break;e.workers.splice(t,1)[0].worker.terminate()}e.finshedTask()};for(var r=0;r<1;++r){var n=new Worker(t);this.workers.push({worker:n,tasks:new Set,refs:new Set,index:r})}}return t.prototype.terminate=function(){this.workers.splice(0,this.workers.length).forEach((function(t){return t.worker.terminate()}))},t.prototype.checkOutWorker=function(){this.cleanUpWorkerTimer>=0&&(clearTimeout(this.cleanUpWorkerTimer),this.cleanUpWorkerTimer=-1);var t=this.workers.find((function(t){return 0===t.tasks.size}));if(t)return t;if(this.workers.length>=y)return this.workers.reduce((function(t,e){return null==t||t.tasks.size>e.tasks.size?e:t}),null);var e={worker:new Worker(this.blob),tasks:new Set,refs:new Set,index:this.workers.length};return this.workers.push(e),e},t.prototype.finshedTask=function(){-1===this.cleanUpWorkerTimer&&this.workers.length>1&&(this.cleanUpWorkerTimer=self.setTimeout(this.cleanUpWorker,1e4))},t.prototype.pushStats=function(t,e,r,n,i,o){var a=this;return new Promise((function(s){var u=a.workerTaskCounter++,l=a.checkOutWorker(),c=l.worker,p=l.tasks,f=l.refs,h=function(e){var r=e.data;r.uid===u&&r.type===t&&(c.removeEventListener("message",h),p.delete(u),a.finshedTask(),s(r.stats))};c.addEventListener("message",h),p.add(u);var d=Object.assign({type:t,uid:u,refData:r,refIndices:i||null},e);r&&f.has(r)||(d.data=n,r&&f.add(r)),!o||i&&f.has(i)||(d.indices=o,i&&f.add(i)),c.postMessage(d)}))},t.prototype.push=function(t,e,r,n){var i=this;return new Promise((function(o){var a=i.workerTaskCounter++,s=i.checkOutWorker(),u=s.worker,l=s.tasks,c=function(e){var r=e.data;r.uid===a&&r.type===t&&(u.removeEventListener("message",c),l.delete(a),i.finshedTask(),o(n?n(r):r))};u.addEventListener("message",c),l.add(a);var p=Object.assign({type:t,uid:a},e);u.postMessage(p,r)}))},t.prototype.setRef=function(t,e){for(var r=0,n=this.workers;r<n.length;r++){n[r].refs.add(t)}this.broadCast("setRef",{ref:t,data:e})},t.prototype.deleteRef=function(t,e){void 0===e&&(e=!1);for(var r={type:"deleteRef",uid:this.workerTaskCounter++,ref:t,startsWith:e},n=0,i=this.workers;n<i.length;n++){var o=i[n];if(o.worker.postMessage(r),e)for(var a=0,s=Array.from(o.refs);a<s.length;a++){var u=s[a];u.startsWith(t)&&o.refs.delete(u)}else o.refs.delete(t)}},t.prototype.deleteRefs=function(){for(var t={type:"deleteRef",uid:this.workerTaskCounter++,ref:"",startsWith:!0},e=0,r=this.workers;e<r.length;e++){var n=r[e];n.worker.postMessage(t),n.refs.clear()}},t.prototype.broadCast=function(t,e){for(var r=this.workerTaskCounter++,n=Object.assign({type:t,uid:r},e),i=0,o=this.workers;i<o.length;i++){o[i].worker.postMessage(n)}},t}();function b(t){return 0===t?1:Math.ceil(Math.log(t)/Math.LN2)+1}function E(t,e){for(var r=Number.POSITIVE_INFINITY,n=0,i=t;n<i.length;n++){var o=i[n],a=e?e(o):o;a<r&&(r=a)}return r}function C(t,e){for(var r=Number.NEGATIVE_INFINITY,n=0,i=t;n<i.length;n++){var o=i[n],a=e?e(o):o;a>r&&(r=a)}return r}function N(t,e){for(var r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=0,o=t;i<o.length;i++){var a=o[i],s=e?e(a):a;s<n&&(n=s),s>r&&(r=s)}return[n,r]}function _(t){var e=new Array(t);return e.fill(null),e}function T(t,e,r){if(void 0===r&&(r=t.length),0===r)return NaN;var n=(r-1)*e,i=Math.floor(n);if(i===n)return t[i];var o=t[i];return o+(t[i+1]-o)*(n-i)}function w(t,e){var r=e?t.map(e):t.slice();return r.sort((function(t,e){return t<e?-1:t>e?1:0})),T(r,.5)}function R(t){return function(e){if(u(e))for(var r=0;r<e.length;++r)t(e[r]);else e.forEach(t)}}function A(t){var e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,n=0,i=0,o=0,a=[],s=null!=t?new Float32Array(t):null,u=function(t){i+=1,null==t||isNaN(t)?o+=1:(t<e&&(e=t),t>r&&(r=t),n+=t)},l=function(t){u(t),s?s[i]=t:a.push(t)},c={min:NaN,max:NaN,mean:NaN,missing:o,count:i,whiskerHigh:NaN,whiskerLow:NaN,outlier:[],median:NaN,q1:NaN,q3:NaN},p=function(t){for(var a=i-o,s=T(t,.5,a),u=T(t,.25,a),l=T(t,.75,a),c=l-u,p=u-1.5*c,f=l+1.5*c,h=[],d=p,g=0;g<a;++g){if(p<(v=t[g])){d=v;break}h.push(v)}var m=f,y=[];for(g=a-1;g>=0;--g){var v;if((v=t[g])<f){m=v;break}y.push(v)}return h=h.concat(y.reverse()),{min:e,max:r,count:i,missing:o,mean:n/a,whiskerHigh:m,whiskerLow:d,outlier:h,median:s,q1:u,q3:l}};return{push:l,build:function(){if(0===i-o)return c;var t=s?s.sort():Float32Array.from(a).sort();return p(t)},buildArr:function(t){for(var e=t.slice().sort(),r=0;r<t.length;++r)u(t[r]);return p(e)},pushAll:R(l)}}function D(t){for(var e=[],r=0,n=1/t,i=0;i<t;++i,r+=n)e.push({x0:r,x1:r+n,count:0});var o=0+n,a=1-n,s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=0,c=0,p=0,f=function(r){c+=1,null==r||isNaN(r)?p+=1:(r<s&&(s=r),r>u&&(u=r),l+=r,e[function(r){if(r<o)return 0;if(r>=a)return t-1;if(3===t)return 1;for(var n=1,i=t-1;n<i;){var s=Math.floor((i+n)/2);r<e[s].x1?i=s:n=s+1}return n}(r)].count++)};return{push:f,build:function(){var t=c-p;return 0===t?{count:p,missing:p,min:NaN,max:NaN,mean:NaN,hist:e,maxBin:0}:{count:c,min:s,max:u,mean:l/t,missing:p,hist:e,maxBin:e.reduce((function(t,e){return Math.max(t,e.count)}),0)}},pushAll:R(f)}}function S(t,e){if(null==t||null==e)return{histGranularity:"year",hist:[]};var r=[];if(e.getFullYear()-t.getFullYear()>=2){for(var n=t.getFullYear(),i=e.getFullYear(),o=n;o<=i;++o)r.push({x0:new Date(o,0,1),x1:new Date(o+1,0,1),count:0});return{hist:r,histGranularity:"year"}}if(e.getTime()-t.getTime()<=26784e5){for(var a=new Date(t.getFullYear(),t.getMonth(),t.getDate());a<=e;){(u=new Date(a)).setDate(u.getDate()+1),r.push({x0:a,x1:u,count:0}),a=u}return{hist:r,histGranularity:"day"}}for(var s=new Date(t.getFullYear(),t.getMonth(),1);s<=e;){var u;(u=new Date(s)).setMonth(u.getMonth()+1),r.push({x0:s,x1:u,count:0}),s=u}return{hist:r,histGranularity:"month"}}function M(t,e,r){if(void 0===r&&(r=1),e<t[0].x1)t[0].count+=r;else{var n=t.length-1;if(e>t[n].x0)t[n].count+=r;else if(2!==n){for(var i=1,o=n;i<o;){var a=Math.floor((o+i)/2);e<t[a].x1?o=a:i=a+1}t[i].count+=r}else t[1].count+=r}}function L(t){var e=null,r=null,n=0,i=0,o=new Map,a=t?t.hist.map((function(t){return{x0:t.x0,x1:t.x1,count:0}})):null,s=function(t){if(n+=1,t&&null!=t)if((null==e||t<e)&&(e=t),(null==r||t>r)&&(r=t),a)M(a,t,1);else{var s=1e4*t.getFullYear()+100*t.getMonth()+t.getDate();o.has(s)?o.get(s).count++:o.set(s,{count:1,x:t})}else i+=1};return{push:s,build:function(){if(a)return{min:e,max:r,missing:i,count:n,maxBin:a.reduce((function(t,e){return Math.max(t,e.count)}),0),hist:a,histGranularity:t.histGranularity};var s=S(e,r),u=s.histGranularity,l=s.hist;return o.forEach((function(t){return M(l,t.x,t.count)})),{min:e,max:r,missing:i,count:n,maxBin:l.reduce((function(t,e){return Math.max(t,e.count)}),0),hist:l,histGranularity:u}},pushAll:R(s)}}function x(t){var e=new Map;t.forEach((function(t){return e.set(t.name,0)}));var r=0,n=0,i=function(t){n+=1,null==t?r+=1:e.set(t.name,(e.get(t.name)||0)+1)};return{push:i,build:function(){var i=t.map((function(t){return{cat:t.name,count:e.get(t.name)}}));return{maxBin:i.reduce((function(t,e){return Math.max(t,e.count)}),Number.NEGATIVE_INFINITY),hist:i,count:n,missing:r}},pushAll:R(i)}}function O(t,e){if(void 0===e&&(e=0),0===e)return Math.round(t);var r=Math.pow(10,e);return Math.round(t*r)/r}function V(t,e,r){return void 0===r&&(r=.5),t===e||Math.abs(t-e)<r}function I(t){return t instanceof Promise||"function"==typeof t.then}function k(t,e){return void 0===e&&(e=t),e<=255?new Uint8Array(t):e<=65535?new Uint16Array(t):new Uint32Array(t)}function G(t,e){if(t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array)return t.slice();var r=null!=e?e:t.length;return r<=255?Uint8Array.from(t):r<=65535?Uint16Array.from(t):Uint32Array.from(t)}function H(t,e){switch(t.length){case 0:return[];case 1:return t[0];default:for(var r=t.reduce((function(t,e){return t+e.length}),0),n=function(t,e,r){return t instanceof Uint8Array?new Uint8Array(e):t instanceof Uint16Array?new Uint16Array(e):t instanceof Uint32Array?new Uint32Array(e):k(e,r)}(t[0],r,e),i=0,o=0,a=t;o<a.length;o++){var s=a[o];n.set(s,i),i+=s.length}return n}}function P(t,e){return t<e?-1:t>e?1:0}function F(t,e){return t<e?1:t>e?-1:0}function U(t,e){if(t.length<2)return t;switch(e.length){case 0:return t.sort();case 1:var r=e[0].asc?P:F,n=e[0].lookup;return t.sort((function(t,e){var i=r(n[t],n[e]);return 0!==i?i:t-e}));case 2:var i=e[0].asc?P:F,o=e[0].lookup,a=e[1].asc?P:F,s=e[1].lookup;return t.sort((function(t,e){var r=i(o[t],o[e]);return 0!==(r=0!==r?r:a(s[t],s[e]))?r:t-e}));default:var u=e.length,l=e.map((function(t){return t.asc?P:F}));return t.sort((function(t,r){for(var n=0;n<u;++n){var i=e[n].lookup,o=l[n](i[t],i[r]);if(0!==o)return o}return t-r}))}}function B(t){return isNaN(t)?null:new Date(t)}function j(t,e){return 0===t?null:e[t-1]}function Y(){var t=self,e=new Map,r=function(t){var r=t.data?t.data:e.get(t.refData),n=t.indices?t.indices:t.refIndices?e.get(t.refIndices):void 0;return t.refData&&e.set(t.refData,r),t.refIndices&&e.set(t.refIndices,n),{data:r,indices:n}},n={sort:function(e){e.sortOrders&&U(e.indices,e.sortOrders);var r=e.indices;t.postMessage({type:e.type,uid:e.uid,ref:e.ref,order:r},[e.indices.buffer])},setRef:function(t){t.data?e.set(t.ref,t.data):e.delete(t.ref)},deleteRef:function(t){if(t.startsWith)for(var r=0,n=Array.from(e.keys());r<n.length;r++){var i=n[r];i.startsWith(t.ref)&&e.delete(i)}else e.delete(t.ref)},dateStats:function(e){var n=r(e),i=n.data,o=n.indices,a=L(e.template);if(o)for(var s=0;s<o.length;++s){var u=i[o[s]];a.push(B(u))}else for(var l=0;l<i.length;++l)a.push(B(i[l]));t.postMessage({type:e.type,uid:e.uid,stats:a.build()})},categoricalStats:function(e){var n=r(e),i=n.data,o=n.indices,a=e.categories.map((function(t){return{name:t}})),s=x(a);if(o)for(var u=0;u<o.length;++u)s.push(j(i[o[u]],a));else for(var l=0;l<i.length;++l)s.push(j(i[l],a));t.postMessage({type:e.type,uid:e.uid,stats:s.build()})},numberStats:function(e){var n=r(e),i=n.data,o=n.indices,a=D(e.numberOfBins);if(o)for(var s=0;s<o.length;++s)a.push(i[o[s]]);else for(var u=0;u<i.length;++u)a.push(i[u]);t.postMessage({type:e.type,uid:e.uid,stats:a.build()})},boxplotStats:function(e){var n,i=r(e),o=i.data,a=i.indices,s=A(a?a.length:void 0);if(a){for(var u=0;u<a.length;++u)s.push(o[a[u]]);n=s.build()}else n=s.buildArr(o);t.postMessage({type:e.type,uid:e.uid,stats:n})}};t.addEventListener("message",(function(t){var e=t.data;if("number"==typeof e.uid&&"string"==typeof e.type){var r=n[e.type];r&&r(e)}}))}function W(){return t=[R.toString(),T.toString(),D.toString(),A.toString(),S.toString(),M.toString(),L.toString(),x.toString(),k.toString(),P.toString(),F.toString(),U.toString(),B.toString(),j.toString(),(n=Y,i=n.toString(),i.slice(i.indexOf("{")+1,i.lastIndexOf("}")))],e=t.map((function(t){return t.toString()})).join("\n\n"),r=new Blob([e],{type:"application/javascript"}),URL.createObjectURL(r);var t,e,r,n,i}function z(t,e){return t.length===e.length&&t.every((function(t,r){return t===e[r]}))}function q(t){return t.replace(/[\s!#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~]+/g,"_")}function K(t){for(;t.lastChild;)t.removeChild(t.lastChild);return t}function X(t){for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r];if(Array.isArray(i))for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(s)}else e.push(i)}return e}function $(t){switch(t){case"min":return"Mininum";case"max":return"Maximum";case"median":return"Median";case"mean":return"Mean";case"q1":return"25% Quantile";case"q3":return"75% Quantile";default:return String(t)}}var J={value:function(){}};function Q(){for(var t,e=0,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n)throw new Error("illegal type: "+t);n[t]=[]}return new Z(n)}function Z(t){this._=t}function tt(t,e){return t.trim().split(/^|\s+/).map((function(t){var r="",n=t.indexOf(".");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}}))}function et(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function rt(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=J,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}Z.prototype=Q.prototype={constructor:Z,on:function(t,e){var r,n=this._,i=tt(t+"",n),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(r=(t=i[o]).type)n[r]=rt(n[r],t.name,e);else if(null==e)for(r in n)n[r]=rt(n[r],t.name,null);return this}for(;++o<a;)if((r=(t=i[o]).type)&&(r=et(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new Z(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),o=0;o<r;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,r=(n=this._[t]).length;o<r;++o)n[o].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,o=n.length;i<o;++i)n[i].value.apply(e,r)}};var nt=Q;function it(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.map((function(e){return""+e+t}))}var ot,at=function(){function t(){var t=this.createEventList();this.listenerEvents=new Set(t),this.listeners=nt.apply(void 0,t);var e=this;this.forwarder=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e.fireImpl.apply(e,[this.type,this.primaryType,this.origin].concat(t))}}return t.prototype.on=function(t,e){var r=this;return Array.isArray(t)?t.forEach((function(t){r.listenerEvents.has(t.split(".")[0])&&(r.listenersChanged(t,Boolean(e)),r.listeners.on(t,e))})):this.listenerEvents.has(t.split(".")[0])&&(this.listenersChanged(t,Boolean(e)),this.listeners.on(t,e)),this},t.prototype.listenersChanged=function(t,e){},t.prototype.createEventList=function(){return[]},t.prototype.fire=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=Array.isArray(t)?t[0]:t;this.fireImpl.apply(this,[t,n,this].concat(e))},t.prototype.fireImpl=function(t,e,r){for(var n=this,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var a=function(t){if(n.listenerEvents.has(t)){var o={source:n,origin:r,type:t,primaryType:e,args:i};n.listeners.apply(t,o,i)}};Array.isArray(t)?t.forEach(a):a(t)},t.prototype.forward=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];t.on(e,this.forwarder)},t.prototype.unforward=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];t.on(e,null)},t}(),st=(r(6),{name:"Default",color:"gray"}),ut={name:"Others",color:"gray"};function lt(t){return t&&null==t.group}function ct(t){return"function"==typeof t.getCollapsed}!function(t){t[t.BINARY=0]="BINARY",t[t.COUNT=1]="COUNT",t[t.UINT8=2]="UINT8",t[t.UINT16=3]="UINT16",t[t.UINT32=4]="UINT32",t[t.INT8=5]="INT8",t[t.INT16=6]="INT16",t[t.INT32=7]="INT32",t[t.FLOAT=8]="FLOAT",t[t.FLOAT_ASC=9]="FLOAT_ASC",t[t.DOUBLE=10]="DOUBLE",t[t.DOUBLE_ASC=11]="DOUBLE_ASC",t[t.STRING=12]="STRING"}(ot||(ot={}));var pt=function(t){function e(e,r){var n=t.call(this)||this;return n.desc=r,n.width=100,n.parent=null,n.uid=q(e),n.renderer=n.desc.renderer||n.desc.type,n.groupRenderer=n.desc.groupRenderer||n.desc.type,n.summaryRenderer=n.desc.summaryRenderer||n.desc.type,n.width=null!=n.desc.width&&n.desc.width>0?n.desc.width:100,n.visible=!1!==n.desc.visible,n.metadata={label:r.label||n.id,summary:r.summary||"",description:r.description||""},n}return i(e,t),Object.defineProperty(e.prototype,"fixed",{get:function(){return Boolean(this.desc.fixed)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frozen",{get:function(){return Boolean(this.desc.frozen)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.uid},enumerable:!0,configurable:!0}),e.prototype.assignNewId=function(t){this.uid=q(t())},Object.defineProperty(e.prototype,"label",{get:function(){return this.metadata.label},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){return this.metadata.description},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fqid",{get:function(){return this.parent?this.parent.fqid+"_"+this.id:this.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fqpath",{get:function(){return this.parent?this.parent.fqpath+"@"+this.parent.indexOf(this):""},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_WIDTH_CHANGED,e.EVENT_LABEL_CHANGED,e.EVENT_METADATA_CHANGED,e.EVENT_VISIBILITY_CHANGED,e.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,e.EVENT_RENDERER_TYPE_CHANGED,e.EVENT_GROUP_RENDERER_TYPE_CHANGED,e.EVENT_DIRTY,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getWidth=function(){return this.width},e.prototype.hide=function(){this.setVisible(!1)},e.prototype.show=function(){this.setVisible(!0)},e.prototype.isVisible=function(){return this.visible},e.prototype.getVisible=function(){return this.isVisible()},e.prototype.setVisible=function(t){this.visible!==t&&this.fire([e.EVENT_VISIBILITY_CHANGED,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],this.visible,this.visible=t)},e.prototype.flatten=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=this.getWidth();return t.push({col:this,offset:e,width:i}),i},e.prototype.setWidth=function(t){V(this.width,t,.5)||this.fire([e.EVENT_WIDTH_CHANGED,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],this.width,this.width=t)},e.prototype.setWidthImpl=function(t){this.width=t},e.prototype.setMetaData=function(t){if(t.label!==this.label||this.description!==t.description||this.metadata.summary!==t.summary){var r=this.getMetaData();this.metadata={label:t.label,summary:t.summary,description:t.description},this.fire([e.EVENT_LABEL_CHANGED,e.EVENT_METADATA_CHANGED,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY],r,this.getMetaData())}},e.prototype.getMetaData=function(){return Object.assign({},this.metadata)},e.prototype.sortByMe=function(t,e){void 0===t&&(t=mt(this)),void 0===e&&(e=0);var r=this.findMyRanker();return!!r&&r.sortBy(this,t,e)},e.prototype.groupByMe=function(){var t=this.findMyRanker();return!!t&&t.toggleGrouping(this)},e.prototype.isGroupedBy=function(){var t=this.findMyRanker();return t?t.getGroupCriteria().indexOf(this):-1},e.prototype.toggleMySorting=function(){var t=this.findMyRanker();return!!t&&t.toggleSorting(this)},e.prototype.isSortedByMeImpl=function(t){var e=this,r=this.findMyRanker();if(!r)return{asc:void 0,priority:void 0};var n=t(r),i=n.findIndex((function(t){return t.col===e}));return i<0?{asc:void 0,priority:void 0}:{asc:n[i].asc?"asc":"desc",priority:i}},e.prototype.isSortedByMe=function(){return this.isSortedByMeImpl((function(t){return t.getSortCriteria()}))},e.prototype.groupSortByMe=function(t,e){void 0===t&&(t=mt(this)),void 0===e&&(e=0);var r=this.findMyRanker();return!!r&&r.groupSortBy(this,t,e)},e.prototype.toggleMyGroupSorting=function(){var t=this.findMyRanker();return!!t&&t.toggleGroupSorting(this)},e.prototype.isGroupSortedByMe=function(){return this.isSortedByMeImpl((function(t){return t.getGroupSortCriteria()}))},e.prototype.removeMe=function(){return!this.fixed&&(!!this.parent&&this.parent.remove(this))},e.prototype.attach=function(t){this.parent=t},e.prototype.detach=function(){this.parent=null},e.prototype.insertAfterMe=function(t){return!!this.parent&&null!=this.parent.insertAfter(t,this)},e.prototype.findMyRanker=function(){return this.parent?this.parent.findMyRanker():null},e.prototype.dump=function(t){var e={id:this.id,desc:t(this.desc),width:this.width};return this.label!==(this.desc.label||this.id)&&(e.label=this.label),this.metadata.summary&&(e.summary=this.metadata.summary),this.getRenderer()!==this.desc.type&&(e.renderer=this.getRenderer()),this.getGroupRenderer()!==this.desc.type&&(e.groupRenderer=this.getGroupRenderer()),this.getSummaryRenderer()!==this.desc.type&&(e.summaryRenderer=this.getSummaryRenderer()),e},e.prototype.restore=function(t,e){this.uid=t.id,this.width=t.width||this.width,this.metadata={label:t.label||this.label,summary:t.summary||"",description:this.description},(t.renderer||t.rendererType)&&(this.renderer=t.renderer||t.rendererType||this.renderer),t.groupRenderer&&(this.groupRenderer=t.groupRenderer),t.summaryRenderer&&(this.summaryRenderer=t.summaryRenderer)},e.prototype.getLabel=function(t){var e=this.getValue(t);return null==e?"":String(e)},e.prototype.getValue=function(t){return""},e.prototype.getExportValue=function(t,e){return"text"===e?this.getLabel(t):this.getValue(t)},e.prototype.getColor=function(t){return"#C1C1C1"},e.prototype.toCompareValue=function(t,e){return 0},e.prototype.toCompareValueType=function(){return ot.UINT8},e.prototype.group=function(t,e){return Object.assign({},st)},e.prototype.toCompareGroupValue=function(t,e,r){return e.name.toLowerCase()},e.prototype.toCompareGroupValueType=function(){return ot.STRING},e.prototype.isFiltered=function(){return!1},e.prototype.clearFilter=function(){return!1},e.prototype.filter=function(t,e){return null!=t},e.prototype.getRenderer=function(){return this.renderer},e.prototype.getGroupRenderer=function(){return this.groupRenderer},e.prototype.getSummaryRenderer=function(){return this.summaryRenderer},e.prototype.setRenderer=function(t){t!==this.renderer&&this.fire([e.EVENT_RENDERER_TYPE_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],this.renderer,this.renderer=t)},e.prototype.setGroupRenderer=function(t){t!==this.groupRenderer&&this.fire([e.EVENT_GROUP_RENDERER_TYPE_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],this.groupRenderer,this.groupRenderer=t)},e.prototype.setSummaryRenderer=function(t){t!==this.summaryRenderer&&this.fire([e.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY],this.summaryRenderer,this.summaryRenderer=t)},e.prototype.markDirty=function(t){switch(void 0===t&&(t="all"),t){case"header":return this.fire([e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY]);case"values":return this.fire([e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES,e.EVENT_DIRTY]);default:return this.fire([e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES,e.EVENT_DIRTY])}},e.FLAT_ALL_COLUMNS=-1,e.EVENT_WIDTH_CHANGED="widthChanged",e.EVENT_LABEL_CHANGED="labelChanged",e.EVENT_METADATA_CHANGED="metaDataChanged",e.EVENT_DIRTY="dirty",e.EVENT_DIRTY_HEADER="dirtyHeader",e.EVENT_DIRTY_VALUES="dirtyValues",e.EVENT_DIRTY_CACHES="dirtyCaches",e.EVENT_RENDERER_TYPE_CHANGED="rendererTypeChanged",e.EVENT_GROUP_RENDERER_TYPE_CHANGED="groupRendererChanged",e.EVENT_SUMMARY_RENDERER_TYPE_CHANGED="summaryRendererChanged",e.EVENT_VISIBILITY_CHANGED="visibilityChanged",e}(at),ft=Symbol.for("SupportType"),ht=Symbol.for("Category");function dt(){return Reflect.metadata(ft,!0)}function gt(t){return void 0===t&&(t="ascending"),"descending"===t?Reflect.metadata(Symbol.for("sortDescendingByDefault"),!0):function(t){return t}}function mt(t){var e=t.constructor;return!Reflect.hasMetadata(Symbol.for("sortDescendingByDefault"),e)}var yt,vt,bt=function(){this.string={label:"label",order:1,name:"string",featureLevel:"basic"},this.categorical={label:"categorical",order:2,name:"categorical",featureLevel:"basic"},this.number={label:"numerical",order:3,name:"number",featureLevel:"basic"},this.date={label:"date",order:4,name:"date",featureLevel:"basic"},this.array={label:"matrix",order:5,name:"array",featureLevel:"advanced"},this.map={label:"map",order:6,name:"map",featureLevel:"advanced"},this.composite={label:"combined",order:7,name:"composite",featureLevel:"advanced"},this.support={label:"support",order:8,name:"support",featureLevel:"advanced"},this.other={label:"others",order:9,name:"other",featureLevel:"advanced"}},Et=new bt;function Ct(t){return Reflect.metadata(ht,t)}function Nt(t){var e=Rt(t),r=t.desc.type;return e===Et.string||e===Et.categorical?"abc":e===Et.number||"rank"===r||mt(t)||new Set(["rank","number","numbers","ordinal","boxplot","script","reduce","stack"]).has(r)?"num":void 0}function _t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Reflect.metadata(Symbol.for("toolbarIcon"),t)}function Tt(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return Reflect.metadata(Symbol.for("toolbarDialogAddon"+t),e)}function wt(t){var e=t.constructor;return Reflect.hasMetadata(ft,e)}function Rt(t){var e=Reflect.getMetadata(ht,t instanceof pt?Object.getPrototypeOf(t).constructor:t)||"other";return Et[e]||Et.other}function At(t,e){var r=e["string"==typeof t?t:t.type];return r?Rt(r):Et.other}function Dt(t){return t instanceof pt&&"function"==typeof t.getMapping||!(t instanceof pt)&&St(t)&&(t.type.startsWith("number")||t.type.startsWith("boxplot"))}function St(t){return t instanceof pt&&"function"==typeof t.getNumber||!(t instanceof pt)&&null!=t.type.match(/(number|stack|ordinal)/)}function Mt(t){return"function"==typeof t.getBoxPlotData}function Lt(t){return Mt(t)&&"function"==typeof t.getNumbers}!function(t){t.min="min",t.max="max",t.median="median",t.q1="q1",t.q3="q3"}(yt||(yt={})),function(t){t.min="min",t.max="max",t.median="median",t.q1="q1",t.q3="q3",t.mean="mean"}(vt||(vt={}));var xt=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.accessor=r.accessor||function(){return null},n.loaded=!0!==r.lazyLoaded,n}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_DATA_LOADED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getLabel=function(t){if(!this.isLoaded())return"";var e=this.getValue(t);return null==e?"":String(e)},e.prototype.getRaw=function(t){return this.isLoaded()?this.accessor(t,this.desc):null},e.prototype.getValue=function(t){return this.getRaw(t)},e.prototype.isLoaded=function(){return this.loaded},e.prototype.setLoaded=function(t){this.loaded!==t&&this.fire([e.EVENT_DATA_LOADED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.loaded,this.loaded=t)},e.prototype.getRenderer=function(){return this.isLoaded()?t.prototype.getRenderer.call(this):e.RENDERER_LOADING},e.prototype.dump=function(r){var n=t.prototype.dump.call(this,r);return n.loaded=this.loaded,this.loaded||n.renderer!==e.RENDERER_LOADING||delete n.renderer,n},e.prototype.restore=function(e,r){void 0!==e.loaded&&(this.loaded=e.loaded),t.prototype.restore.call(this,e,r)},e.EVENT_DATA_LOADED="dataLoaded",e.RENDERER_LOADING="loading",e}(pt),Ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._children=[],e}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_FILTER_CHANGED,r.EVENT_ADD_COLUMN,r.EVENT_MOVE_COLUMN,r.EVENT_REMOVE_COLUMN])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.assignNewId=function(e){t.prototype.assignNewId.call(this,e),this._children.forEach((function(t){return t.assignNewId(e)}))},Object.defineProperty(e.prototype,"children",{get:function(){return this._children.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._children.length},enumerable:!0,configurable:!0}),e.prototype.flatten=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=0;return(0===r||r<=pt.FLAT_ALL_COLUMNS)&&(i=this.getWidth(),t.push({col:this,offset:e,width:i}),0===r)||this._children.forEach((function(i){i.isVisible()&&r<=pt.FLAT_ALL_COLUMNS&&i.flatten(t,e,r-1,n)})),i},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.children=this._children.map((function(t){return t.dump(e)})),r},e.prototype.restore=function(e,r){var n=this;e.children.map((function(t){var e=r(t);e&&n.push(e)})),t.prototype.restore.call(this,e,r)},e.prototype.insert=function(t,e){return!St(t)&&this.canJustAddNumbers?null:(this._children.splice(e,0,t),this.insertImpl(t,e))},e.prototype.move=function(t,e){if(t.parent!==this)return null;var r=this._children.indexOf(t);return e===r?t:(this._children.splice(r,1),this._children.splice(r<e?e-1:e,0,t),this.moveImpl(t,e,r))},e.prototype.insertImpl=function(t,e){return t.attach(this),this.forward.apply(this,[t].concat(it(".combine",pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY,r.EVENT_FILTER_CHANGED,pt.EVENT_RENDERER_TYPE_CHANGED,pt.EVENT_GROUP_RENDERER_TYPE_CHANGED))),this.fire([r.EVENT_ADD_COLUMN,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],t,e),t},e.prototype.moveImpl=function(t,e,n){return this.fire([r.EVENT_MOVE_COLUMN,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY,pt.EVENT_RENDERER_TYPE_CHANGED,pt.EVENT_GROUP_RENDERER_TYPE_CHANGED],t,e,n),t},e.prototype.push=function(t){return this.insert(t,this._children.length)},e.prototype.at=function(t){return this._children[t]},e.prototype.indexOf=function(t){return this._children.indexOf(t)},e.prototype.insertAfter=function(t,e){var r=this.indexOf(e);return r<0?null:this.insert(t,r+1)},e.prototype.moveAfter=function(t,e){var r=this.indexOf(e);return r<0?null:this.move(t,r+1)},e.prototype.remove=function(t){var e=this._children.indexOf(t);return!(e<0)&&(this._children.splice(e,1),this.removeImpl(t,e))},e.prototype.removeImpl=function(t,e){return t.detach(),this.unforward.apply(this,[t].concat(it(".combine",pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY,r.EVENT_FILTER_CHANGED))),this.fire([r.EVENT_REMOVE_COLUMN,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],t,e),!0},e.prototype.isFiltered=function(){return this._children.some((function(t){return t.isFiltered()}))},e.prototype.clearFilter=function(){return this._children.map((function(t){return t.clearFilter()})).some((function(t){return t}))},e.prototype.filter=function(t){return this._children.every((function(e){return e.filter(t)}))},e.prototype.isLoaded=function(){return this._children.every((function(t){return!(t instanceof xt||t instanceof r)||t.isLoaded()}))},Object.defineProperty(e.prototype,"canJustAddNumbers",{get:function(){return!1},enumerable:!0,configurable:!0}),e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_ADD_COLUMN="addColumn",e.EVENT_MOVE_COLUMN="moveColumn",e.EVENT_REMOVE_COLUMN="removeColumn",e=r=a([_t("compositeContained","splitCombined"),Ct("composite")],e)}(pt),Vt=function(t){for(var e=t.length/6|0,r=new Array(e),n=0;n<e;)r[n]="#"+t.slice(6*n,6*++n);return r},It=Vt("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),kt=Vt("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Gt=Vt("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Ht=(Vt("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Vt("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2")),Pt=Vt("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Ft=Vt("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Ut=Vt("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Bt=Vt("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),jt=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t};function Yt(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Wt(){}var zt="\\s*([+-]?\\d+)\\s*",qt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xt=/^#([0-9a-f]{3})$/,$t=/^#([0-9a-f]{6})$/,Jt=new RegExp("^rgb\\("+[zt,zt,zt]+"\\)$"),Qt=new RegExp("^rgb\\("+[Kt,Kt,Kt]+"\\)$"),Zt=new RegExp("^rgba\\("+[zt,zt,zt,qt]+"\\)$"),te=new RegExp("^rgba\\("+[Kt,Kt,Kt,qt]+"\\)$"),ee=new RegExp("^hsl\\("+[qt,Kt,Kt]+"\\)$"),re=new RegExp("^hsla\\("+[qt,Kt,Kt,qt]+"\\)$"),ne={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 ie(t){var e;return t=(t+"").trim().toLowerCase(),(e=Xt.exec(t))?new le((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=$t.exec(t))?oe(parseInt(e[1],16)):(e=Jt.exec(t))?new le(e[1],e[2],e[3],1):(e=Qt.exec(t))?new le(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Zt.exec(t))?ae(e[1],e[2],e[3],e[4]):(e=te.exec(t))?ae(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ee.exec(t))?pe(e[1],e[2]/100,e[3]/100,1):(e=re.exec(t))?pe(e[1],e[2]/100,e[3]/100,e[4]):ne.hasOwnProperty(t)?oe(ne[t]):"transparent"===t?new le(NaN,NaN,NaN,0):null}function oe(t){return new le(t>>16&255,t>>8&255,255&t,1)}function ae(t,e,r,n){return n<=0&&(t=e=r=NaN),new le(t,e,r,n)}function se(t){return t instanceof Wt||(t=ie(t)),t?new le((t=t.rgb()).r,t.g,t.b,t.opacity):new le}function ue(t,e,r,n){return 1===arguments.length?se(t):new le(t,e,r,null==n?1:n)}function le(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function ce(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function pe(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new de(t,e,r,n)}function fe(t){if(t instanceof de)return new de(t.h,t.s,t.l,t.opacity);if(t instanceof Wt||(t=ie(t)),!t)return new de;if(t instanceof de)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(r-n)/s+6*(r<n):r===o?(n-e)/s+2:(e-r)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new de(a,s,u,t.opacity)}function he(t,e,r,n){return 1===arguments.length?fe(t):new de(t,e,r,null==n?1:n)}function de(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function ge(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}jt(Wt,ie,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),jt(le,ue,Yt(Wt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new le(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new le(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+ce(this.r)+ce(this.g)+ce(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),jt(de,he,Yt(Wt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new de(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new de(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new le(ge(t>=240?t-240:t+120,i,n),ge(t,i,n),ge(t<120?t+240:t-120,i,n),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}}));var me=Math.PI/180,ye=180/Math.PI;function ve(t){if(t instanceof Ee)return new Ee(t.l,t.a,t.b,t.opacity);if(t instanceof Ae){if(isNaN(t.h))return new Ee(t.l,0,0,t.opacity);var e=t.h*me;return new Ee(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof le||(t=se(t));var r,n,i=Te(t.r),o=Te(t.g),a=Te(t.b),s=Ce((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?r=n=s:(r=Ce((.4360747*i+.3850649*o+.1430804*a)/.96422),n=Ce((.0139322*i+.0971045*o+.7141733*a)/.82521)),new Ee(116*s-16,500*(r-s),200*(s-n),t.opacity)}function be(t,e,r,n){return 1===arguments.length?ve(t):new Ee(t,e,r,null==n?1:n)}function Ee(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Ce(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function Ne(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function _e(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Te(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function we(t){if(t instanceof Ae)return new Ae(t.h,t.c,t.l,t.opacity);if(t instanceof Ee||(t=ve(t)),0===t.a&&0===t.b)return new Ae(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ye;return new Ae(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Re(t,e,r,n){return 1===arguments.length?we(t):new Ae(t,e,r,null==n?1:n)}function Ae(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}jt(Ee,be,Yt(Wt,{brighter:function(t){return new Ee(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Ee(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new le(_e(3.1338561*(e=.96422*Ne(e))-1.6168667*(t=1*Ne(t))-.4906146*(r=.82521*Ne(r))),_e(-.9787684*e+1.9161415*t+.033454*r),_e(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),jt(Ae,Re,Yt(Wt,{brighter:function(t){return new Ae(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Ae(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ve(this).rgb()}}));var De=-.14861,Se=1.78277,Me=-.29227,Le=-.90649,xe=1.97294,Oe=xe*Le,Ve=xe*Se,Ie=Se*Me-Le*De;function ke(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);t instanceof le||(t=se(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(Ie*n+Oe*e-Ve*r)/(Ie+Oe-Ve),o=n-i,a=(xe*(r-i)-Me*o)/Le,s=Math.sqrt(a*a+o*o)/(xe*i*(1-i)),u=s?Math.atan2(a,o)*ye-120:NaN;return new He(u<0?u+360:u,s,i,t.opacity)}function Ge(t,e,r,n){return 1===arguments.length?ke(t):new He(t,e,r,null==n?1:n)}function He(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Pe(t,e,r,n,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*r+(1+3*t+3*o-3*a)*n+a*i)/6}jt(He,Ge,Yt(Wt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new He(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new He(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*me,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new le(255*(e+r*(De*n+Se*i)),255*(e+r*(Me*n+Le*i)),255*(e+r*(xe*n)),this.opacity)}}));var Fe=function(t){return function(){return t}};function Ue(t,e){return function(r){return t+r*e}}function Be(t,e){var r=e-t;return r?Ue(t,r>180||r<-180?r-360*Math.round(r/360):r):Fe(isNaN(t)?e:t)}function je(t){return 1==(t=+t)?Ye:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Fe(isNaN(e)?r:e)}}function Ye(t,e){var r=e-t;return r?Ue(t,r):Fe(isNaN(t)?e:t)}var We=function t(e){var r=je(e);function n(t,e){var n=r((t=ue(t)).r,(e=ue(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=Ye(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function ze(t){return function(e){var r,n,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=ue(e[r]),o[r]=n.r||0,a[r]=n.g||0,s[r]=n.b||0;return o=t(o),a=t(a),s=t(s),n.opacity=1,function(t){return n.r=o(t),n.g=a(t),n.b=s(t),n+""}}}var qe=ze((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=n<e-1?t[n+2]:2*o-i;return Pe((r-n/e)*e,a,i,o,s)}})),Ke=(ze((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),i=t[(n+e-1)%e],o=t[n%e],a=t[(n+1)%e],s=t[(n+2)%e];return Pe((r-n/e)*e,i,o,a,s)}})),function(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,o=new Array(i),a=new Array(n);for(r=0;r<i;++r)o[r]=or(t[r],e[r]);for(;r<n;++r)a[r]=e[r];return function(t){for(r=0;r<i;++r)a[r]=o[r](t);return a}}),Xe=function(t,e){var r=new Date;return e-=t=+t,function(n){return r.setTime(t+e*n),r}},$e=function(t,e){return e-=t=+t,function(r){return t+e*r}},Je=function(t,e){var r,n={},i={};for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=or(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}},Qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ze=new RegExp(Qe.source,"g");var tr,er,rr,nr,ir=function(t,e){var r,n,i,o=Qe.lastIndex=Ze.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(r=Qe.exec(t))&&(n=Ze.exec(e));)(i=n.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:$e(r,n)})),o=Ze.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var r,n=0;n<e;++n)s[(r=u[n]).i]=r.x(t);return s.join("")})},or=function(t,e){var r,n=typeof e;return null==e||"boolean"===n?Fe(e):("number"===n?$e:"string"===n?(r=ie(e))?(e=r,We):ir:e instanceof ie?We:e instanceof Date?Xe:Array.isArray(e)?Ke:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Je:$e)(t,e)},ar=function(t,e){return e-=t=+t,function(r){return Math.round(t+e*r)}},sr=180/Math.PI,ur={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},lr=function(t,e,r,n,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*r+e*n)&&(r-=t*u,n-=e*u),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,u/=s),t*n<e*r&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*sr,skewX:Math.atan(u)*sr,scaleX:a,scaleY:s}};function cr(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,n,i,o,a,s){if(t!==i||n!==o){var u=a.push("translate(",null,e,null,r);s.push({i:u-4,x:$e(t,i)},{i:u-2,x:$e(n,o)})}else(i||o)&&a.push("translate("+i+e+o+r)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,r,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:r.push(i(r)+"rotate(",null,n)-2,x:$e(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(o.rotate,a.rotate,s,u),function(t,e,r,o){t!==e?o.push({i:r.push(i(r)+"skewX(",null,n)-2,x:$e(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(o.skewX,a.skewX,s,u),function(t,e,r,n,o,a){if(t!==r||e!==n){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:$e(t,r)},{i:s-2,x:$e(e,n)})}else 1===r&&1===n||o.push(i(o)+"scale("+r+","+n+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,r=-1,n=u.length;++r<n;)s[(e=u[r]).i]=e.x(t);return s.join("")}}}cr((function(t){return"none"===t?ur:(tr||(tr=document.createElement("DIV"),er=document.documentElement,rr=document.defaultView),tr.style.transform=t,t=rr.getComputedStyle(er.appendChild(tr),null).getPropertyValue("transform"),er.removeChild(tr),t=t.slice(7,-1).split(","),lr(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),cr((function(t){return null==t?ur:(nr||(nr=document.createElementNS("http://www.w3.org/2000/svg","g")),nr.setAttribute("transform",t),(t=nr.transform.baseVal.consolidate())?(t=t.matrix,lr(t.a,t.b,t.c,t.d,t.e,t.f)):ur)}),", ",")",")"),Math.SQRT2;function pr(t){return function(e,r){var n=t((e=he(e)).h,(r=he(r)).h),i=Ye(e.s,r.s),o=Ye(e.l,r.l),a=Ye(e.opacity,r.opacity);return function(t){return e.h=n(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}pr(Be),pr(Ye);function fr(t){return function(e,r){var n=t((e=Re(e)).h,(r=Re(r)).h),i=Ye(e.c,r.c),o=Ye(e.l,r.l),a=Ye(e.opacity,r.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}fr(Be),fr(Ye);function hr(t){return function e(r){function n(e,n){var i=t((e=Ge(e)).h,(n=Ge(n)).h),o=Ye(e.s,n.s),a=Ye(e.l,n.l),s=Ye(e.opacity,n.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,r)),e.opacity=s(t),e+""}}return r=+r,n.gamma=e,n}(1)}hr(Be);var dr=hr(Ye);var gr=function(t){return qe(t[t.length-1])},mr=gr(new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Vt)),yr=gr(new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Vt)),vr=gr(new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Vt)),br=gr(new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Vt)),Er=gr(new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Vt)),Cr=gr(new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Vt)),Nr=gr(new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Vt)),_r=gr(new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Vt)),Tr=gr(new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Vt)),wr=gr(new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Vt)),Rr=gr(new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Vt)),Ar=gr(new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Vt)),Dr=gr(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Vt)),Sr=gr(new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Vt)),Mr=gr(new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Vt)),Lr=gr(new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Vt)),xr=gr(new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Vt)),Or=gr(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Vt)),Vr=gr(new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Vt)),Ir=gr(new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Vt)),kr=gr(new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Vt)),Gr=gr(new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Vt)),Hr=gr(new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Vt)),Pr=gr(new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Vt)),Fr=gr(new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Vt)),Ur=gr(new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Vt)),Br=gr(new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Vt)),jr=dr(Ge(300,.5,0),Ge(-240,.5,1)),Yr=dr(Ge(-100,.75,.35),Ge(80,1.5,.8)),Wr=dr(Ge(260,.75,.35),Ge(80,1.5,.8)),zr=Ge(),qr=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return zr.h=360*t-100,zr.s=1.5-1.5*e,zr.l=.8-.9*e,zr+""};ue(),Math.PI,Math.PI;function Kr(t){var e=t.length;return function(r){return t[Math.max(0,Math.min(e-1,Math.floor(r*e)))]}}var Xr=Kr(Vt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),$r=Kr(Vt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jr=Kr(Vt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Qr=Kr(Vt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Zr=function(){function t(t){void 0===t&&(t=[]),this[Symbol.toStringTag]=Symbol("OrderedSet"),this.set=new Set,this.list=[],this.addAll(Array.isArray(t)?t:Array.from(t))}return Object.defineProperty(t.prototype,"size",{get:function(){return this.set.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.set.clear(),this.list.splice(0,this.list.length)},t.prototype.addAll=function(t){var e=this;return t.forEach((function(t){return e.add(t)})),this},t.prototype.add=function(t){return this.set.has(t)||(this.set.add(t),this.list.push(t)),this},t.prototype.has=function(t){return this.set.has(t)},t.prototype.delete=function(t){if(!this.set.delete(t))return!1;var e=this.list.indexOf(t);return console.assert(e>=0),this.list.splice(e,1),!0},t.prototype.deleteAll=function(t){var e=this;return t.reduce((function(t,r){return e.delete(r)&&t}),!0)},t.prototype.forEach=function(t,e){this.list.forEach((function(e){t.call(this,e,e,this)}),e)},t.prototype[Symbol.iterator]=function(){return this.list[Symbol.iterator]()},t}();function tn(t,e){return void 0===e&&(e={}),Object.keys(e).forEach((function(r){var n=r;void 0===t[n]&&(t[n]=e[n])})),t}function en(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new(Function.bind.apply(Function,[void 0,"value"].concat(e,["\n  const escapedValue = encodeURIComponent(String(value));\n  return `"+t+"`;\n "])))}function rn(t){if(0===t.length)return o({},st);if(1===t.length&&!t[0].parent)return o({},t[0]);for(var e=[],r=0,n=t;r<n.length;r++){for(var i=n[r],a=[],s=i;s.parent;)a.unshift(s.parent),s=s.parent;e.push.apply(e,a),e.push(Object.assign({subGroups:[]},i))}return e.slice(1).forEach((function(t,r){t.parent=e[r],t.name=e[r].name+" ∩ "+t.name,t.color="#C1C1C1"!==t.color?t.color:t.parent.color,e[r].subGroups=[t]})),e[e.length-1]}function nn(t){var e=Object.assign({},t);return delete e.order,an(e)&&(e.subGroups=[]),e.parent&&(e.parent=nn(e.parent),e.parent.subGroups.push(e)),e}function on(t){return t.name}function an(t){return null!=t.subGroups}function sn(t){for(var e=new Zr,r=0,n=t;r<n.length;r++){for(var i=n[r];i.parent;)i=i.parent;e.add(i)}return Array.from(e)}var un=It.concat(Bt),ln=un.length;function cn(){var t=0;return function(){return un[t++%un.length]}}function pn(t,e){for(var r=[],n=0;n<t.length;++n)r.push(e(t[n],n));return r}function fn(t,e){for(var r=0;r<t.length;++r)if(!e(t[r],r))return!1;return!0}function hn(t,e){for(var r=0;r<t.length;++r)e(t[r],r)}function dn(t){return null==t||"number"!=typeof t&&!isNaN(t)?ot.UINT32:length<=255?ot.UINT8:length<=65535?ot.UINT16:ot.UINT32}var gn={apply:function(t){return t?t.color:"#C1C1C1"},toJSON:function(){return null},clone:function(){return gn},eq:function(t){return t===gn}},mn=function(){function t(t){this.map=new Map(Array.from(t.entries()).map((function(t){var e=t[0],r=t[1];return["string"==typeof e?e:e.name,r]})))}return t.prototype.apply=function(t){return this.map.has(t.name)?this.map.get(t.name):gn.apply(t)},t.prototype.toJSON=function(){var t={};return this.map.forEach((function(e,r){return t[r]=e})),{type:"replace",map:t}},t.prototype.clone=function(){return new t(new Map(this.map.entries()))},t.prototype.eq=function(e){var r=this;return e instanceof t&&(e.map.size===this.map.size&&Array.from(this.map.keys()).every((function(t){return r.map.get(t)===e.map.get(t)})))},t.restore=function(e,r){"replace"===e.type&&(e=e.map);for(var n=new Map(r.map((function(t){return[t.name,t]}))),i=new Map,o=0,a=Object.keys(e);o<a.length;o++){var s=a[o];n.has(s)&&i.set(n.get(s),e[s])}return new t(i)},t}();function yn(t,e){return t?mn.restore(t,e):gn}function vn(t){if(null==t||void 0===t||""===t||"NA"===t||"na"===t||"Na"===t||"nA"===t||"NaN"===t||"number"==typeof t&&isNaN(t))return!0;if(!Array.isArray(t))return!1;for(var e=0,r=t;e<r.length;e++){if(!vn(r[e]))return!1}return!0}function bn(t){return null==t||void 0===t||isNaN(t)}var En={name:"Missing values",color:"gray"};function Cn(t,e,r){if(void 0===r&&(r=function(){return"#C1C1C1"}),"string"==typeof t)return{name:t,label:t,color:r(),value:e};var n=null==t.name?String(t.value):t.name;return{name:n,label:t.label||n,color:t.color||r(),value:null!=t.value?t.value:e}}var Nn=ot.FLOAT_ASC;function _n(t,e,r){if(s(t))return[NaN,null];var n=function(t,e){var r=new Map;if(e?e.forEach((function(t){r.set(t,(r.get(t)||0)+1)})):t.forEach((function(t){r.set(t,(r.get(t)||0)+1)})),0===r.size)return{cat:null,count:0};var n=null,i=0;return r.forEach((function(t,e){t>i&&(n=e,i=t)})),{cat:n,count:i}}(t.map((function(t){return e.getCategory(t)})),r);return null==n.cat?[NaN,null]:[n.cat.value,n.cat.name.toLowerCase()]}var Tn=[ot.FLOAT,ot.STRING];function wn(t,e){var r=null==t||isNaN(t.value),n=null==e||isNaN(e.value);return r||null==t?n?0:1:n||null==e?-1:t.value===e.value?t.label.toLowerCase().localeCompare(e.label.toLowerCase()):t.value-e.value}function Rn(t){if(!t.categories)return[];var e=cn(),r=t.categories.length-1;return t.categories.map((function(t,n){return Cn(t,n/r,e)})).sort(wn)}function An(t){return null==t||!t.filterMissing&&(null==t.filter||""===t.filter)}function Dn(t,e){return t===e||(null==t||null==e?An(t)===An(e):t.filterMissing===e.filterMissing&&typeof t.filter==typeof e.filter&&Array.isArray(t.filter)===Array.isArray(e.filter)&&(Array.isArray(t.filter)?function(t,e){var r=null!=t?t.length:0,n=null!=e?e.length:0;if(r!==n)return!1;if(0===r)return!0;return t.every((function(t,r){return t===e[r]}))}(t.filter,e.filter):String(t.filter)===String(e.filter)))}function Sn(t,e){if(null==t)return!0;if(null==e||isNaN(e.value))return!t.filterMissing;var r=t.filter;return Array.isArray(r)?r.includes(e.name):"string"==typeof r&&r.length>0?e.name.toLowerCase().includes(r.toLowerCase()):!(r instanceof RegExp)||r.test(e.name)}var Mn=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.lookup=new Map,n.currentFilter=null,n.categories=Rn(r),n.categories.forEach((function(t){return n.lookup.set(t.name,t)})),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_FILTER_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getCategory(t);return e?e.name:null},e.prototype.getCategory=function(e){var r=t.prototype.getValue.call(this,e);if(!r)return null;var n=String(r);return this.lookup.has(n)?this.lookup.get(n):null},Object.defineProperty(e.prototype,"dataLength",{get:function(){return this.categories.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labels",{get:function(){return this.categories.map((function(t){return t.label}))},enumerable:!0,configurable:!0}),e.prototype.getLabel=function(t){var e=this.getCategory(t);return e?e.label:""},e.prototype.getCategories=function(t){return[this.getCategory(t)]},e.prototype.getValues=function(t){var e=this.getCategory(t);return this.categories.map((function(t){return t===e}))},e.prototype.getLabels=function(t){return this.getValues(t).map(String)},e.prototype.getMap=function(t){var e=this.categories;return this.getValues(t).map((function(t,r){return{key:e[r].label,value:t}}))},e.prototype.getMapLabel=function(t){var e=this.categories;return this.getLabels(t).map((function(t,r){return{key:e[r].label,value:t}}))},e.prototype.getSet=function(t){var e=this.getCategory(t),r=new Set;return e&&r.add(e),r},e.prototype.iterCategory=function(t){return[this.getCategory(t)]},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.filter=this.currentFilter,r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){if(t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories),void 0!==e.filter){var n=e.filter;"string"==typeof n||Array.isArray(n)?this.currentFilter={filter:n,filterMissing:!1}:this.currentFilter=n}else this.currentFilter=null},e.prototype.getColor=function(t){var e=this.getCategory(t);return e?this.colorMapping.apply(e):"#C1C1C1"},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t,e){return Sn(this.currentFilter,void 0!==e?e:this.getCategory(t))},e.prototype.getFilter=function(){return null==this.currentFilter?null:Object.assign({},this.currentFilter)},e.prototype.setFilter=function(t){Dn(this.currentFilter,t)||this.fire([r.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.currentFilter,this.currentFilter=t)},e.prototype.clearFilter=function(){var t=this.isFiltered();return this.setFilter(null),t},e.prototype.toCompareValue=function(t,e){return null==(r=void 0!==e?e:this.getCategory(t))?NaN:r.value;var r},e.prototype.toCompareValueType=function(){return Nn},e.prototype.group=function(t,e){var r=void 0!==e?e:this.getCategory(t);return r?{name:r.label,color:r.color}:Object.assign({},En)},e.prototype.toCompareGroupValue=function(t,e,r){return _n(t,this,r)},e.prototype.toCompareGroupValueType=function(){return Tn},e.prototype.getGroupRenderer=function(){var e=t.prototype.getGroupRenderer.call(this);return e===this.desc.type&&this.isGroupedBy()>=0?"catdistributionbar":e},e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_COLOR_MAPPING_CHANGED="colorMappingChanged",e=r=a([_t("rename","clone","sort","sortBy","group","groupBy","sortGroupBy","filterCategorical","colorMappedCategorical"),Ct("categorical")],e)}(xt),Ln=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"upset",groupRenderer:"upset",summaryRenderer:"categorical"}))||this;return n.lookup=new Map,n.currentFilter=null,n.separator=new RegExp(r.separator||";"),n.categories=Rn(r),n.categories.forEach((function(t){return n.lookup.set(t.name,t)})),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},Object.defineProperty(e.prototype,"labels",{get:function(){return this.categories.map((function(t){return t.label}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataLength",{get:function(){return this.categories.length},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.getSortedSet(t);return 0===e.length?null:e.map((function(t){return t.name}))},e.prototype.getLabel=function(t){return"("+this.getSortedSet(t).map((function(t){return t.label})).join(",")+")"},e.prototype.normalize=function(t){return"string"==typeof t?t.split(this.separator).map((function(t){return t.trim()})):Array.isArray(t)?t.map((function(t){return String(t).trim()})):t instanceof Set?Array.from(t).map(String):[]},e.prototype.getSet=function(e){var r=this,n=this.normalize(t.prototype.getValue.call(this,e)),i=new Set;return n.forEach((function(t){var e=r.lookup.get(t);e&&i.add(e)})),i},e.prototype.getSortedSet=function(t){return Array.from(this.getSet(t)).sort((function(t,e){return t.value===e.value?t.label.localeCompare(e.label):t.value-e.value}))},e.prototype.getCategories=function(t){return this.getSortedSet(t)},e.prototype.getColors=function(t){var e=this;return this.getSortedSet(t).map((function(t){return e.colorMapping.apply(t)}))},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){return Mn.prototype.setColorMapping.call(this,t)},e.prototype.getValues=function(t){var e=this.getSet(t);return this.categories.map((function(t){return e.has(t)}))},e.prototype.getLabels=function(t){return this.getValues(t).map(String)},e.prototype.getMap=function(t){return this.getSortedSet(t).map((function(t){return{key:t.label,value:!0}}))},e.prototype.getMapLabel=function(t){return this.getSortedSet(t).map((function(t){return{key:t.label,value:"true"}}))},e.prototype.iterCategory=function(t){var e=this.getSet(t);return e.size>0?Array.from(e):[null]},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.filter=this.currentFilter,r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){if(t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories),"filter"in e){var n=e.filter;"string"==typeof n||Array.isArray(n)?this.currentFilter={filter:n,filterMissing:!1,mode:"some"}:this.currentFilter=n}else this.currentFilter=null},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t){var e=this;if(!this.currentFilter)return!0;var r=Array.from(this.getSet(t));return 0===r.length?Sn(this.currentFilter,null):"every"===this.currentFilter.mode?r.every((function(t){return Sn(e.currentFilter,t)})):r.some((function(t){return Sn(e.currentFilter,t)}))},e.prototype.getFilter=function(){return null==this.currentFilter?null:Object.assign({},this.currentFilter)},e.prototype.setFilter=function(t){var e,r;Dn(e=this.currentFilter,r=t)&&(e&&e.mode?e.mode:"every")===(r&&r.mode?r.mode:"every")||this.fire([Mn.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.currentFilter,this.currentFilter=t)},e.prototype.clearFilter=function(){return Mn.prototype.clearFilter.call(this)},e.prototype.toCompareValue=function(t){for(var e=this.getSet(t),r=[e.size],n=0,i=this.categories;n<i.length;n++){var o=i[n];r.push(e.has(o)?1:0)}return r},e.prototype.toCompareValueType=function(){return[dn(this.categories.length)].concat(this.categories.map((function(){return ot.BINARY})))},e.prototype.group=function(t){var e=this.getSet(t),r=e.size,n=this.categories.filter((function(t){return e.has(t)})),i={name:0===n.length?"None":n.map((function(t){return t.name})).join(", "),color:1===n.length?n[0].color:"#C1C1C1"};return i.parent={name:"#"+r,color:"#C1C1C1",subGroups:[i]},i},e.EVENT_FILTER_CHANGED=Mn.EVENT_FILTER_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=Mn.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterCategorical","colorMappedCategorical","group","groupBy"),Ct("categorical")],e)}(xt),xn=new Map;function On(t,e){return void 0===e&&(e=""),"$"===t[0]&&(t=t.slice(1)),xn.has(t)?xn.get(t):e}var Vn,In=parseInt(On("lu_engine_grip_gap","5px"),10),kn=parseFloat(On("lu_filtered_opacity","0.2")),Gn={width:parseInt(On("lu_missing_dash_width","3px"),10),height:parseInt(On("lu_missing_dash_height","10px"),10),color:On("lu_missing_dash_color","gray")},Hn={color:On("lu_renderer_upset_color"),inactive:parseFloat(On("lu_renderer_upset_inactive_opacity","0.1"))},Pn={color:On("lu_renderer_dot_color","gray"),size:parseInt(On("lu_renderer_dot_size","5px"),10),opacity:parseFloat(On("lu_renderer_dot_opacity","0.5"))},Fn={box:On("lu_renderer_boxplot_box","#e0e0e0"),stroke:On("lu_renderer_boxplot_stroke","black"),sort:On("lu_renderer_boxplot_sort_indicator","#ffa500"),outlier:On("lu_renderer_boxplot_outlier","#e0e0e0")},Un={width:parseInt(On("lu_aggregate_square_bracket_width","4px"),10),strokeWidth:parseInt(On("lu_aggregate_square_bracket_stroke_width","2px"),10),color:On("lu_aggregate_square_bracket_stroke_color","#000"),levelOffset:parseInt(On("lu_aggregate_level_offset","2px"),10),levelWidth:parseInt(On("lu_aggregate_level_width","22px"),10)},Bn=parseInt(On("lu_slope_width","200px"),10),jn=On("lu_css_prefix","lu"),Yn=parseInt(On("lu_engine_resize_space","50px"),10),Wn=parseInt(On("lu_engine_resize_animation_duration","1000ms"),10),zn=parseInt(On("lu_aggregate_level_width","22px"),10);function qn(t){return t?jn+"-"+t:jn}function Kn(t){return t?"le-"+t:"le"}function Xn(t){return'<span class="'+qn("aria")+'" aria-hidden="true">'+t+"</span>"}function $n(t){return void 0===t&&(t="Aggregate Groups"),{type:"aggregate",label:t,fixed:!0}}!function(t){t.COLLAPSE="collapse",t.EXPAND="expand",t.EXPAND_TOP_N="expand_top"}(Vn||(Vn={}));var Jn,Qn=function(t){function e(e,r){return t.call(this,e,tn(r,{width:2*zn}))||this}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"frozen",{get:function(){return!1!==this.desc.frozen},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_AGGREGATE])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.isAggregated=function(t){var e=this.findMyRanker();return!!this.desc.isAggregated&&this.desc.isAggregated(e,t)},e.prototype.setAggregated=function(t,e){var n="boolean"==typeof e?e?Vn.EXPAND:Vn.COLLAPSE:e,i=this.findMyRanker();return(this.desc.isAggregated&&this.desc.isAggregated(i,t))===n||(this.desc.setAggregated&&this.desc.setAggregated(i,t,n),this.fire(r.EVENT_AGGREGATE,i,t,n!==Vn.COLLAPSE,n),!1)},e.EVENT_AGGREGATE="aggregate",e=r=a([_t("setShowTopN","rename"),dt(),Ct("support")],e)}(pt);!function(t){t.UNKNOWN="unknown",t.FILTER_CHANGED="filter",t.SORT_CRITERIA_CHANGED="sort_changed",t.SORT_CRITERIA_DIRTY="sort_dirty",t.GROUP_CRITERIA_CHANGED="group_changed",t.GROUP_CRITERIA_DIRTY="group_dirty",t.GROUP_SORT_CRITERIA_CHANGED="group_sort_changed",t.GROUP_SORT_CRITERIA_DIRTY="group_sort_dirty"}(Jn||(Jn={}));var Zn=function(t){function e(r){var n=t.call(this)||this;return n.id=r,n.sortCriteria=[],n.groupColumns=[],n.groupSortCriteria=[],n.columns=[],n.dirtyOrder=function(t){n.fire([e.EVENT_DIRTY_ORDER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t)},n.dirtyOrderSortDirty=function(){return n.dirtyOrder([Jn.SORT_CRITERIA_DIRTY])},n.dirtyOrderGroupDirty=function(){return n.dirtyOrder([Jn.GROUP_CRITERIA_DIRTY])},n.dirtyOrderGroupSortDirty=function(){return n.dirtyOrder([Jn.GROUP_SORT_CRITERIA_DIRTY])},n.dirtyOrderFiltering=function(){return n.dirtyOrder([Jn.FILTER_CHANGED])},n.groups=[Object.assign({order:[]},st)],n.order=[],n.index2pos=[],n.id=q(r),n.label="Ranking "+(r.startsWith("rank")?r.slice(4):r),n}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_WIDTH_CHANGED,e.EVENT_FILTER_CHANGED,e.EVENT_LABEL_CHANGED,e.EVENT_GROUPS_CHANGED,e.EVENT_ADD_COLUMN,e.EVENT_REMOVE_COLUMN,e.EVENT_GROUP_CRITERIA_CHANGED,e.EVENT_MOVE_COLUMN,e.EVENT_DIRTY,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES,e.EVENT_GROUP_SORT_CRITERIA_CHANGED,e.EVENT_COLUMN_VISIBILITY_CHANGED,e.EVENT_SORT_CRITERIA_CHANGED,e.EVENT_DIRTY_ORDER,e.EVENT_ORDER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.assignNewId=function(t){this.id=q(t()),this.columns.forEach((function(e){return e.assignNewId(t)}))},e.prototype.getLabel=function(){return this.label},e.prototype.setLabel=function(t){t!==this.label&&this.fire(e.EVENT_LABEL_CHANGED,this.label,this.label=t)},e.prototype.setGroups=function(t,r,n){var i=this.order,o=this.groups;if(this.groups=t,this.index2pos=r,this.order=H(t.map((function(t){return t.order}))),t.length>1)this.unifyGroups(t);else if(1===t.length)for(var a=t[0].parent;a;)a.order=this.order,a=a.parent;this.fire([e.EVENT_ORDER_CHANGED,e.EVENT_GROUPS_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],i,this.order,o,t,n)},e.prototype.unifyGroups=function(t){for(var e=0,r=this.order,n=new Map,i=0,o=t;i<o.length;i++){var a=o[i],s=a.order.length;a.order=r.subarray(e,e+s),n.set(a,{offset:e,size:s}),e+=s}for(var u=sn(t),l=function(t){if(n.has(t))return n.get(t);var e=t.subGroups.map((function(t){return l(t)})),i=e.length>0?e[0].offset:0,o=e.reduce((function(t,e){return t+e.size}),0),a={offset:i,size:o};return n.set(t,a),t.order=r.subarray(i,i+o),a},c=0,p=u;c<p.length;c++){var f=p[c];l(f)}},e.prototype.getRank=function(t){if(t<0||t>this.index2pos.length)return-1;var e=this.index2pos[t];return null!=e&&!isNaN(e)&&e>0?e:-1},e.prototype.getOrder=function(){return this.order},e.prototype.getOrderLength=function(){return this.order.length},e.prototype.getGroups=function(){return this.groups.slice()},e.prototype.getFlatGroups=function(){var t,e,r,n=[];return t=this.groups,e=function(t){n.push(t)},r=function(t){!1!==e(t)&&an(t)&&t.subGroups.forEach(r)},sn(t).forEach(r),n},e.prototype.dump=function(t){var e={};return e.columns=this.columns.map((function(e){return e.dump(t)})),e.sortCriteria=this.sortCriteria.map((function(t){return{asc:t.asc,sortBy:t.col.id}})),e.groupSortCriteria=this.groupSortCriteria.map((function(t){return{asc:t.asc,sortBy:t.col.id}})),e.groupColumns=this.groupColumns.map((function(t){return t.id})),e},e.prototype.restore=function(t,e){var r=this;if(this.clear(),(t.columns||[]).map((function(t){var n=e(t);n&&r.push(n)})),t.sortColumn&&t.sortColumn.sortBy){var n=this.columns.find((function(e){return e.id===t.sortColumn.sortBy}));n&&this.sortBy(n,t.sortColumn.asc)}if(t.groupColumns){var i=t.groupColumns.map((function(t){return r.columns.find((function(e){return e.id===t}))})).filter((function(t){return null!=t}));this.setGroupCriteria(i)}var o=function(t){return t.map((function(t){return{asc:t.asc,col:r.columns.find((function(e){return e.id===t.sortBy}))||null}})).filter((function(t){return t.col}))};t.sortCriteria&&this.setSortCriteria(o(t.sortCriteria)),t.groupSortCriteria&&this.setGroupSortCriteria(o(t.groupSortCriteria))},e.prototype.flatten=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=e;return(r>0||r<=pt.FLAT_ALL_COLUMNS)&&this.columns.forEach((function(e){e.getVisible()&&r<=pt.FLAT_ALL_COLUMNS&&(i+=e.flatten(t,i,r-1,n)+n)})),i-e},e.prototype.getPrimarySortCriteria=function(){return 0===this.sortCriteria.length?null:this.sortCriteria[0]},e.prototype.getSortCriteria=function(){return this.sortCriteria.map((function(t){return Object.assign({},t)}))},e.prototype.getGroupSortCriteria=function(){return this.groupSortCriteria.map((function(t){return Object.assign({},t)}))},e.prototype.toggleSorting=function(t){return this.setSortCriteria(this.toggleSortingLogic(t,this.sortCriteria))},e.prototype.toggleSortingLogic=function(t,e){var r=e.slice(),n=r.findIndex((function(e){return e.col===t})),i=mt(t);return n<0?r.splice(0,r.length,{col:t,asc:i}):r[n].asc===i?r.splice(n,1,{col:t,asc:!i}):r.splice(n,1),r},e.prototype.toggleGrouping=function(t){var e=this.groupColumns.indexOf(t);if(e>=0){var r=this.groupColumns.slice();return r.splice(e,1),this.setGroupCriteria(r)}return this.setGroupCriteria([t])},e.prototype.getGroupCriteria=function(){return this.groupColumns.slice()},e.prototype.sortBy=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=0),t.findMyRanker()===this&&this.setSortCriteria(this.hierarchyLogic(this.sortCriteria,this.sortCriteria.findIndex((function(e){return e.col===t})),{col:t,asc:e},r))},e.prototype.groupSortBy=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=0),t.findMyRanker()===this&&this.setGroupSortCriteria(this.hierarchyLogic(this.groupSortCriteria,this.groupSortCriteria.findIndex((function(e){return e.col===t})),{col:t,asc:e},r))},e.prototype.hierarchyLogic=function(t,e,r,n){return t=t.slice(),e>=0?(t.splice(e,1),n>=0&&t.splice(Math.min(n,t.length),0,r)):n>=0&&(t[Math.min(n,t.length)]=r),t},e.prototype.groupBy=function(t,e){return void 0===e&&(e=0),t.findMyRanker()===this&&this.setGroupCriteria(this.hierarchyLogic(this.groupColumns,this.groupColumns.indexOf(t),t,e))},e.prototype.setSortCriteria=function(t){var r,n=this,i=Array.isArray(t)?t.slice():[t],o=this.sortCriteria.slice();return!ti(i,o)&&(o.forEach((function(t){t.col.on(e.COLUMN_SORT_DIRTY,null)})),i.forEach((function(t){t.col.on(e.COLUMN_SORT_DIRTY,n.dirtyOrderSortDirty)})),(r=this.sortCriteria).splice.apply(r,[0,this.sortCriteria.length].concat(i.slice())),this.triggerResort(o),!0)},e.prototype.setGroupCriteria=function(t){var r,n=this,i=Array.isArray(t)?t:[t];if(z(this.groupColumns,i))return!0;this.groupColumns.forEach((function(t){t.on(e.COLUMN_GROUP_DIRTY,null)}));var o=this.groupColumns.slice();return(r=this.groupColumns).splice.apply(r,[0,this.groupColumns.length].concat(i)),this.groupColumns.forEach((function(t){t.on(e.COLUMN_GROUP_DIRTY,n.dirtyOrderGroupDirty)})),this.fire([e.EVENT_GROUP_CRITERIA_CHANGED,e.EVENT_DIRTY_ORDER,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES,e.EVENT_DIRTY],o,this.getGroupCriteria()),this.autoAdaptAggregationColumn(),!0},e.prototype.autoAdaptAggregationColumn=function(){var t=this.groupColumns.reduce((function(t,e){return t+(e instanceof Ln?2:1)}),0),e=this.children.find((function(t){return t instanceof Qn}));if(e){var r=t*zn;r>e.getWidth()&&e.setWidth(r)}},e.prototype.toggleGroupSorting=function(t){return this.setGroupSortCriteria(this.toggleSortingLogic(t,this.groupSortCriteria))},e.prototype.setGroupSortCriteria=function(t){var r,n=this,i=Array.isArray(t)?t.slice():[t],o=this.groupSortCriteria.slice();return!ti(i,o)&&(o.forEach((function(t){t.col.on(e.COLUMN_GROUP_SORT_DIRTY,null)})),i.forEach((function(t){t.col.on(e.COLUMN_GROUP_SORT_DIRTY,n.dirtyOrderGroupSortDirty)})),(r=this.groupSortCriteria).splice.apply(r,[0,this.groupSortCriteria.length].concat(i.slice())),this.triggerGroupResort(o),!0)},e.prototype.triggerGroupResort=function(t){var r=this.getGroupSortCriteria(),n=Array.isArray(t)?t:r;this.fire([e.EVENT_GROUP_SORT_CRITERIA_CHANGED,e.EVENT_DIRTY_ORDER,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],n,r)},e.prototype.triggerResort=function(t){var r=this.getSortCriteria(),n=Array.isArray(t)?t:r;this.fire([e.EVENT_SORT_CRITERIA_CHANGED,e.EVENT_DIRTY_ORDER,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],n,r)},Object.defineProperty(e.prototype,"children",{get:function(){return this.columns.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.columns.length},enumerable:!0,configurable:!0}),e.prototype.insert=function(t,r){var n=this;return void 0===r&&(r=this.columns.length),this.columns.splice(r,0,t),t.attach(this),this.forward.apply(this,[t].concat(e.FORWARD_COLUMN_EVENTS)),t.on(e.EVENT_FILTER_CHANGED+".order",this.dirtyOrderFiltering),t.on(pt.EVENT_VISIBILITY_CHANGED+".ranking",(function(r,i){return n.fire([e.EVENT_COLUMN_VISIBILITY_CHANGED,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r,i)})),this.fire([e.EVENT_ADD_COLUMN,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r),t.isFiltered()&&this.dirtyOrderFiltering(),t},e.prototype.move=function(t,r){if(void 0===r&&(r=this.columns.length),t.parent!==this)return console.error("invalid move operation: ",t),null;var n=this.columns.indexOf(t);return r===n||(this.columns.splice(n,1),this.columns.splice(n<r?r-1:r,0,t),this.fire([e.EVENT_MOVE_COLUMN,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r,n)),t},e.prototype.moveAfter=function(t,e){var r=this.columns.indexOf(e);return r<0?null:this.move(t,r+1)},Object.defineProperty(e.prototype,"fqpath",{get:function(){return""},enumerable:!0,configurable:!0}),e.prototype.findByPath=function(t){for(var e=this,r=t.split("@").map(Number).slice(1);r.length>0;){var n=r.shift();e=e.at(n)}return e},e.prototype.indexOf=function(t){return this.columns.indexOf(t)},e.prototype.at=function(t){return this.columns[t]},e.prototype.insertAfter=function(t,e){var r=this.columns.indexOf(e);return r<0?null:this.insert(t,r+1)},e.prototype.push=function(t){return this.insert(t)},e.prototype.remove=function(t){var r=this.columns.indexOf(t);if(r<0)return!1;this.unforward.apply(this,[t].concat(e.FORWARD_COLUMN_EVENTS));var n=this.sortCriteria.findIndex((function(e){return e.col===t})),i=n>=0;i&&this.sortCriteria.splice(n,1);var o=this.groupSortCriteria.findIndex((function(e){return e.col===t})),a=o>=0;a&&this.groupSortCriteria.splice(o,1);var s=null,u=this.groupColumns.indexOf(t);return u>=0&&(s=this.groupColumns.slice()).splice(u,1),t.detach(),this.columns.splice(r,1),this.fire([e.EVENT_REMOVE_COLUMN,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r),s?this.setGroupCriteria(s):i?this.triggerResort(null):a?this.triggerGroupResort(null):t.isFiltered()&&this.dirtyOrderFiltering(),!0},e.prototype.clear=function(){var t=this;if(0!==this.columns.length){this.sortCriteria.forEach((function(t){t.col.on(pt.EVENT_DIRTY_CACHES+".order",null)})),this.sortCriteria.splice(0,this.sortCriteria.length),this.groupSortCriteria.forEach((function(t){t.col.on(e.COLUMN_GROUP_SORT_DIRTY,null)})),this.groupSortCriteria.splice(0,this.groupSortCriteria.length),this.groupColumns.forEach((function(t){t.on(e.COLUMN_GROUP_DIRTY,null)})),this.groupColumns.splice(0,this.groupColumns.length),this.columns.forEach((function(r){t.unforward.apply(t,[r].concat(e.FORWARD_COLUMN_EVENTS)),r.detach()}));var r=this.columns.splice(0,this.columns.length);this.fire([e.EVENT_REMOVE_COLUMN,e.EVENT_DIRTY_ORDER,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],r)}},Object.defineProperty(e.prototype,"flatColumns",{get:function(){var t=[];return this.flatten(t,0,pt.FLAT_ALL_COLUMNS),t.map((function(t){return t.col}))},enumerable:!0,configurable:!0}),e.prototype.find=function(t){for(var e="string"==typeof t?function(e){return e.id===t}:t,r=0,n=this.flatColumns;r<n.length;r++){var i=n[r];if(e(i))return i}return null},e.prototype.isFiltered=function(){return this.columns.some((function(t){return t.isFiltered()}))},e.prototype.filter=function(t){return this.columns.every((function(e){return e.filter(t)}))},e.prototype.clearFilters=function(){return this.columns.map((function(t){return t.clearFilter()})).some((function(t){return t}))},e.prototype.findMyRanker=function(){return this},Object.defineProperty(e.prototype,"fqid",{get:function(){return this.id},enumerable:!0,configurable:!0}),e.prototype.markDirty=function(t){switch(void 0===t&&(t="all"),t){case"header":return this.fire([pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY]);case"values":return this.fire([pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY]);default:return this.fire([pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY])}},e.EVENT_WIDTH_CHANGED=pt.EVENT_WIDTH_CHANGED,e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_LABEL_CHANGED=pt.EVENT_LABEL_CHANGED,e.EVENT_ADD_COLUMN=Ot.EVENT_ADD_COLUMN,e.EVENT_MOVE_COLUMN=Ot.EVENT_MOVE_COLUMN,e.EVENT_REMOVE_COLUMN=Ot.EVENT_REMOVE_COLUMN,e.EVENT_DIRTY=pt.EVENT_DIRTY,e.EVENT_DIRTY_HEADER=pt.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES=pt.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES=pt.EVENT_DIRTY_CACHES,e.EVENT_COLUMN_VISIBILITY_CHANGED=pt.EVENT_VISIBILITY_CHANGED,e.EVENT_SORT_CRITERIA_CHANGED="sortCriteriaChanged",e.EVENT_GROUP_CRITERIA_CHANGED="groupCriteriaChanged",e.EVENT_GROUP_SORT_CRITERIA_CHANGED="groupSortCriteriaChanged",e.EVENT_DIRTY_ORDER="dirtyOrder",e.EVENT_ORDER_CHANGED="orderChanged",e.EVENT_GROUPS_CHANGED="groupsChanged",e.FORWARD_COLUMN_EVENTS=it(".ranking",pt.EVENT_VISIBILITY_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY,pt.EVENT_VISIBILITY_CHANGED,e.EVENT_FILTER_CHANGED),e.COLUMN_GROUP_SORT_DIRTY=it(".groupOrder",pt.EVENT_DIRTY_CACHES,"sortMethodChanged"),e.COLUMN_SORT_DIRTY=it(".order",pt.EVENT_DIRTY_CACHES),e.COLUMN_GROUP_DIRTY=it(".group",pt.EVENT_DIRTY_CACHES,"groupingChanged"),e}(at);function ti(t,e){return t.length===e.length&&t.every((function(t,r){var n=e[r];return t.col===n.col&&t.asc===n.asc}))}function ei(t,e,r){void 0===e&&(e=100);var n=-1,i=null;return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n>=0&&(clearTimeout(n),n=-1);var s={self:this,args:o};i=i&&r?r(i,s):s,n=self.setTimeout((function(){console.assert(null!=i),t.apply(i.self,i.args),i=null}),e)}}function ri(t){return void 0===t&&(t="Rank"),{type:"rank",label:t}}var ni=function(t){function e(e,r){return t.call(this,e,tn(r,{width:50}))||this}return i(e,t),e.prototype.getLabel=function(t){return String(this.getValue(t))},e.prototype.getRaw=function(t){var e=this.findMyRanker();return e?e.getRank(t.i):-1},e.prototype.getValue=function(t){var e=this.getRaw(t);return-1===e?null:e},Object.defineProperty(e.prototype,"frozen",{get:function(){return!1!==this.desc.frozen},enumerable:!0,configurable:!0}),e=a([dt(),Ct("support")],e)}(pt);function ii(t){return void 0===t&&(t="Selection Checkboxes"),{type:"selection",label:t,fixed:!0}}var oi=function(t){function e(e,r){return t.call(this,e,tn(r,{width:20}))||this}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"frozen",{get:function(){return!1!==this.desc.frozen},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SELECT])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.setValue=function(t,e){return this.getValue(t)===e||this.setImpl(t,e)},e.prototype.setValues=function(t,e){if(0!==t.length)return this.desc.setterAll&&this.desc.setterAll(t,e),this.fire(r.EVENT_SELECT,t[0],e,t),!0},e.prototype.setImpl=function(t,e){return this.desc.setter&&this.desc.setter(t.i,e),this.fire(r.EVENT_SELECT,t.i,e),!0},e.prototype.toggleValue=function(t){var e=this.getValue(t);return this.setImpl(t,!e),!e},e.prototype.toCompareValue=function(t){return!0===this.getValue(t)?1:0},e.prototype.toCompareValueType=function(){return ot.BINARY},e.prototype.group=function(t){var e=this.getValue(t);return Object.assign({},e?r.SELECTED_GROUP:r.NOT_SELECTED_GROUP)},e.SELECTED_GROUP={name:"Selected",color:"orange"},e.NOT_SELECTED_GROUP={name:"Unselected",color:"gray"},e.EVENT_SELECT="select",e=r=a([dt(),_t("sort","sortBy","group","groupBy","invertSelection"),Ct("support")],e)}(xt);function ai(t,e,r){return void 0===t&&(t="actions"),void 0===e&&(e=[]),void 0===r&&(r=[]),{type:"actions",label:t,actions:e,groupActions:r,fixed:!0}}var si,ui,li=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.actions=r.actions||[],n.groupActions=r.groupActions||[],n}return i(e,t),e.prototype.getLabel=function(){return""},e.prototype.getValue=function(){return""},e.prototype.compare=function(){return 0},e=a([dt(),Ct("support")],e)}(pt),ci=r(2),pi="function"==typeof ci?ci:r.n(ci).a;!function(t){t.left="left",t.center="center",t.right="right"}(si||(si={})),function(t){t.value="value",t.startsWith="startsWith",t.regex="regex"}(ui||(ui={}));var fi=function(t){function e(e,r){var n=t.call(this,e,tn(r,{width:200}))||this;return n.currentFilter=null,n.currentGroupCriteria={type:ui.startsWith,values:[]},n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_GROUPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(e){var r=t.prototype.getValue.call(this,e);return vn(r)?null:String(r)},e.prototype.getLabel=function(t){return this.getValue(t)||""},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);if(this.currentFilter instanceof RegExp?r.filter="REGEX:"+this.currentFilter.source:r.filter=this.currentFilter,this.currentGroupCriteria){var n=this.currentGroupCriteria,i=n.type,o=n.values;r.groupCriteria={type:i,values:o.map((function(t){return t instanceof RegExp&&i===ui.regex?t.source:t}))}}return r},e.prototype.restore=function(e,n){if(t.prototype.restore.call(this,e,n),e.filter){var i=e.filter;"string"==typeof i?i.startsWith("REGEX:")?this.currentFilter={filter:new RegExp(i.slice(6),"m"),filterMissing:!1}:i===r.FILTER_MISSING?this.currentFilter={filter:null,filterMissing:!0}:this.currentFilter={filter:i,filterMissing:!1}:this.currentFilter={filter:i.filter&&i.filter.startsWith("REGEX:")?new RegExp(i.slice(6),"m"):i.filter||"",filterMissing:!0===i.filterMissing}}else this.currentFilter=null;if(e.groupCriteria){var o=e.groupCriteria,a=o.type,s=o.values;this.currentGroupCriteria={type:a,values:s.map((function(t){return a===ui.regex?new RegExp(t,"m"):t}))}}},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t){if(!this.isFiltered())return!0;var e=this.getLabel(t),r=this.currentFilter,n=r.filter;return null==e||""===e.trim()?!r.filterMissing:!n||(n instanceof RegExp?""!==e&&null!=e.match(n):""!==e&&e.toLowerCase().includes(n.toLowerCase()))},e.prototype.getFilter=function(){return this.currentFilter},e.prototype.setFilter=function(t){if(t!==this.currentFilter){var e=this.currentFilter||{filter:null,filterMissing:!1},n=t||{filter:null,filterMissing:!1};e.filterMissing===n.filterMissing&&(e.filter===n.filter||e.filter instanceof RegExp&&n.filter instanceof RegExp&&e.filter.source===n.filter.source)||this.fire([r.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.currentFilter,this.currentFilter=t)}},e.prototype.clearFilter=function(){var t=this.isFiltered();return this.setFilter(null),t},e.prototype.getGroupCriteria=function(){return this.currentGroupCriteria},e.prototype.setGroupCriteria=function(t){if(!pi(this.currentGroupCriteria,t)&&null!=t){var e=this.getGroupCriteria();this.currentGroupCriteria=t,this.fire([r.EVENT_GROUPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],e,t)}},e.prototype.group=function(t){if(null==this.getValue(t))return Object.assign({},En);if(!this.currentGroupCriteria)return Object.assign({},ut);var e=this.getLabel(t);if(!e)return Object.assign({},En);var r=this.currentGroupCriteria,n=r.type,i=r.values;if(n===ui.value)return{name:e,color:st.color};if(n===ui.startsWith){for(var o=0,a=i;o<a.length;o++){if("string"==typeof(l=a[o])&&e.startsWith(l))return{name:l,color:st.color}}return Object.assign({},ut)}for(var s=0,u=i;s<u.length;s++){var l;if((l=u[s])instanceof RegExp&&l.test(e))return{name:l.source,color:st.color}}return Object.assign({},ut)},e.prototype.toCompareValue=function(t){var e=this.getValue(t);return""===e||null==e?null:e.toLowerCase()},e.prototype.toCompareValueType=function(){return ot.STRING},e.prototype.toCompareGroupValue=function(t,e,r){var n=this;return s(t)?null:r?r.reduce((function(t,e){return null==t||e<t?e:t}),null):t.reduce((function(t,e){var r=n.getValue(e);return null==t||null!=r&&r<t?r:t}),null)},e.prototype.toCompareGroupValueType=function(){return ot.STRING},e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_GROUPING_CHANGED="groupingChanged",e.FILTER_MISSING="__FILTER_MISSING",e=r=a([_t("rename","clone","sort","sortBy","search","groupBy","sortGroupBy","filterString"),Tt("group","groupString"),Ct("string")],e)}(xt),hi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.annotations=new Map,e}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_VALUE_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(e){return this.annotations.has(e.i)?this.annotations.get(e.i):t.prototype.getValue.call(this,e)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.annotations={},this.annotations.forEach((function(t,e){r.annotations[e]=t})),r},e.prototype.restore=function(e,r){var n=this;t.prototype.restore.call(this,e,r),e.annotations&&Object.keys(e.annotations).forEach((function(t){n.annotations.set(Number(t),e.annotations[t])}))},e.prototype.setValue=function(t,r){var n=this.getValue(t);return n===r||(""===r||null==r?this.annotations.delete(t.i):this.annotations.set(t.i,r),this.fire([e.EVENT_VALUE_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],t.i,n,r)),!0},e.EVENT_VALUE_CHANGED="valueChanged",e}(fi),di=function(t){function e(e,n){var i=t.call(this,e,tn(n,{width:30,renderer:"categorical",groupRenderer:"categorical",summaryRenderer:"categorical"}))||this;return i.currentFilter=null,i.categories=[{name:n.trueMarker||"✓",color:r.GROUP_TRUE.color,label:r.GROUP_TRUE.name,value:0},{name:n.falseMarker||"",color:r.GROUP_FALSE.color,label:r.GROUP_FALSE.name,value:1}],i.colorMapping=gn,i}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},Object.defineProperty(e.prototype,"dataLength",{get:function(){return this.categories.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labels",{get:function(){return this.categories.map((function(t){return t.label}))},enumerable:!0,configurable:!0}),e.prototype.getValue=function(e){var r=t.prototype.getValue.call(this,e);return void 0===r||null==r?null:!0===r||"true"===r||"yes"===r||"x"===r},e.prototype.getCategoryOfBoolean=function(t){return null==t?null:this.categories[t?0:1]},e.prototype.getCategory=function(t){var e=this.getValue(t);return null==e?null:this.categories[e?0:1]},e.prototype.getCategories=function(t){return[this.getCategory(t)]},e.prototype.iterCategory=function(t){return[this.getCategory(t)]},e.prototype.getColor=function(t){return Mn.prototype.getColor.call(this,t)},e.prototype.getLabel=function(t){return Mn.prototype.getLabel.call(this,t)},e.prototype.getLabels=function(t){return Mn.prototype.getLabels.call(this,t)},e.prototype.getValues=function(t){return Mn.prototype.getValues.call(this,t)},e.prototype.getMap=function(t){return Mn.prototype.getMap.call(this,t)},e.prototype.getMapLabel=function(t){return Mn.prototype.getMapLabel.call(this,t)},e.prototype.getSet=function(t){var e=this.getValue(t),r=new Set;return null!=e&&r.add(this.categories[e?0:1]),r},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.colorMapping=this.colorMapping.toJSON(),null!=this.currentFilter&&(r.filter=this.currentFilter),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories),"boolean"==typeof e.filter?this.currentFilter={filter:[this.getCategoryOfBoolean(e.filter).name],filterMissing:!1}:void 0!==e.filter&&(this.currentFilter=e.filter)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([Mn.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t){return Sn(this.currentFilter,this.getCategory(t))},e.prototype.getFilter=function(){return null==this.currentFilter?null:Object.assign({},this.currentFilter)},e.prototype.setFilter=function(t){var e="boolean"==typeof t?{filter:[this.getCategoryOfBoolean(t).name],filterMissing:!1}:t;Dn(this.currentFilter,e)||this.fire([r.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.currentFilter,this.currentFilter=e)},e.prototype.clearFilter=function(){var t=this.isFiltered();return this.setFilter(null),t},e.prototype.toCompareValue=function(t){var e=this.getValue(t);return null==e?NaN:e?1:0},e.prototype.toCompareValueType=function(){return ot.BINARY},e.prototype.group=function(t){var e=this.getValue(t);return null==e?Object.assign({},En):Object.assign({},e?r.GROUP_TRUE:r.GROUP_FALSE)},e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_COLOR_MAPPING_CHANGED="colorMappingChanged",e.GROUP_TRUE={name:"True",color:"#444444"},e.GROUP_FALSE={name:"False",color:"#dddddd"},e=r=a([_t("rename","clone","sort","sortBy","group","groupBy","filterCategorical","colorMappedCategorical"),Ct("categorical")],e)}(xt),gi=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n._dataLength=null==r.dataLength||isNaN(r.dataLength)?null:r.dataLength,n.originalLabels=r.labels||_(null==n._dataLength?0:n._dataLength).map((function(t,e){return"Column "+e})),n}return i(e,t),Object.defineProperty(e.prototype,"labels",{get:function(){return this.originalLabels},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataLength",{get:function(){return this._dataLength},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.getValues(t);return e.every((function(t){return null===t}))?null:e},e.prototype.getValues=function(e){var r=t.prototype.getValue.call(this,e);return null==r?[]:r},e.prototype.getLabels=function(t){return this.getValues(t).map(String)},e.prototype.getLabel=function(t){var e=this.getLabels(t);return 0===e.length?"":e.toString()},e.prototype.getMap=function(t){var e=this.labels;return this.getValues(t).map((function(t,r){return{key:e[r],value:t}}))},e.prototype.getMapLabel=function(t){var e=this.labels;return this.getLabels(t).map((function(t,r){return{key:e[r],value:t}}))},e=a([Ct("array")],e)}(xt),mi=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"upset"}))||this;return n.colorMapping=gn,n}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"categories",{get:function(){return this.labels.map((function(t,e){return Cn(t,e)}))},enumerable:!0,configurable:!0}),e.prototype.getSet=function(t){var e=this.getValues(t);return new Set(this.categories.filter((function(t,r){return e[r]})))},e.prototype.toCompareValue=function(t){var e=this.getValue(t);return null==e?NaN:e.reduce((function(t,e){return t+(e?1:0)}),0)},e.prototype.toCompareValueType=function(){return dn(this.dataLength)},e.prototype.getCategories=function(e){var r=this.categories;return t.prototype.getValues.call(this,e).map((function(t,e){return t?r[e]:null}))},e.prototype.iterCategory=function(t){return this.getCategories(t)},e.prototype.getColors=function(t){var e=this;return this.getCategories(t).map((function(t){return t?e.colorMapping.apply(t):"#C1C1C1"}))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){return Mn.prototype.setColorMapping.call(this,t)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories)},e.EVENT_COLOR_MAPPING_CHANGED=Mn.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy")],e)}(gi),yi=function(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]},vi=function(t){return(t=yi(Math.abs(t)))?t[1]:NaN},bi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(t){return new Ci(t)}function Ci(t){if(!(e=bi.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}Ei.prototype=Ci.prototype,Ci.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ni,_i,Ti,wi,Ri=function(t,e){var r=yi(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")},Ai={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Ri(100*t,e)},r:Ri,s:function(t,e){var r=yi(t,e);if(!r)return t+"";var n=r[0],i=r[1],o=i-(Ni=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+yi(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Di=function(t){return t},Si=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];_i=function(t){var e,r,n=t.grouping&&t.thousands?(e=t.grouping,r=t.thousands,function(t,n){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(r)}):Di,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(t.numerals):Di,s=t.percent||"%";function u(t){var e=(t=Ei(t)).fill,r=t.align,u=t.sign,l=t.symbol,c=t.zero,p=t.width,f=t.comma,h=t.precision,d=t.trim,g=t.type;"n"===g?(f=!0,g="g"):Ai[g]||(null==h&&(h=12),d=!0,g="g"),(c||"0"===e&&"="===r)&&(c=!0,e="0",r="=");var m="$"===l?i[0]:"#"===l&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",y="$"===l?i[1]:/[%p]/.test(g)?s:"",v=Ai[g],b=/[defgprs%]/.test(g);function E(t){var i,s,l,E=m,C=y;if("c"===g)C=v(t)+C,t="";else{var N=(t=+t)<0;if(t=v(Math.abs(t),h),d&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n<r;++n)switch(t[n]){case".":i=e=n;break;case"0":0===i&&(i=n),e=n;break;default:if(i>0){if(!+t[n])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),N&&0==+t&&(N=!1),E=(N?"("===u?u:"-":"-"===u||"("===u?"":u)+E,C=("s"===g?Si[8+Ni/3]:"")+C+(N&&"("===u?")":""),b)for(i=-1,s=t.length;++i<s;)if(48>(l=t.charCodeAt(i))||l>57){C=(46===l?o+t.slice(i+1):t.slice(i))+C,t=t.slice(0,i);break}}f&&!c&&(t=n(t,1/0));var _=E.length+t.length+C.length,T=_<p?new Array(p-_+1).join(e):"";switch(f&&c&&(t=n(T+t,T.length?p-C.length:1/0),T=""),r){case"<":t=E+t+C+T;break;case"=":t=E+T+t+C;break;case"^":t=T.slice(0,_=T.length>>1)+E+t+C+T.slice(_);break;default:t=T+E+t+C}return a(t)}return h=null==h?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),E.toString=function(){return t+""},E}return{format:u,formatPrefix:function(t,e){var r=u(((t=Ei(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(vi(e)/3))),i=Math.pow(10,-n),o=Si[8+n/3];return function(t){return r(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Ti=_i.format,wi=_i.formatPrefix;var Mi=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Li=function(t){var e;return 1===t.length&&(e=t,t=function(t,r){return Mi(e(t),r)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var o=n+i>>>1;t(e[o],r)<0?n=o+1:i=o}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n<i;){var o=n+i>>>1;t(e[o],r)>0?i=o:n=o+1}return n}}};var xi=Li(Mi),Oi=xi.right,Vi=(xi.left,Oi);var Ii=Array.prototype,ki=(Ii.slice,Ii.map,Math.sqrt(50)),Gi=Math.sqrt(10),Hi=Math.sqrt(2),Pi=function(t,e,r){var n,i,o,a,s=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e<t)&&(i=t,t=e,e=i),0===(a=Fi(t,e,r))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;return n&&o.reverse(),o};function Fi(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),o=n/Math.pow(10,i);return i>=0?(o>=ki?10:o>=Gi?5:o>=Hi?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ki?10:o>=Gi?5:o>=Hi?2:1)}function Ui(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=ki?i*=10:o>=Gi?i*=5:o>=Hi&&(i*=2),e<t?-i:i}function Bi(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function ji(){}function Yi(t,e){var r=new ji;if(t instanceof ji)t.each((function(t,e){r.set(e,t)}));else if(Array.isArray(t)){var n,i=-1,o=t.length;if(null==e)for(;++i<o;)r.set(i,t[i]);else for(;++i<o;)r.set(e(n=t[i],i,t),n)}else if(t)for(var a in t)r.set(a,t[a]);return r}ji.prototype=Yi.prototype={constructor:ji,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Wi=Yi;function zi(){}var qi=Wi.prototype;function Ki(t,e){var r=new zi;if(t instanceof zi)t.each((function(t){r.add(t)}));else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}zi.prototype=Ki.prototype={constructor:zi,has:qi.has,add:function(t){return this["$"+(t+="")]=t,this},remove:qi.remove,clear:qi.clear,values:qi.keys,size:qi.size,empty:qi.empty,each:qi.each};var Xi=Array.prototype,$i=Xi.map,Ji=Xi.slice;var Qi=function(t){return+t},Zi=[0,1];function to(t){return t}function eo(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:(r=isNaN(e)?NaN:.5,function(){return r});var r}function ro(t){var e,r=t[0],n=t[t.length-1];return r>n&&(e=r,r=n,n=e),function(t){return Math.max(r,Math.min(n,t))}}function no(t,e,r){var n=t[0],i=t[1],o=e[0],a=e[1];return i<n?(n=eo(i,n),o=r(a,o)):(n=eo(n,i),o=r(o,a)),function(t){return o(n(t))}}function io(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),o=new Array(n),a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)i[a]=eo(t[a],t[a+1]),o[a]=r(e[a],e[a+1]);return function(e){var r=Vi(t,e,1,n)-1;return o[r](i[r](e))}}function oo(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ao(){var t,e,r,n,i,o,a=Zi,s=Zi,u=or,l=to;function c(){return n=Math.min(a.length,s.length)>2?io:no,i=o=null,p}function p(e){return isNaN(e=+e)?r:(i||(i=n(a.map(t),s,u)))(t(l(e)))}return p.invert=function(r){return l(e((o||(o=n(s,a.map(t),$e)))(r)))},p.domain=function(t){return arguments.length?(a=$i.call(t,Qi),l===to||(l=ro(a)),c()):a.slice()},p.range=function(t){return arguments.length?(s=Ji.call(t),c()):s.slice()},p.rangeRound=function(t){return s=Ji.call(t),u=ar,c()},p.clamp=function(t){return arguments.length?(l=t?ro(a):to,p):l!==to},p.interpolate=function(t){return arguments.length?(u=t,c()):u},p.unknown=function(t){return arguments.length?(r=t,p):r},function(r,n){return t=r,e=n,c()}}function so(t,e){return ao()(t,e)}var uo=function(t,e,r,n){var i,o=Ui(t,e,r);switch((n=Ei(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(vi(e)/3)))-vi(Math.abs(t)))}(o,a))||(n.precision=i),wi(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vi(e)-vi(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(t){return Math.max(0,-vi(Math.abs(t)))}(o))||(n.precision=i-2*("%"===n.type))}return Ti(n)};function lo(t){var e=t.domain;return t.ticks=function(t){var r=e();return Pi(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return uo(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,i=e(),o=0,a=i.length-1,s=i[o],u=i[a];return u<s&&(n=s,s=u,u=n,n=o,o=a,a=n),(n=Fi(s,u,r))>0?n=Fi(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,r):n<0&&(n=Fi(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,r)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(u/n)*n,e(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(u*n)/n,e(i)),t},t}function co(){var t=so(to,to);return t.copy=function(){return oo(t,co())},Bi.apply(t,arguments),lo(t)}var po=function(t,e){var r,n=0,i=(t=t.slice()).length-1,o=t[n],a=t[i];return a<o&&(r=n,n=i,i=r,r=o,o=a,a=r),t[n]=e.floor(o),t[i]=e.ceil(a),t};function fo(t){return Math.log(t)}function ho(t){return Math.exp(t)}function go(t){return-Math.log(-t)}function mo(t){return-Math.exp(-t)}function yo(t){return isFinite(t)?+("1e"+t):t<0?0:t}function vo(t){return function(e){return-t(-e)}}function bo(t){var e,r,n=t(fo,ho),i=n.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),r=function(t){return 10===t?yo:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=vo(e),r=vo(r),t(go,mo)):t(fo,ho),n}return n.base=function(t){return arguments.length?(o=+t,a()):o},n.domain=function(t){return arguments.length?(i(t),a()):i()},n.ticks=function(t){var n,a=i(),s=a[0],u=a[a.length-1];(n=u<s)&&(f=s,s=u,u=f);var l,c,p,f=e(s),h=e(u),d=null==t?10:+t,g=[];if(!(o%1)&&h-f<d){if(f=Math.round(f)-1,h=Math.round(h)+1,s>0){for(;f<h;++f)for(c=1,l=r(f);c<o;++c)if(!((p=l*c)<s)){if(p>u)break;g.push(p)}}else for(;f<h;++f)for(c=o-1,l=r(f);c>=1;--c)if(!((p=l*c)<s)){if(p>u)break;g.push(p)}}else g=Pi(f,h,Math.min(h-f,d)).map(r);return n?g.reverse():g},n.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Ti(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/n.ticks().length);return function(t){var n=t/r(Math.round(e(t)));return n*o<o-.5&&(n*=o),n<=a?i(t):""}},n.nice=function(){return i(po(i(),{floor:function(t){return r(Math.floor(e(t)))},ceil:function(t){return r(Math.ceil(e(t)))}}))},n}function Eo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Co(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function No(t){return t<0?-t*t:t*t}function _o(t){var e=t(to,to),r=1;function n(){return 1===r?t(to,to):.5===r?t(Co,No):t(Eo(r),Eo(1/r))}return e.exponent=function(t){return arguments.length?(r=+t,n()):r},lo(e)}function To(){var t=_o(ao());return t.copy=function(){return oo(t,To()).exponent(t.exponent())},Bi.apply(t,arguments),t}var wo=new Date,Ro=new Date;function Ao(t,e,r,n){function i(e){return t(e=new Date(+e)),e}return i.floor=i,i.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},i.round=function(t){var e=i(t),r=i.ceil(t);return t-e<r-t?e:r},i.offset=function(t,r){return e(t=new Date(+t),null==r?1:Math.floor(r)),t},i.range=function(r,n,o){var a,s=[];if(r=i.ceil(r),o=null==o?1:Math.floor(o),!(r<n&&o>0))return s;do{s.push(a=new Date(+r)),e(r,o),t(r)}while(a<r&&r<n);return s},i.filter=function(r){return Ao((function(e){if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(i.count=function(e,n){return wo.setTime(+e),Ro.setTime(+n),t(wo),t(Ro),Math.floor(r(wo,Ro))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?function(e){return n(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Do=Ao((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Do.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Ao((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):Do:null};Do.range;var So=Ao((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),Mo=So,Lo=(So.range,Ao((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),xo=Lo,Oo=(Lo.range,Ao((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Vo=Oo,Io=(Oo.range,Ao((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}))),ko=Io;Io.range;function Go(t){return Ao((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var Ho=Go(0),Po=Go(1),Fo=Go(2),Uo=Go(3),Bo=Go(4),jo=Go(5),Yo=Go(6),Wo=(Ho.range,Po.range,Fo.range,Uo.range,Bo.range,jo.range,Yo.range,Ao((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),zo=Wo,qo=(Wo.range,Ao((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));qo.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ao((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var Ko=qo,Xo=(qo.range,Ao((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}))),$o=(Xo.range,Ao((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),Jo=($o.range,Ao((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Qo=Jo;Jo.range;function Zo(t){return Ao((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var ta=Zo(0),ea=Zo(1),ra=Zo(2),na=Zo(3),ia=Zo(4),oa=Zo(5),aa=Zo(6),sa=(ta.range,ea.range,ra.range,na.range,ia.range,oa.range,aa.range,Ao((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}))),ua=(sa.range,Ao((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));ua.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ao((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var la=ua;ua.range;function ca(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function pa(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function fa(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var ha,da,ga,ma,ya,va={"-":"",_:" ",0:"0"},ba=/^\s*\d+/,Ea=/^%/,Ca=/[\\^$*+?|[\]().{}]/g;function Na(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o<r?new Array(r-o+1).join(e)+i:i)}function _a(t){return t.replace(Ca,"\\$&")}function Ta(t){return new RegExp("^(?:"+t.map(_a).join("|")+")","i")}function wa(t){for(var e={},r=-1,n=t.length;++r<n;)e[t[r].toLowerCase()]=r;return e}function Ra(t,e,r){var n=ba.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Aa(t,e,r){var n=ba.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Da(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Sa(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Ma(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function La(t,e,r){var n=ba.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function xa(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Oa(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Va(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ia(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ka(t,e,r){var n=ba.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ga(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Ha(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Pa(t,e,r){var n=ba.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Fa(t,e,r){var n=ba.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Ua(t,e,r){var n=ba.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Ba(t,e,r){var n=Ea.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ja(t,e,r){var n=ba.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Ya(t,e,r){var n=ba.exec(e.slice(r));return n?(t.Q=1e3*+n[0],r+n[0].length):-1}function Wa(t,e){return Na(t.getDate(),e,2)}function za(t,e){return Na(t.getHours(),e,2)}function qa(t,e){return Na(t.getHours()%12||12,e,2)}function Ka(t,e){return Na(1+ko.count(Ko(t),t),e,3)}function Xa(t,e){return Na(t.getMilliseconds(),e,3)}function $a(t,e){return Xa(t,e)+"000"}function Ja(t,e){return Na(t.getMonth()+1,e,2)}function Qa(t,e){return Na(t.getMinutes(),e,2)}function Za(t,e){return Na(t.getSeconds(),e,2)}function ts(t){var e=t.getDay();return 0===e?7:e}function es(t,e){return Na(Ho.count(Ko(t),t),e,2)}function rs(t,e){var r=t.getDay();return t=r>=4||0===r?Bo(t):Bo.ceil(t),Na(Bo.count(Ko(t),t)+(4===Ko(t).getDay()),e,2)}function ns(t){return t.getDay()}function is(t,e){return Na(Po.count(Ko(t),t),e,2)}function os(t,e){return Na(t.getFullYear()%100,e,2)}function as(t,e){return Na(t.getFullYear()%1e4,e,4)}function ss(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Na(e/60|0,"0",2)+Na(e%60,"0",2)}function us(t,e){return Na(t.getUTCDate(),e,2)}function ls(t,e){return Na(t.getUTCHours(),e,2)}function cs(t,e){return Na(t.getUTCHours()%12||12,e,2)}function ps(t,e){return Na(1+Qo.count(la(t),t),e,3)}function fs(t,e){return Na(t.getUTCMilliseconds(),e,3)}function hs(t,e){return fs(t,e)+"000"}function ds(t,e){return Na(t.getUTCMonth()+1,e,2)}function gs(t,e){return Na(t.getUTCMinutes(),e,2)}function ms(t,e){return Na(t.getUTCSeconds(),e,2)}function ys(t){var e=t.getUTCDay();return 0===e?7:e}function vs(t,e){return Na(ta.count(la(t),t),e,2)}function bs(t,e){var r=t.getUTCDay();return t=r>=4||0===r?ia(t):ia.ceil(t),Na(ia.count(la(t),t)+(4===la(t).getUTCDay()),e,2)}function Es(t){return t.getUTCDay()}function Cs(t,e){return Na(ea.count(la(t),t),e,2)}function Ns(t,e){return Na(t.getUTCFullYear()%100,e,2)}function _s(t,e){return Na(t.getUTCFullYear()%1e4,e,4)}function Ts(){return"+0000"}function ws(){return"%"}function Rs(t){return+t}function As(t){return Math.floor(+t/1e3)}!function(t){ha=function(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=Ta(i),c=wa(i),p=Ta(o),f=wa(o),h=Ta(a),d=wa(a),g=Ta(s),m=wa(s),y=Ta(u),v=wa(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Wa,e:Wa,f:$a,H:za,I:qa,j:Ka,L:Xa,m:Ja,M:Qa,p:function(t){return i[+(t.getHours()>=12)]},Q:Rs,s:As,S:Za,u:ts,U:es,V:rs,w:ns,W:is,x:null,X:null,y:os,Y:as,Z:ss,"%":ws},E={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:us,e:us,f:hs,H:ls,I:cs,j:ps,L:fs,m:ds,M:gs,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Rs,s:As,S:ms,u:ys,U:vs,V:bs,w:Es,W:Cs,x:null,X:null,y:Ns,Y:_s,Z:Ts,"%":ws},C={a:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=d[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=p.exec(e.slice(r));return n?(t.w=f[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.m=v[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=g.exec(e.slice(r));return n?(t.m=m[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return T(t,e,r,n)},d:Ia,e:Ia,f:Ua,H:Ga,I:Ga,j:ka,L:Fa,m:Va,M:Ha,p:function(t,e,r){var n=l.exec(e.slice(r));return n?(t.p=c[n[0].toLowerCase()],r+n[0].length):-1},Q:ja,s:Ya,S:Pa,u:Aa,U:Da,V:Sa,w:Ra,W:Ma,x:function(t,e,n){return T(t,r,e,n)},X:function(t,e,r){return T(t,n,e,r)},y:xa,Y:La,Z:Oa,"%":Ba};function N(t,e){return function(r){var n,i,o,a=[],s=-1,u=0,l=t.length;for(r instanceof Date||(r=new Date(+r));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=va[n=t.charAt(++s)])?n=t.charAt(++s):i="e"===n?" ":"0",(o=e[n])&&(n=o(r,i)),a.push(n),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function _(t,e){return function(r){var n,i,o=fa(1900);if(T(o,t,r+="",0)!=r.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(n=pa(fa(o.y))).getUTCDay(),n=i>4||0===i?ea.ceil(n):ea(n),n=Qo.offset(n,7*(o.V-1)),o.y=n.getUTCFullYear(),o.m=n.getUTCMonth(),o.d=n.getUTCDate()+(o.w+6)%7):(i=(n=e(fa(o.y))).getDay(),n=i>4||0===i?Po.ceil(n):Po(n),n=ko.offset(n,7*(o.V-1)),o.y=n.getFullYear(),o.m=n.getMonth(),o.d=n.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?pa(fa(o.y)).getUTCDay():e(fa(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,pa(o)):e(o)}}function T(t,e,r,n){for(var i,o,a=0,s=e.length,u=r.length;a<s;){if(n>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=C[i in va?e.charAt(a++):i])||(n=o(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return b.x=N(r,b),b.X=N(n,b),b.c=N(e,b),E.x=N(r,E),E.X=N(n,E),E.c=N(e,E),{format:function(t){var e=N(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=_(t+="",ca);return e.toString=function(){return t},e},utcFormat:function(t){var e=N(t+="",E);return e.toString=function(){return t},e},utcParse:function(t){var e=_(t,pa);return e.toString=function(){return t},e}}}(t),da=ha.format,ga=ha.parse,ma=ha.utcFormat,ya=ha.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||ma("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||ya("%Y-%m-%dT%H:%M:%S.%LZ");function Ds(t){switch(void 0===t&&(t="linear"),t){case"log":return function t(){var e=bo(ao()).domain([1,10]);return e.copy=function(){return oo(e,t()).base(e.base())},Bi.apply(e,arguments),e}().clamp(!0);case"sqrt":return function(){return To.apply(null,arguments).exponent(.5)}().clamp(!0);case"pow1.1":return To().exponent(1.1).clamp(!0);case"pow2":return To().exponent(2).clamp(!0);case"pow3":return To().exponent(3).clamp(!0);default:return co().clamp(!0)}}function Ss(t,e){return t.length===e.length&&t.every((function(t,r){return V(t,e[r],1e-4)}))}function Ms(t,e){return"log"===e&&0===t[0]&&(t[0]=1e-7),t}var Ls=function(){function t(t,e,r){if(void 0===t&&(t=[0,1]),void 0===e&&(e="linear"),void 0===r&&(r=[0,1]),!t||Array.isArray(t))this.type=e,this.s=Ds(e).domain(Ms(t||[0,1],this.type)).range(r);else{var n=t;this.type=n.type,this.s=Ds(n.type).domain(n.domain).range(n.range)}}return Object.defineProperty(t.prototype,"domain",{get:function(){return this.s.domain()},set:function(t){this.s.domain(Ms(t,this.type))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){return this.s.range()},set:function(t){this.s.range(t)},enumerable:!0,configurable:!0}),t.prototype.getRange=function(t){return[t(this.invert(0)),t(this.invert(1))]},t.prototype.apply=function(t){return this.s(t)},t.prototype.invert=function(t){return this.s.invert(t)},Object.defineProperty(t.prototype,"scaleType",{get:function(){return this.type},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){return{type:this.type,domain:this.domain,range:this.range}},t.prototype.eq=function(e){if(!(e instanceof t))return!1;var r=e;return r.type===this.type&&Ss(this.domain,r.domain)&&Ss(this.range,r.range)},t.prototype.clone=function(){return new t(this.domain,this.type,this.range)},t}(),xs=function(){function t(t,e){if(void 0===t&&(t=[0,1]),void 0===e&&(e="return this.linear(value,this.value_min,this.value_max);"),!t||Array.isArray(t))this.domain=t||[0,1];else{var r=t;this.domain=r.domain,e=r.code}this.code="string"==typeof e?e:e.toString(),this.f="function"==typeof e?e:new Function("value",e)}return t.prototype.getRange=function(){return["?","?"]},t.prototype.apply=function(t){var e=this.domain[0],r=this.domain[this.domain.length-1],n=this.f.call({value_min:e,value_max:r,value_range:r-e,value_domain:this.domain.slice(),linear:function(t,e,r){return(t-e)/(r-e)}},t);return"number"==typeof n?Math.max(Math.min(n,1),0):NaN},t.prototype.toJSON=function(){return{type:"script",code:this.code,domain:this.domain}},t.prototype.eq=function(e){if(!(e instanceof t))return!1;var r=e;return r.code===this.code||r.f===this.f},t.prototype.clone=function(){return new t(this.domain,this.f)},t}();function Os(t,e){return t.map?e.mappingFunction(t.map):new Ls(t.domain||[0,1],"linear",t.range||[0,1])}function Vs(){return{script:xs,linear:Ls,log:Ls,"pow1.1":Ls,pow2:Ls,pow3:Ls}}var Is=Ti(".3n");function ks(t,e){var r=t.getBoxPlotData(e),n=t.getSortMethod();return null==r?NaN:r[n]}function Gs(t,e,r){var n="normalized"===r?t.getBoxPlotData(e):t.getRawBoxPlotData(e);return null==n?NaN:n[t.getSortMethod()]}function Hs(t,e,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),r=r||null==t||isNaN(t),n=n||null==e||isNaN(e),r?n?0:-1:n?1:t-e}function Ps(t,e,r){return void 0===r&&(r=.001),V(t.min,e.min,r)&&V(t.max,e.max,r)&&t.filterMissing===e.filterMissing}function Fs(t,e){return!t||(isNaN(e)?!t.filterMissing:!(isFinite(t.min)&&e<t.min||isFinite(t.max)&&e>t.max))}function Us(t){return!t.filterMissing&&!isFinite(t.min)&&!isFinite(t.max)}function Bs(t){return{min:null!=t.min&&isFinite(t.min)?t.min:-1/0,max:null!=t.max&&isFinite(t.max)?t.max:1/0,filterMissing:t.filterMissing}}var js=function(t){function e(e,r,n){var i=t.call(this,e,tn(r,{groupRenderer:"boxplot",summaryRenderer:"histogram"}))||this;return i.currentFilter={min:-1/0,max:1/0,filterMissing:!1},i.filterAccuracy=.001,i.numberFormat=Ti(".2f"),i.currentGroupThresholds=[],i.groupSortMethod=vt.median,i.mapping=Os(r,n),i.original=i.mapping.clone(),i.colorMapping=n.colorMappingFunction(r.colorMapping||r.color),r.numberFormat&&(i.numberFormat=Ti(r.numberFormat)),r.filterAccuracy&&(i.filterAccuracy=r.filterAccuracy),i}var r;return i(e,t),r=e,e.prototype.getNumberFormat=function(){return this.numberFormat},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.map=this.mapping.toJSON(),r.colorMapping=this.colorMapping.toJSON(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r.groupSortMethod=this.groupSortMethod,this.currentGroupThresholds&&(r.stratifyThreshholds=this.currentGroupThresholds),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.map?this.mapping=r.mappingFunction(e.map):e.domain&&(this.mapping=new Ls(e.domain,"linear",e.range||[0,1])),e.colorMapping&&(this.colorMapping=r.colorMappingFunction(e.colorMapping)),e.groupSortMethod&&(this.groupSortMethod=e.groupSortMethod),e.filter&&(this.currentFilter=Bs(e.filter)),e.stratifyThreshholds&&(this.currentGroupThresholds=e.stratifyThresholds)},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_MAPPING_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_FILTER_CHANGED,r.EVENT_SORTMETHOD_CHANGED,r.EVENT_GROUPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getLabel=function(e){if(this.desc.numberFormat){var r=this.getRawValue(e);return isNaN(r)?"NaN":isFinite(r)?this.numberFormat(r):r.toString()}var n=t.prototype.getValue.call(this,e);return"number"==typeof n?this.numberFormat(+n):String(n)},e.prototype.getRange=function(){return this.mapping.getRange(this.numberFormat)},e.prototype.getRawValue=function(e){var r=t.prototype.getValue.call(this,e);return vn(r)?NaN:+r},e.prototype.getExportValue=function(e,r){return"json"===r?this.getRawValue(e):t.prototype.getExportValue.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getNumber(t);return isNaN(e)?null:e},e.prototype.getNumber=function(t){var e=this.getRawValue(t);return isNaN(e)?NaN:this.mapping.apply(e)},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getRawNumber=function(t){return this.getRawValue(t)},e.prototype.toCompareValue=function(t,e){return null!=e?e:this.getNumber(t)},e.prototype.toCompareValueType=function(){return ot.FLOAT},e.prototype.toCompareGroupValue=function(t,e,r){return function(t,e,r,n){var i=A();return n?i.pushAll(n):i.pushAll(t.map((function(t){return e.getNumber(t)}))),i.build()[r]}(t,this,this.groupSortMethod,r)},e.prototype.toCompareGroupValueType=function(){return ot.FLOAT},e.prototype.getOriginalMapping=function(){return this.original.clone()},e.prototype.getMapping=function(){return this.mapping.clone()},e.prototype.setMapping=function(t){this.mapping.eq(t)||this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],this.mapping.clone(),this.mapping=t)},e.prototype.getColor=function(t){var e=this.getNumber(t);return isNaN(e)?"#C1C1C1":this.colorMapping.apply(e)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return!Us(this.currentFilter)},e.prototype.getFilter=function(){return Object.assign({},this.currentFilter)},e.prototype.setFilter=function(t){if(!Ps(t=t||{min:-1/0,max:1/0,filterMissing:!1},this.currentFilter,this.filterAccuracy)){var e=this.getFilter();this.currentFilter.min=bn(t.min)?-1/0:t.min,this.currentFilter.max=bn(t.max)?1/0:t.max,this.currentFilter.filterMissing=t.filterMissing,this.fire([r.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],e,this.getFilter())}},e.prototype.filter=function(t){return Fs(this.currentFilter,this.getRawNumber(t))},e.prototype.clearFilter=function(){var t=this.isFiltered();return this.setFilter(null),t},e.prototype.getGroupThresholds=function(){return this.currentGroupThresholds.slice()},e.prototype.setGroupThresholds=function(t){if(!z(this.currentGroupThresholds,t)){var e=this.getGroupThresholds();this.currentGroupThresholds=t.slice(),this.fire([r.EVENT_GROUPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],e,t)}},e.prototype.group=function(t){var e=this.getRawNumber(t);if(isNaN(e))return Object.assign({},En);var r=this.currentGroupThresholds;if(0===r.length){var n=this.mapping.domain;r=[(n[1]-n[0])/2]}var i=r.findIndex((function(t){return e<=t}));switch(i){case-1:return{name:this.label+" > "+this.numberFormat(r[r.length-1]),color:this.colorMapping.apply(1)};case 0:return{name:this.label+" <= "+this.numberFormat(r[0]),color:this.colorMapping.apply(0)};default:return{name:this.numberFormat(r[i-1])+" <= "+this.label+" <= "+this.numberFormat(r[i]),color:this.colorMapping.apply(this.mapping.apply((r[i-1]+r[i])/2))}}},e.prototype.getSortMethod=function(){return this.groupSortMethod},e.prototype.setSortMethod=function(t){this.groupSortMethod!==t&&(this.fire([r.EVENT_SORTMETHOD_CHANGED],this.groupSortMethod,this.groupSortMethod=t),this.isGroupSortedByMe().asc||this.toggleMyGroupSorting())},e.EVENT_MAPPING_CHANGED="mappingChanged",e.EVENT_COLOR_MAPPING_CHANGED="colorMappingChanged",e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_SORTMETHOD_CHANGED="sortMethodChanged",e.EVENT_GROUPING_CHANGED="groupingChanged",e=r=a([_t("rename","clone","sort","sortBy","groupBy","sortGroupBy","filterNumber","colorMapped","editMapping"),Tt("sortGroup","sortNumber"),Tt("group","groupNumber"),Ct("number"),gt("descending")],e)}(xt),Ys=function(t){function e(e,r,n){var i=t.call(this,e,r)||this;return i.numberFormat=Is,i.currentFilter={min:-1/0,max:1/0,filterMissing:!1},i.mapping=Os(r,n),i.original=i.mapping.clone(),i.colorMapping=n.colorMappingFunction(r.colorMapping),r.numberFormat&&(i.numberFormat=Ti(r.numberFormat)),i.sort=r.sort||yt.min,i}var r;return i(e,t),r=e,e.prototype.getNumberFormat=function(){return this.numberFormat},e.prototype.toCompareValue=function(t){return ks(this,t)},e.prototype.toCompareValueType=function(){return ot.FLOAT},e.prototype.getBoxPlotData=function(t){return this.getValue(t)},e.prototype.getRange=function(){return this.mapping.getRange(this.numberFormat)},e.prototype.getRawBoxPlotData=function(t){return this.getRawValue(t)},e.prototype.getRawValue=function(e){return t.prototype.getValue.call(this,e)},e.prototype.getExportValue=function(e,r){return"json"===r?this.getRawValue(e):t.prototype.getExportValue.call(this,e,r)},e.prototype.getValue=function(t){var e=this,r=this.getRawValue(t);if(null==r)return null;var n={min:this.mapping.apply(r.min),max:this.mapping.apply(r.max),median:this.mapping.apply(r.median),q1:this.mapping.apply(r.q1),q3:this.mapping.apply(r.q3)};return r.outlier&&Object.assign(n,{outlier:r.outlier.map((function(t){return e.mapping.apply(t)}))}),null!=r.whiskerLow&&Object.assign(n,{whiskerLow:this.mapping.apply(r.whiskerLow)}),null!=r.whiskerHigh&&Object.assign(n,{whiskerHigh:this.mapping.apply(r.whiskerHigh)}),n},e.prototype.getNumber=function(t){return Gs(this,t,"normalized")},e.prototype.getRawNumber=function(t){return Gs(this,t,"raw")},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getLabel=function(t){var e=this.getRawValue(t);if(null==e)return"";var r=this.numberFormat;return"BoxPlot(min = "+r(e.min)+", q1 = "+r(e.q1)+", median = "+r(e.median)+", q3 = "+r(e.q3)+", max = "+r(e.max)+")"},e.prototype.getSortMethod=function(){return this.sort},e.prototype.setSortMethod=function(t){this.sort!==t&&(this.fire(r.EVENT_SORTMETHOD_CHANGED,this.sort,this.sort=t),this.isSortedByMe().asc||this.sortByMe())},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.sortMethod=this.getSortMethod(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r.map=this.mapping.toJSON(),r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.sortMethod&&(this.sort=e.sortMethod),e.filter&&(this.currentFilter=Bs(e.filter)),(e.map||e.domain)&&(this.mapping=Os(e,r)),e.colorMapping&&(this.colorMapping=r.colorMappingFunction(e.colorMapping))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SORTMETHOD_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_MAPPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getOriginalMapping=function(){return this.original.clone()},e.prototype.getMapping=function(){return this.mapping.clone()},e.prototype.setMapping=function(t){this.mapping.eq(t)||this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.mapping.clone(),this.mapping=t)},e.prototype.getColor=function(t){return js.prototype.getColor.call(this,t)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return js.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return js.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){js.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return js.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return js.prototype.clearFilter.call(this)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=js.EVENT_COLOR_MAPPING_CHANGED,e.EVENT_SORTMETHOD_CHANGED=js.EVENT_SORTMETHOD_CHANGED,e.EVENT_FILTER_CHANGED=js.EVENT_FILTER_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterNumber","colorMapped","editMapping"),Tt("sort","sortBoxPlot"),Ct("array"),gt("descending")],e)}(xt),Ws=function(t){function e(e,r){return t.call(this,e,tn(r,{width:200}))||this}return i(e,t),e.prototype.getValue=function(t){var e=this.getMap(t);return 0===e.length?null:e},e.prototype.getLabels=function(t){return this.getMap(t).map((function(t){var e=t.key,r=t.value;return{key:e,value:String(r)}}))},e.prototype.getMap=function(e){return function(t){if(!t)return[];if(t instanceof Map)return Array.from(t.entries()).map((function(t){return{key:t[0],value:t[1]}})).sort(zs);if(Array.isArray(t))return t;return Object.keys(t).map((function(e){return{key:e,value:t[e]}})).sort(zs)}(t.prototype.getValue.call(this,e))},e.prototype.getMapLabel=function(t){return this.getLabels(t)},e.prototype.getLabel=function(t){return"{"+this.getLabels(t).map((function(t){return t.key+": "+t.value})).join(", ")+"}"},e=a([Ct("map")],e)}(xt);function zs(t,e){return t===e?0:t.key.localeCompare(e.key)}var qs=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.lookup=new Map,n.categories=Rn(r),n.categories.forEach((function(t){return n.lookup.set(t.name,t)})),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.parseValue=function(t){if(!t)return null;var e=String(t);return this.lookup.has(e)?this.lookup.get(e):null},e.prototype.getCategoryMap=function(e){var r=this;return t.prototype.getMap.call(this,e).map((function(t){var e=t.key,n=t.value;return{key:e,value:r.parseValue(n)}}))},e.prototype.getCategories=function(t){return this.getCategoryMap(t).map((function(t){return t.value}))},e.prototype.getColors=function(t){var e=this;return this.getCategoryMap(t).map((function(t){var r=t.key,n=t.value;return{key:r,value:n?e.colorMapping.apply(n):"#C1C1C1"}}))},e.prototype.getValue=function(t){var e=this.getCategoryMap(t);return 0===e.length?null:e.map((function(t){var e=t.key,r=t.value;return{key:e,value:r?r.name:null}}))},e.prototype.getLabels=function(t){return this.getCategoryMap(t).map((function(t){var e=t.key,r=t.value;return{key:e,value:r?r.label:""}}))},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){return Mn.prototype.setColorMapping.call(this,t)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories)},e.prototype.iterCategory=function(t){return this.getCategories(t)},e.EVENT_COLOR_MAPPING_CHANGED=Mn.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","colorMappedCategorical")],e)}(Ws),Ks=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.lookup=new Map,n.categories=Rn(r),n.categories.forEach((function(t){return n.lookup.set(t.name,t)})),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getCategories=function(e){var r=this;return t.prototype.getValues.call(this,e).map((function(t){if(!t)return null;var e=String(t);return r.lookup.has(e)?r.lookup.get(e):null}))},e.prototype.getColors=function(t){var e=this;return this.getCategories(t).map((function(t){return t?e.colorMapping.apply(t):"#C1C1C1"}))},e.prototype.iterCategory=function(t){return this.getCategories(t)},e.prototype.getValues=function(t){return this.getCategories(t).map((function(t){return t?t.name:null}))},e.prototype.getLabels=function(t){return this.getCategories(t).map((function(t){return t?t.label:""}))},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){return Mn.prototype.setColorMapping.call(this,t)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories)},e.EVENT_COLOR_MAPPING_CHANGED=Mn.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","colorMappedCategorical")],e)}(gi);function Xs(t,e){var r=new Date(t);return"max"===e?(r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999)):(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),r.getTime()}function $s(t,e){switch(t.granularity){case"century":var r=Math.floor(e.getFullYear()/100);if(t.circular){var n=r%10;return{value:n,name:"*"+n+"00"}}return{value:r,name:r+"00"};case"decade":var i=Math.floor(e.getFullYear()/10);if(t.circular){var o=i%10;return{value:o,name:"**"+o+"0"}}return{value:i,name:i+"0"};case"year":if(t.circular){var a=e.getFullYear()%10;return{value:a,name:"***"+a}}return{value:e.getFullYear(),name:String(e.getFullYear())};case"month":return t.circular?{value:e.getMonth(),name:da("%B")(e)}:{value:zo(e).getTime(),name:da("%B %Y")(e)};case"week":return t.circular?{value:e.getMonth(),name:da("%W")(e)}:{value:Ho(e).getTime(),name:da("%W %Y")(e)};case"day_of_week":return t.circular?{value:e.getDay(),name:da("%A")(e)}:{value:ko(e).getTime(),name:da("%x")(e)};case"day_of_month":return t.circular?{value:e.getDate(),name:da("%d")(e)}:{value:ko(e).getTime(),name:da("%x")(e)};case"day_of_year":if(t.circular){var s=da("%j")(e);return{value:parseInt(s,10),name:s}}return{value:ko(e).getTime(),name:da("%x")(e)};case"hour":return t.circular?{value:e.getHours(),name:da("%A")(e)}:{value:Vo(e).getTime(),name:da("%x")(e)};case"minute":return t.circular?{value:e.getMinutes(),name:da("%A")(e)}:{value:xo(e).getTime(),name:da("%x")(e)};case"second":return t.circular?{value:e.getSeconds(),name:da("%A")(e)}:{value:Mo(e).getTime(),name:da("%x")(e)}}return{value:e.getTime(),name:e.toString()}}function Js(t,e,r,n){var i=(n||t.map((function(t){return r.getDate(t)}))).filter((function(t){return t instanceof Date}));if(s(i))return{value:null,name:""};var o=function(t){var e=Float64Array.from(t);if(1===e.length)return e[0];return e.sort(),e[Math.floor(e.length/2)]}(i.map((function(t){return t.getTime()})));return e?$s(e,new Date(o)):{value:o,name:new Date(o).toString()}}var Qs,Zs=function(t){function e(e,n){var i=t.call(this,e,tn(n,{groupRenderer:"datehistogram",summaryRenderer:"datehistogram"}))||this;i.currentFilter={min:-1/0,max:1/0,filterMissing:!1},i.currentGrouper={granularity:"month",circular:!1};var o=da(n.dateFormat||r.DEFAULT_DATE_FORMAT);return i.format=function(t){return t instanceof Date?o(t):""},i.parse=n.dateParse?ga(n.dateParse):ga(n.dateFormat||r.DEFAULT_DATE_FORMAT),i}var r;return i(e,t),r=e,e.prototype.getFormatter=function(){return this.format},e.prototype.dump=function(e){var r,n=t.prototype.dump.call(this,e);return n.filter=Us(this.currentFilter)?null:this.currentFilter,this.currentGrouper&&(r=this.currentGrouper,!pi({granularity:"month",circular:!1},r))&&(n.grouper=this.currentGrouper),n},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.filter&&(this.currentFilter=Bs(e.filter)),e.grouper&&(this.currentGrouper=e.grouper)},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_FILTER_CHANGED,r.EVENT_GROUPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){return this.getDate(t)},e.prototype.getDate=function(e){var r=t.prototype.getValue.call(this,e);return vn(r)?null:r instanceof Date?r:this.parse(String(r))},e.prototype.iterDate=function(t){return[this.getDate(t)]},e.prototype.getLabel=function(t){var e=this.getValue(t);return this.format(e)},e.prototype.isFiltered=function(){return!Us(this.currentFilter)},e.prototype.clearFilter=function(){var t=this.isFiltered();return this.setFilter(null),t},e.prototype.getFilter=function(){return Object.assign({},this.currentFilter)},e.prototype.setFilter=function(t){if(!Ps(t=t||{min:-1/0,max:1/0,filterMissing:!1},this.currentFilter)){var e=this.getFilter();this.currentFilter.min=bn(t.min)?-1/0:t.min,this.currentFilter.max=bn(t.max)?1/0:t.max,this.currentFilter.filterMissing=t.filterMissing,this.fire([r.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],e,this.getFilter())}},e.prototype.filter=function(t,e){return r=this.currentFilter,n=void 0!==e?e:this.getDate(t),!r||(null!=n&&n instanceof Date?Fs(r,n.getTime()):!r.filterMissing);var r,n},e.prototype.toCompareValue=function(t,e){var r=void 0!==e?e:this.getValue(t);return r instanceof Date?r.getTime():NaN},e.prototype.toCompareValueType=function(){return ot.DOUBLE_ASC},e.prototype.getDateGrouper=function(){return Object.assign({},this.currentGrouper)},e.prototype.setDateGrouper=function(t){if(!pi(this.currentGrouper,t)){var e=this.getDateGrouper();this.currentGrouper=Object.assign({},t),this.fire([r.EVENT_GROUPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],e,t)}},e.prototype.group=function(t,e){var r=void 0!==e?e:this.getDate(t);return r&&r instanceof Date?this.currentGrouper?{name:$s(this.currentGrouper,r).name,color:"#C1C1C1"}:Object.assign({},st):Object.assign({},En)},e.prototype.toCompareGroupValue=function(t,e,r){var n=Js(t,this.currentGrouper,this,r).value;return null==n?NaN:n},e.prototype.toCompareGroupValueType=function(){return ot.DOUBLE_ASC},e.EVENT_FILTER_CHANGED="filterChanged",e.EVENT_GROUPING_CHANGED="groupingChanged",e.DEFAULT_DATE_FORMAT="%x",e=r=a([_t("rename","clone","sort","sortBy","groupBy","sortGroupBy","filterDate"),Tt("group","groupDate"),Ct("date")],e)}(xt);!function(t){t.min="min",t.max="max",t.median="median"}(Qs||(Qs={}));var tu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"datehistogram",groupRenderer:"datehistogram",summaryRenderer:"datehistogram"}))||this;n.currentFilter={min:-1/0,max:1/0,filterMissing:!1};var i=da(r.dateFormat||Zs.DEFAULT_DATE_FORMAT);return n.format=function(t){return t instanceof Date?i(t):""},n.parse=r.dateParse?ga(r.dateParse):ga(r.dateFormat||Zs.DEFAULT_DATE_FORMAT),n.sort=r.sort||Qs.median,n}var r;return i(e,t),r=e,e.prototype.getFormatter=function(){return this.format},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SORTMETHOD_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getDates(t);return e.every((function(t){return null==t}))?null:e},e.prototype.getLabels=function(t){var e=this;return this.getDates(t).map((function(t){return t instanceof Date?e.format(t):""}))},e.prototype.getDates=function(e){var r=this;return t.prototype.getValues.call(this,e).map((function(t){return vn(t)?null:t instanceof Date?t:r.parse(String(t))}))},e.prototype.getDate=function(t){var e=this.getDates(t).filter(Boolean);return 0===e.length?null:new Date(eu(e,this.sort))},e.prototype.iterDate=function(t){return this.getDates(t)},e.prototype.getSortMethod=function(){return this.sort},e.prototype.setSortMethod=function(t){this.sort!==t&&(this.fire([r.EVENT_SORTMETHOD_CHANGED],this.sort,this.sort=t),this.isSortedByMe().asc||this.sortByMe())},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.sortMethod=this.getSortMethod(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.sortMethod&&(this.sort=e.sortMethod),e.filter&&(this.currentFilter=Bs(e.filter))},e.prototype.toCompareValue=function(t){var e=this.getDates(t).filter(Boolean);return e?[e.length,eu(e,this.sort)]:[0,0]},e.prototype.toCompareValueType=function(){return[dn(this.dataLength),ot.DOUBLE_ASC]},e.prototype.isFiltered=function(){return Zs.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return Zs.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){Zs.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return Zs.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return Zs.prototype.clearFilter.call(this)},e.EVENT_SORTMETHOD_CHANGED="sortMethodChanged",e.EVENT_FILTER_CHANGED=Zs.EVENT_FILTER_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterDate"),Tt("sort","sortDates")],e)}(gi);function eu(t,e){switch(e){case Qs.min:return E(t,(function(t){return t.getTime()}));case Qs.max:return C(t,(function(t){return t.getTime()}));case Qs.median:return w(t,(function(t){return t.getTime()}))}}var ru,nu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"default"}))||this;n.currentFilter={min:-1/0,max:1/0,filterMissing:!1};var i=da(r.dateFormat||Zs.DEFAULT_DATE_FORMAT);return n.format=function(t){return t instanceof Date?i(t):""},n.parse=r.dateParse?ga(r.dateParse):ga(r.dateFormat||Zs.DEFAULT_DATE_FORMAT),n.sort=r.sort||Qs.median,n}var r;return i(e,t),r=e,e.prototype.getFormatter=function(){return this.format},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SORTMETHOD_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.parseValue=function(t){return vn(t)?null:t instanceof Date?t:this.parse(String(t))},e.prototype.getDateMap=function(e){var r=this;return t.prototype.getMap.call(this,e).map((function(t){var e=t.key,n=t.value;return{key:e,value:r.parseValue(n)}}))},e.prototype.iterDate=function(t){return this.getDates(t)},e.prototype.getValue=function(t){var e=this.getDateMap(t);return e.every((function(t){return null==t}))?null:e},e.prototype.getLabels=function(t){var e=this;return this.getDateMap(t).map((function(t){var r=t.key,n=t.value;return{key:r,value:n instanceof Date?e.format(n):""}}))},e.prototype.getDates=function(t){return this.getDateMap(t).map((function(t){return t.value}))},e.prototype.getDate=function(t){return tu.prototype.getDate.call(this,t)},e.prototype.getSortMethod=function(){return this.sort},e.prototype.setSortMethod=function(t){return tu.prototype.setSortMethod.call(this,t)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.sortMethod=this.getSortMethod(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.sortMethod&&(this.sort=e.sortMethod),e.filter&&(this.currentFilter=Bs(e.filter))},e.prototype.isFiltered=function(){return Zs.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return Zs.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){Zs.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return Zs.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return Zs.prototype.clearFilter.call(this)},e.EVENT_SORTMETHOD_CHANGED=tu.EVENT_SORTMETHOD_CHANGED,e.EVENT_FILTER_CHANGED=Zs.EVENT_FILTER_CHANGED,e=r=a([_t("rename","filterDate"),Tt("sort","sortDates")],e)}(Ws);function iu(t){return void 0===t&&(t="Group Name"),{type:"group",label:t}}!function(t){t.name="name",t.count="count"}(ru||(ru={}));var ou=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.groupSortMethod=ru.name,e}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"frozen",{get:function(){return!1!==this.desc.frozen},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SORTMETHOD_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getLabel=function(){return""},e.prototype.getValue=function(){return""},e.prototype.getSortMethod=function(){return this.groupSortMethod},e.prototype.setSortMethod=function(t){this.groupSortMethod!==t&&(this.fire(r.EVENT_SORTMETHOD_CHANGED,this.groupSortMethod,this.groupSortMethod=t),this.isGroupSortedByMe().asc||this.toggleMyGroupSorting())},e.prototype.toCompareGroupValue=function(t,e){return"count"===this.groupSortMethod?t.length:e.name===En.name?null:e.name.toLowerCase()},e.prototype.toCompareGroupValueType=function(){return"count"===this.groupSortMethod?ot.COUNT:ot.STRING},e.EVENT_SORTMETHOD_CHANGED="sortMethodChanged",e=r=a([dt(),_t("rename","sortGroupBy"),Tt("sortGroup","sortGroups"),Ct("support")],e)}(pt),au=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"categorical"}))||this;return n.currentMaxDepth=1/0,n.currentLeaves=[],n.currentLeavesNameCache=new Map,n.currentLeavesPathCache=new Map,n.hierarchySeparator=r.hierarchySeparator||".",n.hierarchy=n.initHierarchy(r.hierarchy),n.currentNode=n.hierarchy,n.currentLeaves=su(n.currentNode,n.currentMaxDepth),n.updateCaches(),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.initHierarchy=function(t){var e=cn(),r=this.hierarchySeparator,n=function(t,i){var o=null==i.name?String(i.value):i.name,a=(i.children||[]).map((function(i){if("string"==typeof i){var a=t+i;return{path:a,name:i,label:a,color:e(),value:0,children:[]}}var s=n(""+t+o+r,i);return s.color||(s.color=e()),s})),s=t+o,u=i.label?i.label:s;return{path:s,name:o,children:a,label:u,color:i.color,value:0}};return n("",t)},Object.defineProperty(e.prototype,"categories",{get:function(){return this.currentLeaves},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_CUTOFF_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.colorMapping=this.colorMapping.toJSON(),isFinite(this.currentMaxDepth)&&(r.maxDepth=this.currentMaxDepth),this.currentNode!==this.hierarchy&&(r.cutOffNode=this.currentNode.path),r},e.prototype.restore=function(e,r){if(t.prototype.restore.call(this,e,r),this.colorMapping=r.categoricalColorMappingFunction(e.colorMapping,this.categories),void 0!==e.maxDepth&&(this.currentMaxDepth=e.maxDepth),void 0!==e.cutOffNode){for(var n=e.cutOffNode.split(this.hierarchySeparator),i=this.hierarchy,o=n.shift();o&&i;){if(i.name!==o){i=null;break}var a=n.shift();if(!a)break;o=a,i=i.children.find((function(t){return t.name===o}))||null}this.currentNode=i||this.hierarchy}void 0===e.maxDepth&&void 0===e.cutOffNode||(this.currentLeaves=su(this.currentNode,this.currentMaxDepth),this.updateCaches())},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([Mn.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.getCutOff=function(){return{node:this.currentNode,maxDepth:this.currentMaxDepth}},e.prototype.setCutOff=function(t){var e=null==t.maxDepth?1/0:t.maxDepth;if(this.currentNode!==t.node||this.currentMaxDepth!==e){var n=this.getCutOff();this.currentNode=t.node,this.currentMaxDepth=e,this.currentLeaves=su(t.node,e),this.updateCaches(),this.fire([r.EVENT_CUTOFF_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],n,this.getCutOff())}},e.prototype.getCategory=function(e){var r=this,n=t.prototype.getValue.call(this,e);return null==n||""===n?null:(n=n.trim(),this.currentLeavesNameCache.has(n)?this.currentLeavesNameCache.get(n):this.currentLeavesPathCache.has(n)?this.currentLeavesPathCache.get(n):this.currentLeaves.find((function(t){return t.path===n||t.name===n||n.startsWith(t.path+r.hierarchySeparator)}))||null)},Object.defineProperty(e.prototype,"dataLength",{get:function(){return this.currentLeaves.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labels",{get:function(){return this.currentLeaves.map((function(t){return t.label}))},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.getCategory(t);return e?e.name:null},e.prototype.getCategories=function(t){return[this.getCategory(t)]},e.prototype.iterCategory=function(t){return[this.getCategory(t)]},e.prototype.getLabel=function(t){return Mn.prototype.getLabel.call(this,t)},e.prototype.getColor=function(t){return Mn.prototype.getColor.call(this,t)},e.prototype.getLabels=function(t){return Mn.prototype.getLabels.call(this,t)},e.prototype.getValues=function(t){return Mn.prototype.getValues.call(this,t)},e.prototype.getMap=function(t){return Mn.prototype.getMap.call(this,t)},e.prototype.getMapLabel=function(t){return Mn.prototype.getMapLabel.call(this,t)},e.prototype.getSet=function(t){return Mn.prototype.getSet.call(this,t)},e.prototype.toCompareValue=function(t){return Mn.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return Mn.prototype.toCompareValueType.call(this)},e.prototype.group=function(t){var e=this.getCategory(t);return e?{name:e.label,color:e.color}:Object.assign({},En)},e.prototype.updateCaches=function(){var t=this;this.currentLeavesPathCache.clear(),this.currentLeavesNameCache.clear(),this.currentLeaves.forEach((function(e){t.currentLeavesPathCache.set(e.path,e),t.currentLeavesNameCache.set(e.name,e)}))},e.EVENT_CUTOFF_CHANGED="cutOffChanged",e.EVENT_COLOR_MAPPING_CHANGED="colorMappingChanged",e=r=a([_t("rename","clone","sort","sortBy","cutoff","group","groupBy","colorMappedCategorical"),Ct("categorical")],e)}(xt);function su(t,e){void 0===e&&(e=1/0);var r=[],n=function(t,i){i>=e||0===t.children.length?r.push(t):t.children.forEach((function(t){return n(t,i+1)}))};return n(t,0),r}function uu(t){for(var e=[t],r=0;r<e.length;)for(var n=0,i=e[r++].children;n<i.length;n++){var o=i[n];e.push(o)}return e}function lu(t){return 0!==t.length&&"string"!=typeof t[0]&&t.some((function(t){return null!=t.parent}))}function cu(t){var e=new Map;t.forEach((function(t){var r=t.parent||"",n=Object.assign({children:[],label:t.name,name:t.name,color:"#C1C1C1",value:0},e.get(t.name)||{},t);e.set(t.name,n),e.has(r)||e.set(r,{name:r,children:[],label:r,value:0,color:"#C1C1C1"}),e.get(r).children.push(n)}));var r=e.get("");return console.assert(void 0!==r,"hierarchy with no root"),1===r.children.length?r.children[0]:r}var pu=function(){function t(e){this.name=e,this.apply=t.FUNCTIONS[e]||Gr}return t.prototype.toJSON=function(){return this.name},t.prototype.clone=function(){return this},t.prototype.eq=function(e){return e instanceof t&&e.name===this.name},t.FUNCTIONS={interpolateBlues:Gr,interpolateGreens:Hr,interpolateGreys:Pr,interpolateOranges:Br,interpolatePurples:Fr,interpolateReds:Ur,interpolateCool:Wr,interpolateCubehelixDefault:jr,interpolateWarm:Yr,interpolatePlasma:Qr,interpolateMagma:$r,interpolateViridis:Xr,interpolateInferno:Jr,interpolateYlOrRd:kr,interpolateYlOrBr:Ir,interpolateBuGn:wr,interpolateBuPu:Rr,interpolateGnBu:Ar,interpolateOrRd:Dr,interpolatePuBuGn:Sr,interpolatePuBu:Mr,interpolatePuRd:Lr,interpolateRdPu:xr,interpolateYlGnBu:Or,interpolateYlGn:Vr,interpolateRainbow:qr},t}(),fu=function(){function t(e){this.name=e,this.apply=t.FUNCTIONS[e]||Gr}return t.prototype.toJSON=function(){return this.name},t.prototype.clone=function(){return this},t.prototype.eq=function(e){return e instanceof t&&e.name===this.name},t.FUNCTIONS={interpolateBrBG:mr,interpolatePRGn:yr,interpolatePiYG:vr,interpolatePuOr:br,interpolateRdBu:Er,interpolateRdGy:Cr,interpolateRdYlBu:Nr,interpolateRdYlGn:_r,interpolateSpectral:Tr},t}(),hu=function(){function t(t){this.apply=t}return t.prototype.toJSON=function(){return this.apply.toString()},t.prototype.clone=function(){return this},t.prototype.eq=function(e){return e instanceof t&&e.apply===this.apply},t}(),du=function(){function t(t){this.color=t}return t.prototype.apply=function(){return this.color},t.prototype.toJSON=function(){return this.color},t.prototype.clone=function(){return this},t.prototype.eq=function(e){return e instanceof t&&e.color===this.color},t}(),gu=function(){function t(t,e){if("function"==typeof t.apply)this.base=t,this.steps=null==e?5:e;else{var r=t;this.base=e.colorMappingFunction(r.base),this.steps=r.steps}}return t.prototype.apply=function(t){return this.base.apply(function(t,e){var r=1/e;if(t<=r)return 0;if(t>=1-r)return 1;for(var n=0;n<1;n+=r)if(t<n)return n-r/2;return t}(t,this.steps))},t.prototype.toJSON=function(){return{type:"quantized",base:this.base.toJSON(),steps:this.steps}},t.prototype.clone=function(){return new t(this.base.clone(),this.steps)},t.prototype.eq=function(e){return e instanceof t&&e.base.eq(this.base)&&e.steps===this.steps},t}(),mu=function(){function t(t){this.scale=co(),this.entries=Array.isArray(t)?t:t.entries,this.scale.domain(this.entries.map((function(t){return t.value}))).range(this.entries.map((function(t){return t.color}))).clamp(!0)}return t.prototype.apply=function(t){return this.scale(t)},t.prototype.toJSON=function(){return{type:"custom",entries:this.entries}},t.prototype.clone=function(){return new t(this.entries.slice())},t.prototype.eq=function(e){return e instanceof t&&pi(this.entries,e.entries)},t}();var yu=new du("#C1C1C1");function vu(t){return void 0===t&&(t="Imposition"),{type:"imposition",label:t}}var bu=function(t){function e(e,r){return t.call(this,e,tn(r,{renderer:"number",groupRenderer:"boxplot",summaryRenderer:"histogram"}))||this}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"label",{get:function(){var e=t.prototype.getMetaData.call(this).label,r=this._children;if("Imposition"!==e||0===r.length)return e;if(1===r.length)return r[0].label;var n=this.wrapper,i=this.rest;return(n?n.label:"?")+" ("+i.map((function(t){return t.label})).join(", ")+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapper",{get:function(){return this._children.find(St)||null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rest",{get:function(){var t=this.wrapper;return this._children.filter((function(e){return e!==t}))},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_MAPPING_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getLabel=function(t){var e=this._children;if(0===e.length)return"";if(1===e.length)return e[0].getLabel(t);var r=this.wrapper,n=this.rest;return(r?r.getLabel(t):"?")+" ("+n.map((function(e){return e.label+" = "+e.getLabel(t)})).join(", ")+")"},e.prototype.getColor=function(t){var e=this._children;switch(e.length){case 0:return"#C1C1C1";case 1:return e[0].getColor(t);default:return this.rest[0].getColor(t)}},e.prototype.getNumberFormat=function(){var t=this.wrapper;return t?t.getNumberFormat():Is},e.prototype.getValue=function(t){var e=this.wrapper;return e?e.getValue(t):NaN},e.prototype.getNumber=function(t){var e=this.wrapper;return e?e.getNumber(t):NaN},e.prototype.getRawNumber=function(t){var e=this.wrapper;return e?e.getRawNumber(t):NaN},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getExportValue=function(e,r){if("json"===r){var n=this.getRawNumber(e);return isNaN(n)?null:{label:this.getLabel(e),color:this.getColor(e),value:n}}return t.prototype.getExportValue.call(this,e,r)},e.prototype.getMapping=function(){var t=this.wrapper;return t&&Dt(t)?t.getMapping():new Ls},e.prototype.getOriginalMapping=function(){var t=this.wrapper;return t&&Dt(t)?t.getOriginalMapping():new Ls},e.prototype.setMapping=function(t){var e=this.wrapper;return e&&Dt(e)?e.setMapping(t):void 0},e.prototype.getColorMapping=function(){var t=this.wrapper;return t&&Dt(t)?t.getColorMapping():yu},e.prototype.setColorMapping=function(t){var e=this.wrapper;return e&&Dt(e)?e.setColorMapping(t):void 0},e.prototype.getFilter=function(){var t=this.wrapper;return t&&Dt(t)?t.getFilter():{min:-1/0,max:1/0,filterMissing:!1}},e.prototype.setFilter=function(t){var e=this.wrapper;return e&&Dt(e)?e.setFilter(t):void 0},e.prototype.getRange=function(){var t=this.wrapper;return t&&Dt(t)?t.getRange():["0","1"]},e.prototype.toCompareValue=function(t){return js.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return js.prototype.toCompareValueType.call(this)},e.prototype.toCompareGroupValue=function(t,e){return js.prototype.toCompareGroupValue.call(this,t,e)},e.prototype.toCompareGroupValueType=function(){return js.prototype.toCompareGroupValueType.call(this)},e.prototype.insert=function(e,r){return 1!==this._children.length||this.wrapper||St(e)?this._children.length>=2?null:t.prototype.insert.call(this,e,r):null},e.prototype.insertImpl=function(e,r){return St(e)&&this.forward.apply(this,[e].concat(it(".impose",js.EVENT_MAPPING_CHANGED))),Dt(e)&&this.forward.apply(this,[e].concat(it(".impose",js.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.insertImpl.call(this,e,r)},e.prototype.removeImpl=function(e,r){return St(e)&&this.unforward.apply(this,[e].concat(it(".impose",js.EVENT_MAPPING_CHANGED))),Dt(e)&&this.unforward.apply(this,[e].concat(it(".impose",js.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.removeImpl.call(this,e,r)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=js.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterNumber","colorMapped","editMapping"),gt("descending")],e)}(Ot),Eu=function(t){function e(e,r,n){var i=t.call(this,e,tn(r,Object.assign({renderer:"heatmap",groupRenderer:"heatmap",summaryRenderer:"histogram"},null==r.dataLength||Number.isNaN(r.dataLength)?{}:{width:Math.min(Math.max(100,10*r.dataLength),500)})))||this;return i.numberFormat=Is,i.currentFilter={min:-1/0,max:1/0,filterMissing:!1},i.mapping=Os(r,n),i.original=i.mapping.clone(),i.colorMapping=n.colorMappingFunction(r.colorMapping||r.color),r.numberFormat&&(i.numberFormat=Ti(r.numberFormat)),i.sort=r.sort||vt.median,i}var r;return i(e,t),r=e,e.prototype.getNumberFormat=function(){return this.numberFormat},e.prototype.toCompareValue=function(t){return ks(this,t)},e.prototype.toCompareValueType=function(){return ot.FLOAT},e.prototype.getRawNumbers=function(t){return this.getRawValue(t)},e.prototype.getBoxPlotData=function(t){var e=this.getRawValue(t);if(null==e)return null;for(var r=A(),n=0,i=e;n<i.length;n++){var o=i[n];r.push(vn(o)?NaN:this.mapping.apply(o))}return r.build()},e.prototype.getRange=function(){return this.mapping.getRange(this.numberFormat)},e.prototype.getRawBoxPlotData=function(t){var e=this.getRawValue(t);if(null==e)return null;for(var r=A(),n=0,i=e;n<i.length;n++){var o=i[n];r.push(vn(o)?NaN:o)}return r.build()},e.prototype.getNumbers=function(t){return this.getValues(t)},e.prototype.getNumber=function(t){return Gs(this,t,"normalized")},e.prototype.getRawNumber=function(t){return Gs(this,t,"raw")},e.prototype.getValue=function(t){var e=this.getValues(t);return e.every(isNaN)?null:e},e.prototype.getValues=function(t){var e=this;return this.getRawValue(t).map((function(t){return isNaN(t)?NaN:e.mapping.apply(t)}))},e.prototype.iterNumber=function(t){var e=this.getNumbers(t);return e.every(isNaN)?[NaN]:e},e.prototype.iterRawNumber=function(t){var e=this.getRawNumbers(t);return e.every(isNaN)?[NaN]:e},e.prototype.getRawValue=function(e){var r=t.prototype.getRaw.call(this,e);return null==r?[]:r.map((function(t){return vn(t)?NaN:+t}))},e.prototype.getExportValue=function(e,r){return"json"===r?this.getRawValue(e):t.prototype.getExportValue.call(this,e,r)},e.prototype.getLabels=function(t){return this.getRawValue(t).map(this.numberFormat)},e.prototype.getSortMethod=function(){return this.sort},e.prototype.setSortMethod=function(t){this.sort!==t&&(this.fire([r.EVENT_SORTMETHOD_CHANGED,js.EVENT_DIRTY_HEADER,js.EVENT_DIRTY_VALUES,r.EVENT_DIRTY_CACHES,js.EVENT_DIRTY],this.sort,this.sort=t),this.isSortedByMe().asc||this.sortByMe())},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.sortMethod=this.getSortMethod(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r.map=this.mapping.toJSON(),r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.sortMethod&&(this.sort=e.sortMethod),e.filter&&(this.currentFilter=Bs(e.filter)),(e.map||e.domain)&&(this.mapping=Os(e,r)),e.colorMapping&&(this.colorMapping=r.colorMappingFunction(e.colorMapping))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_MAPPING_CHANGED,r.EVENT_SORTMETHOD_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getOriginalMapping=function(){return this.original.clone()},e.prototype.getMapping=function(){return this.mapping.clone()},e.prototype.setMapping=function(t){this.mapping.eq(t)||this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.mapping.clone(),this.mapping=t)},e.prototype.getColor=function(t){return js.prototype.getColor.call(this,t)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return js.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return js.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){js.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return js.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return js.prototype.clearFilter.call(this)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=js.EVENT_COLOR_MAPPING_CHANGED,e.EVENT_SORTMETHOD_CHANGED=js.EVENT_SORTMETHOD_CHANGED,e.EVENT_FILTER_CHANGED=js.EVENT_FILTER_CHANGED,e.CENTER=0,e=r=a([_t("rename","clone","sort","sortBy","filterNumber","colorMapped","editMapping"),Tt("sort","sortNumbers"),gt("descending")],e)}(gi);function Cu(t){return void 0===t&&(t="Imposition"),{type:"impositions",label:t}}var Nu=function(t){function e(e,r){return t.call(this,e,tn(r,{renderer:"boxplot",groupRenderer:"boxplot",summaryRenderer:"boxplot"}))||this}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"label",{get:function(){var e=t.prototype.getMetaData.call(this).label,r=this._children;if("Imposition"!==e||0===r.length)return e;if(1===r.length)return r[0].label;var n=this.wrapper,i=this.rest;return(n?n.label:"?")+" ("+i.map((function(t){return t.label})).join(", ")+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapper",{get:function(){return this._children.find(Mt)||null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rest",{get:function(){var t=this.wrapper;return this._children.filter((function(e){return e!==t}))},enumerable:!0,configurable:!0}),e.prototype.getLabel=function(t){var e=this._children;if(0===e.length)return"";if(1===e.length)return e[0].getLabel(t);var r=this.wrapper,n=this.rest;return(r?r.getLabel(t):"?")+" ("+n.map((function(e){return e.label+" = "+e.getLabel(t)}))+")"},e.prototype.getColor=function(t){var e=this._children;switch(e.length){case 0:return"#C1C1C1";case 1:return e[0].getColor(t);default:return this.rest[0].getColor(t)}},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_MAPPING_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getNumberFormat=function(){var t=this.wrapper;return t?t.getNumberFormat():Is},e.prototype.getValue=function(t){var e=this.wrapper;return e?e.getValue(t):null},e.prototype.getNumber=function(t){var e=this.wrapper;return e?e.getNumber(t):NaN},e.prototype.getRawNumber=function(t){var e=this.wrapper;return e?e.getRawNumber(t):NaN},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getExportValue=function(e,r){if("json"===r){var n=this.getRawNumber(e);return isNaN(n)?null:{label:this.getLabel(e),color:this.getColor(e),value:n}}return t.prototype.getExportValue.call(this,e,r)},e.prototype.getBoxPlotData=function(t){var e=this.wrapper;return e?e.getBoxPlotData(t):null},e.prototype.getRawBoxPlotData=function(t){var e=this.wrapper;return e?e.getRawBoxPlotData(t):null},e.prototype.getMapping=function(){var t=this.wrapper;return t?t.getMapping():new Ls},e.prototype.getOriginalMapping=function(){var t=this.wrapper;return t?t.getOriginalMapping():new Ls},e.prototype.getSortMethod=function(){var t=this.wrapper;return t?t.getSortMethod():yt.min},e.prototype.setSortMethod=function(t){var e=this.wrapper;return e?e.setSortMethod(t):void 0},e.prototype.setMapping=function(t){var e=this.wrapper;return e?e.setMapping(t):void 0},e.prototype.getColorMapping=function(){var t=this.wrapper;return t?t.getColorMapping():yu},e.prototype.setColorMapping=function(t){var e=this.wrapper;return e?e.setColorMapping(t):void 0},e.prototype.getFilter=function(){var t=this.wrapper;return t?t.getFilter():{min:-1/0,max:1/0,filterMissing:!1}},e.prototype.setFilter=function(t){var e=this.wrapper;return e?e.setFilter(t):void 0},e.prototype.getRange=function(){var t=this.wrapper;return t?t.getRange():["0","1"]},e.prototype.toCompareValue=function(t){return Ys.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return Ys.prototype.toCompareValueType.call(this)},e.prototype.group=function(t){return Ys.prototype.group.call(this,t)},e.prototype.toCompareGroupValue=function(t,e){return Ys.prototype.toCompareGroupValue.call(this,t,e)},e.prototype.toCompareGroupValueType=function(){return Ys.prototype.toCompareGroupValueType.call(this)},e.prototype.insert=function(e,r){return 1!==this._children.length||this.wrapper||Mt(e)?this._children.length>=2?null:t.prototype.insert.call(this,e,r):null},e.prototype.insertImpl=function(e,r){return Mt(e)?this.forward.apply(this,[e].concat(it(".impose",Ys.EVENT_MAPPING_CHANGED,Ys.EVENT_COLOR_MAPPING_CHANGED))):Dt(e)&&this.forward.apply(this,[e].concat(it(".impose",Ys.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.insertImpl.call(this,e,r)},e.prototype.removeImpl=function(e,r){return Mt(e)?this.unforward.apply(this,[e].concat(it(".impose",Ys.EVENT_MAPPING_CHANGED,Ys.EVENT_COLOR_MAPPING_CHANGED))):Dt(e)&&this.unforward.apply(this,[e].concat(it(".impose",Ys.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.removeImpl.call(this,e,r)},e.EVENT_MAPPING_CHANGED=Eu.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=Eu.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterNumber","colorMapped","editMapping"),Tt("sort","sortBoxPlot"),gt("descending")],e)}(Ot);function _u(t){return void 0===t&&(t="Imposition"),{type:"impositions",label:t}}var Tu=function(t){function e(e,r){return t.call(this,e,tn(r,{renderer:"numbers",groupRenderer:"numbers",summaryRenderer:"histogram"}))||this}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"label",{get:function(){var e=t.prototype.getMetaData.call(this).label,r=this._children;if("Imposition"!==e||0===r.length)return e;if(1===r.length)return r[0].label;var n=this.wrapper,i=this.rest;return(n?n.label:"?")+" ("+i.map((function(t){return t.label})).join(", ")+")"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapper",{get:function(){return this._children.find(Lt)||null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rest",{get:function(){var t=this.wrapper;return this._children.filter((function(e){return e!==t}))},enumerable:!0,configurable:!0}),e.prototype.getLabel=function(t){var e=this._children;if(0===e.length)return"";if(1===e.length)return e[0].getLabel(t);var r=this.wrapper,n=this.rest;return(r?r.getLabel(t):"?")+" ("+n.map((function(e){return e.label+" = "+e.getLabel(t)}))+")"},e.prototype.getColor=function(t){var e=this._children;switch(e.length){case 0:return"#C1C1C1";case 1:return e[0].getColor(t);default:return this.rest[0].getColor(t)}},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_MAPPING_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},Object.defineProperty(e.prototype,"labels",{get:function(){var t=this.wrapper;return t?t.labels:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataLength",{get:function(){var t=this.wrapper;return t?t.dataLength:null},enumerable:!0,configurable:!0}),e.prototype.getNumberFormat=function(){var t=this.wrapper;return t?t.getNumberFormat():Is},e.prototype.getValue=function(t){var e=this.wrapper;return e?e.getValue(t):[]},e.prototype.getNumber=function(t){var e=this.wrapper;return e?e.getNumber(t):NaN},e.prototype.getRawNumber=function(t){var e=this.wrapper;return e?e.getRawNumber(t):NaN},e.prototype.getExportValue=function(e,r){if("json"===r){var n=this.getRawNumber(e);return isNaN(n)?null:{label:this.getLabels(e),color:this.getColor(e)}}return t.prototype.getExportValue.call(this,e,r)},e.prototype.getNumbers=function(t){var e=this.wrapper;return e?e.getNumbers(t):[]},e.prototype.getRawNumbers=function(t){var e=this.wrapper;return e?e.getRawNumbers(t):[]},e.prototype.iterNumber=function(t){return this.getNumbers(t)},e.prototype.iterRawNumber=function(t){return this.getRawNumbers(t)},e.prototype.getBoxPlotData=function(t){var e=this.wrapper;return e?e.getBoxPlotData(t):null},e.prototype.getRawBoxPlotData=function(t){var e=this.wrapper;return e?e.getRawBoxPlotData(t):null},e.prototype.getMapping=function(){var t=this.wrapper;return t?t.getMapping():new Ls},e.prototype.getOriginalMapping=function(){var t=this.wrapper;return t?t.getOriginalMapping():new Ls},e.prototype.getSortMethod=function(){var t=this.wrapper;return t?t.getSortMethod():vt.min},e.prototype.setSortMethod=function(t){var e=this.wrapper;return e?e.setSortMethod(t):void 0},e.prototype.setMapping=function(t){var e=this.wrapper;return e?e.setMapping(t):void 0},e.prototype.getColorMapping=function(){var t=this.wrapper;return t?t.getColorMapping():yu},e.prototype.setColorMapping=function(t){var e=this.wrapper;return e?e.setColorMapping(t):void 0},e.prototype.getFilter=function(){var t=this.wrapper;return t?t.getFilter():{min:-1/0,max:1/0,filterMissing:!1}},e.prototype.setFilter=function(t){var e=this.wrapper;return e?e.setFilter(t):void 0},e.prototype.getRange=function(){var t=this.wrapper;return t?t.getRange():["0","1"]},e.prototype.getMap=function(t){var e=this.wrapper;return e?e.getMap(t):[]},e.prototype.getMapLabel=function(t){var e=this.wrapper;return e?e.getMapLabel(t):[]},e.prototype.getLabels=function(t){var e=this.wrapper;return e?e.getLabels(t):[]},e.prototype.getValues=function(t){var e=this.wrapper;return e?e.getValues(t):[]},e.prototype.toCompareValue=function(t){return Eu.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return Eu.prototype.toCompareValueType.call(this)},e.prototype.toCompareGroupValue=function(t,e){return Eu.prototype.toCompareGroupValue.call(this,t,e)},e.prototype.toCompareGroupValueType=function(){return Eu.prototype.toCompareGroupValueType.call(this)},e.prototype.insert=function(e,r){return 1!==this._children.length||this.wrapper||Lt(e)?this._children.length>=2?null:t.prototype.insert.call(this,e,r):null},e.prototype.insertImpl=function(e,r){return Lt(e)&&this.forward.apply(this,[e].concat(it(".impose",Eu.EVENT_MAPPING_CHANGED))),Dt(e)&&this.forward.apply(this,[e].concat(it(".impose",Eu.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.insertImpl.call(this,e,r)},e.prototype.removeImpl=function(e,r){return Lt(e)&&this.unforward.apply(this,[e].concat(it(".impose",Eu.EVENT_MAPPING_CHANGED))),Dt(e)&&this.unforward.apply(this,[e].concat(it(".impose",Eu.EVENT_COLOR_MAPPING_CHANGED))),t.prototype.removeImpl.call(this,e,r)},e.EVENT_MAPPING_CHANGED=Eu.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=Eu.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","filterNumber","colorMapped","editMapping"),Tt("sort","sortNumbers"),gt("descending")],e)}(Ot),wu=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.numberFormat=Ti(".3n"),r.numberFormat&&(n.numberFormat=Ti(r.numberFormat)),n}return i(e,t),e.prototype.getNumberFormat=function(){return this.numberFormat},e.prototype.getLabel=function(t){if(!this.isLoaded())return"";var e=this.getValue(t);return String("number"==typeof e&&!isNaN(e)&&isFinite(e)?this.numberFormat(e):e)},e.prototype.getValue=function(t){if(!this.isLoaded())return null;var e=this.compute(t);return vn(e)?null:e},e.prototype.compute=function(t){return NaN},e.prototype.getNumber=function(t){var e=this.getValue(t);return null==e?NaN:e},e.prototype.getRawNumber=function(t){return this.getNumber(t)},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getExportValue=function(e,r){return"json"===r?{value:this.getRawNumber(e),children:this.children.map((function(t){return t.getExportValue(e,r)}))}:t.prototype.getExportValue.call(this,e,r)},e.prototype.toCompareValue=function(t){return js.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return js.prototype.toCompareValueType.call(this)},e.prototype.toCompareGroupValue=function(t,e){return js.prototype.toCompareGroupValue.call(this,t,e)},e.prototype.toCompareGroupValueType=function(){return js.prototype.toCompareGroupValueType.call(this)},e.prototype.getRenderer=function(){return js.prototype.getRenderer.call(this)},e=a([_t("rename","clone","sort","sortBy","group","groupBy"),gt("descending")],e)}(Ot);function Ru(t){return void 0===t&&(t="Reduce"),{type:"reduce",label:t}}var Au=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"interleaving",groupRenderer:"interleaving",summaryRenderer:"interleaving"}))||this;return n.reduce=r.reduce||vt.max,n}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"label",{get:function(){var e=t.prototype.getMetaData.call(this).label;return"Reduce"!==e?e:""+this.reduce[0].toUpperCase()+this.reduce.slice(1)+"("+this.children.map((function(t){return t.label})).join(", ")+")"},enumerable:!0,configurable:!0}),e.prototype.getColor=function(t){var e=this._children;if(0===e.length||this.reduce===vt.q1||this.reduce===vt.q3||this.reduce===vt.mean)return"#C1C1C1";var r=this.compute(t),n=e.find((function(e){return e.getValue(t)===r}));return n?n.getColor(t):"#C1C1C1"},e.prototype.compute=function(t){var e=this._children.map((function(e){return e.getValue(t)})).filter((function(t){return!isNaN(t)}));if(0===e.length)return NaN;switch(this.reduce){case vt.mean:return e.reduce((function(t,e){return t+e}),0)/e.length;case vt.max:return e.reduce((function(t,e){return Math.max(t,e)}),Number.NEGATIVE_INFINITY);case vt.min:return e.reduce((function(t,e){return Math.min(t,e)}),Number.POSITIVE_INFINITY);case vt.median:return w(e);case vt.q1:return T(e.sort((function(t,e){return t-e})),.25);case vt.q3:return T(e.sort((function(t,e){return t-e})),.75)}},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_REDUCE_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getReduce=function(){return this.reduce},e.prototype.setReduce=function(t){this.reduce!==t&&this.fire([r.EVENT_REDUCE_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.reduce,this.reduce=t)},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.reduce=this.reduce,r},e.prototype.restore=function(e,r){this.reduce=e.reduce||this.reduce,t.prototype.restore.call(this,e,r)},Object.defineProperty(e.prototype,"canJustAddNumbers",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.getExportValue=function(e,r){return"json"===r?{value:this.getRawNumber(e),children:this.children.map((function(t){return t.getExportValue(e,r)}))}:t.prototype.getExportValue.call(this,e,r)},e.EVENT_REDUCE_CHANGED="reduceChanged",e=r=a([_t("reduce")],e)}(wu);function Du(t){return void 0===t&&(t="Weighted Sum"),{type:"stack",label:t}}var Su=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"stack",groupRenderer:"stack",summaryRenderer:"default"}))||this;n.collapsed=!1;var i=n;return n.adaptChange=function(t,e){i.adaptWidthChange(this.source,t,e)},n}var r;return i(e,t),r=e,Object.defineProperty(e.prototype,"label",{get:function(){var e=t.prototype.getMetaData.call(this).label,r=this._children;if("Weighted Sum"!==e||0===r.length)return e;var n=this.getWeights();return r.map((function(t,e){return t.label+" ("+O(100*n[e],1)+"%)"})).join(" + ")},enumerable:!0,configurable:!0}),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLLAPSE_CHANGED,r.EVENT_WEIGHTS_CHANGED,r.EVENT_MULTI_LEVEL_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.setCollapsed=function(t){this.collapsed!==t&&this.fire([r.EVENT_COLLAPSE_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.collapsed,this.collapsed=t)},e.prototype.getCollapsed=function(){return this.collapsed},Object.defineProperty(e.prototype,"canJustAddNumbers",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.flatten=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=null,o=r<=pt.FLAT_ALL_COLUMNS?this._children:this._children.filter((function(t){return t.isVisible()}));if(0===r||r<=pt.FLAT_ALL_COLUMNS){var a=this.getWidth();if(this.collapsed||(a+=(o.length-1)*n),t.push(i={col:this,offset:e,width:a}),0===r)return a}var s=e;return o.forEach((function(e){s+=e.flatten(t,s,r-1,n)+n})),i&&(i.width=s-e-n),s-e-n},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.collapsed=this.collapsed,r},e.prototype.restore=function(e,r){this.collapsed=!0===e.collapsed,t.prototype.restore.call(this,e,r)},e.prototype.insert=function(e,r,n){return void 0===n&&(n=NaN),isNaN(n)||e.setWidth(n/(1-n)*this.getWidth()),e.on(pt.EVENT_WIDTH_CHANGED+".stack",this.adaptChange),t.prototype.setWidth.call(this,0===this.length?e.getWidth():this.getWidth()+e.getWidth()),t.prototype.insert.call(this,e,r)},e.prototype.push=function(t,e){return void 0===e&&(e=NaN),this.insert(t,this.length,e)},e.prototype.insertAfter=function(t,e,r){void 0===r&&(r=NaN);var n=this.indexOf(e);return n<0?null:this.insert(t,n+1,r)},e.prototype.adaptWidthChange=function(e,n,i){if(!V(n,i,.5)){var o=this.getWeights(),a=this.getWidth(),s=n/a,u=(1-s-(i-n)/a)/(1-s),l=this._children.map((function(t){if(t===e)return i;var r=t.getWidth()*u,n=isNaN(r)||r<1?0:r;return t.setWidthImpl(n),n}));t.prototype.setWidth.call(this,l.reduce((function(t,e){return t+e}),0)),this.fire([r.EVENT_WEIGHTS_CHANGED,r.EVENT_MULTI_LEVEL_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],o,this.getWeights())}},e.prototype.getWeights=function(){var t=this.getWidth();return this._children.map((function(e){return e.getWidth()/t}))},e.prototype.setWeights=function(t){var e,n=this.getWeights(),i=t.length-this.length;if(i<0)if((e=t.reduce((function(t,e){return t+e}),0))<=1)for(var o=0;o<-i;++o)t.push(1/-i*(1-e));else if(e<=100)for(o=0;o<-i;++o)t.push(1/-i*(100-e));t=t.slice(0,this.length),e=t.reduce((function(t,e){return t+e}),0)/this.getWidth(),t=t.map((function(t){return t/e})),this._children.forEach((function(e,r){e.setWidthImpl(t[r])})),this.fire([r.EVENT_WEIGHTS_CHANGED,r.EVENT_MULTI_LEVEL_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],n,t)},e.prototype.removeImpl=function(e,r){return e.on(pt.EVENT_WIDTH_CHANGED+".stack",null),t.prototype.setWidth.call(this,0===this.length?100:this.getWidth()-e.getWidth()),t.prototype.removeImpl.call(this,e,r)},e.prototype.setWidth=function(e){var r=e/this.getWidth();this._children.forEach((function(t){t.setWidthImpl(t.getWidth()*r)})),t.prototype.setWidth.call(this,e)},e.prototype.compute=function(t){var e=this.getWidth();return this._children.reduce((function(r,n){return r+n.getValue(t)*(n.getWidth()/e)}),0)},e.prototype.getRenderer=function(){return this.getCollapsed()&&this.isLoaded()?r.COLLAPSED_RENDERER:t.prototype.getRenderer.call(this)},e.prototype.getExportValue=function(e,r){return"json"===r?{value:this.getRawNumber(e),children:this.children.map((function(t){return t.getExportValue(e,r)}))}:t.prototype.getExportValue.call(this,e,r)},e.EVENT_COLLAPSE_CHANGED="collapseChanged",e.EVENT_WEIGHTS_CHANGED="weightsChanged",e.EVENT_MULTI_LEVEL_CHANGED="nestedChildRatio",e.COLLAPSED_RENDERER="number",e=r=a([_t("editWeights","compress","expand")],e)}(wu),Mu=function(t){function e(e,r){var n=t.call(this,e,r)||this;n.collapsed=!1;var i=n;return n.adaptChange=function(t,e){i.adaptWidthChange(t,e)},n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLLAPSE_CHANGED,r.EVENT_MULTI_LEVEL_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.setCollapsed=function(t){this.collapsed!==t&&this.fire([Su.EVENT_COLLAPSE_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.collapsed,this.collapsed=t)},e.prototype.getCollapsed=function(){return this.collapsed},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.collapsed=this.collapsed,r},e.prototype.restore=function(e,r){this.collapsed=!0===e.collapsed,t.prototype.restore.call(this,e,r)},e.prototype.flatten=function(t,e,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),Su.prototype.flatten.call(this,t,e,r,n)},e.prototype.insert=function(e,r){return e.on(pt.EVENT_WIDTH_CHANGED+".stack",this.adaptChange),t.prototype.setWidth.call(this,0===this.length?e.getWidth():this.getWidth()+e.getWidth()),t.prototype.insert.call(this,e,r)},e.prototype.adaptWidthChange=function(e,n){if(!V(e,n,.5)){var i=this.getWidth(),o=i+(n-e);this.fire([r.EVENT_MULTI_LEVEL_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],i,o),t.prototype.setWidth.call(this,o)}},e.prototype.removeImpl=function(e,r){return e.on(pt.EVENT_WIDTH_CHANGED+".stack",null),t.prototype.setWidth.call(this,0===this.length?100:this.getWidth()-e.getWidth()),t.prototype.removeImpl.call(this,e,r)},e.prototype.setWidth=function(e){var n=this.getWidth(),i=e/n;this._children.forEach((function(t){t.setWidthImpl(t.getWidth()*i)})),V(n,e,.5)||this.fire([r.EVENT_MULTI_LEVEL_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY],n,e),t.prototype.setWidth.call(this,e)},e.prototype.getRenderer=function(){return this.getCollapsed()?r.EVENT_COLLAPSE_CHANGED:t.prototype.getRenderer.call(this)},e.prototype.getExportValue=function(e,r){return"json"===r?{children:this.children.map((function(t){return t.getExportValue(e,r)}))}:t.prototype.getExportValue.call(this,e,r)},e.EVENT_COLLAPSE_CHANGED=Su.EVENT_COLLAPSE_CHANGED,e.EVENT_MULTI_LEVEL_CHANGED=Su.EVENT_MULTI_LEVEL_CHANGED,e=r=a([_t("compress","expand")],e)}(Ot);function Lu(t){return void 0===t&&(t="Nested"),{type:"nested",label:t}}var xu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.toCompareValue=function(t){return X(this.children.map((function(e){return e.toCompareValue(t)})))},e.prototype.toCompareValueType=function(){return X(this.children.map((function(t){return t.toCompareValueType()})))},e.prototype.getLabel=function(t){return this.children.map((function(e){return e.getLabel(t)})).join(";")},e.prototype.getValue=function(t){return this.children.map((function(e){return e.getValue(t)})).join(";")},e=a([_t("rename","clone","sort","sortBy")],e)}(Mu),Ou=function(t){function e(e,r,n){var i=t.call(this,e,tn(r,{renderer:"mapbars"}))||this;return i.numberFormat=Is,i.currentFilter={min:-1/0,max:1/0,filterMissing:!1},i.mapping=Os(r,n),i.original=i.mapping.clone(),i.colorMapping=n.colorMappingFunction(r.colorMapping||r.color),i.sort=r.sort||vt.median,r.numberFormat&&(i.numberFormat=Ti(r.numberFormat)),i}var r;return i(e,t),r=e,e.prototype.getNumberFormat=function(){return this.numberFormat},e.prototype.toCompareValue=function(t){return ks(this,t)},e.prototype.toCompareValueType=function(){return ot.FLOAT},e.prototype.getBoxPlotData=function(t){var e=this.getRawValue(t);if(null==e)return null;for(var r=A(),n=0,i=e;n<i.length;n++){var o=i[n];r.push(vn(o.value)?NaN:this.mapping.apply(o.value))}return r.build()},e.prototype.getRange=function(){return this.mapping.getRange(this.numberFormat)},e.prototype.getRawBoxPlotData=function(t){var e=this.getRawValue(t);if(null==e)return null;for(var r=A(),n=0,i=e;n<i.length;n++){var o=i[n];r.push(vn(o.value)?NaN:o.value)}return r.build()},e.prototype.getNumber=function(t){return Gs(this,t,"normalized")},e.prototype.getRawNumber=function(t){return Gs(this,t,"raw")},e.prototype.iterNumber=function(t){var e=this.getValue(t);return e?e.map((function(t){return t.value})):[NaN]},e.prototype.iterRawNumber=function(t){var e=this.getRawValue(t);return e?e.map((function(t){return t.value})):[NaN]},e.prototype.getValue=function(t){var e=this,r=this.getRawValue(t);return 0===r.length?null:r.map((function(t){var r=t.key,n=t.value;return{key:r,value:vn(n)?NaN:e.mapping.apply(n)}}))},e.prototype.getRawValue=function(e){var r=t.prototype.getValue.call(this,e);return null==r?[]:r},e.prototype.getExportValue=function(e,r){return"json"===r?this.getRawValue(e):t.prototype.getExportValue.call(this,e,r)},e.prototype.getLabels=function(t){var e=this;return this.getRawValue(t).map((function(t){var r=t.key,n=t.value;return{key:r,value:e.numberFormat(n)}}))},e.prototype.getSortMethod=function(){return this.sort},e.prototype.setSortMethod=function(t){this.sort!==t&&(this.fire([r.EVENT_SORTMETHOD_CHANGED],this.sort,this.sort=t),this.isSortedByMe().asc||this.sortByMe())},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.sortMethod=this.getSortMethod(),r.filter=Us(this.currentFilter)?null:this.currentFilter,r.map=this.mapping.toJSON(),r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),e.sortMethod&&(this.sort=e.sortMethod),e.filter&&(this.currentFilter=Bs(e.filter)),(e.map||e.domain)&&(this.mapping=Os(e,r)),e.colorMapping&&(this.colorMapping=r.colorMappingFunction(e.colorMapping))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_MAPPING_CHANGED,r.EVENT_SORTMETHOD_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getOriginalMapping=function(){return this.original.clone()},e.prototype.getMapping=function(){return this.mapping.clone()},e.prototype.setMapping=function(t){this.mapping.eq(t)||this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.mapping.clone(),this.mapping=t)},e.prototype.getColor=function(t){return js.prototype.getColor.call(this,t)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return js.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return js.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){js.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return js.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return js.prototype.clearFilter.call(this)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=js.EVENT_COLOR_MAPPING_CHANGED,e.EVENT_SORTMETHOD_CHANGED=js.EVENT_SORTMETHOD_CHANGED,e.EVENT_FILTER_CHANGED=js.EVENT_FILTER_CHANGED,e=r=a([_t("rename","filterNumber","colorMapped","editMapping"),Tt("sort","sortNumbers"),gt("descending")],e)}(Ws),Vu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{renderer:"number",groupRenderer:"boxplot"}))||this;return n.lookup=new Map,n.currentFilter=null,n.categories=Rn(r),n.categories.forEach((function(t){return n.lookup.set(t.name,t)})),n.colorMapping=gn,n}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_MAPPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getNumberFormat=function(){return Is},Object.defineProperty(e.prototype,"dataLength",{get:function(){return this.categories.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labels",{get:function(){return this.categories.map((function(t){return t.label}))},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.getNumber(t);return isNaN(e)?null:e},e.prototype.getCategory=function(e){var r=t.prototype.getValue.call(this,e);if(!r)return null;var n=String(r);return this.lookup.has(n)?this.lookup.get(n):null},e.prototype.getCategories=function(t){return[this.getCategory(t)]},e.prototype.iterCategory=function(t){return[this.getCategory(t)]},e.prototype.iterNumber=function(t){return[this.getNumber(t)]},e.prototype.iterRawNumber=function(t){return[this.getRawNumber(t)]},e.prototype.getColor=function(t){return Mn.prototype.getColor.call(this,t)},e.prototype.getLabel=function(t){return Mn.prototype.getLabel.call(this,t)},e.prototype.getLabels=function(t){return Mn.prototype.getLabels.call(this,t)},e.prototype.getValues=function(t){return Mn.prototype.getValues.call(this,t)},e.prototype.getMap=function(t){return Mn.prototype.getMap.call(this,t)},e.prototype.getMapLabel=function(t){return Mn.prototype.getMapLabel.call(this,t)},e.prototype.getSet=function(t){return Mn.prototype.getSet.call(this,t)},e.prototype.getNumber=function(t){var e=this.getCategory(t);return e?e.value:NaN},e.prototype.getRawNumber=function(t){return this.getNumber(t)},e.prototype.getExportValue=function(e,r){if("json"===r){var n=this.getNumber(e);return isNaN(n)?null:{name:this.getLabel(e),value:n}}return t.prototype.getExportValue.call(this,e,r)},e.prototype.dump=function(t){var e=Mn.prototype.dump.call(this,t);return e.mapping=this.getMapping(),e},e.prototype.restore=function(t,e){Mn.prototype.restore.call(this,t,e),t.mapping&&this.setMapping(t.mapping)},e.prototype.getMapping=function(){return this.categories.map((function(t){return t.value}))},e.prototype.setMapping=function(t){var e=N(t);t=t.map((function(t){return(t-e[0])/(e[1]-e[0])}));var n=this.getMapping();z(n,t)||(this.categories.forEach((function(e,r){return e.value=t[r]||0})),this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],n,this.getMapping()))},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){return Mn.prototype.setColorMapping.call(this,t)},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t){return Mn.prototype.filter.call(this,t)},e.prototype.group=function(t){return Mn.prototype.group.call(this,t)},e.prototype.getFilter=function(){return this.currentFilter},e.prototype.setFilter=function(t){return Mn.prototype.setFilter.call(this,t)},e.prototype.clearFilter=function(){return Mn.prototype.clearFilter.call(this)},e.prototype.toCompareValue=function(t){return Mn.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return Mn.prototype.toCompareValueType.call(this)},e.prototype.getRenderer=function(){return js.prototype.getRenderer.call(this)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_FILTER_CHANGED=Mn.EVENT_FILTER_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=Mn.EVENT_COLOR_MAPPING_CHANGED,e=r=a([_t("rename","clone","sort","sortBy","group","filterOrdinal","colorMappedCategorical"),Ct("categorical")],e)}(xt),Iu="let s = 0;\ncol.forEach((c) => s += c.v);\nreturn s / col.length";function ku(t){return void 0===t&&(t="script"),{type:"script",label:t,script:Iu}}var Gu=function(){function t(t,e,r){this.c=t,this.v=e,this.raw=r}return Object.defineProperty(t.prototype,"type",{get:function(){return this.c.desc.type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.c.getMetaData().label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.c.id},enumerable:!0,configurable:!0}),t}(),Hu=function(){function t(t,e){this.c=t,this.row=e}return Object.defineProperty(t.prototype,"type",{get:function(){return this.c.desc.type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.c.getMetaData().label},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.c.id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v",{get:function(){return this.c.getValue(this.row)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raw",{get:function(){return St(this.c)?this.c.getRawNumber(this.row):null},enumerable:!0,configurable:!0}),t}(),Pu=function(){function t(t,e){var r=this;this.children=t,this.allFactory=e,this.lookup=new Map,this._all=null,t.forEach((function(t){r.lookup.set("ID@"+t.id,t),r.lookup.set("ID@"+t.id.toLowerCase(),t),r.lookup.set("NAME@"+t.name,t),r.lookup.set("NAME@"+t.name.toLowerCase(),t)}))}return t.prototype.byName=function(t){return this.lookup.get("NAME@"+t)},t.prototype.byID=function(t){return this.lookup.get("ID@"+t)},t.prototype.byIndex=function(t){return this.children[t]},t.prototype.forEach=function(t){return this.children.forEach(t)},Object.defineProperty(t.prototype,"length",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{get:function(){return null==this._all&&(this._all=this.allFactory?this.allFactory():null),this._all},enumerable:!0,configurable:!0}),t}(),Fu=function(t){function e(e,n,i){var o=t.call(this,e,tn(n,{renderer:"number",groupRenderer:"boxplot",summaryRenderer:"histogram"}))||this;return o.script=r.DEFAULT_SCRIPT,o.f=null,o.currentFilter={min:-1/0,max:1/0,filterMissing:!1},o.script=n.script||o.script,o.mapping=Os(n,i),o.original=o.mapping.clone(),o.colorMapping=i.colorMappingFunction(n.colorMapping||n.color),o}var r;return i(e,t),r=e,e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_SCRIPT_CHANGED,r.EVENT_COLOR_MAPPING_CHANGED,r.EVENT_MAPPING_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.setScript=function(t){this.script!==t&&(this.f=null,this.fire([r.EVENT_SCRIPT_CHANGED,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.script,this.script=t))},e.prototype.getScript=function(){return this.script},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return r.script=this.script,r.filter=Us(this.currentFilter)?null:this.currentFilter,r.map=this.mapping.toJSON(),r.colorMapping=this.colorMapping.toJSON(),r},e.prototype.restore=function(e,r){t.prototype.restore.call(this,e,r),this.script=e.script||this.script,e.filter&&(this.currentFilter=Bs(e.filter)),(e.map||e.domain)&&(this.mapping=Os(e.map,r)),e.colorMapping&&(this.colorMapping=r.colorMappingFunction(e.colorMapping))},e.prototype.compute=function(t){var e,r,n=this;null==this.f&&(this.f=new Function("children","values","raws","col","row","index",(e=this.script,(r=e.trim()).includes("return")||(r="return ("+r+");"),"\n  const max = function(arr) { return Math.max.apply(Math, arr); };\n  const min = function(arr) { return Math.min.apply(Math, arr); };\n  const extent = function(arr) { return [min(arr), max(arr)]; };\n  const clamp = function(v, minValue, maxValue) { return v < minValue ? minValue : (v > maxValue ? maxValue : v); };\n  const normalize = function(v, minMax, max) {\n    if (Array.isArray(minMax)) {\n      minMax = minMax[0];\n      max = minMax[1];\n    }\n    return (v - minMax) / (max - minMax);\n  };\n  const denormalize = function(v, minMax, max) {\n    if (Array.isArray(minMax)) {\n      minMax = minMax[0];\n      max = minMax[1];\n    }\n    return v * (max - minMax) + minMax;\n  };\n  const linear = function(v, source, target) {\n    target = target || [0, 1];\n    return denormalize(normalize(v, source), target);\n  };\n  const v = (function custom() {\n    "+r+"\n  })();\n\n  return typeof v === 'number' ? v : NaN")));var i=this._children,o=this._children.map((function(e){return e.getValue(t)})),a=this._children.map((function(e){return St(e)?e.getRawNumber(t):null})),s=new Pu(i.map((function(t,e){return new Gu(t,o[e],a[e])})),(function(){var e=n.findMyRanker().flatColumns;return new Pu(e.map((function(e){return new Hu(e,t)})))}));return this.f.call(this,i,o,a,s,t.v,t.i)},e.prototype.getExportValue=function(e,r){return"json"===r?{value:this.getRawNumber(e),children:this.children.map((function(t){return t.getExportValue(e,r)}))}:t.prototype.getExportValue.call(this,e,r)},e.prototype.getRange=function(){return this.mapping.getRange(this.getNumberFormat())},e.prototype.getOriginalMapping=function(){return this.original.clone()},e.prototype.getMapping=function(){return this.mapping.clone()},e.prototype.setMapping=function(t){this.mapping.eq(t)||this.fire([r.EVENT_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.mapping.clone(),this.mapping=t)},e.prototype.getColor=function(t){return js.prototype.getColor.call(this,t)},e.prototype.getColorMapping=function(){return this.colorMapping.clone()},e.prototype.setColorMapping=function(t){this.colorMapping.eq(t)||this.fire([r.EVENT_COLOR_MAPPING_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.colorMapping.clone(),this.colorMapping=t)},e.prototype.isFiltered=function(){return js.prototype.isFiltered.call(this)},e.prototype.getFilter=function(){return js.prototype.getFilter.call(this)},e.prototype.setFilter=function(t){js.prototype.setFilter.call(this,t)},e.prototype.filter=function(t){return js.prototype.filter.call(this,t)},e.prototype.clearFilter=function(){return js.prototype.clearFilter.call(this)},e.EVENT_MAPPING_CHANGED=js.EVENT_MAPPING_CHANGED,e.EVENT_COLOR_MAPPING_CHANGED=js.EVENT_COLOR_MAPPING_CHANGED,e.EVENT_SCRIPT_CHANGED="scriptChanged",e.DEFAULT_SCRIPT=Iu,e=r=a([_t("script","filterNumber","colorMapped","editMapping"),gt("descending")],e)}(wu),Uu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{width:200,renderer:"map"}))||this;return n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n}return i(e,t),e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getMapValue(t);return e.every((function(t){return""===t.value}))?null:e},e.prototype.getMapValue=function(e){return t.prototype.getMap.call(this,e).map((function(t){var e=t.key,r=t.value;return{key:e,value:vn(r)?"":String(r)}}))},e=a([_t("rename","search")],e)}(Ws),Bu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{width:200}))||this;return n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n}return i(e,t),e.prototype.getValues=function(e){return t.prototype.getValues.call(this,e).map((function(t){return vn(t)?"":String(t)}))},e=a([_t("rename","search")],e)}(gi),ju=function(t){function e(e,r){var n=t.call(this,e,tn(r,Object.assign({width:200},r.pattern?{renderer:"link",groupRenderer:"link"}:{})))||this;return n.patternFunction=null,n.currentFilter=null,n.currentGroupCriteria={type:ui.startsWith,values:[]},n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n.pattern=r.pattern||"",n.patternTemplates=r.patternTemplates||[],n}var r;return i(e,t),r=e,e.prototype.setPattern=function(t){t!==this.pattern&&(this.patternFunction=null,this.fire([r.EVENT_PATTERN_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_DIRTY_VALUES,pt.EVENT_DIRTY_CACHES,pt.EVENT_DIRTY],this.pattern,this.pattern=t))},e.prototype.getPattern=function(){return this.pattern},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_PATTERN_CHANGED,r.EVENT_GROUPING_CHANGED,r.EVENT_FILTER_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getLink(t);return null==e?null:e.href},e.prototype.getLink=function(e){var r=t.prototype.getValue.call(this,e);return this.transformValue(r,e)},e.prototype.transformValue=function(t,e){return null==t||""===t?null:"string"==typeof t?this.pattern?(this.patternFunction||(this.patternFunction=en(this.pattern,"item")),{alt:t,href:this.patternFunction.call(this,t,e.v)}):{alt:t,href:t}:t},e.prototype.getLabel=function(t){var e=this.getLink(t);return null==e?"":e.alt},e.prototype.dump=function(t){var e=fi.prototype.dump.call(this,t);return this.pattern!==this.desc.pattern&&(e.pattern=this.pattern),e},e.prototype.restore=function(t,e){fi.prototype.restore.call(this,t,e),t.pattern&&(this.pattern=t.pattern)},e.prototype.isFiltered=function(){return null!=this.currentFilter},e.prototype.filter=function(t){return fi.prototype.filter.call(this,t)},e.prototype.getFilter=function(){return this.currentFilter},e.prototype.setFilter=function(t){return fi.prototype.setFilter.call(this,t)},e.prototype.clearFilter=function(){return fi.prototype.clearFilter.call(this)},e.prototype.getGroupCriteria=function(){return this.currentGroupCriteria},e.prototype.setGroupCriteria=function(t){return fi.prototype.setGroupCriteria.call(this,t)},e.prototype.toCompareValue=function(t){return fi.prototype.toCompareValue.call(this,t)},e.prototype.toCompareValueType=function(){return fi.prototype.toCompareValueType.call(this)},e.prototype.toCompareGroupValue=function(t,e){return fi.prototype.toCompareGroupValue.call(this,t,e)},e.prototype.toCompareGroupValueType=function(){return fi.prototype.toCompareGroupValueType.call(this)},e.prototype.group=function(t){return fi.prototype.group.call(this,t)},e.EVENT_FILTER_CHANGED=fi.EVENT_FILTER_CHANGED,e.EVENT_GROUPING_CHANGED=fi.EVENT_GROUPING_CHANGED,e.EVENT_PATTERN_CHANGED="patternChanged",e=r=a([_t("rename","clone","sort","sortBy","search","groupBy","filterString","editPattern"),Tt("group","groupString"),Ct("string")],e)}(xt),Yu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{width:200,renderer:"map"}))||this;return n.patternFunction=null,n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n.pattern=r.pattern||"",n.patternTemplates=r.patternTemplates||[],n}return i(e,t),e.prototype.setPattern=function(t){ju.prototype.setPattern.call(this,t)},e.prototype.getPattern=function(){return this.pattern},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([ju.EVENT_PATTERN_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValue=function(t){var e=this.getLinkMap(t);return e.every((function(t){return null==t.value}))?null:e.map((function(t){var e=t.key,r=t.value;return{key:e,value:r?r.href:""}}))},e.prototype.getLabels=function(t){return this.getLinkMap(t).map((function(t){var e=t.key,r=t.value;return{key:e,value:r?r.alt:""}}))},e.prototype.getLinkMap=function(e){var r=this;return t.prototype.getMap.call(this,e).map((function(t){var n=t.key,i=t.value;return{key:n,value:r.transformValue(i,e,n)}}))},e.prototype.transformValue=function(t,e,r){return null==t||""===t?null:"string"==typeof t?this.pattern?(this.patternFunction||(this.patternFunction=en(this.pattern,"item","key")),{alt:t,href:this.patternFunction.call(this,t,e.v,r)}):{alt:t,href:t}:t},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return this.pattern!==this.desc.pattern&&(r.pattern=this.pattern),r},e.prototype.restore=function(e,r){e.pattern&&(this.pattern=e.pattern),t.prototype.restore.call(this,e,r)},e.EVENT_PATTERN_CHANGED=ju.EVENT_PATTERN_CHANGED,e=a([_t("rename","search","editPattern")],e)}(Ws),Wu=function(t){function e(e,r){var n=t.call(this,e,tn(r,{width:200}))||this;return n.patternFunction=null,n.alignment=r.alignment||si.left,n.escape=!1!==r.escape,n.pattern=r.pattern||"",n.patternTemplates=r.patternTemplates||[],n}var r;return i(e,t),r=e,e.prototype.setPattern=function(t){return ju.prototype.setPattern.call(this,t)},e.prototype.getPattern=function(){return this.pattern},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([r.EVENT_PATTERN_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.getValues=function(t){return this.getLinks(t).map((function(t){return t?t.href:""}))},e.prototype.getLabels=function(t){return this.getLinks(t).map((function(t){return t?t.alt:""}))},e.prototype.transformValue=function(t,e,r){return null==t||""===t?null:"string"==typeof t?this.pattern?(this.patternFunction||(this.patternFunction=en(this.pattern,"item","index")),{alt:t,href:this.patternFunction.call(this,t,e.v,r)}):{alt:t,href:t}:t},e.prototype.getLinks=function(e){var r=this;return t.prototype.getValues.call(this,e).map((function(t,n){return r.transformValue(t,e,n)}))},e.prototype.dump=function(e){var r=t.prototype.dump.call(this,e);return this.pattern!==this.desc.pattern&&(r.pattern=this.pattern),r},e.prototype.restore=function(e,r){e.pattern&&(this.pattern=e.pattern),t.prototype.restore.call(this,e,r)},e.EVENT_PATTERN_CHANGED=ju.EVENT_PATTERN_CHANGED,e=r=a([_t("rename","search","editPattern")],e)}(gi);function zu(t){return null!=t&&t&&"function"==typeof t.then}var qu=Symbol("aborted");function Ku(t,e,r){return function(n,i){return{then:Ku(t.then((function(t){var r=e()?qu:t,i=n?n(r):r;return zu(i)?i.then((function(t){return e()?qu:t})):e()?qu:i})),e,r),abort:r,isAborted:e}}}function Xu(t){var e=null,r=function(){return null===e},n=new Promise((function(t){return e=t})),i=function(){null!=e&&(e(qu),e=null)};return{then:Ku(Promise.race([n,t]),r,i),abort:i,isAborted:r}}function $u(t){var e=Promise.all(t),r=null,n=function(){return null===r},i=new Promise((function(t){return r=t})),o=function(){if(null!=r){r(qu);for(var e=0,n=t;e<n.length;e++){var i=n[e];Ju(i)&&i.abort()}r=null}};return{then:Ku(Promise.race([i,e]),n,o),abort:o,isAborted:n}}function Ju(t){return null!=t&&t&&"function"==typeof t.then&&"function"==typeof t.abort}function Qu(t){return null!=t&&t&&Ju(t.ready)}var Zu="https://lineup.js.org/develop/schema.4.0.0.json",tl=r(4),el=r.n(tl);function rl(t){return"string"==typeof t&&(t.includes(".")||t.includes("["))}function nl(t,e){return null!=t&&t.hasOwnProperty(e)?t[e]:el()(t,e)}function il(t,e){return nl(t.v,e.column)}function ol(t,e){return t.v[e.column]}function al(t,e){return rl(e.column)?il(t,e):ol(t,e)}function sl(t){return t.delete(null),t.delete(void 0),t.delete(""),t.delete("NA"),t.delete("NaN"),t.delete("na"),Array.from(t).map(String).sort()}function ul(t){return null==t||Array.isArray(t)&&0===t.length||t instanceof Set&&0===t.size||t instanceof Map&&0===t.size||pi({},t)}function ll(t,e,r,n){if(null==t)return console.warn("cannot derive from null value for column: ",r),null;if("number"==typeof t)return{type:"number",domain:N(e())};if("boolean"==typeof t)return{type:"boolean"};if(t instanceof Date)return{type:"date"};for(var i=0,o=Array.isArray(n.datePattern)?n.datePattern:[n.datePattern];i<o.length;i++){var a=o[i];if(null!=ga(a)(t))return{type:"date",dateParse:a}}var s="function"==typeof n.categoricalThreshold?n.categoricalThreshold:function(t,e){return t<e*n.categoricalThreshold};if("string"==typeof t){var u=e(),l=new Set(u);return s(l.size,u.length)?{type:"categorical",categories:sl(l)}:{type:"string"}}return"object"==typeof t&&null!=t.alt&&null!=t.href?{type:"link"}:null}function cl(t,e,r,n,i){var o={type:"string",label:t,column:r},a=ll(e,n,r,i);if(null!=a)return Object.assign(o,a);if(e instanceof Set){for(var s=new Set,u=0,l=n();u<l.length;u++){var c=l[u];c instanceof Set&&c.forEach((function(t){s.add(String(t))}))}return Object.assign(o,{type:"set",categories:sl(s)})}if(e instanceof Map){var p=ll(y=Array.from(e.values()).find((function(t){return!ul(t)})),d=function(){for(var t=[],e=0,r=n();e<r.length;e++){var i=r[e];i instanceof Map&&i.forEach((function(e){ul(e)||t.push(e)}))}return t},r,i);return Object.assign(o,p||{},{type:p?p.type+"Map":"stringMap"})}if(Array.isArray(e)){var f=n(),h=!function(t){if(0===t.length)return!1;var e=t[0].length;return t.some((function(t){return null!=t&&e!==(Array.isArray(t)?t.length:-1)}))}(f);if(h&&(o.dataLength=e.length),(p=ll(y=e.find((function(t){return!ul(t)})),(function(){return X(f).filter((function(t){return!ul(t)}))}),r,i))&&"categorical"===p.type&&!h)return Object.assign(o,p,{type:"set"});if(p||ul(y))return Object.assign(o,p||{},{type:p?p.type+"s":"strings"});if("object"==typeof y&&null!=y.key&&null!=y.value){var d=function(){for(var t=[],e=0,r=f;e<r.length;e++){var n=r[e];if(Array.isArray(n))for(var i=0,o=n;i<o.length;i++){var a=o[i];ul(a)||t.push(a)}}return t},g=ll(y.value,d,r,i);return Object.assign(o,g||{},{type:g?g.type+"Map":"stringMap"})}}if(null!==e&&"object"==typeof e&&["min","max","median","q1","q3"].every((function(t){return"number"==typeof e[t]}))){var m=n();return Object.assign(o,{type:"boxplot",domain:[m.reduce((function(t,e){return Math.min(t,e.min)}),Number.POSITIVE_INFINITY),m.reduce((function(t,e){return Math.max(t,e.max)}),Number.NEGATIVE_INFINITY)]})}if(null!==e&&"object"==typeof e){var y;p=ll(y=Object.keys(e).map((function(t){return e[t]})).filter((function(t){return!ul(t)})),d=function(){for(var t=[],e=function(e){if(null==e)return"continue";Object.keys(e).forEach((function(r){var n=e[r];ul(n)||t.push(n)}))},r=0,i=n();r<i.length;r++){e(i[r])}return t},r,i);return Object.assign(o,p||{},{type:p?p.type+"Map":"stringMap"})}return console.log("cannot infer type of column:",r),o}function pl(t,e){void 0===e&&(e={});var r=Object.assign({categoricalThreshold:function(t,e){return t<=ln&&t<.7*e},columns:[],datePattern:["%x","%Y-%m-%d","%Y-%m-%dT%H:%M:%S.%LZ"]},e);if(0===t.length)return[];var n=t[0];return(Array.isArray(n)?function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}(n.length):r.columns.length>0?function(t,e){if(!e.every((function(t){return t.startsWith("-")})))return e;var r=new Set(e);return t.filter((function(t){return!r.has("-"+t)}))}(Object.keys(n),r.columns):Object.keys(n)).map((function(e){var i=nl(n,e);if(ul(i)){var o=t.find((function(t){return!ul(nl(t,e))}));i=o?o[e]:null}return cl(function(t){return"number"==typeof t?"Col "+(t+1):0===(t=t.trim()).length?"Unknown":t.split(/[\s]+/gm).map((function(t){return 0===t.length?t:""+t[0].toUpperCase()+t.slice(1)})).join(" ")}(e),i,e,(function(){return t.map((function(t){return nl(t,e)})).filter((function(t){return!ul(t)}))}),r)}))}function fl(t){var e=cn();return t.forEach((function(t){Dt(t)&&(t.colorMapping=t.colorMapping||t.color||e()||"#C1C1C1")})),t}function hl(t,e,r){void 0===r&&(r={});var n=Object.assign({separator:"\t",newline:"\n",header:!0,quote:!1,quoteChar:'"',filter:function(t){return!wt(t)},verboseColumnHeaders:!1},r),i=new RegExp("["+n.quoteChar+"]","g");function o(t,e){var r=String(t);return!(n.quote||r.indexOf("\n")>=0)||e&&St(e)?r:""+n.quoteChar+r.replace(i,n.quoteChar+n.quoteChar)+n.quoteChar}var a=t.flatColumns.filter((function(t){return n.filter(t)})),s=t.getOrder(),u=[];return n.header&&u.push(a.map((function(t){return o(t.label+(n.verboseColumnHeaders&&t.description?"\n"+t.description:""))})).join(n.separator)),e.forEach((function(t,e){u.push(a.map((function(r){return o(r.getExportValue({v:t,i:s[e]},"text"),r)})).join(n.separator))})),u.join(n.newline)}function dl(t,e,r,n,i){var o=t.getRankings().find((function(t){return t.id===e}));if(!o)return!1;var a=t.getSelection();if(0===a.length||a.includes(r))return!1;var s=o.getOrder(),u=new Map(Array.from(s).map((function(t,e){return[t,e]}))),l=a.map((function(t){var e=u.has(t)?u.get(t):1/0;return{s:t,index:e,distance:Math.abs(n-e)}})).sort((function(t,e){return t.distance-e.distance}))[0];if(!isFinite(l.distance))return!1;if(i||(a.splice(0,a.length),a.push(l.s)),l.index<n)for(var c=l.index+1;c<=n;++c)a.push(s[c]);else for(c=n;c<=l.index;++c)a.push(s[c]);return t.setSelection(a),!0}function gl(t){return"group+item"===t||"group+item+top"===t||"group+top+item"===t}function ml(t,e,r){return 0===t?1===e.order.length?"first last":"first":t===e.order.length-1||r>0&&t===r-1?"last":null}function yl(t,e){for(var r=[{group:t,meta:e}],n=t,i=e,o=t.parent;o;)e=1===o.subGroups.length&&"first last"===i?"first last":o.subGroups[0]!==n||"first last"!==i&&"first"!==i?o.subGroups[o.subGroups.length-1]!==n||"last"!==i&&"first last"!==i?null:"last":"first",r.unshift({group:o,meta:e}),n=o,i=e,o=o.parent;return r}function vl(t,e){var r=lt(t)?t:t.group,n=lt(t)?"first last":ml(t.relativeIndex,t.group,e(r));if("last"!==n&&"first last"!==n)return 0;for(var i=r,o=r.parent,a=1;o;){if(1!==o.subGroups.length&&o.subGroups[o.subGroups.length-1]!==i)return a;++a,i=o,o=o.parent}return a}function bl(t,e,r){var n=r(t);return gl(e)&&0!==n}function El(t){switch(t.primaryType||""){case Zn.EVENT_DIRTY_ORDER:return t.args[0]||[Jn.UNKNOWN];case Zn.EVENT_SORT_CRITERIA_CHANGED:return[Jn.SORT_CRITERIA_CHANGED];case Zn.EVENT_GROUP_CRITERIA_CHANGED:return[Jn.GROUP_CRITERIA_CHANGED];case Zn.EVENT_GROUP_SORT_CRITERIA_CHANGED:return[Jn.GROUP_SORT_CRITERIA_CHANGED];default:return[Jn.UNKNOWN]}}function Cl(t,e){for(var r=El(t.self),n=El(e.self),i=new Set(r),o=0,a=n;o<a.length;o++){var s=a[o];i.add(s)}var u=[Array.from(i)];return{self:{primaryType:Zn.EVENT_DIRTY_ORDER,args:u},args:u}}var Nl=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.rankings=[],r.selection=new Zr,r.aggregations=new Map,r.uid=0,r.options={columnTypes:{},colorMappingFunctionTypes:{},mappingFunctionTypes:{},singleSelection:!1,showTopN:10,aggregationStrategy:"item",propagateAggregationState:!0},Object.assign(r.options,e),r.columnTypes=Object.assign({actions:li,aggregate:Qn,annotate:hi,boolean:di,booleans:mi,boxplot:Ys,categorical:Mn,categoricalMap:qs,categoricals:Ks,date:Zs,dateMap:nu,dates:tu,group:ou,hierarchy:au,imposition:bu,impositionBoxPlot:Nu,impositions:Tu,reduce:Au,nested:xu,number:js,numbers:Eu,numberMap:Ou,ordinal:Vu,rank:ni,script:Fu,selection:oi,set:Ln,stack:Su,string:fi,stringMap:Uu,strings:Bu,link:ju,linkMap:Yu,links:Wu},r.options.columnTypes),r.colorMappingFunctionTypes=Object.assign(function(){for(var t,e=((t={})["#C1C1C1"]=du,t.quantized=gu,t.custom=mu,t),r=0,n=Object.keys(pu.FUNCTIONS);r<n.length;r++){e[n[r]]=pu}for(var i=0,o=Object.keys(fu.FUNCTIONS);i<o.length;i++){e[o[i]]=fu}return e}(),r.options.colorMappingFunctionTypes),r.mappingFunctionTypes=Object.assign(Vs(),r.options.mappingFunctionTypes),r.showTopN=r.options.showTopN,r.typeFactory=r.createTypeFactory(),r}return i(e,t),e.prototype.createTypeFactory=function(){var t,e=this,r=function(t){var n=e.fromDescRef(t.desc);if(!n||!n.type)return console.warn("cannot restore column dump",t),new pt(t.id||"",t.desc||{});e.fixDesc(n);var i=e.columnTypes[n.type];if(null==i)return console.warn("invalid column type in column dump using column",t),new pt(t.id||"",n);var o=e.instantiateColumn(i,"",n,e.typeFactory);return o.restore(t,r),o};return r.colorMappingFunction=function(t,e){return function(r){if(!r)return yu;if("function"==typeof r)return new hu(r);var n="string"==typeof r?r:r.type,i=t[n];return i?new i(r,e):Array.isArray(r)?new mu(r):new du(r.toString())}}(this.colorMappingFunctionTypes,r),r.mappingFunction=(t=this.mappingFunctionTypes,function(e){if("function"==typeof e)return new xs([0,1],e);if(!e||!e.type)return new Ls;var r=t[e.type];return r?new r(e):(console.warn("invalid mapping type dump",e),new Ls(e.domain||[0,1],"linear",e.range||[0,1]))}),r.categoricalColorMappingFunction=yn,r},e.prototype.getTypeFactory=function(){return this.typeFactory},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_DATA_CHANGED,e.EVENT_BUSY,e.EVENT_SHOWTOPN_CHANGED,e.EVENT_ADD_COLUMN,e.EVENT_REMOVE_COLUMN,e.EVENT_MOVE_COLUMN,e.EVENT_ADD_RANKING,e.EVENT_REMOVE_RANKING,e.EVENT_DIRTY,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES,e.EVENT_ORDER_CHANGED,e.EVENT_SELECTION_CHANGED,e.EVENT_ADD_DESC,e.EVENT_CLEAR_DESC,e.EVENT_JUMP_TO_NEAREST,e.EVENT_GROUP_AGGREGATION_CHANGED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.pushRanking=function(t){var e=this.cloneRanking(t);return this.insertRanking(e),e},e.prototype.fireBusy=function(t){this.fire(e.EVENT_BUSY,t)},e.prototype.takeSnapshot=function(t){var e=this;this.fireBusy(!0);var r=this.cloneRanking(),n=t.findMyRanker(),i="string"===t.desc.type,o=!1,a=n?n.children.filter((function(e){return e===t?(o=!0,!0):i||"string"!==e.desc.type?wt(e):(i=!0,!0)})):[t];return o||a.push(t),a.forEach((function(n){var i=e.clone(n);r.push(i),n===t&&i.sortByMe()})),this.insertRanking(r),this.fireBusy(!1),r},e.prototype.insertRanking=function(t,r){void 0===r&&(r=this.rankings.length),this.rankings.splice(r,0,t),this.forward.apply(this,[t].concat(e.FORWARD_RANKING_EVENTS));var n=this;t.on(Zn.EVENT_DIRTY_ORDER+".provider",ei((function(){n.triggerReorder(t,El(this))}),100,Cl)),this.fire([e.EVENT_ADD_RANKING,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r),this.triggerReorder(t)},e.prototype.triggerReorder=function(t,e){var r=this;this.fireBusy(!0);var n=e||[Jn.UNKNOWN];Promise.resolve(this.sort(t,n)).then((function(e){var i=e.groups,a=e.index2pos;0===t.getGroupSortCriteria().length&&(i=function(t){if(t.length<=1)return t;var e=t.map((function(t){for(var e=[t],r=t.parent;r;)e.unshift(r),r=r.parent;return e})),r=function(t,e){for(var n,i,a,s=[];t.length>0;){var u=t.shift();if(an(u)&&0!==u.subGroups.length){var l=o({},u);for(s.push(l);t.length>0&&(i=l,(a=t[0]).name===i.name&&a.parent===i.parent&&an(a)&&a.subGroups.length>0);)(n=l.subGroups).push.apply(n,t.shift().subGroups);for(var c=0,p=l.subGroups;c<p.length;c++){p[c].parent=l}l.subGroups=r(l.subGroups,e+1)}else s.push(u)}return s};return r(e.map((function(t){return t[0]})),0),t}(i)),r.initAggregateState(t,i),t.setGroups(i,a,n),r.fireBusy(!1)}))},e.prototype.removeRanking=function(t){var r=this.rankings.indexOf(t);return!(r<0)&&(this.unforward.apply(this,[t].concat(e.FORWARD_RANKING_EVENTS)),this.rankings.splice(r,1),t.on(Zn.EVENT_DIRTY_ORDER+".provider",null),this.cleanUpRanking(t),this.fire([e.EVENT_REMOVE_RANKING,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r),!0)},e.prototype.clearRankings=function(){var t=this;this.rankings.forEach((function(r){t.unforward.apply(t,[r].concat(e.FORWARD_RANKING_EVENTS)),r.on(Zn.EVENT_DIRTY_ORDER+".provider",null),t.cleanUpRanking(r)})),this.rankings.splice(0,this.rankings.length),this.fire([e.EVENT_REMOVE_RANKING,e.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],null,-1)},e.prototype.clearFilters=function(){this.rankings.forEach((function(t){return t.clearFilters()}))},e.prototype.getRankings=function(){return this.rankings.slice()},e.prototype.getFirstRanking=function(){return this.rankings[0]||null},e.prototype.getLastRanking=function(){return this.rankings[this.rankings.length-1]},e.prototype.ensureOneRanking=function(){if(0===this.rankings.length){var t=this.pushRanking();this.push(t,ri())}},e.prototype.destroy=function(){},e.prototype.cleanUpRanking=function(t){},e.prototype.push=function(t,e){var r=this.create(e);return r?(t.push(r),r):null},e.prototype.insert=function(t,e,r){var n=this.create(r);return n?(t.insert(n,e),n):null},e.prototype.nextId=function(){return"col"+this.uid++},e.prototype.fixDesc=function(t){var e=this;return"selection"===t.type?(t.accessor=function(t){return e.isSelected(t.i)},t.setter=function(t,r){return r?e.select(t):e.deselect(t)},t.setterAll=function(t,r){return r?e.selectAll(t):e.deselectAll(t)}):"aggregate"===t.type&&(t.isAggregated=function(t,r){return e.getAggregationState(t,r)},t.setAggregated=function(t,r,n){return e.setAggregationState(t,r,n)}),t},e.prototype.cleanDesc=function(t){return"selection"===t.type?(delete t.accessor,delete t.setter,delete t.setterAll):"aggregate"===t.type&&(delete t.isAggregated,delete t.setAggregated),t},e.prototype.create=function(t){this.fixDesc(t);var e=this.columnTypes[t.type];return e?this.instantiateColumn(e,this.nextId(),t,this.typeFactory):null},e.prototype.instantiateColumn=function(t,e,r,n){return new t(e,r,n)},e.prototype.clone=function(t){var e=this.dumpColumn(t);return this.restoreColumn(e)},e.prototype.restoreColumn=function(t){var e=this.typeFactory(t);return e.assignNewId(this.nextId.bind(this)),e},e.prototype.find=function(t){for(var e="string"==typeof t?function(e){return e.id===t}:t,r=0,n=this.rankings;r<n.length;r++){var i=n[r].find(e);if(i)return i}return null},e.prototype.dump=function(){var t,e,r=this;return{$schema:Zu,uid:this.uid,selection:this.getSelection(),aggregations:(t=this.aggregations,e={},t.forEach((function(t,r){return e[r]=t})),e),rankings:this.rankings.map((function(t){return t.dump(r.toDescRef.bind(r))})),showTopN:this.showTopN}},e.prototype.dumpColumn=function(t){return t.dump(this.toDescRef.bind(this))},e.prototype.toDescRef=function(t){return t},e.prototype.fromDescRef=function(t){return t},e.prototype.restoreRanking=function(t){var e=this.cloneRanking();e.restore(t,this.typeFactory);var r=this.nextId.bind(this);return e.children.forEach((function(t){return t.assignNewId(r)})),e},e.prototype.restore=function(t){var e=this;this.clearRankings(),this.uid=t.uid||0,t.selection&&t.selection.forEach((function(t){return e.selection.add(t)})),null!=t.showTopN&&(this.showTopN=t.showTopN),t.aggregations&&(this.aggregations.clear(),Array.isArray(t.aggregations)?t.aggregations.forEach((function(t){return e.aggregations.set(t,0)})):function(t){for(var e=new Map,r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];e.set(i,t[i])}return e}(t.aggregations).forEach((function(t,r){return e.aggregations.set(r,t)}))),t.rankings&&t.rankings.forEach((function(t){var r=e.cloneRanking();r.restore(t,e.typeFactory),r.children.some((function(t){return t instanceof ni}))||r.insert(e.create(ri()),0),e.insertRanking(r)}));var r=this.nextId.bind(this);this.rankings.forEach((function(t){t.children.forEach((function(t){return t.assignNewId(r)}))}))},e.prototype.deriveDefault=function(t){var e=this;void 0===t&&(t=!0);var r=this.pushRanking();return t&&(r.push(this.create($n())),r.push(this.create(ri())),!1!==this.options.singleSelection&&r.push(this.create(ii()))),this.getColumns().forEach((function(t){var n=e.create(t);n&&!wt(n)&&r.push(n)})),r},e.prototype.isAggregated=function(t,e){return this.getTopNAggregated(t,e)>=0},e.prototype.getAggregationState=function(t,e){var r=this.getTopNAggregated(t,e);return r<0?Vn.EXPAND:0===r?Vn.COLLAPSE:Vn.EXPAND_TOP_N},e.prototype.setAggregated=function(t,e,r){return this.setAggregationState(t,e,r?Vn.COLLAPSE:Vn.EXPAND)},e.prototype.setAggregationState=function(t,e,r){this.setTopNAggregated(t,e,r===Vn.COLLAPSE?0:r===Vn.EXPAND_TOP_N?this.showTopN:-1)},e.prototype.getTopNAggregated=function(t,e){for(var r=e;r;){var n=t.id+"@"+on(r);if(this.aggregations.has(n)){var i=this.aggregations.get(n);return this.options.propagateAggregationState&&e!==r&&this.aggregations.set(t.id+"@"+on(e),i),i}r=r.parent}return-1},e.prototype.unaggregateParents=function(t,e){for(var r=e.parent,n=!1;r;)n=this.aggregations.delete(t.id+"@"+on(r))||n,r=r.parent;return n},e.prototype.getAggregationStrategy=function(){return this.options.aggregationStrategy},e.prototype.initAggregateState=function(t,e){var r=-1;switch(this.getAggregationStrategy()){case"group":r=0;break;case"item":case"group+item":case"group+item+top":r=-1;break;case"group+top+item":r=this.showTopN}for(var n=0,i=e;n<i.length;n++){var o=i[n],a=t.id+"@"+on(o);!this.aggregations.has(a)&&r>=0&&this.aggregations.set(a,r)}},e.prototype.setTopNAggregated=function(t,r,n){for(var i=Array.isArray(r)?r:[r],o=[],a=[],s=!1,u=0;u<i.length;u++){var l=i[u],c="number"==typeof n?n:n[u];s=this.unaggregateParents(t,l)||s;var p=this.getTopNAggregated(t,l);if(p!==c){o.push(l),a.push(p);var f=t.id+"@"+on(l);c>=0?this.aggregations.set(f,c):this.aggregations.delete(f)}}(s||0!==o.length)&&(Array.isArray(r)?this.fire([e.EVENT_GROUP_AGGREGATION_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r,a,n):this.fire([e.EVENT_GROUP_AGGREGATION_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],t,r,0===a.length?n:a[0],n))},e.prototype.aggregateAllOf=function(t,e,r){void 0===r&&(r=t.getGroups());var n,i,o=(n=e,i=this.showTopN,"boolean"==typeof n?n?0:-1:n===Vn.COLLAPSE?0:n===Vn.EXPAND?-1:n===Vn.EXPAND_TOP_N?i:n);this.setTopNAggregated(t,r,o)},e.prototype.getShowTopN=function(){return this.showTopN},e.prototype.setShowTopN=function(t){if(this.showTopN!==t){for(var r=0,n=Array.from(this.aggregations.entries());r<n.length;r++){var i=n[r],o=i[0];i[1]===this.showTopN&&this.aggregations.set(o,t)}this.fire([e.EVENT_SHOWTOPN_CHANGED,e.EVENT_DIRTY_VALUES,e.EVENT_DIRTY],this.showTopN,this.showTopN=t)}},e.prototype.isSelected=function(t){return this.selection.has(t)},e.prototype.select=function(t){this.selection.has(t)||(!0===this.options.singleSelection&&this.selection.size>0&&this.selection.clear(),this.selection.add(t),this.fire(e.EVENT_SELECTION_CHANGED,this.getSelection()))},e.prototype.jumpToNearest=function(t){0!==t.length&&this.fire(e.EVENT_JUMP_TO_NEAREST,t)},e.prototype.selectAll=function(t){var r=this;fn(t,(function(t){return r.selection.has(t)}))||(!0===this.options.singleSelection?(this.selection.clear(),t.length>0&&this.selection.add(t[0])):hn(t,(function(t){r.selection.add(t)})),this.fire(e.EVENT_SELECTION_CHANGED,this.getSelection()))},e.prototype.selectAllOf=function(t){this.setSelection(Array.from(t.getOrder()))},e.prototype.setSelection=function(t){var e=this;if(0===t.length)return this.clearSelection();this.selection.size===t.length&&t.every((function(t){return e.selection.has(t)}))||(this.selection.clear(),this.selectAll(t))},e.prototype.toggleSelection=function(t,e){return void 0===e&&(e=!1),this.isSelected(t)?(e?this.deselect(t):this.clearSelection(),!1):(e?this.select(t):this.setSelection([t]),!0)},e.prototype.deselect=function(t){this.selection.has(t)&&(this.selection.delete(t),this.fire(e.EVENT_SELECTION_CHANGED,this.getSelection()))},e.prototype.deselectAll=function(t){var r=this;fn(t,(function(t){return!r.selection.has(t)}))||(hn(t,(function(t){r.selection.delete(t)})),this.fire(e.EVENT_SELECTION_CHANGED,this.getSelection()))},e.prototype.selectedRows=function(){return 0===this.selection.size?[]:this.view(this.getSelection())},e.prototype.getSelection=function(){return Array.from(this.selection)},e.prototype.clearSelection=function(){0!==this.selection.size&&(this.selection.clear(),this.fire(e.EVENT_SELECTION_CHANGED,[],!1))},e.prototype.exportTable=function(t,e){return void 0===e&&(e={}),Promise.resolve(this.view(t.getOrder())).then((function(r){return hl(t,r,e)}))},e.EVENT_SELECTION_CHANGED="selectionChanged",e.EVENT_DATA_CHANGED="dataChanged",e.EVENT_ADD_COLUMN=Zn.EVENT_ADD_COLUMN,e.EVENT_MOVE_COLUMN=Zn.EVENT_MOVE_COLUMN,e.EVENT_REMOVE_COLUMN=Zn.EVENT_REMOVE_COLUMN,e.EVENT_ADD_RANKING="addRanking",e.EVENT_REMOVE_RANKING="removeRanking",e.EVENT_DIRTY=Zn.EVENT_DIRTY,e.EVENT_DIRTY_HEADER=Zn.EVENT_DIRTY_HEADER,e.EVENT_DIRTY_VALUES=Zn.EVENT_DIRTY_VALUES,e.EVENT_DIRTY_CACHES=Zn.EVENT_DIRTY_CACHES,e.EVENT_ORDER_CHANGED=Zn.EVENT_ORDER_CHANGED,e.EVENT_SHOWTOPN_CHANGED="showTopNChanged",e.EVENT_ADD_DESC="addDesc",e.EVENT_CLEAR_DESC="clearDesc",e.EVENT_REMOVE_DESC="removeDesc",e.EVENT_JUMP_TO_NEAREST="jumpToNearest",e.EVENT_GROUP_AGGREGATION_CHANGED=Qn.EVENT_AGGREGATE,e.EVENT_BUSY="busy",e.FORWARD_RANKING_EVENTS=it(".provider",Zn.EVENT_ADD_COLUMN,Zn.EVENT_REMOVE_COLUMN,Zn.EVENT_DIRTY,Zn.EVENT_DIRTY_HEADER,Zn.EVENT_MOVE_COLUMN,Zn.EVENT_ORDER_CHANGED,Zn.EVENT_DIRTY_VALUES,Zn.EVENT_DIRTY_CACHES),e}(at);function _l(t){return t.accessor=t.accessor||(t.column?rl(t.column)?il:ol:al),t.label=t.label||t.column,t}var Tl=function(t){function e(e,r){void 0===e&&(e=[]),void 0===r&&(r={});var n=t.call(this,r)||this;return n.columns=e,n.rankingIndex=0,e.forEach(_l),n}return i(e,t),e.prototype.cloneRanking=function(t){var e=this,r=this.nextRankingId(),n=new Zn(r);return t&&t.children.forEach((function(t){e.push(n,t.desc)})),n},e.prototype.pushDesc=function(t){_l(t),this.columns.push(t),this.fire(Nl.EVENT_ADD_DESC,t)},e.prototype.clearColumns=function(){this.clearRankings(),this.columns.splice(0,this.columns.length),this.fire(Nl.EVENT_CLEAR_DESC)},e.prototype.removeDesc=function(t,e){void 0===e&&(e=!1);var r=this.columns.indexOf(t);return!(r<0)&&(!(!e&&this.getRankings().some((function(e){return e.flatColumns.some((function(e){return e.desc===t}))})))&&(this.columns.splice(r,1),this.fire(Nl.EVENT_REMOVE_DESC,t),!0))},e.prototype.getColumns=function(){return this.columns.slice()},e.prototype.findDesc=function(t){return this.columns.filter((function(e){return e.column===t}))[0]},e.prototype.toDescRef=function(t){return void 0!==t.column?t.type+"@"+t.column:this.cleanDesc(Object.assign({},t))},e.prototype.fromDescRef=function(t){if("string"==typeof t)return this.columns.find((function(e){return e.type+"@"+e.column===t||e.type===t}));var e=this.columns.find((function(e){return t.column===e.column&&t.label===e.label&&t.type===e.type}));return e||t},e.prototype.restore=function(e){t.prototype.restore.call(this,e),this.rankingIndex=1+Math.max.apply(Math,this.getRankings().map((function(t){return+t.id.substring(4)})))},e.prototype.nextRankingId=function(){return"rank"+this.rankingIndex++},e}(Nl),wl=Number.NEGATIVE_INFINITY,Rl=Number.POSITIVE_INFINITY;function Al(t,e){switch(e){case ot.COUNT:return k(t+1);case ot.BINARY:case ot.UINT8:return new Uint8Array(t);case ot.UINT16:return new Uint16Array(t);case ot.UINT32:return new Uint32Array(t);case ot.INT8:return new Int8Array(t);case ot.INT16:return new Int16Array(t);case ot.INT32:return new Int32Array(t);case ot.STRING:return[];case ot.FLOAT_ASC:case ot.FLOAT:return new Float32Array(t);case ot.DOUBLE_ASC:case ot.DOUBLE:return new Float64Array(t)}}function Dl(t,e,r){switch(t){case ot.BINARY:return function(t,r){return e[t]=null==r||isNaN(r)?255:r+1};case ot.COUNT:return function(t,n){return e[t]=null==n||isNaN(n)?r:n+1};case ot.UINT8:return function(t,r){return e[t]=null==r||isNaN(r)?127:r+1};case ot.UINT16:return function(t,r){return e[t]=null==r||isNaN(r)?32767:r+1};case ot.UINT32:return function(t,r){return e[t]=null==r||isNaN(r)?2147483647:r+1};case ot.INT8:return function(t,r){return e[t]=null==r||isNaN(r)?127:r};case ot.INT16:return function(t,r){return e[t]=null==r||isNaN(r)?32767:r};case ot.INT32:return function(t,r){return e[t]=null==r||isNaN(r)?2147483647:r};case ot.STRING:return function(t,r){return e[t]=null==r||""===r?"":r};case ot.FLOAT:case ot.DOUBLE:return function(t,r){return e[t]=null==r||isNaN(r)?wl:r};case ot.FLOAT_ASC:case ot.DOUBLE_ASC:return function(t,r){return e[t]=null==r||isNaN(r)?Rl:r}}}var Sl=function(){function t(t,e,r,n){this.criteria=[],this.data=[];for(var i=function(t){return t<=255?255:t<=65535?65535:4294967295}(t+1),o=0,a=e?r.getSortCriteria():r.getGroupSortCriteria();o<a.length;o++){var s=a[o],u=e?s.col.toCompareValueType():s.col.toCompareGroupValueType(),l=n?n(s.col):void 0;if(this.criteria.push({col:s.col,valueCache:l}),Array.isArray(u))for(var c=0,p=u;c<p.length;c++){var f=p[c];h=Al(t,f);this.data.push({asc:s.asc,v:f,lookup:h,setter:Dl(f,h,i)})}else{var h=Al(t,u);this.data.push({asc:s.asc,v:u,lookup:h,setter:Dl(u,h,i)})}}if(!e){h=Al(t,u=ot.STRING);this.data.push({asc:!0,v:u,lookup:h,setter:Dl(u,h,i)})}}return Object.defineProperty(t.prototype,"sortOrders",{get:function(){return this.data.map((function(t){return{asc:t.asc,lookup:t.lookup}}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"transferAbles",{get:function(){return this.data.map((function(t){return t.lookup})).filter((function(t){return!Array.isArray(t)})).map((function(t){return t.buffer}))},enumerable:!0,configurable:!0}),t.prototype.push=function(t){for(var e=0,r=0,n=this.criteria;r<n.length;r++){var i=n[r],o=i.col.toCompareValue(t,i.valueCache?i.valueCache(t.i):void 0);if(Array.isArray(o))for(var a=0,s=o;a<s.length;a++){var u=s[a];this.data[e++].setter(t.i,u)}else this.data[e++].setter(t.i,o)}},t.prototype.pushValues=function(t,e){for(var r=0;r<e.length;++r)this.data[r].setter(t,e[r])},t.prototype.free=function(){this.data.splice(0,this.data.length)},t}(),Ml={value:null,done:!1};function Ll(t){return{next:function(){return{done:!0,value:t()}}}}function xl(t,e,r){return function(n,i){return{then:xl(t.then(n,i),e,r),abort:e,isAborted:r}}}var Ol=function(){function t(){var t=this;this.tasks=[],this.taskId=-1,this.runTasks=function(e){for(var r=function(){for(var r=t.tasks.shift(),n=r.it.next();!n.done&&(e.didTimeout||e.timeRemaining()>0);)n=r.it.next();n.done?requestAnimationFrame((function(){return r.resolve(n.value)})):t.tasks.unshift(r)};t.tasks.length>0&&(e.didTimeout||e.timeRemaining()>0);)r();t.taskId=-1,t.reSchedule()}}return t.prototype.reSchedule=function(){if(!(0===this.tasks.length||this.taskId>-1)){var t=self;t.requestIdleCallback?this.taskId=t.requestIdleCallback(this.runTasks):this.taskId=self.setTimeout(this.runTasks,1)}},t.prototype.pushMulti=function(t,e,r){var n=this;void 0===r&&(r=!0);var i,o=function(){var e=n.tasks.findIndex((function(e){return e.id===t}));if(!(e<0)){var r=n.tasks[e];n.tasks.splice(e,1),r.isAborted=!0,r.resolve(qu)}},a=this.tasks.findIndex((function(e){return e.id===t}));a>=0&&this.tasks[a].abort();var s=new Promise((function(t){i=t})),u={id:t,it:e,result:s,abort:o,isAborted:!1,resolve:i};this.tasks.push(u),this.reSchedule();var l=r?o:function(){},c=r?function(){return u.isAborted}:function(){return!1};return{then:xl(s,l,c),abort:l,isAborted:c}},t.prototype.push=function(t,e){return this.pushMulti(t,Ll(e))},t.prototype.abort=function(t){var e=this.tasks.findIndex((function(e){return e.id===t}));return!(e<0)&&(this.tasks[e].abort(),!0)},t.prototype.abortAll=function(t){var e=this.tasks.filter(t);if(0!==e.length){this.tasks=this.tasks.filter((function(e){return!t(e)}));for(var r=0,n=e;r<n.length;r++){var i=n[r];i.resolve(qu),i.abort()}}},t.prototype.clear=function(){if(-1!==this.taskId){var t=self;t.requestIdleCallback?t.clearIdleCallback(this.taskId):self.clearTimeout(this.taskId),this.taskId=-1,this.tasks.splice(0,this.tasks.length).forEach((function(t){t.resolve(qu),t.abort()}))}},t}(),Vl=function(){function t(t){this.v=t}return t.prototype.then=function(t){return t(this.v)},t}();function Il(t){return new Vl(t)}var kl=function(){function t(t){this.v=t}return t.prototype.then=function(t){return this.v.then(t)},t}();function Gl(t){return new kl(t)}function Hl(t){return t.every((function(t){return t instanceof Vl}))?Il(t.map((function(t){return t.v}))):Gl($u(t.map((function(t){return t.v}))))}var Pl=function(){function t(t,e){this.indices=t,this.maxDataIndex=e,this._joined=null}return Object.defineProperty(t.prototype,"joined",{get:function(){return 1===this.indices.length?this.indices[0]:0===this.indices.length?new Uint8Array(0):this._joined?this._joined:this._joined=H(this.indices,this.maxDataIndex)},enumerable:!0,configurable:!0}),t}(),Fl=function(){function t(t){var e=this;void 0===t&&(t=[]),this.data=t,this.valueCacheData=new Map,this.byIndex=function(t){return e.data[t]}}return t.prototype.byOrder=function(t){return g(t).map(this.byIndex)},t.prototype.byOrderAcc=function(t,e){var r=this;return g(t).map((function(t){return e(r.data[t])}))},t.prototype.builder=function(t,e,r,n){var i=this,o=0,a=0,s=e instanceof Pl?e.indices:[e];return{next:null==e?function(e){void 0===e&&(e=100);for(var a=e,s=i.data;o<s.length&&a>0;++o,--a)t.push(r(o));return o<s.length?Ml:{done:!0,value:n?n(t.build()):t.build()}}:function(e){void 0===e&&(e=100);for(var i=e;a<s.length;){for(var u=s[a];o<u.length&&i>0;++o,--i)t.push(r(u[o]));if(o<u.length)return Ml;a++,o=0}return{done:!0,value:n?n(t.build()):t.build()}}}},t.prototype.builderForEach=function(t,e,r,n){return this.builder({push:t.pushAll,build:t.build},e,r,n)},t.prototype.boxplotBuilder=function(t,e,r,n){var i=A();return this.numberStatsBuilder(i,t,e,r,n)},t.prototype.normalizedStatsBuilder=function(t,e,r,n,i){var o=D(r);return this.numberStatsBuilder(o,t,e,n,i)},t.prototype.numberStatsBuilder=function(t,e,r,n,i){var o=this;if(r instanceof js||r instanceof Vu||r instanceof bu){var a=n?r.id+":r":r.id,s=n?function(t){return r.getRawNumber(o.data[t])}:function(t){return r.getNumber(o.data[t])};if(null==e&&!this.valueCacheData.has(a)){var u=new Float32Array(this.data.length),l=0;return this.builder({push:function(e){t.push(e),u[l++]=e},build:function(){return o.setValueCacheData(a,u),t.build()}},null,s,i)}var c=this.valueCacheData.get(a),p=c?function(t){return c[t]}:s;return this.builder(t,e,p,i)}var f=n?function(t){return r.iterRawNumber(o.data[t])}:function(t){return r.iterNumber(o.data[t])};return this.builderForEach(t,e,f,i)},t.prototype.dateStatsBuilder=function(t,e,r,n){var i=this,o=L(r);if(e instanceof Zs){if(null==t){var a=function(t){var e=new Float64Array(t),r=0;return{push:function(t){return e[r++]=null==t?NaN:t.getTime()},cache:e}}(this.data.length);return this.builder({push:function(t){o.push(t),a.push(t)},build:function(){return i.setValueCacheData(e.id,a.cache),o.build()}},null,(function(t){return e.getDate(i.data[t])}),n)}var s=this.valueCacheData.get(e.id),u=s?function(t){return B(s[t])}:function(t){return e.getDate(i.data[t])};return this.builder(o,t,u,n)}return this.builderForEach(o,t,(function(t){return e.iterDate(i.data[t])}),n)},t.prototype.categoricalStatsBuilder=function(t,e,r){var n=this,i=x(e.categories);if(e instanceof Mn||e instanceof Vu){if(null==t){var o=function(t,e){for(var r=k(t,e.length+1),n=new Map,i=0;i<e.length;++i)n.set(e[i].name,i+1);var o=0;return{push:function(t){return r[o++]=null==t?0:n.get(t.name)||0},cache:r}}(this.data.length,e.categories);return this.builder({push:function(t){i.push(t),o.push(t)},build:function(){return n.setValueCacheData(e.id,o.cache),i.build()}},null,(function(t){return e.getCategory(n.data[t])}),r)}var a=this.valueCacheData.get(e.id),s=a?function(t){return j(a[t],e.categories)}:function(t){return e.getCategory(n.data[t])};return this.builder(i,t,s,r)}return this.builderForEach(i,t,(function(t){return e.iterCategory(n.data[t])}),r)},t.prototype.dirtyColumn=function(t,e){"data"===e&&(this.valueCacheData.delete(t.id),this.valueCacheData.delete(t.id+":r"))},t.prototype.setValueCacheData=function(t,e){null==e?this.valueCacheData.delete(t):this.valueCacheData.set(t,e)},t.prototype.valueCache=function(t){var e=this.valueCacheData.get(t.id);if(e)return t instanceof Zs?function(t){return B(e[t])}:t instanceof Mn||t instanceof Vu?function(r){return j(e[r],t.categories)}:function(t){return e[t]}},t}();function Ul(t,e,r){var n=G(t,e);return r&&U(n,r.sortOrders),n}var Bl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache=new Map,e}return i(e,t),e.prototype.setData=function(t){this.data=t,this.cache.clear(),this.valueCacheData.clear()},e.prototype.dirtyColumn=function(e,r){t.prototype.dirtyColumn.call(this,e,r),"group"!==r&&(this.cache.delete(e.id+":summary"),this.cache.delete(e.id+":summary:raw"),this.cache.delete(e.id+":summary:b"),this.cache.delete(e.id+":summary:braw"),"summary"!==r&&(this.cache.delete(e.id+":data"),this.cache.delete(e.id+":data:raw"),this.cache.delete(e.id+":data:b"),this.cache.delete(e.id+":data:braw")))},e.prototype.dirtyRanking=function(t,e){for(var r=0,n=t.flatColumns;r<n.length;r++){var i=n[r];this.dirtyColumn(i,e)}},e.prototype.preCompute=function(){},e.prototype.preComputeData=function(){},e.prototype.preComputeCol=function(){},e.prototype.copyData2Summary=function(){},e.prototype.copyCache=function(t,e){for(var r=e.id+":",n=0,i=Array.from(this.cache.keys()).sort();n<i.length;n++){var o=i[n];if(o.startsWith(r)){var a=t.id+":"+o.slice(r.length);this.cache.set(a,this.cache.get(o))}}},e.prototype.sort=function(t,e,r,n,i,o){return Promise.resolve(Ul(r,i,o))},e.prototype.groupCompare=function(t,e,r){var n=t.getGroupSortCriteria();if(0===n.length)return Il([e.name.toLowerCase()]);for(var i=this.byOrder(r),o=[],a=0,s=n;a<s.length;a++){var u=s[a].col.toCompareGroupValue(i,e);Array.isArray(u)?o.push.apply(o,u):o.push(u)}return o.push(e.name.toLowerCase()),Il(o)},e.prototype.groupRows=function(t,e,r,n){return Il(n(this.byOrder(e.order)))},e.prototype.groupExampleRows=function(t,e,r,n){return Il(n(this.byOrder(e.order.slice(0,5))))},e.prototype.groupBoxPlotStats=function(t,e,r){var n=this.summaryBoxPlotStatsD(t,r),i=n.summary,o=n.data;return Il({group:this.boxplotBuilder(e.order,t,r).next(1/0).value,summary:i,data:o})},e.prototype.groupNumberStats=function(t,e,r){var n=this.summaryNumberStatsD(t,r),i=n.summary,o=n.data;return Il({group:this.normalizedStatsBuilder(e.order,t,i.hist.length,r).next(1/0).value,summary:i,data:o})},e.prototype.groupCategoricalStats=function(t,e){var r=this.summaryCategoricalStatsD(t),n=r.summary,i=r.data;return Il({group:this.categoricalStatsBuilder(e.order,t).next(1/0).value,summary:n,data:i})},e.prototype.groupDateStats=function(t,e){var r=this.summaryDateStatsD(t),n=r.summary,i=r.data;return Il({group:this.dateStatsBuilder(e.order,t,n).next(1/0).value,summary:n,data:i})},e.prototype.summaryBoxPlotStats=function(t,e){return Il(this.summaryBoxPlotStatsD(t,e))},e.prototype.summaryNumberStats=function(t,e){return Il(this.summaryNumberStatsD(t,e))},e.prototype.summaryCategoricalStats=function(t){return Il(this.summaryCategoricalStatsD(t))},e.prototype.summaryDateStats=function(t){return Il(this.summaryDateStatsD(t))},e.prototype.summaryNumberStatsD=function(t,e){var r=this;return this.cached("summary",t,(function(){var n=t.findMyRanker().getOrder(),i=r.dataNumberStats(t,e);return{summary:r.normalizedStatsBuilder(n,t,i.hist.length,e).next(1/0).value,data:i}}),e?":raw":"",0===t.findMyRanker().getOrderLength())},e.prototype.summaryBoxPlotStatsD=function(t,e){var r=this;return this.cached("summary",t,(function(){var n=t.findMyRanker().getOrder(),i=r.dataBoxPlotStats(t,e);return{summary:r.boxplotBuilder(n,t,e).next(1/0).value,data:i}}),e?":braw":":b",0===t.findMyRanker().getOrderLength())},e.prototype.summaryCategoricalStatsD=function(t){var e=this;return this.cached("summary",t,(function(){var r=t.findMyRanker().getOrder(),n=e.dataCategoricalStats(t);return{summary:e.categoricalStatsBuilder(r,t).next(1/0).value,data:n}}),"",0===t.findMyRanker().getOrderLength())},e.prototype.summaryDateStatsD=function(t){var e=this;return this.cached("summary",t,(function(){var r=t.findMyRanker().getOrder(),n=e.dataDateStats(t);return{summary:e.dateStatsBuilder(r,t,n).next(1/0).value,data:n}}),"",0===t.findMyRanker().getOrderLength())},e.prototype.cached=function(t,e,r,n,i){void 0===n&&(n=""),void 0===i&&(i=!1);var o=e.id+":"+t+n;if(this.cache.has(o))return this.cache.get(o);var a=r();return i||this.cache.set(o,a),a},e.prototype.dataBoxPlotStats=function(t,e){var r=this;return this.cached("data",t,(function(){return r.boxplotBuilder(null,t,e).next(1/0).value}),e?":braw":":b")},e.prototype.dataNumberStats=function(t,e){var r=this;return this.cached("data",t,(function(){return r.normalizedStatsBuilder(null,t,b(r.data.length),e).next(1/0).value}),e?":raw":"")},e.prototype.dataCategoricalStats=function(t){var e=this;return this.cached("data",t,(function(){return e.categoricalStatsBuilder(null,t).next(1/0).value}))},e.prototype.dataDateStats=function(t){var e=this;return this.cached("data",t,(function(){return e.dateStatsBuilder(null,t).next(1/0).value}))},e.prototype.terminate=function(){this.cache.clear()},e}(Fl);function jl(t){return t instanceof pt&&"function"==typeof t.getMap&&"function"==typeof t.getMapLabel||!(t instanceof pt)&&t.type.endsWith("Map")}function Yl(t){return t instanceof pt&&"function"==typeof t.getLabels&&"function"==typeof t.getValues&&jl(t)||!(t instanceof pt)&&t.type.endsWith("s")&&"actions"!==t.type}function Wl(t){return void 0!==t.categories&&"function"==typeof t.iterCategory}function zl(t){return Wl(t)&&"function"==typeof t.getSet}function ql(t){return t instanceof pt&&"function"==typeof t.getCategory||!(t instanceof pt)&&null!=t.type.match(/(categorical|ordinal|hierarchy)/)}function Kl(t){return Wl(t)&&Yl(t)&&!zl(t)}function Xl(t){return"string"==typeof t.name&&"string"==typeof t.label&&"string"==typeof t.color&&"number"==typeof t.value}function $l(t){return t instanceof pt&&"function"==typeof t.getDate||!(t instanceof pt)&&t.type.startsWith("date")}function Jl(t){return"function"==typeof t.getDates}var Ql,Zl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache=new Map,e.tasks=new Ol,e.workers=new v(W()),e}return i(e,t),e.prototype.setData=function(t){this.data=t,this.cache.clear(),this.tasks.clear(),this.valueCacheData.clear(),this.workers.deleteRefs()},e.prototype.dirtyColumn=function(e,r){t.prototype.dirtyColumn.call(this,e,r);for(var n=0,i=Array.from(this.cache.keys()).sort();n<i.length;n++){var o=i[n];("data"===r&&o.startsWith(e.id+":")||"summary"===r&&o.startsWith(e.id+":b:summary:")||o.startsWith(e.id+":a:group"))&&(this.cache.delete(o),this.tasks.abort(o))}"data"===r&&(this.valueCacheData.delete(e.id),this.workers.deleteRef(e.id))},e.prototype.dirtyRanking=function(e,r){var n,i=e.flatColumns;switch(r){case"group":n=i.map((function(t){return function(e){return e.startsWith(t.id+":a:group")}}));break;case"summary":n=i.map((function(t){return function(e){return e.startsWith(t.id+":b:summary")||e.startsWith(t.id+":a:group")}}));break;case"data":default:n=i.map((function(t){return function(e){return e.startsWith(t.id+":")}}))}for(var o=function(t){n.some((function(e){return e(t)}))&&(a.cache.delete(t),a.tasks.abort(t))},a=this,s=0,u=Array.from(this.cache.keys()).sort();s<u.length;s++){o(u[s])}if(this.tasks.abortAll((function(t){return t.id.startsWith("r"+e.id+":")})),this.workers.deleteRef(e.id,!0),"data"===r)for(var l=0,c=i;l<c.length;l++){var p=c[l];t.prototype.dirtyColumn.call(this,p,r),this.workers.deleteRef(p.id)}},e.prototype.preCompute=function(t,e,r){if(0!==e.length){var n=t.flatColumns;if(1!==e.length)for(var i=e.map((function(t){var e=t.rows,r=t.group;return Object.assign({order:e},r)})),o=new Pl(e.map((function(t){return t.rows})),r),a=0,s=n;a<s.length;a++){if(Wl(C=s[a])){this.summaryCategoricalStats(C,o);for(var u=0,l=i;u<l.length;u++){var c=l[u];this.groupCategoricalStats(C,c)}}else if($l(C)){this.summaryDateStats(C,o);for(var p=0,f=i;p<f.length;p++){c=f[p];this.groupDateStats(C,c)}}else if(St(C)){this.summaryNumberStats(C,!1,o),this.summaryNumberStats(C,!0,o);for(var h=0,d=i;h<d.length;h++){c=d[h];this.groupNumberStats(C,c,!1),this.groupNumberStats(C,c,!0)}}}else for(var g=e[0],m=g.group,y=g.rows,v=new Pl([y],r),b=0,E=n;b<E.length;b++){var C;if(Wl(C=E[b]))this.summaryCategoricalStats(C,v);else if(St(C))this.summaryNumberStats(C,!1,v),this.summaryNumberStats(C,!0,v);else{if(!$l(C))continue;this.summaryDateStats(C,v)}this.chainCopy(C.id+":a:group:"+m.name,this.cache.get(C.id+":b:summary"),(function(t){return{group:t.summary,summary:t.summary,data:t.data}})),St(C)&&this.chainCopy(C.id+":a:group:"+m.name+":raw",this.cache.get(C.id+":b:summary:raw"),(function(t){return{group:t.summary,summary:t.summary,data:t.data}}))}}},e.prototype.preComputeData=function(t){for(var e=0,r=t.flatColumns;e<r.length;e++){var n=r[e];Wl(n)?this.dataCategoricalStats(n):St(n)?(this.dataNumberStats(n,!1),this.dataNumberStats(n,!0)):$l(n)&&this.dataDateStats(n)}},e.prototype.preComputeCol=function(t){var e=t.findMyRanker();if(Wl(t)){if(this.dataCategoricalStats(t),!e)return;this.summaryCategoricalStats(t);for(var r=0,n=e.getGroups();r<n.length;r++){var i=n[r];this.groupCategoricalStats(t,i)}}else if(St(t)){if(this.dataNumberStats(t,!1),this.dataNumberStats(t,!0),!e)return;this.summaryNumberStats(t,!1),this.summaryNumberStats(t,!0);for(var o=0,a=e.getGroups();o<a.length;o++){i=a[o];this.groupNumberStats(t,i,!1),this.groupNumberStats(t,i,!0)}}else if($l(t)&&(this.dataDateStats(t),e)){this.summaryDateStats(t);for(var s=0,u=e.getGroups();s<u.length;s++){i=u[s];this.groupDateStats(t,i)}}},e.prototype.copyData2Summary=function(t){for(var e=0,r=t.flatColumns;e<r.length;e++){var n=r[e];if(Wl(n))this.dataCategoricalStats(n);else if(St(n))this.dataNumberStats(n,!1),this.dataNumberStats(n,!0);else{if(!$l(n))continue;this.dataDateStats(n)}this.chainCopy(n.id+":b:summary",this.cache.get(n.id+":c:data"),(function(t){return{summary:t,data:t}})),St(n)&&this.chainCopy(n.id+":b:summary:raw",this.cache.get(n.id+":c:data:raw"),(function(t){return{summary:t,data:t}}))}},e.prototype.copyCache=function(t,e){for(var r=e.id+":",n=0,i=Array.from(this.cache.keys()).sort();n<i.length;n++){var o=i[n];if(o.startsWith(r)){var a=t.id+":"+o.slice(r.length);this.chainCopy(a,this.cache.get(o),(function(t){return t}))}}},e.prototype.groupCompare=function(t,e,r){var n=this;return Gl(this.tasks.push("r"+t.id+":"+e.name,(function(){var i=t.getGroupSortCriteria();if(0===i.length)return[e.name.toLowerCase()];for(var o=n.byOrder(r),a=[],s=function(t){var i=n.valueCache(t.col),s=t.col.toCompareGroupValue(o,e,i?g(r).map((function(t){return i(t)})):void 0);Array.isArray(s)?a.push.apply(a,s):a.push(s)},u=0,l=i;u<l.length;u++){s(l[u])}return a.push(e.name.toLowerCase()),a})))},e.prototype.groupRows=function(t,e,r,n){var i=this;return this.cached(t.id+":a:group:"+e.name+":"+r,!0,Ll((function(){return n(i.byOrder(e.order))})))},e.prototype.groupExampleRows=function(t,e,r,n){return Il(n(this.byOrder(e.order.slice(0,5))))},e.prototype.groupBoxPlotStats=function(t,e,r){var n=this;return this.chain(t.id+":a:group:"+e.name+(r?":braw":":b"),this.summaryBoxPlotStats(t,r),(function(i){var o=i.summary,a=i.data,s=t.findMyRanker(),u=r?t.id+":r":t.id;return n.valueCacheData.has(u)&&e.order.length>0?function(){return n.workers.pushStats("boxplotStats",{},u,n.valueCacheData.get(u),s.id+":"+e.name,e.order).then((function(t){return{group:t,summary:o,data:a}}))}:n.boxplotBuilder(e.order,t,r,(function(t){return{group:t,summary:o,data:a}}))}))},e.prototype.groupNumberStats=function(t,e,r){var n=this;return this.chain(t.id+":a:group:"+e.name+(r?":raw":""),this.summaryNumberStats(t,r),(function(i){var o=i.summary,a=i.data,s=t.findMyRanker(),u=r?t.id+":r":t.id;return n.valueCacheData.has(u)&&e.order.length>0?function(){return n.workers.pushStats("numberStats",{numberOfBins:o.hist.length},u,n.valueCacheData.get(u),s.id+":"+e.name,e.order).then((function(t){return{group:t,summary:o,data:a}}))}:n.normalizedStatsBuilder(e.order,t,o.hist.length,r,(function(t){return{group:t,summary:o,data:a}}))}))},e.prototype.groupCategoricalStats=function(t,e){var r=this;return this.chain(t.id+":a:group:"+e.name,this.summaryCategoricalStats(t),(function(n){var i=n.summary,o=n.data,a=t.findMyRanker();return r.valueCacheData.has(t.id)&&e.order.length>0?function(){return r.workers.pushStats("categoricalStats",{categories:t.categories.map((function(t){return t.name}))},t.id,r.valueCacheData.get(t.id),a.id+":"+e.name,e.order).then((function(t){return{group:t,summary:i,data:o}}))}:r.categoricalStatsBuilder(e.order,t,(function(t){return{group:t,summary:i,data:o}}))}))},e.prototype.groupDateStats=function(t,e){var r=this,n=t.id+":a:group:"+e.name;return this.chain(n,this.summaryDateStats(t),(function(n){var i=n.summary,o=n.data,a=t.findMyRanker();return r.valueCacheData.has(t.id)&&e.order.length>0?function(){return r.workers.pushStats("dateStats",{template:i},t.id,r.valueCacheData.get(t.id),a.id+":"+e.name,e.order).then((function(t){return{group:t,summary:i,data:o}}))}:r.dateStatsBuilder(e.order,t,i,(function(t){return{group:t,summary:i,data:o}}))}))},e.prototype.summaryBoxPlotStats=function(t,e,r){var n=this;return this.chain(t.id+":b:summary"+(e?":braw":":b"),this.dataBoxPlotStats(t,e),(function(i){var o=t.findMyRanker(),a=e?t.id+":r":t.id;return n.valueCacheData.has(a)?function(){return n.workers.pushStats("boxplotStats",{},a,n.valueCacheData.get(a),o.id,r?r.joined:o.getOrder()).then((function(t){return{summary:t,data:i}}))}:n.boxplotBuilder(r||o.getOrder(),t,e,(function(t){return{summary:t,data:i}}))}))},e.prototype.summaryNumberStats=function(t,e,r){var n=this;return this.chain(t.id+":b:summary"+(e?":raw":""),this.dataNumberStats(t,e),(function(i){var o=t.findMyRanker(),a=e?t.id+":r":t.id;return n.valueCacheData.has(a)?function(){return n.workers.pushStats("numberStats",{numberOfBins:i.hist.length},a,n.valueCacheData.get(a),o.id,r?r.joined:o.getOrder()).then((function(t){return{summary:t,data:i}}))}:n.normalizedStatsBuilder(r||o.getOrder(),t,i.hist.length,e,(function(t){return{summary:t,data:i}}))}))},e.prototype.summaryCategoricalStats=function(t,e){var r=this;return this.chain(t.id+":b:summary",this.dataCategoricalStats(t),(function(n){var i=t.findMyRanker();return r.valueCacheData.has(t.id)?function(){return r.workers.pushStats("categoricalStats",{categories:t.categories.map((function(t){return t.name}))},t.id,r.valueCacheData.get(t.id),i.id,e?e.joined:i.getOrder()).then((function(t){return{summary:t,data:n}}))}:r.categoricalStatsBuilder(e||i.getOrder(),t,(function(t){return{summary:t,data:n}}))}))},e.prototype.summaryDateStats=function(t,e){var r=this;return this.chain(t.id+":b:summary",this.dataDateStats(t),(function(n){var i=t.findMyRanker();return r.valueCacheData.has(t.id)?function(){return r.workers.pushStats("dateStats",{template:n},t.id,r.valueCacheData.get(t.id),i.id,e?e.joined:i.getOrder()).then((function(t){return{summary:t,data:n}}))}:r.dateStatsBuilder(e||i.getOrder(),t,n,(function(t){return{summary:t,data:n}}))}))},e.prototype.cached=function(t,e,r){var n=this,i=0===this.data.length;if(this.isValidCacheEntry(t)&&!i)return this.cache.get(t);var o="function"==typeof r?Xu(r()):this.tasks.pushMulti(t,r,e),a=Gl(o);return i||this.cache.set(t,a),o.then((function(e){n.cache.get(t)===a&&("symbol"==typeof e?n.cache.delete(t):n.cache.set(t,Il(e)))})),a},e.prototype.chain=function(t,e,r){var n=this;if(this.isValidCacheEntry(t))return this.cache.get(t);if(e instanceof Vl)return"symbol"==typeof e.v?Il(qu):this.cached(t,!0,r(e.v));var i=e.v.then((function(e){if("symbol"==typeof e)return qu;var i=r(e);return"function"==typeof i?i():n.tasks.pushMulti(t,i)})),o=Gl(i);return this.cache.set(t,o),i.then((function(e){n.cache.get(t)===o&&("symbol"==typeof e?n.cache.delete(t):n.cache.set(t,Il(e)))})),o},e.prototype.isValidCacheEntry=function(t){if(!this.cache.has(t))return!1;var e=this.cache.get(t);return!(e instanceof Vl&&"symbol"==typeof e.v||e instanceof kl&&e.v.isAborted())},e.prototype.chainCopy=function(t,e,r){var n=this;if(this.isValidCacheEntry(t))return this.cache.get(t);if(e instanceof Vl){if("symbol"==typeof e.v)return Il(qu);var i=Il(r(e.v));return this.cache.set(t,i),i}var o=e.v.then((function(t){return"symbol"==typeof t?qu:r(t)})),a=Gl(o);return this.cache.set(t,a),o.then((function(e){n.cache.get(t)===a&&("symbol"==typeof e?n.cache.delete(t):n.cache.set(t,Il(e)))})),a},e.prototype.dataBoxPlotStats=function(t,e){var r=this,n=t.id+":c:data"+(e?":braw":":b"),i=e?t.id+":r":t.id;return this.valueCacheData.has(i)&&this.data.length>0?this.cached(n,!1,(function(){return r.workers.pushStats("boxplotStats",{},i,r.valueCacheData.get(i))})):this.cached(n,!1,this.boxplotBuilder(null,t,e))},e.prototype.dataNumberStats=function(t,e){return this.cached(t.id+":c:data"+(e?":raw":""),!1,this.normalizedStatsBuilder(null,t,b(this.data.length),e))},e.prototype.dataCategoricalStats=function(t){return this.cached(t.id+":c:data",!1,this.categoricalStatsBuilder(null,t))},e.prototype.dataDateStats=function(t){return this.cached(t.id+":c:data",!1,this.dateStatsBuilder(null,t))},e.prototype.sort=function(t,e,r,n,i,o){if(!o||r.length<1e3){var a=Ul(r,i,o);return Promise.resolve(a)}var s=G(r,i),u=[s.buffer];return n&&u.push.apply(u,o.transferAbles),this.workers.push("sort",{ref:t.id+":"+e.name,indices:s,sortOrders:o.sortOrders},u,(function(t){return t.order}))},e.prototype.terminate=function(){this.workers.terminate(),this.cache.clear(),this.valueCacheData.clear()},e}(Fl),tc=function(t){function e(e,r,n){void 0===r&&(r=[]),void 0===n&&(n={});var i=t.call(this,r,n)||this;i._data=e,i.ooptions={filterGlobally:!1,jumpToSearchResult:!1,taskExecutor:"direct"},i.filter=null,i.mapToDataRow=function(t){return t<0||t>=i._dataRows.length?{i:t,v:{}}:i._dataRows[t]},Object.assign(i.ooptions,n),i._dataRows=ec(e),i.tasks="direct"===i.ooptions.taskExecutor?new Bl:new Zl,i.tasks.setData(i._dataRows);var o=i;return i.reorderAll=function(){for(var t=this.source,e=this.type,r=0,n=o.getRankings();r<n.length;r++){var i=n[r];i!==t&&i.dirtyOrder(e===Zn.EVENT_FILTER_CHANGED?[Jn.FILTER_CHANGED]:[Jn.UNKNOWN])}},i}return i(e,t),e.prototype.setFilter=function(t){this.filter=t,this.reorderAll.call({type:Zn.EVENT_FILTER_CHANGED})},e.prototype.getFilter=function(){return this.filter},e.prototype.getTotalNumberOfRows=function(){return this.data.length},e.prototype.getTaskExecutor=function(){return this.tasks},Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tasks.terminate()},e.prototype.setData=function(t){this._data=t,this._dataRows=ec(t),this.dataChanged()},e.prototype.dataChanged=function(){this.tasks.setData(this._dataRows);for(var t=0,e=this.getRankings();t<e.length;t++){var r=e[t];this.tasks.preComputeData(r)}this.fire(Nl.EVENT_DATA_CHANGED,this._dataRows),this.reorderAll.call({type:Zn.EVENT_FILTER_CHANGED})},e.prototype.clearData=function(){this.setData([])},e.prototype.appendData=function(t){for(var e=0,r=t;e<r.length;e++){var n=r[e];this._data.push(n),this._dataRows.push({v:n,i:this._dataRows.length})}this.dataChanged()},e.prototype.cloneRanking=function(e){var r=t.prototype.cloneRanking.call(this,e);return this.ooptions.filterGlobally&&r.on(Zn.EVENT_FILTER_CHANGED+".reorderAll",this.reorderAll),this.trackRanking(r,e),r},e.prototype.trackRanking=function(t,e){var r=this,n=this;t.on(pt.EVENT_DIRTY_CACHES+".cache",(function(){for(var t=this.origin;t instanceof pt;)n.tasks.dirtyColumn(t,"data"),n.tasks.preComputeCol(t),t=t.parent}));var i=t.flatColumns,o=Zn.EVENT_ADD_COLUMN+".cache",a=Zn.EVENT_REMOVE_COLUMN+".cache",s=function(t){r.tasks.dirtyColumn(t,"data"),t instanceof Ot&&(t.on(o,null),t.on(a,null))},u=function(t){r.tasks.preComputeCol(t),t instanceof Ot&&(t.on(o,u),t.on(a,s))};t.on(o,u),t.on(a,s);for(var l=0,c=i;l<c.length;l++){var p=c[l];p instanceof Ot&&(p.on(o,u),p.on(a,s))}if(e)for(var f=e.flatColumns,h=0;h<i.length;++h)this.tasks.copyCache(i[h],f[h]);this.tasks.preComputeData(t)},e.prototype.cleanUpRanking=function(e){this.ooptions.filterGlobally&&e.on(Zn.EVENT_FILTER_CHANGED+".reorderAll",null);var r=e.flatColumns,n=Zn.EVENT_ADD_COLUMN+".cache",i=Zn.EVENT_REMOVE_COLUMN+".cache";e.on(n,null),e.on(i,null);for(var o=0,a=r;o<a.length;o++){var s=a[o];s instanceof Ot&&(s.on(n,null),s.on(i,null))}this.tasks.dirtyRanking(e,"data"),t.prototype.cleanUpRanking.call(this,e)},e.prototype.resolveFilter=function(t){var e=[];if(this.ooptions.filterGlobally)for(var r=0,n=this.getRankings();r<n.length;r++){var i=n[r];i.isFiltered()&&e.push.apply(e,i.flatColumns.filter((function(t){return t.isFiltered()})))}else t.isFiltered()&&e.push.apply(e,t.flatColumns.filter((function(t){return t.isFiltered()})));return this.filter&&e.push(this.filter),e},e.prototype.noSorting=function(t){for(var e=this._data.length,r=k(e,e-1),n=r.slice(),i=0;i<e;++i)r[i]=i,n[i]=i+1;return this.tasks.preCompute(t,[{rows:r,group:st}],e-1),{groups:[Object.assign({order:r},st)],index2pos:n}},e.prototype.createSorter=function(t,e,r,n,i){var o=this,a=new Map,s=[],u=-1,l=t.getGroupCriteria(),c=i?new Sl(this._data.length,!0,t,this.tasks.valueCache.bind(this.tasks)):void 0,p=function(t,e){var r=t.name.toLowerCase();if(a.has(r))a.get(r).rows.push(e.i);else{var n={group:t,rows:[e.i]};a.set(r,n),s.push(n)}},f=l.map((function(t){return o.tasks.valueCache(t)})),h=e.map((function(t){return"function"==typeof t?void 0:o.tasks.valueCache(t)})),d=1===l.length?function(t){return rn([l[0].group(t,f[0]?f[0](t.i):void 0)])}:function(t){return rn(l.map((function(e,r){return e.group(t,f[r]?f[r](t.i):void 0)})))};if(r){t:for(var g=0,m=this._dataRows;g<m.length;g++){for(var y=m[g],v=0;v<e.length;++v){var b=e[v],E=h[v];if("function"==typeof b&&!b(y)||b instanceof pt&&!b.filter(y,E?E(y.i):void 0))continue t}u<y.i&&(u=y.i),c&&c.push(y),p(d(y),y)}return s.sort((function(t,e){return t.group.name.toLowerCase().localeCompare(e.group.name.toLowerCase())})),{maxDataIndex:u,lookups:c,groupOrder:s}}for(var C=0,N=t.getGroups();C<N.length;C++){var _=N[C],T=_.order;if(n)for(R=0;R<T.length;++R){u<(A=T[R])&&(u=A);y=this._dataRows[A];c&&c.push(y),p(d(y),y)}else{var w=nn(_);if(s.push({group:w,rows:T}),!c){u=T.reduce((function(t,e){return Math.max(t,e)}),u);continue}for(var R=0;R<T.length;++R){var A;u<(A=T[R])&&(u=A),c.push(this._dataRows[A])}}}return n&&s.sort((function(t,e){return t.group.name.toLowerCase().localeCompare(e.group.name.toLowerCase())})),{maxDataIndex:u,lookups:c,groupOrder:s}},e.prototype.sortGroup=function(t,e,r,n,i,o,a){var s=t.group,u=this.tasks.sort(r,s,t.rows,o,a,n),l=i?this.tasks.groupCompare(r,s,t.rows).then((function(t){return t})):[];return Promise.all([u,l]).then((function(t){var r=t[0],n=t[1];return i&&Array.isArray(n)&&i.pushValues(e,n),Object.assign(s,{order:r})}))},e.prototype.sortGroups=function(t,e,r){if(e){var n=t.map((function(t,e){return e}));return U(n,e.sortOrders),n.map((function(e){return t[e]}))}return r?t.sort((function(t,e){return t.name.localeCompare(e.name)})):t},e.prototype.index2pos=function(t,e){for(var r=k(e+1,t.reduce((function(t,e){return t+e.order.length}),1)),n=1,i=0,o=t;i<o.length;i++)for(var a=o[i],s=0;s<a.order.length;s++,n++)r[a.order[s]]=n;return{groups:t,index2pos:r}},e.prototype.sort=function(t,e){var r=this,n=new Set(e);if(0===this._data.length)return{groups:[],index2pos:[]};var i=this.resolveFilter(t),o=n.has(Jn.UNKNOWN)||n.has(Jn.FILTER_CHANGED),a=o||n.has(Jn.GROUP_CRITERIA_CHANGED)||n.has(Jn.GROUP_CRITERIA_DIRTY),s=a||n.has(Jn.SORT_CRITERIA_CHANGED)||n.has(Jn.SORT_CRITERIA_DIRTY),u=a||n.has(Jn.GROUP_SORT_CRITERIA_CHANGED)||n.has(Jn.GROUP_SORT_CRITERIA_DIRTY);o?this.tasks.dirtyRanking(t,"summary"):a&&this.tasks.dirtyRanking(t,"group"),0===i.length&&this.tasks.copyData2Summary(t);var l=t.getGroupCriteria().length>0,c=t.getSortCriteria().length>0,p=t.getGroupSortCriteria().length>0;if(!l&&!c&&0===i.length)return this.noSorting(t);var f=this.createSorter(t,i,o,a,s),h=f.maxDataIndex,d=f.lookups,g=f.groupOrder;if(0===g.length)return{groups:[],index2pos:[]};if(this.tasks.preCompute(t,g,h),1===g.length){var m=g[0];return this.sortGroup(m,0,t,d,void 0,!0,h).then((function(t){return r.index2pos([t],h)}))}var y=p&&u?new Sl(g.length,!1,t):void 0;return Promise.all(g.map((function(e,n){return r.sortGroup(e,n,t,d,y,!1,h)}))).then((function(t){var e=r.sortGroups(t,y,u);return r.index2pos(e,h)}))},e.prototype.viewRaw=function(t){var e=this;return pn(t,(function(t){return e._data[t]||{}}))},e.prototype.viewRawRows=function(t){return pn(t,this.mapToDataRow)},e.prototype.getRow=function(t){return this._dataRows[t]},e.prototype.seq=function(t){return g(t).map(this.mapToDataRow)},e.prototype.view=function(t){return this.viewRaw(t)},e.prototype.mappingSample=function(t){var e=this,r=this._dataRows.length;if(r<=120)return g(this._dataRows).map((function(e){return t.getRawNumber(e)}));for(var n=new Set,i=0;i<120;++i){for(var o=Math.floor(Math.random()*(r-1));n.has(o);)o=Math.floor(Math.random()*(r-1));n.add(o)}return g(Array.from(n)).map((function(r){return t.getRawNumber(e._dataRows[r])}))},e.prototype.searchAndJump=function(t,e){for(var r="string"==typeof(t="string"==typeof t?t.toLowerCase():t)?function(e){return e.toLowerCase().indexOf(t)>=0}:t.test.bind(t),n=[],i=0;i<this._dataRows.length;++i)r(e.getLabel(this._dataRows[i]))&&n.push(i);this.jumpToNearest(n)},e}(Tl);function ec(t){return t.map((function(t,e){return{v:t,i:e}}))}!function(t){t[t.CELL=0]="CELL",t[t.GROUP=1]="GROUP",t[t.SUMMARY=2]="SUMMARY"}(Ql||(Ql={}));function rc(){}var nc={template:"<div></div>",update:rc};function ic(t,e){return void 0===e||t.textContent!==e&&(t.textContent=e),t}function oc(t,e,r){Array.from(t.querySelectorAll(e)).forEach(r)}function ac(t,e){Array.from(t.children).forEach(e)}function sc(t,e,r){if(0!==t.childElementCount){if(!e.every((function(e,r){var n=t.children[r];return null!=n&&n.dataset.columnId===e.column.id&&n.dataset.renderer===e.rendererId}))){var n=new Set(e.map((function(t){return t.column.id+"@"+t.rendererId})));ac(t,(function(e){var r=e.dataset.columnId+"@"+e.dataset.renderer;n.has(r)||t.removeChild(e)})),e.forEach((function(e){var n=t.querySelector('[data-column-id="'+e.column.id+'"]');n||((n=r.asElement(e.template)).dataset.columnId=e.column.id,n.dataset.renderer=e.rendererId,n.classList.add(qn("renderer-"+e.rendererId))),t.appendChild(n)}))}}else{t.innerHTML=e.map((function(t){return t.template})).join("");var i=Array.from(t.children);e.forEach((function(t,e){var r=i[e];r.dataset.columnId=t.column.id,r.dataset.renderer=t.rendererId,r.classList.add(qn("renderer-"+t.rendererId))}))}}function uc(t,e){return void 0===e&&(e=t.labels.length),t.getWidth()/e>30}function lc(t){return t.getWidth()/t.categories.length>30}var cc={};function pc(t){var e=cc[t];return e||(cc[t]=he(t).l>.5?"black":"white")}function fc(t,e,r,n){var i=pc(e);if(n<=.05||"black"===i||n>.9)t.style.color="black"===i||n<=.05?null:i;else{t.style.color=null,t.innerText=r;var o=t.ownerDocument.createElement("span");o.classList.add(qn("gradient-text")),o.style.color=i,o.innerText=r,t.appendChild(o)}}var hc=function(){var t=0;return function(e){return""+e+(t++).toString(36)}}();function dc(t,e){var r=[];return e.every((function(e){if(null==t.getValue(e))return!0;var n=t.getLabel(e);return r.push(n),r.length<5})),0===r.length?"":r.join(", ")+(r.length<e.length?", ...":"")}function gc(t,e){return qn("stacked-"+t+"-"+e.id)}function mc(t){return Dt(t)?t.getColorMapping().apply(0):"#C1C1C1"}var yc=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t,e){return t instanceof li&&e!==Ql.SUMMARY},t.prototype.create=function(t){var e=t.actions;return{template:'<div class="'+qn("actions")+" "+qn("hover-only")+'">'+e.map((function(t){return"<span title='"+t.name+"' class='"+(t.className||"")+"'>"+(t.icon||"")+"</span>"})).join("")+"</div>",update:function(t,r){ac(t,(function(t,n){t.onclick=function(t){t.preventDefault(),t.stopPropagation(),setTimeout((function(){return e[n].action(r)}),1)}}))}}},t.prototype.createGroup=function(t,e){var r=t.groupActions;return{template:'<div class="'+qn("actions")+" "+qn("hover-only")+'">'+r.map((function(t){return"<span title='"+t.name+"' class='"+(t.className||"")+"'>"+(t.icon||"")+"</span>"})).join("")+"</div>",update:function(n,i){ac(n,(function(n,o){n.onclick=function(n){n.preventDefault(),n.stopPropagation(),e.tasks.groupRows(t,i,"identity",(function(t){return t})).then((function(t){"symbol"!=typeof t&&setTimeout((function(){return r[o].action(i,Array.from(t))}),1)}))}}))}}},t.prototype.createSummary=function(){return nc},t}();function vc(t){t.preventDefault(),t.stopPropagation()}function bc(t,e,r,n){void 0===r&&(r="agg-level"),void 0===n&&(n=!1);var i=t.ownerDocument,o=Array.from(t.children);n&&(e+=1);for(var a=o.length;a<e;++a){var s=i.createElement("div");s.classList.add(qn(r)),o.push(s),t.appendChild(s)}for(var u=0,l=o.splice(e,o.length-e);u<l.length;u++){l[u].remove()}if(n){var c=o[o.length-1];c.classList.remove(qn(r)),c.classList.add(qn("agg-all"))}return o}function Ec(t,e,r,n,i){for(var o=i.getAggregationStrategy(),a=n.findMyRanker(),s=r>=0,u=!e.subGroups||0===e.subGroups.length,l=gl(o),c=!s&&bl(e,o,(function(t){return i.getTopNAggregated(a,t)})),p=c&&u&&function(t){return"group+item+top"===t||"group+top+item"===t}(o),f=yl(e,r>=0?ml(r,e,i.getTopNAggregated(a,e)):"first last"),h=bc(t,f.length,"agg-level",p),d=f.length-1,g=function(t){var e=f[t],r=h[t],u=i.getAggregationState(a,e.group),g=t===d;if(r.dataset.level=String(f.length-1-t),l&&(s||t<d))return c||"last"!==e.meta&&"first last"!==e.meta?delete r.dataset.meta:r.dataset.meta="last",r.classList.toggle(qn("agg-inner"),s&&g),r.classList.remove(qn("agg-expand"),qn("agg-collapse")),r.title="",delete r.onclick,"continue";var m=u===Vn.COLLAPSE,y="first"===e.meta||"first last"===e.meta,v=u===Vn.EXPAND,b=p&&g?h[f.length]:null,E=e.meta;if(c&&"first last"===e.meta&&(E="first"),E?r.dataset.meta=E:delete r.dataset.meta,r.classList.toggle(qn("agg-expand"),y),r.classList.toggle(qn("agg-collapse"),m),r.title=y?m?"Expand Group":"Collapse Group":"",y?r.onclick=function(t){var r;switch(vc(t),o){case"group+top+item":r=u===Vn.COLLAPSE?Vn.EXPAND_TOP_N:Vn.COLLAPSE;break;case"group":case"item":case"group+item":case"group+item+top":default:r=u===Vn.COLLAPSE?Vn.EXPAND:Vn.COLLAPSE}n.setAggregated(e.group,r)}:delete r.onclick,!b)return"continue";b.dataset.level=String(t),b.classList.toggle(qn("agg-compress"),v),b.title=v?"Show Top "+i.getShowTopN()+" Only":"Show All",b.onclick=function(t){vc(t),n.setAggregated(e.group,u===Vn.EXPAND?Vn.EXPAND_TOP_N:Vn.EXPAND)}},m=0;m<f.length;++m)g(m)}function Cc(t){return null==t.parent&&t.name===st.name}var Nc=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t){return t instanceof Qn},t.prototype.create=function(t,e){return{template:"<div></div>",update:function(r,n,i,o){Cc(o)?K(r):Ec(r,o,i,t,e.provider)},render:function(r,n,i,o){if(!Cc(o)){var a=yl(o,ml(i,o,e.provider.getTopNAggregated(t.findMyRanker(),o)));r.fillStyle=Un.color;for(var s=0;s<a.length;++s)r.fillRect(Un.levelWidth*s+Un.levelOffset,0,Un.strokeWidth,4);return a.some((function(t){return null!=t.meta}))}}}},t.prototype.createGroup=function(t,e){return{template:'<div><div class="'+qn("agg-level")+'"></div></div>',update:function(r,n){Ec(r,n,-1,t,e.provider)}}},t.prototype.createSummary=function(t,e){return{template:"<div></div>",update:function(r){var n=t.findMyRanker(),i=n.getGroups();if(1!==i.length||i[0].name!==st.name)for(var o=i.map((function(t){return yl(t,"first last")})),a=o.reduce((function(t,e){return Math.max(t,e.length)}),Number.NEGATIVE_INFINITY),s=bc(r,a,"agg-expand"),u=function(t){var r=s[t],i=o.map((function(e){return e[t]?e[t].group:null})).filter((function(t){return null!=t})),a=i.every((function(t){return e.provider.getAggregationState(n,t)===Vn.COLLAPSE}));r.classList.toggle(qn("agg-collapse"),a),r.title=a?"Expand All Groups":"Collapse All Groups",r.onclick=function(t){vc(t),e.provider.aggregateAllOf(n,a?Vn.EXPAND:Vn.COLLAPSE,i)}},l=0;l<a;++l)u(l);else K(r)}}},t}();function _c(t){return'<label class="'+qn("checkbox")+'">\n    <input type="checkbox" '+(t?'checked="checked"':"")+'>\n    <span class="'+qn("filter-missing")+'">Filter rows containing missing values</span>\n  </label>'}function Tc(t,e){return'<label class="'+qn("checkbox")+'">\n    <input type="checkbox" '+(t?'checked="checked"':"")+" "+(0===e?"disabled":"")+'>\n    <span class="'+qn("filter-missing")+" "+(0===e?qn("disabled"):"")+'">Filter '+e+" missing value rows</span>\n  </label>"}function wc(t){return t.getElementsByClassName(qn("filter-missing"))[0].previousElementSibling}function Rc(t,e){t.getElementsByTagName("input")[0].disabled=0===e,t.lastElementChild.classList.toggle(qn("disabled"),0===e),t.lastElementChild.textContent="Filter "+e+" missing value rows"}function Ac(t,e,r,n,i){void 0===n&&(n=0),void 0===i&&(i=0);var o=Math.max(0,n+(e-Gn.width)/2),a=Math.max(0,i+(r-Gn.height)/2);t.fillStyle=Gn.color,t.fillRect(o,a,Math.min(e,Gn.width),Math.min(r,Gn.height))}function Dc(t,e,r){var n=vn(e.getValue(r));return t.classList.toggle(qn("missing"),n),n}function Sc(t,e,r,n,i,o){void 0===i&&(i=0),void 0===o&&(o=0);var a=vn(e.getValue(r));return a&&Ac(t,n,4,i,o),a}var Mc=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t){return t instanceof fi},t.prototype.create=function(t){var e=t.alignment||"left";return{template:"<div"+("left"!==e?' class="'+qn(e)+'"':"")+"> </div>",update:function(e,r){Dc(e,t,r),t.escape?ic(e,t.getLabel(r)):e.innerHTML=t.getLabel(r),e.title=e.textContent}}},t.prototype.createGroup=function(t,e){return{template:"<div> </div>",update:function(r,n){return e.tasks.groupExampleRows(t,n,"string",(function(e){return dc(t,e)})).then((function(e){"symbol"!=typeof e&&(r.classList.toggle(qn("missing"),!e),t.escape?ic(r,e):(r.innerHTML=e,r.title=e))}))}}},t.interactiveSummary=function(t,e){var r=e,n=wc(e),i=e.querySelector('input[type="text"]'),o=e.querySelector('input[type="checkbox"]'),a=function(){if(i.value.trim().length<=0){var e=n.checked?{filter:null,filterMissing:n.checked}:null;t.setFilter(e)}else t.setFilter({filter:o.checked?new RegExp(i.value):i.value,filterMissing:n.checked})};return n.onchange=a,i.onchange=a,i.oninput=ei(a,100),o.onchange=a,r.onsubmit=function(t){return t.preventDefault(),t.stopPropagation(),a(),!1},function(e){var r=(t=e).getFilter()||{filter:null,filterMissing:!1},a=r.filter;n.checked=r.filterMissing,i.value=a instanceof RegExp?a.source:a||"",o.checked=a instanceof RegExp}},t.prototype.createSummary=function(e,r,n){if(!n)return{template:"<div></div>",update:function(t){var r=e.getFilter();t.textContent=function(t){if(null==t||!t.filter)return"";if(t.filter instanceof RegExp)return t.filter.source;return t.filter}(r)}};var i,o=e.getFilter()||{filter:null,filterMissing:!1},a=o.filter||"";return{template:'<form><input type="text" placeholder="Filter '+e.desc.label+'..." autofocus value="'+(a instanceof RegExp?a.source:a)+'">\n          <label class="'+qn("checkbox")+'">\n            <input type="checkbox" '+(a instanceof RegExp?'checked="checked"':"")+">\n            <span>Use regular expressions</span>\n          </label>\n          "+_c(o.filterMissing)+"</form>",update:function(r){i||(i=t.interactiveSummary(e,r)),i(e)}}},t}();var Lc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title="Default",e}return i(e,t),e.prototype.canRender=function(e){return t.prototype.canRender.call(this,e)&&e instanceof hi},e.prototype.create=function(t){return{template:'<div>\n        <span></span>\n        <input class="'+qn("hover-only")+" "+qn("annotate-input")+'">\n       </div>',update:function(e,r){var n=e.firstElementChild,i=e.lastElementChild;i.onchange=function(){n.textContent=i.value,t.setValue(r,i.value)},i.onclick=function(t){t.stopPropagation()},n.textContent=i.value=t.getLabel(r)}}},e}(Mc);function xc(t,e,r,n){return r&&r.color?r.color(e,n):e?t.getColor(e):Dt(t)?t.getColorMapping().apply(null!=n?n:0):"#C1C1C1"}var Oc=function(){function t(t){void 0===t&&(t=!1),this.renderValue=t,this.title="Bar"}return t.prototype.canRender=function(t,e){return e===Ql.CELL&&St(t)&&!Lt(t)},t.prototype.create=function(t,e,r){var n=e.colWidth(t);return{template:'<div title="">\n          <div class="'+qn("bar-label")+"\" style='background-color: #C1C1C1'>\n            <span "+(this.renderValue?"":'class="'+qn("hover-only")+'"')+"></span>\n          </div>\n        </div>",update:function(e,n){var i=t.getNumber(n),o=Dc(e,t,n),a=isNaN(i)?0:O(100*i,2),s=t.getLabel(n);e.title=s;var u=e.firstElementChild;u.style.width=o?"100%":a+"%";var l=xc(t,n,r,i);u.style.backgroundColor=o?null:l,ic(u.firstElementChild,s);var c=u.firstElementChild;ic(c,s),fc(c,l||"#C1C1C1",s,a/100)},render:function(e,i){if(!Sc(e,t,i,n)){var o=t.getNumber(i);e.fillStyle=xc(t,i,r,o)||"#C1C1C1";var a=n*o;e.fillRect(0,0,isNaN(a)?0:a,4)}}}},t.prototype.createGroup=function(){return nc},t.prototype.createSummary=function(){return nc},t}(),Vc=function(){function t(){this.title="String",this.groupTitle="None",this.summaryTitle="None"}return t.prototype.canRender=function(t,e){return!0},t.prototype.create=function(t){return{template:"<div> </div>",update:function(e,r){Dc(e,t,r);var n=t.getLabel(r);ic(e,n),e.title=n}}},t.prototype.createGroup=function(t){return nc},t.prototype.createSummary=function(){return nc},t}(),Ic=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title="Default",e}return i(e,t),e.prototype.canRender=function(t,e){return t instanceof di&&e===Ql.CELL},e.prototype.create=function(e){var r=t.prototype.create.call(this,e);return r.template='<div class="'+qn("center")+'"> </div>',r},e}(Vc),kc='<div title="">\n  <div class="'+qn("boxplot-whisker")+'">\n    <div class="'+qn("boxplot-box")+'"></div>\n    <div class="'+qn("boxplot-median")+'"></div>\n    <div class="'+qn("boxplot-mean")+'"></div>\n  </div>\n</div>',Gc='<div title="">\n  <div class="'+qn("boxplot-whisker")+'">\n    <div class="'+qn("boxplot-box")+'"></div>\n    <div class="'+qn("boxplot-median")+'"></div>\n    <div class="'+qn("boxplot-mean")+'"></div>\n  </div>\n  <span class="'+qn("mapping-hint")+'"></span><span class="'+qn("mapping-hint")+'"></span>\n</div>';var Hc=function(){function t(){this.title="Box Plot"}return t.prototype.canRender=function(t,e){return Mt(t)&&e===Ql.CELL||St(t)&&e!==Ql.CELL},t.prototype.create=function(t,e,r){var n=t.getSortMethod(),i=void 0!==t.isSortedByMe().asc,o=e.colWidth(t);return{template:kc,update:function(e,o){var a=t.getBoxPlotData(o);if(e.classList.toggle(qn("missing"),!a),a){var s=t.getRawBoxPlotData(o);Pc(t,e,a,s,i?n:"",xc(t,o,r))}},render:function(e,a){if(!Sc(e,t,a,o)){var s=t.getBoxPlotData(a);if(s)!function(t,e,r,n,i,o){var a=null!=e.whiskerLow?e.whiskerLow:Math.max(e.q1-1.5*(e.q3-e.q1),e.min),s=null!=e.whiskerHigh?e.whiskerHigh:Math.min(e.q3+1.5*(e.q3-e.q1),e.max);t.fillStyle=n||Fn.box,t.strokeStyle=Fn.stroke,t.beginPath(),t.rect(e.q1,0,e.q3-e.q1,i),t.fill(),t.stroke();var u=i-o,l=i/2;t.beginPath(),t.moveTo(a,l),t.lineTo(e.q1,l),t.moveTo(a,o),t.lineTo(a,u),t.moveTo(e.median,0),t.lineTo(e.median,i),t.moveTo(e.q3,l),t.lineTo(s,l),t.moveTo(s,o),t.lineTo(s,u),t.stroke(),t.fill(),""!==r&&(t.strokeStyle=Fn.sort,t.beginPath(),t.moveTo(e[r],o),t.lineTo(e[r],i-o),t.stroke(),t.fill());if(!e.outlier)return;t.fillStyle=Fn.outlier,e.outlier.forEach((function(e){t.fillRect(Math.max(e-Pn.size/2,0),l-Pn.size/2,Pn.size,Pn.size)}))}(e,{min:s.min*o,median:s.median*o,mean:null!=s.mean?s.mean*o:void 0,q1:s.q1*o,q3:s.q3*o,max:s.max*o,outlier:s.outlier?s.outlier.map((function(t){return t*o})):void 0,whiskerLow:null!=s.whiskerLow?s.whiskerLow*o:void 0,whiskerHigh:null!=s.whiskerHigh?s.whiskerHigh*o:void 0},i?n:"",xc(t,a,r),4,0)}}}},t.prototype.createGroup=function(t,e,r){var n=t instanceof js&&void 0!==t.isGroupSortedByMe().asc?t.getSortMethod():"";return{template:kc,update:function(i,o){return Hl([e.tasks.groupBoxPlotStats(t,o,!1),e.tasks.groupBoxPlotStats(t,o,!0)]).then((function(e){if("symbol"!=typeof e){var o=null==e||null==e[0]||0===e[0].group.count||e[0].group.count===e[0].group.missing;i.classList.toggle(qn("missing"),o),o||Pc(t,i,e[0].group,e[1].group,n,xc(t,null,r))}}))}}},t.prototype.createSummary=function(t,e,r,n){return{template:Dt(t)?Gc:kc,update:function(r){return Hl([e.tasks.summaryBoxPlotStats(t,!1),e.tasks.summaryBoxPlotStats(t,!0)]).then((function(e){if("symbol"!=typeof e){var i=null==e||null==e[0]||0===e[0].summary.count||e[0].summary.count===e[0].summary.missing;if(r.classList.toggle(qn("missing"),i),!i){var o=e[0].summary,a=e[1].summary,s=t instanceof js&&void 0!==t.isGroupSortedByMe().asc?t.getSortMethod():"";if(Dt(t)){var u=t.getRange();Array.from(r.getElementsByTagName("span")).forEach((function(t,e){return t.textContent=u[e]}))}Pc(t,r,o,a,s,xc(t,null,n),Dt(t))}}}))}}},t}();function Pc(t,e,r,n,i,o,a){void 0===a&&(a=!1),e.title=function(t,e){if(null==e)return"";var r=t.getNumberFormat(),n=null!=e.mean?"mean = "+r(e.mean)+" (dashed line)\n":"";return"min = "+r(e.min)+"\nq1 = "+r(e.q1)+"\nmedian = "+r(e.median)+"\n"+n+"q3 = "+r(e.q3)+"\nmax = "+r(e.max)}(t,n);var s=e.firstElementChild,u=s.firstElementChild,l=u.nextElementSibling,c=s.lastElementChild,p=null!=r.whiskerLow?r.whiskerLow:Math.max(r.q1-1.5*(r.q3-r.q1),r.min),f=null!=r.whiskerHigh?r.whiskerHigh:Math.min(r.q3+1.5*(r.q3-r.q1),r.max);s.style.left=O(100*p,2)+"%";var h=f-p;s.style.width=O(100*h,2)+"%",u.style.left=O((r.q1-p)/h*100,2)+"%",u.style.width=O((r.q3-r.q1)/h*100,2)+"%",u.style.backgroundColor=o,l.style.left=O((r.median-p)/h*100,2)+"%",null!=r.mean?(c.style.left=O((r.mean-p)/h*100,2)+"%",c.style.display=null):c.style.display="none";var d=Array.from(e.children).slice(1,a?-2:void 0),g=r.outlier?r.outlier.length:0;if(d.splice(g,d.length-g).forEach((function(t){return t.remove()})),s.dataset.sort=i,r.outlier&&0!==g){for(var m=d.length;m<g;++m){var y=e.ownerDocument.createElement("div");y.classList.add(qn("boxplot-outlier")),d.unshift(y),s.insertAdjacentElement("afterend",y)}r.outlier.forEach((function(t,e){delete d[e].dataset.sort,d[e].style.left=O(100*t,2)+"%"})),"min"===i&&r.outlier[0]<=p?(s.dataset.sort="",d[0].dataset.sort="min",d.length>1&&d[d.length-1].insertAdjacentElement("afterend",d[0])):"max"===i&&r.outlier[d.length-1]>=f&&(s.dataset.sort="",d[d.length-1].dataset.sort="max")}}function Fc(t,e,r,n){if((null==t||isNaN(t))&&(t=1),n||!Dt(r))return(i=he(xc(r,e,n,t)||"#C1C1C1")).l=1-t,i.toString();var i,o=r.getColorMapping(),a=o.apply(t);return o instanceof du?((i=he(a)).l=1-t,i.toString()):a}var Uc=function(){function t(){this.title="Brightness"}return t.prototype.canRender=function(t,e){return St(t)&&e===Ql.CELL&&!Lt(t)},t.prototype.create=function(t,e,r){var n=e.colWidth(t);return{template:'<div title="">\n        <div class="'+qn("cat-color")+'" style="background-color: #C1C1C1"></div><div class="'+qn("cat-label")+'"> </div>\n      </div>',update:function(e,n){var i=Dc(e,t,n);e.title=t.getLabel(n),e.firstElementChild.style.backgroundColor=i?null:Fc(t.getNumber(n),n,t,r),ic(e.lastElementChild,e.title)},render:function(e,i){Sc(e,t,i,n)||(e.fillStyle=Fc(t.getNumber(i),i,t,r),e.fillRect(0,0,n,4))}}},t.prototype.createGroup=function(){return nc},t.prototype.createSummary=function(){return nc},t}(),Bc=function(){function t(){this.title="Color",this.groupTitle="Histogram"}return t.prototype.canRender=function(t,e){return Wl(t)&&(e!==Ql.CELL||ql(t))},t.prototype.create=function(t,e){var r=e.colWidth(t);return{template:'<div>\n        <div class="'+qn("cat-color")+'"></div><div class="'+qn("cat-label")+'"></div>\n      </div>',update:function(e,r){Dc(e,t,r);var n=t.getCategory(r);e.firstElementChild.style.backgroundColor=n?t.getColor(r):null,ic(e.lastElementChild,t.getLabel(r))},render:function(e,n){if(!Sc(e,t,n,r)){var i=t.getCategory(n);e.fillStyle=i?t.getColor(n):"",e.fillRect(0,0,r,4)}}}},t.prototype.createGroup=function(t,e){var r=jc(t,!1),n=r.template,i=r.update;return{template:n+"</div>",update:function(r,n){return e.tasks.groupCategoricalStats(t,n).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.group||0===t.group.count||t.group.count===t.group.missing;r.classList.toggle(qn("missing"),e),e||i(r,t.group)}}))}}},t.prototype.createSummary=function(t,e,r){return t instanceof Mn||t instanceof Vu||t instanceof Ln||t instanceof di?function(t,e,r){var n,i=jc(t,r||uc(t)),o=i.template,a=i.update;return{template:""+o+(r?Tc(!1,0):"")+"</div>",update:function(i){return i.classList.toggle(qn("histogram-i"),r),n||(n=Wc(t,i)),e.tasks.summaryCategoricalStats(t).then((function(e){if("symbol"!=typeof e){var o=e.summary,s=e.data;n(r&&s?s.missing:o?o.missing:0,t);var u=!e||null==e.summary||0===e.summary.count||e.summary.count===e.summary.missing;i.classList.toggle(qn("missing"),u),u||a(i,o,r?s:void 0)}}))}}}(t,e,r):function(t,e,r){var n=jc(t,r),i=n.template,o=n.update;return{template:i+"</div>",update:function(r){return e.tasks.summaryCategoricalStats(t).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.summary||0===t.summary.count||t.summary.count===t.summary.missing;r.classList.toggle(qn("missing"),e),e||o(r,t.summary)}}))}}}(t,e,r)},t}();function jc(t,e){var r=t.getColorMapping(),n=t.categories.map((function(t){return'<div class="'+qn("histogram-bin")+'" title="'+t.label+': 0" data-cat="'+t.name+'" '+(e?'data-title="'+t.label+'"':"")+'><div style="height: 0; background-color: '+r.apply(t)+'"></div></div>'})).join("");return{template:'<div class="'+qn("histogram")+" "+(t.categories.length>19?qn("dense"):"")+'">'+n,update:function(e,r,n){var i=t.getColorMapping(),o=t.categories.map((function(t){var e=ie(i.apply(t));return e.opacity=kn,e.toString()})),a=n?n.maxBin:r.maxBin;oc(e,"[data-cat]",(function(e,s){var u=t.categories[s],l=r.hist[s].count,c=e.firstElementChild;if(n){var p=n.hist[s].count;e.title=u.label+": "+l+" of "+p,c.style.height=O(100*p/a,2)+"%";var f=100-O(100*l/p,2);c.style.background=0===f?i.apply(u):100===f?o[s]:"linear-gradient("+o[s]+" "+f+"%, "+i.apply(u)+" "+f+"%, "+i.apply(u)+" 100%)"}else{e.title=t.categories[s].label+": "+l;var h=e.firstElementChild;h.style.height=Math.round(100*l/a)+"%",h.style.background=i.apply(u)}}))}}}function Yc(t,e,r){if(t instanceof Ln){var n=t.getFilter(),i=n?n.mode:void 0;t.setFilter({filter:e,filterMissing:r,mode:i})}else t.setFilter({filter:e,filterMissing:r})}function Wc(t,e){var r=Array.from(e.querySelectorAll("[data-cat]")),n=function(e,r,n){var i=e.firstElementChild,o=t.getColorMapping().apply(r);if(n)i.style.background=o;else{var a=ie(o);a.opacity=kn,i.style.background=a.toString()}};r.forEach((function(e,r){var i=t.categories[r];e.onclick=function(o){o.preventDefault(),o.stopPropagation();var a=t.getFilter();if(null==a||!Array.isArray(a.filter)){n(e,i,!1);var s=t.categories.slice();return s.splice(r,1),void Yc(t,s.map((function(t){return t.name})),!!a&&a.filterMissing)}var u=a.filter.slice(),l=u.indexOf(i.name);l>=0?(u.splice(l,1),n(e,i,!1)):(u.push(i.name),n(e,i,!0)),a.filterMissing||u.length!==t.categories.length?Yc(t,u,a.filterMissing):t.setFilter(null)}}));var i=e.getElementsByTagName("input")[0];return i&&(i.onchange=function(){var e=i.checked,r=t.getFilter();null==r?e?Yc(t,t.categories.map((function(t){return t.name})),e):t.setFilter(null):!e&&Array.isArray(r.filter)&&r.filter.length===t.categories.length?t.setFilter(null):Yc(t,r.filter,e)}),function(e,r){var n=(t=r).getFilter();i&&(i.checked=null!=n&&n.filterMissing,Rc(i.parentElement,e))}}var zc=function(){function t(){this.title="Heatmap"}return t.prototype.canRender=function(t){return Kl(t)&&Boolean(t.dataLength)},t.prototype.createContext=function(t,e){var r=e.colWidth(t),n=r/t.dataLength,i=t.labels;return{template:'<canvas height="18" title=""></canvas>',render:function(t,e,r){e.forEach((function(e,i){var o=i*n;null!=e?(t.fillStyle=e.color,t.fillRect(o,0,n,r)):Ac(t,n,r,o,0)}))},width:r,mover:function(e,n){return function(o){var a=o.offsetX/r,s=Math.max(0,Math.min(t.dataLength-1,Math.floor(a*(t.dataLength-1)+.5)));e.title=i[s]+": "+n[s]}}}},t.prototype.create=function(t,e){var r=this.createContext(t,e),n=r.template,i=r.render,o=r.mover,a=r.width;return{template:n,update:function(e,r){var n=e.getContext("2d");n.canvas.width=a,n.clearRect(0,0,n.canvas.width,n.canvas.height),Dc(e,t,r)||(e.onmousemove=o(e,t.getLabels(r)),e.onmouseleave=function(){return e.title=""},i(n,t.getCategories(r),18))},render:function(e,r){i(e,t.getCategories(r),4)}}},t.prototype.createGroup=function(t,e){var r=this,n=this.createContext(t,e),i=n.template,o=n.render,a=n.mover,u=n.width;return{template:i,update:function(n,i){return e.tasks.groupRows(t,i,r.title,(function(e){return function(t,e){if(s(t))return _(e.dataLength);var r=_(e.dataLength).map((function(){return new Map}));return t.forEach((function(t){var n=e.getCategories(t);if(n)for(var i=0;i<r.length;++i){var o=r[i],a=n[i]||null;o.set(a,(o.get(a)||0)+1)}})),r.map((function(t){if(0===t.size)return null;var e=null,r=0;return t.forEach((function(t,n){t>r&&(e=n,r=t)})),e}))}(e,t)})).then((function(t){if("symbol"!=typeof t){var e=n.getContext("2d");e.canvas.width=u,e.clearRect(0,0,e.canvas.width,e.canvas.height);var r=!t||0===t.length||t.every((function(t){return null==t}));n.classList.toggle(qn("missing"),r),r||(n.onmousemove=a(n,t.map((function(t){return t?t.label:"missing"}))),n.onmouseleave=function(){return n.title=""},o(e,t,18))}}))}}},t.prototype.createSummary=function(t){for(var e=t.labels.slice();e.length>0&&!uc(t,e.length);)e=e.filter((function(t,e){return e%2==0}));for(var r='<div class="'+qn("heatmap")+'">',n=0,i=e;n<i.length;n++){var o=i[n];r+='<div class="'+qn("heatmap-cell")+'"  title="'+o+'" data-title="'+o+'"></div>'}return{template:r+="</div>",update:rc}},t}(),qc=function(){function t(){this.title="Distribution Bar"}return t.prototype.canRender=function(t,e){return ql(t)&&e!==Ql.CELL},t.prototype.create=function(){return nc},t.prototype.createGroup=function(t,e){var r=Xc(t),n=r.template,i=r.update;return{template:n+"</div>",update:function(r,n){return e.tasks.groupCategoricalStats(t,n).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.group||0===t.group.count||t.group.count===t.group.missing;r.classList.toggle(qn("missing"),e),e||i(r,t.group)}}))}}},t.prototype.createSummary=function(t,e,r){return t instanceof Mn||t instanceof Vu?function(t,e,r){var n,i=Xc(t),o=i.template,a=i.update;return{template:""+o+(r?Tc(!1,0):"")+"</div>",update:function(i){return n||(n=Wc(t,i)),e.tasks.summaryCategoricalStats(t).then((function(e){if("symbol"!=typeof e){var o=e.summary,s=e.data,u=r&&s?s.missing:o?o.missing:0;n(u,t);var l=!e||null==e.summary||0===e.summary.count||e.summary.count===e.summary.missing;i.classList.toggle(qn("missing"),l),l||a(i,o,s)}}))}}}(t,e,r):function(t,e){var r=Xc(t),n=r.template,i=r.update;return{template:n+"</div>",update:function(r){return e.tasks.summaryCategoricalStats(t).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.summary||0===t.summary.count||t.summary.count===t.summary.missing;r.classList.toggle(qn("missing"),e),e||i(r,t.summary,t.data)}}))}}}(t,e)},t}();function Kc(t){var e=ie(t);return e.opacity=kn,e.toString()}function Xc(t){var e=t.getColorMapping(),r=t.categories.map((function(t){return{label:t.label,name:t.name,color:e.apply(t),selected:Kc(e.apply(t))}}));return r.push({label:"Missing Values",name:"missing",color:"#C1C1C1",selected:"transparent"}),{template:"<div>"+r.map((function(t){return'<div class="'+qn("distribution-bar")+'" style="background-color: '+t.color+"; color: "+pc(t.color)+'" title="'+t.label+': 0" data-cat="'+t.name+'"><span>'+t.label+"</span></div>"})).join(""),update:function(t,e,n){var i=e.hist.slice();i.push({count:e.missing});var o=Array.from(t.children);if(n){var a=n.hist.slice();a.push({count:n.missing});var s=a.reduce((function(t,e){return t+e.count}),9);for(p=0;p<r.length;++p){f=o[p],h=i[p].count,d=r[p].label;var u=a[p].count;f.style.flexGrow=""+O(0===s?0:u,2),f.title=d+": "+h+" of "+u;var l=100-O(100*h/u,2);f.style.background=0===l?r[p].color:100===l?r[p].selected:"linear-gradient("+r[p].selected+" "+l+"%, "+r[p].color+" "+l+"%, "+r[p].color+" 100%)"}}else for(var c=i.reduce((function(t,e){return t+e.count}),0),p=0;p<r.length;++p){var f=o[p],h=i[p].count,d=r[p].label;f.style.flexGrow=""+O(0===c?0:h,2),f.title=d+": "+h}}}}var $c=function(){function t(){this.title="Proportional Symbol"}return t.prototype.canRender=function(t,e){return St(t)&&e===Ql.CELL&&!Lt(t)},t.prototype.create=function(t,e,r){return{template:'<div style="background: radial-gradient(circle closest-side, red 100%, transparent 100%)" title="">\n              <div class="'+qn("hover-only")+" "+qn("bar-label")+'"></div>\n          </div>',update:function(e,n){var i=t.getNumber(n),o=Math.round(100*i),a=Dc(e,t,n);e.style.background=a?null:"radial-gradient(circle closest-side, "+xc(t,n,r)+" "+o+"%, transparent "+o+"%)",ic(e.firstElementChild,t.getLabel(n))}}},t.prototype.createGroup=function(){return nc},t.prototype.createSummary=function(){return nc},t}(),Jc=function(){function t(){this.title="Dot",this.groupTitle="Dots"}return t.prototype.canRender=function(t,e){return St(t)&&e!==Ql.SUMMARY},t.getCanvasRenderer=function(t,e){var r=e.colWidth(t),n=2*Math.PI,i=Pn.size/2;return{template:'<canvas height="40"></canvas>',render:function(t,e,r){t.save(),t.globalAlpha=Pn.opacity;for(var o=0,a=e;o<a.length;o++){var s=a[o];t.fillStyle=s.color||Pn.color;var u=Math.min(r-i,Math.max(i,s.value*r)),l=O(Math.random()*(40-Pn.size)+i,2);t.beginPath(),t.moveTo(u+i,l),t.arc(u,l,i,0,n,!0),t.fill()}t.restore()},width:r}},t.getDOMRenderer=function(t){for(var e=Lt(t)?t.dataLength:1,r="",n=0;n<e;++n)r+="<div style='background-color: #C1C1C1' title=''></div>";return{template:"<div>"+r+"</div>",update:function(t,e){var r=e.length;t.children.length!==r&&(t.innerHTML=e.reduce((function(t,e){return t+"<div style='background-color: "+e.color+"' title='"+e.label+"'></div>"}),""));var n=t.children;e.forEach((function(t,e){var i=n[e];i.title=t.label,i.style.display=isNaN(t.value)?"none":null,i.style.left=O(100*t.value,2)+"%",i.style.top=r>1?O(80*Math.random()+10,2)+"%":null,i.style.backgroundColor=t.color}))},render:function(t,e,r,n){t.save(),t.globalAlpha=Pn.opacity,e.forEach((function(e,i){t.fillStyle=r[i]||Pn.color,t.fillRect(Math.max(0,e*n-Pn.size/2),0,Pn.size,4)})),t.restore()}}},t.prototype.create=function(e,r,n){var i=t.getDOMRenderer(e),o=i.template,a=i.render,s=i.update,u=r.colWidth(e),l=e.getNumberFormat();return{template:o,update:function(t,r){if(!Dc(t,e,r)){var i=xc(e,r,n);if(!Lt(e)){var o=e.getNumber(r);return s(t,[{value:o,label:e.getLabel(r),color:i}])}var a=e.getNumbers(r).filter((function(t){return!isNaN(t)})).map((function(t){return{value:t,label:l(t),color:i}}));return s(t,a)}},render:function(t,r){if(!Sc(t,e,r,u)){var i=xc(e,r,n);if(!Lt(e)){var o=e.getNumber(r);return a(t,[o],[i],u)}var s=e.getNumbers(r).filter((function(t){return!isNaN(t)}));return a(t,s,s.map((function(t){return i})),u)}}}},t.prototype.createGroup=function(e,r,n){var i=t.getCanvasRenderer(e,r),o=i.template,a=i.render,s=i.width;return{template:o,update:function(t,i){return r.tasks.groupRows(e,i,"dot",(function(t){if(!Lt(e))return Array.from(t.map((function(t){return{value:e.getNumber(t),color:xc(e,t,n)}})));var r=t.map((function(t){var r=xc(e,t,n);return e.getNumbers(t).filter((function(t){return!isNaN(t)})).map((function(t){return{value:t,color:r}}))}));return Array.from(function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return new m(e?[t,e].concat(r):t)}(r))})).then((function(e){if("symbol"!=typeof e){var r=!e||0===e.length||e.every((function(t){return Number.isNaN(t.value)}));if(t.classList.toggle(qn("missing"),r),!r){var n=t.getContext("2d");n.canvas.width=s,n.clearRect(0,0,n.canvas.width,n.canvas.height),a(n,e,s)}}}))}}},t.prototype.createSummary=function(){return nc},t}();function Qc(t){return null==t.parent&&t.name===st.name}var Zc=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t){return t instanceof ou},t.prototype.create=function(){return{template:"<div><div></div></div>",update:function(t,e,r,n){var i=Qc(n)||r>0?"":n.name+" ("+n.order.length+")";t.firstElementChild.textContent=i,t.title=i},render:function(t,e,r){return 0===r}}},t.prototype.createGroup=function(){return{template:"<div><div></div></div>",update:function(t,e){var r=Qc(e)?"":e.name+" ("+e.order.length+")";t.firstElementChild.textContent=r,t.title=r}}},t.prototype.createSummary=function(){return nc},t}(),tp=function(){function t(){}return t.choose=function(t,e){for(var r=null,n=e.map((function(e,n){return 0===n&&(r=e),{n:t.getNumbers(e),raw:t.getRawNumbers(e)}})),i=t.dataLength,o=[],a=[],s=function(e){var r=n.map((function(t){return{n:t.n[e],raw:t.raw[e]}})).filter((function(t){return!isNaN(t.n)}));if(0===r.length)o.push(NaN),a.push(NaN);else{var i=A(),s=A(),u=t.getSortMethod();r.forEach((function(t){i.push(t.n),s.push(t.raw)})),o.push(i.build()[u]),a.push(s.build()[u])}},u=0;u<i;++u)s(u);return{normalized:o,raw:a,row:r}},t.prototype.create=function(t,e,r){var n=e.colWidth(t),i=this.createContext(t,e,r),o=i.templateRow,a=i.render,s=i.update;return{template:'<div class="'+i.clazz+'">'+o+"</div>",update:function(e,r){Dc(e,t,r)||s(e,t.getNumbers(r),t.getRawNumbers(r),r)},render:function(e,r){Sc(e,t,r,n)||a(e,t.getNumbers(r),r)}}},t.prototype.createGroup=function(e,r,n){var i=this,o=this.createContext(e,r,n),a=o.templateRow,s=o.update;return{template:'<div class="'+o.clazz+'">'+a+"</div>",update:function(n,o){return r.tasks.groupRows(e,o,i.title,(function(r){return t.choose(e,r)})).then((function(t){"symbol"!=typeof t&&s(n,t.normalized,t.raw,t.row,$(e.getSortMethod())+" ")}))}}},t}();for(var ep=function(){function t(){this.title="Heatmap"}return t.prototype.canRender=function(t){return Lt(t)&&Boolean(t.dataLength)},t.prototype.createContext=function(t,e,r){var n=e.colWidth(t),i=n/t.dataLength,o=t.labels;return{template:'<canvas height="18" title=""></canvas>',render:function(e,n,o,a){n.forEach((function(n,s){var u=s*i;isNaN(n)?Ac(e,i,a,u,0):(e.fillStyle=Fc(n,o,t,r),e.fillRect(u,0,i,a))}))},width:n,mover:function(e,r,i){return function(a){var s=a.offsetX/n,u=Math.max(0,Math.min(t.dataLength-1,Math.floor(s*(t.dataLength-1)+.5)));e.title=""+(i||"")+o[u]+": "+r[u]}}}},t.prototype.create=function(t,e,r,n){var i=this.createContext(t,e,n),o=i.template,a=i.render,s=i.mover,u=i.width;return{template:o,update:function(e,r){var n=e.getContext("2d");n.canvas.width=u,n.clearRect(0,0,n.canvas.width,n.canvas.height),Dc(e,t,r)||(e.onmousemove=s(e,t.getLabels(r)),e.onmouseleave=function(){return e.title=""},a(n,t.getNumbers(r),r,18))},render:function(e,r){a(e,t.getNumbers(r),r,4)}}},t.prototype.createGroup=function(t,e,r){var n=this,i=this.createContext(t,e,r),o=i.template,a=i.render,s=i.mover,u=i.width,l=t.getNumberFormat();return{template:o,update:function(r,i){return e.tasks.groupRows(t,i,n.title,(function(e){return tp.choose(t,e)})).then((function(e){if("symbol"!=typeof e){var n=r.getContext("2d");n.canvas.width=u,n.clearRect(0,0,n.canvas.width,n.canvas.height);var i=!e||0===e.normalized.length||e.normalized.every((function(t){return Number.isNaN(t)}));r.classList.toggle(qn("missing"),i),i||(r.onmousemove=s(r,e.raw.map(l),$(t.getSortMethod())+" "),r.onmouseleave=function(){return r.title=""},a(n,e.normalized,e.row,18))}}))}}},t.prototype.createSummary=function(t){for(var e=t.labels.slice();e.length>0&&!uc(t,e.length);)e=e.filter((function(t,e){return e%2==0}));for(var r='<div class="'+qn("heatmap")+'">',n=0,i=e;n<i.length;n++){var o=i[n];r+='<div class="'+qn("heatmap-cell")+'"  title="'+o+'" data-title="'+o+'"></div>'}return{template:r+="</div>",update:rc}},t}(),rp="undefined"!=typeof window&&"undefined"!=typeof document,np=["Edge","Trident","Firefox"],ip=0,op=0;op<np.length;op+=1)if(rp&&navigator.userAgent.indexOf(np[op])>=0){ip=1;break}var ap=rp&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),ip))}};function sp(t){return t&&"[object Function]"==={}.toString.call(t)}function up(t,e){if(1!==t.nodeType)return[];var r=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?r[e]:r}function lp(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function cp(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=up(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/(auto|scroll|overlay)/.test(r+i+n)?t:cp(lp(t))}var pp=rp&&!(!window.MSInputMethodContext||!document.documentMode),fp=rp&&/MSIE 10/.test(navigator.userAgent);function hp(t){return 11===t?pp:10===t?fp:pp||fp}function dp(t){if(!t)return document.documentElement;for(var e=hp(10)?document.body:null,r=t.offsetParent||null;r===e&&t.nextElementSibling;)r=(t=t.nextElementSibling).offsetParent;var n=r&&r.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TH","TD","TABLE"].indexOf(r.nodeName)&&"static"===up(r,"position")?dp(r):r:t?t.ownerDocument.documentElement:document.documentElement}function gp(t){return null!==t.parentNode?gp(t.parentNode):t}function mp(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var r=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,n=r?t:e,i=r?e:t,o=document.createRange();o.setStart(n,0),o.setEnd(i,0);var a,s,u=o.commonAncestorContainer;if(t!==u&&e!==u||n.contains(i))return"BODY"===(s=(a=u).nodeName)||"HTML"!==s&&dp(a.firstElementChild)!==a?dp(u):u;var l=gp(t);return l.host?mp(l.host,e):mp(t,gp(e).host)}function yp(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",r="top"===e?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var i=t.ownerDocument.documentElement,o=t.ownerDocument.scrollingElement||i;return o[r]}return t[r]}function vp(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=yp(e,"top"),i=yp(e,"left"),o=r?-1:1;return t.top+=n*o,t.bottom+=n*o,t.left+=i*o,t.right+=i*o,t}function bp(t,e){var r="x"===e?"Left":"Top",n="Left"===r?"Right":"Bottom";return parseFloat(t["border"+r+"Width"],10)+parseFloat(t["border"+n+"Width"],10)}function Ep(t,e,r,n){return Math.max(e["offset"+t],e["scroll"+t],r["client"+t],r["offset"+t],r["scroll"+t],hp(10)?parseInt(r["offset"+t])+parseInt(n["margin"+("Height"===t?"Top":"Left")])+parseInt(n["margin"+("Height"===t?"Bottom":"Right")]):0)}function Cp(t){var e=t.body,r=t.documentElement,n=hp(10)&&getComputedStyle(r);return{height:Ep("Height",e,r,n),width:Ep("Width",e,r,n)}}var Np=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},_p=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),Tp=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},wp=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function Rp(t){return wp({},t,{right:t.left+t.width,bottom:t.top+t.height})}function Ap(t){var e={};try{if(hp(10)){e=t.getBoundingClientRect();var r=yp(t,"top"),n=yp(t,"left");e.top+=r,e.left+=n,e.bottom+=r,e.right+=n}else e=t.getBoundingClientRect()}catch(t){}var i={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},o="HTML"===t.nodeName?Cp(t.ownerDocument):{},a=o.width||t.clientWidth||i.right-i.left,s=o.height||t.clientHeight||i.bottom-i.top,u=t.offsetWidth-a,l=t.offsetHeight-s;if(u||l){var c=up(t);u-=bp(c,"x"),l-=bp(c,"y"),i.width-=u,i.height-=l}return Rp(i)}function Dp(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=hp(10),i="HTML"===e.nodeName,o=Ap(t),a=Ap(e),s=cp(t),u=up(e),l=parseFloat(u.borderTopWidth,10),c=parseFloat(u.borderLeftWidth,10);r&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var p=Rp({top:o.top-a.top-l,left:o.left-a.left-c,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!n&&i){var f=parseFloat(u.marginTop,10),h=parseFloat(u.marginLeft,10);p.top-=l-f,p.bottom-=l-f,p.left-=c-h,p.right-=c-h,p.marginTop=f,p.marginLeft=h}return(n&&!r?e.contains(s):e===s&&"BODY"!==s.nodeName)&&(p=vp(p,e)),p}function Sp(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.ownerDocument.documentElement,n=Dp(t,r),i=Math.max(r.clientWidth,window.innerWidth||0),o=Math.max(r.clientHeight,window.innerHeight||0),a=e?0:yp(r),s=e?0:yp(r,"left"),u={top:a-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:o};return Rp(u)}function Mp(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===up(t,"position"))return!0;var r=lp(t);return!!r&&Mp(r)}function Lp(t){if(!t||!t.parentElement||hp())return document.documentElement;for(var e=t.parentElement;e&&"none"===up(e,"transform");)e=e.parentElement;return e||document.documentElement}function xp(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?Lp(t):mp(t,e);if("viewport"===n)o=Sp(a,i);else{var s=void 0;"scrollParent"===n?"BODY"===(s=cp(lp(e))).nodeName&&(s=t.ownerDocument.documentElement):s="window"===n?t.ownerDocument.documentElement:n;var u=Dp(s,a,i);if("HTML"!==s.nodeName||Mp(a))o=u;else{var l=Cp(t.ownerDocument),c=l.height,p=l.width;o.top+=u.top-u.marginTop,o.bottom=c+u.top,o.left+=u.left-u.marginLeft,o.right=p+u.left}}var f="number"==typeof(r=r||0);return o.left+=f?r:r.left||0,o.top+=f?r:r.top||0,o.right-=f?r:r.right||0,o.bottom-=f?r:r.bottom||0,o}function Op(t){return t.width*t.height}function Vp(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=xp(r,n,o,i),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},u=Object.keys(s).map((function(t){return wp({key:t},s[t],{area:Op(s[t])})})).sort((function(t,e){return e.area-t.area})),l=u.filter((function(t){var e=t.width,n=t.height;return e>=r.clientWidth&&n>=r.clientHeight})),c=l.length>0?l[0].key:u[0].key,p=t.split("-")[1];return c+(p?"-"+p:"")}function Ip(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=n?Lp(e):mp(e,r);return Dp(r,i,n)}function kp(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),r=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),n=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+n,height:t.offsetHeight+r}}function Gp(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function Hp(t,e,r){r=r.split("-")[0];var n=kp(t),i={width:n.width,height:n.height},o=-1!==["right","left"].indexOf(r),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",l=o?"width":"height";return i[a]=e[a]+e[u]/2-n[u]/2,i[s]=r===s?e[s]-n[l]:e[Gp(s)],i}function Pp(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Fp(t,e,r){return(void 0===r?t:t.slice(0,function(t,e,r){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===r}));var n=Pp(t,(function(t){return t[e]===r}));return t.indexOf(n)}(t,"name",r))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var r=t.function||t.fn;t.enabled&&sp(r)&&(e.offsets.popper=Rp(e.offsets.popper),e.offsets.reference=Rp(e.offsets.reference),e=r(e,t))})),e}function Up(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=Ip(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=Vp(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=Hp(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=Fp(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function Bp(t,e){return t.some((function(t){var r=t.name;return t.enabled&&r===e}))}function jp(t){for(var e=[!1,"ms","Webkit","Moz","O"],r=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<e.length;n++){var i=e[n],o=i?""+i+r:t;if(void 0!==document.body.style[o])return o}return null}function Yp(){return this.state.isDestroyed=!0,Bp(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[jp("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Wp(t){var e=t.ownerDocument;return e?e.defaultView:window}function zp(t,e,r,n){r.updateBound=n,Wp(t).addEventListener("resize",r.updateBound,{passive:!0});var i=cp(t);return function t(e,r,n,i){var o="BODY"===e.nodeName,a=o?e.ownerDocument.defaultView:e;a.addEventListener(r,n,{passive:!0}),o||t(cp(a.parentNode),r,n,i),i.push(a)}(i,"scroll",r.updateBound,r.scrollParents),r.scrollElement=i,r.eventsEnabled=!0,r}function qp(){this.state.eventsEnabled||(this.state=zp(this.reference,this.options,this.state,this.scheduleUpdate))}function Kp(){var t,e;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(t=this.reference,e=this.state,Wp(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach((function(t){t.removeEventListener("scroll",e.updateBound)})),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e))}function Xp(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function $p(t,e){Object.keys(e).forEach((function(r){var n="";-1!==["width","height","top","right","bottom","left"].indexOf(r)&&Xp(e[r])&&(n="px"),t.style[r]=e[r]+n}))}var Jp=rp&&/Firefox/i.test(navigator.userAgent);function Qp(t,e,r){var n=Pp(t,(function(t){return t.name===e})),i=!!n&&t.some((function(t){return t.name===r&&t.enabled&&t.order<n.order}));if(!i){var o="`"+e+"`",a="`"+r+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var Zp=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],tf=Zp.slice(3);function ef(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=tf.indexOf(t),n=tf.slice(r+1).concat(tf.slice(0,r));return e?n.reverse():n}var rf="flip",nf="clockwise",of="counterclockwise";function af(t,e,r,n){var i=[0,0],o=-1!==["right","left"].indexOf(n),a=t.split(/(\+|\-)/).map((function(t){return t.trim()})),s=a.indexOf(Pp(a,(function(t){return-1!==t.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,l=-1!==s?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return(l=l.map((function(t,n){var i=(1===n?!o:o)?"height":"width",a=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,r,n){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=r;break;case"%":case"%r":default:s=n}return Rp(s)[e]/100*o}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o}return o}(t,i,e,r)}))}))).forEach((function(t,e){t.forEach((function(r,n){Xp(r)&&(i[e]+=r*("-"===t[n-1]?-1:1))}))})),i}var sf={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,r=e.split("-")[0],n=e.split("-")[1];if(n){var i=t.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(r),u=s?"left":"top",l=s?"width":"height",c={start:Tp({},u,o[u]),end:Tp({},u,o[u]+o[l]-a[l])};t.offsets.popper=wp({},a,c[n])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var r=e.offset,n=t.placement,i=t.offsets,o=i.popper,a=i.reference,s=n.split("-")[0],u=void 0;return u=Xp(+r)?[+r,0]:af(r,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var r=e.boundariesElement||dp(t.instance.popper);t.instance.reference===r&&(r=dp(r));var n=jp("transform"),i=t.instance.popper.style,o=i.top,a=i.left,s=i[n];i.top="",i.left="",i[n]="";var u=xp(t.instance.popper,t.instance.reference,e.padding,r,t.positionFixed);i.top=o,i.left=a,i[n]=s,e.boundaries=u;var l=e.priority,c=t.offsets.popper,p={primary:function(t){var r=c[t];return c[t]<u[t]&&!e.escapeWithReference&&(r=Math.max(c[t],u[t])),Tp({},t,r)},secondary:function(t){var r="right"===t?"left":"top",n=c[r];return c[t]>u[t]&&!e.escapeWithReference&&(n=Math.min(c[r],u[t]-("right"===t?c.width:c.height))),Tp({},r,n)}};return l.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";c=wp({},c,p[e](t))})),t.offsets.popper=c,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,r=e.popper,n=e.reference,i=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",l=a?"width":"height";return r[s]<o(n[u])&&(t.offsets.popper[u]=o(n[u])-r[l]),r[u]>o(n[s])&&(t.offsets.popper[u]=o(n[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var r;if(!Qp(t.instance.modifiers,"arrow","keepTogether"))return t;var n=e.element;if("string"==typeof n){if(!(n=t.instance.popper.querySelector(n)))return t}else if(!t.instance.popper.contains(n))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],o=t.offsets,a=o.popper,s=o.reference,u=-1!==["left","right"].indexOf(i),l=u?"height":"width",c=u?"Top":"Left",p=c.toLowerCase(),f=u?"left":"top",h=u?"bottom":"right",d=kp(n)[l];s[h]-d<a[p]&&(t.offsets.popper[p]-=a[p]-(s[h]-d)),s[p]+d>a[h]&&(t.offsets.popper[p]+=s[p]+d-a[h]),t.offsets.popper=Rp(t.offsets.popper);var g=s[p]+s[l]/2-d/2,m=up(t.instance.popper),y=parseFloat(m["margin"+c],10),v=parseFloat(m["border"+c+"Width"],10),b=g-t.offsets.popper[p]-y-v;return b=Math.max(Math.min(a[l]-d,b),0),t.arrowElement=n,t.offsets.arrow=(Tp(r={},p,Math.round(b)),Tp(r,f,""),r),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(Bp(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var r=xp(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),n=t.placement.split("-")[0],i=Gp(n),o=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case rf:a=[n,i];break;case nf:a=ef(n);break;case of:a=ef(n,!0);break;default:a=e.behavior}return a.forEach((function(s,u){if(n!==s||a.length===u+1)return t;n=t.placement.split("-")[0],i=Gp(n);var l=t.offsets.popper,c=t.offsets.reference,p=Math.floor,f="left"===n&&p(l.right)>p(c.left)||"right"===n&&p(l.left)<p(c.right)||"top"===n&&p(l.bottom)>p(c.top)||"bottom"===n&&p(l.top)<p(c.bottom),h=p(l.left)<p(r.left),d=p(l.right)>p(r.right),g=p(l.top)<p(r.top),m=p(l.bottom)>p(r.bottom),y="left"===n&&h||"right"===n&&d||"top"===n&&g||"bottom"===n&&m,v=-1!==["top","bottom"].indexOf(n),b=!!e.flipVariations&&(v&&"start"===o&&h||v&&"end"===o&&d||!v&&"start"===o&&g||!v&&"end"===o&&m),E=!!e.flipVariationsByContent&&(v&&"start"===o&&d||v&&"end"===o&&h||!v&&"start"===o&&m||!v&&"end"===o&&g),C=b||E;(f||y||C)&&(t.flipped=!0,(f||y)&&(n=a[u+1]),C&&(o=function(t){return"end"===t?"start":"start"===t?"end":t}(o)),t.placement=n+(o?"-"+o:""),t.offsets.popper=wp({},t.offsets.popper,Hp(t.instance.popper,t.offsets.reference,t.placement)),t=Fp(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,r=e.split("-")[0],n=t.offsets,i=n.popper,o=n.reference,a=-1!==["left","right"].indexOf(r),s=-1===["top","left"].indexOf(r);return i[a?"left":"top"]=o[r]-(s?i[a?"width":"height"]:0),t.placement=Gp(e),t.offsets.popper=Rp(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!Qp(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,r=Pp(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottom<r.top||e.left>r.right||e.top>r.bottom||e.right<r.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var r=e.x,n=e.y,i=t.offsets.popper,o=Pp(t.instance.modifiers,(function(t){return"applyStyle"===t.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:e.gpuAcceleration,s=dp(t.instance.popper),u=Ap(s),l={position:i.position},c=function(t,e){var r=t.offsets,n=r.popper,i=r.reference,o=Math.round,a=Math.floor,s=function(t){return t},u=o(i.width),l=o(n.width),c=-1!==["left","right"].indexOf(t.placement),p=-1!==t.placement.indexOf("-"),f=e?c||p||u%2==l%2?o:a:s,h=e?o:s;return{left:f(u%2==1&&l%2==1&&!p&&e?n.left-1:n.left),top:h(n.top),bottom:h(n.bottom),right:f(n.right)}}(t,window.devicePixelRatio<2||!Jp),p="bottom"===r?"top":"bottom",f="right"===n?"left":"right",h=jp("transform"),d=void 0,g=void 0;if(g="bottom"===p?"HTML"===s.nodeName?-s.clientHeight+c.bottom:-u.height+c.bottom:c.top,d="right"===f?"HTML"===s.nodeName?-s.clientWidth+c.right:-u.width+c.right:c.left,a&&h)l[h]="translate3d("+d+"px, "+g+"px, 0)",l[p]=0,l[f]=0,l.willChange="transform";else{var m="bottom"===p?-1:1,y="right"===f?-1:1;l[p]=g*m,l[f]=d*y,l.willChange=p+", "+f}var v={"x-placement":t.placement};return t.attributes=wp({},v,t.attributes),t.styles=wp({},l,t.styles),t.arrowStyles=wp({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){var e,r;return $p(t.instance.popper,t.styles),e=t.instance.popper,r=t.attributes,Object.keys(r).forEach((function(t){!1!==r[t]?e.setAttribute(t,r[t]):e.removeAttribute(t)})),t.arrowElement&&Object.keys(t.arrowStyles).length&&$p(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,r,n,i){var o=Ip(i,e,t,r.positionFixed),a=Vp(r.placement,o,e,t,r.modifiers.flip.boundariesElement,r.modifiers.flip.padding);return e.setAttribute("x-placement",a),$p(e,{position:r.positionFixed?"fixed":"absolute"}),r},gpuAcceleration:void 0}}},uf=function(){function t(e,r){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Np(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=ap(this.update.bind(this)),this.options=wp({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=r&&r.jquery?r[0]:r,this.options.modifiers={},Object.keys(wp({},t.Defaults.modifiers,i.modifiers)).forEach((function(e){n.options.modifiers[e]=wp({},t.Defaults.modifiers[e]||{},i.modifiers?i.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return wp({name:t},n.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&sp(t.onLoad)&&t.onLoad(n.reference,n.popper,n.options,t,n.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return _p(t,[{key:"update",value:function(){return Up.call(this)}},{key:"destroy",value:function(){return Yp.call(this)}},{key:"enableEventListeners",value:function(){return qp.call(this)}},{key:"disableEventListeners",value:function(){return Kp.call(this)}}]),t}();uf.Utils=("undefined"!=typeof window?window:global).PopperUtils,uf.placements=Zp,uf.Defaults=sf;var lf=uf;function cf(t,e){var r=t;if(!e)return r;var n=Object.keys(e);if(0===n.length)return r;for(var i=0,o=n;i<o.length;i++){var a=o[i],s=e[a];"[object Object]"===Object.prototype.toString.call(s)&&Object.getPrototypeOf(s)===Object.prototype?(null==r[a]&&(r[a]={}),r[a]=cf(r[a],s)):Array.isArray(s)?(null==r[a]&&(r[a]=[]),r[a]=r[a].concat(s)):r[a]=s}return r}function pf(t,e,r){return{attachment:null!=r.currentTarget?r.currentTarget:r,level:e,manager:t.dialogManager,idPrefix:t.idPrefix}}var ff=function(){function t(t,e){void 0===e&&(e={}),this.dialog=t,this.options={title:"",livePreview:!1,popup:!1,placement:"bottom-start",toggleDialog:!0,cancelSubDialogs:!1,autoClose:!1,modifiers:{}},this.popper=null,Object.assign(this.options,e),this.node=t.attachment.ownerDocument.createElement("form"),this.node.classList.add(qn("dialog"))}return Object.defineProperty(t.prototype,"autoClose",{get:function(){return this.options.autoClose},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attachment",{get:function(){return this.dialog.attachment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this.dialog.level},enumerable:!0,configurable:!0}),t.prototype.showLivePreviews=function(){return!0===this.options.livePreview||"string"==typeof this.options.livePreview&&!0===this.dialog.manager.livePreviews[this.options.livePreview]},t.prototype.enableLivePreviews=function(t){var e=this;if(this.showLivePreviews()){var r=function(){e.submit()};"string"==typeof t?this.forEach(t,(function(t){t.addEventListener("change",r,{passive:!0})})):t.forEach((function(t){t.addEventListener("change",r,{passive:!0})}))}},t.prototype.equals=function(t){return this.dialog.level===t.dialog.level&&this.dialog.attachment===t.dialog.attachment},t.prototype.appendDialogButtons=function(){this.node.insertAdjacentHTML("beforeend",'<div class="'+qn("dialog-buttons")+'">\n      <button class="'+qn("dialog-button")+'" type="submit" title="Apply"></button>\n      <button class="'+qn("dialog-button")+'" type="button" title="Cancel"></button>\n      <button class="'+qn("dialog-button")+'" type="reset" title="Reset to default values"></button>\n    </div>')},t.prototype.open=function(){var t=this;if(!(this.options.toggleDialog&&this.dialog.manager.removeLike(this)||!1===this.build(this.node))){var e=this.attachment.closest("."+qn());this.options.title&&this.node.insertAdjacentHTML("afterbegin","<strong>"+this.options.title+"</strong>"),this.options.popup||this.appendDialogButtons(),e.appendChild(this.node),this.popper=new lf(this.attachment,this.node,cf({modifiers:{preventOverflow:{boundariesElement:e}}},this.options));var r=this.find("input[autofocus]");r&&self.setTimeout((function(){return r.focus()}));var n=this.find("button[type=reset]");n&&(n.onclick=function(e){e.stopPropagation(),e.preventDefault(),t.reset(),t.showLivePreviews()&&t.submit()}),this.node.onsubmit=function(e){return e.stopPropagation(),e.preventDefault(),t.triggerSubmit()};var i=this.find("button[title=Cancel]");i&&(i.onclick=function(e){e.stopPropagation(),e.preventDefault(),t.cancel(),t.destroy("cancel")}),this.options.cancelSubDialogs&&this.node.addEventListener("click",(function(){t.dialog.manager.removeAboveLevel(t.dialog.level+1)})),this.dialog.manager.push(this)}},t.prototype.triggerSubmit=function(){return!!this.node.checkValidity()&&(!1!==this.submit()&&this.destroy("confirm"),!1)},t.prototype.find=function(t){return this.node.querySelector(t)},t.prototype.findInput=function(t){return this.find(t)},t.prototype.forEach=function(t,e){return Array.from(this.node.querySelectorAll(t)).map(e)},t.prototype.cleanUp=function(t){"confirm"===t?this.submit():"cancel"===t&&this.cancel(),"handled"!==t&&this.dialog.manager.triggerDialogClosed(this,t),this.popper&&this.popper.destroy(),this.node.remove()},t.prototype.destroy=function(t){void 0===t&&(t="cancel"),this.dialog.manager.triggerDialogClosed(this,t),this.dialog.manager.remove(this,!0)},t}(),hf=function(t){function e(e,r){return void 0===r&&(r={}),t.call(this,e,Object.assign({popup:!0},r))||this}return i(e,t),e.prototype.submit=function(){return!0},e.prototype.reset=function(){},e.prototype.cancel=function(){},e}(ff),df=function(t){function e(e,r,n){void 0===n&&(n={});var i=t.call(this,e)||this;return i.callback=r,i.ioptions={min:NaN,max:NaN,step:"any",value:NaN,label:null},Object.assign(i.ioptions,n),i}return i(e,t),e.prototype.build=function(t){var e=this.ioptions;t.insertAdjacentHTML("beforeend",'\n     <input type="number" value="'+(isNaN(e.value)?"":String(e.value))+'" required autofocus placeholder="'+(e.label?e.label:"enter number")+'" '+(isNaN(e.min)?"":' min="'+e.min+'"')+" "+(isNaN(e.max)?"":' max="'+e.max+'"')+' step="'+e.step+'">\n    '),this.enableLivePreviews("input")},e.prototype.submit=function(){return this.callback(this.findInput("input[type=number]").valueAsNumber),!0},e}(hf);function gf(t,e){void 0===e&&(e={});var r=Object.assign({container:t.parentElement,filter:function(){return!0},onStart:function(){},onDrag:function(){},onEnd:function(){},minDelta:2},e),n=null,i=function(t,e){return t-e.getBoundingClientRect().left-e.clientLeft},o=0,a=0,s=0,u=function(e){if(r.filter(e)){e.stopPropagation(),e.preventDefault();var n=i(e.clientX,r.container)-s;Math.abs(a-n)<r.minDelta||(a=n,r.onDrag(t,n,a-n,e))}},l=function(e){if(r.filter(e)){e.stopPropagation(),e.preventDefault();var a=i(e.clientX,r.container)-s;n.removeEventListener("mousemove",u),n.removeEventListener("mouseup",l),n.removeEventListener("mouseleave",l),n.classList.remove(qn("dragging")),Math.abs(o-a)<2||r.onEnd(t,a,o-a,e)}};t.onmousedown=function(e){r.filter(e)&&(e.stopPropagation(),e.preventDefault(),s=i(e.clientX,t),o=a=i(e.clientX,r.container)-s,(n=t.closest("body")||t.closest("."+qn())).addEventListener("mousemove",u),n.addEventListener("mouseup",l),n.addEventListener("mouseleave",l),n.classList.add(qn("dragging")),r.onStart(t,o,0,e))}}function mf(t){var e=ie(t);return e.opacity=kn,e.toString()}function yf(t){for(var e="",r=0;r<t;++r)e+='<div class="'+qn("histogram-bin")+'" title="Bin '+r+': 0" data-x=""><div style="height: 0" ></div></div>';return'<div class="'+qn("histogram")+" "+(t>19?qn("dense"):"")+'">'+e}function vf(t,e,r,n,i){var o=e.hist;(function(t,e){var r=Array.from(t.querySelectorAll("[data-x]"));if(r.length>e)r.splice(e,r.length-e).forEach((function(t){return t.remove()}));else if(r.length<e){for(var n=r.length;n<e;++n)t.insertAdjacentHTML("afterbegin",'<div class="'+qn("histogram-bin")+'" title="Bin '+n+': 0" data-x=""><div style="height: 0" ></div></div>');r=Array.from(t.querySelectorAll("[data-x]"))}return t.classList.toggle(qn("dense"),e>19),r})(t,o.length).forEach((function(t,a){var s=o[a],u=t.firstElementChild;if(s){var l=s.x0,c=s.x1,p=s.count,f=i(s);if(t.dataset.x=n(l),r){var h=(r.hist[a]||{count:p}).count;t.title=n(l)+" - "+n(c)+" ("+p+" of "+h+")",u.style.height=O(100*h/r.maxBin,2)+"%";var d=100-O(100*p/h,2);u.style.background=0===d?f:100===d?mf(f):"linear-gradient("+mf(f)+" "+d+"%, "+f+" "+d+"%, "+f+" 100%)"}else t.title=n(l)+" - "+n(c)+" ("+p+")",u.style.height=O(100*p/e.maxBin,2)+"%",u.style.backgroundColor=f}else u.style.height="0%"}))}function bf(t){return'<span class="'+qn("mapping-hint")+'" title="'+t[0]+'">'+t[0]+'</span><span class="'+qn("mapping-hint")+'" title="'+t[1]+'">'+t[1]+"</span>"}function Ef(t,e){Array.from(t.getElementsByTagName("span")).forEach((function(t,r){return t.textContent=e[r]}))}function Cf(t,e){return'\n    <div class="'+qn("histogram-min-hint")+'" style="width: '+t.percent(e.filterMin)+'%"></div>\n    <div class="'+qn("histogram-max-hint")+'" style="width: '+(100-t.percent(e.filterMax))+'%"></div>\n    <div class="'+qn("histogram-min")+'" data-value="'+t.format(e.filterMin)+'" data-raw="'+t.formatRaw(e.filterMin)+'" style="left: '+t.percent(e.filterMin)+'%" title="min filter, drag or double click to change"></div>\n    <div class="'+qn("histogram-max")+'" data-value="'+t.format(e.filterMax)+'" data-raw="'+t.formatRaw(e.filterMax)+'" style="right: '+(100-t.percent(e.filterMax))+'%" title="max filter, drag or double click to change"></div>\n    '+Tc(e.filterMissing,0)+"\n  "}function Nf(t,e){var r=t.getElementsByClassName(qn("histogram-min"))[0],n=t.getElementsByClassName(qn("histogram-max"))[0],i=t.getElementsByClassName(qn("histogram-min-hint"))[0],o=t.getElementsByClassName(qn("histogram-max-hint"))[0],a=t.getElementsByTagName("input")[0],s=function(){var t=e.parseRaw(r.dataset.raw),i=e.parseRaw(n.dataset.raw);e.setFilter(a.checked,t,i)},u=function(t){t.preventDefault(),t.stopPropagation();var n=e.parseRaw(r.dataset.raw);e.edit(n,r,"min").then((function(t){i.style.width=e.percent(t)+"%",r.dataset.value=e.format(t),r.dataset.raw=e.formatRaw(t),r.style.left=e.percent(t)+"%",r.classList.toggle(qn("swap-hint"),e.percent(t)>15),s()}))};r.onclick=function(t){(t.shiftKey||t.ctrlKey)&&u(t)},r.ondblclick=u;var l=function(t){t.preventDefault(),t.stopPropagation();var r=e.parseRaw(n.dataset.raw);e.edit(r,n,"max").then((function(t){o.style.width=100-e.percent(t)+"%",n.dataset.value=e.format(t),n.dataset.raw=e.formatRaw(t),n.style.right=100-e.percent(t)+"%",n.classList.toggle(qn("swap-hint"),e.percent(t)<85),s()}))};n.onclick=function(t){(t.shiftKey||t.ctrlKey)&&l(t)},n.ondblclick=l,a.onchange=function(){return s()};var c={minDelta:0,filter:function(t){return 0===t.button&&!t.shiftKey&&!t.ctrlKey},onStart:function(t){return t.classList.add(qn("hist-dragging"))},onDrag:function(r,n){var a=t.clientWidth,s=Math.max(0,Math.min(n,a)),u=Math.round(100*s/a);if(r.dataset.value=e.format(e.unpercent(u)),r.dataset.raw=e.formatRaw(e.unpercent(u)),r.classList.contains(qn("histogram-min")))return r.style.left=u+"%",r.classList.toggle(qn("swap-hint"),u>15),void(i.style.width=u+"%");r.style.right=100-u+"%",r.classList.toggle(qn("swap-hint"),u<85),o.style.width=100-u+"%"},onEnd:function(t){t.classList.remove(qn("hist-dragging")),s()}};return gf(r,c),gf(n,c),function(t,s){i.style.width=e.percent(s.filterMin)+"%",o.style.width=100-e.percent(s.filterMax)+"%",r.dataset.value=e.format(s.filterMin),n.dataset.value=e.format(s.filterMax),r.dataset.raw=e.formatRaw(s.filterMin),n.dataset.raw=e.formatRaw(s.filterMax),r.style.left=e.percent(s.filterMin)+"%",n.style.right=100-e.percent(s.filterMax)+"%",r.classList.toggle(qn("swap-hint"),e.percent(s.filterMin)>15),n.classList.toggle(qn("swap-hint"),e.percent(s.filterMax)<85),a.checked=s.filterMissing,Rc(a.parentElement,t)}}var _f=function(){function t(){this.title="Histogram"}return t.prototype.canRender=function(t,e){return St(t)&&e!==Ql.CELL||Lt(t)&&e===Ql.CELL},t.prototype.create=function(t,e,r){var n=Tf(t,r),i=n.template,o=n.render,a=n.guessedBins;return{template:i+"</div>",update:function(e,r){if(!Dc(e,t,r)){for(var n=D(a),i=0,s=t.getNumbers(r);i<s.length;i++){var u=s[i];n.push(u)}var l=n.build();o(e,l)}}}},t.prototype.createGroup=function(t,e,r){var n=Tf(t,r),i=n.template,o=n.render;return{template:i+"</div>",update:function(r,n){return e.tasks.groupNumberStats(t,n).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.group||0===t.group.count||t.group.count===t.group.missing;if(r.classList.toggle(qn("missing"),e),!e){var n=t.summary,i=t.group;o(r,i,n)}}}))}}},t.prototype.createSummary=function(t,e,r,n){var i=Tf(t,n);return!r||!Dt(t)?function(t,e,r,n){Dt(t)&&(r+=bf(t.getRange()));return{template:r+"</div>",update:function(r){return Dt(t)&&Ef(r,t.getRange()),e.tasks.summaryNumberStats(t).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.summary||0===t.summary.count||t.summary.count===t.summary.missing;r.classList.toggle(qn("missing"),e),e||n(r,t.summary)}}))}}}(t,e,i.template,i.render):function(t,e,r,n){var i,o=Rf(t,e);return{template:(r+=Cf(o,wf(t)))+"</div>",update:function(r){return i||(i=Nf(r,o)),e.tasks.summaryNumberStats(t).then((function(e){if("symbol"!=typeof e){var o=e.summary,a=e.data;i(a?a.missing:o?o.missing:0,wf(t)),r.classList.add(qn("histogram-i")),r.classList.toggle(qn("missing"),!o),o&&n(r,o,a)}}))}}}(t,e,i.template,i.render)},t}();function Tf(t,e){var r=t.findMyRanker(),n=r?b(r.getOrderLength()):10,i=t.getNumberFormat();return{template:yf(n),render:function(r,n,o){return vf(r,n,o||null,i,(function(r){return xc(t,null,e,(r.x1+r.x0)/2)}))},guessedBins:n}}function wf(t,e){void 0===e&&(e=t.getFilter());var r=t.getMapping().domain,n=isFinite(e.min)?e.min:r[0],i=isFinite(e.max)?e.max:r[1];return{filterMissing:e.filterMissing,filterMin:n,filterMax:i}}function Rf(t,e){var r=t.getMapping().domain,n=t.getNumberFormat();return{percent:function(t){return function(t){return Math.max(0,Math.min(100,t))}(Math.round(100*(t-r[0])/(r[1]-r[0])))},unpercent:function(t){return t/100*(r[1]-r[0])+r[0]},domain:r,format:n,formatRaw:String,parseRaw:Number.parseFloat,setFilter:function(e,n,i){return t.setFilter({filterMissing:e,min:n===r[0]?Number.NEGATIVE_INFINITY:n,max:i===r[1]?Number.POSITIVE_INFINITY:i})},edit:function(t,n){return new Promise((function(i){var o={attachment:n,manager:e.dialogManager,level:e.dialogManager.maxLevel+1,idPrefix:e.idPrefix};new df(o,i,{value:t,min:r[0],max:r[1]}).open()}))}}}var Af=function(){function t(){this.title="Image"}return t.prototype.canRender=function(t,e){return t instanceof ju&&e===Ql.CELL},t.prototype.create=function(t){return{template:"<div></div>",update:function(e,r){var n=Dc(e,t,r);if(e.style.backgroundImage=null,n)e.title="";else{var i,o=t.getLink(r);if(e.title=o?o.alt:"",o)return Xu((i=o.href,new Promise((function(t){var e=new Image;e.onload=function(){return t(e)},e.src=i})))).then((function(t){"symbol"!=typeof t&&(e.style.backgroundImage=n||!o?null:"url('"+t.src+"')")}))}}}},t.prototype.createGroup=function(){return nc},t.prototype.createSummary=function(){return nc},t}(),Df=function(){function t(){}return t.prototype.createGroup=function(t,e,r){var n=this,i=this.create(t,e,r);return{template:i.template,update:function(r,o){return e.tasks.groupRows(t,o,"aggregated",(function(e){return n.aggregatedIndex(e,t)})).then((function(t){"symbol"!=typeof t&&i.update(r,t.row,t.index,o)}))}}},t.prototype.createSummary=function(){return nc},t}();function Sf(t,e,r,n,i){var o=In,a=0;return{cols:t.children.map((function(t){var s=a,u=t.getWidth();a+=u,a+=r?0:o;var l=n===Ql.CELL?e.renderer(t,i):null,c=n===Ql.GROUP?e.groupRenderer(t,i):null,p=n===Ql.GROUP?e.summaryRenderer(t,!1,i):null,f="",h="";switch(n){case Ql.CELL:f=l.template,h=t.getRenderer();break;case Ql.GROUP:f=c.template,h=t.getGroupRenderer();break;case Ql.SUMMARY:f=p.template,h=t.getSummaryRenderer()}return f=f.replace(/^<([^ >]+)([ >])/,'<$1 data-column-id="'+t.id+'" data-renderer="'+h+'"$2'),{column:t,shift:s,width:u,template:f=/^<([^>]+) class="([ >]*)/.test(f)?f.replace(/^<([^>]+) class="([ >]*)/,'<$1 class="'+qn("renderer-"+h)+" $2"):f.replace(/^<([^ >]+)([ >])/,'<$1 class="'+qn("renderer-"+h)+'"$2'),rendererId:h,renderer:l,groupRenderer:c,summaryRenderer:p}})),stacked:r,padding:o}}var Mf=function(t){function e(e){void 0===e&&(e=!0);var r=t.call(this)||this;return r.stacked=e,r.title=r.stacked?"Stacked Bar":"Nested",r}return i(e,t),e.prototype.canRender=function(t,e){return ct(t)&&e!==Ql.SUMMARY},e.prototype.create=function(t,e,r){var n=this,i=Sf(t,e,this.stacked,Ql.CELL,r),o=i.cols,a=i.stacked,s=e.colWidth(t);return{template:"<div class='"+gc(e.idPrefix,t)+" "+(a?"":qn("grid-space"))+"'>"+o.map((function(t){return t.template})).join("")+"</div>",update:function(r,i,s,u){if(Dc(r,t,i))return null;sc(r,o,e);var l=[],c=Array.from(r.children),p=t.getWidth(),f=0;return o.forEach((function(t,e){var r=t.column.getWidth()/p,h=c[e];h.classList.add(qn(n.stacked?"stack-sub":"nested-sub"),qn("detail")),h.dataset.group="d",h.style.transform=a?"translate(-"+O(f/r*100,4)+"%,0)":null,h.style.gridColumnStart=(e+1).toString();var d=t.renderer.update(h,i,s,u);if(a&&(f+=(1-t.column.getNumber(i))*r,e<o.length-1)){var g=h.querySelector("span");g&&(g.style.overflow="hidden")}d&&l.push(d)})),l.length>0?$u(l):null},render:function(e,r,n,i){if(Sc(e,t,r,s))return null;for(var u=[],l=0,c=0,p=o;c<p.length;c++){var f=p[c],h=f.renderer;if(h.render){var d=f.shift-l;e.translate(d,0);var g=h.render(e,r,n,i);"boolean"!=typeof g&&g&&u.push({shift:d,r:g}),e.translate(-d,0)}a&&(l+=f.width*(1-f.column.getNumber(r)))}return 0===u.length?null:$u(u.map((function(t){return t.r}))).then((function(t){return function(e){if("symbol"!=typeof t)for(var r=0;r<t.length;++r){var n=t[r];if("function"==typeof n){var i=u[r].shift;e.translate(i,0),n(e),e.translate(-i,0)}}}}))}}},e.prototype.createGroup=function(e,r,n){var i=this;if(this.stacked&&St(e))return t.prototype.createGroup.call(this,e,r,n);var o=Sf(e,r,!1,Ql.GROUP,n).cols;return{template:"<div class='"+gc(r.idPrefix,e)+" "+qn("grid-space")+"'>"+o.map((function(t){return t.template})).join("")+"</div>",update:function(t,e){sc(t,o,r);var n=[],a=Array.from(t.children);return o.forEach((function(t,r){var o=a[r];o.classList.add(qn(i.stacked?"stack-sub":"nested-sub"),qn("group")),o.dataset.group="g",o.style.gridColumnStart=(r+1).toString();var s=t.groupRenderer.update(o,e);s&&n.push(s)})),n.length>0?$u(n):null}}},e.prototype.aggregatedIndex=function(t,e){return console.assert(St(e)),function(t,e){var r=t.map((function(t,r){return{r:t,i:r,v:e.getNumber(t)}})),n=Array.from(r.filter((function(t){return!isNaN(t.v)}))).sort((function(t,e){return Hs(t.v,e.v)})),i=n[Math.floor(n.length/2)];return void 0===i?{index:0,row:n[0].r}:{index:i.i,row:i.r}}(t,e)},e}(Df),Lf=function(){function t(){this.title="Interleaved"}return t.prototype.canRender=function(t){return t instanceof wu},t.prototype.create=function(t,e){var r=Sf(t,e,!1,Ql.CELL).cols,n=e.colWidth(t);return{template:"<div>"+r.map((function(t){return t.template})).join("")+"</div>",update:function(n,i,o,a){Dc(n,t,i)||(sc(n,r,e),ac(n,(function(t,e){r[e].renderer.update(t,i,o,a)})))},render:function(e,i,o,a){Sc(e,t,i,n)||(e.save(),e.scale(1,1/r.length),r.forEach((function(t,r){var n=t.renderer;n.render&&n.render(e,i,r,a),e.translate(0,4)})),e.restore())}}},t.prototype.createGroup=function(t,e){var r=Sf(t,e,!1,Ql.GROUP).cols;return{template:"<div>"+r.map((function(t){return t.template})).join("")+"</div>",update:function(t,n){sc(t,r,e),ac(t,(function(t,e){r[e].groupRenderer.update(t,n)}))}}},t.prototype.createSummary=function(t,e,r){var n=t.children,i=0,o=Tf(t,{color:function(){return mc(n[i++%n.length])}}),a=o.template,s=o.render;return{template:a,update:function(t){return Hl(n.map((function(t){return e.tasks.summaryNumberStats(t)}))).then((function(e){if("symbol"!=typeof e){var r=e.map((function(t){return t.summary}));if(r.some(Boolean)){t.classList.remove(qn("missing"));var n=function(t){var e=t.find(Boolean);if(!e)return null;for(var r=e.hist.length,n=[],i=0,o=function(e){t.forEach((function(t){var r=t?t.hist[e]:null;r?(r.count>i&&(i=r.count),n.push(r)):n.push(xf)}))},a=0;a<r;++a)o(a);return{maxBin:i,hist:n}}(r);s(t,n)}else t.classList.add(qn("missing"))}}))}}},t}(),xf={count:0,x0:0,x1:0};var Of=function(){function t(){this.title="Link"}return t.prototype.canRender=function(t,e){return t instanceof ju&&e!==Ql.SUMMARY},t.prototype.create=function(t){var e=t.alignment||"left";return{template:"<a"+("left"!==e?' class="'+qn(e)+'"':"")+' target="_blank" rel="noopener" href=""></a>',update:function(e,r){Dc(e,t,r);var n=t.getLink(r);e.href=n?n.href:"",t.escape?ic(e,n?n.alt:""):e.innerHTML=n?n.alt:""}}},t.exampleText=function(t,e){var r=[];return e.every((function(e){var n=t.getLink(e);return!n||(r.push('<a target="_blank" rel="noopener"  href="'+n.href+'">'+n.alt+"</a>"),r.length<5)})),0===r.length?"":r.join(", ")+(r.length<e.length?", &hellip;":"")},t.prototype.createGroup=function(e,r){return{template:"<div> </div>",update:function(n,i){return r.tasks.groupExampleRows(e,i,"link",(function(r){return t.exampleText(e,r)})).then((function(t){"symbol"!=typeof t&&(n.classList.toggle(qn("missing"),!t),n.innerHTML=t)}))}}},t.prototype.createSummary=function(){return nc},t}(),Vf=function(){function t(){this.title="Table"}return t.prototype.canRender=function(t){return jl(t)},t.prototype.create=function(t){return Yl(t)&&t.dataLength?this.createFixed(t):{template:'<div class="'+qn("rtable")+'"></div>',update:function(e,r){Dc(e,t,r)||(e.innerHTML=t.getMapLabel(r).map((function(t){var e=t.key,r=t.value;return'<div class="'+qn("table-cell")+'">'+e+'</div><div class="'+qn("table-cell")+'">'+r+"</div>"})).join(""))}}},t.template=function(t){return"<div>"+t.labels.map((function(t){return'<div class="'+qn("table-cell")+'">'+t+'</div><div  class="'+qn("table-cell")+'" data-v></div>'})).join("\n")+"</div>"},t.prototype.createFixed=function(e){return{template:t.template(e),update:function(t,r){if(!Dc(t,e,r)){var n=e.getLabels(r);oc(t,"[data-v]",(function(t,e){t.innerHTML=n[e]}))}}}},t.example=function(t){return t.slice(0,5).map((function(t){return t.value})).join(", ")+(5<t.length?", &hellip;":"")},t.prototype.createGroup=function(e,r){return Yl(e)&&e.dataLength?this.createFixedGroup(e,r):{template:'<div class="'+qn("rtable")+'"></div>',update:function(n,i){return r.tasks.groupRows(e,i,"table",(function(t){return If(t.map((function(t){return e.getMapLabel(t)})))})).then((function(e){"symbol"!=typeof e&&(n.innerHTML=e.map((function(e){var r=e.key,n=e.values;return'<div class="'+qn("table-cell")+'">'+r+'</div><div class="'+qn("table-cell")+'">'+t.example(n)+"</div>"})).join(""))}))}}},t.prototype.createFixedGroup=function(e,r){return{template:t.template(e),update:function(t,n){return r.tasks.groupExampleRows(e,n,"table",(function(t){var r=e.labels.map((function(){return[]}));return t.forEach((function(t){for(var n=e.getLabels(t),i=0;i<Math.min(r.length,n.length);++i)vn(n[i])||r[i].push(n[i])})),r})).then((function(e){"symbol"!=typeof e&&oc(t,"[data-v]",(function(t,r){t.innerHTML=e[r].join(", ")+"&hellip;"}))}))}}},t.prototype.createSummary=function(){return{template:'<div class="'+qn("rtable")+'"><div>Key</div><div>Value</div></div>',update:rc}},t}();function If(t){var e=new Map;return t.forEach((function(t){return t.forEach((function(t){e.has(t.key)?e.get(t.key).push(t):e.set(t.key,[t])}))})),Array.from(e).sort((function(t,e){return t[0].localeCompare(e[0])})).map((function(t){return{key:t[0],values:t[1]}}))}var kf=function(){function t(){this.title="Table with Links"}return t.prototype.canRender=function(t,e){return t instanceof Yu&&e!==Ql.SUMMARY},t.prototype.create=function(t){var e=t.alignment||"left";return{template:'<div class="'+qn("rtable")+'"></div>',update:function(r,n){Dc(r,t,n)||(r.innerHTML=t.getLinkMap(n).map((function(t){var r=t.key,n=t.value;return'\n          <div class="'+qn("table-cell")+'">'+r+'</div>\n          <div class="'+qn("table-cell")+" "+("left"!==e?qn(e):"")+'">\n            <a href="'+n.href+'" target="_blank" rel="noopener">'+n.alt+"</a>\n          </div>"})).join(""))},render:rc}},t.example=function(t){for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r];if(i&&i.value.href&&(e.push('<a target="_blank" rel="noopener" href="'+i.value.href+'">'+i.value.alt+"</a>"),e.length>=5))break}return 0===e.length?"":""+e.join(", ")+(e.length<t.length)+" ? ', &hellip;': ''}"},t.prototype.createGroup=function(e,r){var n=e.alignment||"left";return{template:'<div class="'+qn("rtable")+'"></div>',update:function(i,o){return r.tasks.groupRows(e,o,"linkmap",(function(t){return If(t.map((function(t){return e.getLinkMap(t)})))})).then((function(e){"symbol"!=typeof e&&(i.innerHTML=e.map((function(e){var r=e.key,i=e.values,o=t.example(i);return o?"<div>"+r+"</div><div"+("left"!==n?' class="'+qn(n)+'"':"")+">"+o+"</div>":"<div>"+r+'</div><div class="'+qn("missing")+'"></div>'})).join(""))}))}}},t.prototype.createSummary=function(){return nc},t}(),Gf=function(){function t(){this.title="Loading"}return t.prototype.canRender=function(){return!1},t.prototype.create=function(){return{template:"<div>Loading &hellip;</div>",update:rc}},t.prototype.createGroup=function(){return this.create()},t.prototype.createSummary=function(){return this.create()},t}(),Hf=function(){function t(){this.title="Bar Table"}return t.prototype.canRender=function(t,e){return jl(t)&&St(t)&&(e===Ql.CELL||e===Ql.SUMMARY&&Dt(t))},t.prototype.create=function(t,e,r){var n=t.getNumberFormat();return{template:'<div class="'+qn("rtable")+'"></div>',update:function(e,i){Dc(e,t,i)||(e.innerHTML=t.getMap(i).map((function(e){var o=e.key,a=e.value;if(isNaN(a))return'<div class="'+qn("table-cell")+'">'+o+'</div><div class="'+qn("table-cell")+" "+qn("missing")+'"></div>';var s=O(100*a,2);return'<div class="'+qn("table-cell")+'">'+o+'</div>\n            <div class="'+qn("table-cell")+'" title="'+n(a)+'">\n              <div style="width: '+s+"%; background-color: "+xc(t,i,r)+'">\n                <span class="'+qn("hover-only")+'">'+a+"</span>\n              </div>\n            </div>"})).join(""))}}},t.prototype.createGroup=function(){return nc},t.prototype.createSummary=function(t){return{template:'<div class="'+qn("rtable")+'"><div>Key</div><div><span></span><span></span>Value</div></div>',update:function(e){var r=t.getRange(),n=e.lastElementChild;n.firstElementChild.textContent=r[0],n.children[1].textContent=r[1]}}},t}(),Pf=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t){return t instanceof ni},t.prototype.create=function(t){return{template:'<div class="'+qn("right")+'"> </div>',update:function(e,r){Dc(e,t,r),ic(e,t.getLabel(r))}}},t.prototype.createGroup=function(t){var e=t.findMyRanker();return{template:"<div><div></div><div></div></div>",update:function(t,r){var n=t.firstElementChild,i=t.lastElementChild;if(0===r.order.length)return n.textContent="",void(i.textContent="");n.textContent=e.getRank(r.order[0]).toString(),i.textContent=e.getRank(r.order[r.order.length-1]).toString()}}},t.prototype.createSummary=function(){return nc},t}(),Ff=function(){function t(){this.title="Default"}return t.prototype.canRender=function(t){return t instanceof oi},t.prototype.create=function(t,e){return{template:"<div></div>",update:function(r,n,i){r.onclick=function(r){if(r.preventDefault(),r.stopPropagation(),r.shiftKey){var o=t.findMyRanker().id;if(dl(e.provider,o,n.i,i,r.ctrlKey))return}t.toggleValue(n)}}}},t.prototype.createGroup=function(t,e){return{template:"<div></div>",update:function(r,n){var i=0,o=0,a=n.order.length;fn(n.order,(function(t){return e.provider.isSelected(t)?i++:o++,!(2*i>a||2*o>a)})),r.classList.toggle(qn("group-selected"),2*i>a),r.onclick=function(e){e.preventDefault(),e.stopPropagation();var i=r.classList.toggle(qn("group-selected"));t.setValues(n.order,i)}}}},t.prototype.createSummary=function(t,e){var r=qn("icon-unchecked"),n=qn("icon-checked");return{template:'<div title="(Un)Select All" class="'+r+'"></div>',update:function(i){i.onclick=function(o){o.stopPropagation(),i.classList.contains(r)?(e.provider.selectAllOf(t.findMyRanker()),i.classList.remove(r),i.classList.add(n)):(e.provider.setSelection([]),i.classList.remove(n),i.classList.add(r))}}}},t}(),Uf=function(){function t(){this.title="Matrix"}return t.prototype.canRender=function(t){return zl(t)},t.createDOMContext=function(t){for(var e=t.categories,r=t.getColorMapping(),n="",i=0,o=e;i<o.length;i++){var a=o[i];n+='<div class="'+qn("heatmap-cell")+'" title="'+a.label+'" style="background-color: '+r.apply(a)+'"></div>'}return{templateRow:n,render:function(t,e){ac(t,(function(t,r){var n=e[r];t.style.opacity="boolean"==typeof n?n?"1":"0":O(n,2).toString()}))}}},t.prototype.create=function(e,r){var n=t.createDOMContext(e),i=n.templateRow,o=n.render,a=r.colWidth(e),s=a/e.dataLength,u=e.categories,l=e.getColorMapping();return{template:'<div class="'+qn("heatmap")+'">'+i+"</div>",update:function(t,r){Dc(t,e,r)||o(t,e.getValues(r))},render:function(t,r){if(!Sc(t,e,r,a)){var n=e.getValues(r);t.save(),u.forEach((function(e,r){if(n[r]){var i=r*s;t.fillStyle=l.apply(e),t.fillRect(i,0,s,4)}})),t.restore()}}}},t.prototype.createGroup=function(e,r){var n=t.createDOMContext(e),i=n.templateRow,o=n.render;return{template:'<div class="'+qn("heatmap")+'">'+i+"</div>",update:function(t,n){return r.tasks.groupCategoricalStats(e,n).then((function(e){if("symbol"!=typeof e){var r=!e||!e.group||0===e.group.count||e.group.count===e.group.missing;t.classList.toggle(qn("missing"),r),r||o(t,e.group.hist.map((function(t){return t.count/e.group.maxBin})))}}))}}},t.prototype.createSummary=function(t){for(var e=t.categories,r=t.getColorMapping(),n='<div class="'+qn("heatmap")+'">',i=lc(t),o=0,a=e;o<a.length;o++){var s=a[o];n+='<div class="'+qn("heatmap-cell")+'" title="'+s.label+'"'+(i?' data-title="'+s.label+'"':"")+' style="background-color: '+r.apply(s)+'"></div>'}return{template:n+="</div>",update:rc}},t}();function Bf(t){if(0===t.length)return"";var e="",r=!0;return t.forEach((function(t,n){isNaN(t)?r=!0:r?(e+="M"+n+","+(1-t)+" ",r=!1):e+="L"+n+","+(1-t)+" "})),e}var jf=function(){function t(){this.title="Sparkline"}return t.prototype.canRender=function(t,e){return Lt(t)&&e!==Ql.SUMMARY},t.prototype.create=function(t){var e=t.dataLength,r=1-t.getMapping().apply(Eu.CENTER);return{template:'<svg viewBox="0 0 '+(e-1)+' 1" preserveAspectRatio="none meet"><line x1="0" x2="'+(e-1)+'" y1="'+r+'" y2="'+r+'"></line><path></path></svg>',update:function(e,r){if(!Dc(e,t,r)){var n=t.getNumbers(r);e.lastElementChild.setAttribute("d",Bf(n))}}}},t.prototype.createGroup=function(t,e){var r=t.dataLength,n=1-t.getMapping().apply(Eu.CENTER);return{template:'<svg viewBox="0 0 '+r+' 1" preserveAspectRatio="none meet"><line x1="0" x2="'+(r-1)+'" y1="'+n+'" y2="'+n+'"></line><path></path></svg>',update:function(r,n){return function(t,e,r){var n=Array.from(t.children);n.length>e?n.slice(e).forEach((function(t){return t.remove()})):e>n.length&&t.insertAdjacentHTML("beforeend",r.repeat(e-n.length))}(r,n.order.length,"<path></path>"),e.tasks.groupRows(t,n,"numbers",(function(e){return Array.from(e.map((function(e){return t.getNumbers(e)})))})).then((function(t){if("symbol"!=typeof t){var e=0===t.length||t.every((function(t){return t.every(vn)}));r.classList.toggle(qn("missing"),e),e||ac(r,(function(e,r){e.setAttribute("d",Bf(t[r]))}))}}))}}},t.prototype.createSummary=function(){return nc},t}(),Yf=function(){function t(){this.title="UpSet"}return t.prototype.canRender=function(t){return zl(t)},t.calculateSetPath=function(t,e){var r=[];return t.forEach((function(t,e){return t?r.push(e):-1})),{left:r[0]*e+e/2,right:r[r.length-1]*e+e/2}},t.createDOMContext=function(t){for(var e="",r=0,n=t.categories;r<n.length;r++){var i=n[r];e+='<div class="'+qn("upset-dot")+'" title="'+i.label+'"></div>'}return{template:'<div><div class="'+qn("upset-line")+'"></div>'+e+"</div>",render:function(t,e){Array.from(t.children).slice(1).forEach((function(t,r){var n=e[r];t.classList.toggle(qn("enabled"),n)}));var r=t.firstElementChild,n=e.findIndex((function(t){return t})),i=e.length-1-e.reverse().findIndex((function(t){return t}));n<0||n===i?r.style.display="none":(r.style.display=null,r.style.left=Math.round(100*(n+.5)/e.length)+"%",r.style.width=Math.round(100*(i-n)/e.length)+"%")}}},t.prototype.create=function(e,r){var n=t.createDOMContext(e),i=n.template,o=n.render,a=r.colWidth(e),s=a/e.categories.length;return{template:i,update:function(t,r){Dc(t,e,r)||o(t,e.getValues(r))},render:function(r,n){if(!Sc(r,e,n,a)){var i=e.getValues(n),o=i.some((function(t){return t}));if(r.save(),r.fillStyle=Hn.color,r.strokeStyle=Hn.color,o){var u=t.calculateSetPath(i,s),l=u.left,c=u.right;r.beginPath(),r.moveTo(l,2),r.lineTo(c,2),r.stroke()}i.forEach((function(t,e){var n=e*s;r.beginPath(),r.globalAlpha=t?1:Hn.inactive,r.fillRect(n,0,s,4),r.fill()})),r.restore()}}}},t.prototype.createGroup=function(e,r){var n=t.createDOMContext(e),i=n.template,o=n.render;return{template:i,update:function(t,n){return r.tasks.groupCategoricalStats(e,n).then((function(e){"symbol"!=typeof e&&o(t,e.group.hist.map((function(t){return t.count>0})))}))}}},t.prototype.createSummary=function(e,r){var n=t.createDOMContext(e),i=n.template,o=n.render;return{template:i,update:function(t){return r.tasks.summaryCategoricalStats(e).then((function(e){"symbol"!=typeof e&&o(t,e.summary.hist.map((function(t){return t.count>0})))}))}}},t}(),Wf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.title="Bar Chart",e}return i(e,t),e.prototype.canRender=function(t,e){return Lt(t)&&Boolean(t.dataLength)&&e===Ql.CELL},e.compute=function(t,e,r){return t<e?{height:e-t,bottom:t-r[0]}:{height:t-e,bottom:e-r[0]}},e.prototype.createContext=function(t,r,n){for(var i=r.colWidth(t)/t.dataLength,o=t.getMapping().apply(Eu.CENTER),a="",s=0;s<t.dataLength;++s)a+='<div class="'+qn("heatmap-cell")+'" style="background-color: white" title=""></div>';var u=t.getNumberFormat();return{clazz:qn("heatmap"),templateRow:a,update:function(r,i,a,s,l){var c=Fc(0,s,t,n),p=Fc(1,s,t,n);ac(r,(function(t,r){var n=i[r],s=e.compute(n,o,[0,1]),f=s.bottom,h=s.height;t.title=""+(l||"")+u(a[r]),t.style.backgroundColor=n<o?c:p,t.style.bottom=Math.round(100*f/1)+"%",t.style.height=Math.round(100*h/1)+"%"}))},render:function(r,a,s){var u=Fc(0,s,t,n),l=Fc(1,s,t,n);a.forEach((function(t,n){r.fillStyle=t<o?u:l;var a=n*i,s=e.compute(t,o,[0,1]),c=s.bottom,p=s.height;r.fillRect(a,4*(1-p-c),i,4*p)}))}}},e.prototype.createSummary=function(){return nc},e}(tp),zf=function(){function t(){this.title="Date",this.groupTitle="Date",this.summaryTitle="Date"}return t.prototype.canRender=function(t){return t instanceof Zs},t.prototype.create=function(t){return{template:"<div> </div>",update:function(e,r){Dc(e,t,r),ic(e,t.getLabel(r))},render:rc}},t.prototype.createGroup=function(t,e){return{template:"<div> </div>",update:function(r,n){return t.isGroupedBy()>=0?e.tasks.groupRows(t,n,"date",(function(e){return Js(e,t.getDateGrouper(),t)})).then((function(t){"symbol"!=typeof t&&(r.classList.toggle(qn("missing"),!t),ic(r,t?t.name:""))})):e.tasks.groupExampleRows(t,n,"date",(function(e){return dc(t,e)})).then((function(t){"symbol"!=typeof t&&(r.classList.toggle(qn("missing"),!t),ic(r,t))}))}}},t.prototype.createSummary=function(){return nc},t}(),qf=function(t){function e(e,r,n){void 0===n&&(n={});var i=t.call(this,e)||this;return i.callback=r,i.ioptions={value:null,label:null},Object.assign(i.ioptions,n),i}return i(e,t),e.prototype.build=function(t){var e=this,r=this.ioptions,n=da("%Y-%m-%d");t.insertAdjacentHTML("beforeend",'\n     <input type="date" value="'+(r.value?n(r.value):"")+'" required autofocus placeholder="'+(r.label?r.label:"enter date")+'">\n    '),this.findInput("input[type=date]").addEventListener("keypress",(function(t){"Enter"===t.key&&e.triggerSubmit()})),this.enableLivePreviews("input")},e.prototype.submit=function(){return this.callback(this.findInput("input[type=date]").valueAsDate),!0},e}(hf),Kf=function(){function t(){this.title="Histogram"}return t.prototype.canRender=function(t,e){return $l(t)&&e!==Ql.CELL||Jl(t)&&e===Ql.CELL},t.prototype.create=function(t,e){var r=$f(t),n=r.template,i=r.render;return{template:n+"</div>",update:function(e,r){if(!Dc(e,t,r)){for(var n=L(),o=0,a=t.getDates(r);o<a.length;o++){var s=a[o];n.push(s)}var u=n.build();i(e,u)}}}},t.prototype.createGroup=function(t,e){var r=$f(t),n=r.template,i=r.render;return{template:n+"</div>",update:function(r,n){return e.tasks.groupDateStats(t,n).then((function(t){if("symbol"!=typeof t){var e=!t||null==t.group||0===t.group.count||t.group.count===t.group.missing;r.classList.toggle(qn("missing"),e),e||i(r,t.group)}}))}}},t.prototype.createSummary=function(t,e,r){var n=$f(t);return r?function(t,e,r,n){var i,o,a=t.getFilter(),s=[isFinite(a.min)?a.min:0,isFinite(a.max)?a.max:100];return{template:(r+=Cf(Qf(t,e,s),Jf(t,s)))+"</div>",update:function(r){return e.tasks.summaryDateStats(t).then((function(a){if("symbol"!=typeof a){var s=a.summary,u=a.data;if(!o){var l=[u.min?u.min.getTime():Date.now(),u.max?u.max.getTime():Date.now()];i=Qf(t,e,l),o=Nf(r,i)}o(u?u.missing:s?s.missing:0,Jf(t,i.domain)),r.classList.add(qn("histogram-i")),r.classList.toggle(qn("missing"),!s),s&&n(r,s,u)}}))}}}(t,e,n.template,n.render):function(t,e,r,n,i){return{template:(n+=bf(["",""]))+"</div>",update:function(n){return e.tasks.summaryDateStats(t).then((function(e){if("symbol"!=typeof e){var o=e.summary,a=e.data;if(n.classList.toggle(qn("missing"),!o),o){var s=t.getFormatter();Ef(n,[s(o.min),s(o.max)]),i(n,o,r?a:void 0)}}}))}}}(t,e,!1,n.template,n.render)},t}();function Xf(t,e,r,n){var i=$f(t),o=t.getFilter(),a=[isFinite(o.min)?o.min:0,isFinite(o.max)?o.max:100],s=Qf(t,r,a),u=s.setFilter,l=Jf(t,a);s.setFilter=function(t,e,r){l={filterMissing:t,filterMin:e,filterMax:r},n&&u(t,e,r)},e.innerHTML=""+i.template+Cf(s,Jf(t,a))+"</div>";var c=e.firstElementChild;c.classList.add(qn("summary"),qn("renderer")),c.dataset.renderer="histogram",c.dataset.interactive="",c.classList.add(qn("histogram-i"));var p=null,f=function(){var e=r.tasks.summaryDateStats(t).then((function(e){if("symbol"!=typeof e){var o,f,h=e.summary,d=e.data;p||(o=d.min,f=d.max,a=[o?o.getTime():Date.now(),f?f.getTime():Date.now()],s=Qf(t,r,a),u=s.setFilter,l=Jf(t,a),s.setFilter=function(t,e,r){l={filterMissing:t,filterMin:e,filterMax:r},n&&u(t,e,r)},p=Nf(c,s)),p(d?d.missing:h?h.missing:0,l),c.classList.toggle(qn("missing"),!h),h&&i.render(c,h,d)}}));e&&(c.classList.add(Kn("loading")),e.then((function(){c.classList.remove(Kn("loading"))})))},h=t.findMyRanker();return h&&h.on(Zn.EVENT_ORDER_CHANGED+".numberFilter",(function(){return f()})),f(),{cleanUp:function(){h&&h.on(Zn.EVENT_ORDER_CHANGED+".numberFilter",null)},reset:function(){l=Jf(t,a,{min:-1/0,max:1/0,filterMissing:!1}),f()},submit:function(){u(l.filterMissing,l.filterMin,l.filterMax)}}}function $f(t){var e=t.getFormatter(),r=mc(t);return{template:yf(10),render:function(t,n,i){return vf(t,n,i||null,e,(function(){return r}))},guessedBins:10}}function Jf(t,e,r){void 0===r&&(r=t.getFilter());var n=isFinite(r.min)?r.min:e[0],i=isFinite(r.max)?r.max:e[1];return{filterMissing:r.filterMissing,filterMin:n,filterMax:i}}function Qf(t,e,r){return{percent:function(t){return function(t){return Math.max(0,Math.min(100,t))}(Math.round(100*(t-r[0])/(r[1]-r[0])))},unpercent:function(t){return t/100*(r[1]-r[0])+r[0]},domain:r,format:function(e){return isNaN(e)?"":t.getFormatter()(new Date(e))},formatRaw:String,parseRaw:function(t){return Number.parseInt(t,10)},setFilter:function(e,n,i){return t.setFilter({filterMissing:e,min:Math.abs(n-r[0])<.001?Number.NEGATIVE_INFINITY:Xs(n,"min"),max:Math.abs(i-r[1])<.001?Number.POSITIVE_INFINITY:Xs(i,"max")})},edit:function(t,r,n){return new Promise((function(i){var o={attachment:r,manager:e.dialogManager,level:e.dialogManager.maxLevel+1,idPrefix:e.idPrefix};new qf(o,(function(t){return i(null==t?NaN:Xs(t.getTime(),n))}),{value:isNaN(t)?null:new Date(t)}).open()}))}}}var Zf=new Vc,th={actions:new yc,aggregate:new Nc,annotate:new Lc,boolean:new Ic,boxplot:new Hc,brightness:new Uc,catdistributionbar:new qc,categorical:new Bc,circle:new $c,date:new zf,default:Zf,dot:new Jc,group:new Zc,heatmap:new ep,catheatmap:new zc,histogram:new _f,datehistogram:new Kf,image:new Af,interleaving:new Lf,link:new Of,linkMap:new kf,loading:new Gf,nested:new Mf(!1),number:new Oc,mapbars:new Hf,rank:new Pf,selection:new Ff,set:new Uf,sparkline:new jf,stack:new Mf,string:new Mc,table:new Vf,upset:new Yf,verticalbar:new Wf};var eh={schemeCategory10:It,schemeAccent:kt,schemeDark2:Gt,schemePastel1:Ht,schemePastel2:Pt,schemeSet1:Ft,schemeSet2:Ut,schemeSet3:Bt},rh=function(t){function e(e,r){var n=t.call(this,r,{livePreview:"colorMapping"})||this;return n.column=e,n.before=e.getColorMapping().clone(),n}return i(e,t),e.prototype.build=function(t){var e=this,r=hc(this.dialog.idPrefix),n=this.column.getColorMapping();t.insertAdjacentHTML("beforeend",'<div class="'+qn("dialog-table")+'">\n      <div class="'+qn("dialog-color-table-entry")+'">\n        <select id="'+r+'Chooser">\n          <option value="">Apply Color Scheme...</option>\n          <option value="schemeCategory10">D3 Category 10 ('+It.length+')</option>\n          <option value="schemeSet1">Set 1 ('+Ft.length+')</option>\n          <option value="schemeSet2">Set 2 ('+Ut.length+')</option>\n          <option value="schemeSet3">Set 3 ('+Bt.length+')</option>\n          <option value="schemeAccent">Accent ('+kt.length+')</option>\n          <option value="schemeDark2">Dark2 ('+Gt.length+')</option>\n          <option value="schemePastel1">Pastel 1 ('+Ht.length+')</option>\n          <option value="schemePastel2">Pastel 2 ('+Pt.length+")</option>\n        </select>\n      </div>\n      "+this.column.categories.map((function(t){return'\n        <label class="'+qn("checkbox")+" "+qn("dialog-color-table-entry")+'">\n          <input data-cat="'+t.name+'" type="color" value="'+ie(n.apply(t)).hex()+'">\n          <span>'+t.label+"</span>\n        </label>"})).join("")+"\n    </div>"),this.findInput("select").onchange=function(t){var r=eh[t.currentTarget.value];r&&(e.forEach("[data-cat]",(function(t,e){t.value=r[e%r.length]})),e.showLivePreviews()&&e.submit())},this.enableLivePreviews("input[type=color]")},e.prototype.reset=function(){var t=this.column.categories;this.forEach("[data-cat]",(function(e,r){e.value=ie(t[r].color).hex()}))},e.prototype.submit=function(){var t=this.column.categories,e=new Map;return this.forEach("input[data-cat]",(function(r,n){var i=t[n];ie(i.color).hex()!==r.value&&e.set(i,r.value)})),0===e.size?this.column.setColorMapping(gn):this.column.setColorMapping(new mn(e)),!0},e.prototype.cancel=function(){this.column.setColorMapping(this.before)},e}(ff),nh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"filter"})||this;return i.column=e,i.ctx=n,i.before=i.column.getFilter()||{filter:"",filterMissing:!1},i}return i(e,t),e.prototype.build=function(t){var e=this;t.insertAdjacentHTML("beforeend",'<div class="'+qn("dialog-table")+'">\n        <label class="'+qn("checkbox")+" "+qn("dialog-filter-table-entry")+'">\n          <input type="checkbox" checked>\n          <span>\n            <span class="'+qn("dialog-filter-table-color")+'"></span>\n            <div>Un/Select All</div>\n          </span>\n        </label>\n        '+this.column.categories.map((function(t){return'<label class="'+qn("checkbox")+" "+qn("dialog-filter-table-entry")+'">\n          <input data-cat="'+t.name+'" type="checkbox"'+(Sn(e.before,t)?"checked":"")+'>\n          <span>\n            <span class="'+qn("dialog-filter-table-color")+'" style="background-color: '+t.color+'"></span>\n            <div class="'+qn("dialog-filter-table-entry-label")+'">'+t.label+'</div>\n            <div class="'+qn("dialog-filter-table-entry-stats")+'"></div>\n          </span>\n        </label>'})).join("")+"\n    </div>");var r=this.findInput("input:not([data-cat])");if(r.onchange=function(){oc(t,"input[data-cat]",(function(t){return t.checked=r.checked}))},this.column instanceof Ln){var n="every"!==this.before.mode;t.insertAdjacentHTML("beforeend","<strong>Show rows where</strong>"),t.insertAdjacentHTML("beforeend",'<label class="'+qn("checkbox")+'">\n        <input type="radio" '+(n?"":'checked="checked"')+' name="mode" value="every">\n        <span>all are selected</span>\n      </label>'),t.insertAdjacentHTML("beforeend",'<label class="'+qn("checkbox")+'" style="padding-bottom: 0.6em">\n        <input type="radio" '+(n?'checked="checked"':"")+' name="mode" value="some">\n        <span>some are selected</span>\n      </label>')}t.insertAdjacentHTML("beforeend",Tc(this.before.filterMissing,0)),this.enableLivePreviews("input[type=checkbox],input[type=radio]");var i=this.column.findMyRanker();i&&i.on(Zn.EVENT_ORDER_CHANGED+".catFilter",(function(){return e.updateStats()})),this.updateStats()},e.prototype.updateStats=function(){var t=this,e=this.ctx.provider.getTaskExecutor().summaryCategoricalStats(this.column).then((function(e){if("symbol"!=typeof e){var r=e.summary,n=e.data,i=n?n.missing:r?r.missing:0;Rc(wc(t.node).parentElement,i),r&&n&&t.forEach("."+qn("dialog-filter-table-entry-stats"),(function(t,e){var i=r.hist[e],o=n.hist[e];t.textContent=i.count+"/"+o.count}))}}));e&&(this.node.classList.add(Kn("loading")),e.then((function(){t.node.classList.remove(Kn("loading"))})))},e.prototype.updateFilter=function(t,e,r){void 0===r&&(r=!1);var n=null==t&&!1===e,i={filter:t,filterMissing:e};this.column instanceof Ln&&(i.mode=r?"some":"every"),this.column.setFilter(n?null:i)},e.prototype.reset=function(){this.forEach("input[data-cat]",(function(t){return t.checked=!0})),wc(this.node).checked=!1;var t=this.findInput("input[value=every]");t&&(t.checked=!0)},e.prototype.cancel=function(){this.updateFilter(""===this.before.filter?null:this.before.filter,this.before.filterMissing,"some"===this.before.mode)},e.prototype.submit=function(){var t=this.forEach("input[data-cat]:checked",(function(t){return t.dataset.cat}));t.length===this.column.categories.length&&(t=null);var e=wc(this.node).checked,r=this.findInput("input[value=some]");return this.updateFilter(t,e,null!=r&&r.checked),!0},e.prototype.cleanUp=function(e){t.prototype.cleanUp.call(this,e);var r=this.column.findMyRanker();r&&r.on(Zn.EVENT_ORDER_CHANGED+".catFilter",null)},e}(ff),ih=function(t){function e(e,r){var n=t.call(this,r,{livePreview:"filter"})||this;return n.column=e,n.before=n.column.getFilter()||{filter:n.column.categories.map((function(t){return t.name})),filterMissing:!1},n}return i(e,t),e.prototype.build=function(t){var e=this,r=this.column.categories.map((function(t){return Object.assign({range:O(100*t.value,2)},t)}));r.sort((function(t,e){return t.label.localeCompare(e.label)})),t.insertAdjacentHTML("beforeend",'<div class="'+qn("dialog-table")+'">\n        <label class="'+qn("checkbox")+" "+qn("dialog-filter-table-entry")+'">\n          <input type="checkbox" checked>\n          <span>\n            <div>Un/Select All</div>\n          </span>\n        </label>\n        '+r.map((function(t){return'\n          <label class="'+qn("checkbox")+" "+qn("dialog-filter-table-entry")+'">\n            <input data-cat="'+t.name+'" type="checkbox"'+(Sn(e.before,t)?"checked":"")+'>\n            <span>\n              <input type="number" value="'+t.range+'" min="0" max="100" size="5">\n              <div class="'+qn("dialog-filter-color-bar")+'">\n                <span style="background-color: '+t.color+"; width: "+t.range+'%"></span>\n              </div>\n              <div>'+t.label+"</div>\n            </span>\n          </label>"})).join("")+"\n    </div>");var n=this.findInput("input[type=checkbox]:not([data-cat])");n.onchange=function(){oc(t,"[data-cat]",(function(t){return t.checked=n.checked}))},this.forEach("input[type=number]",(function(t){t.oninput=function(){t.nextElementSibling.firstElementChild.style.width=t.value+"%"}})),t.insertAdjacentHTML("beforeend",_c(this.before.filterMissing)),this.enableLivePreviews("input[type=checkbox], input[type=number]")},e.prototype.updateFilter=function(t,e){var r=null==t&&!1===e;this.column.setFilter(r?null:{filter:t,filterMissing:e})},e.prototype.cancel=function(){this.updateFilter(this.before.filter,this.before.filterMissing)},e.prototype.reset=function(){this.forEach("[data-cat]",(function(t){t.checked=!1,t.nextElementSibling.value="50"}))},e.prototype.submit=function(){var t=this.forEach("input[data-cat]",(function(t){return{checked:t.checked,cat:t.dataset.cat,range:t.nextElementSibling.valueAsNumber}})),e=t.filter((function(t){return t.checked})).map((function(t){return t.cat}));e.length===this.column.categories.length&&(e=null);var r=wc(this.node).checked;return this.updateFilter(e,r),this.column.setMapping(t.map((function(t){return t.range/100}))),!0},e}(ff),oh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"vis"})||this;return i.column=e,i.ctx=n,i.before={renderer:e.getRenderer(),group:e.getGroupRenderer(),summary:e.getSummaryRenderer()},i}return i(e,t),e.prototype.build=function(t){var e=this.column.getRenderer(),r=this.column.getGroupRenderer(),n=this.column.getSummaryRenderer(),i=this.ctx.getPossibleRenderer(this.column),o=i.item,a=i.group,s=i.summary;console.assert(o.length>1||a.length>1||s.length>1);var u=function(t,e){return t.label.localeCompare(e.label)};t.insertAdjacentHTML("beforeend","\n      <strong>Item Visualization</strong>\n      "+o.sort(u).map((function(t){return' <label class="'+qn("checkbox")+'"><input type="radio" name="renderer" value="'+t.type+'" '+(e===t.type?"checked":"")+"><span>"+t.label+"</span></label>"})).join("")+"\n      <strong>Group Visualization</strong>\n      "+a.sort(u).map((function(t){return' <label class="'+qn("checkbox")+'"><input type="radio" name="group" value="'+t.type+'" '+(r===t.type?"checked":"")+"><span>"+t.label+"</span></label>"})).join("")+"\n      <strong>Summary Visualization</strong>\n      "+s.sort(u).map((function(t){return' <label class="'+qn("checkbox")+'"><input type="radio" name="summary" value="'+t.type+'" '+(n===t.type?"checked":"")+"><span>"+t.label+"</span></label>"})).join("")+"\n    "),this.enableLivePreviews("input[type=radio]")},e.prototype.cancel=function(){this.column.setRenderer(this.before.renderer),this.column.setGroupRenderer(this.before.group),this.column.setSummaryRenderer(this.before.summary)},e.prototype.reset=function(){var t=this.column.desc,e=this.findInput('input[name=renderer][value="'+(t.renderer||t.type)+'"]');e&&(e.checked=!0);var r=this.findInput('input[name=group][value="'+(t.groupRenderer||t.type)+'"]');r&&(r.checked=!0);var n=this.findInput('input[name=summary][value="'+(t.summaryRenderer||t.type)+'"]');n&&(n.checked=!0)},e.prototype.submit=function(){var t=this.findInput("input[name=renderer]:checked").value,e=this.findInput("input[name=group]:checked").value,r=this.findInput("input[name=summary]:checked").value;return this.column.setRenderer(t),this.column.setGroupRenderer(e),this.column.setSummaryRenderer(r),!0},e}(ff),ah=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"colorMapping"})||this;return i.column=e,i.ctx=n,i.id=hc("col"),i.before=i.column.getColorMapping(),i}return i(e,t),e.prototype.createTemplate=function(t,e){var r=e instanceof gu?e.base:e,n=r instanceof mu?r.entries:[],i="";i+='<datalist id="'+t+'L">'+It.map((function(t){return"<option>"+t+'"</option>'})).join("")+"</datalist>",i+='<datalist id="'+t+'LW"><option>#FFFFFF"</option>'+It.slice(0,-1).map((function(t){return"<option>"+t+"</option>"})).join("")+"</datalist>",i+='<strong data-toggle="'+(r instanceof du?"open":"")+'">Solid Color</strong>',i+="<div>";var o=r instanceof du?r.color:"",a="#C1C1C1"===o,s=function(t){return'<label class="'+qn("checkbox-color")+'">\n        <input name="color" type="radio" value="'+t+'" '+(t===o?'checked="checked"':"")+'>\n        <span style="background: '+t+'"></span>\n      </label>'};[It,kt,Gt,Ht,Pt,Ft,Ut,Bt].forEach((function(t,e){a=a||t.includes(o),i+='<div class="'+qn("color-line")+'">\n          '+t.map(s).join("")+"\n          "+(0===e?s("#C1C1C1"):"")+"\n        </div>"})),i+='<label class="'+qn("checkbox")+" "+qn("color-gradient")+'"><input name="color" type="radio" value="custom:solid" '+(o&&!a?'checked="checked"':"")+'>\n        <span class="'+qn("color-custom")+'"><input type="color" name="solid" list="'+t+'L" value="'+(r instanceof du?r.color:"#C1C1C1")+'" '+(o&&!a?"":"disabled")+"></span>\n      </label>",i+="</div>",i+='<strong data-toggle="'+(r instanceof pu||r instanceof mu&&2===n.length?"open":"")+'">Sequential Color</strong>',i+="<div>",i+='<div><label class="'+qn("checkbox")+'">\n      <input name="kindS" type="radio" id="'+t+'KC_S" value="continuous" '+(e instanceof gu?"":"checked")+'>\n      <span>Continuous</span>\n    </label>\n    <label class="'+qn("checkbox")+'">\n      <input name="kindS" type="radio" id="'+t+'KQ_S" value="quantized" '+(e instanceof gu?"checked":"")+'>\n      <span>Discrete&nbsp;<input type="number" id="'+t+'KQS_S" min="2" step="1" style="width: 3em" value="'+(e instanceof gu?e.steps+'"':'5" disabled')+">&nbsp; steps</span>\n    </label></div>";for(var u=r instanceof pu?r.name:"",l=0,c=Object.keys(pu.FUNCTIONS);l<c.length;l++){var p=c[l];i+='<label class="'+qn("checkbox")+" "+qn("color-gradient")+'"><input name="color" type="radio" value="'+p+'" '+(p===u?'checked="checked"':"")+'>\n        <span data-c="'+p+'" style="background: '+sh(pu.FUNCTIONS[p],9)+'"></span>\n      </label>'}var f=2===n.length;i+='<label class="'+qn("checkbox")+" "+qn("color-gradient")+'">\n        <input name="color" type="radio" value="custom:sequential" '+(f?"checked":"")+'>\n        <span class="'+qn("color-custom")+'">\n          <input type="color" name="interpolate0" list="'+t+'LW" '+(f?'value="'+n[0].color+'"':"disabled")+'>\n          <input type="color" name="interpolate1" list="'+t+'LW" '+(f?'value="'+n[n.length-1].color+'"':"disabled")+">\n        </span>\n      </label>",i+="</div>",i+='<strong data-toggle="'+(r instanceof fu||r instanceof mu&&3===n.length?"open":"")+'">Diverging Color</strong>',i+="<div>",i+='<div><label class="'+qn("checkbox")+'">\n      <input name="kindD" type="radio" id="'+t+'KC_D" value="continuous" '+(e instanceof gu?"":"checked")+'>\n      <span>Continuous</span>\n    </label>\n    <label class="'+qn("checkbox")+'">\n      <input name="kindD" type="radio" id="'+t+'KQ_D" value="quantized" '+(e instanceof gu?"checked":"")+'>\n      <span>Discrete&nbsp;<input type="number" id="'+t+'KQS_D" min="2" step="1" style="width: 3em" value="'+(e instanceof gu?e.steps+'"':'5" disabled')+">&nbsp; steps</span>\n    </label></div>";u=r instanceof fu?r.name:"";for(var h=0,d=Object.keys(fu.FUNCTIONS);h<d.length;h++){p=d[h];i+='<label class="'+qn("checkbox")+" "+qn("color-gradient")+'"><input name="color" type="radio" value="'+p+'" '+(p===u?'checked="checked"':"")+'>\n        <span data-c="'+p+'" style="background: '+sh(fu.FUNCTIONS[p],11)+'"></span>\n      </label>'}f=3===n.length;return i+='<label class="'+qn("checkbox")+" "+qn("color-gradient")+'">\n        <input name="color" type="radio" value="custom:divergent" '+(f?"checked":"")+'>\n        <span class="'+qn("color-custom")+'">\n          <input type="color" name="divergingm1" list="'+t+'L" '+(f?'value="'+n[0].color+'"':"disabled")+'>\n          <input type="color" name="diverging0" list="'+t+'LW" '+(f?'value="'+n[1].color+'"':"disabled")+'>\n          <input type="color" name="diverging1" list="'+t+'L" '+(f?'value="'+n[2].color+'"':"disabled")+">\n        </span>\n      </label>",i+="</div>"},e.prototype.applyColor=function(){var t=this.findInput("input[name=color]:checked");if(t){var e=this.findInput("#"+this.id+"KQ_S"),r=this.findInput("#"+this.id+"KQS_S"),n=function(t,e){switch(t.value){case"custom:solid":return new du(e.querySelector("input[name=solid]").value);case"custom:sequential":var r=e.querySelector("input[name=interpolate0]").value,n=e.querySelector("input[name=interpolate1]").value;return new mu([{color:r,value:0},{color:n,value:1}]);case"custom:diverging":var i=e.querySelector("input[name=divergentm1]").value,o=e.querySelector("input[name=divergent0]").value,a=e.querySelector("input[name=divergent1]").value;return new mu([{color:i,value:0},{color:o,value:.5},{color:a,value:1}])}if(t.value in pu.FUNCTIONS)return new pu(t.value);if(t.value in fu.FUNCTIONS)return new fu(t.value);return new du(t.value)}(t,this.node);!e.checked||n instanceof du?this.column.setColorMapping(n):this.column.setColorMapping(new gu(n,Number.parseInt(r.value,10)))}},e.prototype.build=function(t){var e=t.ownerDocument.createElement("div");e.classList.add(qn("dialog-color")),t.appendChild(e),this.render(e,this.column.getColorMapping())},e.prototype.render=function(t,e){var r=this,n=this.id;t.innerHTML=this.createTemplate(n,e);for(var i=Array.from(t.querySelectorAll("strong[data-toggle]")),o=function(t){t.onclick=function(e){e.preventDefault(),e.stopPropagation();for(var r=0,n=i;r<n.length;r++){var o=n[r];o.dataset.toggle="open"===o.dataset.toggle||t!==o?"":"open"}}},a=0,s=i;a<s.length;a++){o(s[a])}var u=[],l=function(t){if(t.checked){for(var e=function(e){Array.from(e.nextElementSibling.getElementsByTagName("input")).forEach((function(r){return r.disabled=e!==t}))},n=0,i=u;n<i.length;n++){e(i[n])}r.showLivePreviews()&&r.applyColor()}},c=function(){var t=r.findInput("input[name=color]:checked");t&&l(t)};this.forEach("input[name=color]",(function(t){t.value.startsWith("custom:")&&u.push(t),t.onchange=function(){return l(t)}})),this.forEach("."+qn("color-custom")+" input[type=color]",(function(t){t.onchange=function(){var e=t.parentElement.previousElementSibling;l(e)}}));var p=this.findInput("#"+n+"KC_S"),f=this.findInput("#"+n+"KQ_S"),h=this.findInput("#"+n+"KQS_S"),d=this.findInput("#"+n+"KC_D"),g=this.findInput("#"+n+"KQ_D"),m=this.findInput("#"+n+"KQS_D");p.onchange=d.onchange=function(t){p.checked=d.checked=t.currentTarget.checked,h.disabled=m.disabled=!f.checked,p.checked&&(r.updateGradients(-1),c())},h.onchange=m.onchange=function(t){h.value=m.value=t.currentTarget.value,r.updateGradients(Number.parseInt(h.value,10)),c()},f.onchange=g.onchange=function(t){f.checked=g.checked=t.currentTarget.checked,h.disabled=m.disabled=!f.checked,f.checked&&(r.updateGradients(Number.parseInt(h.value,10)),c())}},e.prototype.reset=function(){var t=this.column.desc,e=this.ctx.provider.getTypeFactory().colorMappingFunction(t.colorMapping||t.color);this.render(this.node.querySelector("."+qn("dialog-color")),e)},e.prototype.submit=function(){return this.applyColor(),!0},e.prototype.cancel=function(){this.column.setColorMapping(this.before)},e.prototype.updateGradients=function(t){this.forEach("span[data-c]",(function(e){var r=e.dataset.c,n=pu.FUNCTIONS[r];if(n)e.style.background=t<0?sh(n,9):uh(n,t);else{var i=fu.FUNCTIONS[r];i&&(e.style.background=t<0?sh(i,11):uh(i,t))}}))},e}(ff);function sh(t,e){if(void 0===e&&(e=2),e<=1)return""+t(0);for(var r=1/(e-1),n="linear-gradient(to right",i=0;i<e;++i)n+=", "+t(i*r)+" "+O(i*r*100,2)+"%";return n+=")"}function uh(t,e){if(void 0===e&&(e=2),1===e)return""+t(0);for(var r="linear-gradient(to right",n=1/e,i=n/2,o=0;o<e;++o){var a=t(o*n+(0===o?0:o===e-1?n:i));r+=", "+a+" "+O(o*n*100,2)+"%, "+a+" "+O((o+1)*n*100,2)+"%"}return r+=")"}function lh(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=t.dataTransfer.types;return"function"==typeof n.indexOf?e.some((function(t){return n.indexOf(t)>=0})):"function"==typeof n.includes?e.some((function(t){return n.includes(t)})):"function"==typeof n.contains&&e.some((function(t){return n.contains(t)}))}var ch=new Map;function ph(t){return ch.size>0&&lh(t,"text/plain")}function fh(t){var e=t.dataTransfer;!function(t){var e=t.dataTransfer;return Boolean(t.ctrlKey&&e.effectAllowed.match(/copy/gi)||!e.effectAllowed.match(/move/gi))}(t)?e.dropEffect="move":e.dropEffect="copy"}var hh=0;function dh(t,e,r,n,i,o){void 0===n&&(n=null),void 0===i&&(i=!1),void 0===o&&(o=function(){return!0}),t.addEventListener("dragenter",(function(r){if(!t.classList.contains(qn("dragging"))&&(lh.apply(void 0,[r].concat(e))||ph(r))&&o())return t.classList.add(qn("dragover")),i&&r.stopPropagation(),!1;t.classList.remove(qn("dragover"))})),t.addEventListener("dragover",(function(r){if(!t.classList.contains(qn("dragging"))&&(lh.apply(void 0,[r].concat(e))||ph(r))&&o())return r.preventDefault(),fh(r),t.classList.add(qn("dragover")),i&&r.stopPropagation(),n&&n(r),!1})),t.addEventListener("dragleave",(function(t){t.target.classList.remove(qn("dragover"))})),t.addEventListener("drop",(function(n){n.preventDefault(),i&&n.stopPropagation(),fh(n);var o=n.dataTransfer.dropEffect;if(t.classList.remove(qn("dragover")),ph(n)){var a=n.dataTransfer.getData("text/plain"),s=parseInt(a.indexOf(":")>=0?a.substring(0,a.indexOf(":")):a,10);if(ch.has(s)){var u=ch.get(s);return ch.delete(s),!r({effect:o,data:u},n)}}else if(lh.apply(void 0,[n].concat(e))){var l={};return e.forEach((function(t){var e=n.dataTransfer.getData(t);""!==e&&(l[t]=e)})),!r({effect:o,data:l},n)}}))}var gh=function(t){function e(e,r,n,i){var o=t.call(this,r,{autoClose:!0})||this;return o.column=e,o.mode=n,o.ctx=i,o}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("more-options")),t.dataset.colId=this.column.id,function(t,e,r,n,i){var o=Eh(t,r,n,e,!0,i);pd(r,n).filter((function(t){return!Ch(r,t,i,"shortcut")})).forEach(o)}(t,this.dialog.level+1,this.column,this.ctx,this.mode),vh(t,this.column)},e}(hf);function mh(t,e,r){void 0===r&&(r={}),r=Object.assign({dragAble:!0,mergeDropAble:!0,rearrangeAble:!0,resizeable:!0,level:0,extraPrefix:""},r);var n=e.document.createElement("section"),i=r.extraPrefix?function(t){return qn(t)+" "+qn(r.extraPrefix+"-"+t)}:qn,o=t.getMetaData().summary;return n.innerHTML='\n    <div class="'+i("label")+" "+qn("typed-icon")+'">'+(t.getWidth()<30?"&nbsp;":t.label)+'</div>\n    <div class="'+i("sublabel")+'">'+(t.getWidth()<30||!o?"&nbsp;":o)+'</div>\n    <div class="'+i("toolbar")+'"></div>\n    <div class="'+i("spacing")+'"></div>\n    <div class="'+i("handle")+" "+qn("feature-advanced")+" "+qn("feature-ui")+'"></div>\n  ',Nh(n.getElementsByClassName(qn("toolbar"))[0],r.level,t,e,"header"),_h(n,t),r.dragAble&&wh(n,t,e),r.mergeDropAble&&function(t,e,r){var n=function(t){var n=t.data,i="copy"===t.effect,o=Th,a=Object.keys(n).find((function(t){return t.startsWith(o)&&t.endsWith("-ref")}));if(a){var s=n[a],u=r.provider.find(s);if(i)u=r.provider.clone(u);else{if(u===e)return null;u.removeMe()}return u}var l=Object.keys(n).find((function(t){return t.startsWith(o)}));if(!l)return null;var c=JSON.parse(l);return r.provider.create(r.provider.fromDescRef(c))},i=function(t){var r=n(t);return null!=r&&null!=e.push(r)},o=function(t,n){if(null==t)return!1;var i=e.findMyRanker(),o=i.indexOf(e),a=r.provider.create(n);return e.removeMe(),a.push(e),a.push(t),null!=i.insert(a,o)},a=function(t){return function(e){var r=n(e);return o(r,t)}},s=[Th+"-ref",Th],u=[Th+"-number-ref",Th+"-number"],l=[Th+"-categorical-ref",Th+"-categorical"],c=[Th+"-boxplot-ref",Th+"-boxplot"],p=[Th+"-numbers-ref",Th+"-numbers"];if(t.dataset.draginfo="+",e instanceof bu)return dh(t,l.concat(u),i,(function(e){lh.apply(void 0,[e].concat(l))?t.dataset.draginfo="Color by":lh.apply(void 0,[e].concat(u))&&(t.dataset.draginfo="Wrap")}),!1,(function(){return e.children.length<2}));if(e instanceof Nu)return dh(t,l.concat(c),i,(function(e){lh.apply(void 0,[e].concat(l))?t.dataset.draginfo="Color by":lh.apply(void 0,[e].concat(c))&&(t.dataset.draginfo="Wrap")}),!1,(function(){return e.children.length<2}));if(e instanceof Tu)return dh(t,l.concat(p),i,(function(e){lh.apply(void 0,[e].concat(l))?t.dataset.draginfo="Color by":lh.apply(void 0,[e].concat(p))&&(t.dataset.draginfo="Wrap")}),!1,(function(){return e.children.length<2}));if(ct(e))return dh(t,e.canJustAddNumbers?u:s,i);if(e instanceof Ot)return dh(t,e.canJustAddNumbers?u:s,i);if(Lt(e))return t.dataset.draginfo="Color by",dh(t,l,a(_u()));if(Mt(e))return t.dataset.draginfo="Color by",dh(t,l,a(Cu()));if(St(e))return t.dataset.draginfo="Merge",dh(t,l.concat(u),(function(t,e){var r=n(t);return null!=r&&(ql(r)?o(r,vu()):!!St(r)&&o(r,e.shiftKey?Ru():Du()))}),(function(e){lh.apply(void 0,[e].concat(l))?t.dataset.draginfo="Color by":lh.apply(void 0,[e].concat(u))&&(t.dataset.draginfo=e.shiftKey?"Min/Max":"Sum")}));t.dataset.draginfo="Group",dh(t,s,a(Lu()))}(n,t,e),r.rearrangeAble&&function(t,e,r){dh(t,[Th+"-ref",Th],(function(t){var n=null,i=t.data;if(!(Th+"-ref"in i)){var o=JSON.parse(i[Th]);return null!=(n=r.provider.create(r.provider.fromDescRef(o)))&&null!=e.insertAfterMe(n)}var a=i[Th+"-ref"];if(!(n=r.provider.find(a))||n===e&&!t.effect.startsWith("copy"))return!1;if(t.effect.startsWith("copy"))return null!=(n=r.provider.clone(n))&&null!=e.insertAfterMe(n);var s=n.parent;return s?s===e.parent?null!=s.moveAfter(n,e):(n.removeMe(),null!=e.insertAfterMe(n)):null!=e.insertAfterMe(n)}),null,!0)}(n.getElementsByClassName(qn("handle"))[0],t,e),r.resizeable&&function(t,e){var r,n,i="",o=e.getElementsByClassName(qn("handle"))[0],a=0,s=0,u=function(r){r.stopPropagation(),r.preventDefault();var o=r.clientX,u=o-a;if(!(Math.abs(a-o)<2)){a=o;var l=Math.max(0,t.getWidth()+u);n.classList.toggle(qn("resize-animated"),l<s),n.style.transform=i+" translate("+(l-s-Yn)+"px, 0px)",e.style.width=l+"px",t.setWidth(l),_h(e,t)}},l=function(i){i.stopPropagation(),i.preventDefault();var o=i.clientX;if(e.classList.remove(qn("change-width")),r.removeEventListener("mousemove",u),r.removeEventListener("mouseup",l),r.removeEventListener("mouseleave",l),r.classList.remove(qn("resizing")),e.style.width=null,setTimeout((function(){n.classList.remove(qn("resizing"),qn("resize-animated"))}),1.2*Wn),!(Math.abs(a-o)<2)){var s=o-a,c=Math.max(0,t.getWidth()+s);t.setWidth(c),_h(e,t)}};o.onmousedown=function(o){o.stopPropagation(),o.preventDefault(),e.classList.add(qn("change-width")),s=t.getWidth(),a=o.clientX,(r=e.closest("body")||e.closest("."+qn())).addEventListener("mousemove",u),r.addEventListener("mouseup",l),r.addEventListener("mouseleave",l),r.classList.add(qn("resizing")),n=e.closest("."+Kn()).querySelector("."+qn("resize-helper")),i=n.previousElementSibling.style.transform,n.style.transform=i+" translate("+-Yn+"px, 0px)",n.classList.add(qn("resizing"))},o.onclick=function(t){t.stopPropagation(),t.preventDefault()}}(t,n),n}function yh(t,e,r){void 0===r&&(r=30);var n=t.getElementsByClassName(qn("label"))[0];n.innerHTML=e.getWidth()<r?"&nbsp;":e.label;var i=e.getMetaData().summary,o=t.getElementsByClassName(qn("sublabel"))[0];o&&(o.innerHTML=e.getWidth()<r||!i?"&nbsp;":i);var a=e.label;i&&(a=a+"\n"+i),e.description&&(a=a+"\n"+e.description),t.title=a,t.dataset.colId=e.id,t.dataset.type=e.desc.type,n.dataset.typeCat=Rt(e).name,vh(t,e),function(t,e){var r=t.closest("."+qn());if(!r)return;var n=r.querySelector("."+qn("more-options")+'[data-col-id="'+e.id+'"]');if(!n)return;vh(n,e)}(t,e)}function vh(t,e){var r=t.getElementsByClassName(qn("action-sort"))[0];if(r){var n=e.isSortedByMe(),i=n.asc,o=n.priority;r.dataset.sort=void 0!==i?i:"",r.dataset.type=Nt(e),void 0!==o?r.dataset.priority=(o+1).toString():delete r.dataset.priority}var a=t.getElementsByClassName(qn("action-sort-groups"))[0];if(a){var s=e.isGroupSortedByMe();i=s.asc,o=s.priority;a.dataset.sort=void 0!==i?i:"",a.dataset.type=Nt(e),void 0!==o?a.dataset.priority=(o+1).toString():delete a.dataset.priority}var u=t.getElementsByClassName(qn("action-group"))[0];if(u){var l=e.isGroupedBy();u.dataset.group=l>=0?"true":"false",l>=0?u.dataset.priority=(l+1).toString():delete u.dataset.priority}var c=t.getElementsByClassName(qn("action-filter"))[0];c&&(e.isFiltered()?c.dataset.active="":delete c.dataset.active)}function bh(t){t.endsWith("&hellip;")&&(t=t.slice(0,-"&hellip;".length-1)),t.endsWith("By")&&(t=t.slice(0,-3));var e=t.toLowerCase().replace(/[ +-]/gm,"-");return qn("action")+" "+qn("action-"+e)}function Eh(t,e,r,n,i,o){return function(a){var s=Ch(e,a,o,"shortcut")?"o":Ch(e,a,o,"menu+shortcut")?"s":"r";t.insertAdjacentHTML("beforeend",'<i data-a="'+s+'" title="'+a.title+'" class="'+bh(a.title.toString())+" "+qn("feature-"+(a.options.featureLevel||"basic"))+" "+qn("feature-"+(a.options.featureCategory||"others"))+'"><span'+(i?"":' class="'+qn("aria")+'" aria-hidden="true"')+">"+a.title+"</span> </i>");var u=t.lastElementChild;return u.onclick=function(t){t.stopPropagation(),r.dialogManager.setHighlightColumn(e),a.onClick(e,t,r,n,!i)},u}}function Ch(t,e,r,n){var i=void 0===e.options.mode?"menu":e.options.mode;return i===n||"function"==typeof i&&i(t,r)===n}function Nh(t,e,r,n,i,o){void 0===o&&(o=!0);var a=Eh(t,r,n,e,!1,i),s=pd(r,n),u=s.filter((function(t){return!Ch(r,t,i,"menu")})),l=u.reduce((function(t,e){return t+(Ch(r,e,i,"menu+shortcut")?1:0)}),0);u.forEach(a);var c=s.length-u.length+l;u.length===s.length||c===l&&!o||(t.insertAdjacentHTML("beforeend",'<i data-a="m" data-m="'+c+'" title="More &hellip;" class="'+bh("More")+'">'+Xn("More &hellip;")+"</i>"),t.lastElementChild.onclick=function(t){t.stopPropagation(),n.dialogManager.setHighlightColumn(r),new gh(r,pf(n,e,t),i,n).open()})}function _h(t,e,r){void 0===r&&(r=22.5),function(t,e,r){var n=t.getElementsByClassName(qn("label"))[0];if(e.getWidth()<30)n.classList.remove("."+qn("rotated"));else{var i=n.clientWidth<=0?e.label.length*r/3*.6>e.getWidth():.6*n.scrollWidth>n.clientWidth;n.classList.toggle("."+qn("rotated"),i)}}(t,e,r);var n=t.getElementsByClassName(qn("toolbar"))[0];if(0!==n.childElementCount){for(var i=e.getWidth(),o=Array.from(n.children).map((function(t){return{node:t,width:t.clientWidth>0?t.clientWidth:r}})),a=o.filter((function(t){return"o"===t.node.dataset.a})),s=o.filter((function(t){return"s"===t.node.dataset.a})),u=o.find((function(t){return"m"===t.node.dataset.a})),l=(u?parseInt(u.node.dataset.m,10):0)>s.length,c=o.reduce((function(t,e){return t+e.width}),0),p=0,f=o;p<f.length;p++){(g=f[p]).node.classList.remove(qn("hidden"))}if(!(c<i))if(u&&!l&&c-u.width<i)u.node.classList.add(qn("hidden"));else for(var h=0,d=s.reverse().concat(a.reverse());h<d.length;h++){var g;if((g=d[h]).node.classList.add(qn("hidden")),(c-=g.width)<i)return}}}var Th="text/x-caleydo-lineup-column";function wh(t,e,r){!function(t,e,r){void 0===r&&(r=!1);var n=++hh;t.classList.add(qn("dragable")),t.draggable=!0,t.addEventListener("dragstart",(function(i){t.classList.add(qn("dragging"));var o=e();if(i.dataTransfer.effectAllowed=o.effectAllowed,r&&i.stopPropagation(),!Object.keys(o.data).every((function(t){try{return i.dataTransfer.setData(t,o.data[t]),!0}catch(t){return!1}}))){var a=o.data["text/plain"]||"";i.dataTransfer.setData("text/plain",n+(a?": "+a:"")),ch.set(n,o.data)}})),t.addEventListener("dragend",(function(e){t.classList.remove(qn("dragging")),r&&e.stopPropagation(),ch.size>0&&ch.delete(n);var i=t.ownerDocument.getElementsByClassName(qn("dragover"))[0];i&&i.classList.remove(qn("dragover"))}))}(t,(function(){var t,n=JSON.stringify(r.provider.toDescRef(e.desc)),i=((t={"text/plain":e.label})[Th+"-ref"]=e.id,t[Th]=n,t);return St(e)&&(i[Th+"-number"]=n,i[Th+"-number-ref"]=e.id),ql(e)&&(i[Th+"-categorical"]=n,i[Th+"-categorical-ref"]=e.id),Mt(e)&&(i[Th+"-boxplot"]=n,i[Th+"-boxplot-ref"]=e.id),jl(e)&&(i[Th+"-map"]=n,i[Th+"-map-ref"]=e.id),Yl(e)&&(i[Th+"-array"]=n,i[Th+"-array-ref"]=e.id),Lt(e)&&(i[Th+"-numbers"]=n,i[Th+"-numbers-ref"]=e.id),{effectAllowed:"copyMove",data:i}}),!0)}var Rh=function(t){function e(e,r,n){var i=t.call(this,r)||this;return i.column=e,i.ctx=n,i.id=".dialog"+Math.random().toString(36).slice(-8).substr(0,3),i}return i(e,t),e.prototype.cleanUp=function(e){t.prototype.cleanUp.call(this,e),this.column.on(it(this.id,Ot.EVENT_ADD_COLUMN,Ot.EVENT_REMOVE_COLUMN),null)},e.prototype.build=function(t){var e=this;t.classList.add(qn("dialog-sub-nested"));var r=function(){e.column.children.forEach((function(r){var n=mh(r,e.ctx,{mergeDropAble:!1,resizeable:!1,level:e.dialog.level+1,extraPrefix:"sub"});n.className=qn("header"),yh(n,r);var i=e.ctx.summaryRenderer(r,!1),o=e.ctx.asElement(i.template);o.dataset.renderer=r.getSummaryRenderer(),o.classList.add(qn("summary"),qn("renderer"),qn("th-summary"));var a=i.update(o);a&&(o.classList.add(Kn("loading")),a.then((function(){o.classList.remove(Kn("loading"))}))),n.appendChild(o),t.appendChild(n)}))};r(),this.column.on(it(this.id,Ot.EVENT_ADD_COLUMN,Ot.EVENT_REMOVE_COLUMN),ei((function(){t.parentElement?(K(t),r()):e.destroy()})))},e}(hf),Ah=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"cutOff"})||this;return i.column=e,i.idPrefix=n,i.innerNodes=uu(i.column.hierarchy),i.innerNodePaths=i.innerNodes.map((function(t){return t.path})),i.before=e.getCutOff(),i}return i(e,t),e.prototype.build=function(t){t.insertAdjacentHTML("beforeend",'\n        <input type="text" value="'+this.before.node.label+'" required="required" autofocus="autofocus" list="ui'+this.idPrefix+'lineupHierarchyList" placeholder="cut off node">\n        <input type="number" value="'+(isFinite(this.before.maxDepth)?this.before.maxDepth:"")+'" placeholder="max depth (&infin;)">\n        <datalist id="ui'+this.idPrefix+'lineupHierarchyList">'+this.innerNodes.map((function(t){return'<option value="'+t.path+'">'+t.label+"</option>"}))+"</datalist>");var e=this.innerNodePaths;this.findInput('input[type="text"]').addEventListener("change",(function(){var t=this.value;e.indexOf(t)<0?this.setCustomValidity("invalid node"):this.setCustomValidity("")}),{passive:!0}),this.enableLivePreviews("input[type=text],input[type=number]")},e.prototype.reset=function(){this.findInput('input[type="text"]').value=this.column.hierarchy.path,this.findInput('input[type="number"]').value=""},e.prototype.cancel=function(){this.column.setCutOff(this.before)},e.prototype.submit=function(){var t=this.findInput('input[type="text"]').value,e=this.innerNodePaths.indexOf(t),r=this.innerNodes[e],n=this.findInput('input[type="number"]').value,i=""===n?1/0:parseInt(n,10);return this.column.setCutOff({node:r,maxDepth:i}),!0},e}(ff),Dh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"filter",cancelSubDialogs:!0})||this;return i.column=e,i.ctx=n,i.handler=null,i.before=i.column.getFilter()||{min:-1/0,max:1/0,filterMissing:!1},i}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("dialog-mapper")),this.handler=Xf(this.column,t,{dialogManager:this.ctx.dialogManager,idPrefix:this.ctx.idPrefix,tasks:this.ctx.provider.getTaskExecutor()},this.showLivePreviews())},e.prototype.cleanUp=function(e){t.prototype.cleanUp.call(this,e),this.handler.cleanUp()},e.prototype.reset=function(){this.handler.reset()},e.prototype.submit=function(){return this.handler.submit(),!0},e.prototype.cancel=function(){this.column.setFilter(this.before)},e}(ff),Sh=function(t){function e(e,r,n){var i=t.call(this,r)||this;return i.column=e,i.idPrefix=n,i.before=i.column.getPattern(),i}return i(e,t),e.prototype.build=function(t){var e=this.column.patternTemplates;t.insertAdjacentHTML("beforeend",'<strong>Edit Pattern (access via ${value}, ${item})</strong><input\n        type="text"\n        size="30"\n        value="'+this.before+'"\n        required\n        autofocus\n        placeholder="pattern (access via ${value}, ${item})"\n        '+(e.length>0?'list="ui'+this.idPrefix+'lineupPatternList"':"")+"\n      >"),e.length>0&&t.insertAdjacentHTML("beforeend",'<datalist id="ui'+this.idPrefix+'lineupPatternList">'+e.map((function(t){return'<option value="'+t+'">'}))+"</datalist>"),this.enableLivePreviews("input")},e.prototype.cancel=function(){this.column.setPattern(this.before)},e.prototype.reset=function(){this.node.querySelector("input").value=""},e.prototype.submit=function(){var t=this.node.querySelector("input").value;return this.column.setPattern(t),!0},e}(ff);var Mh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"group"})||this;return i.column=e,i.ctx=n,i.handlers=[],i}return i(e,t),e.prototype.build=function(t){for(var e=0,r=fd(this.column,"group",this.ctx);e<r.length;e++){var n=r[e];this.node.insertAdjacentHTML("beforeend","<strong>"+n.title+"</strong>"),this.handlers.push(n.append(this.column,this.node,this.dialog,this.ctx))}this.handlers.push(function(t,e,r){var n=e.findMyRanker(),i=n.getGroupCriteria(),o=i.indexOf(e),a=o>=0;o<0&&(o=i.length);var s=hc(r);t.insertAdjacentHTML("afterbegin",'\n        <strong>Group By</strong>\n        <label class="'+qn("checkbox")+'"><input type="radio" name="grouped" value="true" '+(a?"checked":"")+' ><span>Enabled</span></label>\n        <label class="'+qn("checkbox")+'"><input type="radio" name="grouped" value="false" '+(a?"":"checked")+' ><span>Disabled</span></label>\n        <strong>Group Priority</strong>\n        <input type="number" id="'+s+'P" step="1" min="1" max="'+(i.length+1)+'" value="'+(o+1)+'">\n    ');var u=function(e){oc(t,"input:not([name=grouped]), select, textarea",(function(t){t.disabled=e}))};return u(!a),oc(t,"input[name=grouped]",(function(t){t.addEventListener("change",(function(){var e="true"===t.value;u(!e)}),{passive:!0})})),{elems:"input[name=grouped], #"+s+"P",submit:function(){var r="true"===t.querySelector("input[name=grouped]:checked").value,i=Number.parseInt(t.querySelector("#"+s+"P").value,10)-1;return n.groupBy(e,r?i:-1),!0},reset:function(){t.querySelector("input[name=grouped][value=false]").checked=!0,t.querySelector("#"+s+"P").value=(i.length+(a?0:1)).toString(),u(!0)},cancel:function(){n.groupBy(e,i.indexOf(e))}}}(t,this.column,this.dialog.idPrefix));for(var i=0,o=this.handlers;i<o.length;i++){var a=o[i];this.enableLivePreviews(a.elems)}},e.prototype.submit=function(){for(var t=0,e=this.handlers;t<e.length;t++){if(!1===e[t].submit())return!1}return!0},e.prototype.cancel=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].cancel()}},e.prototype.reset=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].reset()}},e}(ff);function Lh(t){return Math.max(Math.min(t,100),0)}var xh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"dataMapping"})||this;return i.line=e,i.adapter=n,i.dialog.attachment.classList.add(qn("mapping-line-selected")),i.before={domain:i.line.domain,range:i.line.range},i}return i(e,t),e.prototype.build=function(t){var e=this,r=this.adapter.domain();t.insertAdjacentHTML("beforeend",'\n        <button class="'+qn("dialog-button")+' lu-action-remove" title="Remove" type="button" '+(this.line.frozen?'style="display: none"':"")+' ><span style="margin-left: 3px">Remove Mapping Line</span></button>\n        <strong>Input Domain Value (min ... max)</strong>\n        <input type="number" value="'+this.adapter.formatter(this.adapter.unnormalizeRaw(this.line.domain))+'" '+(this.line.frozen?"readonly disabled":"")+' autofocus required min="'+r[0]+'" max="'+r[1]+'" step="any">\n        <strong>Output Normalized Value (0 ... 1)</strong>\n        <input type="number" value="'+O(this.line.range/100,3)+'" required min="0" max="1" step="any">\n      '),this.find("button").addEventListener("click",(function(){e.destroy("confirm"),e.line.destroy()}),{passive:!0}),this.enableLivePreviews("input")},e.prototype.cleanUp=function(e){t.prototype.cleanUp.call(this,e),this.dialog.attachment.classList.remove(qn("mapping-line-selected"))},e.prototype.cancel=function(){this.line.update(this.before.domain,this.before.range,!0)},e.prototype.reset=function(){this.findInput("input[type=number]").value=O(this.adapter.unnormalizeRaw(this.before.domain),3).toString(),this.findInput("input[type=number]:last-of-type").value=O(this.before.range/100,3).toString()},e.prototype.submit=function(){if(!this.node.checkValidity())return!1;var t=this.adapter.normalizeRaw(this.findInput("input[type=number]").valueAsNumber),e=100*this.findInput("input[type=number]:last-of-type").valueAsNumber;return this.line.update(t,e,!0),!0},e}(ff),Oh=function(){function t(t,e,r,n){var i=this;this.domain=e,this.range=r,this.adapter=n;t.insertAdjacentHTML("beforeend",'<g class="'+qn("dialog-mapper-mapping")+'" transform="translate('+e+',0)">\n      <line x1="0" x2="'+(r-e)+'" y2="52"></line>\n      <line x1="0" x2="'+(r-e)+'" y2="52"></line>\n      <circle r="2"></circle>\n      <circle cx="'+(r-e)+'" cy="52" r="2"></circle>\n      <text class="'+qn("dialog-mapper-mapping-domain")+" "+(e>25&&e<75?qn("dialog-mapper-mapping-middle"):"")+(e>75?qn("dialog-mapper-mapping-right"):"")+'" dy="-3">\n        '+this.adapter.formatter(this.adapter.unnormalizeRaw(e))+'\n      </text>\n      <text class="'+qn("dialog-mapper-mapping-range")+" "+(r>25&&r<75?qn("dialog-mapper-mapping-middle"):"")+(r>50?qn("dialog-mapper-mapping-right"):"")+'" dy="3" x="'+(r-e)+'" y="52">\n        '+O(r/100,3)+"\n      </text>\n      <title>Drag the anchor circle to change the mapping, double click to edit</title>\n    </g>"),this.node=t.lastElementChild,this.node.classList.toggle(qn("frozen"),V(0,e)||V(e,100));var a,s,u,l,c=function(e){return 100*e/t.getBoundingClientRect().width},p={container:t.parentElement,filter:function(t){return 0===t.button&&!t.shiftKey},onStart:function(t,e){a=i.domain,s=i.range;var r=c(e);u=i.domain-r,l=i.range-r},onEnd:function(){V(a,i.domain)&&V(s,i.range)||i.adapter.updated(i)}};gf(this.node.querySelector("line:first-of-type"),o({},p,{onDrag:function(t,e){var r=c(e);i.update(Lh(r+u),Lh(r+l))}})),gf(this.node.querySelector("circle:first-of-type"),o({},p,{onDrag:function(t,e){var r=c(e);i.update(Lh(r),i.range)}})),gf(this.node.querySelector("circle:last-of-type"),o({},p,{onDrag:function(t,e){var r=c(e);i.update(i.domain,Lh(r))}})),this.node.onclick=function(t){t.shiftKey&&i.openDialog()},this.node.ondblclick=function(){i.openDialog()}}return t.prototype.openDialog=function(){var t={manager:this.adapter.dialog.manager,level:this.adapter.dialog.level+1,attachment:this.node,idPrefix:this.adapter.dialog.idPrefix};new xh(this,t,this.adapter).open()},Object.defineProperty(t.prototype,"frozen",{get:function(){return this.node.classList.contains(qn("frozen"))},enumerable:!0,configurable:!0}),t.prototype.destroy=function(t){void 0===t&&(t=!1),this.node.remove(),t||this.adapter.destroyed(this)},t.prototype.update=function(t,e,r){if(void 0===r&&(r=!1),V(t,100)&&(t=100),V(t,0)&&(t=0),V(e,100)&&(e=100),V(e,0)&&(e=0),!V(t,this.domain)||!V(e,this.range)){this.frozen&&(t=this.domain),this.domain=t,this.range=e,this.node.setAttribute("transform","translate("+t+",0)");var n=e-t;Array.from(this.node.querySelectorAll("line")).forEach((function(t){return t.setAttribute("x2",String(n))})),this.node.querySelector("circle[cx]").setAttribute("cx",String(n));var i=this.node.querySelector("text");i.textContent=this.adapter.formatter(this.adapter.unnormalizeRaw(t)),i.classList.toggle(qn("dialog-mapper-mapping-right"),t>75),i.classList.toggle(qn("dialog-mapper-mapping-middle"),t>=25&&t<=75);var o=this.node.querySelector("text[x]");o.textContent=O(e/100,3).toString(),o.classList.toggle(qn("dialog-mapper-mapping-right"),e>75),o.classList.toggle(qn("dialog-mapper-mapping-middle"),e>=25&&e<=75),o.setAttribute("x",String(n)),r&&this.adapter.updated(this)}},t}(),Vh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"dataMapping",cancelSubDialogs:!0})||this;i.column=e,i.mappingLines=[],i.mappingAdapter={destroyed:function(t){i.mappingLines.splice(i.mappingLines.indexOf(t),1),i.updateLines(i.computeScale())},updated:function(){return i.updateLines(i.computeScale())},domain:function(){return i.rawDomain},normalizeRaw:i.normalizeRaw.bind(i),unnormalizeRaw:i.unnormalizeRaw.bind(i),dialog:i.dialog,formatter:i.column.getNumberFormat()},i.idPrefix="me"+n.idPrefix,i.before=i.column.getMapping().clone(),i.scale=i.column.getMapping().clone();var o=i.scale.domain;return i.rawDomain=[o[0],o[o.length-1]],i.data=Promise.resolve(n.provider.mappingSample(e)),i}return i(e,t),Object.defineProperty(e.prototype,"scaleType",{get:function(){if(this.scale instanceof xs)return"script";if(this.scale instanceof Ls){var t=this.scale.scaleType;if("linear"!==t)return t;var e=this.scale.range;return 2===e.length&&1===e[0]&&0===e[1]?"linear_invert":3===e.length&&1===e[0]&&0===e[1]&&1===e[2]?"linear_abs":"linear"}return"unknown"},enumerable:!0,configurable:!0}),e.prototype.build=function(t){var e=this;t.classList.add(qn("dialog-mapper"));var r=this.column.findMyRanker(),n=r?r.flatColumns.filter((function(t){return Dt(t)&&t!==e.column})):[];t.insertAdjacentHTML("beforeend",'\n        <div><label for="'+this.idPrefix+'mapping_type"><strong>Normalization Scaling:</strong></label><select id="'+this.idPrefix+'mapping_type" class="browser-default">\n        <option value="linear">Linear</option>\n        <option value="linear_invert">Invert</option>\n        <option value="linear_abs">Absolute</option>\n        <option value="log">Log</option>\n        <option value="pow1.1">Pow 1.1</option>\n        <option value="pow2">Pow 2</option>\n        <option value="pow3">Pow 3</option>\n        <option value="sqrt">Sqrt</option>\n        <option value="script">Custom Script</option>\n        <option value="unknown">Unknown</option>\n        '+(n.length>0?'<optgroup label="Copy From">'+n.map((function(t){return'<option value="copy_'+t.id+'">'+t.label+"</option>"})).join("")+"</optgroup>":"")+"\n      </select>\n      </div>\n        <div class="+qn("dialog-mapper-domain")+'>\n          <input id="'+this.idPrefix+'min" required type="number" value="'+O(this.rawDomain[0],3)+'" step="any">\n          <span>Input Domain (min - max)</span>\n          <input id="'+this.idPrefix+'max" required type="number" value="'+O(this.rawDomain[1],3)+'" step="any">\n        </div>\n        <svg class="'+qn("dialog-mapper-details")+'" viewBox="0 0 106 66">\n           <g transform="translate(3,7)">\n              <rect y="-3" width="100" height="10">\n                <title>Click to create a new mapping line</title>\n              </rect>\n              <rect y="49" width="100" height="10">\n                <title>Click to create a new mapping line</title>\n              </rect>\n           </g>\n        </svg>\n        <div class='+qn("dialog-mapper-range")+'>\n          <span>Output Normalized Domain (0 - 1)</span>\n        </div>\n        <div class="'+qn("dialog-mapper-script")+'">\n          <strong>Custom Normalization Script</strong>\n          <textarea class="'+qn("textarea")+'"></textarea>\n        </div>');var i=t.querySelector("."+qn("dialog-mapper-details")+" > g");this.forEach("."+qn("dialog-mapper-details")+" rect",(function(t){return t.onclick=function(r){r.preventDefault(),r.stopPropagation();var n=t.getBoundingClientRect(),o=O(100*(r.x-n.left)/n.width,2),a=new Oh(i,o,o,e.mappingAdapter);e.mappingLines.push(a)}}));var o=this.find("select"),a=this.find("textarea");o.onchange=function(r){var n=r.currentTarget;switch(n.value){case"linear_invert":e.scale=new Ls(e.rawDomain.slice(),"linear",[1,0]);break;case"linear_abs":e.scale=new Ls([e.rawDomain[0],(e.rawDomain[1]-e.rawDomain[0])/2,e.rawDomain[1]],"linear",[1,0,1]);break;case"script":var i=new xs(e.rawDomain.slice());e.scale=i,a.value=i.code;break;case"unknown":e.scale=e.column.getOriginalMapping().clone();break;default:if(n.value.startsWith("copy_"))return void e.copyMapping(n.value.slice("copy_".length));e.scale=new Ls(e.rawDomain.slice(),n.value,[0,1])}e.createMappings(),t.dataset.scale=n.value,e.updateLines()};var s=t.dataset.scale=this.scaleType;o.selectedIndex=Array.from(o.options).findIndex((function(t){return t.value===s})),"script"===s&&(a.value=this.scale.code),this.createMappings(),this.forEach("#"+this.idPrefix+"min, #"+this.idPrefix+"max",(function(t,r){return t.onchange=function(){var n=t.valueAsNumber;if(n!==e.rawDomain[r]){var i=e.rawDomain[1-r];if(isNaN(n)||0===r&&n>=i||1===r&&n<=i)t.setCustomValidity("value has to be "+(0===r?"<= max":">= min"));else{t.setCustomValidity(""),e.rawDomain[r]=n,e.scale=e.computeScale();var o=e.scale.domain.slice();o[0]=e.rawDomain[0],o[o.length-1]=e.rawDomain[1],e.scale.domain=o,e.createMappings(),e.updateLines(),e.showLivePreviews()&&e.column.setMapping(e.scale)}}else t.setCustomValidity("")}})),this.data.then((function(t){t.forEach((function(t){vn(t)||i.insertAdjacentHTML("afterbegin",'<line data-v="'+t+'" x1="'+O(e.normalizeRaw(t),2)+'" x2="'+O(100*e.scale.apply(t),2)+'" y2="52"></line>')}))}))},e.prototype.createMappings=function(){if(this.mappingLines.splice(0,this.mappingLines.length).forEach((function(t){return t.destroy(!0)})),this.scale instanceof Ls)for(var t=this.node.querySelector("."+qn("dialog-mapper-details")+" > g"),e=this.scale.domain,r=this.scale.range,n=0;n<e.length;++n)this.mappingLines.push(new Oh(t,this.normalizeRaw(e[n]),100*r[n],this.mappingAdapter))},e.prototype.update=function(){var t=this,e=this.node.dataset.scale=this.scaleType,r=this.find("select");r.selectedIndex=Array.from(r.options).findIndex((function(t){return t.value===e})),"script"===e&&(this.find("textarea").value=this.scale.code),this.forEach("input[type=number]",(function(e,r){e.value=O(t.rawDomain[r],3).toString()}))},e.prototype.updateLines=function(t){var e=this;void 0===t&&(t=this.scale),this.forEach("."+qn("dialog-mapper-details")+"  > g > line[x1]",(function(r){var n=parseFloat(r.getAttribute("data-v"));r.setAttribute("x1",O(e.normalizeRaw(n),2).toString()),r.setAttribute("x2",O(100*t.apply(n),2).toString())}))},e.prototype.reset=function(){this.scale=this.column.getOriginalMapping().clone();var t=this.scale.domain;this.rawDomain=[t[0],t[t.length-1]],this.update(),this.createMappings(),this.updateLines()},e.prototype.copyMapping=function(t){var e=this.column.findMyRanker();if(e){var r=e.find(t);this.scale=r.getMapping().clone(),this.rawDomain=this.scale.domain.slice(),this.update(),this.createMappings(),this.updateLines()}},e.prototype.normalizeRaw=function(t){var e=100*(t-this.rawDomain[0])/(this.rawDomain[1]-this.rawDomain[0]);return Math.max(Math.min(e,100),0)},e.prototype.unnormalizeRaw=function(t){return t*(this.rawDomain[1]-this.rawDomain[0])/100+this.rawDomain[0]},e.prototype.computeScale=function(){var t=this,e=this.scaleType;if("script"===e)return new xs(this.rawDomain.slice(),this.node.querySelector("textarea").value);this.mappingLines.sort((function(t,e){return t.domain-e.domain}));var r=this.mappingLines.map((function(e){return t.unnormalizeRaw(e.domain)})),n=this.mappingLines.map((function(t){return t.range/100}));return new Ls(r,e,n)},e.prototype.submit=function(){if(!this.node.checkValidity())return!1;var t=this.computeScale();return this.column.setMapping(t),!0},e.prototype.cancel=function(){this.column.setMapping(this.before)},e}(ff),Ih=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"filter",cancelSubDialogs:!0})||this;return i.column=e,i.ctx=n,i.handler=null,i.before=e.getFilter(),i}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("dialog-mapper")),this.handler=function(t,e,r,n){var i=Tf(t),o=Rf(t,r);e.innerHTML=""+i.template+Cf(o,wf(t))+"</div>";var a=e.firstElementChild;a.classList.add(qn("summary"),qn("renderer")),a.dataset.renderer="histogram",a.dataset.interactive="",a.classList.add(qn("histogram-i"));var s=o.setFilter,u=wf(t);o.setFilter=function(t,e,r){u={filterMissing:t,filterMin:e,filterMax:r},n&&s(t,e,r)};var l=Nf(a,o),c=function(){var e=r.tasks.summaryNumberStats(t).then((function(t){if("symbol"!=typeof t){var e=t.summary,r=t.data;l(r?r.missing:e?e.missing:0,u),a.classList.toggle(qn("missing"),!e),e&&i.render(a,e,r)}}));e&&(a.classList.add(Kn("loading")),e.then((function(){a.classList.remove(Kn("loading"))})))},p=t.findMyRanker();return p&&p.on(Zn.EVENT_ORDER_CHANGED+".numberFilter",(function(){return c()})),c(),{cleanUp:function(){p&&p.on(Zn.EVENT_ORDER_CHANGED+".numberFilter",null)},reset:function(){u=wf(t,{min:-1/0,max:1/0,filterMissing:!1}),c()},submit:function(){s(u.filterMissing,u.filterMin,u.filterMax)}}}(this.column,t,{dialogManager:this.ctx.dialogManager,idPrefix:this.ctx.idPrefix,tasks:this.ctx.provider.getTaskExecutor()},this.showLivePreviews())},e.prototype.cleanUp=function(e){t.prototype.cleanUp.call(this,e),this.handler.cleanUp()},e.prototype.reset=function(){this.handler.reset()},e.prototype.submit=function(){return this.handler.submit(),!0},e.prototype.cancel=function(){this.column.setFilter(this.before)},e}(ff);function kh(t,e,r){var n=e.getSortMethod();return r.forEach((function(e){return t.insertAdjacentHTML("beforeend",'<label class="'+qn("checkbox")+'"><input type="radio" name="multivaluesort" value="'+e+'"  '+(n===e?"checked":"")+" ><span>"+$(e)+"</span></label>")})),oc(t,"input[name=multivaluesort]",(function(t){t.addEventListener("change",(function(){return e.setSortMethod(t.value)}),{passive:!0})})),{elems:"input[name=multivaluesort]",submit:function(){var r=t.querySelector("input[name=multivaluesort]:checked").value;return e.setSortMethod(r),!0},cancel:function(){e.setSortMethod(n)},reset:function(){t.querySelector('input[name=multivaluesort][value="'+n+'"]').checked=!0}}}var Gh=function(t){function e(e,r){var n=t.call(this,r,{livePreview:"reduce"})||this;return n.column=e,n.handler=null,n}return i(e,t),e.prototype.build=function(t){var e=this,r={getSortMethod:function(){return e.column.getReduce()},setSortMethod:function(t){return e.column.setReduce(t)}};this.handler=kh(t,r,Object.keys(vt)),this.enableLivePreviews(this.handler.elems)},e.prototype.submit=function(){return this.handler.submit()},e.prototype.reset=function(){this.handler.reset()},e.prototype.cancel=function(){this.handler.cancel()},e}(ff),Hh=function(t){function e(e,r){var n=t.call(this,r)||this;return n.column=e,n.before=e.getMetaData(),n}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("dialog-rename")),t.insertAdjacentHTML("beforeend",'\n      <input type="text" value="'+this.column.label+'" required autofocus placeholder="name">\n      <input type="text" value="'+this.column.getMetaData().summary+'" placeholder="summary" name="summary">\n      <textarea class="'+qn("textarea")+'" rows="5" placeholder="description">'+this.column.description+"</textarea>")},e.prototype.reset=function(){var t=this.column.desc,e={label:t.label||this.column.id,summary:t.summary||"",description:t.description||""};this.findInput('input[type="text"]').value=e.label,this.findInput('input[name="summary"]').value=e.summary,this.node.querySelector("textarea").value=e.description},e.prototype.submit=function(){var t=this.findInput('input[type="text"]').value,e=this.findInput('input[name="summary"]').value.trim(),r=this.node.querySelector("textarea").value;return this.column.setMetaData({label:t,description:r,summary:e}),!0},e.prototype.cancel=function(){this.column.setMetaData(this.before)},e}(ff),Ph=function(t){function e(e,r){var n=t.call(this,r)||this;return n.column=e,n.before=e.getScript(),n}return i(e,t),e.prototype.build=function(t){t.insertAdjacentHTML("beforeend",'<textarea class="'+qn("textarea")+'" autofocus="true" rows="5" autofocus="autofocus" style="width: 95%;">'+this.column.getScript()+"</textarea>")},e.prototype.cancel=function(){this.column.setScript(this.before)},e.prototype.reset=function(){this.node.querySelector("textarea").value=this.column.desc.script||Fu.DEFAULT_SCRIPT},e.prototype.submit=function(){return this.column.setScript(this.node.querySelector("textarea").value),!0},e}(ff),Fh=function(t){function e(e,r,n){var i=t.call(this,r,{livePreview:"search"})||this;return i.column=e,i.provider=n,i}return i(e,t),e.prototype.build=function(t){var e=this;t.insertAdjacentHTML("beforeend",'<input type="text" size="20" value="" required autofocus placeholder="search... (>= 3 chars)">\n      <label class="'+qn("checkbox")+'">\n        <input type="checkbox">\n        <span>Use regular expressions</span>\n      </label>\n    ');var r=t.querySelector('input[type="text"]'),n=t.querySelector('input[type="checkbox"]'),i=function(){r.value.length<3?r.setCustomValidity("at least 3 characters"):r.setCustomValidity("")};r.addEventListener("input",i,{passive:!0}),n.addEventListener("change",i,{passive:!0}),this.enableLivePreviews([r,n]),this.showLivePreviews()&&r.addEventListener("input",ei((function(){return e.submit()}),100),{passive:!0})},e.prototype.submit=function(){var t=this.findInput('input[type="text"]'),e=this.findInput('input[type="checkbox"]'),r=t.value;return e.checked&&(r=new RegExp(r)),this.provider.searchAndJump(r,this.column),!0},e.prototype.reset=function(){var t=this.findInput('input[type="text"]'),e=this.findInput('input[type="checkbox"]');t.value="",e.checked=!1},e.prototype.cancel=function(){},e}(ff),Uh=function(t){function e(e,r){var n=t.call(this,r)||this;return n.provider=e,n.before=n.provider.getShowTopN(),n}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("dialog-rename")),t.insertAdjacentHTML("beforeend",'\n      <input type="number" min="0" step="1" value="'+this.before+'">'),this.enableLivePreviews("input")},e.prototype.cancel=function(){this.provider.setShowTopN(this.before)},e.prototype.submit=function(){var t=this.findInput("input").valueAsNumber;return this.provider.setShowTopN(t),!0},e.prototype.reset=function(){this.findInput("input").value=10..toString()},e}(ff),Bh=function(t){function e(e,r,n,i){var o=t.call(this,n,{livePreview:r?"groupSort":"sort"})||this;return o.column=e,o.groupSortBy=r,o.ctx=i,o.handlers=[],o}return i(e,t),e.prototype.build=function(t){for(var e=0,r=fd(this.column,this.groupSortBy?"sortGroup":"sort",this.ctx);e<r.length;e++){var n=r[e];this.node.insertAdjacentHTML("beforeend","<strong>"+n.title+"</strong>"),this.handlers.push(n.append(this.column,this.node,this.dialog,this.ctx))}this.handlers.push(function(t,e,r,n){void 0===n&&(n=!1);var i=e.findMyRanker(),o=n?i.getGroupSortCriteria():i.getSortCriteria(),a=Object.assign({},n?e.isGroupSortedByMe():e.isSortedByMe()),s=void 0===a.priority?o.length:a.priority,u=hc(r);t.insertAdjacentHTML("afterbegin",'\n        <strong>Sort Order</strong>\n        <label class="'+qn("checkbox")+'"><input type="radio" name="sortorder" value="asc"  '+("asc"===a.asc?"checked":"")+' ><span>Ascending</span></label>\n        <label class="'+qn("checkbox")+'"><input type="radio" name="sortorder" value="desc"  '+("desc"===a.asc?"checked":"")+' ><span>Decending</span></label>\n        <label class="'+qn("checkbox")+'"><input type="radio" name="sortorder" value="none"  '+(void 0===a.asc?"checked":"")+' ><span>Unsorted</span></label>\n        <strong>Sort Priority</strong>\n        <input type="number" id="'+u+'P" step="1" min="1" max="'+(o.length+1)+'" value="'+(s+1)+'">\n    ');var l=function(e){oc(t,"input:not([name=sortorder]), select, textarea",(function(t){t.disabled=e}))};return l(void 0===a.asc),oc(t,"input[name=sortorder]",(function(t){t.addEventListener("change",(function(){l("none"===t.value)}),{passive:!0})})),{elems:"input[name=sortorder], #"+u+"P",submit:function(){var r=t.querySelector("input[name=sortorder]:checked").value,o=Number.parseInt(t.querySelector("#"+u+"P").value,10)-1;return n?i.groupSortBy(e,"asc"===r,"none"===r?-1:o):i.sortBy(e,"asc"===r,"none"===r?-1:o),!0},reset:function(){t.querySelector("input[name=sortorder][value=none]").checked=!0,t.querySelector("#"+u+"P").value=(o.length+(void 0===a.priority?1:0)).toString(),l(!0)},cancel:function(){n?i.groupSortBy(e,"asc"===a.asc,void 0===a.asc?-1:a.priority):i.sortBy(e,"asc"===a.asc,void 0===a.asc?-1:a.priority)}}}(t,this.column,this.dialog.idPrefix,this.groupSortBy));for(var i=0,o=this.handlers;i<o.length;i++){var a=o[i];this.enableLivePreviews(a.elems)}},e.prototype.submit=function(){for(var t=0,e=this.handlers;t<e.length;t++){if(!1===e[t].submit())return!1}return!0},e.prototype.cancel=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].cancel()}},e.prototype.reset=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].reset()}},e}(ff);var jh=function(t){function e(e,r){var n=t.call(this,r,{livePreview:"filter"})||this;return n.column=e,n.before=n.column.getFilter(),n}return i(e,t),e.prototype.updateFilter=function(t,e){null!=t||e?this.column.setFilter({filter:t,filterMissing:e}):this.column.setFilter(null)},e.prototype.reset=function(){this.findInput('input[type="text"]').value="",this.forEach("input[type=checkbox]",(function(t){return t.checked=!1}))},e.prototype.cancel=function(){this.before?this.updateFilter(""===this.before.filter?null:this.before.filter,this.before.filterMissing):this.updateFilter(null,!1)},e.prototype.submit=function(){var t=wc(this.node).checked,e=this.findInput('input[type="text"]').value,r=this.findInput('input[type="checkbox"]').checked;return this.updateFilter(function(t,e){var r=t.trim();return""===r?null:e?new RegExp(r,"m"):r}(e,r),t),!0},e.prototype.build=function(t){var e=this,r=this.column.getFilter()||{filter:"",filterMissing:!1};t.insertAdjacentHTML("beforeend",'<input type="text" placeholder="Filter '+this.column.desc.label+'..." autofocus value="'+(r.filter instanceof RegExp?r.filter.source:r.filter||"")+'" style="width: 100%">\n    <label class="'+qn("checkbox")+'">\n      <input type="checkbox" '+(r.filter instanceof RegExp?'checked="checked"':"")+">\n      <span>Use regular expressions</span>\n    </label>\n    "+_c(r.filterMissing));var n=wc(t),i=t.querySelector('input[type="text"]'),o=t.querySelector('input[type="checkbox"]');this.enableLivePreviews([n,i,o]),this.showLivePreviews()&&i.addEventListener("input",ei((function(){return e.submit()}),100),{passive:!0})},e}(ff),Yh=function(t){function e(e,r){var n=t.call(this,r)||this;return n.column=e,n.weights=n.column.getWeights(),n}return i(e,t),e.prototype.cancel=function(){this.column.setWeights(this.weights.slice())},e.prototype.reset=function(){var t=100/this.weights.length;oc(this.node,"input[type=number]",(function(e){var r=O(t,2);e.value=String(r),e.nextElementSibling.firstElementChild.style.width=r+"%"}))},e.prototype.build=function(t){var e=this,r=this.column.children;t.insertAdjacentHTML("beforeend",'<div class="'+qn("dialog-table")+'">\n        '+this.weights.map((function(t,e){return'<div class="'+qn("dialog-weights-table-entry")+'">\n          <input type="number" value="'+O(100*t,2)+'" min="0" max="100" step="any" required>\n          <span class="'+qn("dialog-filter-color-bar")+'">\n            <span style="background-color: '+mc(r[e])+"; width: "+O(100*t,2)+'%"></span>\n          </span>\n          '+r[e].label+"\n        </div>"})).join("")+"\n    </div>");var n=Array.from(this.node.querySelectorAll("input[type=number]"));n.forEach((function(t,r){t.oninput=function(){var i=t.valueAsNumber;if(i<=0?t.setCustomValidity("weight cannot be zero"):t.setCustomValidity(""),e.updateBar(t),2===n.length){var o=100-i;o<=0?t.setCustomValidity("weight cannot be 100 in case of two elements"):t.setCustomValidity("");var a=n[1-r];a.value=O(o,2).toString(),e.updateBar(a)}}}))},e.prototype.updateBar=function(t){t.nextElementSibling.firstElementChild.style.width=t.value+"%"},e.prototype.distributeWeights=function(){var t=Array.from(this.node.querySelectorAll("input[type=number]")).map((function(t){return{input:t,weight:t.value?t.valueAsNumber:NaN}}));if(t.some((function(t){return isNaN(t.weight)}))){var e=t.filter((function(t){return isNaN(t.weight)})),r=t.filter((function(t){return!isNaN(t.weight)})).reduce((function(t,e){return t+e.weight}),0);if(r<100){for(var n=(100-r)/e.length,i=0,o=e;i<o.length;i++){(f=o[i]).input.value=O(n,2).toString(),this.updateBar(f.input)}return}for(var a=0,s=e;a<s.length;a++){(f=s[a]).input.value="0",this.updateBar(f.input)}}var u=t.map((function(t){return t.weight}));if(!Wh(u))for(var l=u.reduce((function(t,e){return t+e}),0),c=0,p=t;c<p.length;c++){var f;(f=p[c]).input.value=O(100*f.weight/l,2).toString(),this.updateBar(f.input)}},e.prototype.appendDialogButtons=function(){var e=this;t.prototype.appendDialogButtons.call(this);var r=this.node.querySelector("."+qn("dialog-buttons"));r.insertAdjacentHTML("beforeend",'<button class="'+qn("dialog-button")+" "+qn("dialog-weights-distribute-button")+'" type="button" title="distribute weights"></button>'),r.lastElementChild.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.distributeWeights()}},e.prototype.submit=function(){for(var t=Array.from(this.node.querySelectorAll("input[type=number]")).map((function(t){return{input:t,weight:t.valueAsNumber}})),e=!1,r=0,n=t;r<n.length;r++){var i=n[r];i.weight<=0?(i.input.setCustomValidity("weight cannot be zero"),e=!0):i.input.setCustomValidity("")}var o=t.map((function(t){return t.weight}));return e||Wh(o)||(t[t.length-1].input.setCustomValidity("sum of weights has to be 100, change weights or use the redistribute button to fix"),e=!0),e?("function"==typeof this.node.reportValidity&&this.node.reportValidity(),!1):(this.column.setWeights(o.map((function(t){return t/100}))),!0)},e}(ff);function Wh(t){return Math.abs(t.reduce((function(t,e){return t+e}),0)-100)<3}function zh(t,e,r){return void 0===r&&(r={}),{title:t,onClick:e,options:r}}function qh(t,e,r,n){return void 0===r&&(r=function(){return[]}),void 0===n&&(n={}),{title:t,onClick:function(t,n,i,o){(new(e.bind.apply(e,[void 0,t,pf(i,o,n)].concat(r(i))))).open()},options:n}}function Kh(t){return t=t.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),{title:"Sort By",order:2,append:function(e,r){return kh(r,e,t)}}}var Xh={title:"Sort",onClick:function(t,e,r,n){if(r.dialogManager.removeAboveLevel(n),e.ctrlKey){var i=t.findMyRanker(),o=i.getSortCriteria(),a=t.isSortedByMe(),s=mt(t);if(void 0!==a.priority){var u=void 0;u=s?a.asc?"desc":void 0:a.asc?void 0:"asc",i.sortBy(t,"asc"===u,u?a.priority:-1)}else i.sortBy(t,s,o.length)}else t.toggleMySorting()},options:{mode:"shortcut",order:1,featureCategory:"ranking",featureLevel:"basic"}},$h={title:"Sort By &hellip;",onClick:function(t,e,r,n){new Bh(t,!1,pf(r,n,e),r).open()},options:{mode:"menu",order:1,featureCategory:"ranking",featureLevel:"advanced"}},Jh={title:"Sort Groups By &hellip;",onClick:function(t,e,r,n){new Bh(t,!0,pf(r,n,e),r).open()},options:{mode:"menu",order:3,featureCategory:"ranking",featureLevel:"advanced"}},Qh={title:"Rename &hellip;",onClick:function(t,e,r,n){new Hh(t,pf(r,n,e)).open()},options:{order:5,featureCategory:"ui",featureLevel:"advanced"}},Zh={title:"Visualization &hellip;",onClick:function(t,e,r,n){new oh(t,pf(r,n,e),r).open()},options:{featureCategory:"ui",featureLevel:"advanced"}},td={title:"Remove",onClick:function(t,e,r){r.dialogManager.removeAll();var n=t.findMyRanker();n.children.every((function(e){return wt(e)||e.fixed||e===t}))?(r.provider.removeRanking(n),r.provider.ensureOneRanking()):t.removeMe()},options:{order:90,featureCategory:"model",featureLevel:"advanced"}},ed=zh("Group",(function(t,e,r,n){if(r.dialogManager.removeAboveLevel(n),e.ctrlKey){var i=t.findMyRanker(),o=i.getGroupCriteria(),a=o.indexOf(t);i.groupBy(t,a>=0?-1:o.length)}else t.groupByMe()}),{mode:"shortcut",order:2,featureCategory:"ranking",featureLevel:"basic"}),rd=zh("Group By &hellip;",(function(t,e,r,n){new Mh(t,pf(r,n,e),r).open()}),{mode:"menu",order:2,featureCategory:"ranking",featureLevel:"advanced"});function nd(t,e,r,n){r.dialogManager.removeAboveLevel(n);var i=t;i.setCollapsed(!i.getCollapsed());var o=i.getCollapsed(),a=e.currentTarget;a.title=o?"Expand":"Compress",a.classList.toggle(qn("action-compress"),!o),a.classList.toggle(qn("action-expand"),o);var s=a.getElementsByTagName("span")[0];s&&(s.textContent=a.title)}var id={title:"Compress",enabled:function(t){return!t.getCollapsed()},onClick:nd,options:{featureCategory:"model",featureLevel:"advanced"}},od={title:"Expand",enabled:function(t){return t.getCollapsed()},onClick:nd,options:{featureCategory:"model",featureLevel:"advanced"}},ad={title:"Change Show Top N",onClick:function(t,e,r,n){new Uh(r.provider,pf(r,n,e)).open()},options:{featureCategory:"ui",featureLevel:"advanced"}},sd={sortNumber:Kh(Object.keys(vt)),sortNumbers:Kh(Object.keys(vt)),sortBoxPlot:Kh(Object.keys(yt)),sortDates:Kh(Object.keys(Qs)),sortGroups:Kh(["count","name"]),groupNumber:{title:"Split",order:2,append:function(t,e,r){var n=t.getMapping().domain,i=t.getGroupThresholds(),o=i.length<=1,a=t.findMyRanker();e.insertAdjacentHTML("beforeend",'\n    <label class="'+qn("checkbox")+'">\n      <input type="radio" name="threshold" value="threshold" '+(o?"checked":"")+'>\n      <span>at&nbsp;<input type="number" size="10" id="'+r.idPrefix+'N1" value="'+(i.length>0?i[0]:O((n[1]-n[0])/2,2))+'"\n          required min="'+n[0]+'" max="'+n[1]+'" step="any" '+(o?"":"disabled")+'>\n      </span>\n    </label>\n    <label class="'+qn("checkbox")+'">\n      <input type="radio" name="threshold" value="bins" '+(o?"":"checked")+'>\n      <span> in&nbsp;<input type="number" size="5" id="'+r.idPrefix+'N2" value="'+(i.length>1?i.length:b(a.getOrderLength()))+'"\n          required min="2" step="1" '+(o?"disabled":"")+">&nbsp;bins\n      </span>\n    </label>\n  ");var s=e.querySelector("#"+r.idPrefix+"N1"),u=e.querySelector("#"+r.idPrefix+"N2");return oc(e,"input[name=threshold]",(function(t){t.addEventListener("change",(function(){var e="threshold"===t.value;s.disabled=!e,u.disabled=e}),{passive:!0})})),{elems:"input[name=threshold], #"+r.idPrefix+"N1, #"+r.idPrefix+"N2",submit:function(){if("threshold"===e.querySelector("input[name=threshold]:checked").value)return t.setGroupThresholds([s.valueAsNumber]),!0;for(var r=parseInt(u.value,10),i=(n[1]-n[0])/r,o=n[0]+i,a=[o],l=1;l<r-1;++l)o+=i,a.push(o);return t.setGroupThresholds(a),!0},cancel:function(){t.setGroupThresholds(i)},reset:function(){var t=O((n[1]-n[0])/2,2);s.value=t.toString(),s.disabled=!1,u.value=b(a.getOrderLength()).toString(),u.disabled=!0,e.querySelector("input[name=threshold][value=threshold]").checked=!0}}}},groupString:{title:"Groups",order:2,append:function(t,e,r){var n=t.getGroupCriteria(),i=n.type,o=n.values;e.insertAdjacentHTML("beforeend",'\n    <label class="'+qn("checkbox")+'">\n      <input type="radio" name="'+r.idPrefix+'groupString" value="'+ui.value+'" id="'+r.idPrefix+'VAL" '+(i===ui.value?"checked":"")+'>\n      <span>Use text value</span>\n    </label>\n    <label class="'+qn("checkbox")+'">\n      <input type="radio" name="'+r.idPrefix+'groupString" value="'+ui.startsWith+'" id="'+r.idPrefix+'RW" '+(i===ui.startsWith?"checked":"")+'>\n      <span>Text starts with &hellip;</span>\n    </label>\n    <label class="'+qn("checkbox")+'">\n      <input type="radio" name="'+r.idPrefix+'groupString" value="'+ui.regex+'" id="'+r.idPrefix+'RE" '+(i===ui.regex?"checked":"")+'>\n      <span>Use regular expressions</span>\n    </label>\n    <textarea rows="5" placeholder="one value per row, e.g., \nA\nB" id="'+r.idPrefix+'T">'+o.map((function(t){return t instanceof RegExp?t.source:t})).join("\n")+"</textarea>\n  ");var a=e.querySelector("#"+r.idPrefix+"VAL"),s=e.querySelector("#"+r.idPrefix+"RW"),u=e.querySelector("#"+r.idPrefix+"RE"),l=e.querySelector("#"+r.idPrefix+"T"),c=function(t){l.style.display=t?null:"none"};return c(i!==ui.value),a.onchange=function(){return c(!a.checked)},s.onchange=function(){return c(s.checked)},u.onchange=function(){return c(u.checked)},{elems:[l,a,s,u],submit:function(){var n=e.querySelector('input[name="'+r.idPrefix+'groupString"]:checked').value,i=l.value.trim().split("\n").map((function(t){return t.trim()})).filter((function(t){return t.length>0}));return n===ui.regex&&(i=i.map((function(t){return new RegExp(t.toString(),"m")}))),t.setGroupCriteria({type:n,values:i}),!0},cancel:function(){t.setGroupCriteria(n)},reset:function(){l.value="",s.checked=!0}}}},groupDate:{title:"Granularity",order:2,append:function(t,e){for(var r=t.getDateGrouper(),n="",i=0,o=["century","decade","year","month","week","day_of_week","day_of_month","day_of_year","hour","minute","second"];i<o.length;i++){var a=o[i];n+='<label class="'+qn("checkbox")+'">\n    <input type="radio" name="granularity" value="'+a+'" '+(r.granularity===a?"checked":"")+">\n    <span> by "+a+" </span>\n  </label>"}n+='<label class="'+qn("checkbox")+'">\n    <input type="checkbox" name="circular" '+(r.circular?"checked":"")+">\n    <span> Circular </span>\n  </label>",e.insertAdjacentHTML("beforeend",n);var s=e.querySelector("input[name=circular]");return{elems:"input[name=granularity],input[name=circular]",submit:function(){var r=e.querySelector("input[name=granularity]:checked").value;return t.setDateGrouper({granularity:r,circular:s.checked}),!0},cancel:function(){t.setDateGrouper(r)},reset:function(){var t={granularity:"month",circular:!1};s.checked=t.circular,e.querySelector('input[name=granularity][value="'+t.granularity+'"]').checked=!0}}}}},ud={vis:Zh,group:ed,groupBy:rd,compress:id,expand:od,sort:Xh,sortBy:$h,sortGroupBy:Jh,clone:{title:"Clone",onClick:function(t,e,r){r.dialogManager.removeAll(),r.provider.takeSnapshot(t)},options:{order:80,featureCategory:"model",featureLevel:"advanced"}},remove:td,rename:Qh,setShowTopN:ad,search:qh("Search &hellip;",Fh,(function(t){return[t.provider]}),{mode:"menu+shortcut",order:4,featureCategory:"ranking",featureLevel:"basic"}),filterNumber:qh("Filter &hellip;",Ih,(function(t){return[t]}),{mode:"menu+shortcut",featureCategory:"ranking",featureLevel:"basic"}),filterDate:qh("Filter &hellip;",Dh,(function(t){return[t]}),{mode:"menu+shortcut",featureCategory:"ranking",featureLevel:"basic"}),filterString:qh("Filter &hellip;",jh,(function(){return[]}),{mode:"menu+shortcut",featureCategory:"ranking",featureLevel:"basic"}),filterCategorical:qh("Filter &hellip;",nh,(function(t){return[t]}),{mode:"menu+shortcut",featureCategory:"ranking",featureLevel:"basic"}),filterOrdinal:qh("Filter &hellip;",ih,(function(){return[]}),{mode:"menu+shortcut",featureCategory:"ranking",featureLevel:"basic"}),colorMapped:qh("Color Mapping &hellip;",ah,(function(t){return[t]}),{mode:"menu",featureCategory:"ui",featureLevel:"advanced"}),colorMappedCategorical:qh("Color Mapping &hellip;",rh,(function(){return[]}),{mode:"menu",featureCategory:"ui",featureLevel:"advanced"}),script:qh("Edit Combine Script &hellip;",Ph,(function(){return[]}),{mode:"menu+shortcut",featureCategory:"model",featureLevel:"advanced"}),reduce:qh("Reduce by &hellip;",Gh,(function(){return[]}),{featureCategory:"model",featureLevel:"advanced"}),cutoff:qh("Set Cut Off &hellip;",Ah,(function(t){return[t.idPrefix]}),{featureCategory:"model",featureLevel:"advanced"}),editMapping:qh("Data Mapping &hellip;",Vh,(function(t){return[t]}),{featureCategory:"model",featureLevel:"advanced"}),editPattern:qh("Edit Pattern &hellip;",Sh,(function(t){return[t.idPrefix]}),{featureCategory:"model",featureLevel:"advanced"}),editWeights:qh("Edit Weights &hellip;",Yh,(function(){return[]}),{mode:"menu+shortcut",featureCategory:"model",featureLevel:"advanced"}),compositeContained:qh("Contained Columns &hellip;",Rh,(function(t){return[t]}),{featureCategory:"model",featureLevel:"advanced"}),splitCombined:zh("Split Combined Column",(function(t,e,r,n){r.dialogManager.removeAboveLevel(n-1),t.children.reverse().forEach((function(e){return t.insertAfterMe(e)})),t.removeMe()}),{featureCategory:"model",featureLevel:"advanced"}),invertSelection:zh("Invert Selection",(function(t,e,r,n){r.dialogManager.removeAboveLevel(n-1);var i=r.provider.getSelection(),o=Array.from(t.findMyRanker().getOrder());if(0!==i.length){var a=new Set(i),s=o.filter((function(t){return!a.has(t)}));r.provider.setSelection(s)}else r.provider.setSelection(o)}),{featureCategory:"model",featureLevel:"advanced"})};function ld(t,e){return t.options.order===e.options.order?t.title.toString().localeCompare(e.title.toString()):(t.options.order||50)-(e.options.order||50)}function cd(t,e){var r=e.caches.toolbar;if(r.has(t.desc.type))return r.get(t.desc.type);var n=function(t){var e=new Zr,r=t,n=Symbol.for("toolbarIcon");do{var i=Reflect.getOwnMetadata(n,r.constructor);if(i)for(var o=0,a=i;o<a.length;o++){var s=a[o];e.add(s)}r=Object.getPrototypeOf(r)}while(r);return Array.from(e)}(t);t.fixed||n.push("remove");var i=e.getPossibleRenderer(t);(i.item.length>2||i.group.length>2||i.summary.length>2)&&n.push("vis");var o=e.resolveToolbarActions(t,n),a=Array.from(new Set(o)).sort(ld);return r.set(t.desc.type,a),a}function pd(t,e){var r=cd(t,e),n=e.flags;return r.filter((function(e){return!(e.enabled&&!e.enabled(t))&&("basic"===e.options.featureLevel||!(!1===n.advancedModelFeatures&&"model"===e.options.featureCategory||!1===n.advancedRankingFeatures&&"ranking"===e.options.featureCategory||!1===n.advancedUIFeatures&&"ui"===e.options.featureCategory))}))}function fd(t,e,r){var n=t.desc.type+"@"+e,i=r.caches.toolbarAddons;if(i.has(n))return i.get(n);var o=function(t,e){var r=new Zr,n=t,i=Symbol.for("toolbarDialogAddon"+e);do{var o=Reflect.getOwnMetadata(i,n.constructor);if(o)for(var a=0,s=o;a<s.length;a++){var u=s[a];r.add(u)}n=Object.getPrototypeOf(n)}while(n);return Array.from(r)}(t,e),a=r.resolveToolbarDialogAddons(t,o),s=Array.from(new Set(a)).sort((function(t,e){return t.order===e.order?t.title.localeCompare(e.title):(t.order||50)-(e.order||50)}));return i.set(n,s),s}function hd(t,e,r){var n=[];return e.forEach((function(e){r.hasOwnProperty(e)?n.push(r[e]):console.warn('cannot find toolbar action of type: "'+t.desc.type+'" with key "'+e+'"')})),n}function dd(t,e,r){var n=[];return e.forEach((function(e){r.hasOwnProperty(e)?n.push(r[e]):console.warn('cannot find toolbar dialog addon of type: "'+t.desc.type+'" with key "'+e+'"')})),n}function gd(){return{toolbarActions:ud,toolbarDialogAddons:sd,resolveToolbarActions:hd,resolveToolbarDialogAddons:dd,renderers:Object.assign({},th),canRender:function(){return!0},labelRotation:0,summaryHeader:!0,animated:!0,expandLineOnHover:!1,sidePanel:!0,sidePanelCollapsed:!1,hierarchyIndicator:!0,defaultSlopeGraphMode:"item",overviewMode:!1,livePreviews:{search:!0,filter:!0,vis:!0,sort:!0,group:!0,groupSort:!0,colorMapping:!0},onDialogBackgroundClick:"cancel",rowHeight:18,groupHeight:40,groupPadding:5,rowPadding:2,levelOfDetail:function(){return"high"},customRowUpdate:function(){},dynamicHeight:function(){return null},flags:{disableFrozenColumns:!0,advancedRankingFeatures:!0,advancedModelFeatures:!0,advancedUIFeatures:!0},ignoreUnsupportedBrowser:!1}}var md=r(5);function yd(){var t=Object(md.detect)();if(!t||!t.version)return"browser cannot be detected";var e="unsupported browser detected:";switch(t.name){case"firefox":var r=parseInt(t.version.slice(0,t.version.indexOf(".")),10);return r<=57&&52!==r?e+" Firefox "+t.version+" (&lt; 57)":null;case"edge":return parseInt(t.version.slice(0,t.version.indexOf(".")),10)<=16?e+" Edge "+t.version+" (&lt; 16)":null;case"chrome":return parseInt(t.version.slice(0,t.version.indexOf(".")),10)<=64?e+" Chrome "+t.version+" (&lt; 64)":null;case"ie":return e+" Internet Explorer"}return console.warn("unknown browser detected",t,"assuming fine..."),null}var vd,bd=function(t){function e(e){var r=t.call(this)||this;r.escKeyListener=function(t){27===t.which&&r.removeLast()},r.openDialogs=[];var n=e.doc;return r.livePreviews=e.livePreviews,r.onDialogBackgroundClick=e.onDialogBackgroundClick,r.node=n.createElement("div"),r.node.classList.add(qn("backdrop")),r.node.innerHTML='<div class="'+qn("backdrop-bg")+'"></div>',r.node.onclick=function(){r.removeAll()},r}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_DIALOG_CLOSED,e.EVENT_DIALOG_OPENED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},Object.defineProperty(e.prototype,"maxLevel",{get:function(){return this.openDialogs.reduce((function(t,e){return Math.max(t,e.level)}),0)},enumerable:!0,configurable:!0}),e.prototype.setHighlight=function(t){var e=this.node.firstElementChild;e.style.clipPath=e.style.webkitClipPath="polygon(\n      0% 0%,\n      0% 100%,\n      "+t.left+"px 100%,\n      "+t.left+"px "+t.top+"px,\n      "+(t.left+t.width)+"px "+t.top+"px,\n      "+(t.left+t.width)+"px "+(t.top+t.height)+"px,\n      "+t.left+"px "+(t.top+t.height)+"px,\n      "+t.left+"px 100%,\n      100% 100%,\n      100% 0%\n    )"},e.prototype.setHighlightColumn=function(t){var e=this.node.parentElement;if(e){var r=e.querySelector("."+qn("header")+'[data-col-id="'+t.id+'"]');if(r){var n=r.getBoundingClientRect(),i=e.getBoundingClientRect();this.setHighlight({left:n.left-i.left,top:n.top-i.top,width:n.width,height:i.height})}else this.clearHighlight()}else this.clearHighlight()},e.prototype.clearHighlight=function(){this.node.firstElementChild.style.clipPath=null},e.prototype.removeLast=function(){0!==this.openDialogs.length&&this.remove(this.openDialogs[this.openDialogs.length-1])},e.prototype.removeAll=function(){var t=this;0!==this.openDialogs.length&&(this.openDialogs.splice(0,this.openDialogs.length).reverse().forEach((function(e){return e.cleanUp(t.onDialogBackgroundClick)})),this.takeDown())},e.prototype.triggerDialogClosed=function(t,r){this.fire(e.EVENT_DIALOG_CLOSED,t,r)},e.prototype.remove=function(t,e){var r=this;void 0===e&&(e=!1);var n=this.openDialogs.indexOf(t);if(n<0)return!1;for(this.openDialogs.splice(n,this.openDialogs.length-n).reverse().forEach((function(t){return t.cleanUp(e?"handled":r.onDialogBackgroundClick)}));e&&this.openDialogs.length>0&&this.openDialogs[this.openDialogs.length-1].autoClose;){this.openDialogs.pop().cleanUp(this.onDialogBackgroundClick)}return 0===this.openDialogs.length&&this.takeDown(),!0},e.prototype.removeAboveLevel=function(t){var e=this;this.openDialogs.filter((function(e){return e.level>=t})).reverse().forEach((function(t){return e.remove(t)}))},e.prototype.removeLike=function(t){var e=this.openDialogs.find((function(e){return t.equals(e)}));return!!e&&(this.remove(e),!0)},e.prototype.setUp=function(){this.node.ownerDocument.addEventListener("keyup",this.escKeyListener,{passive:!0}),this.node.style.display="block"},e.prototype.takeDown=function(){this.clearHighlight(),this.node.ownerDocument.removeEventListener("keyup",this.escKeyListener),this.node.style.display=null},e.prototype.push=function(t){this.removeAboveLevel(t.level),0===this.openDialogs.length&&this.setUp(),this.openDialogs.push(t),this.fire(e.EVENT_DIALOG_OPENED,t)},e.EVENT_DIALOG_OPENED="dialogOpened",e.EVENT_DIALOG_CLOSED="dialogClosed",e}(at),Ed=function(t){function e(e,r,n){var i=t.call(this)||this;i.node=e,i._data=r,i.highlightListeners=0;var o=yd();return i.isBrowserSupported=n||!o,i.isBrowserSupported||(i.node.classList.add(qn("unsupported-browser")),i.node.innerHTML="<span>"+o+'</span>\n      <div class="'+qn("unsupported-browser")+'">\n        <a href="https://www.mozilla.org/en-US/firefox/" rel="noopener" target="_blank" data-browser="firefox" data-version="57"></a>\n        <a href="https://www.google.com/chrome/index.html" rel="noopener" target="_blank" data-browser="chrome" data-version="64" title="best support"></a>\n        <a href="https://www.microsoft.com/en-us/windows/microsoft-edge" rel="noopener" target="_blank" data-browser="edge" data-version="16"></a>\n      </div><span>use the <code>ignoreUnsupportedBrowser=true</code> option to ignore this error at your own risk</span>'),i.forward(r,Nl.EVENT_SELECTION_CHANGED+".main"),r.on(Nl.EVENT_BUSY+".busy",(function(t){return i.node.classList.toggle(qn("busy"),t)})),i}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_HIGHLIGHT_CHANGED,e.EVENT_SELECTION_CHANGED,e.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},Object.defineProperty(e.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){K(this.node),this._data.destroy()},e.prototype.dump=function(){return this.data.dump()},e.prototype.restore=function(t){this._data.restore(t)},e.prototype.setDataProvider=function(t,e){var r=this;this._data&&(this.unforward(this._data,Nl.EVENT_SELECTION_CHANGED+".taggle"),this._data.on(Nl.EVENT_BUSY+".busy",null)),this._data=t,e&&t.restore(e),this.forward(t,Nl.EVENT_SELECTION_CHANGED+".taggle"),t.on(Nl.EVENT_BUSY+".busy",(function(t){return r.node.classList.toggle(qn("busy"),t)}))},e.prototype.getSelection=function(){return this._data.getSelection()},e.prototype.setSelection=function(t){this._data.setSelection(t)},e.prototype.sortBy=function(t,e){void 0===e&&(e=!1);var r=this.data.find(t);return r&&r.sortByMe(e),null!=r},e.prototype.listenersChanged=function(r,n){t.prototype.listenersChanged.call(this,r,n),r.startsWith(e.EVENT_HIGHLIGHT_CHANGED)&&(n?(this.highlightListeners++,1===this.highlightListeners&&this.enableHighlightListening(!0)):(this.highlightListeners-=1,0===this.highlightListeners&&this.enableHighlightListening(!1)))},e.prototype.enableHighlightListening=function(t){},e.EVENT_SELECTION_CHANGED=Nl.EVENT_SELECTION_CHANGED,e.EVENT_DIALOG_OPENED=bd.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED=bd.EVENT_DIALOG_CLOSED,e.EVENT_HIGHLIGHT_CHANGED="highlightChanged",e}(at);!function(t){t[t.UPDATE=0]="UPDATE",t[t.UPDATE_CREATE=1]="UPDATE_CREATE",t[t.UPDATE_REMOVE=2]="UPDATE_REMOVE",t[t.SHOW=3]="SHOW",t[t.HIDE=4]="HIDE"}(vd||(vd={}));var Cd=[{delay:0,apply:function(t){var e=t.mode,r=t.previous,n=t.nodeY,i=t.current,o=t.node;o.dataset.animation=vd[e].toLowerCase(),o.style.transform="translate(0, "+(r.y-n)+"px)",e===vd.SHOW?o.style.height=null!==i.height?i.height+"px":null:o.style.height=r.height+"px",o.style.opacity=e===vd.SHOW?"0":e===vd.HIDE?"1":null}},{delay:10,apply:function(t){var e=t.mode,r=t.current,n=t.nodeY,i=t.node;i.style.transform=e===vd.HIDE||e===vd.UPDATE_REMOVE?"translate(0, "+(r.y-n)+"px)":null,e!==vd.HIDE&&(i.style.height=null!==r.height?r.height+"px":null),i.style.opacity=e===vd.SHOW?"1":e===vd.HIDE?"0":null}},{delay:1100,apply:function(t){var e=t.node;delete e.dataset.animation,e.style.opacity=null,e.style.transform=null}}],Nd=function(){function t(t,e){var r=this;this.context=t,this.key=e,this.cache=[],this.lastFilled=0,this.key2index=new Map,this.context.exceptions.forEach((function(t){r.cache[t.index]=t.y,r.key2index.set(e(t.index),t.index)}))}return t.prototype.findValidStart=function(t){for(var e=t-1;e>=0;--e)if(void 0!==this.cache[e])return e;return-1},t.prototype.posByKey=function(t){if(this.key2index.has(t)){var e=this.key2index.get(t);return{index:e,pos:this.pos(e)}}return this.fillCacheTillKey(t)},t.prototype.pos=function(t){if(0===this.context.exceptions.length)return t*this.context.defaultRowHeight;var e=this.cache[t];if(void 0!==e)return e;var r=this.findValidStart(t);return r<0?this.fillCache(0,t,0):this.fillCache(r+1,t,this.cache[r]+this.heightOf(r)),this.cache[t]},t.prototype.fillCache=function(t,e,r,n){if(e<=this.lastFilled){if(!n)return;for(var i=t;i<=e;++i)n(i,this.key(i),this.cache[i])}else{var o=r;for(i=t;i<=e;++i){this.cache[i]=o;var a=this.key(i);this.key2index.set(a,i),n&&n(i,a,o),o+=this.heightOf(i)}}},t.prototype.heightOf=function(t){var e=this.context.exceptionsLookup;return e.has(t)?e.get(t):this.context.defaultRowHeight},t.prototype.exceptionHeightOf=function(t,e){void 0===e&&(e=!1);var r=this.context.padding(t),n=this.context.exceptionsLookup;return n.has(t)?n.get(t)-r:e?this.context.defaultRowHeight-r:null},t.prototype.padding=function(t){return this.context.padding(t)},t.prototype.fillCacheTillKey=function(t){for(var e=0,r=this.lastFilled;r<this.context.numberOfRows;++r,++this.lastFilled){var n=this.cache[r];if(void 0===n){var i=this.key(r);if(this.cache[r]=e,this.key2index.set(i,r),i===t)return{index:r,pos:e};e+=this.heightOf(r)}else e=n+this.heightOf(r)}return{index:-1,pos:-1}},t.prototype.positions=function(t,e,r,n){this.fillCache(t,e,r,n)},t}();var _d=function(){function t(t){var e=this;this.node=t,this.sync={handler:[],prev:null,timer:-1},this.animation={handler:[],prev:null,timer:-1},this.numbers=new Map,this.handleAnimationImpl=function(){1===e.animation.timer&&(e.handle(e.animation),e.animation.timer=-1)},t.addEventListener("scroll",(function(){e.sync.handler.length>0&&e.handle(e.sync),e.handleAnimation(),e.handleTimeouts()}),{passive:!0})}return Object.defineProperty(t.prototype,"current",{get:function(){return this.asInfo()},enumerable:!0,configurable:!0}),t.prototype.handle=function(t){var e=this.current;if(!(t.prev&&Math.abs(e.left-t.prev.left)+Math.abs(e.top-t.prev.top)<4)){t.prev=e;for(var r=0,n=t.handler;r<n.length;r++){(0,n[r])(e)}}},t.prototype.handleAnimation=function(){-1===this.animation.timer&&0!==this.animation.handler.length&&(this.animation.timer=1,requestAnimationFrame(this.handleAnimationImpl))},t.prototype.handleTimeouts=function(){var t=this;0!==this.numbers.size&&this.numbers.forEach((function(e,r){0!==e.handler.length&&(e.timer=self.setTimeout((function(){t.handle(e),e.timer=-1}),r))}))},t.prototype.asInfo=function(){return{left:this.node.scrollLeft,top:this.node.scrollTop,width:this.node.clientWidth,height:this.node.clientHeight}},t.prototype.push=function(t,e){switch("number"==typeof t&&(this.numbers.has(t)||this.numbers.set(t,{handler:[],prev:null,timer:-1}),this.numbers.get(t).handler.push(e)),t){case"sync":this.sync.handler.push(e);break;case"animation":this.animation.handler.push(e)}},t.prototype.remove=function(t){return[this.sync,this.animation].concat(Array.from(this.numbers.values())).some((function(e){var r=e.handler.indexOf(t);return r>=0&&e.handler.splice(r,1),r>=0}))},t.prototype.isWaiting=function(t){switch(t){case"animation":return this.animation.timer>=0;case"sync":return!1;default:return this.numbers.has(t)&&this.numbers.get(t).timer>=0}},t}();function Td(t,e,r){t.__le_scroller__||(t.__le_scroller__=new _d(t));var n=t.__le_scroller__;return n.push(e,r),n.asInfo()}function wd(t,e){return!!t.__le_scroller__&&t.__le_scroller__.isWaiting(e)}function Rd(t){for(;t.lastChild;)t.removeChild(t.lastChild);return t}var Ad,Dd=function(){function t(t,e,r){this.index=t,this.y=e,this.height=r}return Object.defineProperty(t.prototype,"y2",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),t}();function Sd(t,e,r){void 0===e&&(e=NaN),void 0===r&&(r=0);var n=new Map,i=[],o="function"==typeof r?r:function(){return r};isNaN(e)&&(e=function(t){var e=new Map;if(t.forEach((function(t){e.set(t,(e.get(t)||0)+1)})),0===e.size)return 20;var r=Array.from(e).sort((function(t,e){return t[1]!==e[1]?e[1]-t[1]:t[0]-e[0]})),n=r[0][0];return 0===n?r.length>1?r[1][0]:20:n}(t)),e+=o(-1);var a=-1,s=0,u=0,l=0;return t.forEach((function(t,r){if(t+=o(r),u+=t,l++,t!==e){n.set(r,t);var c=(r-a-1)*e;a=r;var p=s+c;s=p+t,i.push(new Dd(r,p,t))}})),{exceptionsLookup:n,exceptions:i,totalHeight:u,defaultRowHeight:e,numberOfRows:l,padding:o}}function Md(t,e,r,n,i){if(0===i)return{first:0,last:-1,firstRowPos:0,endPos:0};if(1===i)return{first:0,last:0,firstRowPos:0,endPos:0===n.length?r:n[0].y2};var o=t,a=o+e;function s(t,e){return Math.min(i-1,e+Math.max(0,Math.floor(t/r)))}function u(t,e,n){void 0===n&&(n=!1);var u=a-t,l=s(o-t,e),c=s(u,e),p=t+(l-e)*r,f=t+(c+1-e)*r;return console.assert(!n||!(p>o||f<a&&c<i-1),"error",n,p,f,o,a,e,t),{first:l,last:c,firstRowPos:p,endPos:f}}var l=u(0,0,!0);if(0===n.length)return l;if(l.last<n[0].index)return l;if(l.last===n[0].index&&n[0].height>r)return Object.assign(l,{endPos:n[0].y2});var c=n[n.length-1];if(o>=c.y){var p=u(c.y2,c.index+1);return o<c.y2?Object.assign(p,{first:c.index,firstRowPos:c.y}):p}for(var f=[],h=n[0],d=0,g=n;d<g.length;d++){var m=g[d],y=m.y,v=m.y2;if(y>=a)break;v<=o?h=m:f.push(m)}if(0===f.length)return u(h.y2,h.index+1);var b=f[0],E=f[f.length-1],C=Math.max(0,b.index-Math.max(0,Math.ceil((b.y-o)/r))),N=E.index;a>=E.y2&&(N=s(a-E.y2,E.index+1));var _=b.y-(b.index-C)*r,T=E.y2+(N-E.index)*r;return console.assert(_<=o&&(T>=a||N===i-1),"error",_,T,o,a,b,E),{first:C,last:N,firstRowPos:_,endPos:T}}function Ld(t,e,r){for(var n=0===t.length?0:t[t.length-1]+1,i=[],o=[],a=t.length-1;a>=0;--a){if(!(t[a]>=r))break;o.push(t.pop())}for(a=n;a<r;++a)e[a].frozen&&(i.push(a),t.push(a));return{target:t,added:i,removed:o}}!function(t){t[t.NONE=0]="NONE",t[t.ALL=1]="ALL",t[t.SOME=2]="SOME",t[t.SOME_BOTTOM=3]="SOME_BOTTOM",t[t.SOME_TOP=4]="SOME_TOP"}(Ad||(Ad={}));function xd(t){return t?"le-"+t:"le"}var Od=xd("loading"),Vd=xd("frozen"),Id=xd("hidden"),kd=xd("multi"),Gd=xd("even"),Hd=xd("shifted"),Pd=xd("scrollbar-tester"),Fd=xd("header"),Ud=xd("body"),Bd=xd("footer"),jd=xd("thead"),Yd=xd("tbody"),Wd=xd("tr"),zd=xd("th"),qd=xd("td"),Kd=xd("scrolling"),Xd=xd("row-animation");function $d(t){return t.classList.contains(Od)}var Jd=function(){function t(t,e){var r=this;void 0===e&&(e={}),this.body=t,this.pool=[],this.loadingPool=[],this.loading=new WeakMap,this.visible={first:0,forcedFirst:0,last:-1,forcedLast:-1},this.visibleFirstRowPos=0,this.scrollListener=null,this.lastScrollInfo=null,this.abortAnimation=function(){},this.options={async:"animation",minScrollDelta:10,mixins:[],scrollingHint:!1,batchSize:10,striped:!1,viewportOversize:200},this.adapter=this.createAdapter(),Object.assign(this.options,e),this.mixins=this.options.mixins.map((function(t){return new t(r.adapter)})),this.fragment=t.ownerDocument.createDocumentFragment()}return t.prototype.addMixin=function(t,e){this.mixins.push(new t(this.adapter,e))},t.prototype.createAdapter=function(){var t=this,e={visible:this.visible,addAtBeginning:this.addAtBeginning.bind(this),addAtBottom:this.addAtBottom.bind(this),removeFromBeginning:this.removeFromBeginning.bind(this),removeFromBottom:this.removeFromBottom.bind(this),updateOffset:this.updateOffset.bind(this),isScrollEventWaiting:function(){return wd(t.bodyScroller,t.options.async)}};return Object.defineProperties(e,{visibleFirstRowPos:{get:function(){return t.visibleFirstRowPos},enumerable:!0},context:{get:function(){return t.context},enumerable:!0},scrollOffset:{get:function(){return t.lastScrollInfo?t.lastScrollInfo.top:0},enumerable:!0},scrollTotal:{get:function(){return t.lastScrollInfo?t.lastScrollInfo.height:t.bodyScroller.clientHeight},enumerable:!0}}),e},Object.defineProperty(t.prototype,"bodyScroller",{get:function(){return this.body.parentElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bodySizer",{get:function(){var t=this.bodyScroller,e=Array.from(t.children).find((function(t){return"footer"===t.tagName.toLowerCase()}));if(e)return e;var r=t.ownerDocument.createElement("footer");return r.classList.add(Bd,xd("footer-"+this.idPrefix)),t.insertBefore(r,t.firstChild),r},enumerable:!0,configurable:!0}),t.prototype.init=function(){var t=this,e=this.bodyScroller,r=Td(e,this.options.async,this.scrollListener=function(e){if(t.lastScrollInfo=e,!(Math.abs(r.top-e.top)<t.options.minScrollDelta&&Math.abs(r.height-e.height)<t.options.minScrollDelta)){var n=e.top>r.top;r=e,t.onScrolledVertically(e.top,e.height,n),t.options.scrollingHint&&t.body.classList.remove(Kd)}});this.options.scrollingHint&&Td(e,"animation",(function(){return t.body.classList.add(Kd)})),this.recreate()},t.prototype.destroy=function(){var t,e;t=this.bodyScroller,e=this.scrollListener,t.__le_scroller__&&t.__le_scroller__.remove(e),this.body.remove()},t.cleanUp=function(t){t.style.height=null},t.prototype.select=function(t){var e,r;return this.pool.length>0?(e=this.pool.pop(),r=this.updateRow(e,t)):this.loadingPool.length>0?((e=this.loadingPool.pop()).classList.remove(Od),r=this.createRow(e,t)):((e=this.body.ownerDocument.createElement("div")).classList.add(Wd,xd("tr-"+this.idPrefix)),r=this.createRow(e,t)),e.dataset.index=String(t),this.options.striped&&e.classList.toggle(Gd,t%2==0),{item:e,result:r}},t.prototype.selectProxy=function(){var t;return this.loadingPool.length>0?t=this.loadingPool.pop():(t=this.body.ownerDocument.createElement("div")).classList.add(Od,Wd,xd("tr-"+this.idPrefix)),t},t.prototype.recycle=function(e){(t.cleanUp(e),this.loading.has(e))?this.loading.get(e).abort():this.pool.push(e)},t.prototype.proxy=function(e,r){var n=this;if(!Ju(r))return e;var i=r,o=e,a=this.selectProxy();return a.dataset.index=o.dataset.index,a.style.height=o.style.height,this.loading.set(a,i),i.then((function(e){e===qu?(t.cleanUp(o),n.pool.push(o)):n.body.replaceChild(o,a),n.loading.delete(a),t.cleanUp(a),n.loadingPool.push(a)})),a},t.prototype.create=function(t){var e=this.select(t),r=e.item,n=e.result,i=this.context,o=i.exceptionsLookup,a=i.padding;return o.has(t)&&(r.style.height=o.get(t)-a(t)+"px"),this.proxy(r,n)},t.prototype.removeAll=function(t){void 0===t&&(t=!0);var e=this.body;if(!t)return Array.from(e.children);for(var r=[];e.lastElementChild;){var n=e.lastElementChild;e.removeChild(n),this.recycle(n),r.push(n)}return r},t.prototype.update=function(){var t=this,e=this.visible.first,r=this.fragment,n=Array.from(this.body.children);Rd(this.body),n.forEach((function(n,i){if(t.loading.has(n))r.appendChild(n);else{var o=t.updateRow(n,i+e);r.appendChild(t.proxy(n,o))}})),this.body.appendChild(r)},t.prototype.forEachRow=function(t,e){var r=this;void 0===e&&(e=!1);var n=Array.from(this.body.children),i=this.fragment;e||Rd(this.body),n.forEach((function(n,o){$d(n)||"update_remove"===n.dataset.animation||"hide"===n.dataset.animation||t(n,o+r.visible.first),e||i.appendChild(n)})),e||this.body.appendChild(i)},t.prototype.removeFromBeginning=function(t,e,r){return void 0===r&&(r=!0),this.remove(t,e,!0,r)},t.prototype.removeFromBottom=function(t,e,r){return void 0===r&&(r=!0),this.remove(t,e,!1,r)},t.prototype.remove=function(t,e,r,n){if(void 0===n&&(n=!0),!(e<t)){for(var i=this.body,o=[],a=r?i.firstChild:i.lastChild,s=t;s<=e;++s){var u=a;a=r?a.nextSibling:a.previousSibling,n&&(i.removeChild(u),this.recycle(u)),o.push(u)}return o}},t.prototype.addAtBeginning=function(t,e,r){if(void 0===r&&(r=!0),!(e<t)){var n=this.fragment;if(t!==e||!r){for(var i=t;i<=e;++i)n.appendChild(this.create(i));return r&&this.body.insertBefore(n,this.body.firstChild),n}this.body.insertBefore(this.create(t),this.body.firstChild)}},t.prototype.addAtBottom=function(t,e,r){if(void 0===r&&(r=!0),!(e<t)){if(t!==e||!r){for(var n=this.fragment,i=t;i<=e;++i)n.appendChild(this.create(i));return r&&this.body.appendChild(n),n}this.body.appendChild(this.create(t))}},t.prototype.updateOffset=function(t){this.visibleFirstRowPos=t,this.updateSizer(t)},t.prototype.updateSizer=function(t){var e=this.context.totalHeight;Qd(this.body,0,t.toFixed(0)),Qd(this.bodySizer,0,Math.max(0,e-1).toFixed(0))},t.prototype.recreate=function(t){return this.abortAnimation(),t?this.recreateAnimated(t):this.recreatePure()},t.prototype.recreatePure=function(){var t=this.context,e=this.bodyScroller;this.updateOffset(0),this.removeAll(),this.clearPool();var r=Md(e.scrollTop,e.clientHeight,t.defaultRowHeight,t.exceptions,t.numberOfRows),n=r.first,i=r.last,o=r.firstRowPos;this.visible.first=this.visible.forcedFirst=n,this.visible.last=this.visible.forcedLast=i,n<0?this.updateOffset(0):(this.addAtBottom(n,i),this.updateOffset(o))},t.prototype.recreateAnimated=function(t){var e=this,r=new Map,n=new Nd(t.previous,t.previousKey),i=new Nd(this.context,t.currentKey),o=Md(this.bodyScroller.scrollTop,this.bodyScroller.clientHeight,i.context.defaultRowHeight,i.context.exceptions,i.context.numberOfRows),a=Array.from(this.body.children),s=Object.assign({},this.visible);Rd(this.body),n.positions(s.first,Math.min(s.last,s.first+a.length),this.visibleFirstRowPos,(function(t,e,n){var i=a[t];i&&r.set(e,{n:i,pos:n,i:t})})),this.visible.first=this.visible.forcedFirst=o.first,this.visible.last=this.visible.forcedLast=o.last;var u=this.fragment,l=[],c=o.firstRowPos;i.positions(o.first,o.last,o.firstRowPos,(function(t,o,a){var s,p,f=vd.UPDATE;if(r.has(o)){var h=r.get(o);r.delete(o),h.n.dataset.index=String(t),s=e.proxy(h.n,e.updateRow(h.n,t)),p={index:h.i,y:h.pos,height:n.exceptionHeightOf(h.i,!0)}}else{var d=n.posByKey(o);s=e.create(t),f=d.index<0?vd.SHOW:vd.UPDATE_CREATE,p={index:d.index,y:d.pos>=0?d.pos:a,height:d.index<0?i.exceptionHeightOf(t,!0):n.exceptionHeightOf(d.index,!0)}}l.push({node:s,key:o,mode:f,previous:p,nodeY:c,nodeYCurrentHeight:a,current:{index:t,y:a,height:i.exceptionHeightOf(t)}}),s.style.transform="translate(0, "+(c-a)+"px)",c+=p.height+(p.index<0?i.padding(t):n.padding(p.index)),u.appendChild(s)}));var p=o.endPos;r.forEach((function(t,e){var r=i.posByKey(e),o=r.pos>=0?r.pos:t.pos,a=t.n;a.style.transform="translate(0, "+(t.pos-c)+"px)",u.appendChild(a);var s=n.exceptionHeightOf(t.i,!0);l.push({node:t.n,key:e,mode:r.index<0?vd.HIDE:vd.UPDATE_REMOVE,previous:{index:t.i,y:t.pos,height:s},nodeY:c,nodeYCurrentHeight:p,current:{index:r.index,y:o,height:r.index<0?null:i.exceptionHeightOf(r.index)}}),p+=r.index<0?i.context.defaultRowHeight:i.exceptionHeightOf(r.index,!0)+i.padding(r.index),c+=s+n.padding(t.i)})),this.updateOffset(o.firstRowPos),this.animate(l,t.phases||Cd,n,i,u)},t.prototype.animate=function(t,e,r,n,i){var o=this;if(t.length<=0)this.body.appendChild(i);else{for(var a=-1,s=0,u=function(e,i){void 0===i&&(i=t),i.forEach((function(t){return e.apply(t,r,n)}))},l=function(){if(console.assert(t[0].node.offsetTop>=0,"dummy log for forcing dom update"),u(e[s++]),s<e.length){var r=e[s];a=self.setTimeout(l,r.delay)}else{var n=o.body.classList;Array.from(n).forEach((function(t){t.startsWith(xd())&&t.endsWith("-animation")&&n.remove(t)})),t.forEach((function(t){var e=t.node,r=t.mode;r!==vd.UPDATE_REMOVE&&r!==vd.HIDE||(e.remove(),e.style.transform=null,o.recycle(e))})),o.abortAnimation=function(){},a=-1}};0===e[s].delay;)u(e[s++]);var c=this.body;this.body.appendChild(i);var p=[];t=t.filter((function(t){return e=t,i=r.context.defaultRowHeight,o=n.context.defaultRowHeight,a=e.previous,s=e.mode,u=e.nodeY,l=e.current,c=null==a.height?i:a.height,f=null==l.height?o:l.height,!(s===vd.UPDATE&&Math.abs(a.y-u)<=1&&Math.abs(c-f)<=1)||(p.push(t),!1);var e,i,o,a,s,u,l,c,f})),p.length>0&&e.slice(s).forEach((function(t){return u(t,p)})),0!==t.length&&(c.classList.add(Xd),new Set(t.map((function(t){return t.mode}))).forEach((function(t){c.classList.add(xd(vd[t].toLowerCase().split("_")[0]+"-animation"))})),this.abortAnimation=function(){a<=0||(clearTimeout(a),a=-1,s=e.length-1,l())},a=self.setTimeout(l,e[s].delay))}},t.prototype.clearPool=function(){this.pool.splice(0,this.pool.length)},t.prototype.revalidate=function(){var t=this.bodyScroller;this.onScrolledVertically(t.scrollTop,t.clientHeight,!0),this.updateOffset(this.visibleFirstRowPos)},t.prototype.onScrolledVertically=function(t,e,r){for(var n=this.options.viewportOversize,i=Math.max(0,t-n),o=this.onScrolledImpl(i,e+n+(t-i)),a=0,s=this.mixins;a<s.length;a++){s[a].onScrolled(r,o)}return o},t.prototype.shiftLast=function(t,e){if(e>=this.options.batchSize)return t;var r=this.context.numberOfRows;return Math.min(r-1,t+(this.options.batchSize-e))},t.prototype.shiftFirst=function(t,e,r){if(r>=this.options.batchSize||t<=0)return{first:t,firstRowPos:e};for(var n=Math.max(0,t-(this.options.batchSize-r)),i=this.context,o=i.exceptionsLookup,a=i.defaultRowHeight,s=e,u=n;u<t;++u)o.has(u)?s-=o.get(u):s-=a;return{first:n,firstRowPos:s}},t.prototype.onScrolledImpl=function(t,e){var r=this.context,n=Md(t,e,r.defaultRowHeight,r.exceptions,r.numberOfRows),i=n.first,o=n.last,a=n.firstRowPos,s=this.visible;if(s.forcedFirst=i,s.forcedLast=o,i-s.first>=0&&o-s.last<=0)return Ad.NONE;var u,l,c=Ad.SOME,p=!1;if(i>s.last||o<s.first)u=this.removeAll(!1),l=this.addAtBottom(i,o,!1),p=!0,c=Ad.ALL;else if(i<s.first){s.last-(o+1)>=this.options.batchSize?u=this.removeFromBottom(o+1,s.last,!1):o=s.last;var f=this.shiftFirst(i,a,s.first-1-i);i=f.first,a=f.firstRowPos,l=this.addAtBeginning(i,s.first-1,!1),p=!1,c=Ad.SOME_TOP}else{i-1-s.first>=this.options.batchSize?u=this.removeFromBeginning(s.first,i-1,!1):(i=s.first,a=this.visibleFirstRowPos),o=this.shiftLast(o,o-s.last+1),l=this.addAtBottom(s.last+1,o,!1),p=!0,c=Ad.SOME_BOTTOM}return s.first=i,s.last=o,this.updateOffset(a),this.manipulate(u,l,p),c},t.prototype.manipulate=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n++){var o=i[n];o.remove(),this.recycle(o)}e&&(r?this.body.appendChild(e):this.body.insertBefore(e,this.body.firstChild))},t}();function Qd(t,e,r){var n="translate("+e+"px, "+r+"px)",i=t;i.__transform__!==n&&(i.__transform__=t.style.transform=n)}function Zd(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r],o=e[i];if(o.endsWith(" !important")){var a=o.slice(0,-" !important".length);if(t[i]!==a){t[i]=a;var s=i.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();t.setProperty(s,a,"important")}}else t[i]!==o&&(t[i]=o)}}function tg(t){return{thead:"thead-"+t,tbody:"tbody-"+t,tr:"tr-"+t,th:"th-"+t,td:"td-"+t}}function eg(t){var e=tg(t);return{thead:xd(e.thead),tbody:xd(e.tbody),tr:xd(e.tr),th:xd(e.th),td:xd(e.td)}}var rg=function(t){function e(e,r){var n=t.call(this,e)||this;n.id=r.startsWith("#")?r.slice(1):r,n.ids=tg(n.id),n.cssClasses=eg(n.id);var i=e.getElementsByTagName("header")[0],o=e.getElementsByTagName("main")[0];self.setTimeout((function(){var t=function(t){var e=t.ownerDocument.body;e.insertAdjacentHTML("beforeend",'\n    <div class="'+Pd+'"><div></div></div>\n  ');var r=e.lastElementChild,n=r.offsetWidth-r.clientWidth,i=r.offsetHeight-r.clientHeight;return r.remove(),{width:n,height:i}}(e).width;n.updateRule("__scollBarFix2","#header-"+n.id+" > article:last-of-type",{borderRight:t+"px solid transparent"})}),20);var a=i.scrollLeft;return Td(o,"animation",(function(t){var r=t.left;a!==r&&(a=i.scrollLeft=r),e.classList.toggle(Hd,t.left>0)})),n}return i(e,t),e.prototype.update=function(t,e,r,n,i,o){void 0===o&&(o="px");var a=tg(i),s=eg(i),u=""+e.reduce((function(t,e,n){return t+e.width+r(n)}),0)+o;this.updateRule("__heightsRule"+s.tr,"."+s.tr,{height:t+"px",width:u}),this.updateRule("__heightsRule"+s.tbody,"#"+a.tbody,{width:u}),this.updateColumns(e,r,s,n,o)},e.prototype.remove=function(t){var e=eg(t);this.deleteRule("__heightsRule"+e.tr),this.deleteRule("__heightsRule"+e.tbody);for(var r="__col"+e.td+"_",n=this.ruleNames.reduce((function(t,e){return t+(e.startsWith(r)?1:0)}),0),i=0;i<n;++i)this.deleteRule(""+r+i)},e.prototype.updateColumns=function(t,e,r,n,i){var o=this;void 0===i&&(i="px");var a="__col"+r.td+"_",s=new Set(this.ruleNames.filter((function(t){return t.startsWith(a)}))),u=0;t.forEach((function(t,l){var c="."+r.th+'[data-id="'+t.id+'"]',p={width:""+t.width+i},f="."+r.td+'[data-id="'+t.id+'"]',h={transform:"translateX("+u+i+")",width:""+t.width+i};t.frozen&&(p.left=u+"px",o.updateRule(""+a+f+"F","."+r.td+"."+Hd+'[data-id="'+t.id+'"]',{transform:"translateX(0)",left:""+(u+n)+i}),s.delete(""+a+f+"F")),o.updateRule(""+a+c,c,p),s.delete(""+a+c),o.updateRule(""+a+f,f,h),s.delete(""+a+f),u+=t.width+e(l)})),s.forEach((function(t){return o.deleteRule(t)}))},e}(function(){function t(t){this.rules=[],this.testVerifyTimeout=-1,this.node=t.ownerDocument.createElement("style"),this.node.appendChild(t.ownerDocument.createTextNode("")),t.appendChild(this.node)}return t.prototype.destroy=function(){this.node.remove()},t.prototype.verifySheet=function(){var t=this,e=this.sheet;if(e){var r=e.cssRules;if(r.length!==this.rules.length||!this.rules.every((function(t,e){return r[e].selectorText===t.selector}))){console.warn("invalid sheet rules detected");for(var n=r.length,i=0;i<n;++i)e.deleteRule(i);for(var o=0,a=this.rules;o<a.length;o++){var s=a[o],u=e.insertRule(s.selector+" {}",e.cssRules.length),l=e.cssRules[u];s.selector=l.selectorText,Zd(l.style,s.style)}}}else{if(this.testVerifyTimeout>=0)return;this.testVerifyTimeout=self.setTimeout((function(){t.testVerifyTimeout=-1,t.verifySheet()}),20)}},Object.defineProperty(t.prototype,"sheet",{get:function(){return this.node.sheet},enumerable:!0,configurable:!0}),t.prototype.getSheetRule=function(t){var e=this.sheet;return e?e.cssRules[t]:null},t.prototype.addRule=function(t,e,r){this.verifySheet();var n=this.sheet;if(n){var i=n.insertRule(e+" {}",n.cssRules.length),o=n.cssRules[i];return this.rules.push({id:t,selector:o.selectorText,style:r}),Zd(o.style,r),t}this.rules.push({id:t,selector:e,style:r})},t.prototype.updateRule=function(t,e,r){this.verifySheet();var n=this.rules.findIndex((function(e){return e.id===t}));if(n<0)return this.addRule(t,e,r);var i=this.rules[n];i.selector=e,i.style=r;var o=this.getSheetRule(n);return o&&(o.selectorText.replace(/\s/gm,"")!==e.replace(/\s/gm,"")&&(o.selectorText=e,i.selector=o.selectorText),Zd(o.style,r)),t},t.prototype.deleteRule=function(t){this.verifySheet();var e=this.rules.findIndex((function(e){return e.id===t}));if(!(e<0)){this.rules.splice(e,1);var r=this.sheet;r&&r.deleteRule(e)}},Object.defineProperty(t.prototype,"ruleNames",{get:function(){return this.rules.map((function(t){return t.id}))},enumerable:!0,configurable:!0}),t}());var ng=function(){function t(t,e,r){var n=this;void 0===r&&(r={}),this.node=t,this.tableId=0,this.sections=[],this.options={columnPadding:0,async:"animation",minScrollDelta:30},Object.assign(this.options,r),e=e.startsWith("#")?e.slice(1):e,t.id=e,t.innerHTML='<header id="header-'+e+'" class="'+Fd+" "+xd("header-"+e)+'">\n      <footer class="'+Bd+" "+xd("footer-"+e)+'">&nbsp;</footer>\n    </header>\n    <main id="body-'+e+'" class="'+Ud+" "+xd("body-"+e)+'">\n      <footer class="'+Bd+'">&nbsp;</footer>\n    </main>',t.classList.add(xd(),kd,"lineup-engine"),this.style=new rg(this.node,e);var i=Td(this.main,this.options.async,(function(t){if(!(Math.abs(i.left-t.left)<n.options.minScrollDelta&&Math.abs(i.width-t.width)<n.options.minScrollDelta)){var e=t.left>i.left;i=t,n.onScrolledHorizontally(t.left,t.width,e)}}))}return t.prototype.update=function(){var t=this;this.onScrolledHorizontally(this.main.scrollLeft,this.main.clientWidth,!1);var e=0;this.sections.forEach((function(r){r.body.style.left=r.header.style.left=e+"px",e+=r.width+t.options.columnPadding}))},t.prototype.onScrolledHorizontally=function(t,e,r){var n=this,i=0,o=t+e;this.sections.forEach((function(e){var a=i+e.width;a<t||i>o?e.hide():e.show(Math.max(0,t-i),Math.min(o-i,e.width),r),i=a+n.options.columnPadding})),this.updateOffset()},t.prototype.updateOffset=function(){var t=this,e=this.header.getElementsByTagName("footer")[0],r=this.main.getElementsByTagName("footer")[0],n=Math.max.apply(Math,[0].concat(this.sections.map((function(t){return t.height})))),i=this.sections.reduce((function(e,r){return e+r.width+t.options.columnPadding}),0);Qd(e,i,0),Qd(r,i,n)},t.prototype.destroy=function(){this.sections.forEach((function(t){return t.destroy()})),this.node.remove()},Object.defineProperty(t.prototype,"doc",{get:function(){return this.node.ownerDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"header",{get:function(){return this.node.getElementsByTagName("header")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"main",{get:function(){return this.node.getElementsByTagName("main")[0]},enumerable:!0,configurable:!0}),t.prototype.pushTable=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.doc.createElement("article"),i=this.doc.createElement("article"),o=this.node.id+"T"+this.tableId++,a=tg(o),s=eg(o);n.id=a.thead,n.classList.add(jd,s.thead),i.id=a.tbody,i.classList.add(Yd,s.tbody),this.header.insertBefore(n,this.header.lastElementChild),this.main.appendChild(i);var u=t.apply(void 0,[n,i,o,this.style].concat(e));return u.init(),this.sections.push(u),this.update(),u},t.prototype.pushSeparator=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.doc.createElement("section"),i=this.doc.createElement("section");n.classList.add(xd("header-separator")),i.classList.add(xd("separator")),this.header.insertBefore(n,this.header.lastElementChild),this.main.appendChild(i);var o=t.apply(void 0,[n,i,this.style].concat(e));return o.init(),this.sections.push(o),this.update(),o},t.prototype.remove=function(t){var e=this.sections.indexOf(t);return!(e<0)&&(this.sections.splice(e,1),t.destroy(),this.update(),!0)},t.prototype.clear=function(){this.sections.splice(0,this.sections.length).forEach((function(t){return t.destroy()})),this.update()},t.prototype.widthChanged=function(){this.update()},t}();var ig=function(){function t(t,e){return this.adapter=t,this.prefetchTimeout=-1,this.cleanupTimeout=-1,this.options={prefetchRows:20,cleanUpRows:10,delay:200},Object.assign(this.options,e),this}return t.prototype.prefetchDown=function(){if(this.prefetchTimeout=-1,!this.adapter.isScrollEventWaiting()){var t=this.adapter.context,e=Math.min(this.adapter.visible.forcedLast+this.options.prefetchRows,t.numberOfRows-1);this.adapter.visible.last===e&&this.adapter.visible.last>=this.adapter.visible.forcedLast+this.options.prefetchRows||(this.adapter.addAtBottom(this.adapter.visible.last+1,e),this.adapter.visible.last=e)}},t.prototype.prefetchUp=function(){if(this.prefetchTimeout=-1,!(this.adapter.isScrollEventWaiting()||this.adapter.visible.first<=this.adapter.visible.forcedFirst-this.options.prefetchRows)){var t=this.adapter.context,e=Md(Math.max(this.adapter.scrollOffset-this.options.prefetchRows*t.defaultRowHeight,0),this.adapter.scrollTotal,t.defaultRowHeight,t.exceptions,t.numberOfRows),r=e.first,n=e.firstRowPos;if(r!==this.adapter.visible.first){var i=this.adapter.syncFrozen?this.adapter.syncFrozen(r):0;this.adapter.addAtBeginning(r,this.adapter.visible.first-1,i),this.adapter.visible.first=r,this.adapter.updateOffset(n)}}},t.prototype.triggerPrefetch=function(t){this.prefetchTimeout>=0&&clearTimeout(this.prefetchTimeout);var e=this.adapter.visible.last<this.adapter.visible.forcedLast+this.options.prefetchRows,r=this.adapter.visible.first>this.adapter.visible.forcedFirst-this.options.prefetchRows,n=this.adapter.visible.last===this.adapter.context.numberOfRows,i=0===this.adapter.visible.first;if((!t||e||n)&&(t||r||i)){var o=t||i?this.prefetchDown.bind(this):this.prefetchUp.bind(this);this.prefetchTimeout=self.setTimeout(o,this.options.delay)}},t.prototype.cleanUpTop=function(t){if(this.cleanupTimeout=-1,!this.adapter.isScrollEventWaiting()){var e=Math.max(0,t-this.options.cleanUpRows);if(!(e<=this.adapter.visible.first)){var r=this.adapter.syncFrozen?this.adapter.syncFrozen(e):0;this.adapter.removeFromBeginning(this.adapter.visible.first,e-1,r);var n=this.adapter.context,i=(e-this.adapter.visible.first)*n.defaultRowHeight;if(n.exceptions.length>0)for(var o=this.adapter.visible.first;o<e;++o)n.exceptionsLookup.has(o)&&(i+=n.exceptionsLookup.get(o)-n.defaultRowHeight);this.adapter.visible.first=e,this.adapter.updateOffset(this.adapter.visibleFirstRowPos+i),this.prefetchDown()}}},t.prototype.cleanUpBottom=function(t){this.cleanupTimeout=-1;var e=t+this.options.cleanUpRows;this.adapter.visible.last<=e||(this.adapter.removeFromBottom(e+1,this.adapter.visible.last),this.adapter.visible.last=e,this.prefetchUp())},t.prototype.triggerCleanUp=function(t,e,r){this.cleanupTimeout>=0&&clearTimeout(this.cleanupTimeout),r&&t-this.options.cleanUpRows<=this.adapter.visible.first||!r&&this.adapter.visible.last<=e+this.options.cleanUpRows||(this.cleanupTimeout=self.setTimeout(r?this.cleanUpTop.bind(this):this.cleanUpBottom.bind(this),this.options.delay,r?t:e))},t.prototype.onScrolled=function(t,e){this.adapter.isScrollEventWaiting()||(e!==Ad.ALL&&this.options.cleanUpRows>0&&this.triggerCleanUp(this.adapter.visible.forcedFirst,this.adapter.visible.forcedLast,t),e!==Ad.NONE&&this.options.prefetchRows>0&&this.triggerPrefetch(t))},t}(),og=function(){function t(t,e,r){for(var n=this,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];this.header=t,this.style=e,this.tableId=r,this.cellPool=[],this.loading=new WeakMap,this.visibleColumns={frozen:[],first:0,forcedFirst:0,last:-1,forcedLast:-1},this.visibleFirstColumnPos=0,this.horizontallyShifted=!1,this.columnAdapter=this.createColumnAdapter(),this.columnMixins=i.map((function(t){return new t(n.columnAdapter)})),this.columnFragment=t.ownerDocument.createDocumentFragment()}return t.prototype.leftShift=function(){var t=this.context,e=this.visibleColumns.frozen.reduce((function(e,r){return e+t.columns[r].width+t.column.padding(r)}),0);return this.visibleFirstColumnPos-e},Object.defineProperty(t.prototype,"headerScroller",{get:function(){return this.header.parentElement},enumerable:!0,configurable:!0}),t.prototype.addColumnMixin=function(t,e){this.columnMixins.push(new t(this.columnAdapter,e))},t.prototype.createColumnAdapter=function(){var t=this,e={visible:this.visibleColumns,addAtBeginning:this.addColumnAtStart.bind(this),addAtBottom:this.addColumnAtEnd.bind(this),removeFromBeginning:this.removeColumnFromStart.bind(this),removeFromBottom:this.removeColumnFromEnd.bind(this),updateOffset:this.updateColumnOffset.bind(this),scroller:this.headerScroller,syncFrozen:this.syncFrozen.bind(this),isScrollEventWaiting:function(){return wd(t.headerScroller,"animation")}};return Object.defineProperties(e,{visibleFirstRowPos:{get:function(){return t.visibleFirstColumnPos},enumerable:!0},context:{get:function(){return t.context.column},enumerable:!0},scrollOffset:{get:function(){return t.lastScrollInfo?t.lastScrollInfo.left:0},enumerable:!0},scrollTotal:{get:function(){return t.lastScrollInfo?t.lastScrollInfo.width:t.headerScroller.clientWidth},enumerable:!0}}),e},t.prototype.init=function(){var t=this,e=this.context;this.style.update(e.defaultRowHeight-e.padding(-1),e.columns,e.column.padding,0,this.tableId),e.columns.forEach((function(){t.cellPool.push([])}))},t.prototype.onScrolledHorizontally=function(t,e,r){for(var n=this.onScrolledHorizontallyImpl(t,e),i=0,o=this.columnMixins;i<o.length;i++){o[i].onScrolled(r,n)}return n},t.prototype.removeColumnFromStart=function(t,e,r){var n=this;void 0===r&&(r=this.visibleColumns.frozen.length),this.forEachRow((function(i){n.removeCellFromStart(i,t,e,r)}))},t.prototype.removeCellFromStart=function(t,e,r,n){for(var i=e;i<=r;++i){var o=0===n?t.firstElementChild:t.children[n];o.remove(),this.recycleCell(o,i)}},t.prototype.removeColumnFromEnd=function(t,e){var r=this;this.forEachRow((function(n){r.removeCellFromEnd(n,t,e)}))},t.prototype.removeCellFromEnd=function(t,e,r){for(var n=r;n>=e;--n){var i=t.lastElementChild;i.remove(),this.recycleCell(i,n)}},t.prototype.removeFrozenCells=function(t,e,r){for(var n=0,i=e;n<i.length;n++){var o=i[n],a=t.children[r];a.remove(),this.recycleCell(a,o)}},t.prototype.removeFrozenColumns=function(t,e){var r=this;this.forEachRow((function(n){r.removeFrozenCells(n,t,e)}))},t.prototype.removeAllColumns=function(t){var e=this;this.forEachRow((function(r){e.removeAllCells(r,t)}))},t.prototype.removeAllCells=function(t,e,r){var n=this;void 0===r&&(r=this.visibleColumns.first);var i=Array.from(t.children),o=this.visibleColumns.frozen;if(Rd(t),e||0===o.length)for(var a=0,s=o;a<s.length;a++){var u=s[a];this.recycleCell(i.shift(),u)}else for(var l=0,c=o;l<c.length;l++){c[l];t.appendChild(i.shift())}i.forEach((function(t,e){n.recycleCell(t,e+r)}))},t.prototype.selectProxyCell=function(t,e,r){var n,i,o=this.cellPool[e],a=r[e],s=o.pop(),u=s?this.updateCell(s,t,a)||s:this.createCell(this.header.ownerDocument,t,a);return Qu(u)?(n=u.item,i=u.ready):n=u,n!==s&&(n.dataset.id=a.id,n.classList.add(qd,this.style.cssClasses.td,xd("td-"+this.tableId))),this.updateShiftedState(n,a),{item:n,ready:i}},t.prototype.handleCellReady=function(t,e,r){var n=this;void 0===r&&(r=-1),t.classList.add(Od);var i=e;return this.loading.set(t,i),i.then((function(e){n.loading.delete(t),t.classList.remove(Od),e===qu&&r>=0&&n.cellPool[r].push(t)})),t},t.prototype.selectCell=function(t,e,r){var n=this.selectProxyCell(t,e,r),i=n.item,o=n.ready;return Ju(o)?this.handleCellReady(i,o,e):i},t.prototype.updateShiftedState=function(t,e){t.classList.toggle(Hd,e.frozen&&this.horizontallyShifted)},t.prototype.recycleCell=function(t,e){(void 0===e&&(e=-1),this.loading.has(t))?this.loading.get(t).abort():!$d(t)&&e>=0&&this.cellPool[e].push(t)},t.prototype.addColumnAtStart=function(t,e,r){var n=this;void 0===r&&(r=this.visibleColumns.frozen.length);var i=this.context.columns;this.forEachRow((function(o,a){n.addCellAtStart(o,a,t,e,r,i)}))},t.prototype.addCellAtStart=function(t,e,r,n,i,o){for(var a=n;a>=r;--a){var s=this.selectCell(e,a,o);t.insertBefore(s,i>0?t.children[i]:t.firstChild)}},t.prototype.insertFrozenCells=function(t,e,r,n,i){for(var o=t.children[n],a=0,s=r;a<s.length;a++){var u=s[a],l=this.selectCell(e,u,i);o?t.insertBefore(l,o):t.appendChild(l)}},t.prototype.insertFrozenColumns=function(t,e){var r=this,n=this.context.columns;this.forEachRow((function(i,o){r.insertFrozenCells(i,o,t,e,n)}))},t.prototype.addColumnAtEnd=function(t,e){var r=this,n=this.context.columns;this.forEachRow((function(i,o){r.addCellAtEnd(i,o,t,e,n)}))},t.prototype.verifyRows=function(){var t=this.context.columns;this.forEachRow((function(e,r){return ag(e,r,t)}))},t.prototype.addCellAtEnd=function(t,e,r,n,i){for(var o=r;o<=n;++o){var a=this.selectCell(e,o,i);t.appendChild(a)}},t.prototype.updateHeaders=function(){var t=this,e=this.context.columns;Array.from(this.header.children).forEach((function(r,n){var i,o=r,a=e[n],s=t.updateHeader(o,a);(i=Qu(s)?t.handleCellReady(s.item,s.ready,-1):s||o)!==o&&(i.dataset.id=a.id,i.classList.add(zd,t.style.cssClasses.th,xd("th-"+t.tableId)),t.header.replaceChild(o,i))}))},t.prototype.recreate=function(t,e){var r=this,n=this.context;this.style.update(n.defaultRowHeight-n.padding(-1),n.columns,n.column.padding,-this.leftShift(),this.tableId),this.clearPool();for(var i=this.cellPool.length;i<n.columns.length;++i)this.cellPool.push([]);for(var o=this.columnFragment,a=o.ownerDocument,s=new Map;this.header.lastChild;){var u=this.header.lastChild;this.header.removeChild(u),s.set(u.dataset.id,u)}n.columns.forEach((function(t){var e,n=s.get(t.id),i=n?r.updateHeader(n,t)||n:r.createHeader(a,t);(e=Qu(i)?r.handleCellReady(i.item,i.ready,-1):i)!==n&&(e.dataset.id=t.id,e.classList.add(zd,r.style.cssClasses.th,xd("th-"+r.tableId))),o.appendChild(e)})),this.header.appendChild(o);var l=Md(t,e,n.column.defaultRowHeight,n.column.exceptions,n.column.numberOfRows),c=l.first,p=l.last,f=l.firstRowPos;if(this.visibleColumns.first=this.visibleColumns.forcedFirst=c,this.visibleColumns.last=this.visibleColumns.forcedLast=p,n.columns.some((function(t){return t.frozen}))){var h=Ld([],n.columns,c).target;this.visibleColumns.frozen=h}else this.visibleColumns.frozen=[];this.updateColumnOffset(f)},t.prototype.clearPool=function(){this.cellPool.forEach((function(t){return t.splice(0,t.length)}))},t.prototype.updateColumnOffset=function(t){var e=t!==this.visibleFirstColumnPos;if(this.visibleFirstColumnPos=t,e){var r=this.context;this.style.update(r.defaultRowHeight-r.padding(-1),r.columns,r.column.padding,-this.leftShift(),this.tableId)}},t.prototype.createRow=function(t,e){var r=this.context.columns,n=this.visibleColumns;if(n.frozen.length>0)for(var i=0,o=n.frozen;i<o.length;i++){var a=o[i],s=this.selectCell(e,a,r);t.appendChild(s)}for(a=n.first;a<=n.last;++a){s=this.selectCell(e,a,r);t.appendChild(s)}},t.prototype.updateRow=function(t,e){var r=this.context.columns,n=this.visibleColumns;switch(t.childElementCount){case 0:n.frozen.length>0&&this.insertFrozenCells(t,e,n.frozen,0,r),this.addCellAtEnd(t,e,n.first,n.last,r);break;case 1:var i=t.firstElementChild,o=i.dataset.id,a=r.findIndex((function(t){return t.id===o}));t.removeChild(i),a>=0&&this.recycleCell(i,a),n.frozen.length>0&&this.insertFrozenCells(t,e,n.frozen,0,r),this.addCellAtEnd(t,e,n.first,n.last,r);break;default:this.mergeColumns(t,e)}},t.prototype.mergeColumns=function(t,e){for(var r=this,n=this.context.columns,i=this.visibleColumns,o=new Map;t.lastChild;){var a=t.lastChild;t.removeChild(a),o.set(a.dataset.id,a)}for(var s=function(i){var a=n[i],s=o.get(a.id);if(s){o.delete(a.id);var u,l=r.updateCell(s,e,a)||s;(u=Qu(l)?r.handleCellReady(l.item,l.ready,i):l)&&u!==s&&(u.dataset.id=a.id,u.classList.add(qd,r.style.cssClasses.td,xd("td-"+r.tableId))),r.updateShiftedState(u,a),t.appendChild(u)}else{var c=r.selectCell(e,i,n);t.appendChild(c)}},u=0,l=i.frozen;u<l.length;u++){s(l[u])}for(var c=i.first;c<=i.last;++c)s(c);if(0!==o.size){var p=new Map(n.map((function(t,e){return[t.id,e]})));o.forEach((function(t,e){var n=p.get(e);null!=n&&n>=0&&r.recycleCell(t,n)}))}},t.prototype.updateShiftedStates=function(){if(this.context.columns.some((function(t){return t.frozen}))){var t=this.horizontallyShifted,e=Hd;if(t){for(var r=Array.from(this.header.querySelectorAll("."+Vd+":not(."+e+")")),n=Array.from(this.body.querySelectorAll("."+Vd+":not(."+e+")")),i=0,o=r;i<o.length;i++){o[i].classList.add(e)}for(var a=0,s=n;a<s.length;a++){s[a].classList.add(e)}}else{r=Array.from(this.header.querySelectorAll("."+Vd+"."+e)),n=Array.from(this.body.querySelectorAll("."+Vd+"."+e));for(var u=0,l=r;u<l.length;u++){l[u].classList.remove(e)}for(var c=0,p=n;c<p.length;c++){p[c].classList.remove(e)}}}},t.prototype.syncFrozen=function(t){var e=this.context.columns,r=this.visibleColumns;if(!e.some((function(t){return t.frozen})))return 0;if(0===t)return r.frozen.length>0&&(this.removeFrozenColumns(r.frozen,0),r.frozen=[]),0;var n=r.frozen.length,i=Ld(r.frozen,e,t),o=i.target,a=i.added,s=i.removed;return s.length>0&&this.removeFrozenColumns(s,n-s.length),a.length>0&&this.insertFrozenColumns(a,n-s.length),r.frozen=o,o.length},t.prototype.onScrolledHorizontallyImpl=function(t,e){var r=this.horizontallyShifted!==t>0;this.horizontallyShifted=t>0;var n=this.context.column,i=Md(t,e,n.defaultRowHeight,n.exceptions,n.numberOfRows),o=i.first,a=i.last,s=i.firstRowPos,u=this.visibleColumns;if(u.forcedFirst=o,u.forcedLast=a,o-u.first>=0&&a-u.last<=0)return r&&this.updateShiftedStates(),Ad.NONE;var l=Ad.SOME,c=this.syncFrozen(o);return o>u.last||a<u.first?(this.removeAllColumns(!1),this.addColumnAtEnd(o,a),l=Ad.ALL):o<u.first?(this.removeColumnFromEnd(a+1,u.last),this.updateShiftedStates(),this.addColumnAtStart(o,u.first-1,c),l=Ad.SOME_TOP):(this.removeColumnFromStart(u.first,o-1,c),this.updateShiftedStates(),this.addColumnAtEnd(u.last+1,a),l=Ad.SOME_BOTTOM),u.first=o,u.last=a,this.updateColumnOffset(s),l},t}();function ag(t,e,r){var n=Array.from(t.children);if(!(n.length<=1)){var i=n.map((function(t){return r.find((function(e){return e.id===t.dataset.id}))}));console.assert(i.every((function(t){return Boolean(t)})),"all columns must exist",e),console.assert(i.every((function(t,e){return 0===e||t.index>=i[e-1].index})),"all columns in ascending order",e),console.assert(new Set(i).size===i.length,"unique columns",i)}}var sg=function(t){function e(e,r,n,o,a){void 0===a&&(a={});var s=t.call(this,r,a)||this;s.header=e,s.body=r,s.tableId=n,s.style=o;var u=s,l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"context",{get:function(){return u.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return u.body},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastScrollInfo",{get:function(){return u.lastScrollInfo},enumerable:!0,configurable:!0}),e.prototype.createHeader=function(t,e){return u.createHeader(t,e)},e.prototype.updateHeader=function(t,e){return u.updateHeader(t,e)},e.prototype.createCell=function(t,e,r){return u.createCell(t,e,r)},e.prototype.updateColumnOffset=function(e){t.prototype.updateColumnOffset.call(this,e),u.updateOffset(u.visibleFirstRowPos)},e.prototype.updateCell=function(t,e,r){return u.updateCell(t,e,r)},e.prototype.forEachRow=function(t){return u.forEachRow(t)},e}(og);return s.cell=new(l.bind.apply(l,[void 0,s.header,s.style,n].concat(a.mixins||[]))),s}return i(e,t),e.prototype.addColumnMixin=function(t,e){this.cell.addColumnMixin(t,e)},Object.defineProperty(e.prototype,"idPrefix",{get:function(){return this.tableId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.context.column.totalHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleColumns",{get:function(){return this.cell.visibleColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleFirstColumnPos",{get:function(){return this.cell.visibleFirstColumnPos},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.context.totalHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this.header.classList.contains(Od)},set:function(t){this.hidden!==t&&(this.header.classList.toggle(Od,t),this.body.classList.toggle(Od,t),this.header.classList.toggle(Id,t),this.body.classList.toggle(Id,t),this.onVisibilityChanged(!t))},enumerable:!0,configurable:!0}),e.prototype.updateSizer=function(t){this.updateShifts(t,this.cell.leftShift())},e.prototype.updateShifts=function(t,e){Qd(this.body,0,t.toFixed(0))},e.prototype.onVisibilityChanged=function(t){},e.prototype.hide=function(){this.hidden=!0},e.prototype.show=function(t,e,r){var n=this.hidden;this.hidden=!1,n?this.revalidate():this.onScrolledHorizontally(t,e,r)},e.prototype.init=function(){this.hide(),this.cell.init(),t.prototype.init.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.header.remove(),this.style.remove(this.tableId)},e.prototype.onScrolledVertically=function(e,r,n){return this.hidden?Ad.NONE:t.prototype.onScrolledVertically.call(this,e,r,n)},e.prototype.onScrolledHorizontally=function(t,e,r){var n=this.cell.onScrolledHorizontally(t,e,r);return this.updateSizer(this.visibleFirstRowPos),n},e.prototype.updateHeaders=function(){this.cell.updateHeaders()},e.prototype.handleCellReady=function(t,e,r){return void 0===r&&(r=-1),this.cell.handleCellReady(t,e,r)},e.prototype.recycleCell=function(t,e){void 0===e&&(e=-1),this.cell.recycleCell(t,e)},e.prototype.updateColumnWidths=function(){var t=this.context;this.style.update(t.defaultRowHeight-t.padding(-1),t.columns,t.column.padding,-this.cell.leftShift(),this.tableId)},e.prototype.recreate=function(e){var r=this.bodyScroller,n=r.scrollLeft;this.cell.recreate(n,r.clientWidth),t.prototype.recreate.call(this,e),r.scrollLeft=n},e.prototype.clearPool=function(){t.prototype.clearPool.call(this),this.cell.clearPool()},e.prototype.createRow=function(t,e){this.cell.createRow(t,e),t.classList.add(this.style.cssClasses.tr)},e.prototype.updateRow=function(t,e){this.cell.updateRow(t,e)},e}(Jd);function ug(t){var e=new Map,r=new Map;return t.forEach((function(t,n){if(lt(t))for(var i=0;i<t.order.length;++i)e.set(i,n);else t.group&&0===t.relativeIndex&&r.set(t.group.name,n)})),{item2groupIndex:e,group2firstItemIndex:r}}function lg(t){return lt(t)?t.name:t.dataIndex.toString()}function cg(t,e,r){var n,i=function(t){return lg(e[t])},o=function(t){return lg(r[t])};if(e.reduce((function(t,e){return t+(lt(e)?1:0)}),0)===r.reduce((function(t,e){return t+(lt(e)?1:0)}),0))return{currentKey:o,previous:t,previousKey:i};var a,s=[Object.assign({},Cd[0],{apply:function(t,o){Cd[0].apply(t),t.mode===vd.SHOW&&(t.node.style.transform="translate(0, "+(function(t,o,a){n||(n=ug(e));var s=r[t],u=lt(s)?n.group2firstItemIndex.get(s.name):n.item2groupIndex.get(s.dataIndex);if(void 0===u)return a;var l=o.posByKey(i(u));return l.pos>=0?l.pos:a}(t.current.index,o,t.previous.y)-t.nodeY)+"px)")}}),Object.assign({},Cd[1],{apply:function(t,n,i){Cd[1].apply(t),t.mode===vd.HIDE&&(t.node.style.transform="translate(0, "+(function(t,n,i){a||(a=ug(r));var s=e[t],u=lt(s)?a.group2firstItemIndex.get(s.name):a.item2groupIndex.get(s.dataIndex);if(void 0===u)return i;var l=n.posByKey(o(u));return l.pos>=0?l.pos:i}(t.previous.index,i,t.current.y)-t.nodeY)+"px)")}}),Cd[Cd.length-1]];return{previous:t,previousKey:i,currentKey:o,phases:s}}var pg=function(){function t(t,e,r,n){this.c=t,this.index=e,this.ctx=r,this.flags=n,this.renderers=null}return Object.defineProperty(t.prototype,"width",{get:function(){return this.c.getWidth()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.c.id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"frozen",{get:function(){return!this.flags.disableFrozenColumns&&this.c.frozen},enumerable:!0,configurable:!0}),t.prototype.singleRenderer=function(){if(!this.renderers||!this.renderers.single)return null;if(this.renderers.singleTemplate)return this.renderers.singleTemplate.cloneNode(!0);var t=this.ctx.asElement(this.renderers.single.template);return t.classList.add(qn("renderer-"+this.renderers.singleId),qn("detail")),t.dataset.renderer=this.renderers.singleId,t.dataset.group="d",this.renderers.singleTemplate=t.cloneNode(!0),t},t.prototype.groupRenderer=function(){if(!this.renderers||!this.renderers.group)return null;if(this.renderers.groupTemplate)return this.renderers.groupTemplate.cloneNode(!0);var t=this.ctx.asElement(this.renderers.group.template);return t.classList.add(qn("renderer-"+this.renderers.groupId),qn("group")),t.dataset.renderer=this.renderers.groupId,t.dataset.group="g",this.renderers.groupTemplate=t.cloneNode(!0),t},t.prototype.summaryRenderer=function(){if(!this.renderers||!this.renderers.summary)return null;if(this.renderers.summaryTemplate)return this.renderers.summaryTemplate.cloneNode(!0);var t=this.ctx.asElement(this.renderers.summary.template);return t.classList.add(qn("summary"),qn("th-summary"),qn("renderer-"+this.renderers.summaryId)),t.dataset.renderer=this.renderers.summaryId,this.renderers.summaryTemplate=t.cloneNode(!0),t},t.prototype.createHeader=function(){var t=mh(this.c,this.ctx,{extraPrefix:"th",dragAble:this.flags.advancedUIFeatures,mergeDropAble:this.flags.advancedModelFeatures,rearrangeAble:this.flags.advancedUIFeatures,resizeable:this.flags.advancedUIFeatures});if(t.classList.add(qn("header")),this.flags.disableFrozenColumns||t.classList.toggle(Kn("frozen"),this.frozen),this.renderers&&this.renderers.summary){var e=this.summaryRenderer();t.appendChild(e)}return this.updateHeader(t)},t.prototype.hasSummaryLine=function(){return Boolean(this.c.getMetaData().summary)},t.prototype.updateHeader=function(t){if(yh(t,this.c),!this.renderers||!this.renderers.summary)return t;var e=t.getElementsByClassName(qn("summary"))[0];e.dataset.renderer!==this.renderers.summaryId&&(e.remove(),e=this.summaryRenderer(),t.appendChild(e));var r=this.renderers.summary.update(e);return r?{item:t,ready:r}:t},t.prototype.createCell=function(t){var e=this.ctx.isGroup(t)?this.groupRenderer():this.singleRenderer();return this.updateCell(e,t)},t.prototype.updateCell=function(t,e){var r=this;this.flags.disableFrozenColumns||t.classList.toggle(Kn("frozen"),this.frozen);var n,i=this.ctx.isGroup(e),o=t.dataset.renderer,a=i?this.renderers.groupId:this.renderers.singleId,s=t.dataset.group;if(o===a&&s===(i?"g":"d")||(t=i?this.groupRenderer():this.singleRenderer()),i){var u=this.ctx.getGroup(e);n=this.renderers.group.update(t,u)}else{var l=this.ctx.getRow(e),c=this.ctx.provider.getRow(l.dataIndex);n=I(c)?fg(c,(function(e){return r.renderers.single.update(t,e,l.relativeIndex,l.group)})):this.renderers.single.update(t,c,l.relativeIndex,l.group)}return n?{item:t,ready:n}:t},t.prototype.renderCell=function(t,e){var r=this.ctx.getRow(e),n=this.renderers.single;if(!n.render)return!1;var i=this.ctx.provider.getRow(r.dataIndex);return I(i)?fg(i,(function(e){return n.render(t,e,r.relativeIndex,r.group)||!1})):n.render(t,i,r.relativeIndex,r.group)||!1},t}();function fg(t,e){var r=!1,n=new Promise((function(i){r||t.then((function(t){if(!r){var o=e(t);return Ju(o)?(n.abort=o.abort.bind(o),n.then(i)):i(o)}}))}));return n.abort=function(){r=!0},n}var hg,dg=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.summaries=[],o}return i(e,t),Object.defineProperty(e.prototype,"mc",{get:function(){return this.c},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.c.getWidth()+In*this.mc.length},enumerable:!0,configurable:!0}),e.prototype.createHeader=function(){var e=t.prototype.createHeader.call(this),r=this.ctx.document.createElement("div");return r.classList.add(qn("nested")),r.classList.add(gc(this.ctx.idPrefix,this.c)),Qu(e)?e.item.appendChild(r):e.appendChild(r),this.updateNested(r,e)},e.prototype.matchChildren=function(t,e){var r=this;if(!e.every((function(e,r){var n=t.children[r];return null!=n&&n.dataset.colId===e.id}))||e.length!==t.childElementCount){var n=new Map(Array.from(t.children).map((function(t,e){return[t.dataset.colId,{node:t,summary:r.summaries[e]}]})));this.summaries=[],e.forEach((function(e,i){var o=n.get(e.id);if(o){n.delete(e.id);var a=o.node;return a.style.gridColumnStart=(i+1).toString(),t.appendChild(a),void(r.summaries[i]=o.summary)}var s=mh(e,r.ctx,{extraPrefix:"th",mergeDropAble:!1,dragAble:r.flags.advancedModelFeatures,rearrangeAble:r.flags.advancedModelFeatures,resizeable:r.flags.advancedModelFeatures});if(s.classList.add(qn("header"),qn("nested-th")),s.style.gridColumnStart=(i+1).toString(),t.appendChild(s),r.renderers&&r.renderers.summary){var u=r.ctx.summaryRenderer(e,!1),l=r.ctx.asElement(u.template);l.classList.add(qn("summary"),qn("th-summary"),qn("renderer-"+e.getSummaryRenderer())),l.dataset.renderer=e.getSummaryRenderer(),s.appendChild(l),r.summaries[i]=u,u.update(l)}})),n.forEach((function(t){return t.node.remove()}))}},e.prototype.updateHeader=function(e){var r=t.prototype.updateHeader.call(this,e),n=(e=Qu(r)?r.item:r).getElementsByClassName(qn("nested"))[0];return n?(e.appendChild(n),this.updateNested(n,r)):r},e.prototype.hasSummaryLine=function(){return t.prototype.hasSummaryLine.call(this)||this.mc.children.some((function(t){return Boolean(t.getMetaData().summary)}))},e.prototype.updateWidthRule=function(t){var e=this.mc.children.map((function(t){return"minmax(0, "+O(t.getWidth())+"fr)"})),r=gc(this.ctx.idPrefix,this.c);return t.updateRule("stacked-"+this.c.id,"."+r,{display:"grid",gridTemplateColumns:e.join(" ")}),r},e.prototype.updateNested=function(t,e){var r=this,n=this.mc.children;this.matchChildren(t,n);var i,o=Array.from(t.children),a=[];return Qu(e)?(a.push(e.ready),i=e.item):i=e,n.forEach((function(t,e){var n=o[e];if(yh(n,t),r.renderers&&r.renderers.summary){var i=n.getElementsByClassName(qn("summary"))[0],s=i.dataset.renderer,u=t.getSummaryRenderer();if(s!==u){var l=r.ctx.summaryRenderer(t,!1);i.remove(),(i=r.ctx.asElement(l.template)).classList.add(qn("summary"),qn("th-summary"),qn("renderer-"+u)),i.dataset.renderer=u,r.summaries[e]=l,n.appendChild(i)}var c=r.summaries[e].update(i);c&&a.push(c)}})),0===a.length?i:{item:i,ready:$u(a)}},e}(pg),gg=function(t){function e(e,r){var n=t.call(this)||this;n.ctx=e,n.body=r,n.start=null;var i=r.parentElement.parentElement,o=i.querySelector("hr");o||(o=i.ownerDocument.createElement("hr"),i.appendChild(o)),n.hr=o,n.hr.classList.add(qn("hr"));var a=function(t){n.showHint(t)},s=function(t){if(n.body.removeEventListener("mousemove",a),n.body.removeEventListener("mouseup",s),n.body.removeEventListener("mouseleave",s),n.start){var e=Kn("tr"),r=n.start.node.classList.contains(e)?n.start.node:n.start.node.closest("."+e),i=n.body.ownerDocument.elementFromPoint(t.clientX,t.clientY),o=i.classList.contains(e)?i:i.closest("."+e);n.start=null,n.body.classList.remove(qn("selection-active")),n.hr.classList.remove(qn("selection-active")),n.select(t.ctrlKey,r,o)}};return r.addEventListener("mousedown",(function(t){var e=i.getBoundingClientRect();n.start={x:t.clientX,y:t.clientY,xShift:e.left,yShift:e.top,node:t.target},n.body.classList.add(qn("selection-active")),r.addEventListener("mousemove",a,{passive:!0}),r.addEventListener("mouseup",s,{passive:!0}),r.addEventListener("mouseleave",s,{passive:!0})}),{passive:!0}),n}return i(e,t),e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_SELECT_RANGE])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.select=function(t,r,n){var i=this;if(r&&n&&r!==n){var o=parseInt(r.dataset.index,10),a=parseInt(n.dataset.index,10),s=Math.min(o,a),u=Math.max(o,a);s!==u&&requestAnimationFrame((function(){return i.fire(e.EVENT_SELECT_RANGE,s,u,t)}))}},e.prototype.showHint=function(t){var r=this.start,n=r.y,i=t.clientY,o=Math.abs(n-i)>e.MIN_DISTANCE;this.hr.classList.toggle(qn("selection-active"),o),this.hr.style.transform="translate("+(r.x-r.xShift)+"px,"+(n-r.yShift)+"px)scale(1,"+Math.abs(i-n)+")rotate("+(i>n?90:-90)+"deg)"},e.prototype.remove=function(t){t.onclick=void 0},e.prototype.add=function(t){var e=this;t.onclick=function(r){var n=parseInt(t.dataset.i,10);if(r.shiftKey){var i=parseInt(t.dataset.index,10),o=t.parentElement.dataset.ranking;if(dl(e.ctx.provider,o,n,i,r.ctrlKey))return}e.ctx.provider.toggleSelection(n,r.ctrlKey)}},e.prototype.selectRange=function(t,e){void 0===e&&(e=!1);var r=new Zr(e?this.ctx.provider.getSelection():[]),n=function(t){r.has(t)?r.delete(t):r.add(t)};t.forEach((function(t){lt(t)?hn(t.order,n):n(t.dataIndex)})),this.ctx.provider.setSelection(Array.from(r))},e.prototype.updateState=function(t,e){this.ctx.provider.isSelected(e)?t.classList.add(qn("selected")):t.classList.remove(qn("selected"))},e.prototype.update=function(t,e){var r=parseInt(t.dataset.i,10);e.has(r)?t.classList.add(qn("selected")):t.classList.remove(qn("selected"))},e.EVENT_SELECT_RANGE="selectRange",e.MIN_DISTANCE=10,e}(at),mg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.fire=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];t.prototype.fire.apply(this,[e].concat(r))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_WIDTH_CHANGED,e.EVENT_UPDATE_DATA,e.EVENT_RECREATE,e.EVENT_HIGHLIGHT_CHANGED])},e.EVENT_WIDTH_CHANGED="widthChanged",e.EVENT_UPDATE_DATA="updateData",e.EVENT_RECREATE="recreate",e.EVENT_HIGHLIGHT_CHANGED="highlightChanged",e}(at),yg={passive:!1},vg=function(t){function e(r,n,i,o,a,s,u){void 0===u&&(u={});var l=t.call(this,n,i,o,a,{mixins:[ig],batchSize:20})||this;l.ranking=r,l.ctx=s,l.loadingCanvas=new WeakMap,l.data=[],l.highlight=-1,l.canvasPool=[],l.currentCanvasShift=0,l.currentCanvasWidth=0,l.events=new mg,l.roptions={animation:!0,levelOfDetail:function(){return"high"},customRowUpdate:function(){},flags:{disableFrozenColumns:!1,advancedModelFeatures:!0,advancedRankingFeatures:!0,advancedUIFeatures:!0}},l.canvasMouseHandler={timer:new Set,hoveredRows:new Set,cleanUp:function(){var t=l.canvasMouseHandler;t.timer.forEach((function(t){self.clearTimeout(t)})),t.timer.clear();for(var e=0,r=Array.from(t.hoveredRows);e<r.length;e++){var n=r[e];t.unhover(n)}},enter:function(t){var e=l.canvasMouseHandler;e.cleanUp();var r=t.currentTarget;r.addEventListener("mouseleave",e.leave,yg),e.timer.add(self.setTimeout((function(){e.hoveredRows.add(r),l.updateHoveredRow(r,!0)}),500))},leave:function(t){var e=l.canvasMouseHandler,r=void 0!==t.currentTarget?t.currentTarget:t;e.unhover(r),e.cleanUp()},unhover:function(t){var r=l.canvasMouseHandler;r.hoveredRows.delete(t),t.removeEventListener("mouseleave",r.leave),!e.isCanvasRenderedRow(t)&&t.parentElement&&self.setTimeout((function(){return l.updateHoveredRow(t,!1)}))}},l.highlightHandler={enabled:!1,enter:function(t){if(l.highlight>=0){var r=l.body.getElementsByClassName(Kn("highlighted"))[0];r&&r.classList.remove(Kn("highlighted")),l.highlight=-1}var n=t.currentTarget,i=parseInt(n.dataset.i||"-1",10);l.events.fire(e.EVENT_HIGHLIGHT_CHANGED,i)},leave:function(){if(l.highlight>=0){var t=l.body.getElementsByClassName(Kn("highlighted"))[0];t&&t.classList.remove(Kn("highlighted")),l.highlight=-1}l.events.fire(e.EVENT_HIGHLIGHT_CHANGED,-1)}},Object.assign(l.roptions,u),i.dataset.ranking=r.id;var c,p,f,h=l;return l.delayedUpdate=ei((function(){this.type===Zn.EVENT_DIRTY_VALUES?this.primaryType!==pt.EVENT_RENDERER_TYPE_CHANGED&&this.primaryType!==pt.EVENT_GROUP_RENDERER_TYPE_CHANGED&&this.primaryType!==pt.EVENT_LABEL_CHANGED&&h.updateBody():h.events.fire(e.EVENT_UPDATE_DATA)}),50,(function(t,e){return t.self.type===Zn.EVENT_ORDER_CHANGED?t:e})),l.delayedUpdateAll=ei((function(){return l.updateAll()}),50),l.delayedUpdateColumnWidths=ei((function(){return l.updateColumnWidths()}),50),r.on(Zn.EVENT_ADD_COLUMN+".hist",(function(t,e){l.columns.splice(e,0,l.createCol(t,e)),l.reindex(),l.delayedUpdateAll()})),r.on(Zn.EVENT_REMOVE_COLUMN+".body",(function(t,r){e.disableListener(t),l.columns.splice(r,1),l.reindex(),l.delayedUpdateAll()})),r.on(Zn.EVENT_MOVE_COLUMN+".body",(function(t,e,r){var n=l.columns.splice(r,1)[0];console.assert(n.c===t),l.columns.splice(r<e?e-1:e,0,n),l.reindex(),l.delayedUpdateAll()})),r.on(Zn.EVENT_COLUMN_VISIBILITY_CHANGED+".body",(function(t,n,i){if(i){var o=r.children.indexOf(t);l.columns.splice(o,0,l.createCol(t,o))}else{o=l.columns.findIndex((function(e){return e.c===t}));e.disableListener(t),l.columns.splice(o,1)}l.reindex(),l.delayedUpdateAll()})),r.on(Zn.EVENT_ORDER_CHANGED+".body",l.delayedUpdate),l.selection=new gg(l.ctx,i),l.selection.on(gg.EVENT_SELECT_RANGE,(function(t,e,r){l.selection.selectRange(l.data.slice(t,e+1),r)})),l.renderCtx=Object.assign({isGroup:function(t){return lt(l.data[t])},getRow:function(t){return l.data[t]},getGroup:function(t){return l.data[t]}},s),l.columns=r.children.filter((function(t){return t.isVisible()})).map((function(t,e){return l.createCol(t,e)})),l._context=Object.assign({columns:l.columns,column:Sd(l.columns.map((function(t){return t.width})),100,In)},(p=20,void 0===f&&(f=0),{exceptions:[],exceptionsLookup:{keys:function(){return[].values()},get:function(){return p},has:function(){return!1},size:0},totalHeight:(c=0)*(p+=f),numberOfRows:c,defaultRowHeight:p,padding:function(){return f}})),l.columns.forEach((function(t){t instanceof dg&&t.updateWidthRule(l.style),t.renderers=l.ctx.createRenderer(t.c)})),l.style.updateRule("hoverOnly"+l.tableId,"\n      #"+tg(l.tableId).tbody+":hover > ."+Kn("tr")+":hover ."+qn("hover-only")+",\n      #"+tg(l.tableId).tbody+" > ."+Kn("tr")+"."+qn("selected")+" ."+qn("hover-only")+",\n      #"+tg(l.tableId).tbody+" > ."+Kn("tr")+"."+Kn("highlighted")+" ."+qn("hover-only"),{visibility:"visible"}),l.updateCanvasRule(),l}return i(e,t),e.prototype.on=function(t,e){return this.events.on(t,e),this},Object.defineProperty(e.prototype,"id",{get:function(){return this.ranking.id},enumerable:!0,configurable:!0}),e.prototype.onVisibilityChanged=function(e){t.prototype.onVisibilityChanged.call(this,e),e&&this.delayedUpdate.call({type:Zn.EVENT_ORDER_CHANGED})},e.prototype.updateHeaders=function(){return this.updateColumnSummaryFlag(),t.prototype.updateHeaders.call(this)},Object.defineProperty(e.prototype,"currentData",{get:function(){return this.data},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),e.prototype.createHeader=function(t,e){return e.createHeader()},e.prototype.updateColumnSummaryFlag=function(){this.header.classList.toggle(qn("show-sublabel"),this.columns.some((function(t){return t.hasSummaryLine()})))},e.prototype.updateHeader=function(t,e){return e instanceof dg&&e.updateWidthRule(this.style),e.updateHeader(t)},e.prototype.createCell=function(t,e,r){return r.createCell(e)},e.prototype.createCellHandled=function(t,e){var r,n=t.createCell(e);return r=Qu(n)?this.handleCellReady(n.item,n.ready,t.index):n,this.initCellClasses(r,t.id),r},e.prototype.updateCell=function(t,e,r){return r.updateCell(t,e)},e.prototype.selectCanvas=function(){if(this.canvasPool.length>0)return this.canvasPool.pop();var t=this.body.ownerDocument.createElement("canvas");return t.classList.add(qn("low-c"+this.tableId)),t},e.prototype.rowFlags=function(t){var e=t,r=e.__lu__;return null==r?e.__lu__={}:r},e.prototype.visibleRenderedWidth=function(){for(var t=0,e=0,r=this.visibleColumns.frozen;e<r.length;e++){var n=r[e];t+=this.columns[n].width+In}for(n=this.visibleColumns.first;n<=this.visibleColumns.last;++n)t+=this.columns[n].width+In;return t>0&&(t-=In),t},e.prototype.pushLazyRedraw=function(t,e,r,n){var i=this;n.then((function(o){var a=i.loadingCanvas.get(t)||[],s=a.findIndex((function(t){return t.render===n&&t.col===r.index}));if(!(s<0)){if(a.splice(s,1),"function"==typeof o){var u=t.getContext("2d");u.clearRect(e-1,0,r.width+2,t.height),u.save(),u.translate(e,0),o(u),u.restore()}a.length>0||(i.loadingCanvas.delete(t),t.classList.remove(qn("loading-c")))}})),this.loadingCanvas.has(t)?this.loadingCanvas.get(t).push({col:r.index,render:n}):(t.classList.add(qn("loading-c")),this.loadingCanvas.set(t,[{col:r.index,render:n}]))},e.prototype.renderRow=function(t,e,r){var n=this;if(this.loadingCanvas.has(t)){for(var i=0,o=this.loadingCanvas.get(t);i<o.length;i++){o[i].render.abort()}this.loadingCanvas.delete(t)}t.classList.remove(qn("loading-c")),t.width=this.currentCanvasWidth,t.height=4;var a=t.getContext("2d");a.imageSmoothingEnabled=!1,a.clearRect(0,0,t.width,t.height),a.save();for(var s=[],u=0,l=function(e){var i=n.columns[e],o=i.renderCell(a,r);!0===o?s.push(i):!1!==o&&Ju(o)&&n.pushLazyRedraw(t,u,i,o);var l=i.width+In;u+=l,a.translate(l,0)},c=0,p=this.visibleColumns.frozen;c<p.length;c++){l(f=p[c])}for(var f=this.visibleColumns.first;f<=this.visibleColumns.last;++f)l(f);a.restore();var h=e.childElementCount-1;if(0!==s.length){if(1===s.length){var d=s[0];if(0===h)return(m=this.createCellHandled(d,r)).classList.add(qn("low")),void e.appendChild(m);var g=e.lastElementChild;if(1===h&&g.dataset.colId===d.id){if($d(g)){var m=this.createCellHandled(d,r);return e.replaceChild(m,g),void this.recycleCell(g,d.index)}return void this.updateCellImpl(d,e.lastElementChild,r)}}for(var y=new Map(Array.from(e.children).slice(1).map((function(t){return[t.dataset.id,t]}))),v=0,b=s;v<b.length;v++){f=b[v];var E=y.get(f.id);if(E&&!$d(E))y.delete(f.id),this.updateCellImpl(f,E,r);else{var C=this.createCellHandled(f,r);C.classList.add(qn("low")),e.appendChild(C)}}y.forEach((function(t){t.remove(),n.recycleCell(t)}))}else for(;e.lastElementChild!==e.firstElementChild;){var N=e.lastElementChild;e.removeChild(N),this.recycleCell(N)}},e.prototype.updateCanvasCell=function(t,e,r,n,i){if(this.loadingCanvas.has(t)){var o=this.loadingCanvas.get(t),a=o.filter((function(t){return t.col===n.index}));if(a.length>0){this.loadingCanvas.set(t,o.filter((function(t){return t.col!==n.index})));for(var s=0,u=a;s<u.length;s++){u[s].render.abort()}}}var l=t.getContext("2d");l.clearRect(i-1,0,n.width+2,t.height),l.save(),l.translate(i,0);var c=n.renderCell(l,r);if(l.restore(),"boolean"!=typeof c&&Ju(c)&&this.pushLazyRedraw(t,i,n,c),!0===c||1!==e.childElementCount){var p=e.querySelector('[data-id="'+n.id+'"]');if(p&&!c)return p.remove(),void this.recycleCell(p,n.index);if(p)return this.updateCellImpl(n,p,r);var f=this.createCellHandled(n,r);f.classList.add(qn("low")),e.appendChild(f)}},e.prototype.reindex=function(){this.columns.forEach((function(t,e){t.index=e}))},e.prototype.updateAll=function(){var r=this;this.columns.forEach((function(t,e){t.index=e,t.renderers=r.ctx.createRenderer(t.c)})),this._context=Object.assign({},this._context,{column:Sd(this.columns.map((function(t){return t.width})),100,In)}),this.updateColumnSummaryFlag(),this.events.fire(e.EVENT_RECREATE),t.prototype.recreate.call(this),this.events.fire(e.EVENT_WIDTH_CHANGED)},e.prototype.updateBody=function(){var r=this;this.hidden||(this.events.fire(e.EVENT_WIDTH_CHANGED),t.prototype.forEachRow.call(this,(function(t,e){return r.updateRow(t,e)})))},e.prototype.updateHeaderOf=function(t){var e=this._context.columns.findIndex((function(e){return e.c===t}));if(e<0)return!1;var r=this.header.children[e],n=this._context.columns[e];return r&&n&&this.updateHeader(r,n),this.updateColumnSummaryFlag(),r&&n},e.prototype.createRow=function(e,r){e.classList.add(this.style.cssClasses.tr),this.roptions.customRowUpdate(e,r),this.highlightHandler.enabled&&(e.addEventListener("mouseenter",this.highlightHandler.enter,yg),this.rowFlags(e).highlight=!0);var n=this.renderCtx.isGroup(r),i=this.toRowMeta(r);if(i?e.dataset.meta=i:delete e.dataset.meta,n)return e.dataset.agg="group",void t.prototype.createRow.call(this,e,r);var o=this.renderCtx.getRow(r).dataIndex;e.classList.toggle(Kn("highlighted"),this.highlight===o),e.dataset.i=o.toString(),e.dataset.agg="detail",this.selection.updateState(e,o),this.selection.add(e);var a="low"===this.roptions.levelOfDetail(r);if(e.classList.toggle(qn("low"),a),a&&!this.ctx.provider.isSelected(o)){var s=this.selectCanvas();e.appendChild(s),e.addEventListener("mouseenter",this.canvasMouseHandler.enter,yg),this.renderRow(s,e,r)}else t.prototype.createRow.call(this,e,r)},e.prototype.updateRow=function(e,r,n){this.roptions.customRowUpdate(e,r);var i=this.roptions.levelOfDetail(r),o="low"===(n||i),a=e.classList.contains(qn("low")),s=this.renderCtx.isGroup(r),u="group"===e.dataset.agg;e.classList.toggle(qn("low"),"low"===i),this.highlightHandler.enabled&&!this.rowFlags(e).highlight&&(e.addEventListener("mouseenter",this.highlightHandler.enter,yg),this.rowFlags(e).highlight=!0),s!==u&&(K(e),e.dataset.agg=s?"group":"detail",s?(e.dataset.i="",this.selection.remove(e)):this.selection.add(e)),!a||i&&!s||e.removeEventListener("mouseenter",this.canvasMouseHandler.enter);var l=this.toRowMeta(r);if(l?e.dataset.meta=l:delete e.dataset.meta,s)return e.classList.remove(Kn("highlighted")),void t.prototype.updateRow.call(this,e,r);var c=this.renderCtx.getRow(r).dataIndex;e.classList.toggle(Kn("highlighted"),this.highlight===c),e.dataset.i=c.toString(),this.selection.updateState(e,c);var p=a&&"canvas"===e.firstElementChild.nodeName.toLowerCase()?e.firstElementChild:null;if(!o||this.ctx.provider.isSelected(c))return p&&(this.recycleCanvas(p),K(e),e.removeEventListener("mouseenter",this.canvasMouseHandler.enter)),void t.prototype.updateRow.call(this,e,r);if(a&&p)this.renderRow(p,e,r);else{K(e),e.dataset.agg="detail";var f=this.selectCanvas();e.appendChild(f),e.addEventListener("mouseenter",this.canvasMouseHandler.enter,yg),this.renderRow(f,e,r)}},e.prototype.updateCanvasBody=function(){var r=this;this.updateCanvasRule(),t.prototype.forEachRow.call(this,(function(t,n){e.isCanvasRenderedRow(t)&&r.renderRow(t.firstElementChild,t,n)}))},e.prototype.toRowMeta=function(t){var e=this,r=this.renderCtx.provider;return function(t,e,r){if(lt(t)){if(bl(t,e,r))return"first";var n=vl(t,r);return 0===n?"first":"first last"+(1===n?"":n-1)}if(null==ml(t.relativeIndex,t.group,r(t.group)))return null;var i=vl(t,r);return 0===i?null:"last"+(1===i?"":i-1)}(this.renderCtx.getRow(t),r.getAggregationStrategy(),(function(t){return r.getTopNAggregated(e.ranking,t)}))},e.prototype.updateCanvasRule=function(){this.style.updateRule("renderCanvas"+this.tableId,"."+qn("low-c"+this.tableId),{transform:"translateX("+this.currentCanvasShift+"px)",width:this.currentCanvasWidth+"px"})},e.prototype.updateShifts=function(e,r){t.prototype.updateShifts.call(this,e,r);var n=this.visibleRenderedWidth();r===this.currentCanvasShift&&n===this.currentCanvasWidth||(this.currentCanvasShift=r,this.currentCanvasWidth=n,this.updateCanvasBody())},e.prototype.recycleCanvas=function(t){if(this.loadingCanvas.has(t)){for(var e=0,r=this.loadingCanvas.get(t);e<r.length;e++){r[e].render.abort()}this.loadingCanvas.delete(t)}else t.classList.contains(qn("loading-c"))||this.canvasPool.push(t)},e.prototype.enableHighlightListening=function(e){var r=this;if(this.highlightHandler.enabled!==e){if(this.highlightHandler.enabled=e,e)return this.body.addEventListener("mouseleave",this.highlightHandler.leave,yg),void t.prototype.forEachRow.call(this,(function(t){t.addEventListener("mouseenter",r.highlightHandler.enter,yg),r.rowFlags(t).highlight=!0}));this.body.removeEventListener("mouseleave",this.highlightHandler.leave),t.prototype.forEachRow.call(this,(function(t){t.removeEventListener("mouseenter",r.highlightHandler.enter),r.rowFlags(t).highlight=!1}))}},e.prototype.updateHoveredRow=function(t,r){if(e.isCanvasRenderedRow(t)===r){var n=parseInt(t.dataset.index,10);this.updateRow(t,n,r?"high":"low")}},e.prototype.forEachRow=function(r,n){void 0===n&&(n=!1);return t.prototype.forEachRow.call(this,(function(t,n){e.isCanvasRenderedRow(t)||r(t,n)}),n)},e.prototype.updateSelection=function(e){var r=this;t.prototype.forEachRow.call(this,(function(t,n){r.renderCtx.isGroup(n)?r.updateRow(t,n):r.selection.update(t,e)}),!0)},e.prototype.updateColumnWidths=function(){var r=this;this._context.column=Sd(this._context.columns.map((function(t){return t.width})),100,In),t.prototype.updateColumnWidths.call(this),this.context.columns.forEach((function(t){t instanceof dg&&t.updateWidthRule(r.style),t.renderers=r.ctx.createRenderer(t.c)})),this.events.fire(e.EVENT_WIDTH_CHANGED)},e.prototype.updateColumn=function(r){var n=this,i=this.context.columns,o=i[r];if(!o)return!1;for(var a=0,s=this.visibleColumns.first;s<r;++s)a+=i[s].width+In;return t.prototype.forEachRow.call(this,(function(t,i){e.isCanvasRenderedRow(t)?n.updateCanvasCell(t.firstElementChild,t,i,o,a):n.updateCellImpl(o,t.children[r],i)})),!0},e.prototype.updateCellImpl=function(t,e,r){if(e){var n,i=this.updateCell(e,r,t);e!==(n=Qu(i)?this.handleCellReady(i.item,i.ready,t.index):i)&&n&&(this.initCellClasses(n,t.id),e.parentElement.replaceChild(n,e))}},e.prototype.initCellClasses=function(t,e){t.dataset.id=e,t.classList.add(Kn("td"),this.style.cssClasses.td,Kn("td-"+this.tableId))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.style.deleteRule("hoverOnly"+this.tableId),this.style.deleteRule("renderCanvas"+this.tableId),this.ranking.flatColumns.forEach((function(t){return e.disableListener(t)}))},e.prototype.groupData=function(){var t=this,e=this.ranking.getGroups(),r=this.ctx.provider,n=gl(r.getAggregationStrategy()),i=[];if(0===e.length)return i;var o=function(t,e,r){i.push({group:t,dataIndex:e,relativeIndex:r})};if(1===e.length&&e[0].name===st.name){for(var a=e[0],s=a.order.length,u=0;u<s;++u)o(a,a.order[u],u);return i}for(var l=sn(e),c=function(e){var a=r.getTopNAggregated(t.ranking,e),s=e,u=e;if((0===a||n)&&i.push(s),0!==a&&Array.isArray(u.subGroups)&&u.subGroups.length>0)for(var l=0,p=u.subGroups;l<p.length;l++){var f=p[l];c(f)}else for(var h=a<0?s.order.length:Math.min(a,s.order.length),d=0;d<h;++d)o(s,s.order[d],d)},p=0,f=l;p<f.length;p++){var h=f[p];c(h)}return i},e.prototype.render=function(r,n){var i=this,o=this._context,a=this.data;if(this.data=r,this.columns.forEach((function(t,e){t.index=e,t.renderers=i.ctx.createRenderer(t.c)})),this._context=Object.assign({columns:this.columns,column:Sd(this.columns.map((function(t){return t.width})),100,In)},n),this.bodyScroller)return this.events.fire(e.EVENT_RECREATE),t.prototype.recreate.call(this,this.roptions.animation?cg(o,a,this.data):void 0)},e.prototype.setHighlight=function(t){this.highlight=t;var e=this.body.querySelector("[data-i]."+Kn("highlighted"));if(e&&e.classList.remove(Kn("highlighted")),!(t<0)){var r=this.body.querySelector('[data-i="'+t+'"]');return r&&r.classList.add(Kn("highlighted")),null!=r}},e.prototype.findNearest=function(t){var e=this,r=t.find((function(t){return Boolean(e.body.querySelectorAll('[data-i="'+t+'"]'))}));if(null!=r)return r;for(var n=this.visible,i=new Set(t),o=-1,a=-1,s=n.first;s>=0;--s){if(!lt(u=this.data[s])&&i.has(u.dataIndex)){o=s;break}}for(s=n.last;s<this.data.length;++s){var u;if(!lt(u=this.data[s])&&i.has(u.dataIndex)){a=s;break}}if(o<0&&o<0)return-1;var l=o>=0&&n.first-o<a-n.last?o:a;return this.data[l].dataIndex},e.prototype.scrollIntoView=function(t){var e=this,r=this.body.querySelector('[data-i="'+t+'"]');if(r)return r.scrollIntoView(!0),!0;var n=this.data.findIndex((function(e){return!lt(e)&&e.dataIndex===t}));if(n<0)return!1;var i=function(){var t=e._context;if(0===t.exceptions.length||n<t.exceptions[0].index)return n*t.defaultRowHeight;var r=t.exceptions.reverse().find((function(t){return t.index<=n}));if(!r)return-1;if(r.index===n)return r.y;var i=n-r.index-1;return r.y2+i*t.defaultRowHeight}();if(i<0)return!1;var o=this.bodyScroller;if(!o)return!1;var a=o.scrollTop;o.scrollTop=Math.min(i,o.scrollHeight-o.clientHeight),this.onScrolledVertically(o.scrollTop,o.clientHeight,a<o.scrollTop);var s=this.body.querySelector('[data-i="'+t+'"]');return!!s&&(s.scrollIntoView(!0),!0)},e.prototype.getHighlight=function(){var t=this.body.querySelector("[data-i]:hover, [data-i]."+Kn("highlighted"));return t?parseInt(t.dataset.i,10):this.highlight},e.prototype.createCol=function(t,r){var n=this,i=ct(t)&&!t.getCollapsed()?new dg(t,r,this.renderCtx,this.roptions.flags):new pg(t,r,this.renderCtx,this.roptions.flags);t.on(pt.EVENT_WIDTH_CHANGED+".body",(function(){i.renderers=n.ctx.createRenderer(t),n.delayedUpdateColumnWidths()}));var o=ei((function(){n.updateColumn(i.index)||e.disableListener(t)}),25);t.on([pt.EVENT_RENDERER_TYPE_CHANGED+".body",pt.EVENT_GROUP_RENDERER_TYPE_CHANGED+".body"],(function(){i.renderers=n.ctx.createRenderer(t),o()}));var a=this;return t.on(pt.EVENT_DIRTY_HEADER+".body",(function(){a.updateHeaderOf(i.c)||e.disableListener(t)})),t.on(it(".body",pt.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,pt.EVENT_DIRTY_CACHES),(function(){i.renderers=n.ctx.createRenderer(t),n.updateHeaderOf(i.c)||e.disableListener(t)})),t.on(pt.EVENT_DIRTY_VALUES+".body",o),ct(t)&&(t.on(Su.EVENT_COLLAPSE_CHANGED+".body",(function(){e.disableListener(t);var r=i.index,o=n.createCol(t,r);o.index=r,n.columns.splice(r,1,o),n.delayedUpdateAll()})),t.getCollapsed()||(i.updateWidthRule(this.style),t.on(Su.EVENT_MULTI_LEVEL_CHANGED+".body",(function(){i.updateWidthRule(n.style)})),t.on(Su.EVENT_MULTI_LEVEL_CHANGED+".bodyUpdate",o))),i},e.isCanvasRenderedRow=function(t){return t.classList.contains(qn("low"))&&t.childElementCount>=1&&"canvas"===t.firstElementChild.nodeName.toLowerCase()},e.disableListener=function(t){t.on(pt.EVENT_WIDTH_CHANGED+".body",null),t.on(it(".body",pt.EVENT_RENDERER_TYPE_CHANGED,pt.EVENT_GROUP_RENDERER_TYPE_CHANGED,pt.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,pt.EVENT_DIRTY_CACHES,pt.EVENT_LABEL_CHANGED),null),t.on(Zn.EVENT_DIRTY_HEADER+".body",null),t.on(Zn.EVENT_DIRTY_VALUES+".body",null),ct(t)&&(t.on(Su.EVENT_COLLAPSE_CHANGED+".body",null),t.on(Su.EVENT_MULTI_LEVEL_CHANGED+".body",null),t.on(Su.EVENT_MULTI_LEVEL_CHANGED+".bodyUpdate",null))},e.EVENT_WIDTH_CHANGED=mg.EVENT_WIDTH_CHANGED,e.EVENT_UPDATE_DATA=mg.EVENT_UPDATE_DATA,e.EVENT_RECREATE=mg.EVENT_RECREATE,e.EVENT_HIGHLIGHT_CHANGED=mg.EVENT_HIGHLIGHT_CHANGED,e}(sg);!function(t){t.ITEM="item",t.BAND="band"}(hg||(hg={}));var bg=function(){function t(t,e,r){this.left=t,this.right=e,this.dataIndices=r}return t.prototype.isSelected=function(t){return 1===this.dataIndices.length?t.has(this.dataIndices[0]):this.dataIndices.some((function(e){return t.has(e)}))},t.prototype.update=function(t,e){t.setAttribute("data-i",String(this.dataIndices[0])),t.setAttribute("class",qn("slope")),t.setAttribute("d","M0,"+this.left+"L"+e+","+this.right)},t}(),Eg=function(){function t(t,e,r){this.left=t,this.right=e,this.dataIndices=r}return t.prototype.isSelected=function(t){return this.dataIndices.some((function(e){return t.has(e)}))},t.prototype.update=function(t,e){t.setAttribute("class",qn("group-slope")),t.setAttribute("d","M0,"+this.left[0]+"L"+e+","+this.right[0]+"L"+e+","+this.right[1]+"L0,"+this.left[1]+"Z")},t}(),Cg=function(){function t(t,e,r,n,i){void 0===i&&(i={}),this.header=t,this.body=e,this.id=r,this.ctx=n,this.leftSlopes=[],this.rightSlopes=[],this.pool=[],this.scrollListener=null,this.width=Bn,this.height=0,this.current=null,this.chosen=new Set,this.chosenSelectionOnly=new Set,this._mode=hg.ITEM,this.node=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg"),this.node.innerHTML='<g transform="translate(0,0)"></g>',t.classList.add(qn("slopegraph-header")),this._mode=i.mode===hg.BAND?hg.BAND:hg.ITEM,this.initHeader(t),e.classList.add(qn("slopegraph")),this.body.style.height="1px",e.appendChild(this.node)}return t.prototype.init=function(){var t=this;this.hide();var e=this.body.parentElement.__le_scroller__,r=e.asInfo();e.push("animation",this.scrollListener=function(e){Math.abs(r.top-e.top)<5||(r=e,t.onScrolledVertically(e.top,e.height))})},t.prototype.initHeader=function(t){var e=this,r=qn("active");t.innerHTML='<i title="Item" class="'+(this._mode===hg.ITEM?r:"")+'">'+Xn("Item")+'</i>\n        <i title="Band" class="'+(this._mode===hg.BAND?r:"")+'">'+Xn("Band")+"</i>";var n=Array.from(t.children);n.forEach((function(t,i){t.onclick=function(o){o.preventDefault(),o.stopPropagation(),t.classList.contains(r)||(e.mode=0===i?hg.ITEM:hg.BAND,n.forEach((function(t,e){return t.classList.toggle(r,e===i)})))}}))},Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){t!==this._mode&&(this._mode=t,this.current&&this.rebuild(this.current.leftRanking,this.current.left,this.current.leftContext,this.current.rightRanking,this.current.right,this.current.rightContext))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hidden",{get:function(){return this.header.classList.contains(Kn("loading"))},set:function(t){this.header.classList.toggle(Kn("loading"),t),this.body.classList.toggle(Kn("loading"),t)},enumerable:!0,configurable:!0}),t.prototype.hide=function(){this.hidden=!0},t.prototype.show=function(){var t=this.hidden;this.hidden=!1,t&&this.revalidate()},t.prototype.destroy=function(){(this.header.remove(),this.scrollListener)&&this.body.parentElement.__le_scroller__.remove(this.scrollListener);this.body.remove()},t.prototype.rebuild=function(t,e,r,n,i,o){this.current={leftRanking:t,left:e,leftContext:r,right:i,rightRanking:n,rightContext:o};var a=this.prepareRightSlopes(i,o);this.computeSlopes(e,r,a),this.revalidate()},t.prototype.computeSlopes=function(t,e,r){var n=this,i=this.mode,o=new Map,a=0;this.leftSlopes=t.map((function(s,u){var l=e.exceptionsLookup.get(u)||e.defaultRowHeight,c=l-0,p=[],f=a;a+=l;var h,d=0,g=function(t,e,r,i){void 0===r&&(r=1),void 0===i&&(i=0),p.push(t),hn(e.ref,(function(e){return n.rightSlopes[e].push(t)})),e.offset+=r*e.heightPerRow,d+=r*i};if(lt(s))h=s;else{var m=s,y=m.dataIndex,v=r.get(y);if(!v)return p;if(i===hg.ITEM){var b=new bg(f+c/2,v.start+v.offset+v.heightPerRow/2,[y]);return g(b,v),p}if(o.has(m.group))return o.get(m.group);var E=function(r,n){for(var i=0,o=0,a=r;a<t.length;++a){var s=t[a];if(lt(s)||s.group!==n)break;i++,o+=e.exceptionsLookup.get(a)||e.defaultRowHeight}return{gr:n,padded:o-e.padding(r+i-1),height:o}}(u,m.group);h=E.gr,l=E.height,c=E.padded,o.set(m.group,p)}var C=new Set(h.order),N=c/h.order.length;return hn(h.order,(function(t){if(C.has(t)){C.delete(t);var e=r.get(t);if(e){var n=function(t,e){for(var r=[],n=0;n<t.length;++n)e(t[n],n)&&r.push(t[n]);return r}(e.rows,(function(t){return C.delete(t)}));n.push(t);var o,a=n.length;o=1===a?new bg(f+d+N/2,e.start+e.offset+e.heightPerRow/2,[t]):i===hg.ITEM?new bg(f+d+N*a/2,e.start+e.offset+e.heightPerRow*a/2,n):new Eg([f+d,f+d+N*a],[e.start+e.offset,e.start+e.offset+e.heightPerRow*a],n),g(o,e,a,N)}}})),p}))},t.prototype.prepareRightSlopes=function(t,e){var r=new Map,n=this.mode,i=new Map,o=0;return this.rightSlopes=t.map((function(t,a){var s=e.exceptionsLookup.get(a)||e.defaultRowHeight,u=s-0,l=o;o+=s;var c=[],p={start:l,offset:0,ref:[a]};if(lt(t)){var f=Object.assign(p,{rows:Array.from(t.order),heightPerRow:u/t.order.length,group:t});return hn(t.order,(function(t){return r.set(t,f)})),c}var h=t,d=t.dataIndex,g=Object.assign(p,{rows:[d],heightPerRow:u,group:h.group});return n===hg.ITEM?(r.set(d,g),c):(i.has(h.group)?((g=i.get(h.group)).rows.push(d),g.ref.push(a)):(g.heightPerRow=s,i.set(h.group,g)),r.set(d,g),c)})),r},t.prototype.revalidate=function(){if(this.current&&!this.hidden){var t=this.body.parentElement;this.onScrolledVertically(t.scrollTop,t.clientHeight)}},t.prototype.highlight=function(t){var e=Kn("highlighted"),r=this.body.querySelector("[data-i]."+e);if(r&&r.classList.remove(e),!(t<0)){var n=this.body.querySelector('[data-i="'+t+'"]');return n&&n.classList.add(e),null!=n}},t.prototype.onScrolledVertically=function(t,e){if(this.current){var r=this.current,n=r.leftContext,i=r.rightContext,o=Md(t,e,n.defaultRowHeight,n.exceptions,n.numberOfRows),a=Md(t,e,i.defaultRowHeight,i.exceptions,i.numberOfRows),s=Math.min(o.firstRowPos,a.firstRowPos),u=Math.max(o.endPos,a.endPos);this.body.style.transform="translate(0, "+s.toFixed(0)+"px)",this.body.style.height=(u-s).toFixed(0)+"px",this.node.firstElementChild.setAttribute("transform","translate(0,-"+s.toFixed(0)+")"),this.chosen=this.choose(o.first,o.last,a.first,a.last),this.render(this.chosen,this.chooseSelection(o.first,o.last,this.chosen))}},t.prototype.choose=function(t,e,r,n){for(var i=new Set,o=t;o<=e;++o)for(var a=0,s=this.leftSlopes[o];a<s.length;a++){var u=s[a];i.add(u)}for(o=r;o<=n;++o)for(var l=0,c=this.rightSlopes[o];l<c.length;l++){u=c[l];i.add(u)}return i},t.prototype.chooseSelection=function(t,e,r){var n=new Set,i=this.ctx.provider;if(0===i.getSelection().length)return n;for(var o={has:function(t){return i.isSelected(t)}},a=0;a<t;++a)for(var s=0,u=this.leftSlopes[a];s<u.length;s++){(p=u[s]).isSelected(o)&&!r.has(p)&&n.add(p)}for(a=e+1;a<this.leftSlopes.length;++a)for(var l=0,c=this.leftSlopes[a];l<c.length;l++){var p;(p=c[l]).isSelected(o)&&!r.has(p)&&n.add(p)}return n},t.prototype.updatePath=function(t,e,r,n,i){r.update(t,n),t.__data__=r;var o=r.isSelected(i);t.classList.toggle(qn("selected"),o),o&&e.appendChild(t)},t.prototype.render=function(t,e){var r=this,n=this.node.firstElementChild,i=n.ownerSVGElement.getBoundingClientRect().width,o=this.matchLength(t.size+e.size,n),a=this.ctx.provider,s={has:function(t){return a.isSelected(t)}},u=0,l=function(t){r.updatePath(o[u++],n,t,i,s)};t.forEach(l),e.forEach(l)},t.prototype.addPath=function(t){var e=this,r=this.pool.pop();if(r)return t.appendChild(r),r;var n=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");return n.onclick=function(t){var r=n.__data__,i=e.ctx.provider,o=r.dataIndices;if(t.ctrlKey)o.forEach((function(t){return i.toggleSelection(t,!0)}));else{var a=i.isSelected(o[0]);i.setSelection(a?[]:o)}},t.appendChild(n),n},t.prototype.matchLength=function(t,e){for(var r=Array.from(e.children),n=t;n<r.length;++n){var i=r[n];this.pool.push(i),i.remove()}for(n=r.length;n<t;++n)r.push(this.addPath(e));return r},t.prototype.updateSelection=function(t){var e=this.node.firstElementChild,r=Array.from(e.children),n=new Set(t);if(0!==t.size){for(var i=0,o=r;i<o.length;i++){var a=(g=(d=o[i]).__data__).isSelected(t);d.classList.toggle(qn("selected"),a),a?(e.appendChild(d),g.dataIndices.forEach((function(t){return n.delete(t)}))):this.chosenSelectionOnly.delete(g)&&d.remove()}if(0!==n.size)for(var s=e.ownerSVGElement.getBoundingClientRect().width,u=0,l=this.leftSlopes;u<l.length;u++)for(var c=0,p=l[u];c<p.length;c++){g=p[c];if(!this.chosen.has(g)&&!this.chosenSelectionOnly.has(g)&&g.isSelected(n)){this.chosenSelectionOnly.add(g);d=this.addPath(e);this.updatePath(d,e,g,s,n)}}}else{for(var f=0,h=r;f<h.length;f++){var d,g=(d=h[f]).__data__;d.classList.toggle(qn("selected"),!1),this.chosenSelectionOnly.has(g)&&d.remove()}this.chosenSelectionOnly.clear()}},t}(),Ng=function(t){function e(r,n,i){var o=t.call(this)||this;o.data=r,o.rankings=[],o.slopeGraphs=[],o.updateAbles=[],o.zoomFactor=1,o.idPrefix="lu"+Math.random().toString(36).slice(-8).substr(0,3),o.enabledHighlightListening=!1,o.options=i,o.node=n.ownerDocument.createElement("main"),o.node.id=o.idPrefix,o.node.classList.toggle(qn("whole-hover"),i.expandLineOnHover),n.appendChild(o.node);var a,s,u,l=new bd({doc:n.ownerDocument,livePreviews:i.livePreviews,onDialogBackgroundClick:i.onDialogBackgroundClick});o.forward.apply(o,[l].concat(it(".main",e.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED))),n.appendChild(l.node),o.ctx={idPrefix:o.idPrefix,document:n.ownerDocument,provider:r,tasks:r.getTaskExecutor(),dialogManager:l,resolveToolbarActions:function(t,e){return o.options.resolveToolbarActions(t,e,o.options.toolbarActions)},resolveToolbarDialogAddons:function(t,e){return o.options.resolveToolbarDialogAddons(t,e,o.options.toolbarDialogAddons)},flags:o.options.flags,asElement:(a=n.ownerDocument,s=new Map,u=a.createElement("div"),function(t){if(s.has(t))return s.get(t).cloneNode(!0);u.innerHTML=t;var e=u.firstElementChild;return s.set(t,e.cloneNode(!0)),e}),renderer:function(t,e){return function(t,e){var r=e[t.getRenderer()];return r&&"function"==typeof r.create?r:Zf}(t,o.options.renderers).create(t,o.ctx,e)},groupRenderer:function(t,e){return function(t,e){var r=e[t.getGroupRenderer()];return r&&"function"==typeof r.createGroup?r:Zf}(t,o.options.renderers).createGroup(t,o.ctx,e)},summaryRenderer:function(t,e,r){return function(t,e){var r=e[t.getSummaryRenderer()];return r&&"function"==typeof r.createSummary?r:Zf}(t,o.options.renderers).createSummary(t,o.ctx,e,r)},createRenderer:function(t,e){return{single:this.renderer(t,e),group:this.groupRenderer(t,e),summary:i.summaryHeader?this.summaryRenderer(t,!1,e):null,singleId:t.getRenderer(),groupId:t.getGroupRenderer(),summaryId:t.getSummaryRenderer(),singleTemplate:null,groupTemplate:null,summaryTemplate:null}},getPossibleRenderer:function(t){return function(t,e,r){var n=Object.keys(e).filter(Boolean).map((function(t){return{type:t,factory:e[t]}})),i=n.filter((function(e){var n=e.type,i=e.factory;return"function"==typeof i.create&&i.canRender(t,Ql.CELL)&&(!r||r(n,i,t,Ql.CELL))})),o=n.filter((function(e){var n=e.type,i=e.factory;return"function"==typeof i.createGroup&&i.canRender(t,Ql.GROUP)&&(!r||r(n,i,t,Ql.GROUP))})),a=n.filter((function(e){var n=e.type,i=e.factory;return"function"==typeof i.createSummary&&i.canRender(t,Ql.SUMMARY)&&(!r||r(n,i,t,Ql.SUMMARY))}));return{item:i.map((function(t){return{type:t.type,label:t.factory.title}})),group:o.map((function(t){var e=t.type,r=t.factory;return{type:e,label:r.groupTitle||r.title}})),summary:a.map((function(t){var e=t.type,r=t.factory;return{type:e,label:r.summaryTitle||r.groupTitle||r.title}}))}}(t,o.options.renderers,o.options.canRender)},colWidth:function(t){return t.isVisible()?t.getWidth():0},caches:{toolbar:new Map,toolbarAddons:new Map}},o.table=new ng(o.node,o.idPrefix);var c=o.table.node.querySelector("."+Kn("body")+" ."+Kn("footer")),p=c.cloneNode(!0);p.classList.add(qn("resize-helper")),c.insertAdjacentElement("afterend",p),o.style.addRule("lineup_rowPadding0","\n        ."+o.style.cssClasses.tr,{marginTop:i.rowPadding+"px"});for(var f=0;f<4;++f)o.style.addRule("lineup_groupPadding"+f,"\n        ."+o.style.cssClasses.tr+"[data-meta~=last"+(0===f?"":f)+"]",{marginBottom:i.groupPadding*(f+1)+"px"});o.style.addRule("lineup_rowPaddingAgg0","\n        ."+qn("agg-level")+"::after",{top:"-"+i.rowPadding+"px"});for(f=1;f<=4;++f)o.style.addRule("lineup_rowPaddingAgg"+f,"\n        ."+qn("agg-level")+"[data-level='"+f+"']::after",{top:"-"+(i.rowPadding+i.groupPadding)+"px"});o.style.addRule("lineup_rotation","\n       #"+o.idPrefix+"."+qn("rotated-label")+" ."+qn("label")+"."+qn("rotated"),{transform:"rotate("+-o.options.labelRotation+"deg)"});var h=[];return o.options.flags.advancedRankingFeatures||h.push("ranking"),o.options.flags.advancedModelFeatures||h.push("model"),o.options.flags.advancedUIFeatures||h.push("ui"),h.length>0&&o.style.addRule("lineup_feature_disable","\n        "+h.map((function(t){return"."+qn("feature")+"-"+t+"."+qn("feature-advanced")})).join(", "),{display:"none !important"}),o.initProvider(r),o}return i(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.table.style},enumerable:!0,configurable:!0}),e.prototype.zoomOut=function(){this.zoomFactor=Math.max(this.zoomFactor-.1,.5),this.updateZoomFactor(),this.update()},e.prototype.zoomIn=function(){this.zoomFactor=Math.min(this.zoomFactor+.1,2),this.updateZoomFactor(),this.update()},e.prototype.updateZoomFactor=function(){this.node.querySelector("main").style.fontSize=100*this.zoomFactor+"%"},e.prototype.pushUpdateAble=function(t){this.updateAbles.push(t)},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_HIGHLIGHT_CHANGED,e.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.setDataProvider=function(t){this.takeDownProvider(),this.data=t,this.ctx.provider=t,this.ctx.tasks=t.getTaskExecutor(),this.initProvider(t)},e.prototype.takeDownProvider=function(){var t=this;this.data.on(Nl.EVENT_SELECTION_CHANGED+".body",null),this.data.on(Nl.EVENT_ADD_RANKING+".body",null),this.data.on(Nl.EVENT_REMOVE_RANKING+".body",null),this.data.on(Nl.EVENT_GROUP_AGGREGATION_CHANGED+".body",null),this.data.on(Nl.EVENT_SHOWTOPN_CHANGED+".body",null),this.data.on(Nl.EVENT_JUMP_TO_NEAREST+".body",null),this.data.on(Nl.EVENT_BUSY+".body",null),this.rankings.forEach((function(e){return t.table.remove(e)})),this.rankings.splice(0,this.rankings.length),this.slopeGraphs.forEach((function(e){return t.table.remove(e)})),this.slopeGraphs.splice(0,this.slopeGraphs.length)},e.prototype.initProvider=function(t){var e=this;t.on(Nl.EVENT_SELECTION_CHANGED+".body",(function(){return e.updateSelection(t.getSelection())})),t.on(Nl.EVENT_ADD_RANKING+".body",(function(t){e.addRanking(t)})),t.on(Nl.EVENT_REMOVE_RANKING+".body",(function(t){e.removeRanking(t)})),t.on(Nl.EVENT_GROUP_AGGREGATION_CHANGED+".body",(function(t){e.update(e.rankings.filter((function(e){return e.ranking===t})))})),t.on(Nl.EVENT_SHOWTOPN_CHANGED+".body",(function(){e.update(e.rankings)})),t.on(Nl.EVENT_JUMP_TO_NEAREST+".body",(function(t){e.setHighlightToNearest(t,!0)})),this.ctx.provider=t,this.data.getRankings().forEach((function(t){return e.addRanking(t)}))},e.prototype.updateSelection=function(t){var e=new Set(t);this.rankings.forEach((function(t){return t.updateSelection(e)})),this.slopeGraphs.forEach((function(t){return t.updateSelection(e)}))},e.prototype.updateHist=function(t,e){if(this.options.summaryHeader){for(var r=0,n=t?[t]:this.rankings;r<n.length;r++){var i=n[r];e?i.updateHeaderOf(e):i.updateHeaders()}this.updateUpdateAbles()}},e.prototype.addRanking=function(t){var e=this;if(this.rankings.length>0){var r=this.table.pushSeparator((function(r,n){return new Cg(r,n,t.id+"S",e.ctx,{mode:"band"===e.options.defaultSlopeGraphMode?hg.BAND:hg.ITEM})}));this.slopeGraphs.push(r)}var n=this.table.pushTable((function(r,n,i,o){return new vg(t,r,n,i,o,e.ctx,{animation:e.options.animated,customRowUpdate:e.options.customRowUpdate||function(){},levelOfDetail:e.options.levelOfDetail||function(){return"high"},flags:e.options.flags})}));n.on(vg.EVENT_WIDTH_CHANGED,(function(){e.updateRotatedHeaderState(),e.table.widthChanged()})),n.on(vg.EVENT_UPDATE_DATA,(function(){return e.update([n])})),n.on(vg.EVENT_RECREATE,(function(){return e.updateUpdateAbles()})),this.forward(n,vg.EVENT_HIGHLIGHT_CHANGED),this.enabledHighlightListening&&n.enableHighlightListening(!0),t.on(it(".renderer",Zn.EVENT_ORDER_CHANGED),(function(){return e.updateHist(n)})),this.rankings.push(n),this.update([n])},e.prototype.updateRotatedHeaderState=function(){if(0!==this.options.labelRotation){var t=this.node.querySelector("."+qn("label")+"."+qn("rotated"));this.node.classList.toggle(qn("rotated-label"),Boolean(t))}},e.prototype.removeRanking=function(t){if(!t)return this.rankings.splice(0,this.rankings.length),this.slopeGraphs.splice(0,this.slopeGraphs.length),void this.table.clear();var e=this.rankings.findIndex((function(e){return e.ranking===t}));if(!(e<0)){var r=this.rankings.splice(e,1)[0],n=this.slopeGraphs.splice(0===e?e:e-1,1)[0];this.table.remove(r),n&&this.table.remove(n)}},e.prototype.update=function(t){var e=this;if(void 0===t&&(t=this.rankings),0!==(t=t.filter((function(t){return!t.hidden&&t.body.parentElement}))).length){for(var r=function(t){return O(t,2)},n=r(this.zoomFactor*this.options.rowPadding),i=r(this.zoomFactor*this.options.groupPadding),o=function(t){var o=t.groupData(),s=function(t,i){if(e.options.dynamicHeight){var o=e.options.dynamicHeight(i,t),a=function(t,e){return"number"==typeof t?t:t(e)};if(o)return{defaultHeight:r(e.zoomFactor*o.defaultHeight),height:function(t){return r(e.zoomFactor*a(o.height,t))},padding:function(t){return r(e.zoomFactor*a(o.padding,t))}}}var s=r(e.zoomFactor*e.options.rowHeight),u=r(e.zoomFactor*e.options.groupHeight);return{defaultHeight:s,height:function(t){return lt(t)?u:s},padding:n}}(t.ranking,o),u=s.height,l=s.defaultHeight,c=s.padding,p=a.data.getAggregationStrategy(),f=function(r){return e.data.getTopNAggregated(t.ranking,r)},h=Sd(o.map(u),l,(function(t){var e="number"==typeof c?c:c(o[t]||null),r=o[t];return t<0||!r||lt(r)&&bl(r,p,f)?e:e+i*vl(r,f)}));t.render(o,h)},a=this,s=0,u=t;s<u.length;s++){o(u[s])}this.updateSlopeGraphs(t),this.updateUpdateAbles(),this.updateRotatedHeaderState(),this.table.widthChanged()}},e.prototype.updateUpdateAbles=function(){for(var t=0,e=this.updateAbles;t<e.length;t++){(0,e[t])(this.ctx)}},e.prototype.updateSlopeGraphs=function(t){var e=this;void 0===t&&(t=this.rankings);for(var r=new Set(t.map((function(t){return e.rankings.indexOf(t)}))),n=0;n<this.slopeGraphs.length;++n){var i=this.slopeGraphs[n];if(i.hidden)return;var o=n,a=n+1;if(!r.has(o)&&!r.has(a))return;var s=this.rankings[o],u=this.rankings[a];i.rebuild(s.ranking,s.currentData,s.context,u.ranking,u.currentData,u.context)}},e.prototype.setHighlight=function(t,r){var n=this.rankings.map((function(e){return e.setHighlight(t)}));return this.fire(e.EVENT_HIGHLIGHT_CHANGED,t),!(0===this.rankings.length||t<0)&&(r?this.rankings[0].scrollIntoView(t):n[0])},e.prototype.setHighlightToNearest=function(t,e){if(0===this.rankings.length)return!1;var r=this.rankings[0].findNearest(t);return r>=0&&this.setHighlight(r,e)},e.prototype.getHighlight=function(){for(var t=0,e=this.rankings;t<e.length;t++){var r=e[t].getHighlight();if(r>=0)return r}return-1},e.prototype.enableHighlightListening=function(t){for(var e=0,r=this.rankings;e<r.length;e++){r[e].enableHighlightListening(t)}this.enabledHighlightListening=t},e.prototype.destroy=function(){this.takeDownProvider(),this.table.destroy(),this.node.remove()},e.EVENT_HIGHLIGHT_CHANGED=vg.EVENT_HIGHLIGHT_CHANGED,e.EVENT_DIALOG_OPENED=bd.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED=bd.EVENT_DIALOG_CLOSED,e}(at),_g=function(t){function e(e,r){var n=t.call(this,r)||this;return n.items=e,n}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("more-options"),qn("choose-options"));for(var e=0,r=this.items;e<r.length;e++){var n=r[e];t.appendChild(n)}},e}(hf);var Tg=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.options={formatItem:function(t){return t.text},doc:document,placeholder:"Select..."},r.values=[],Object.assign(r.options,e),r.node=r.options.doc.createElement("div"),r.node.classList.add(qn("search")),r.node.innerHTML='<input class="'+qn("search-input")+'" type="search" placeholder="'+r.options.placeholder+'">\n    <ul class="'+qn("search-list")+'"></ul>',r.search=r.node.firstElementChild,r.body=r.node.lastElementChild,r.search.onfocus=function(){return r.focus()},r.search.onblur=function(){return r.blur()},r.search.oninput=function(){return r.filter()},r.search.onkeydown=function(t){return r.handleKey(t)},r.itemTemplate=r.options.doc.createElement("li"),r.itemTemplate.classList.add(qn("search-item")),r.itemTemplate.innerHTML="<span></span>",r.groupTemplate=r.options.doc.createElement("li"),r.groupTemplate.classList.add(qn("search-group")),r.groupTemplate.innerHTML="<span></span><ul></ul>",r}return i(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.values},set:function(t){this.values=t,K(this.body),this.buildDialog(this.body,this.values)},enumerable:!0,configurable:!0}),e.prototype.buildDialog=function(t,e){for(var r=this,n=function(e){var n;!function(t){return void 0!==t.id}(e)?(n=i.groupTemplate.cloneNode(!0),i.buildDialog(n.lastElementChild,e.children),t.appendChild(n)):((n=i.itemTemplate.cloneNode(!0)).onmousedown=function(t){t.preventDefault()},n.onclick=function(){return r.select(e)},n.onmouseenter=function(){return r.highlighted=n},n.onmouseleave=function(){return r.highlighted=null},t.appendChild(n));var o=n.firstElementChild;o.innerHTML=i.options.formatItem(e,o)},i=this,o=0,a=e;o<a.length;o++){n(a[o])}},e.prototype.handleKey=function(t){var e=27,r=13,n=38,i=40;switch(t.which){case e:this.search.blur();break;case r:var o=this.highlighted;o&&o.click();break;case n:this.highlightPrevious();break;case i:this.highlightNext()}},e.prototype.select=function(t){this.search.value="",this.search.blur(),this.fire(e.EVENT_SELECT,t)},e.prototype.focus=function(){this.body.style.width=this.search.offsetWidth+"px",this.highlighted=this.body.firstElementChild||null,this.node.classList.add(qn("search-open"))},Object.defineProperty(e.prototype,"highlighted",{get:function(){return this.body.getElementsByClassName(qn("search-highlighted"))[0]||null},set:function(t){var e=this.highlighted;e!==t&&(e&&e.classList.remove(qn("search-highlighted")),t&&t.classList.add(qn("search-highlighted")))},enumerable:!0,configurable:!0}),e.prototype.highlightNext=function(){var t=this.highlighted;if(t&&!t.classList.contains(qn("hidden"))){var e=Array.from(this.body.querySelectorAll("."+qn("search-item")+":not(."+qn("hidden")+")")),r=e.indexOf(t);this.highlighted=e[r+1]||null}else this.highlighted=this.body.querySelector("."+qn("search-item")+":not(."+qn("hidden")+")")||null},e.prototype.highlightPrevious=function(){var t=this.highlighted,e=Array.from(this.body.querySelectorAll("."+qn("search-item")+":not(."+qn("hidden")+")"));if(t&&!t.classList.contains(qn("hidden"))){var r=e.indexOf(t);this.highlighted=e[r-1]||null}else this.highlighted=e[e.length-1]||null},e.prototype.blur=function(){this.search.value="",this.filterResults(this.body,""),this.node.classList.remove(qn("search-open"))},e.prototype.filter=function(){var t=this.filterResults(this.body,this.search.value.toLowerCase());this.body.classList.toggle(qn("search-empty"),t)},e.prototype.filterResults=function(t,e){var r=this;if(""===e)return Array.from(t.getElementsByClassName(qn("hidden"))).forEach((function(t){return t.classList.remove(qn("hidden"))})),!1;var n=Array.from(t.children);return n.forEach((function(t){var n=!t.firstElementChild.innerHTML.toLowerCase().includes(e);if(t.classList.contains(qn("search-group"))){var i=t.lastElementChild,o=r.filterResults(i,e);n=n&&o}t.classList.toggle(qn("hidden"),n)})),n.every((function(t){return t.classList.contains(qn("hidden"))}))},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_SELECT])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.EVENT_SELECT="select",e}(at),wg=function(t){function e(e,r){var n=t.call(this,r,{livePreview:"rename"})||this;return n.ranking=e,n.before=e.getLabel(),n}return i(e,t),e.prototype.build=function(t){t.classList.add(qn("dialog-rename")),t.insertAdjacentHTML("beforeend",'\n      <input type="text" value="'+this.ranking.getLabel()+'" required autofocus placeholder="name">')},e.prototype.reset=function(){this.findInput('input[type="text"]').value=this.before},e.prototype.cancel=function(){this.ranking.setLabel(this.before)},e.prototype.submit=function(){var t=this.findInput('input[type="text"]').value;return this.ranking.setLabel(t),!0},e}(ff),Rg=function(t){function e(e,r,n){var i=t.call(this,r,{autoClose:!0})||this;return i.ranking=e,i.ctx=n,i}return i(e,t),e.prototype.addIcon=function(t,e,r){t.insertAdjacentHTML("beforeend",'<i title="'+e+'" class="'+bh(e)+'"><span>'+e+"</span> </i>"),t.lastElementChild.onclick=function(t){t.stopPropagation(),r(t)}},e.prototype.build=function(t){var e=this;t.classList.add(qn("more-options")),this.addIcon(t,"Rename",(function(t){t.stopPropagation(),t.preventDefault(),new wg(e.ranking,pf(e.ctx,e.level+1,t)).open()})),this.addIcon(t,"Remove",(function(t){t.stopPropagation(),t.preventDefault(),e.destroy("confirm"),e.ctx.provider.removeRanking(e.ranking)}))},e}(hf),Ag=function(t){function e(e,r,n,i,o){var a=t.call(this,n)||this;return a.column=e,a.addons=r,a.ctx=i,a.onClick=o,a.handlers=[],a}return i(e,t),e.prototype.build=function(t){for(var e=0,r=this.addons;e<r.length;e++){var n=r[e];this.node.insertAdjacentHTML("beforeend","<strong>"+n.title+"</strong>"),this.handlers.push(n.append(this.column,t,this.dialog,this.ctx))}},e.prototype.submit=function(){for(var t=0,e=this.handlers;t<e.length;t++){if(!1===e[t].submit())return!1}return this.onClick&&this.onClick(),!0},e.prototype.cancel=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].cancel()}},e.prototype.reset=function(){for(var t=0,e=this.handlers;t<e.length;t++){e[t].reset()}},e}(ff),Dg=function(){function t(t,e){this.ctx=t,this.node=e.createElement("aside"),this.node.classList.add(qn("hierarchy"),qn("feature-advanced"),qn("feature-ranking")),this.node.innerHTML='\n      <section class="'+qn("group-hierarchy")+'">\n      </section>\n      <section class="'+qn("sort-hierarchy")+'">\n      </section>\n      <section class="'+qn("sort-groups-hierarchy")+'">\n      </section>\n    ';var r={doc:e,placeholder:"Add Sort Criteria...",formatItem:function(t,e){return e.classList.add(qn("typed-icon")),e.dataset.typeCat=Rt(t.col).name,e.dataset.type=t.col.desc.type,t.text}};this.groupAdder=new Tg(Object.assign({},r,{placeholder:"Add Grouping Criteria..."})),this.groupSortAdder=new Tg(Object.assign({},r,{placeholder:"Add Grouping Sort Criteria..."})),this.sortAdder=new Tg(r)}return t.prototype.update=function(t){t?(this.node.style.display=null,this.renderGroups(t,this.node.firstElementChild),this.renderSorting(t,this.node.children[1]),this.renderGroupSorting(t,this.node.lastElementChild)):this.node.style.display="none"},t.prototype.render=function(t,e,r,n,i,o){var a=this,s=new Map(Array.from(t.children).map((function(t){return[t.dataset.id,t]})));K(t),e.forEach((function(e){var u=r(e),l=s.get(u.id);if(l)return t.appendChild(l),void yh(l,u,0);var c=fd(u,i,a.ctx);t.insertAdjacentHTML("beforeend",'<div data-id="'+u.id+'" class="'+qn("toolbar")+" "+qn("hierarchy-entry")+'">\n      <div class="'+qn("label")+" "+qn("typed-icon")+'">'+u.label+"</div>\n      "+(c.length>0?'<i title="Customize" class="'+bh("customize")+'">'+Xn("Customize")+"</i>":"")+'\n      <i title="Move Up" class="'+bh("Move Up")+'">'+Xn("Move Up")+'</i>\n      <i title="Move Down" class="'+bh("Move Down")+'">'+Xn("Move Down")+'</i>\n      <i title="Remove from hierarchy" class="'+bh("Remove")+'">'+Xn("Remove from hierarchy")+"</i>\n      </div>");var p=t.lastElementChild;function f(t){t.preventDefault(),t.stopPropagation()}p.querySelector('i[title="Move Down"]').onclick=function(t){f(t),o(e,1)},p.querySelector('i[title="Move Up"]').onclick=function(t){f(t),o(e,-1)},p.querySelector("i[title^=Remove]").onclick=function(t){f(t),o(e,0)},c.length>0&&(p.querySelector("i[title=Customize]").onclick=function(t){f(t),a.customize(u,c,t)}),n(e,p),yh(p,u,0)}))},t.prototype.renderGroups=function(t,e){var r=t.getGroupCriteria();if(0!==r.length){this.render(e,r,(function(t){return t}),(function(t,e){e.insertAdjacentHTML("afterbegin",'<i title="Group" class="'+bh("group")+'" data-group="true">'+Xn("Group")+"</i>")}),"group",(function(t,e){if(0!==e){var r=t.isGroupedBy();t.findMyRanker().groupBy(t,r+e)}else t.groupByMe()})),this.addGroupAdder(t,r,e)}else K(e)},t.prototype.renderSorting=function(t,e){var r=t.getSortCriteria();if(0!==r.length){var n=function(t,e){var r=t.col,n=r.isSortedByMe();isFinite(e)?0!==e?r.sortByMe("asc"===n.asc,n.priority+e):r.sortByMe("asc"===n.asc,-1):r.sortByMe("desc"===n.asc,n.priority)};this.render(e,r,(function(t){return t.col}),(function(t,e){e.insertAdjacentHTML("afterbegin",'\n      <i title="Sort" class="'+bh("sort")+'" data-sort="'+(t.asc?"asc":"desc")+'">'+Xn("Toggle Sorting")+"</i>"),e.querySelector("i[title=Sort]").onclick=function(e){e.preventDefault(),e.stopPropagation(),n(t,1/0)}}),"sort",n),this.addSortAdder(t,r,e)}else K(e)},t.prototype.renderGroupSorting=function(t,e){var r=t.getGroupSortCriteria();if(0!==r.length){var n=function(t,e){var r=t.col,n=r.isGroupSortedByMe();isFinite(e)?0!==e?r.groupSortByMe("asc"===n.asc,n.priority+e):r.groupSortByMe("asc"===n.asc,-1):r.groupSortByMe("desc"===n.asc,n.priority)};this.render(e,r,(function(t){return t.col}),(function(t,e){e.insertAdjacentHTML("afterbegin",'\n      <i title="Sort Group" class="'+bh("sort-groups")+'" data-sort="'+(t.asc?"asc":"desc")+'">'+Xn("Toggle Sorting")+"</i>"),e.querySelector('i[title="Sort Group"]').onclick=function(e){e.preventDefault(),e.stopPropagation(),n(t,1/0)}}),"sortGroup",n),this.addGroupSortAdder(t,r,e)}else K(e)},t.prototype.addAdder=function(t,e,r,n,i,o,a){var s=this,u=new Set(n);if(t.data=e.children.filter((function(t){return!wt(t)&&!u.has(t)&&o(t)})).map((function(t){return{col:t,id:t.id,text:t.label}})),t.on(Tg.EVENT_SELECT,(function(e){var n=fd(e.col,r,s.ctx);n.length>0?s.customize(e.col,n,t.node,(function(){return a(e.col)})):a(e.col)})),!(t.data.length<=0)){var l=i.ownerDocument.createElement("footer");l.appendChild(t.node),l.classList.add(qn("hierarchy-adder")),i.appendChild(l)}},t.prototype.addSortAdder=function(t,e,r){var n=this;this.addAdder(this.sortAdder,t,"sort",e.map((function(t){return t.col})),r,(function(t){return e=t,r=n.ctx,null!=cd(e,r).find((function(t){return t===Xh||t===$h||t.title===Xh.title||t.title.startsWith("Sort By")}));var e,r}),(function(r){t.sortBy(r,mt(r),e.length)}))},t.prototype.addGroupAdder=function(t,e,r){var n=this;this.addAdder(this.groupAdder,t,"group",e,r,(function(t){return e=t,r=n.ctx,null!=cd(e,r).find((function(t){return t===ed||t===rd||t.title===ed.title||t.title.startsWith("Group By")}));var e,r}),(function(r){t.groupBy(r,e.length)}))},t.prototype.addGroupSortAdder=function(t,e,r){var n=this;this.addAdder(this.groupSortAdder,t,"sortGroup",e.map((function(t){return t.col})),r,(function(t){return e=t,r=n.ctx,null!=cd(e,r).find((function(t){return t===Jh||t.title===Jh.title||t.title.startsWith("Sort Groups By")}));var e,r}),(function(r){t.groupSortBy(r,mt(r),e.length)}))},t.prototype.customize=function(t,e,r,n){new Ag(t,e,pf(this.ctx,0,r),this.ctx,n).open()},t}(),Sg=function(){function t(t,e,r){var n=this;this.column=t,this.ctx=e,this.summaryUpdater=null,this.node=r.createElement("article"),this.node.classList.add(qn("side-panel-entry")),this.node.dataset.colId=t.id,this.node.dataset.type=t.desc.type,this.summary=e.summaryRenderer(t,!0),this.column.on(it(".panel",js.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_HEADER),(function(){n.update()})),this.column.on(it(".panel",pt.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,pt.EVENT_DIRTY_CACHES),(function(){n.recreateSummary()})),this.init(),this.update()}return t.prototype.init=function(){this.node.innerHTML='\n      <header class="'+qn("side-panel-entry-header")+'">\n        <div class="'+qn("side-panel-labels")+'">\n          <span class="'+qn("label")+" "+qn("typed-icon")+" "+qn("side-panel-label")+'"></span>\n          <span class="'+qn("sublabel")+" "+qn("side-panel-sublabel")+'"></span>\n        </div>\n        <div class="'+qn("toolbar")+" "+qn("side-panel-toolbar")+'"></div>\n      </header>',Nh(this.node.querySelector("."+qn("toolbar")),0,this.column,this.ctx,"sidePanel",!1),wh(this.node.querySelector("header"),this.column,this.ctx),this.appendSummary()},t.prototype.update=function(t){void 0===t&&(t=this.ctx),this.ctx=t,yh(this.node,this.column),this.updateSummary()},t.prototype.updateSummary=function(){var t=this.node.querySelector("."+qn("summary"));this.summaryUpdater&&(this.summaryUpdater.abort(),t.classList.remove(Kn("loading")),this.summaryUpdater=null);var e=this.summary.update(t);e&&(this.summaryUpdater=e,t.classList.add(Kn("loading")),e.then((function(e){"symbol"!=typeof e&&t.classList.remove(Kn("loading"))})))},t.prototype.appendSummary=function(){var t=this.ctx.asElement(this.summary.template);t.classList.add(qn("summary"),qn("side-panel-summary"),qn("renderer"),qn("renderer-"+this.column.getSummaryRenderer())),t.dataset.renderer=this.column.getSummaryRenderer(),t.dataset.interactive=Dt(this.column).toString(),this.node.appendChild(t)},t.prototype.recreateSummary=function(){this.node.removeChild(this.node.querySelector("."+qn("summary"))),this.summary=this.ctx.summaryRenderer(this.column,!0),this.appendSummary(),this.updateSummary()},t.prototype.destroy=function(){this.column.on(it(".panel",js.EVENT_FILTER_CHANGED,pt.EVENT_DIRTY_HEADER,pt.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,pt.EVENT_DIRTY_CACHES),null),this.node.remove()},t}(),Mg=function(){function t(t,e,r,n){this.ranking=t,this.ctx=e,this.options=n,this.entries=new Map,this.node=r.createElement("section"),this.header=r.createElement("div"),this.dropdown=r.createElement("div"),this.node.classList.add(qn("side-panel-ranking")),this.header.classList.add(qn("side-panel-ranking-header"),qn("side-panel-ranking-label")),this.dropdown.classList.add(qn("side-panel-ranking-label")),this.dropdown.innerHTML=this.header.innerHTML="<span>"+t.getLabel()+'</span><i class="'+bh("more")+'" title="More &hellip;">'+Xn("More &hellip;")+"</i>",this.header.lastElementChild.onclick=this.dropdown.lastElementChild.onclick=function(r){r.stopPropagation(),r.preventDefault(),new Rg(t,pf(e,1,r),e).open()},this.hierarchy=this.options.hierarchy?new Dg(e,r):null,this.init()}return t.prototype.init=function(){var t=this;this.node.innerHTML='<main class="'+qn("side-panel-ranking-main")+'"></main>',this.hierarchy&&this.node.insertBefore(this.hierarchy.node,this.node.firstChild),this.hierarchy&&this.ranking.on(it(".panel",Zn.EVENT_GROUP_CRITERIA_CHANGED,Zn.EVENT_SORT_CRITERIA_CHANGED,Zn.EVENT_GROUP_SORT_CRITERIA_CHANGED),(function(){t.updateHierarchy()})),this.ranking.on(it(".panel",Zn.EVENT_ADD_COLUMN,Zn.EVENT_REMOVE_COLUMN,Zn.EVENT_MOVE_COLUMN),(function(){t.updateList(),t.updateHierarchy()})),this.ranking.on(it(".panel",Zn.EVENT_LABEL_CHANGED),(function(){t.dropdown.firstElementChild.textContent=t.header.firstElementChild.textContent=t.ranking.getLabel()}))},Object.defineProperty(t.prototype,"active",{get:function(){return this.node.classList.contains(qn("active"))},set:function(t){this.node.classList.toggle(qn("active"),t),this.header.classList.toggle(qn("active"),t),this.dropdown.classList.toggle(qn("active"),t),t||(this.updateList(),this.updateHierarchy())},enumerable:!0,configurable:!0}),t.prototype.update=function(t){this.ctx=t,this.updateList(),this.updateHierarchy()},t.prototype.updateHierarchy=function(){this.hierarchy&&this.active&&this.hierarchy.update(this.ranking)},t.prototype.updateList=function(){var t=this;if(this.active){var e=this.node.querySelector("main"),r=this.ranking.flatColumns.filter((function(t){return!wt(t)}));if(0===r.length)return K(e),this.entries.forEach((function(t){return t.destroy()})),void this.entries.clear();K(e);var n=new Map(this.entries);this.entries.clear(),r.forEach((function(r){var i=n.get(r.id);if(i)return i.update(t.ctx),e.appendChild(i.node),t.entries.set(r.id,i),void n.delete(r.id);var o=new Sg(r,t.ctx,e.ownerDocument);e.appendChild(o.node),t.entries.set(r.id,o)})),n.forEach((function(t){return t.destroy()}))}},t.prototype.destroy=function(){this.header.remove(),this.node.remove(),this.ranking.on(it(".panel",Zn.EVENT_GROUP_CRITERIA_CHANGED,Zn.EVENT_SORT_CRITERIA_CHANGED,Zn.EVENT_GROUP_SORT_CRITERIA_CHANGED,Zn.EVENT_ADD_COLUMN,Zn.EVENT_MOVE_COLUMN,Zn.EVENT_REMOVE_COLUMN,Zn.EVENT_LABEL_CHANGED),null),this.entries.forEach((function(t){return t.destroy()})),this.entries.clear()},t}();function Lg(t){return null!=t.desc}var xg=function(){function t(t,e,r){void 0===r&&(r={}),this.ctx=t,this.options={additionalDescs:[Du("Weighted Sum"),ku("Scripted Formula"),Lu("Nested"),Ru(),vu(),ri(),ii(),iu(),$n()],chooser:!0,hierarchy:!0,placeholder:"Add Column...",formatItem:function(t,e){var r=Lg(t)?t:t.children[0];return e.dataset.typeCat=r.category.name,e.classList.add(qn("typed-icon")),Lg(t)&&(e.dataset.type=r.desc.type),e.parentElement&&(e.parentElement.classList.add(qn("feature-model")),e.parentElement.classList.toggle(qn("feature-advanced"),"advanced"===r.category.featureLevel),e.parentElement.classList.toggle(qn("feature-basic"),"basic"===r.category.featureLevel)),t.text},collapseable:!0},this.chooser=null,this.descs=[],this.rankings=[],Object.assign(this.options,r),this.node=e.createElement("aside"),this.node.classList.add(qn("side-panel")),this.search=this.options.chooser?new Tg(this.options):null,this.data=t.provider,this.init(),this.update(t)}return t.prototype.init=function(){var t=this;(this.node.innerHTML='\n      <aside class="'+qn("stats")+'"></aside>\n      <header class="'+qn("side-panel-rankings")+'">\n        <i class="'+qn("action")+'" title="Choose &hellip;">'+Xn("Choose &hellip;")+'</i>\n      </header>\n      <main class="'+qn("side-panel-main")+'"></main>\n    ',this.node.querySelector("header > i").onclick=function(e){e.stopPropagation(),new _g(t.rankings.map((function(t){return t.dropdown})),pf(t.ctx,1,e)).open()},this.options.collapseable)&&(this.node.insertAdjacentHTML("beforeend",'<div class="'+qn("collapser")+'" title="Collapse Panel">'+Xn("Collapse Panel")+"</div>"),this.node.lastElementChild.onclick=function(){return t.collapsed=!t.collapsed},this.collapsed="collapsed"===this.options.collapseable);this.initChooser(),this.changeDataStorage(null,this.data)},t.prototype.initChooser=function(){var t=this;this.search&&(this.chooser=this.node.ownerDocument.createElement("header"),this.chooser.appendChild(this.chooser.ownerDocument.createElement("form")),this.chooser.classList.add(qn("side-panel-chooser")),this.chooser.firstElementChild.appendChild(this.search.node),this.search.on(Tg.EVENT_SELECT,(function(e){var r=t.data.create(e.desc);if(r){var n=t.active;n&&n.ranking.push(r)}})))},Object.defineProperty(t.prototype,"active",{get:function(){return this.rankings.find((function(t){return t.active}))},enumerable:!0,configurable:!0}),t.prototype.changeDataStorage=function(t,e){var r,n=this;t&&t.on(it(".panel",Nl.EVENT_ADD_RANKING,Nl.EVENT_REMOVE_RANKING,Nl.EVENT_ADD_DESC,Nl.EVENT_CLEAR_DESC,Nl.EVENT_ORDER_CHANGED,Nl.EVENT_SELECTION_CHANGED),null),this.data=e;var i=function(t){return{desc:t,category:At(t,e.columnTypes),id:t.type+"@"+t.label,text:t.label}};(r=this.descs).splice.apply(r,[0,this.descs.length].concat(e.getColumns().concat(this.options.additionalDescs).map(i))),e.on(Nl.EVENT_ADD_DESC+".panel",(function(t){n.descs.push(i(t)),n.updateChooser()})),e.on(Nl.EVENT_CLEAR_DESC+".panel",(function(){n.descs.splice(0,n.descs.length),n.updateChooser()})),e.on(it(".panel",Nl.EVENT_SELECTION_CHANGED,Nl.EVENT_ORDER_CHANGED),(function(){n.updateStats()})),e.on(it(".panel",Nl.EVENT_ADD_RANKING),(function(t,e){n.createEntry(t,e),n.makeActive(e)})),e.on(it(".panel",Nl.EVENT_REMOVE_RANKING),(function(t,e){if(e<0)return n.rankings.splice(0,n.rankings.length).forEach((function(t){return t.destroy()})),n.node.querySelector("header").dataset.count="0",void n.makeActive(-1);var r=n.rankings.splice(e,1)[0];n.node.querySelector("header").dataset.count=String(n.rankings.length),r.destroy(),r.active&&n.makeActive(0===n.rankings.length?-1:Math.max(e-1,0))})),this.rankings.splice(0,this.rankings.length).forEach((function(t){return t.destroy()})),e.getRankings().forEach((function(t,e){n.createEntry(t,e)})),this.rankings.length>0&&this.makeActive(0),this.updateStats()},t.prototype.createEntry=function(t,e){var r=this,n=new Mg(t,this.ctx,this.node.ownerDocument,this.options),i=this.node.querySelector("header"),o=this.node.querySelector("main");i.insertBefore(n.header,i.children[e+1]),i.dataset.count=String(this.rankings.length+1),n.header.onclick=function(t){t.preventDefault(),t.stopPropagation(),r.makeActive(r.rankings.indexOf(n))},n.dropdown.onclick=n.header.onclick=function(t){t.preventDefault(),t.stopPropagation(),r.ctx.dialogManager.removeAboveLevel(0),r.makeActive(r.rankings.indexOf(n))},o.insertBefore(n.node,o.children[e]),this.rankings.splice(e,0,n)},Object.defineProperty(t.prototype,"collapsed",{get:function(){return this.node.classList.contains(qn("collapsed"))},set:function(t){this.node.classList.toggle(qn("collapsed"),t),t||(this.updateChooser(),this.updateStats(),this.updateRanking())},enumerable:!0,configurable:!0}),t.prototype.makeActive=function(t){this.rankings.forEach((function(e,r){return e.active=t===r}));var e=this.active;if(e&&this.chooser){e.node.insertAdjacentElement("afterbegin",this.chooser);var r=this.node.closest("."+qn()),n=r?r.querySelector('article[data-ranking="'+e.ranking.id+'"]'):null;n&&n.scrollIntoView()}this.updateRanking()},t.prototype.updateRanking=function(){var t=this.active;t&&!this.collapsed&&t.update(this.ctx)},t.prototype.update=function(t){var e=this.data;this.ctx=t,t.provider!==e&&this.changeDataStorage(e,t.provider),this.updateChooser(),this.updateStats();var r=this.active;r&&r.update(t)},t.prototype.updateStats=function(){var t=this;if(!this.collapsed){var e=this.node.querySelector("."+qn("stats")),r=this.data.getSelection(),n=this.data.getFirstRanking(),i=Ti(",d"),o=n?n.getGroups().reduce((function(t,e){return t+e.order.length}),0):0,a=this.data.getTotalNumberOfRows();e.innerHTML="Showing <strong>"+i(o)+"</strong> of "+i(a)+" items"+(r.length>0?"; <span>"+i(r.length)+" selected</span>":"")+(o<a?' <i class="'+qn("action")+" "+qn("action-filter")+" "+qn("stats-reset")+'" title="Reset filters"><span>Reset</span></i>':"");var s=e.querySelector("."+qn("stats-reset"));s&&(s.onclick=function(e){e.preventDefault(),e.stopPropagation(),t.data.clearFilters()})}},t.prototype.destroy=function(){this.node.remove(),this.data&&(this.rankings.forEach((function(t){return t.destroy()})),this.rankings.length=0,this.data.on(it(".panel",Nl.EVENT_ADD_RANKING,Nl.EVENT_REMOVE_RANKING,Nl.EVENT_ADD_DESC),null))},t.groupByType=function(t){var e=new Map;return t.forEach((function(t){e.has(t.category)?e.get(t.category).push(t):e.set(t.category,[t])})),Array.from(e).map((function(t){var e=t[0],r=t[1];return{text:e.label,order:e.order,children:r.sort((function(t,e){return t.text.localeCompare(e.text)}))}})).sort((function(t,e){return t.order-e.order}))},t.prototype.updateChooser=function(){this.search&&!this.collapsed&&(this.search.data=t.groupByType(this.descs))},t}(),Og=function(t){function e(e,r,n){void 0===n&&(n={});var i=t.call(this,e,r,n&&!0===n.ignoreUnsupportedBrowser)||this;return i.options=gd(),cf(i.options,n),i.isBrowserSupported?(i.node.classList.add(qn()),i.renderer=new Ng(r,i.node,i.options),i.options.sidePanel?(i.panel=new xg(i.renderer.ctx,i.node.ownerDocument,{collapseable:!i.options.sidePanelCollapsed||"collapsed",hierarchy:i.options.hierarchyIndicator&&i.options.flags.advancedRankingFeatures}),i.renderer.pushUpdateAble((function(t){return i.panel.update(t)})),i.node.insertBefore(i.panel.node,i.node.firstChild)):i.panel=null,i.forward.apply(i,[i.renderer].concat(it(".main",Ng.EVENT_HIGHLIGHT_CHANGED,Ng.EVENT_DIALOG_OPENED,Ng.EVENT_DIALOG_CLOSED))),i):(i.renderer=null,i.panel=null,i)}return i(e,t),e.prototype.destroy=function(){this.node.classList.remove(qn()),this.renderer&&this.renderer.destroy(),this.panel&&this.panel.destroy(),t.prototype.destroy.call(this)},e.prototype.update=function(){this.renderer&&this.renderer.update()},e.prototype.setDataProvider=function(e,r){t.prototype.setDataProvider.call(this,e,r),this.renderer&&(this.renderer.setDataProvider(e),this.update(),this.panel&&this.panel.update(this.renderer.ctx))},e.prototype.setHighlight=function(t,e){return void 0===e&&(e=!0),null!=this.renderer&&this.renderer.setHighlight(t,e)},e.prototype.getHighlight=function(){return this.renderer?this.renderer.getHighlight():-1},e.prototype.enableHighlightListening=function(t){this.renderer&&this.renderer.enableHighlightListening(t)},e.EVENT_SELECTION_CHANGED=Ed.EVENT_SELECTION_CHANGED,e.EVENT_DIALOG_OPENED=Ed.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED=Ed.EVENT_DIALOG_CLOSED,e.EVENT_HIGHLIGHT_CHANGED=Ed.EVENT_HIGHLIGHT_CHANGED,e}(Ed);function Vg(t){return{apply:function(e,r,n,i){var o=function(e,r,n,i){var o=r-t.rowHeight-5,a=e.filter((function(t){return!lt(t)})),s=e.length-a.length,u=a.reduce((function(t,e){return t+(n.has(e.dataIndex)?1:0)}),0),l=a.length-u,c=a.reduce((function(t,e){return t+vl(e,i)}),0);if(l<=0)return{height:t.rowHeight,violation:""};var p=o-s*t.groupHeight-c*t.groupPadding-u*t.rowHeight,f=Math.floor(p/l);return f<1?{height:1,violation:"Not possible to fit all rows on the screen."}:f>t.rowHeight?{height:t.rowHeight,violation:""}:{height:f,violation:""}}(e,r,n,i),a=o.violation,s=o.height;return{item:function(e){return n.has(e.dataIndex)?t.rowHeight:s},group:t.groupHeight,violation:a}},levelOfDetail:function(e,r){return r>=.9*(lt(e)?t.groupHeight:t.rowHeight)?"high":"low"}}}var Ig=function(t){function e(e,r,n){var i=t.call(this)||this;return i.data=e,i.isDynamicLeafHeight=!1,i.rule=null,i.levelOfDetail=null,i.resizeListener=function(){return ei((function(){return i.update()}),100)},i.options={violationChanged:function(){},rowPadding:2},Object.assign(i.options,n),i.renderer=new Ng(e,r,Object.assign({},n,{dynamicHeight:function(t,e){var r=i.dynamicHeight(t,e);return r||(n.dynamicHeight?n.dynamicHeight(t,e):null)},levelOfDetail:function(t){return i.levelOfDetail?i.levelOfDetail(t):"high"}})),i.data.on(Nl.EVENT_SELECTION_CHANGED+".rule",(function(){i.isDynamicLeafHeight&&i.update()})),i.forward.apply(i,[i.renderer].concat(it(".main",Ng.EVENT_HIGHLIGHT_CHANGED,Ng.EVENT_DIALOG_OPENED,Ng.EVENT_DIALOG_CLOSED))),window.addEventListener("resize",i.resizeListener,{passive:!0}),i}return i(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.renderer.style},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctx",{get:function(){return this.renderer.ctx},enumerable:!0,configurable:!0}),e.prototype.pushUpdateAble=function(t){this.renderer.pushUpdateAble(t)},e.prototype.dynamicHeight=function(t,e){var r=this;if(!this.rule)return this.levelOfDetail=null,this.options.violationChanged(null,""),null;var n=this.renderer?this.renderer.node.querySelector("main").clientHeight:100,i=this.rule.apply(t,n,new Set(this.data.getSelection()),(function(t){return r.data.getTopNAggregated(e,t)}));this.isDynamicLeafHeight="function"==typeof i.item,this.options.violationChanged(this.rule,i.violation||"");var o=function(t){return lt(t)?"number"==typeof i.group?i.group:i.group(t):"number"==typeof i.item?i.item:i.item(t)};return this.levelOfDetail=function(e){var n=t[e];return r.rule?r.rule.levelOfDetail(n,o(n)):"high"},{defaultHeight:"number"==typeof i.item?i.item:NaN,height:o,padding:0}},e.prototype.createEventList=function(){return t.prototype.createEventList.call(this).concat([e.EVENT_HIGHLIGHT_CHANGED,e.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED])},e.prototype.on=function(e,r){return t.prototype.on.call(this,e,r)},e.prototype.zoomOut=function(){this.renderer.zoomOut()},e.prototype.zoomIn=function(){this.renderer.zoomIn()},e.prototype.switchRule=function(t){this.rule!==t&&(this.rule=t,this.update())},e.prototype.destroy=function(){this.renderer.destroy(),window.removeEventListener("resize",this.resizeListener)},e.prototype.update=function(){this.renderer.update()},e.prototype.setDataProvider=function(t){var e=this;this.data&&this.data.on(Nl.EVENT_SELECTION_CHANGED+".rule",null),this.data=t,this.data.on(Nl.EVENT_SELECTION_CHANGED+".rule",(function(){e.isDynamicLeafHeight&&e.update()})),this.renderer.setDataProvider(t),this.update()},e.prototype.setHighlight=function(t,e){return this.renderer.setHighlight(t,e)},e.prototype.getHighlight=function(){return this.renderer.getHighlight()},e.prototype.enableHighlightListening=function(t){this.renderer.enableHighlightListening(t)},e.EVENT_HIGHLIGHT_CHANGED=Ng.EVENT_HIGHLIGHT_CHANGED,e.EVENT_DIALOG_OPENED=Ng.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED=Ng.EVENT_DIALOG_CLOSED,e}(at),kg=function(t){function e(e,r,n){void 0===n&&(n={});var i=t.call(this,e,r,n&&!0===n.ignoreUnsupportedBrowser)||this;if(i.options=gd(),cf(i.options,n),cf(i.options,{violationChanged:function(t,e){return i.setViolation(e)}}),!i.isBrowserSupported)return i.spaceFilling=null,i.renderer=null,i.panel=null,i;i.node.classList.add(qn(),qn("taggle")),i.renderer=new Ig(r,i.node,i.options),i.panel=new xg(i.renderer.ctx,i.node.ownerDocument,{collapseable:!i.options.sidePanelCollapsed||"collapsed",hierarchy:i.options.hierarchyIndicator&&i.options.flags.advancedRankingFeatures}),i.renderer.pushUpdateAble((function(t){return i.panel.update(t)})),i.node.insertBefore(i.panel.node,i.node.firstChild),i.panel.node.insertAdjacentHTML("afterbegin",'<div class="'+qn("rule-button-chooser")+" "+qn("feature-advanced")+" "+qn("feature-ui")+'"><label>\n            <input type="checkbox">\n            <span>Overview</span>\n            <div class="'+qn("rule-violation")+'"></div>\n          </label></div>');var o=Vg(i.options);i.spaceFilling=i.panel.node.querySelector("."+qn("rule-button-chooser"));var a=i.spaceFilling.querySelector("input");return a.onchange=function(){var t=i.spaceFilling.classList.toggle(qn("chosen"));self.setTimeout((function(){i.updateLodRules(t),i.renderer.switchRule(t?o:null)}))},i.options.overviewMode&&(a.checked=!0,i.spaceFilling.classList.toggle(qn("chosen")),i.updateLodRules(!0),i.renderer.switchRule(o)),i.forward.apply(i,[i.renderer].concat(it(".main",Ig.EVENT_HIGHLIGHT_CHANGED,Ig.EVENT_DIALOG_OPENED,Ig.EVENT_DIALOG_CLOSED))),i}return i(e,t),e.prototype.updateLodRules=function(t){this.renderer&&Gg(this.renderer.style,t,this.options)},e.prototype.setViolation=function(t){if(t=t||"",this.spaceFilling){this.spaceFilling.classList.toggle(qn("violated"),Boolean(t));var e=this.spaceFilling.querySelector("."+qn("rule-violation"));t?e.innerHTML=t.replace(/\n/g,"<br>"):e.textContent=""}},e.prototype.destroy=function(){this.node.classList.remove(qn(),qn("taggle")),this.renderer&&this.renderer.destroy(),this.panel&&this.panel.destroy(),t.prototype.destroy.call(this)},e.prototype.update=function(){this.renderer&&this.renderer.update()},e.prototype.setHighlight=function(t,e){return void 0===e&&(e=!0),null!=this.renderer&&this.renderer.setHighlight(t,e)},e.prototype.getHighlight=function(){return this.renderer?this.renderer.getHighlight():-1},e.prototype.enableHighlightListening=function(t){this.renderer&&this.renderer.enableHighlightListening(t)},e.prototype.setDataProvider=function(e,r){t.prototype.setDataProvider.call(this,e,r),this.renderer&&(this.renderer.setDataProvider(e),this.update(),this.panel.update(this.renderer.ctx))},e.EVENT_SELECTION_CHANGED=Ed.EVENT_SELECTION_CHANGED,e.EVENT_DIALOG_OPENED=Ed.EVENT_DIALOG_OPENED,e.EVENT_DIALOG_CLOSED=Ed.EVENT_DIALOG_CLOSED,e.EVENT_HIGHLIGHT_CHANGED=Ed.EVENT_HIGHLIGHT_CHANGED,e}(Ed);function Gg(t,e,r){if(!e)return t.deleteRule("taggle_lod_rule"),t.deleteRule("lineup_rowPadding1"),void t.deleteRule("lineup_rowPadding2");t.updateRule("taggle_lod_rule","\n  ."+Kn("tr")+"."+qn("low")+"[data-agg=detail]:hover",{height:r.rowHeight+"px !important"}),t.updateRule("lineup_rowPadding1","\n  ."+Kn("tr")+"."+qn("low"),{marginTop:"0"}),t.updateRule("lineup_rowPadding2","\n  ."+Kn("tr")+"."+qn("low")+"."+Kn("highlighted")+",\n  ."+Kn("tr")+"."+qn("selected")+",\n  ."+Kn("tr")+"."+qn("low")+":hover + ."+Kn("tr")+"."+qn("low")+",\n  ."+Kn("tr")+"."+qn("low")+"."+Kn("highlighted")+" + ."+Kn("tr")+"."+qn("low")+",\n  ."+Kn("tr")+"."+qn("selected")+" + ."+Kn("tr")+"."+qn("low"),{marginTop:r.rowPadding+"px !important"})}var Hg=function(){function t(t,e){this.desc={column:e,type:t,label:e?e[0].toUpperCase()+e.slice(1):t}}return t.prototype.label=function(t){return this.desc.label=t,this},t.prototype.summary=function(t){return this.desc.summary=t,this},t.prototype.description=function(t){return this.desc.description=t,this},t.prototype.frozen=function(){return this.desc.frozen=!0,this},t.prototype.renderer=function(t,e,r){return t&&(this.desc.renderer=t),e&&(this.desc.groupRenderer=e),r&&(this.desc.summaryRenderer=r),this},t.prototype.custom=function(t,e){return this.desc[t]=e,this},t.prototype.width=function(t){return this.desc.width=t,this},t.prototype.color=function(t){return this},t.prototype.asArray=function(t){console.assert(["boolean","categorical","date","number","string","link"].includes(this.desc.type)),this.desc.type+="s";var e=this.desc;return Array.isArray(t)?(e.labels=t,e.dataLength=t.length):"number"==typeof t&&(e.dataLength=t),this},t.prototype.asMap=function(){return console.assert(["categorical","date","number","string","link"].includes(this.desc.type)),this.desc.type+="Map",this},t.prototype.build=function(t){return this.desc},t}(),Pg=Hg;function Fg(t,e){return new Hg(t,e)}var Ug=function(){function t(){this.options={renderers:{},toolbarActions:{},toolbarDialogAddons:{},flags:{}}}return t.prototype.animated=function(t){return this.options.animated=t,this},t.prototype.livePreviews=function(t){return this.options.livePreviews=t,this},t.prototype.labelRotation=function(t){return this.options.labelRotation=t,this},t.prototype.sidePanel=function(t,e){return void 0===e&&(e=!1),this.options.sidePanel=t,this.options.sidePanelCollapsed=e,this},t.prototype.hierarchyIndicator=function(t){return this.options.hierarchyIndicator=t,this},t.prototype.defaultSlopeGraphMode=function(t){return this.options.defaultSlopeGraphMode=t,this},t.prototype.summaryHeader=function(t){return this.options.summaryHeader=t,this},t.prototype.expandLineOnHover=function(t){return this.options.expandLineOnHover=t,this},t.prototype.overviewMode=function(){return this.options.overviewMode=!0,this},t.prototype.ignoreUnsupportedBrowser=function(){return this.options.ignoreUnsupportedBrowser=!0,this},t.prototype.registerRenderer=function(t,e){return this.options.renderers[t]=e,this},t.prototype.canRender=function(t){return this.options.canRender=t,this},t.prototype.registerToolbarAction=function(t,e){return this.options.toolbarActions[t]=e,this},t.prototype.registerToolbarDialogAddon=function(t,e){return this.options.toolbarDialogAddons[t]=e,this},t.prototype.rowHeight=function(t,e){return void 0===e&&(e=2),this.options.rowHeight=t,this.options.rowPadding=e,this},t.prototype.groupRowHeight=function(t,e){return void 0===e&&(e=5),this.options.groupHeight=t,this.options.groupPadding=e,this},t.prototype.dynamicHeight=function(t){return this.options.dynamicHeight=t,this},t.prototype.disableAdvancedRankingFeatures=function(){return this.options.flags.advancedRankingFeatures=!1,this},t.prototype.disableAdvancedModelFeatures=function(){return this.options.flags.advancedModelFeatures=!1,this},t.prototype.disableAdvancedUIFeatures=function(){return this.options.flags.advancedUIFeatures=!1,this},t}(),Bg=function(){function t(){this.columns=[],this.sort=[],this.groupSort=[],this.groups=[]}return t.prototype.sortBy=function(t,e){if(void 0===e&&(e=!0),t.includes(":")){var r=t.indexOf(":");e=t.slice(r+1),t=t.slice(0,r)}return this.sort.push({column:t,asc:!0===e||"a"===String(e)[0]}),this},t.prototype.groupBy=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n=0,i=e;n<i.length;n++){var o=i[n];Array.isArray(o)?(t=this.groups).push.apply(t,o):this.groups.push(o)}return this},t.prototype.groupSortBy=function(t,e){if(void 0===e&&(e=!0),t.includes(":")){var r=t.indexOf(":");e=t.slice(r+1),t=t.slice(0,r)}return this.groupSort.push({column:t,asc:!0===e||"a"===String(e)[0]}),this},t.prototype.column=function(t){if("string"==typeof t){switch(t){case"_aggregate":return this.aggregate();case"_selection":return this.selection();case"_group":return this.group();case"_rank":return this.rank();case"_*":return this.supportTypes();case"*":return this.allColumns()}return this.columns.push(t),this}var e=t.label||null;switch(t.type){case"impose":return this.impose(e,t.column,t.colorColumn);case"min":case"max":case"median":case"mean":return console.assert(t.columns.length>=2),this.reduce.apply(this,[e,t.type,t.columns[0],t.columns[1]].concat(t.columns.slice(2)));case"nested":return console.assert(t.columns.length>=1),this.nested.apply(this,[e,t.columns[0]].concat(t.columns.slice(1)));case"script":return this.scripted.apply(this,[e,t.code].concat(t.columns));case"weightedSum":console.assert(t.columns.length>=2),console.assert(t.columns.length===t.weights.length);var r=[];return t.columns.slice(2).forEach((function(e,n){r.push(e),r.push(t.weights[n+2])})),this.weightedSum.apply(this,[e,t.columns[0],t.weights[0],t.columns[1],t.weights[1]].concat(r))}return console.error("invalid column type: ",t),this},t.prototype.impose=function(t,e,r){return this.columns.push({desc:function(r){var n=r.getColumns().find((function(t){return t.label===e||t.column===e}));switch(n?n.type:""){case"boxplot":return Cu(t||void 0);case"numbers":return _u(t||void 0);default:return vu(t||void 0)}},columns:[e,r]}),this},t.prototype.nested=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.columns.push({desc:Lu(t||void 0),columns:[e].concat(r)}),this},t.prototype.composite=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return this.columns.push({desc:t,columns:e}),this},t.prototype.weightedSum=function(t,e,r,n,i){for(var o=[],a=5;a<arguments.length;a++)o[a-5]=arguments[a];var s=[r,i].concat(o.filter((function(t,e){return e%2==1})));return this.columns.push({desc:Du(t||void 0),columns:[e,n].concat(o.filter((function(t,e){return e%2==0}))),post:function(t){t.setWeights(s)}}),this},t.prototype.reduce=function(t,e,r,n){for(var i=[],o=4;o<arguments.length;o++)i[o-4]=arguments[o];return this.columns.push({desc:Ru(t||void 0),columns:[r,n].concat(i),post:function(t){t.setReduce(e)}}),this},t.prototype.scripted=function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.columns.push({desc:Object.assign(ku(t||void 0),{script:e}),columns:r}),this},t.prototype.selection=function(){return this.columns.push({desc:ii(),columns:[]}),this},t.prototype.group=function(){return this.columns.push({desc:iu(),columns:[]}),this},t.prototype.aggregate=function(){return this.columns.push({desc:$n(),columns:[]}),this},t.prototype.rank=function(){return this.columns.push({desc:ri(),columns:[]}),this},t.prototype.supportTypes=function(){return this.aggregate().rank().selection()},t.prototype.allColumns=function(){return this.columns.push(t.ALL_MAGIC_FLAG),this},t.prototype.build=function(e){var r=e.pushRanking(),n=e.getColumns(),i=function(t){return n.find((function(e){return e.label===t||e.column===t}))};this.columns.forEach((function(o){if(o!==t.ALL_MAGIC_FLAG)if("string"!=typeof o){var a=e.create("function"==typeof o.desc?o.desc(e):o.desc);r.push(a),o.columns.forEach((function(t){var r=i(t),n=r?e.create(r):null;n?a.push(n):console.warn("invalid column: ",t)})),o.post&&o.post(a)}else!function(t){var n=i(t);n?e.push(r,n):console.warn("invalid column: ",t)}(o);else n.forEach((function(t){return e.push(r,t)}))}));var o=r.children,a=[];this.groups.forEach((function(t){var n=o.find((function(e){return e.desc.label===t||e.desc.column===t}));if(n)a.push(n);else{var s=i(t);if(s){var u=e.push(r,s);u?a.push(u):console.warn("invalid group criteria column: ",t)}else console.warn("invalid group criteria column: ",t)}})),a.length>0&&r.setGroupCriteria(a);var s=[];this.sort.forEach((function(t){var n=t.column,a=t.asc,u=o.find((function(t){return t.desc.label===n||t.desc.column===n}));if(u)s.push({col:u,asc:a});else{var l=i(n);if(l){var c=e.push(r,l);c?s.push({col:c,asc:a}):console.warn("invalid sort criteria column: ",n)}else console.warn("invalid sort criteria column: ",n)}})),s.length>0&&r.setSortCriteria(s);var u=[];return this.groupSort.forEach((function(t){var n=t.column,a=t.asc,s=o.find((function(t){return t.desc.label===n||t.desc.column===n}));if(s)u.push({col:s,asc:a});else{var l=i(n);if(l){var c=e.push(r,l);c?u.push({col:c,asc:a}):console.warn("invalid group sort criteria column: ",n)}else console.warn("invalid group sort criteria column: ",n)}})),u.length>0&&r.setGroupSortCriteria(u),r},t.ALL_MAGIC_FLAG="*",t}();function jg(){return new Bg}var Yg=function(t){function e(e){return t.call(this,"categorical",e)||this}return i(e,t),e.prototype.asOrdinal=function(){return this.desc.type="ordinal",this},e.prototype.categories=function(t){return this.desc.categories=t,this},e.prototype.asSet=function(t){return t&&(this.desc.separator=t),this.desc.type="set",this},e.prototype.derive=function(t){var e=new Set,r="set"===this.desc.type,n=this.desc.separator||";",i=function(t){return"string"==typeof t&&""!==t?t:null!=t&&"string"==typeof t.value&&""!==t.value?t.value:null},o=this.desc.column;t.forEach((function(t){var a=nl(t,o);if(Array.isArray(a))a.forEach((function(t){return e.add(i(t))}));else if(null!=a&&""!==a){(r?[a.toString()]:a.toString().split(n)).forEach((function(t){return e.add(i(t))}))}})),this.categories(sl(e))},e.prototype.build=function(e){return this.desc.categories||this.derive(e),t.prototype.build.call(this,e)},e}(Pg);function Wg(t,e){var r=new Yg(t);return e&&r.categories(e),r}var zg=function(t){function e(e){return t.call(this,"number",e)||this}return i(e,t),e.prototype.mapping=function(t,e,r){return"linear"===t?(this.desc.domain=e,r&&(this.desc.range=r),this):(this.desc.map={type:t,domain:e,range:r||[0,1]},this)},e.prototype.color=function(t){return this.colorMapping(t)},e.prototype.colorMapping=function(t){return this.desc.colorMapping=t,this},e.prototype.numberFormat=function(t){return this.desc.numberFormat=t,this},e.prototype.scripted=function(t,e){return this.desc.map={domain:e,code:t,type:"script"},this},e.prototype.asArray=function(e,r){return r&&(this.desc.sort=r),t.prototype.asArray.call(this,e)},e.prototype.asMap=function(e){return e&&(this.desc.sort=e),t.prototype.asMap.call(this)},e.prototype.asBoxPlot=function(t){return t&&(this.desc.sort=t),this.desc.type="boxplot",this},e.prototype.derive=function(t){var e=this.desc.column,r=function(t,e){var r=[];return(Array.isArray(t)?t:[t]).forEach((function(t){"number"!=typeof t||isNaN(t)||r.push(t),null==t||"number"!=typeof t.value||isNaN(t.value)||r.push(t.value),null==t||"number"!=typeof t[e]||isNaN(t[e])||r.push(t[e])})),r};return[E(t,(function(t){var n=nl(t,e),i=r(n,"min");return 0===i.length?1/0:E(i)})),C(t,(function(t){var n=nl(t,e),i=r(n,"max");return 0===i.length?-1/0:C(i)}))]},e.prototype.build=function(e){if(this.desc.map||this.desc.domain){var r=this.desc.domain||this.desc.map.domain;if(isNaN(r[0])||isNaN(r[1])){var n=this.derive(e);isNaN(r[0])&&(r[0]=n[0]),isNaN(r[1])&&(r[1]=n[1])}}else this.mapping("linear",this.derive(e));return t.prototype.build.call(this,e)},e}(Pg);function qg(t,e){var r=new zg(t);return e&&r.mapping("linear",e),r}var Kg=function(t){function e(e){return t.call(this,"string",e)||this}return i(e,t),e.prototype.editable=function(){return this.desc.type="annotate",this},e.prototype.alignment=function(t){return this.desc.alignment=t,this},e.prototype.html=function(){return this.desc.escape=!1,this},e.prototype.pattern=function(t,e){return this.desc.type="link",this.desc.pattern=t,e&&(this.desc.patternTemplates=e),this},e}(Pg);function Xg(t){return new Kg(t)}var $g=function(t){function e(e){return t.call(this,"date",e)||this}return i(e,t),e.prototype.format=function(t,e){return this.desc.dateFormat=t,e&&(this.desc.dateParse=e),this},e}(Pg);function Jg(t){return new $g(t)}var Qg=function(t){function e(e){return t.call(this,"hierarchy",e)||this}return i(e,t),e.prototype.hierarchy=function(t,e){return this.desc.hierarchy=t,e&&(this.desc.hierarchySeparator=e),this},e.prototype.build=function(e){return console.assert(Boolean(this.desc.hierarchy)),t.prototype.build.call(this,e)},e}(Pg);function Zg(t,e){var r=new Qg(t);return e&&r.hierarchy(e),r}var tm=function(t){function e(){return t.call(this,"actions","")||this}return i(e,t),e.prototype.action=function(t){return this.actions([t])},e.prototype.actions=function(t){var e;return this.desc.actions||(this.desc.actions=[]),(e=this.desc.actions).push.apply(e,t),this},e.prototype.groupAction=function(t){return this.groupActions([t])},e.prototype.groupActions=function(t){var e;return this.desc.groupActions||(this.desc.groupActions=[]),(e=this.desc.groupActions).push.apply(e,t),this},e}(Pg);function em(){return new tm}var rm=function(t){function e(e){return t.call(this,"boolean",e)||this}return i(e,t),e.prototype.trueMarker=function(t){return this.desc.trueMarker=t,this},e.prototype.falseMarker=function(t){return this.desc.falseMarker=t,this},e}(Pg);function nm(t){return new rm(t)}var im=function(t){function e(e){var r=t.call(this)||this;return r.data=e,r.columns=[],r.providerOptions={columnTypes:{}},r.rankBuilders=[],r._deriveColors=!1,r}return i(e,t),e.prototype.scheduledTaskExecutor=function(){return this.providerOptions.taskExecutor="scheduled",this},e.prototype.showTopN=function(t){return this.providerOptions.showTopN=t,this},e.prototype.aggregationStrategy=function(t){return this.providerOptions.aggregationStrategy=t,this},e.prototype.propagateAggregationState=function(t){return this.providerOptions.propagateAggregationState=t,this},e.prototype.singleSelection=function(){return this.providerOptions.singleSelection=!0,this},e.prototype.filterGlobally=function(){return this.providerOptions.filterGlobally=!0,this},e.prototype.deriveColumns=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n=(t=[]).concat.apply(t,e),i=0,o=pl(this.data,{columns:n});i<o.length;i++){var a=o[i];this.columns.push(a)}return this},e.prototype.deriveColors=function(){return this._deriveColors=!0,this},e.prototype.registerColumnType=function(t,e){return this.providerOptions.columnTypes[t]=e,this},e.prototype.column=function(t){return this.columns.push(t instanceof Pg?t.build.bind(t):t),this},e.prototype.restore=function(t){return this.rankBuilders.push((function(e){return e.restore(t)})),this},e.prototype.defaultRanking=function(t){return void 0===t&&(t=!0),this.rankBuilders.push((function(e){return e.deriveDefault(t)})),this},e.prototype.ranking=function(t){return this.rankBuilders.push(t instanceof Bg?t.build.bind(t):t),this},e.prototype.buildData=function(){for(var t=[],e=new Set,r=function(r){var i="function"==typeof r?r(n.data):r,o=i.type+"@"+i.label;if(!e.has(o))return t.push(i),e.add(o),"continue";var a=t.findIndex((function(t){return o===t.type+"@"+t.label}));t.splice(a,1,i)},n=this,i=0,o=this.columns;i<o.length;i++){r(o[i])}this._deriveColors&&fl(t);var a=new tc(this.data,t,this.providerOptions);return 0===this.rankBuilders.length&&this.defaultRanking(),this.rankBuilders.forEach((function(t){return t(a)})),a},e.prototype.build=function(t){return new Og(t,this.buildData(),this.options)},e.prototype.buildTaggle=function(t){return new kg(t,this.buildData(),this.options)},e}(Ug);function om(t){return new im(t)}function am(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return om(e).deriveColumns(r).deriveColors().defaultRanking().buildTaggle(t)}function sm(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return om(e).deriveColumns(r).deriveColors().defaultRanking().build(t)}function um(t,e){var r=t.column,n={column:r,type:t.type,label:r?r[0].toUpperCase()+r.slice(1):t.type};if(["label","description","frozen","width","renderer","groupRenderer","summaryRenderer","visible","fixed"].forEach((function(e){t.hasOwnProperty(e)&&(n[e]=t[e])})),t.custom&&Object.assign(n,t.custom),t.asMap&&(console.assert(["categorical","date","number","string","link"].includes(n.type)),n.type+="Map"),null!=t.asArray){console.assert(["boolean","categorical","date","number","string","link"].includes(n.type)),n.type+="s";var i=n,o=t.asArray;Array.isArray(o)?(i.labels=o,i.dataLength=o.length):"number"==typeof o&&(i.dataLength=o)}return n}function lm(t,e){var r=jg();t.sortBy&&(n=Array.isArray(t.sortBy)?t.sortBy:[t.sortBy]).forEach((function(t){"string"==typeof t?r.sortBy(t):r.sortBy(t.column,t.asc)}));if(t.groupBy){var n=Array.isArray(t.groupBy)?t.groupBy:[t.groupBy];r.groupBy.apply(r,n)}return t.columns&&t.columns.forEach((function(t){return r.column(t)})),r.build(e)}function cm(t,e){var r={};return e.forEach((function(e){t.hasOwnProperty(e)&&(r[e]=t[e])})),r}function pm(t,e,r){return r.every((function(t){return!e(t)}))?null:cm(t,r)}var fm=["singleSelection","filterGlobally","columnTypes","taskExecutor","jumpToSearchResult"],hm=["animated","sidePanel","sidePanelCollapsed","hierarchyIndicator","defaultSlopeGraphMode","summaryHeader","expandLineOnHover","overviewMode","renderers","canRender","toolbarActions","toolbarDialogAddons","rowHeight","rowPadding","groupHeight","groupPadding","dynamicHeight","labelRotation","ignoreUnsupportedBrowser","livePreviews"],dm=function(){function t(t){var e=this;this.adapter=t,this.data=null,this.instance=null,this.prevRankings=null,this.prevColumns=null,this.prevHighlight=null,this.onSelectionChanged=function(t){e.props.onSelectionChanged&&!pi(e.props.selection,t)&&e.props.onSelectionChanged(t)},this.onHighlightChanged=function(t){(null!=e.prevHighlight?e.prevHighlight:-1)!==t&&(e.prevHighlight=t,e.props.onHighlightChanged&&e.props.onHighlightChanged(t))}}return Object.defineProperty(t.prototype,"props",{get:function(){return this.adapter.props()},enumerable:!0,configurable:!0}),t.prototype.componentDidMount=function(){this.data=this.buildProvider(),this.instance=this.adapter.createInstance(this.data,cm(this.props,hm)),this.instance.on(Og.EVENT_HIGHLIGHT_CHANGED,this.onHighlightChanged)},t.prototype.resolveColumnDescs=function(t){var e=this.adapter.columnDescs(t),r=0===e.length||Boolean(this.props.deriveColumns),n=Array.isArray(this.props.deriveColumns)?this.props.deriveColumns:[];return{columns:e,deriveColors:Boolean(this.props.deriveColors),deriveColumns:r,deriveColumnNames:n}},t.prototype.resolveRankings=function(){var t=this.adapter.rankingBuilders();return{builders:t,restore:this.props.restore,derive:0===t.length&&!this.props.restore||Boolean(this.props.defaultRanking),supportTypes:"noSupportTypes"!==this.props.defaultRanking}},t.prototype.buildColumns=function(t,e){this.prevColumns=e;var r=e.columns.map((function(t){return Object.assign({},t)}));if(e.deriveColumns)for(var n=new Set(r.map((function(t){return t.type+"@"+t.label}))),i=0,o=pl(t,{columns:e.deriveColumnNames});i<o.length;i++){var a=o[i];n.has(a.type+"@"+a.label)||r.push(a)}return e.deriveColors&&fl(r),r},t.prototype.buildRankings=function(t,e){t.clearRankings(),this.prevRankings=e,e.derive&&t.deriveDefault(e.supportTypes),e.restore&&t.restore(e.restore),e.builders.forEach((function(e){return lm(e,t)}))},t.prototype.buildProvider=function(){var t=this.buildColumns(this.props.data,this.resolveColumnDescs(this.props.data)),e=new tc(this.props.data,t,cm(this.props,fm));return this.buildRankings(e,this.resolveRankings()),e.setSelection(this.props.selection||[]),e.on(tc.EVENT_SELECTION_CHANGED,this.onSelectionChanged),e},t.prototype.updateLineUp=function(t,e){var r=pm(this.props,t,hm);return r?(this.instance&&this.instance.destroy(),this.instance=this.adapter.createInstance(this.data,r),this.prevHighlight=null==this.props.highlight?-1:this.props.highlight,this.instance.setHighlight(this.prevHighlight),this.instance.on(Og.EVENT_HIGHLIGHT_CHANGED,this.onHighlightChanged),!0):(e&&this.instance.setDataProvider(this.data),!!(e||null!=this.props.highlight&&this.prevHighlight!==this.props.highlight)&&(this.prevHighlight=null==this.props.highlight?-1:this.props.highlight,this.instance.on(Og.EVENT_HIGHLIGHT_CHANGED,null),this.instance.setHighlight(this.prevHighlight),this.instance.on(Og.EVENT_HIGHLIGHT_CHANGED,this.onHighlightChanged),!0))},t.prototype.updateProvider=function(t){var e=this;if(pm(this.props,t,fm)||!this.data||t("data"))return this.data=this.buildProvider(),!0;var r=this.resolveRankings(),n=this.resolveColumnDescs(this.props.data),i=!pi(this.prevColumns,n);if(i){var o=this.buildColumns(this.props.data,n);this.data.clearColumns(),o.forEach((function(t){return e.data.pushDesc(t)}))}return!i&&pi(r,this.prevRankings)||this.buildRankings(this.data,r),this.data.on(tc.EVENT_SELECTION_CHANGED,null),this.data.setSelection(this.props.selection||[]),this.data.on(tc.EVENT_SELECTION_CHANGED,this.onSelectionChanged),!1},t.prototype.componentDidUpdate=function(t){var e=this.updateProvider(t);this.updateLineUp(t,e)},t.prototype.componentWillUnmount=function(){this.instance&&(this.instance.destroy(),this.instance=null),this.data=null},t}(),gm={buildString:function(t){var e=um(o({},t,{type:"string"}));return["pattern","patternTemplate","alignment"].forEach((function(r){t.hasOwnProperty(r)&&(e[r]=t[r])})),t.editable&&(e.type="annotate"),t.pattern&&(e.type="link"),t.html&&(e.escape=!1),e},buildNumber:function(t,e){var r=um(o({},t,{type:"number"})),n=t.domain?t.domain:N(e,(function(t){return nl(t,r.column)}));return t.hasOwnProperty("color")&&(r.colorMapping=t.color),["sort","colorMapping"].forEach((function(e){t.hasOwnProperty(e)&&(r[e]=t[e])})),t.scripted?r.map={domain:n,code:t.scripted,type:"script"}:t.mapping&&"linear"!==t.mapping?r.map={type:t.mapping,domain:n,range:t.range||[0,1]}:(r.domain=n,t.range&&(r.range=t.range)),r},buildHierarchy:function(t){var e=um(o({},t,{type:"hierarchy"}));return["hierarchy","hierarchySeparator"].forEach((function(r){t.hasOwnProperty(r)&&(e[r]=t[r])})),e},buildDate:function(t){var e=um(o({},t,{type:"date"}));return["dateFormat","dateParse"].forEach((function(r){t.hasOwnProperty(r)&&(e[r]=t[r])})),e},buildCategorical:function(t,e){var r=um(o({},t,{type:"categorical"}));if(t.asOrdinal&&(r.type="ordinal"),t.missingCategory&&(r.missingCategory=t.missingCategory),t.asSet&&("string"==typeof t.asSet&&(r.separator=t.asSet),r.type="set"),t.categories)r.categories=t.categories;else{var n=new Set(e.map((function(t){return nl(t,r.column)})));r.categories=Array.from(n).sort()}return r},buildActions:function(t){var e=um(o({},t,{type:"actions"}));return["actions","groupActions"].forEach((function(r){t.hasOwnProperty(r)&&(e[r]=t[r])})),e},build:um,buildGeneric:function(t){return t.column},buildWeightedSumRanking:function(t,e){var r={type:"weightedSum",columns:e.map((function(t){return t.column})),weights:e.map((function(t){return t.weight}))};return t.label&&(r.label=t.label),r},buildSupportRanking:function(t){return"_"+t.type},buildScriptRanking:function(t,e){var r={type:"script",code:t.code,columns:e};return t.label&&(r.label=t.label),r},buildReduceRanking:function(t,e){var r={type:t.type,columns:e};return t.label&&(r.label=t.label),r},buildRanking:lm,buildNestedRanking:function(t,e){var r={type:"nested",columns:e};return t.label&&(r.label=t.label),r},buildImposeRanking:function(t){return Object.assign({type:"impose"},t)},buildAllColumnsRanking:function(){return"*"},equal:pi,isSame:pm,isTypeInstance:function(t,e){for(var r=t;r&&r!==e;)r=r.__proto__;return r===e},Adapter:dm};function mm(t,e){void 0===e&&(e={});var r=function(t){function e(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=t.call(this,e,r)||this;return"function"==typeof o.init&&o.init.apply(o,[e,r].concat(n)),o}return i(e,t),e.prototype.init=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e}(xt);return r.prototype.toString=function(){return t},r.prototype=Object.assign(r.prototype,e),r}function ym(t){for(var e=[],r=0;r<t.length;++r)e[t[r]]=r+1;return e}var vm=function(t){function e(e,r,n){void 0===r&&(r=[]),void 0===n&&(n={});var i=t.call(this,r,n)||this;return i.server=e,i.ooptions={maxCacheSize:1e3},i.cache=new Map,Object.assign(i.ooptions,n),i}return i(e,t),e.prototype.getTotalNumberOfRows=function(){return this.cache.size},e.prototype.getTaskExecutor=function(){return new Bl([])},e.prototype.sort=function(t){return this.server.sort(t).then((function(t){return{groups:[Object.assign({order:t},st)],index2pos:ym(t)}}))},e.prototype.loadFromServer=function(t){return this.server.view(t).then((function(e){return e.map((function(e,r){return{v:e,dataIndex:t[r]}}))}))},e.prototype.view=function(t){if(0===t.length)return Promise.resolve([]);var e=this.fetch([t])[0];return Promise.all(e).then((function(t){return t.map((function(t){return t.v}))}))},e.prototype.computeMissing=function(t){var e=new Set,r=e.add.bind(e);return t.forEach((function(t){return t.forEach(r)})),this.cache.forEach((function(t,r){return e.delete(r)})),this.cache.size,e.size,this.ooptions.maxCacheSize,Array.from(e)},e.prototype.loadInCache=function(t){var e=this;if(0!==t.length){var r=this.loadFromServer(t);t.forEach((function(n,i){var o=t[i];e.cache.set(o,r.then((function(t){return{v:t[i],i:o}})))}))}},e.prototype.fetch=function(t){var e=this,r=this.computeMissing(t);return this.loadInCache(r),t.map((function(t){return t.map((function(t){return e.cache.get(t)}))}))},e.prototype.getRow=function(t){return this.cache.has(t)||this.loadInCache([t]),this.cache.get(t)},e.prototype.mappingSample=function(t){return this.server.mappingSample(t.desc.column)},e.prototype.searchAndJump=function(t,e){var r=this;this.server.search(t,e.desc.column).then((function(t){r.jumpToNearest(t)}))},e}(Tl),bm={AAggregatedGroupRenderer:Df,ANumbersCellRenderer:tp,ActionRenderer:yc,AggregateGroupRenderer:Nc,AnnotationRenderer:Lc,BarCellRenderer:Oc,BooleanCellRenderer:Ic,BoxplotCellRenderer:Hc,BrightnessCellRenderer:Uc,CategoricalCellRenderer:Bc,CategoricalHeatmapCellRenderer:zc,CategoricalStackedDistributionlCellRenderer:qc,CircleCellRenderer:$c,DateCellRenderer:zf,DateHistogramCellRenderer:Kf,DefaultCellRenderer:Vc,DotCellRenderer:Jc,GroupCellRenderer:Zc,HeatmapCellRenderer:ep,HistogramCellRenderer:_f,ImageCellRenderer:Af,InterleavingCellRenderer:Lf,LinkCellRenderer:Of,LinkMapCellRenderer:kf,LoadingCellRenderer:Gf,MapBarCellRenderer:Hf,MultiLevelCellRenderer:Mf,RankCellRenderer:Pf,SelectionRenderer:Ff,SetCellRenderer:Uf,SparklineCellRenderer:jf,StringCellRenderer:Mc,TableCellRenderer:Vf,UpSetCellRenderer:Yf,VerticalBarCellRenderer:Wf},Em={toHeatMapColor:Fc,noRenderer:nc,wideEnough:uc,wideEnoughCat:lc,adaptTextColorToBgColor:pc,adaptDynamicColorToBgColor:fc};function Cm(t,e,r){return void 0===r&&(r={}),new tc(t,e,r)}function Nm(t,e,r){return void 0===r&&(r={}),new Og(t,e,r)}function _m(t,e,r){return void 0===r&&(r={}),new kg(t,e,r)}r(7);r.d(e,"version",(function(){return Tm})),r.d(e,"buildId",(function(){return wm})),r.d(e,"license",(function(){return Rm})),r.d(e,"createLocalDataProvider",(function(){return Cm})),r.d(e,"createLineUp",(function(){return Nm})),r.d(e,"createTaggle",(function(){return _m})),r.d(e,"defaultOptions",(function(){return gd})),r.d(e,"equal",(function(){return pi})),r.d(e,"isMissingValue",(function(){return vn})),r.d(e,"isUnknown",(function(){return bn})),r.d(e,"FIRST_IS_NAN",(function(){return-1})),r.d(e,"FIRST_IS_MISSING",(function(){return 1})),r.d(e,"missingGroup",(function(){return En})),r.d(e,"toCategories",(function(){return Rn})),r.d(e,"ScaleMappingFunction",(function(){return Ls})),r.d(e,"ScriptMappingFunction",(function(){return xs})),r.d(e,"mappingFunctions",(function(){return Vs})),r.d(e,"DEFAULT_CATEGORICAL_COLOR_FUNCTION",(function(){return gn})),r.d(e,"ReplacmentColorMappingFunction",(function(){return mn})),r.d(e,"CustomColorMappingFunction",(function(){return mu})),r.d(e,"DEFAULT_COLOR_FUNCTION",(function(){return yu})),r.d(e,"SequentialColorFunction",(function(){return pu})),r.d(e,"DivergentColorFunction",(function(){return fu})),r.d(e,"UnknownColorFunction",(function(){return hu})),r.d(e,"QuantizedColorFunction",(function(){return gu})),r.d(e,"SolidColorFunction",(function(){return du})),r.d(e,"ActionColumn",(function(){return li})),r.d(e,"AggregateGroupColumn",(function(){return Qn})),r.d(e,"AnnotateColumn",(function(){return hi})),r.d(e,"ArrayColumn",(function(){return gi})),r.d(e,"BooleanColumn",(function(){return di})),r.d(e,"BooleansColumn",(function(){return mi})),r.d(e,"BoxPlotColumn",(function(){return Ys})),r.d(e,"CategoricalColumn",(function(){return Mn})),r.d(e,"CategoricalMapColumn",(function(){return qs})),r.d(e,"CategoricalsColumn",(function(){return Ks})),r.d(e,"Column",(function(){return pt})),r.d(e,"CompositeColumn",(function(){return Ot})),r.d(e,"CompositeNumberColumn",(function(){return wu})),r.d(e,"DateColumn",(function(){return Zs})),r.d(e,"DatesColumn",(function(){return tu})),r.d(e,"DatesMapColumn",(function(){return nu})),r.d(e,"GroupColumn",(function(){return ou})),r.d(e,"HierarchyColumn",(function(){return au})),r.d(e,"ImpositionBoxPlotColumn",(function(){return Nu})),r.d(e,"ImpositionCompositeColumn",(function(){return bu})),r.d(e,"ImpositionCompositesColumn",(function(){return Tu})),r.d(e,"LinkColumn",(function(){return ju})),r.d(e,"LinkMapColumn",(function(){return Yu})),r.d(e,"LinksColumn",(function(){return Wu})),r.d(e,"MapColumn",(function(){return Ws})),r.d(e,"MultiLevelCompositeColumn",(function(){return Mu})),r.d(e,"NestedColumn",(function(){return xu})),r.d(e,"NumberColumn",(function(){return js})),r.d(e,"NumberMapColumn",(function(){return Ou})),r.d(e,"NumbersColumn",(function(){return Eu})),r.d(e,"OrdinalColumn",(function(){return Vu})),r.d(e,"RankColumn",(function(){return ni})),r.d(e,"Ranking",(function(){return Zn})),r.d(e,"EDirtyReason",(function(){return Jn})),r.d(e,"ReduceColumn",(function(){return Au})),r.d(e,"ScriptColumn",(function(){return Fu})),r.d(e,"SelectionColumn",(function(){return oi})),r.d(e,"SetColumn",(function(){return Ln})),r.d(e,"StackColumn",(function(){return Su})),r.d(e,"StringColumn",(function(){return fi})),r.d(e,"StringsColumn",(function(){return Bu})),r.d(e,"StringMapColumn",(function(){return Uu})),r.d(e,"ValueColumn",(function(){return xt})),r.d(e,"defineColumn",(function(){return mm})),r.d(e,"DataProvider",(function(){return Nl})),r.d(e,"LocalDataProvider",(function(){return tc})),r.d(e,"RemoteDataProvider",(function(){return vm})),r.d(e,"deriveColors",(function(){return fl})),r.d(e,"deriveColumnDescriptions",(function(){return pl})),r.d(e,"exportRanking",(function(){return hl})),r.d(e,"tasksAll",(function(){return Hl})),r.d(e,"colorOf",(function(){return xc})),r.d(e,"renderMissingCanvas",(function(){return Sc})),r.d(e,"renderMissingDOM",(function(){return Dc})),r.d(e,"rendererClasses",(function(){return bm})),r.d(e,"rendererUtils",(function(){return Em})),r.d(e,"EngineRanking",(function(){return vg})),r.d(e,"EngineRenderer",(function(){return Ng})),r.d(e,"LineUp",(function(){return Og})),r.d(e,"SlopeGraph",(function(){return Cg})),r.d(e,"DataBuilder",(function(){return im})),r.d(e,"builder",(function(){return om})),r.d(e,"asTaggle",(function(){return am})),r.d(e,"asLineUp",(function(){return sm})),r.d(e,"SupportType",(function(){return dt})),r.d(e,"SortByDefault",(function(){return gt})),r.d(e,"isSortingAscByDefault",(function(){return mt})),r.d(e,"Categories",(function(){return bt})),r.d(e,"categories",(function(){return Et})),r.d(e,"Category",(function(){return Ct})),r.d(e,"getSortType",(function(){return Nt})),r.d(e,"toolbar",(function(){return _t})),r.d(e,"dialogAddons",(function(){return Tt})),r.d(e,"isSupportType",(function(){return wt})),r.d(e,"categoryOf",(function(){return Rt})),r.d(e,"categoryOfDesc",(function(){return At})),r.d(e,"DEFAULT_COLOR",(function(){return"#C1C1C1"})),r.d(e,"defaultGroup",(function(){return st})),r.d(e,"othersGroup",(function(){return ut})),r.d(e,"isGroup",(function(){return lt})),r.d(e,"ECompareValueType",(function(){return ot})),r.d(e,"isMultiLevelColumn",(function(){return ct})),r.d(e,"isCategoricalLikeColumn",(function(){return Wl})),r.d(e,"isSetColumn",(function(){return zl})),r.d(e,"isCategoricalColumn",(function(){return ql})),r.d(e,"isCategoricalsColumn",(function(){return Kl})),r.d(e,"isCategory",(function(){return Xl})),r.d(e,"isMapAbleColumn",(function(){return Dt})),r.d(e,"isNumberColumn",(function(){return St})),r.d(e,"ESortMethod",(function(){return yt})),r.d(e,"isBoxPlotColumn",(function(){return Mt})),r.d(e,"EAdvancedSortMethod",(function(){return vt})),r.d(e,"isNumbersColumn",(function(){return Lt})),r.d(e,"isDateColumn",(function(){return $l})),r.d(e,"isDatesColumn",(function(){return Jl})),r.d(e,"isMapColumn",(function(){return jl})),r.d(e,"isArrayColumn",(function(){return Yl})),r.d(e,"createActionDesc",(function(){return ai})),r.d(e,"EAggregationState",(function(){return Vn})),r.d(e,"createAggregateDesc",(function(){return $n})),r.d(e,"EDateSort",(function(){return Qs})),r.d(e,"createGroupDesc",(function(){return iu})),r.d(e,"EGroupSortMethod",(function(){return ru})),r.d(e,"resolveInnerNodes",(function(){return uu})),r.d(e,"isHierarchical",(function(){return lu})),r.d(e,"deriveHierarchy",(function(){return cu})),r.d(e,"createImpositionBoxPlotDesc",(function(){return Cu})),r.d(e,"createImpositionDesc",(function(){return vu})),r.d(e,"createImpositionsDesc",(function(){return _u})),r.d(e,"createNestedDesc",(function(){return Lu})),r.d(e,"createRankDesc",(function(){return ri})),r.d(e,"createReduceDesc",(function(){return Ru})),r.d(e,"createScriptDesc",(function(){return ku})),r.d(e,"createSelectionDesc",(function(){return ii})),r.d(e,"createStackDesc",(function(){return Du})),r.d(e,"EAlignment",(function(){return si})),r.d(e,"EStringGroupCriteriaType",(function(){return ui})),r.d(e,"ABORTED",(function(){return qu})),r.d(e,"SCHEMA_REF",(function(){return Zu})),r.d(e,"ERenderMode",(function(){return Ql})),r.d(e,"ADialog",(function(){return ff})),r.d(e,"EMode",(function(){return hg})),r.d(e,"SearchBox",(function(){return Tg})),r.d(e,"SidePanel",(function(){return xg})),r.d(e,"Taggle",(function(){return kg})),r.d(e,"TaggleRenderer",(function(){return Ig})),r.d(e,"ColumnBuilder",(function(){return Pg})),r.d(e,"RankingBuilder",(function(){return Bg})),r.d(e,"buildRanking",(function(){return jg})),r.d(e,"builderAdapter",(function(){return gm})),r.d(e,"dialogContext",(function(){return pf})),r.d(e,"spaceFillingRule",(function(){return Vg})),r.d(e,"updateLodRules",(function(){return Gg})),r.d(e,"buildCategoricalColumn",(function(){return Wg})),r.d(e,"buildColumn",(function(){return Fg})),r.d(e,"buildNumberColumn",(function(){return qg})),r.d(e,"buildStringColumn",(function(){return Xg})),r.d(e,"buildDateColumn",(function(){return Jg})),r.d(e,"buildHierarchicalColumn",(function(){return Zg})),r.d(e,"buildActionsColumn",(function(){return em})),r.d(e,"buildBooleanColumn",(function(){return nm})),r.d(e,"default",(function(){return Og}));var Tm="4.1.2",wm="20210218-194157",Rm="BSD-3-Clause"}])}));
//# sourceMappingURL=LineUpJS.js.map