!function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){for(var r=0;r=0||(i[r]=t[r]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function l(t,e,r){var n=String(t);return-1!==n.indexOf(r)?r+n.replace(new RegExp(r,"g"),r+r)+r:new RegExp("[\n\r".concat(e,"]")).test(n)?r+n+r:n}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.delimiter,n=void 0===r?",":r,i=e.quoteChar,o=void 0===i?'"':i,a=e.lineTerminator,u=void 0===a?"\n":a;return t.map((function(t){return t.map((function(t){return l(t,n,o)})).join(n)})).join(u)}var h={formatDelimited:p},d="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},v=Array.prototype,m=Object.prototype,g="undefined"!=typeof Symbol?Symbol.prototype:null,y=v.push,M=v.slice,w=m.toString,Y=m.hasOwnProperty,b="undefined"!=typeof ArrayBuffer,E="undefined"!=typeof DataView,A=Array.isArray,x=Object.keys,O=Object.create,N=b&&ArrayBuffer.isView,S=isNaN,D=isFinite,T=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C=Math.pow(2,53)-1;function R(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;i=0&&r<=C}}function st(t){return function(e){return null==e?void 0:e[t]}}var ct=st("byteLength"),ft=ut(ct),lt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var pt=b?function(t){return N?N(t)&&!Z(t):ft(t)&<.test(w.call(t))}:at(!1),ht=st("length");function dt(t,e){e=function(t){for(var e={},r=t.length,n=0;n":">",'"':""","'":"'","`":"`"},ie=re(ne),oe=re(It(ne)),ae=gt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},ue=/(.)^/,se={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ce=/\\|'|\r|\n|\u2028|\u2029/g;function fe(t){return"\\"+se[t]}var le=/^\s*(\w|\$)+\s*$/;var pe=0;function he(t,e,r,n,i){if(!(n instanceof e))return t.apply(r,i);var o=Ht(t.prototype),a=t.apply(o,i);return I(a)?a:o}var de=R((function(t,e){var r=de.placeholder,n=function(){for(var i=0,o=e.length,a=Array(o),u=0;u1)ge(u,e-1,r,n),i=n.length;else for(var s=0,c=u.length;s0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}}var Ee=de(be,2);function Ae(t,e,r){e=Qt(e,r);for(var n,i=vt(t),o=0,a=i.length;o0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+u,a):u=o>=0?Math.min(o+1,u):o+u+1;else if(r&&o&&u)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(M.call(n,a,u),ot))>=0?o+a:-1;for(o=t>0?a:u-1;o>=0&&o0?0:a-1;for(i||(n=e[o?o[u]:u],u+=t);u>=0&&u=3;return e(t,Gt(r,i,4),n,o)}}var Le=ke(1),je=ke(-1);function Pe(t,e,r){var n=[];return e=Qt(e,r),Re(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Fe(t,e,r){e=Qt(e,r);for(var n=!me(t)&&vt(t),i=(n||t).length,o=0;o=0}var Be=R((function(t,e,r){var n,i;return K(e)?i=e:(e=Vt(e),n=e.slice(0,-1),e=e[e.length-1]),Ie(t,(function(t){var o=i;if(!o){if(n&&n.length&&(t=Wt(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))}));function Ve(t,e){return Ie(t,Kt(e))}function We(t,e,r){var n,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var u=0,s=(t=me(t)?t:Rt(t)).length;uo&&(o=n);else e=Qt(e,r),Re(t,(function(t,r,n){((i=e(t,r,n))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function ze(t,e,r){if(null==e||r)return me(t)||(t=Rt(t)),t[te(t.length-1)];var n=me(t)?Ut(t):Rt(t),i=ht(n);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a1&&(n=Gt(n,e[1])),e=Yt(t)):(n=Ze,e=ge(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(r=e[1])):(e=Ie(ge(e,!1,!1),String),n=function(t,r){return!Ue(e,r)}),tr(t,n,r)}));function rr(t,e,r){return M.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))}function nr(t,e,r){return null==t||t.length<1?null==e||r?void 0:[]:null==e||r?t[0]:rr(t,t.length-e)}function ir(t,e,r){return M.call(t,null==e||r?1:e)}function or(t,e){return ge(t,e,!1)}var ar=R((function(t,e){return e=ge(e,!0,!0),Pe(t,(function(t){return!Ue(e,t)}))})),ur=R((function(t,e){return ar(t,e)}));function sr(t,e,r,n){j(e)||(n=r,r=e,e=!1),null!=r&&(r=Qt(r,n));for(var i=[],o=[],a=0,u=ht(t);ae?(n&&(clearTimeout(n),n=null),u=c,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(s,f)),a};return c.cancel=function(){clearTimeout(n),u=0,n=i=o=null},c},debounce:function(t,e,r){var n,i,o,a,u,s=function(){var c=ee()-i;e>c?n=setTimeout(s,e-c):(n=null,r||(a=t.apply(u,o)),n||(o=u=null))},c=R((function(c){return u=this,o=c,i=ee(),n||(n=setTimeout(s,e),r&&(a=t.apply(u,o))),a}));return c.cancel=function(){clearTimeout(n),n=o=u=null},c},wrap:function(t,e){return de(e,t)},negate:Ye,compose:function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},after:function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},before:be,once:Ee,findKey:Ae,findIndex:Oe,findLastIndex:Ne,sortedIndex:Se,indexOf:Te,lastIndexOf:_e,find:Ce,detect:Ce,findWhere:function(t,e){return Ce(t,qt(e))},each:Re,forEach:Re,map:Ie,collect:Ie,reduce:Le,foldl:Le,inject:Le,reduceRight:je,foldr:je,filter:Pe,select:Pe,reject:function(t,e,r){return Pe(t,Ye(Qt(e)),r)},every:Fe,all:Fe,some:He,any:He,contains:Ue,includes:Ue,include:Ue,invoke:Be,pluck:Ve,where:function(t,e){return Pe(t,qt(e))},max:We,min:function(t,e,r){var n,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var u=0,s=(t=me(t)?t:Rt(t)).length;un||void 0===r)return 1;if(r0&&void 0!==arguments[0]?arguments[0]:{},r=e.includeComputedColumns,n=void 0===r||r,a=e.includeHeader,u=void 0===a||a,s=o(e,["includeComputedColumns","includeHeader"]),c=i.numRows(),f=[],l=n?t:t.filter((function(t){return!t.isComputed}));u&&f.push(l.map((function(t){return t.title()})));for(var h=0;he&&(t.length=e,r.length=e),i},columnOrder:function(e){return arguments.length?(t.length=0,e.forEach((function(e){t.push(r[e])})),i):t.map((function(t){return r.indexOf(t)}))},align:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=Math.max.apply(Math,u(t.map((function(t){return t.length})))),i=f(t);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=Array(n-o.length).fill(r);o.add.apply(o,u(a))}}catch(t){i.e(t)}finally{i.f()}},clone:function(){return mr(t.map((function(t){return t.clone()})))},clear:function(){var e,r=f(t);try{for(r.s();!(e=r.n()).done;){e.value.clear()}}catch(t){r.e(t)}finally{r.f()}},deleteRow:function(){for(var e=arguments.length,r=new Array(e),n=0;nu[1]&&(u[0]=r,u[1]=a[r]))}))})),e=u[0];var s={parse:function(t){if(H(t)||L(t)||k(t))return t;var n=t.replace("%","").replace("−","-").replace(/[  ]/g,"").replace("–","-").replace("—","-");return"-"!==e[0]&&(n=n.replace(new RegExp("."===e[0]?"\\.":e[0],"g"),"")),"."!==e[1]&&(n=n.replace(e[1],".")),isNaN(n)||""===n?(o[n.toLowerCase()]||""===n||r++,t):Number(n)},toNum:function(t){return t},fromNum:function(t){return t},errors:function(){return r},name:function(){return"number"},isValid:function(t){return""===t||o[String(t).toLowerCase()]||H(s.parse(t))},ambiguousFormats:function(){var t=[];return Re(a,(function(e,r){e===u[1]&&t.push([r,i[r]])})),t},format:function(t){return arguments.length?(e=t,s):e}};return s},date:function(t){var e,r=0,n={},i=["",0];t=t||[],Re(Nr,(function(e,r){Re(t,(function(t){void 0===n[r]&&(n[r]=0),Dr(t,r)&&(n[r]+=1,n[r]>i[1]&&(i[0]=r,i[1]=n[r]))}))})),e=i[0];var o={parse:function(t){if(U(t)||L(t))return t;if(!e||!F(t))return r++,t;var n,i,o,a=(n=t.toLowerCase(),B((o=Nr[i=e]).parse)?n.match(o.parse):o.parse(n,i));if(!a)return r++,t;function u(t){return(t=+t)<30?2e3+t:1900+t}Dr(t,e)||r++;var s=(new Date).getFullYear();switch(e){case"YYYY":return new Date(a[1],0,1);case"YYYY-H":return new Date(a[1],6*(a[2]-1),1);case"H-YYYY":return new Date(a[2],6*(a[1]-1),1);case"YYYY-Q":return new Date(a[1],3*(a[2]-1),1);case"Q-YYYY":return new Date(a[2],3*(a[1]-1),1);case"YYYY-M":return new Date(a[1],a[2]-1,1);case"M-YYYY":return new Date(a[2],a[1]-1,1);case"YYYY-MMM":return new Date(+a[1],Or[a[2]],1);case"MMM-YYYY":return new Date(+a[2],Or[a[1]],1);case"MMM-YY":return new Date(u(+a[2]),Or[a[1]],1);case"MMM":return new Date(s,Or[a[1]],1);case"YYYY-WW":return Tr(a[1],a[2],1);case"WW-YYYY":return Tr(a[2],a[1],1);case"YYYY-WW-d":return Tr(a[1],a[2],a[3]);case"YYYY-MM-DD":return new Date(a[1],a[3]-1,a[4]);case"DD/MM/YYYY":return new Date(a[4],a[3]-1,a[1]);case"DD/MMM/YYYY":return new Date(a[4],Or[a[3]],a[1]);case"DD/MMM/YY":return new Date(u(a[4]),Or[a[3]],a[1]);case"MM/DD/YYYY":return new Date(a[4],a[1]-1,a[3]);case"MM/DD/YY":return new Date(u(a[4]),a[1]-1,a[3]);case"DD/MM/YY":return new Date(u(a[4]),a[3]-1,a[1]);case"MMM-DD-YYYY":return new Date(a[3],Or[a[1]],a[2]);case"YYYY-MM-DD HH:MM":return new Date(+a[1],a[3]-1,+a[4],_r(+a[5],a[8]),+a[6]||0,+a[7]||0);case"DD.MM.YYYY HH:MM":return new Date(+a[4],a[3]-1,+a[1],_r(+a[5],a[8]),+a[6]||0,+a[7]||0);case"MM/DD/YYYY HH:MM":return new Date(+a[4],a[1]-1,+a[3],_r(+a[5],a[8]),+a[6]||0,+a[7]||0);case"ISO8601":return new Date(a.toUpperCase());default:console.warn("unknown format",e)}return r++,t},toNum:function(t){return U(t)?t.getTime():Number.NaN},fromNum:function(t){return new Date(t)},errors:function(){return r},name:function(){return"date"},format:function(t){return arguments.length?(e=t,o):e},precision:function(){return Nr[e].precision},isValid:function(t){return U(o.parse(t))},ambiguousFormats:function(){var t=[];return Re(n,(function(e,r){e===i[1]&&t.push([r,r])})),t}};return o}},Rr=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,Ir=/|<\?(?:php)?[\s\S]*?\?>/gi,kr="

";function Lr(t,e){if(null===t)return null;if(void 0!==t){if((t=String(t)).indexOf("<")<0&&t.indexOf(">")<0)return t;if(t=function(t,e){e=(((void 0!==e?e||"":kr)+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var r=t,n=t;for(;;)if(n=(r=n).replace(Ir,"").replace(Rr,(function(t,r){return e.indexOf("<"+r.toLowerCase()+">")>-1?t:""})),r===n)return n}(t,e),"undefined"==typeof document)return t;var r=document.createElement("div");r.innerHTML="".concat(t,"");for(var n=r.childNodes[0].querySelectorAll("*"),i=0;i=1?(t=arguments[0],f=2===arguments.length?arguments[1]:t,p):Lr(t)},origName:function(){return Lr(f)},title:function(){return arguments.length?(c=arguments[0],p):Lr(c||t)},length:e.length,val:function(t,n){if(arguments.length){var i=n?l:e;return t<0&&(t+=i.length),r.parse(U(i[t])||H(i[t])?i[t]:Lr(i[t]))}},values:function(t){var n=t?l:e;return n=Ie(n,(function(t){return U(t)||H(t)?t:Lr(t)})),Ie(n,r.parse)},each:function(t){for(var r=0;ro[1]&&(o[1]=t))})),o[0]=r.fromNum(o[0]),o[1]=r.fromNum(o[1])),o)},sum:function(){return!!r.toNum&&(void 0===a&&(a=0,p.each((function(t){var e=r.toNum(t);Number.isFinite(e)&&(a+=e)})),a=r.fromNum(a)),a)},mean:function(){if(!r.toNum)return!1;if(void 0===u){u=0;var t=0;p.each((function(e){var n=r.toNum(e);Number.isFinite(n)&&(u+=n,t++)})),u=r.fromNum(u/t)}return u},median:function(){if(!r.toNum)return!1;if(void 0===s){var t=p.values().map(r.toNum);s=r.fromNum(function(t){var e,r=[],n=t.length,i=-1;if(1===arguments.length)for(;++it&&(l.length=t,e.length=t,p.length=t)},add:function(){var t;l.push.apply(l,arguments),(t=e).push.apply(t,arguments),p.length=e.length},clone:function(){return jr(t,e.slice(),r.name())},clear:function(){e.splice(0),p.length=e.length}};return p.total=p.sum,p}function Pr(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],o=r-n;return o?i+o*(t[n]-i):i}function Fr(t){return null===t?NaN:+t}function Hr(t){return!ot(t)}function Ur(t,e){return te?1:t>=e?0:NaN}function Br(t){return{dataset:function(){if(t.url){var e=(new Date).getTime(),r="".concat(t.url).concat(t.url.indexOf("?")>-1?"&":"?","v=").concat(t.url.indexOf("//static.dwcdn.net")>-1?e-e%6e4:e);return window.fetch(r).then((function(t){return t.text()})).then((function(e){return new Vr(t).parse(e)}))}if(t.csv||""===t.csv)return new Promise((function(e){e(t.csv)})).then((function(e){return new Vr(t).parse(e)}));throw new Error("you need to provide either an URL or CSV data.")},parse:function(){return new Vr(t).parse(t.csv)}}}mr.delimited=Br;var Vr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=Object.assign({delimiter:"auto",quoteChar:'"',skipRows:0,emptyValue:null,transpose:!1,firstRowIsHeader:!0},e),this.__delimiterPatterns=Wr(e.delimiter,e.quoteChar),this.opts=e}var r,n,i;return r=t,(n=[{key:"parse",value:function(t){this.__rawData=t;var e=this.opts;"auto"===e.delimiter&&(e.delimiter=this.guessDelimiter(t,e.skipRows),this.__delimiterPatterns=Wr(e.delimiter,e.quoteChar));var r,n="|"!==e.delimiter?"|":"#";return t=n+"\n"+t.replace(/[ \r\n\f]+$/g,"").replace(/^\uFEFF/,"")+n,r=function(t,e,r){r=r||",";for(var i,o=[[]],a=null;a=t.exec(e);){var u=a[1];u.length&&u!==r&&o.push([]),i=a[2]?a[2].replace(new RegExp('""',"g"),'"'):a[3],o[o.length-1].push(void 0===i?"":i)}o[0][0].substr(0,1)===n&&(o[0][0]=o[0][0].substr(1));var s=o.length-1,c=o[s].length-1,f=o[s][c].length-1;return o[s][c].substr(f)===n&&(o[s][c]=o[s][c].substr(0,f)),o.slice(1)}(this.__delimiterPatterns,t,e.delimiter),e.transpose&&(r=function(t){var e,r,n=t,i=n.length?n.length:0,o=n[0]instanceof Array?n[0].length:0;if(0===o||0===i)return[];var a=[];for(e=0;ee&&(e=u,r=o)})),i[r]}}])&&e(r.prototype,n),i&&e(r,i),t}();function Wr(t,e){return new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:"+e+"([^"+e+"]*(?:"+e+'"[^'+e+"]*)*)"+e+"|([^"+e+"\\"+t+"\\r\\n]*))","gi")}function zr(t){return{dataset:function(){if(t.url)return fetch(t.url).then((function(t){return t.text()})).then((function(t){return JSON.parse(t)}));if(t.csv)return new Promise((function(e){e(t.csv)})).then((function(t){return JSON.parse(t)}));throw new Error("you need to provide either an URL or CSV data.")},parse:function(){return JSON.parse(t.csv)}}}function $r(t){return Math.max(0,String(t-Math.floor(t)).replace(/00000*[0-9]+$/,"").replace(/33333*[0-9]+$/,"").replace(/99999*[0-9]+$/,"").length-2)}function qr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Math.pow(10,e);return Math.round(t*r)/r}function Kr(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1,i=[],o=0,a=sr(t.filter(it)),u=a.length,s=Math.floor(u*(1-n));if(a.length<3)return Math.round(a.reduce((function(t,e){if(!e)return t;var r=Math.log(Math.abs(e))/Math.LN10;return r<8&&r>-3?t+Math.min(3,$r(a[0])):t+(r>0?-1*(r-1):-1*r)}),0)/a.length);sr(a.map(f)).length>s?(e=function(){return sr(i).length===u},r=-1):(e=function(){return sr(i).length<=s},r=1);var c=100;do{i=a.map(f),o+=r}while(e()&&c-- >0);function f(t){return qr(t,o)}return c<10&&console.warn("maximum iteration reached",t,i,o),r<0?o+=2:o--,o}function Gr(e){if(!e||"object"!==t(e))return e;try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}function Xr(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return null;var r=t.offsetHeight;if(!e)return r;var n=getComputedStyle(t);return r+=parseInt(n.marginTop)+parseInt(n.marginBottom)}function Jr(){for(var t=0,e=document.querySelector(".dw-chart"),r=0;r=this.expression.length?this.newToken("TEOF","EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},en.prototype.isString=function(){var t=!1,e=this.pos,r=this.expression.charAt(e);if("'"===r||'"'===r)for(var n=this.expression.indexOf(r,e+1);n>=0&&this.pos"9")))break}if(e>t){var n=this.expression.substring(t,e);if(n in this.consts)return this.current=this.newToken("TNUMBER",this.consts[n]),this.pos+=n.length,!0}return!1},en.prototype.isNamedOp=function(){for(var t=this.pos,e=t;e"9")))break}if(e>t){var n=this.expression.substring(t,e);if(this.isOperatorEnabled(n)&&(n in this.binaryOps||n in this.unaryOps||n in this.ternaryOps))return this.current=this.newToken(Qr,n),this.pos+=n.length,!0}return!1},en.prototype.isName=function(){for(var t=this.pos,e=t,r=!1;e"9"))break}else r=!0}if(r){var i=this.expression.substring(t,e);return this.current=this.newToken("TNAME",i),this.pos+=i.length,!0}return!1},en.prototype.isWhitespace=function(){for(var t=!1,e=this.expression.charAt(this.pos);!(" "!==e&&"\t"!==e&&"\n"!==e&&"\r"!==e||(t=!0,this.pos++,this.pos>=this.expression.length));)e=this.expression.charAt(this.pos);return t};var rn=/^[0-9a-f]{4}$/i;en.prototype.unescape=function(t){var e=t.indexOf("\\");if(e<0)return t;for(var r=t.substring(0,e);e>=0;){var n=t.charAt(++e);switch(n){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var i=t.substring(e+1,e+5);rn.test(i)||this.parseError("Illegal escape sequence: \\u"+i),r+=String.fromCharCode(parseInt(i,16)),e+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+n+'"')}++e;var o=t.indexOf("\\",e);r+=t.substring(e,o<0?t.length:o),e=o}return r},en.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},en.prototype.isRadixInteger=function(){var t,e,r=this.pos;if(r>=this.expression.length-2||"0"!==this.expression.charAt(r))return!1;if(++r,"x"===this.expression.charAt(r))t=16,e=/^[0-9a-f]$/i,++r;else{if("b"!==this.expression.charAt(r))return!1;t=2,e=/^[01]$/i,++r}for(var n=!1,i=r;r="0"&&t<="9"||!o&&"."===t);)"."===t?o=!0:a=!0,r++,e=a;if(e&&(i=r),"e"===t||"E"===t){r++;for(var u=!0,s=!1;r="0"&&t<="9"))break;s=!0,u=!1}else u=!1;r++}s||(r=i)}return e?(this.current=this.newToken("TNUMBER",parseFloat(this.expression.substring(n,r))),this.pos=r):this.pos=i,e},en.prototype.isOperator=function(){var t=this.pos,e=this.expression.charAt(this.pos);if("+"===e||"-"===e||"*"===e||"/"===e||"%"===e||"^"===e||"?"===e||":"===e||"."===e)this.current=this.newToken(Qr,e);else if("∙"===e||"•"===e)this.current=this.newToken(Qr,"*");else if(">"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Qr,">="),this.pos++):this.current=this.newToken(Qr,">");else if("<"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Qr,"<="),this.pos++):this.current=this.newToken(Qr,"<");else if("|"===e){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(Qr,"||"),this.pos++}else if("="===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Qr,"=="),this.pos++):this.current=this.newToken(Qr,e);else{if("!"!==e)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Qr,"!="),this.pos++):this.current=this.newToken(Qr,e)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=t,!1)},en.prototype.isOperatorEnabled=function(t){return this.parser.isOperatorEnabled(t)},en.prototype.getCoordinates=function(){var t,e=0,r=-1;do{e++,t=this.pos-r,r=this.expression.indexOf("\n",r+1)}while(r>=0&&r=",">","in"];sn.prototype.parseComparison=function(t){for(this.parseAddSub(t);this.accept(Qr,cn);){var e=this.current;this.parseAddSub(t),t.push(un(e.value))}};var fn=["+","-","||"];sn.prototype.parseAddSub=function(t){for(this.parseTerm(t);this.accept(Qr,fn);){var e=this.current;this.parseTerm(t),t.push(un(e.value))}};var ln=["*","/","%"];function pn(t,e){return Number(t)+Number(e)}function hn(t,e){return t-e}function dn(t,e){return t*e}function vn(t,e){return t/e}function mn(t,e){return t%e}function gn(t,e){return t===e}function yn(t,e){return t!==e}function Mn(t,e){return t>e}function wn(t,e){return t=e}function bn(t,e){return t<=e}function En(t,e){return Boolean(t&&e)}function An(t,e){return Boolean(t||e)}function xn(t){return Math.log(t)*Math.LOG10E}function On(t){return-t}function Nn(t){return!t}function Sn(t){return t<0?Math.ceil(t):Math.floor(t)}function Dn(t){return Math.random()*(t||1)}function Tn(t){return Array.isArray(t)?t.length:String(t).length}function _n(t,e,r){return t?e:r}function Cn(t,e){return void 0===e||0==+e?Math.round(t):(t=+t,e=-+e,isNaN(t)||"number"!=typeof e||e%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]-e:-e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+e:e))))}function Rn(t,e){return t[0|e]}function In(t){return 1===arguments.length&&Array.isArray(t)?Math.max.apply(Math,t):Math.max.apply(Math,arguments)}function kn(t){return 1===arguments.length&&Array.isArray(t)?Math.min.apply(Math,t):Math.min.apply(Math,arguments)}function Ln(t,e){if("function"!=typeof t)throw new Error("First argument to map is not a function");if(!Array.isArray(e))throw new Error("Second argument to map is not an array");return e.map((function(e,r){return t(e,r)}))}function jn(t,e,r){if("function"!=typeof t)throw new Error("First argument to fold is not a function");if(!Array.isArray(r))throw new Error("Second argument to fold is not an array");return r.reduce((function(e,r,n){return t(e,r,n)}),e)}function Pn(t,e){if("function"!=typeof t)throw new Error("First argument to filter is not a function");if(!Array.isArray(e))throw new Error("Second argument to filter is not an array");return e.filter((function(e,r){return t(e,r)}))}function Fn(t){return(t>0)-(t<0)||+t}function Hn(t){return Math.log(1+t)}function Un(t){return Math.log(t)/Math.LN2}function Bn(t){if(!Array.isArray(t))throw new Error("Sum argument is not an array");return t.reduce((function(t,e){return t+Number(e)}),0)}function Vn(t,e,r){var n,i,o,a,u,s,c=[];if(zn(t))return $n(t,r);for(var f=t.length,l=0;l0;)u.unshift($n(c.pop(),r));if(!(a=c.pop()).apply||!a.call)throw new Error(a+" is not a function");c.push(a.apply(void 0,u))}else if("IFUNDEF"===h)c.push(function(){for(var t=c.pop(),n=[],i=p.value;i-- >0;)n.unshift(c.pop());var o=c.pop(),a=function(){for(var i=Object.assign({},r),o=0,a=n.length;o0;)u.unshift(c.pop());c.push(u)}}if(c.length>1)throw new Error("invalid Expression (parity)");return 0===c[0]?0:$n(c[0],r)}function Wn(t,e,r){return zn(t)?t:{type:"IEXPREVAL",value:function(r){return Vn(t.value,e,r)}}}function zn(t){return t&&"IEXPREVAL"===t.type}function $n(t,e){return zn(t)?t.value(e):t}function qn(t,e){this.tokens=t,this.parser=e,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.functions=e.functions}function Kn(t){return t.trim()}function Gn(t){this.options=t||{},this.unaryOps={SIN:Math.sin,COS:Math.cos,TAN:Math.tan,ASIN:Math.asin,ACOS:Math.acos,ATAN:Math.atan,SQRT:Math.sqrt,LOG:Math.log,LOG2:Math.log2||Un,LN:Math.log,LOG10:Math.log10||xn,LG:Math.log10||xn,LOG1P:Math.log1p||Hn,ABS:Math.abs,CEIL:Math.ceil,FLOOR:Math.floor,ISNULL:function(t){return null===t},TRUNC:Math.trunc||Sn,"-":On,"+":Number,EXP:Math.exp,NOT:Nn,LENGTH:Tn,"!":Nn,SIGN:Math.sign||Fn,TEXT:function(t){return e(t)?t.toISOString():String(t)},NUMBER:Number},this.binaryOps={"+":pn,"-":hn,"*":dn,"/":vn,"%":mn,"^":Math.pow,"==":gn,"!=":yn,">":Mn,"<":wn,">=":Yn,"<=":bn,and:En,or:An,in:function(t,e){return Array.isArray(e)?e.includes(t):String(e).includes(t)},"[":Rn},this.ternaryOps={"?":_n};var e=function(t){return t instanceof Date&&!isNaN(t)},r=function(t){if(e(t))return t;try{var r=new Date(t);return e(r)?r:null}catch(t){return null}};function n(t){return(1===arguments.length&&Array.isArray(t)?t:Array.from(arguments)).slice(0).filter((function(t){return!isNaN(t)&&Number.isFinite(t)}))}var o=/\w*/g,a=/\w\S*/g,u=/[\\^$*+?.()|[\]{}]/g;try{o=new RegExp("\\p{L}*","ug"),a=new RegExp("[\\p{L}\\p{N}]\\S*","ug")}catch(t){}this.functions={IF:_n,RANDOM:Dn,MIN:function(){var t=n.apply(this,arguments);return kn(t)},MAX:function(){return In(n.apply(this,arguments))},SUM:function(){return Bn(n.apply(this,arguments))},MEAN:function(){var t=n.apply(this,arguments);return Bn(t)/t.length},MEDIAN:function(){var t=n.apply(this,arguments).sort((function(t,e){return t-e})),e=Math.floor(t.length/2);return t.length%2==1?t[e]:.5*(t[e-1]+t[e])},POW:Math.pow,ATAN2:Math.atan2,ROUND:Cn,CONCAT:function(){return Array.from(arguments).join("")},TRIM:Kn,SUBSTR:function(t,e,r){return t.substr(e,r)},REPLACE:function(t,e,r){return t.replace(new RegExp(String(e).replace(u,"\\$&"),"g"),r)},REPLACE_REGEX:function(t,e,r){return t.replace(new RegExp(e,"g"),r)},SPLIT:function(t,e){return String(t).split(e)},LOWER:function(t){return String(t).toLowerCase()},UPPER:function(t){return String(t).toUpperCase()},PROPER:function(t){return String(t).replace(o,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},TITLE:function(t){return String(t).replace(a,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},SORT:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!Array.isArray(t))throw new Error("First argument to SORT is not an array");return t.slice(0).sort((function(t,n){return((t="string"==typeof r?t[r]:"function"==typeof r?r(t):t)>(n="string"==typeof r?n[r]:"function"==typeof r?r(n):n)?1:t2&&void 0!==arguments[2]?arguments[2]:null;if(!Array.isArray(t))throw new Error("First argument to JOIN is not an array");return r?[t.slice(0,t.length-1).join(e),t[t.length-1]].join(r):t.join(e)},MAP:Ln,FOLD:jn,FILTER:Pn,PLUCK:function(t,e){if(!Array.isArray(t))throw new Error("First argument to PLUCK is not an array");return t.map((function(t){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:null}))},INDEXOF:function(t,e){return Array.isArray(t)||(t=String(t)),t.indexOf(e)},FIND:function(t,e){if(!Array.isArray(t))throw new Error("First argument to FIND is not an array");if("function"!=typeof e)throw new Error("Second argument to FIND is not a function");for(var r=t.length,n=0;n1&&(arguments[1]=arguments[1]-1),i(Date,Array.prototype.slice.call(arguments))},YEAR:function(t){return(t=r(t))?t.getFullYear():null},MONTH:function(t){return(t=r(t))?t.getMonth()+1:null},DAY:function(t){return(t=r(t))?t.getDate():null},WEEKDAY:function(t){return(t=r(t))?t.getDay():null},HOURS:function(t){return(t=r(t))?t.getHours():null},MINUTES:function(t){return(t=r(t))?t.getMinutes():null},SECONDS:function(t){return(t=r(t))?t.getSeconds():null},DATEDIFF:function(t,e){return t=r(t),e=r(e),t&&e?(e.getTime()-t.getTime())/864e5:null},TIMEDIFF:function(t,e){return t=r(t),e=r(e),t&&e?(e.getTime()-t.getTime())/1e3:null}},this.unaryOps.LOWER=this.functions.LOWER,this.unaryOps.UPPER=this.functions.UPPER,this.unaryOps.PROPER=this.functions.PROPER,this.unaryOps.TITLE=this.functions.TITLE,this.unaryOps.TRIM=this.functions.TRIM,this.unaryOps.YEAR=this.functions.YEAR,this.unaryOps.MONTH=this.functions.MONTH,this.unaryOps.DAY=this.functions.DAY,this.unaryOps.WEEKDAY=this.functions.WEEKDAY,this.unaryOps.HOURS=this.functions.HOURS,this.unaryOps.MINUTES=this.functions.MINUTES,this.unaryOps.SECONDS=this.functions.SECONDS,this.consts={E:Math.E,PI:Math.PI,TRUE:!0,FALSE:!1,NA:Number.NaN,NULL:Number.NaN}}sn.prototype.parseTerm=function(t){for(this.parseFactor(t);this.accept(Qr,ln);){var e=this.current;this.parseFactor(t),t.push(un(e.value))}},sn.prototype.parseFactor=function(t){var e=this.tokens.unaryOps;if(this.save(),this.accept(Qr,(function(t){return t.value in e}))){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===Zr&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(t);if("TSEMICOLON"===this.nextToken.type||"TCOMMA"===this.nextToken.type||"TEOF"===this.nextToken.type||this.nextToken.type===Zr&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(t)}var r=this.current;this.parseFactor(t),t.push(an(r.value))}else this.parseExponential(t)},sn.prototype.parseExponential=function(t){for(this.parsePostfixExpression(t);this.accept(Qr,"^");)this.parseFactor(t),t.push(un("^"))},sn.prototype.parsePostfixExpression=function(t){for(this.parseFunctionCall(t);this.accept(Qr,"!");)t.push(an("!"))},sn.prototype.parseFunctionCall=function(t){var e=this.tokens.unaryOps;if(this.accept(Qr,(function(t){return t.value in e}))){var r=this.current;this.parseAtom(t),t.push(an(r.value))}else for(this.parseMemberExpression(t);this.accept(Zr,"(");)if(this.accept(Zr,")"))t.push(new on("IFUNCALL",0));else{var n=this.parseArgumentList(t);t.push(new on("IFUNCALL",n))}},sn.prototype.parseArgumentList=function(t){for(var e=0;!this.accept(Zr,")");)for(this.parseExpression(t),++e;this.accept("TCOMMA");)this.parseExpression(t),++e;return e},sn.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(Qr,".")||this.accept("TBRACKET","[");){var e=this.current;if("."===e.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect("TNAME"),t.push(new on("IMEMBER",this.current.value))}else{if("["!==e.value)throw new Error("unexpected symbol: "+e.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(t),this.expect("TBRACKET","]"),t.push(un("["))}}},qn.prototype.evaluate=function(t){return t=t||{},Vn(this.tokens,this,t)},qn.prototype.variables=function(){return(this.tokens||[]).filter((function(t){return"IVAR"===t.type})).map((function(t){return t.value}))},Gn.prototype.parse=function(t){var e=[],r=new sn(this,new en(this,t),{allowMemberAccess:!0});return r.parseExpression(e),r.expect("TEOF","EOF"),new qn(e,this)},Gn.prototype.evaluate=function(t,e){return this.parse(t).evaluate(e)};var Xn=new Gn;Gn.parse=function(t){return Xn.parse(t)},Gn.evaluate=function(t,e){return Xn.parse(t).evaluate(e)},Gn.keywords=["ABS","ACOS","ACOSH","and","ASIN","ASINH","ATAN","ATAN2","ATANH","CBRT","CEIL","CONCAT","COS","COSH","DATEDIFF","DAY","E","EVERY","EXP","EXPM1","FIND","FLOOR","HOURS","IF","in","INDEXOF","ISNULL","JOIN","LENGTH","LN","LOG","LOG10","LOG1P","LOG2","LOWER","MAP","MAX","MEAN","MEDIAN","MIN","MINUTES","MONTH","NOT","NOT","or","PI","PLUCK","POW","PROPER","RANDOM","RANGE","REPLACE","REPLACE_REGEX","ROUND","SECONDS","SIGN","SIN","SINH","SLICE","SOME","SORT","SPLIT","SQRT","SUBSTR","SUM","TAN","TANH","TIMEDIFF","TITLE","TRIM","TRUNC","UPPER","WEEKDAY","YEAR"];var Jn={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",AND:"logical",OR:"logical",NOT:"logical",IN:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};Gn.prototype.isOperatorEnabled=function(t){var e=function(t){return Object.prototype.hasOwnProperty.call(Jn,t)?Jn[t]:t}(t),r=this.options.operators||{};return!(e in r)||!!r[e]};var Qn=/\{\{(.+?)\}\}/g;function Zn(t){return K(t.name)?t.name():F(t.name)?t.name:t}function ti(){if(0===window.innerHeight)return 0;var t=window.innerHeight-Jr();return Math.max(t,0)}function ei(t){var e=parseFloat(getComputedStyle(t,null).width.replace("px",""));return isNaN(e)?0:e}function ri(t){var e="string"==typeof t?document.querySelector(t):t;e&&e.parentElement.removeChild(e)}var ni,ii=Object.freeze({__proto__:null,purifyHtml:Lr,significantDimension:Kr,tailLength:$r,round:qr,smartRound:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=Kr(t,r);return n+=e,t.map((function(t){return qr(t,n)}))},equalish:function(t,e){return Math.abs(t-e)<1e-6},clone:Gr,delimited:h,getNonChartHeight:Jr,outerHeight:Xr,htmlTemplate:function(t){var e={},r=new Gn;return t.replace(Qn,(function(t,n){(n=n.trim())&&!e[n]&&(e[n]=r.parse(n))})),function(r){return Lr(t.replace(Qn,(function(t,n){var i=n.trim()?e[n.trim()].evaluate(r):"";return null===i?"":i})),"



      • ")}},minMax:function(t){var e=[Number.MAX_VALUE,-Number.MAX_VALUE];return t.forEach((function(t){e[0]=Math.min(e[0],t.range()[0]),e[1]=Math.max(e[1],t.range()[1])})),e},columnNameColumn:function(t){return jr("",t.map((function(t){return t.title()})))},name:Zn,getMaxChartHeight:ti,nearest:function(t,e){var r,n=Number.MAX_VALUE;return t.forEach((function(t){var i=Math.abs(t-e);i1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return t;for(var n=Array.isArray(e)?e:e.split("."),i=t,o=0;o=0;e--)t[e].apply(this,arguments)},add:function(e){t.push(e)}}}function ui(t,e){var r=t.getMetadata("data.column-order",[]);return r.length&&r.length===e.numColumns()&&e.columnOrder(r),e}function si(t,e){var r=t.getMetadata("data.changes",[]),n=t.getMetadata("data.transpose",!1),i=e.numRows();return r.forEach((function(t){var r=n?t.column:t.row,o=n?t.row:t.column;if(e.hasColumn(o))if(t.ignored=!1,0===r){if(t.previous&&"undefined"!==t.previous)if(e.column(o).title()!==t.previous)return;e.column(o).title(t.value)}else if(r<=i){if(t.previous&&"undefined"!==t.previous)if(e.column(o).raw(r-1)!==t.previous)return;e.column(o).raw(r-1,t.value)}})),Re(t.getMetadata("data.column-format",{}),(function(t,r){t.type&&e.hasColumn(r)&&"auto"!==t.type&&e.column(r).type(t.type),t["input-format"]&&e.hasColumn(r)&&e.column(r).type(!0).format(t["input-format"])})),e}function ci(t){return t.toString().toLowerCase().replace(/\s+/g,"_").replace(/[^\w-]+/g,"").replace(/-/g,"_").replace(/__+/g,"_").replace(/^_+/,"").replace(/_+$/,"").replace(/^(\d)/,"_$1").replace(/^(and|or|in|true|false)$/,"$1_")}function fi(t,e){var r=oi(t.get(),"metadata.describe.computed-columns",{});Array.isArray(r)||(r=Object.keys(r).reduce((function(t,e){return t.push({name:e,formula:r[e]}),t}),[]));var n=si(t,e).list(),i={},o={},u=new Gn;e.eachColumn((function(t){if(!t.isComputed)if(i[t.name()]=ci(t.name()),"number"===t.type()){var e=a(t.range(),2),r=e[0],n=e[1];o[t.name()]={min:r,max:n,sum:t.sum(),mean:t.mean(),median:t.median()}}else if("date"===t.type()){var u=a(t.range(),2),s=u[0],c=u[1];o[t.name()]={min:s,max:c}}}));var s=r.reduce((function(t,r,n){var i=ci(r.name);return t.set(i,{name:r.name,index:e.numColumns()+n,key:i,formula:r.formula,visited:0,computed:!1,dependsOn:[]})}),new Map);r.forEach((function(t){var e=t.formula,r=t.name,n=s.get(ci(r));if(e.trim())try{n.expr=u.parse(e.trim()),n.expr.variables().forEach((function(t){t=t.split("__")[0],s.has(t)&&n.dependsOn.push(s.get(t))}))}catch(t){n.error=t.message}else n.expr={evaluate:function(){return""},variables:function(){return[]}}}));for(var c=[],f=0;s.size&&!(f>1e3);)s.forEach((function(t){f++;try{l(t,[])}catch(e){if(!e.message.startsWith("circular-dependency"))throw e;t.error=e.message,s.delete(t.key),c.push(t)}}));return c.forEach((function(e){if(e.error){var r=jr(e.name,n.map((function(){return"null"})));r.isComputed=!0,r.formula=e.formula,r.errors=[{message:e.error,row:"all"}],e.column=r}else e.column=function(e){var r=e.formula,u=e.name,s=e.expr,c=e.error,f=e.index,l=[];c&&l.push({row:"all",message:c});var p=oi(t,"metadata.data.changes",[]).filter((function(t){return t.column===f&&t.row>0})).reduce((function(t,e){var r=t.get(e.row-1);return r&&(e.previous=r.previous),t.set(e.row-1,e),t}),new Map),h=n.map((function(t,e){var r,n={ROWNUMBER:e};Re(t,(function(t,e){i[e]&&(n[i[e]]=t,o[e]&&Object.keys(o[e]).forEach((function(t){n["".concat(i[e],"__").concat(t)]=o[e][t]})))}));try{"function"==typeof(r=s.evaluate(n))&&(l.push({message:"formula returned function",row:e}),r=null)}catch(t){l.push({message:t.message,row:e}),r=null}if(p.has(e)){var a=p.get(e);if(void 0===a.previous||a.previous==r)return a.value}return r}));i[u]=ci(u),h.forEach((function(t,e){n[e][u]=t}));var d=jr(u,h.map((function(t){return j(t)?t?"yes":"no":U(t)?t.toISOString():H(t)?String(t):k(t)?null:String(t)})));if("number"===d.type()){var v=a(d.range(),2),m=v[0],g=v[1];o[u]={min:m,max:g,sum:d.sum(),mean:d.mean(),median:d.median()}}else if("date"===d.type()){var y=a(d.range(),2),M=y[0],w=y[1];o[u]={min:M,max:w}}return d.isComputed=!0,d.errors=l,d.formula=r,d}(e)})),c.sort((function(t,e){return t.index-e.index})).forEach((function(t){var r=t.column;return e.add(r)})),e;function l(t,e){if(!t.computed){e.push(t.name);for(var r=0;r-1||function(t,e){if(void 0===t&&void 0!==e)return!1;if(void 0===e&&void 0!==t)return!1;if(t.length!==e.length)return!1;for(var r=0;r=0){var m=Pe(o.columns(),(function(e){return Te(t.accepts,e.type())>=0}));if(m.length)u[e]=m[0].name();else{var g=jr(e,Ie(pr(o.numRows()),(function(t){return(t>25?String.fromCharCode(64+t/26):"")+String.fromCharCode(65+t%26)})),"text");o.add(g),r.chart().dataset(o),a[g.name()]=!0,u[e]=g.name()}}}})),Re(u,(function(t,e){tt(t)?(s[e]=[],Re(t,(function(t,n){s[e][n]=!1!==t?r.dataset.column(t):null}))):s[e]=!1!==t?r.dataset.column(t):null})),r.__axisCache={axes:u,axesAsColumns:s,userAxes:Gr(n),overrideKeys:f(),transpose:r.chart().getMetadata("data.transpose")},r.__axisCache[t?"axesAsColumns":"axes"]},keys:function(){var t=this.axes();if(t.labels){var e=this.dataset.column(t.labels),r=[];return e.each((function(t){r.push(String(t))})),r}return[]},keyLabel:function(t){return t},reset:function(){this.clear(),this.target().innerHTML="",ri(".chart .filter-ui"),ri(".chart .legend")},clear:function(){},renderingComplete:function(){window.parent&&window.parent.postMessage&&setTimeout((function(){window.parent.postMessage("datawrapper:vis:rendered","*")}),200),this.__renderedResolve(),this.__rendered=!0,this.postRendering()},postRendering:function(){},rendered:function(){return this.__renderedDfd},supportsSmartRendering:function(){return!1},colorMode:function(t){if(!arguments.length)return this.__colorMode;this.__colorMode=t},colorMap:function(t){var e=this;if(!arguments.length)return function(t){return e.__colors[t]=1,e.__colorMap?e.__colorMap(t):t};this.__colorMap=t},colorsUsed:function(){return Object.keys(this.__colors)},on:function(t,e){this.__callbacks[t]||(this.__callbacks[t]=[]),this.__callbacks[t].push(e)},fire:function(t,e){this.__callbacks&&this.__callbacks[t]&&this.__callbacks[t].forEach((function(t){"function"==typeof t&&t(e)}))}});var pi={};function hi(t,e){if(!pi[t]){console.warn("unknown visualization type: "+t);var r=Object.keys(pi);return r.length>0&&console.warn("try one of these instead: "+r.join(", ")),!1}var n=Ut(li),i=function(t){for(var e=[];"base"!==t.parentVis;)t=pi[t.parentVis],e.push({id:t.parentVis,vis:t});return e.reverse()}(pi[t]);return i.push({id:t,vis:pi[t]}),i.forEach((function(r){Object.assign(n,"function"==typeof r.vis.init?r.vis.init({target:e}):r.vis.init,{id:t})})),e&&n.target(e),n}hi.register=function(t){var e,r;2===arguments.length?(e="base",r=arguments[1]):3===arguments.length&&(e=arguments[1],r=arguments[2]),pi[t]={parentVis:e,init:r}},hi.has=function(t){return void 0!==pi[t]},hi.base=li;var di={};function vi(t){return di[t]}vi.register=function(t,e){di[t]=e};var mi={};function gi(t){return mi[t]}gi.register=function(t,e){mi[t]=e},gi.has=function(t){return void 0!==mi[t]};var yi=[];jr.types=Cr;var Mi={version:"chart-core@8.45.5",dataset:mr,column:jr,datasource:{delimited:Br,json:zr},utils:ii,chart:function(t){var e,r,n,i,o,a=ai(),u=ai(),s={},c={},f=["svgonly","plain","static","svgonly","map2svg","transparent","fitchart","fitheight"],l=["theme","search"],p={get:function(e,r){return oi(t,e,r)},getMetadata:function(e,r){return oi(t,"metadata.".concat(e),r)},set:function(e,r){return function(t,e,r){var n=Array.isArray(e)?e:e.split("."),i=n.pop(),o=t;return n.forEach((function(t){void 0!==o[t]&&null!==o[t]||(o[t]={}),o=o[t]})),JSON.stringify(o[i])!==JSON.stringify(r)&&(o[i]=r,!0)}(t,e,r)&&a.fire(p,e,r),this},setMetadata:function(t,e){return p.set("metadata.".concat(t),e)},getElementBounds:function(t){var e=ni.target().getBoundingClientRect(),r=t.getBoundingClientRect();return{top:r.top-e.top,right:r.right-e.left,bottom:r.bottom-e.top,left:r.left-e.left,width:r.width,height:r.height}},load:function(t,e){var r=this,n={firstRowIsHeader:p.get("metadata.data.horizontal-header",!0),transpose:p.get("metadata.data.transpose",!1)};return!t&&""!==t||e?n.url=e||"data.csv":n.csv=t,(p.get("metadata.data.json")?zr(n):Br(n)).dataset().then((function(t){return r.dataset(t),u.fire(p,t),t})).catch((function(t){console.error("could not fetch datasource",t)}))},dataset:function(t){return arguments.length?(!0!==t&&(o=t),e=p.get("metadata.data.json")?o:ui(p,si(p,fi(p,o))),!0===t?e:p):e},theme:function(t){return arguments.length?(r=t,p):r||{}},vis:function(t){return arguments.length?((ni=t).chart(p),p):ni},hasHighlight:function(){var t=p.get("metadata.visualize.highlighted-series");return tt(t)&&t.length>0},isHighlighted:function(t){if(void 0===L(t))return!1;var e=p.get("metadata.visualize.highlighted-series"),r=Zn(t);return!tt(e)||0===e.length||Te(e,r)>=0},locale:function(t,e){return arguments.length?((i=t.replace("_","-"))||(i="en-US"),"function"==typeof e&&e(),p):i},metricPrefix:function(t){return arguments.length?(n=t,p):n},inEditor:function(){try{return window.parent!==window&&window.parent.dw&&window.parent.dw.backend&&window.parent.dw.backend.hooks}catch(t){return!1}},render:function(t,n){if(!ni||!r||!e)throw new Error("cannot render the chart!");var i=p.vis().target();ni.chart(p);var o=ei(i),a=t?ti():p.getMetadata("publish.chart-height")||400,u=p.getHeightMode();if("fixed"===u?o<=0:o<=0||a<=0)return console.warn("Aborting chart rendering due to invalid container dimensions"),window.clearInterval(this.__resizingInterval),this.__resizingInterval=setInterval(d,1e3),void d();[i,n].forEach((function(t){t.classList.toggle("vis-height-fit","fit"===u),t.classList.toggle("vis-height-fixed","fixed"===u)}));var s=oi(r,"vis.".concat(p.type,".mobileBreakpoint"),450);n.classList.toggle("is-mobile",n.clientWidth<=s),n.classList.add("vis-"+ni.id),ni.reset(i),ni.size(o,a),ni.__init();var c={isIframe:t},h=new URLSearchParams(window.location.search);function d(){if(!c||!c.fitchart){var t,e,r,n;if("fit"===p.getHeightMode()){if(p.inEditor()||!p.getMetadata("publish.chart-height"))return;t=Jr()+p.getMetadata("publish.chart-height")}else t=Xr(document.querySelector("html"),!0);if(Math.round(window.innerHeight)!==Math.round(t))window.parent.postMessage({"datawrapper-height":(e={},r=p.get().id,n=t,r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e)},"*"),window.parent.postMessage({sentinel:"amp",type:"embed-size",height:t},"*"),window.parent.postMessage(JSON.stringify({src:window.location.toString(),context:"iframe.resize",height:t}),"*"),"function"==typeof window.datawrapperHeightCallback&&window.datawrapperHeightCallback(t)}}t&&(f.forEach((function(t){return c[t]=!!h.get(t)})),l.forEach((function(t){return c[t]=h.get(t)}))),ni.render(i,c),t&&(window.clearInterval(this.__resizingInterval),this.__resizingInterval=setInterval(d,1e3),d())},getHeightMode:function(){var t=oi(ni.theme(),"vis.d3-pies.fitchart",!1)&&["d3-pies","d3-donuts","d3-multiple-pies","d3-multiple-donuts"].indexOf(ni.meta.id)>-1,e=!!new URLSearchParams(window.location.search).get("fitchart");return t||e||"fixed"!==ni.meta.height?"fit":"fixed"},attributes:function(e){return arguments.length?(t=e,p):t},onChange:a.add,onDatasetChange:u.add,dataCellChanged:function(t,r){var n=p.get("metadata.data.changes",[]),i=p.get("metadata.data.transpose",!1),o=!1,a=e.columnOrder();return t=a[t],n.forEach((function(e){var n="row",a="column";i&&(n="column",a="row"),t===e[a]&&e[n]===r&&(o=!0)})),o},asset:function(t,e){if(1===arguments.length)return s[t];s[t]=e},translations:function(t){return 0===arguments.length?c:(c=t,this)},translate:function(t){var e=arguments;if(!c[t])return"MISSING: "+t;var r=c[t];return"string"==typeof r&&arguments.length>1&&(r=r.replace(/\$(\d)/g,(function(t,r){return r=1+Number(r),void 0===e[r]?t:e[r]}))),r}};return p},visualization:hi,theme:vi,block:gi,notify:function(t){t.remove=function(){yi=yi.filter((function(e){return e!==t})),window.parent.dw.backend.fire("notifications.change",yi)},yi.push(t);try{return window.parent.dw.backend.fire("notifications.change",yi),t.remove}catch(t){}}};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=Mi),exports.dw=Mi):window.dw=Mi}(); //# sourceMappingURL=dw-2.0.min.js.map