!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 f(t){try{if(","===t.localeData().delimiters.decimal)return";"}catch(t){}return","}function p(t,e,r){if(null==t||"number"==typeof t&&!Number.isFinite(t))return"";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 h(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 p(t,n,o)})).join(n)})).join(u)}var d={formatDelimited:h,guessDelimiterFromLocale:f},m="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},v=Array.prototype,g=Object.prototype,y="undefined"!=typeof Symbol?Symbol.prototype:null,b=v.push,M=v.slice,w=g.toString,Y=g.hasOwnProperty,E="undefined"!=typeof ArrayBuffer,x="undefined"!=typeof DataView,A=Array.isArray,_=Object.keys,O=Object.create,N=E&&ArrayBuffer.isView,S=isNaN,T=isFinite,D=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=Math.pow(2,53)-1;function k(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<=R}}function ct(t){return function(e){return null==e?void 0:e[t]}}var lt=ct("byteLength"),ft=st(lt),pt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var ht=E?function(t){return N?N(t)&&!tt(t):ft(t)&&pt.test(w.call(t))}:ut(!1),dt=ct("length");function mt(t,e){e=function(t){for(var e={},r=t.length,n=0;n":">",'"':""","'":"'","`":"`"},oe=ne(ie),ae=ne(It(ie)),ue=yt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},se=/(.)^/,ce={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},le=/\\|'|\r|\n|\u2028|\u2029/g;function fe(t){return"\\"+ce[t]}var pe=/^\s*(\w|\$)+\s*$/;var he=0;function de(t,e,r,n,i){if(!(n instanceof e))return t.apply(r,i);var o=Ut(t.prototype),a=t.apply(o,i);return I(a)?a:o}var me=k((function(t,e){var r=me.placeholder,n=function(){for(var i=0,o=e.length,a=Array(o),u=0;u1)ye(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 xe=me(Ee,2);function Ae(t,e,r){e=Zt(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),at))>=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,Xt(r,i,4),n,o)}}var Fe=Le(1),je=Le(-1);function Pe(t,e,r){var n=[];return e=Zt(e,r),ke(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Be(t,e,r){e=Zt(e,r);for(var n=!ge(t)&&vt(t),i=(n||t).length,o=0;o=0}var Ve=k((function(t,e,r){var n,i;return G(e)?i=e:(e=$t(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=zt(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))}));function $e(t,e){return Ie(t,Gt(e))}function ze(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=ge(t)?t:kt(t)).length;uo&&(o=n);else e=Zt(e,r),ke(t,(function(t,r,n){((i=e(t,r,n))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function We(t,e,r){if(null==e||r)return ge(t)||(t=kt(t)),t[ee(t.length-1)];var n=ge(t)?Ht(t):kt(t),i=dt(n);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a1&&(n=Xt(n,e[1])),e=Yt(t)):(n=tr,e=ye(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(r=e[1])):(e=Ie(ye(e,!1,!1),String),n=function(t,r){return!He(e,r)}),er(t,n,r)}));function nr(t,e,r){return M.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))}function ir(t,e,r){return null==t||t.length<1?null==e||r?void 0:[]:null==e||r?t[0]:nr(t,t.length-e)}function or(t,e,r){return M.call(t,null==e||r?1:e)}function ar(t,e){return ye(t,e,!1)}var ur=k((function(t,e){return e=ye(e,!0,!0),Pe(t,(function(t){return!He(e,t)}))})),sr=k((function(t,e){return ur(t,e)}));function cr(t,e,r,n){j(e)||(n=r,r=e,e=!1),null!=r&&(r=Zt(r,n));for(var i=[],o=[],a=0,u=dt(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,l)),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=re()-i;e>c?n=setTimeout(s,e-c):(n=null,r||(a=t.apply(u,o)),n||(o=u=null))},c=k((function(c){return u=this,o=c,i=re(),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 me(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:Ee,once:xe,findKey:Ae,findIndex:Oe,findLastIndex:Ne,sortedIndex:Se,indexOf:De,lastIndexOf:Ce,find:Re,detect:Re,findWhere:function(t,e){return Re(t,Kt(e))},each:ke,forEach:ke,map:Ie,collect:Ie,reduce:Fe,foldl:Fe,inject:Fe,reduceRight:je,foldr:je,filter:Pe,select:Pe,reject:function(t,e,r){return Pe(t,Ye(Zt(e)),r)},every:Be,all:Be,some:Ue,any:Ue,contains:He,includes:He,include:He,invoke:Ve,pluck:$e,where:function(t,e){return Pe(t,Kt(e))},max:ze,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=ge(t)?t:kt(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,s=void 0===a||a,c=e.numeral,l=void 0===c?null:c,p=o(e,["includeComputedColumns","includeHeader","numeral"]),d=i.numRows(),m=n?t:t.filter((function(t){return!t.isComputed})),v=m.map((function(t){return[].concat(u(s?[t.title()]:[]),u(t.formatted(l)))})),g=v[0].map((function(t,e){return v.map((function(t){return t[e]}))})).slice(0,d+1);return!p.delimiter&&l&&(p.delimiter=f(l)),h(g,p)},toCSV:function(){return this.csv.apply(this,arguments)},filterColumns:function(r){return t=t.filter((function(t){return!r[t.name()]})),ke(r,(function(t,r){t&&e[r]&&delete e[r]})),i},eachRow:function(t){var e;for(e=0;ee&&(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=l(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 gr(t.map((function(t){return t.clone()})))},clear:function(){var e,r=l(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(U(t)||F(t)||L(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()]||U(s.parse(t))},ambiguousFormats:function(){var t=[];return ke(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||[],ke(Nr,(function(e,r){ke(t,(function(t){void 0===n[r]&&(n[r]=0),Tr(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(H(t)||F(t))return t;if(!e||!B(t))return r++,t;var n,i,o,a=(n=t.toLowerCase(),V((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}Tr(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 Dr(a[1],a[2],1);case"WW-YYYY":return Dr(a[2],a[1],1);case"YYYY-WW-d":return Dr(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],Cr(+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],Cr(+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],Cr(+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 H(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 H(o.parse(t))},ambiguousFormats:function(){var t=[];return ke(n,(function(e,r){e===i[1]&&t.push([r,r])})),t}};return o}},kr=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,Ir=/|<\?(?:php)?[\s\S]*?\?>/gi,Lr="

";function Fr(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||"":Lr)+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var r=t,n=t;for(;;)if(n=(r=n).replace(Ir,"").replace(kr,(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],l=2===arguments.length?arguments[1]:t,p):Fr(t)},origName:function(){return Fr(l)},title:function(){return arguments.length?(c=arguments[0],p):Fr(c||t)},length:e.length,val:function(t,n){if(arguments.length){var i=n?f:e;return t<0&&(t+=i.length),r.parse(H(i[t])||U(i[t])?i[t]:Fr(i[t]))}},formatted:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&"number"===this.type()?this.values().map((function(e){return Number.isFinite(e)?t(e).format("0.[00000000000000000000]"):e})):this.raw()},values:function(t){var n=t?f:e;return n=Ie(n,(function(t){return H(t)||U(t)?t:Fr(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&&(f.length=t,e.length=t,p.length=t)},add:function(){var t;f.push.apply(f,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 Br(t){return null===t?NaN:+t}function Ur(t){return!at(t)}function Hr(t,e){return te?1:t>=e?0:NaN}function Vr(t){return{dataset:function(){return 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 $r(t).parse(e)}))}if(t.csv||""===t.csv)return new Promise((function(e){e(t.csv)})).then((function(e){return new $r(t).parse(e)}));throw new Error("you need to provide either an URL or CSV data.")}().catch((function(t){return console.error("could not fetch datasource, returning an empty dataset",t),gr([])}))},parse:function(){return new $r(t).parse(t.csv)}}}gr.delimited=Vr;var $r=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=zr(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=zr(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,l=o[s][c].length-1;return o[s][c].substr(l)===n&&(o[s][c]=o[s][c].substr(0,l)),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;e=0;e--)if(t[e].some((function(t){return""!==t})))return t.slice(0,e+1);return t.slice(0,1)}(r))}},{key:"guessDelimiter",value:function(t){var e=0,r=-1,n=this,i=["\t",";","|",","];return i.forEach((function(i,o){var a=zr(i,n.quoteChar),u=t.match(a).length;"\t"===i&&(u*=1.15),u>e&&(e=u,r=o)})),i[r]}}])&&e(r.prototype,n),i&&e(r,i),t}();function zr(t,e){return new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:"+e+"([^"+e+"]*(?:"+e+'"[^'+e+"]*)*)"+e+"|([^"+e+"\\"+t+"\\r\\n]*))","gi")}function Wr(t){return{dataset:function(){return 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.")}().catch((function(t){return console.error("could not fetch datasource, returning an empty object",t),{}}))},parse:function(){return JSON.parse(t.csv)}}}function qr(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 Kr(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 Gr(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1,i=[],o=0,a=cr(t.filter(ot)),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,qr(a[0])):t+(r>0?-1*(r-1):-1*r)}),0)/a.length);cr(a.map(l)).length>s?(e=function(){return cr(i).length===u},r=-1):(e=function(){return cr(i).length<=s},r=1);var c=100;do{i=a.map(l),o+=r}while(e()&&c-- >0);function l(t){return Kr(t,o)}return c<10&&console.warn("maximum iteration reached",t,i,o),r<0?o+=2:o--,o}function Xr(e){if(!e||"object"!==t(e))return e;try{return JSON.parse(JSON.stringify(e))}catch(t){return e}}function Jr(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 Qr(){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)+'"')},rn.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},rn.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(Zr,n),this.pos+=n.length,!0}return!1},rn.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},rn.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 nn=/^[0-9a-f]{4}$/i;rn.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);nn.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},rn.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)},rn.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},rn.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(Zr,e);else if("∙"===e||"•"===e)this.current=this.newToken(Zr,"*");else if(">"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Zr,">="),this.pos++):this.current=this.newToken(Zr,">");else if("<"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Zr,"<="),this.pos++):this.current=this.newToken(Zr,"<");else if("|"===e){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(Zr,"||"),this.pos++}else if("="===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Zr,"=="),this.pos++):this.current=this.newToken(Zr,e);else{if("!"!==e)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(Zr,"!="),this.pos++):this.current=this.newToken(Zr,e)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=t,!1)},rn.prototype.isOperatorEnabled=function(t){return this.parser.isOperatorEnabled(t)},rn.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"];cn.prototype.parseComparison=function(t){for(this.parseAddSub(t);this.accept(Zr,ln);){var e=this.current;this.parseAddSub(t),t.push(sn(e.value))}};var fn=["+","-","||"];cn.prototype.parseAddSub=function(t){for(this.parseTerm(t);this.accept(Zr,fn);){var e=this.current;this.parseTerm(t),t.push(sn(e.value))}};var pn=["*","/","%"];function hn(t,e){return Number(t)+Number(e)}function dn(t,e){return t-e}function mn(t,e){return t*e}function vn(t,e){return t/e}function gn(t,e){return t%e}function yn(t,e){return t===e}function bn(t,e){return t!==e}function Mn(t,e){return t>e}function wn(t,e){return t=e}function En(t,e){return t<=e}function xn(t,e){return Boolean(t&&e)}function An(t,e){return Boolean(t||e)}function _n(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 Tn(t){return Math.random()*(t||1)}function Dn(t){return Array.isArray(t)?t.length:String(t).length}function Cn(t,e,r){return t?e:r}function Rn(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 kn(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 Ln(t){return 1===arguments.length&&Array.isArray(t)?Math.min.apply(Math,t):Math.min.apply(Math,arguments)}function Fn(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 Bn(t){return(t>0)-(t<0)||+t}function Un(t){return Math.log(1+t)}function Hn(t){return Math.log(t)/Math.LN2}function Vn(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 $n(t,e,r){var n,i,o,a,u,s,c=[];if(Wn(t))return qn(t,r);for(var l=t.length,f=0;f0;)u.unshift(qn(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:qn(c[0],r)}function zn(t,e,r){return Wn(t)?t:{type:"IEXPREVAL",value:function(r){return $n(t.value,e,r)}}}function Wn(t){return t&&"IEXPREVAL"===t.type}function qn(t,e){return Wn(t)?t.value(e):t}function Kn(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 Gn(t){return t.trim()}function Xn(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||Hn,LN:Math.log,LOG10:Math.log10||_n,LG:Math.log10||_n,LOG1P:Math.log1p||Un,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:Dn,"!":Nn,SIGN:Math.sign||Bn,TEXT:function(t){return e(t)?t.toISOString():String(t)},NUMBER:Number},this.binaryOps={"+":hn,"-":dn,"*":mn,"/":vn,"%":gn,"^":Math.pow,"==":yn,"!=":bn,">":Mn,"<":wn,">=":Yn,"<=":En,and:xn,or:An,in:function(t,e){return Array.isArray(e)?e.includes(t):String(e).includes(t)},"[":kn},this.ternaryOps={"?":Cn};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:Cn,RANDOM:Tn,MIN:function(){var t=n.apply(this,arguments);return Ln(t)},MAX:function(){return In(n.apply(this,arguments))},SUM:function(){return Vn(n.apply(this,arguments))},MEAN:function(){var t=n.apply(this,arguments);return Vn(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:Rn,CONCAT:function(){return Array.from(arguments).join("")},TRIM:Gn,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:Fn,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}}cn.prototype.parseTerm=function(t){for(this.parseFactor(t);this.accept(Zr,pn);){var e=this.current;this.parseFactor(t),t.push(sn(e.value))}},cn.prototype.parseFactor=function(t){var e=this.tokens.unaryOps;if(this.save(),this.accept(Zr,(function(t){return t.value in e}))){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===tn&&"("===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===tn&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(t)}var r=this.current;this.parseFactor(t),t.push(un(r.value))}else this.parseExponential(t)},cn.prototype.parseExponential=function(t){for(this.parsePostfixExpression(t);this.accept(Zr,"^");)this.parseFactor(t),t.push(sn("^"))},cn.prototype.parsePostfixExpression=function(t){for(this.parseFunctionCall(t);this.accept(Zr,"!");)t.push(un("!"))},cn.prototype.parseFunctionCall=function(t){var e=this.tokens.unaryOps;if(this.accept(Zr,(function(t){return t.value in e}))){var r=this.current;this.parseAtom(t),t.push(un(r.value))}else for(this.parseMemberExpression(t);this.accept(tn,"(");)if(this.accept(tn,")"))t.push(new an("IFUNCALL",0));else{var n=this.parseArgumentList(t);t.push(new an("IFUNCALL",n))}},cn.prototype.parseArgumentList=function(t){for(var e=0;!this.accept(tn,")");)for(this.parseExpression(t),++e;this.accept("TCOMMA");)this.parseExpression(t),++e;return e},cn.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(Zr,".")||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 an("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(sn("["))}}},Kn.prototype.evaluate=function(t){return t=t||{},$n(this.tokens,this,t)},Kn.prototype.variables=function(){return(this.tokens||[]).filter((function(t){return"IVAR"===t.type})).map((function(t){return t.value}))},Xn.prototype.parse=function(t){var e=[],r=new cn(this,new rn(this,t),{allowMemberAccess:!0});return r.parseExpression(e),r.expect("TEOF","EOF"),new Kn(e,this)},Xn.prototype.evaluate=function(t,e){return this.parse(t).evaluate(e)};var Jn=new Xn;Xn.parse=function(t){return Jn.parse(t)},Xn.evaluate=function(t,e){return Jn.parse(t).evaluate(e)},Xn.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 Qn={"+":"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"};Xn.prototype.isOperatorEnabled=function(t){var e=function(t){return Object.prototype.hasOwnProperty.call(Qn,t)?Qn[t]:t}(t),r=this.options.operators||{};return!(e in r)||!!r[e]};var Zn=/\{\{(.+?)\}\}/g;function ti(t){var e={},r=new Xn;return t.replace(Zn,(function(t,n){(n=n.trim())&&!e[n]&&(e[n]=r.parse(n))})),function(r){return t.replace(Zn,(function(t,n){var i=n.trim()?e[n.trim()].evaluate(r):"";return null===i?"":i}))}}function ei(t){return G(t.name)?t.name():B(t.name)?t.name:t}function ri(){if(0===window.innerHeight)return 0;var t=window.innerHeight-Qr();return Math.max(t,0)}function ni(t){var e=parseFloat(getComputedStyle(t,null).width.replace("px",""));return isNaN(e)?0:e}function ii(t){var e="string"==typeof t?document.querySelector(t):t;e&&e.parentElement.removeChild(e)}var oi,ai=Object.freeze({__proto__:null,purifyHtml:Fr,significantDimension:Gr,tailLength:qr,round:Kr,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=Gr(t,r);return n+=e,t.map((function(t){return Kr(t,n)}))},equalish:function(t,e){return Math.abs(t-e)<1e-6},clone:Xr,delimited:d,getNonChartHeight:Qr,outerHeight:Jr,htmlTemplate:function(t){var e=ti(t);return function(t){return Fr(e(t),"



      • ")}},templateParser:ti,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:ei,getMaxChartHeight:ri,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 ci(t,e){var r=t.getMetadata("data.column-order",[]);return r.length&&r.length===e.numColumns()&&e.columnOrder(r),e}function li(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)}})),ke(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 fi(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 pi(t,e){var r=ui(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=li(t,e).list(),i={},o={},u=new Xn;e.eachColumn((function(t){if(!t.isComputed)if(i[t.name()]=fi(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=fi(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(fi(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=[],l=0;s.size&&!(l>1e3);)s.forEach((function(t){l++;try{f(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,l=e.index,f=[];c&&f.push({row:"all",message:c});var p=ui(t,"metadata.data.changes",[]).filter((function(t){return t.column===l&&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};ke(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))&&(f.push({message:"formula returned function",row:e}),r=null)}catch(t){f.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]=fi(u),h.forEach((function(t,e){n[e][u]=t}));var d=jr(u,h.map((function(t){return j(t)?t?"yes":"no":H(t)?function(t){try{return t.toISOString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}(t):U(t)?String(t):L(t)?null:String(t)})));if("number"===d.type()){var m=a(d.range(),2),v=m[0],g=m[1];o[u]={min:v,max:g,sum:d.sum(),mean:d.mean(),median:d.median()}}else if("date"===d.type()){var y=a(d.range(),2),b=y[0],M=y[1];o[u]={min:b,max:M}}return d.isComputed=!0,d.errors=f,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 f(t,e){if(!t.computed){e.push(t.name);for(var r=0;r=1e12&&!o||"t"===o?(v+=h.abbreviations.trillion,e/=1e12):u<1e12&&u>=1e9&&!o||"b"===o?(v+=h.abbreviations.billion,e/=1e9):u<1e9&&u>=1e6&&!o||"m"===o?(v+=h.abbreviations.million,e/=1e6):(u<1e6&&u>=1e3&&!o||"k"===o)&&(v+=h.abbreviations.thousand,e/=1e3)),t._.includes(r,"[.]")&&(m=!0,r=r.replace("[.]",".")),s=e.toString().split(".")[0],c=r.split(".")[1],f=r.indexOf(","),i=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,c?(t._.includes(c,"[")?(c=(c=c.replace("]","")).split("["),g=t._.toFixed(e,c[0].length+c[1].length,n,c[1].length)):g=t._.toFixed(e,c.length,n),s=g.split(".")[0],g=t._.includes(g,".")?h.delimiters.decimal+g.split(".")[1]:"",m&&0===Number(g.slice(1))&&(g="")):s=t._.toFixed(e,0,n),v&&!o&&Number(s)>=1e3&&v!==h.abbreviations.trillion)switch(s=String(Number(s)/1e3),v){case h.abbreviations.thousand:v=h.abbreviations.million;break;case h.abbreviations.million:v=h.abbreviations.billion;break;case h.abbreviations.billion:v=h.abbreviations.trillion}if(t._.includes(s,"-")&&(s=s.slice(1),y=!0),s.length0;b--)s="0"+s;return f>-1&&(s=s.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+h.delimiters.thousands)),0===r.indexOf(".")&&(s=""),p=s+g+(v||""),d?p=(d&&y?"(":"")+p+(d&&y?")":""):l>=0?p=0===l?(y?"-":"+")+p:p+(y?"-":"+"):y&&(p="-"+p),p},stringToNumber:function(t){var e,r,n,i=a[s.currentLocale],o=t,u={thousand:3,million:6,billion:9,trillion:12};if(s.zeroFormat&&t===s.zeroFormat)r=0;else if(s.nullFormat&&t===s.nullFormat||!t.replace(/[^0-9]+/g,"").length)r=null;else{for(e in r=1,"."!==i.delimiters.decimal&&(t=t.replace(/\./g,"").replace(i.delimiters.decimal,".")),u)if(n=new RegExp("[^a-zA-Z]"+i.abbreviations[e]+"(?:\\)|(\\"+i.currency.symbol+")?(?:\\))?)?$"),o.match(n)){r*=Math.pow(10,u[e]);break}r*=(t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1,t=t.replace(/[^0-9\.]+/g,""),r*=Number(t)}return r},isNaN:function(t){return"number"==typeof t&&isNaN(t)},includes:function(t,e){return-1!==t.indexOf(e)},insert:function(t,e,r){return t.slice(0,r)+e+t.slice(r)},reduce:function(t,e){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var r,n=Object(t),i=n.length>>>0,o=0;if(3===arguments.length)r=arguments[2];else{for(;o=i)throw new TypeError("Reduce of empty array with no initial value");r=n[o++]}for(;on?t:n}),1)},toFixed:function(t,e,r,n){var i,o,a,u,s=t.toString().split("."),c=e-(n||0);return i=2===s.length?Math.min(Math.max(s[1].length,c),e):c,a=Math.pow(10,i),u=(r(t+"e+"+i)/a).toFixed(i),n>e-i&&(o=new RegExp("\\.?0{1,"+(n-(e-i))+"}$"),u=u.replace(o,"")),u}},t.options=s,t.formats=o,t.locales=a,t.locale=function(t){return t&&(s.currentLocale=t.toLowerCase()),s.currentLocale},t.localeData=function(t){if(!t)return a[s.currentLocale];if(t=t.toLowerCase(),!a[t])throw new Error("Unknown locale : "+t);return a[t]},t.reset=function(){for(var t in u)s[t]=u[t]},t.zeroFormat=function(t){s.zeroFormat="string"==typeof t?t:null},t.nullFormat=function(t){s.nullFormat="string"==typeof t?t:null},t.defaultFormat=function(t){s.defaultFormat="string"==typeof t?t:"0.0"},t.register=function(t,e,r){if(e=e.toLowerCase(),this[t+"s"][e])throw new TypeError(e+" "+t+" already registered.");return this[t+"s"][e]=r,r},t.validate=function(e,r){var n,i,o,a,u,s,c,l;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{c=t.localeData(r)}catch(e){c=t.localeData(t.locale())}return o=c.currency.symbol,u=c.abbreviations,n=c.delimiters.decimal,i="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(l=e.match(/^[^\d]+/))||(e=e.substr(1),l[0]===o))&&((null===(l=e.match(/[^\d]+$/))||(e=e.slice(0,-1),l[0]===u.thousand||l[0]===u.million||l[0]===u.billion||l[0]===u.trillion))&&(s=new RegExp(i+"{2}"),!e.match(/[^\d.,]/g)&&(!((a=e.split(n)).length>2)&&(a.length<2?!!a[0].match(/^\d+.*\d$/)&&!a[0].match(s):1===a[0].length?!!a[0].match(/^\d+$/)&&!a[0].match(s)&&!!a[1].match(/^\d+$/):!!a[0].match(/^\d+.*\d$/)&&!a[0].match(s)&&!!a[1].match(/^\d+$/)))))},t.fn=c.prototype={clone:function(){return t(this)},format:function(e,r){var n,i,a,u=this._value,c=e||s.defaultFormat;if(r=r||Math.round,0===u&&null!==s.zeroFormat)i=s.zeroFormat;else if(null===u&&null!==s.nullFormat)i=s.nullFormat;else{for(n in o)if(c.match(o[n].regexps.format)){a=o[n].format;break}i=(a=a||t._.numberToFormat)(u,c,r)}return i},value:function(){return this._value},input:function(){return this._input},set:function(t){return this._value=Number(t),this},add:function(t){var r=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([this._value,t],(function(t,e,n,i){return t+Math.round(r*e)}),0)/r,this},subtract:function(t){var r=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([t],(function(t,e,n,i){return t-Math.round(r*e)}),Math.round(this._value*r))/r,this},multiply:function(t){return this._value=e.reduce([this._value,t],(function(t,r,n,i){var o=e.correctionFactor(t,r);return Math.round(t*o)*Math.round(r*o)/Math.round(o*o)}),1),this},divide:function(t){return this._value=e.reduce([this._value,t],(function(t,r,n,i){var o=e.correctionFactor(t,r);return Math.round(t*o)/Math.round(r*o)})),this},difference:function(e){return Math.abs(t(this._value).subtract(e).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$"}}),t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,r,n){var i,o=t._.includes(r," BPS")?" ":"";return e*=1e4,r=r.replace(/\s?BPS/,""),i=t._.numberToFormat(e,r,n),t._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"BPS"),i=i.join("")):i=i+o+"BPS",i},unformat:function(e){return+(1e-4*t._.stringToNumber(e)).toFixed(15)}}),n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},i="("+(i=(r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(n.suffixes.filter((function(t){return r.suffixes.indexOf(t)<0}))).join("|")).replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(e,i,o){var a,u,s,c=t._.includes(i,"ib")?n:r,l=t._.includes(i," b")||t._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),a=0;a<=c.suffixes.length;a++)if(u=Math.pow(c.base,a),s=Math.pow(c.base,a+1),null===e||0===e||e>=u&&e0&&(e/=u);break}return t._.numberToFormat(e,i,o)+l},unformat:function(e){var i,o,a=t._.stringToNumber(e);if(a){for(i=r.suffixes.length-1;i>=0;i--){if(t._.includes(e,r.suffixes[i])){o=Math.pow(r.base,i);break}if(t._.includes(e,n.suffixes[i])){o=Math.pow(n.base,i);break}}a*=o||1}return a}}),t.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,n){var i,o,a=t.locales[t.options.currentLocale],u={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(r=r.replace(/\s?\$\s?/,""),i=t._.numberToFormat(e,r,n),e>=0?(u.before=u.before.replace(/[\-\(]/,""),u.after=u.after.replace(/[\-\)]/,"")):e<0&&!t._.includes(u.before,"-")&&!t._.includes(u.before,"(")&&(u.before="-"+u.before),o=0;o=0;o--)switch(u.after[o]){case"$":i=o===u.after.length-1?i+a.currency.symbol:t._.insert(i,a.currency.symbol,-(u.after.length-(1+o)));break;case" ":i=o===u.after.length-1?i+" ":t._.insert(i," ",-(u.after.length-(1+o)+a.currency.symbol.length-1))}return i}}),t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,r,n){var i=("number"!=typeof e||t._.isNaN(e)?"0e+0":e.toExponential()).split("e");return r=r.replace(/e[\+|\-]{1}0/,""),t._.numberToFormat(Number(i[0]),r,n)+"e"+i[1]},unformat:function(e){var r=t._.includes(e,"e+")?e.split("e+"):e.split("e-"),n=Number(r[0]),i=Number(r[1]);return i=t._.includes(e,"e-")?i*=-1:i,t._.reduce([n,Math.pow(10,i)],(function(e,r,n,i){var o=t._.correctionFactor(e,r);return e*o*(r*o)/(o*o)}),1)}}),t.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,n){var i=t.locales[t.options.currentLocale],o=t._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),o+=i.ordinal(e),t._.numberToFormat(e,r,n)+o}}),t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,n){var i,o=t._.includes(r," %")?" ":"";return t.options.scalePercentBy100&&(e*=100),r=r.replace(/\s?\%/,""),i=t._.numberToFormat(e,r,n),t._.includes(i,")")?((i=i.split("")).splice(-1,0,o+"%"),i=i.join("")):i=i+o+"%",i},unformat:function(e){var r=t._.stringToNumber(e);return t.options.scalePercentBy100?.01*r:r}}),t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(t,e,r){var n=Math.floor(t/60/60),i=Math.floor((t-60*n*60)/60),o=Math.round(t-60*n*60-60*i);return n+":"+(i<10?"0"+i:i)+":"+(o<10?"0"+o:o)},unformat:function(t){var e=t.split(":"),r=0;return 3===e.length?(r+=60*Number(e[0])*60,r+=60*Number(e[1]),r+=Number(e[2])):2===e.length&&(r+=60*Number(e[0]),r+=Number(e[1])),Number(r)}}),t}))}(di);var mi=di.exports,vi=function(){}.prototype;jt(vi,{__init:function(){var t=this;return this.__renderedDfd=new Promise((function(e){t.__renderedResolve=e})),this.__rendered=!1,this.__colors={},this.__callbacks={},window.parent&&window.parent.postMessage&&window.parent.postMessage("datawrapper:vis:init","*"),this},render:function(t){t.innerHTML="implement me!"},theme:function(t){return arguments.length?(this.__theme=t,this):"string"==typeof this.__theme?dw.theme(this.__theme):this.__theme},libraries:function(t){return arguments.length?(this.__libraries=t,this):this.__libraries||{}},target:function(t){return arguments.length?(this.__target=t,this):this.__target},size:function(t,e){var r=this;return arguments.length?(r.__w=t,r.__h=e,r):[r.__w,r.__h]},get:function(t,e){return ui(this.chart().get(),"metadata.visualize"+(t?"."+t:""),e)},chart:function(t){var e=this;if(!arguments.length)return e.__chart;e.dataset=t.dataset(),e.theme(t.theme()),e.__chart=t,e.__axisCache=void 0;var r=ui(t.get(),"metadata.data.column-format",{}),n={};ke(r,(function(t,e){n[e]=!!t.ignore})),e.dataset.filterColumns&&e.dataset.filterColumns(n);var i=e.libraries(),o=i.numeral;if(o&&t.locales&&t.locales.numeral){try{o.register("locale","dw",t.locales.numeral)}catch(t){if(!(t instanceof TypeError))throw t}o.locale("dw")}return e},axes:function(t,e){var r=this,n=ui(r.chart().get(),"metadata.axes",{});if(!e&&r.__axisCache&&wt(r.__axisCache.userAxes,n)&&wt(r.__axisCache.overrideKeys,l())&&r.__axisCache.transpose===r.chart().getMetadata("data.transpose"))return r.__axisCache[t?"axesAsColumns":"axes"];var i=Xr(r.meta.axes),o=r.dataset,a={},u={},s={};ke(i,(function(t,e){if(n[e]){var i=n[e];if(t.optional&&t.overrideOptionalKey&&!ui(r.chart().get(),"metadata."+t.overrideOptionalKey,!1))return;(function(t){et(t)||(t=[t]);for(var e=0;e-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 v=Pe(o.columns(),(function(e){return De(t.accepts,e.type())>=0}));if(v.length)u[e]=v[0].name();else{var g=jr(e,Ie(hr(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()}}}})),ke(u,(function(t,e){et(t)?(s[e]=[],ke(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:Xr(n),overrideKeys:l(),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="",ii(".chart .filter-ui"),ii(".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){var r=e.__darkMode&&e.__darkModeColorMap;return e.__colors[t]=1,e.__colorMap?(r&&(t=e.__darkModeColorMap(t)),e.__colorMap(t)):(r&&(t=e.__darkModeColorMap(t)),t)};this.__colorMap=t},initDarkMode:function(t,e){this.__onDarkModeChange=t,this.__darkModeColorMap=e},darkMode:function(t){if(void 0===this.__darkMode&&(this.__darkMode=!1),!arguments.length)return this.__darkMode;this.__onDarkModeChange&&(this.__darkMode=t,this.__onDarkModeChange(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 gi={};function yi(t,e){if(!gi[t]){console.warn("unknown visualization type: "+t);var r=Object.keys(gi);return r.length>0&&console.warn("try one of these instead: "+r.join(", ")),!1}var n=Ht(vi),i=function(t){for(var e=[];"base"!==t.parentVis;)t=gi[t.parentVis],e.push({id:t.parentVis,vis:t});return e.reverse()}(gi[t]);return i.push({id:t,vis:gi[t]}),i.forEach((function(r){Object.assign(n,"function"==typeof r.vis.init?r.vis.init({target:e}):r.vis.init,{id:t})})),n.libraries(yi.libraries),e&&n.target(e),n}yi.register=function(t){var e,r;2===arguments.length?(e="base",r=arguments[1]):3===arguments.length&&(e=arguments[1],r=arguments[2]),gi[t]={parentVis:e,init:r}},yi.has=function(t){return void 0!==gi[t]},yi.libraries={numeral:mi},yi.base=vi;var bi={};function Mi(t){return bi[t]}Mi.register=function(t,e){bi[t]=e};var wi={};function Yi(t){return wi[t]}Yi.register=function(t,e){wi[t]=e},Yi.has=function(t){return void 0!==wi[t]};var Ei=[];jr.types=Rr;var xi={version:"chart-core@8.45.5",dataset:gr,column:jr,datasource:{delimited:Vr,json:Wr},utils:ai,chart:function(t){var e,r,n,i,o,a=si(),u=si(),s={},c={},l=["plain","static","svgonly","map2svg","transparent","fitchart","fitheight"],f=["theme","search"],p={get:function(e,r){return ui(t,e,r)},getMetadata:function(e,r){return ui(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=oi.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")?Wr(n):Vr(n)).dataset().then((function(t){return r.dataset(t),u.fire(p,t),t}))},dataset:function(t){return arguments.length?(!0!==t&&(o=t),e=p.get("metadata.data.json")?o:ci(p,li(p,pi(p,o))),!0===t?e:p):e},theme:function(t){return arguments.length?(r=t,p):r||{}},vis:function(t){return arguments.length?((oi=t).chart(p),p):oi},hasHighlight:function(){var t=p.get("metadata.visualize.highlighted-series");return et(t)&&t.length>0},isHighlighted:function(t){if(void 0===F(t))return!1;var e=p.get("metadata.visualize.highlighted-series"),r=ei(t);return!et(e)||0===e.length||De(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(!oi||!r||!e)throw new Error("cannot render the chart!");var i=p.vis().target();oi.chart(p);var o=ni(i),a=t?ri():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=ui(r,"vis.".concat(p.type,".mobileBreakpoint"),450);n.classList.toggle("is-mobile",n.clientWidth<=s),n.classList.add("vis-"+oi.id),oi.reset(i),oi.size(o,a),oi.__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=Qr()+p.getMetadata("publish.chart-height")}else t=Jr(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:location.href,context:"iframe.resize",height:t}),"*"),"function"==typeof window.datawrapperHeightCallback&&window.datawrapperHeightCallback(t)}}t&&(l.forEach((function(t){return c[t]=JSON.parse(h.get(t)||"false")})),f.forEach((function(t){return c[t]=h.get(t)}))),oi.render(i,c),t&&(window.clearInterval(this.__resizingInterval),this.__resizingInterval=setInterval(d,1e3),d())},getHeightMode:function(){var t=ui(oi.theme(),"vis.d3-pies.fitchart",!1)&&["d3-pies","d3-donuts","d3-multiple-pies","d3-multiple-donuts"].indexOf(oi.meta.id)>-1,e=!!new URLSearchParams(window.location.search).get("fitchart");return t||e||"fixed"!==oi.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:yi,theme:Mi,block:Yi,notify:function(t){t.remove=function(){Ei=Ei.filter((function(e){return e!==t})),window.parent.dw.backend.fire("notifications.change",Ei)},Ei.push(t);try{return window.parent.dw.backend.fire("notifications.change",Ei),t.remove}catch(t){}}};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=xi),exports.dw=xi):window.dw=xi}(); //# sourceMappingURL=dw-2.0.min.js.map