(function () {
  //Inject code v3.0.1

  var highcharts = document.createElement('script');

  var cdn = 'https://code.highcharts.com/';
  var loaded = 0;  
  var encodedUrl = encodeURI('https://https://app.everviz.com//show/tB2-gEN0B');
  var chartCreated = false;
  var scripts = [
    "highcharts.js",
    "modules/stock.js",
    "highcharts-more.js",
    "highcharts-3d.js",
    "modules/data.js",
    "modules/exporting.js",
    "modules/funnel.js",
    "modules/solid-gauge.js",
    "modules/export-data.js",
    "modules/accessibility.js"
    /* "modules/series-label.js" */
  ];

  var externalCSS = [
      ];

  var extraScripts = [
  "https://code.highcharts.com/modules/annotations.js"
  ,"https://code.highcharts.com/modules/annotations-advanced.js"
  ];

  var options = {"title":{"text":"Cumulative number of infections","align":"left","x":10,"style":{"fontFamily":"'Fort', sans-serif","fontSize":17,"lineHeight":21,"fontWeight":"700","color":"#222222"}},"subtitle":{"text":"","align":"left","x":10,"style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontStyle":"italic","lineHeight":20,"fontWeight":"400","color":"#222222"}},"colors":["#40425b","#56c5d0","#2A2383","#F2C60E","#24CBE5","#64E572","#FF9655","#FFF263","#6AF9C4"],"legend":{"align":"left","verticalAlign":"top","itemMarginBottom":10,"x":0,"symbolRadius":2,"layout":"horizontal","itemStyle":{"fontSize":14,"fontWeight":"700","color":"#333333","cursor":"pointer","textOverflow":"ellipsis","fontFamily":"'Fort', sans-serif"},"title":{"text":"SCENARIO WHEN POLICY INITIATIVE HAPPENS"},"useHTML":true},"plotOptions":{"series":{"marker":{"enabled":false},"lineWidth":3,"allowPointSelect":true,"states":{"select":{"color":"#EFFFEF","borderColor":"black","dashStyle":"dot"}},"dataLabels":{"style":{"fontSize":14}},"events":{}},"line":{"lineWidth":4}},"chart":{"type":"line","polar":false,"backgroundColor":"#f7f6f7","style":{"fontFamily":"'Fort', sans-serif","fontWeight":"500"}},"exporting":{"buttons":{"contextButton":{"theme":{"fill":"#f7f6f7"}}}},"credits":{"text":"everviz.com","href":"https://everviz.com","enabled":false,"style":{"fontSize":12,"fontWeight":"500","color":"#222222"}},"series":[{"data":[],"turboThreshold":0,"type":"area","marker":{"symbol":"circle"},"name":"Earlier intervention: days 30-59","zIndex":1},{"data":[],"turboThreshold":0,"type":"area","marker":{"symbol":"circle"},"name":"Later intervention: days 60-89"}],"caption":{"text":"Figure 1B"},"tooltip":{"valueSuffix":" infections","shared":true,"valueDecimals":0,"style":{"fontFamily":"'Fort', sans-serif","fontSize":14,"fontWeight":"500","color":"#222222","cursor":"default","pointerEvents":"none","whiteSpace":"nowrap"},"headerFormat":"<span style=\"font-size: 10px\">DAY {point.key}</span><br/>"},"lang":{"thousandsSep":","},"stockTools":{"gui":{"enabled":false}},"navigation":{"bindingsClassName":"tools-container","events":{}},"labels":{"items":[]},"pane":{"background":[]},"responsive":{"rules":[]},"yAxis":{"title":{"text":"","style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontWeight":"700","color":"#222222"}},"labels":{"style":{"fontSize":14,"fontWeight":"700","color":"#222222"}},"endOnTick":false},"xAxis":{"labels":{"style":{"fontSize":14,"fontWeight":"700","color":"#222222"}},"title":{"style":{"fontFamily":"'Fort', sans-serif","fontSize":15,"fontWeight":"700","color":"#222222"},"text":"Days elapsed during pandemic"},"plotBands":[{"from":30,"to":59,"color":"#cafaff"},{"from":60,"to":89,"color":"#cafaff"}],"plotLines":[{"label":{"text":"<Earlier<br>intervention","rotation":0,"verticalAlign":"middle"},"value":30,"zIndex":1,"color":"#40425b"},{"label":{"text":"<Later<br>intervention","rotation":0,"verticalAlign":"middle"},"value":60,"color":"#56c5d0","zIndex":1}],"lineColor":"#222222","tickColor":"#222222","min":1},"annotations":[],"data":{"csv":"Day;Earlier intervention: days 30-59;Later intervention: days 60-89\n1;742.5;742.5\n2;830.7749208;830.7749208\n3;925.0970181;925.0970181\n4;1025.798518;1025.798518\n5;1133.259833;1133.259833\n6;1247.902929;1247.902929\n7;1370.187952;1370.187952\n8;1500.611943;1500.611943\n9;1639.708903;1639.708903\n10;1788.050758;1788.050758\n11;1946.248957;1946.248957\n12;2114.956509;2114.956509\n13;2294.870392;2294.870392\n14;2486.734241;2486.734241\n15;2691.341311;2691.341311\n16;2909.53768;2909.53768\n17;3142.225706;3142.225706\n18;3390.367729;3390.367729\n19;3654.990031;3654.990031\n20;3937.187074;3937.187074\n21;4238.126011;4238.126011\n22;4559.051515;4559.051515\n23;4901.290919;4901.290919\n24;5266.259702;5266.259702\n25;5655.467346;5655.467346\n26;6070.523569;6070.523569\n27;6513.144985;6513.144985\n28;6985.162199;6985.162199\n29;7488.527374;7488.527374\n30;8025.322304;8025.322304\n31;8512.842759;8597.767017\n32;8969.047394;9208.228953\n33;9406.081318;9859.232753\n34;9832.168074;10553.47069\n35;10252.88605;11293.81379\n36;10672.02959;12083.32371\n37;11092.18993;12925.26541\n38;11515.14714;13823.12058\n39;11942.13453;14780.60209\n40;12374.01705;15801.66933\n41;12811.41167;16890.54451\n42;13254.76851;18051.73017\n43;13704.42574;19290.02775\n44;14160.64645;20610.55742\n45;14623.64366;22018.77923\n46;15093.59716;23520.51567\n47;15570.66484;25121.97571\n48;16054.99042;26829.78042\n49;16546.70859;28650.99032\n50;17045.94857;30593.13453\n51;17552.83644;32664.24185\n52;18067.49677;34872.87385\n53;18590.05374;37228.16026\n54;19120.63184;39739.83659\n55;19659.35644;42418.2843\n56;20206.3541;45274.57361\n57;20761.75284;48320.50916\n58;21325.68235;51568.67864\n59;21898.27404;55032.5047\n60;22479.66124;58726.30024\n61;23224.25673;62080.98714\n62;24095.99775;65220.13801\n63;25074.08053;68227.32286\n64;26147.32851;71159.12735\n65;27310.68774;74053.93553\n66;28563.04947;76937.85506\n67;29905.90069;79828.71466\n68;31342.49171;82738.76099\n69;32877.32655;85676.47816\n70;34515.85551;88647.81529\n71;36264.29422;91657.01467\n72;38129.52258;94707.17062\n73;40119.034;97800.60649\n74;42240.91704;100939.1291\n75;44503.85804;104124.2004\n76;46917.15778;107357.0534\n77;49490.75789;110638.7704\n78;52235.27435;113970.3359\n79;55162.03668;117352.6721\n80;58283.13171;120786.6633\n81;61611.45158;124273.1721\n82;65160.74578;127813.0505\n83;68945.67704;131407.1474\n84;72981.8813;135056.314\n85;77286.03184;138761.4069\n86;81875.9077;142523.291\n87;86770.46677;146342.841\n88;91989.92366;150220.9424\n89;97555.83283;154158.493\n90;103491.1771;158156.4029\n91;109820.4622;163276.3555\n92;116569.8172;169270.3275\n93;123767.1019;175995.2026\n94;131442.0211;183374.0509\n95;139626.2463;191372.0329\n96;148353.5457;199981.4266\n97;157659.9224;209212.3472\n98;167583.7617;219087.0213\n99;178165.9881;229636.2807\n100;189450.2328;240897.4454\n101;201483.0116;252913.0772\n102;214313.9148;265730.2805\n103;227995.8094;279400.3509\n104;242585.0543;293978.6441\n105;258141.7298;309524.5898\n106;274729.8818;326101.8011\n107;292417.7813;343778.2502\n108;311278.2018;362626.4928\n109;331388.7136;382723.9294\n110;352831.9976;404153.0983\n111;375696.1787;427001.9964\n112;400075.1815;451364.4256\n113;426069.1077;477340.3655\n114;453784.6385;505036.3713\n115;483335.4618;534565.9994\n116;514842.727;566050.2596\n117;548435.5285;599618.0972\n118;584251.4192;635406.9058\n119;622436.9573;673563.072\n120;663148.2856;714242.5547","seriesMapping":[{"x":0,"y":1},{"x":0,"y":2}]}};
  
  var templateDataSettings = {};

  var pluginCode = {};;

  options.data.complete = function(options) {
    const keys = Object.keys(templateDataSettings || {});
    keys.forEach(function(key) {
      const serie = options.series[key];
      (serie.data || []).forEach(function(d, i) {
        if (templateDataSettings[key].data && templateDataSettings[key].data[i]) {
          merge(d, templateDataSettings[key].data[i]);
        }
      })
    })  
    return options;
  }

  merge(options, pluginCode);

  function isNull(what){return(typeof what==='undefined'||what===null)}
  function isStr(what){return(typeof what==='string'||what instanceof String)}
  function isNum(what){return!isNaN(parseFloat(what))&&isFinite(what)}
  function isFn(what){return(what&&(typeof what==='function')||(what instanceof Function))}
  function isArr(what){return(!isNull(what)&&what.constructor.toString().indexOf('Array')>-1)}
  function isBool(what){return(what===!0||what===!1)}
  function isBasic(what){return!isArr(what)&&(isStr(what)||isNum(what)||isBool(what)||isFn(what))}
  function isObj(what){return what&&what.constructor.toString().indexOf('Object')>-1}
  function isEmptyObjectArray(arr){return isObj(arr[0])&&arr.some(function(b){return Object.keys(b).length===0})}
  function merge(a,b){if(!a||!b)return a||b;Object.keys(b).forEach(function(bk){if(isNull(b[bk])||isBasic(b[bk])){a[bk]=b[bk]}else if(isArr(b[bk])){if(isEmptyObjectArray(b[bk]))return;a[bk]=[];b[bk].forEach(function(i){if(isNull(i)||isBasic(i)){a[bk].push(i)}else{a[bk].push(merge(isArr(i)?[]:{},i))}})}else{a[bk]=a[bk]||{};merge(a[bk],b[bk])}});return a}

  function isScriptAlreadyIncluded(src){
    var scripts = document.getElementsByTagName("script");
    for (var i = 0; i < scripts.length; i++) {
      if (scripts[i].hasAttribute('src')) {
        const scriptTag = scripts[i].getAttribute('src') || '';
        if ((scriptTag.indexOf(src) >= 0) || 
            (scriptTag.indexOf('highcharts.src.js') > -1 && src === 'highcharts.js') ||
            ((scriptTag.indexOf('stock/highstock.js') > -1) && src === 'modules/highstock.js')) {
          return true;
        }
      }
    }
    return false;
  }

  function loadCSS() {
    var cssLength = externalCSS.length;
    for(var i=0; i < cssLength; i++) {
      var css = document.createElement('link');
      css.rel  = 'stylesheet';
      css.type = "text/css";
      css.href = externalCSS[i];
      document.body.appendChild(css);
    }
  }

  function createChart() {
    if(chartCreated) return;

    if (typeof window['Highcharts'] !== 'undefined') {
      

    if (options.yAxis && options.yAxis.length === 1) options.yAxis = options.yAxis[0];
    if (options.xAxis && options.xAxis.length === 1) options.xAxis = options.xAxis[0];
    if (options.zAxis && options.zAxis.length === 1) options.zAxis = options.zAxis[0];

    Highcharts.merge(true, options, {
    chart: {style: {fontFamily: "'Fort', sans-serif", fontWeight: "500",}},
    credits: {style: {fontSize: 12, fontWeight: "500", color: "#222222",}},
    legend: {itemStyle: {fontFamily: "'Fort', sans-serif", fontSize: 14, fontWeight: "700",}},
    plotOptions: {series: {dataLabels: {style: {fontSize: 14,}}}},
    subtitle: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontStyle: "italic", lineHeight: 20, fontWeight: "400", color: "#222222",}},
    title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 17, lineHeight: 21, fontWeight: "700", color: "#222222",}},
    tooltip: {style: {fontFamily: "'Fort', sans-serif", fontSize: 14, fontWeight: "500", color: "#222222",}},
    xAxis: {labels: {style: {fontSize: 14, fontWeight: "700", color: "#222222",}}, title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontWeight: "700", color: "#222222",}}},
    yAxis: {labels: {style: {fontSize: 14, fontWeight: "700", color: "#222222",}}, title: {style: {fontFamily: "'Fort', sans-serif", fontSize: 15, fontWeight: "700", color: "#222222",}}},
});


      if (options && (options.lang || options.global)) {
        Highcharts.setOptions({
          global: options.global || {},
          lang: options.lang || {}
        });
      }

      if (Highcharts.Annotation) {
        Highcharts.Annotation.ControlPoint.prototype.redraw = function (animation) {
          this.graphic[animation ? 'animate' : 'attr'](
              this.options.positioner ? this.options.positioner.call(this, this.target) : null
          );
        };
      }
      
      chartCreated = true;
      window.HighchartsCloud.hasLoaded = true;
      new Highcharts.Chart('highcharts-tB2-gEN0B', options);
    }
  }

  function check(scripts, cb) {
    if (loaded === scripts.length) {
      if (cb) {
        cb();
      } else {
        for (var i = 0; i < window.HighchartsCloud.ondone.length; i++) {
          try {
            window.HighchartsCloud.ondone[i]();
          } catch(e) {
            console.error(e);
          }
        }
      }
    }
  }

  function loadScript(s, scripts, cb) {
    if (!s) next();
    
    function next() {
      ++loaded;
      if (loaded < scripts.length) {
        loadScript(scripts[loaded], scripts, cb);
      }
      check(scripts, cb);
    }

    if (isScriptAlreadyIncluded(s)) {
      return next();
    }

    var n = document.createElement('script');

    n.onload = function () {
      next();
    };

    if (s.indexOf('https') >= 0) {
      n.src = s;
    } else {
      n.src = cdn + s;
    }
    document.body.appendChild(n);
  }

  function loadExtraScripts(){
    if (extraScripts.length > 0) {
      loaded = 0;
      loadScript(extraScripts[0], extraScripts);
    } else {
      check(scripts);
    }
  }

  function loadExtraScriptsAndMakeChart(){
    loaded = 0;
    if (extraScripts.length > 0) {
      loadScript(extraScripts[0], extraScripts, createChart);
    } else {
      check(extraScripts);
    }
  }

  if (typeof window['HighchartsCloud'] === 'undefined') {
    window.HighchartsCloud = {
      ondone: [createChart],
      hasWrapped: false,
      hasLoaded: false
    };

    loadScript(scripts[0], scripts, loadExtraScripts);
    loadCSS();

  } else {
    if (!window.HighchartsCloud.hasLoaded) window.HighchartsCloud.ondone.push(loadExtraScriptsAndMakeChart);
    else loadExtraScriptsAndMakeChart();
  }

}());
