(function () {
  //Inject code v5.2

  var highcharts = document.createElement('script');
  var injectVersion = 5;
  var cdn = 'https://code.highcharts.com/';
  var loaded = 0;  
  var encodedUrl = encodeURI('https://https://app.everviz.com//show/uWc3GuuvU');
  var chartCreated = false;
  var chart = false;
  var delayGen = 0;
  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"
  ];

  const inEmbedCode = window.location.pathname.indexOf('/embed/') > -1;
  const inEverviz = window.location.origin === 'https://app.everviz.com';
  const loadHighchartsModules = inEverviz && !inEmbedCode;

  var legacyElementClassName = 'highcharts-uWc3GuuvU';
  var elementClassName = 'everviz-uWc3GuuvU';
  var externalCSS = [
    "https://app.everviz.com/fonts/PrbXiHAt4/font.css",
    "https://app.everviz.com/static/fonts/gordita/style.css",
    "https://app.everviz.com/resources/css/highcharts-data-table.css"
  ];

  var extraScripts = [
  "https://code.highcharts.com/modules/heatmap.js",
  "https://code.highcharts.com/modules/series-label.js",
  "https://app.everviz.com/resources/js/everviz-tooltip-helper.js",
  "https://app.everviz.com/resources/js/highcharts-scroll-animation.js",
  "https://app.everviz.com/resources/js/everviz-utils.js",
  "https://app.everviz.com/resources/js/highcharts-overrides.js",
  ];

  var options = {"colors":["#FF495E","#28277E","#6D5BD1","#F9DCE7","#AEC8FA","#DDD8F5"],"chart":{"style":{"fontFamily":"gordita","fontSize":"12px"},"type":"heatmap","height":775,"marginRight":50},"title":{"text":"","align":"left","useHTML":true},"subtitle":{"text":"","align":"left","useHTML":true},"credits":{"text":"","href":"","useHTML":true},"plotOptions":{"series":{"borderRadius":2,"pointPadding":0.01,"groupPadding":0.05,"borderWidth":0,"shadow":false,"marker":{"enabled":true},"lineWidth":0,"minSize":4,"maxSize":60,"allowPointSelect":true,"states":{"select":{"color":"#EFFFEF","borderColor":"black","dashStyle":"dot"}},"label":{"enabled":true},"dataLabels":{"enabled":true,"style":{"textOutline":"0 contrast","fontFamily":"proximanova_regular-webfont","fontWeight":"bold","fontSize":"14px"},"format":"{point.value}%"}}},"legend":{"align":"center","verticalAlign":"top","itemMarginBottom":10,"x":0,"symbolRadius":2,"enabled":true,"itemStyle":{"fontFamily":"proximanova_regular-webfont","color":"#757575","fontSize":"12px","fontWeight":"bold","fontStyle":"normal","cursor":"pointer","textOverflow":"ellipsis"}},"tooltip":{"pointFormat":"<div><span style=\"font-size: 12px;\">{point.yLabel}: </span><strong style=\"font-size: 12px;\">{point.value}%</strong></div>","headerFormat":"<div><span style=\"font-size: 10px;\">{point.xLabel}</span></div>","footerFormat":"","useHTML":true},"colorAxis":[{"index":0,"stops":[[0,"#cbebc8"],[0.47458116348180396,"#028526"],[1,"#0f4015"]],"max":100,"min":20,"labels":{"format":"{value}%","step":2},"tickInterval":10,"tickAmount":9}],"series":[{"data":[],"turboThreshold":0,"_colorIndex":0,"_symbolIndex":0,"type":"heatmap","borderColor":"#ffffff","borderWidth":1}],"lang":{"shortMonths":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"weekdays":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"months":["January","February","March","April","May","June","July","August","September","October","November","December"],"numericSymbols":["k","M","G","T","P","E"]},"exporting":{"enabled":false,"url":"https://api.everviz.com/export"},"stockTools":{"gui":{"enabled":false}},"navigation":{"bindingsClassName":"tools-container"},"everviz":{"tooltip":{"useEvervizHelper":true}},"responsive":{"rules":[{"condition":{"maxWidth":500},"chartOptions":{"xAxis":{"labels":{"style":{"fontSize":"12px"}}},"yAxis":{"labels":{"style":{"fontSize":"12px"}}},"plotOptions":{"column":{"dataLabels":{"style":{"fontSize":"12px"}}},"series":{"dataLabels":{"style":{"fontSize":"12px"}}}}},"_id":"highcharts-15cddmi-13797"}]},"annotations":[],"xAxis":{"categories":["All adults","Gen Zers & millennials","Gen Xers","Baby boomers"],"opposite":true,"type":"linear","lineWidth":0,"labels":{"format":"{value}","style":{"color":"#2b2b2b","fontFamily":"proximanova_regular-webfont","fontSize":"14px"}}},"yAxis":{"title":{"useHTML":true,"text":""},"index":0,"type":"category","reversed":true,"labels":{"format":"{value}","style":{"fontSize":"14px","color":"#2b2b2b","fontFamily":"proximanova_regular-webfont"}},"categories":["Eating fruits and vegetables","Eating fresh foods","Limiting unhealthy snacks","Lowering heart disease/stroke risk","Limiting unhealthy fats","Limiting processed foods","Limiting certain drinks, like soda or juice","Focusing on portion control","Limiting sodium","Eating intuitively or mindfully","Limiting eating out at restaurants","Cutting out certain food groups","Cutting out alcohol","Counting calories","Eating local foods","Eating organic foods","Intermittent fasting","Going on a diet"]},"data":{"csv":"\"Demo\";\"Behavior\";\"Demo\";\"Behavior\";\"Share\"\n\"All adults\";\"Eating fruits and vegetables\";0;0;91\n\"All adults\";\"Eating fresh foods\";0;1;88\n\"All adults\";\"Limiting unhealthy snacks\";0;2;83\n\"All adults\";\"Lowering heart disease/stroke risk\";0;3;83\n\"All adults\";\"Limiting unhealthy fats\";0;4;82\n\"All adults\";\"Limiting processed foods\";0;5;81\n\"All adults\";\"Limiting certain drinks, like soda or juice\";0;6;81\n\"All adults\";\"Focusing on portion control\";0;7;79\n\"All adults\";\"Limiting sodium\";0;8;76\n\"All adults\";\"Eating intuitively or mindfully\";0;9;75\n\"All adults\";\"Limiting eating out at restaurants\";0;10;67\n\"All adults\";\"Cutting out certain food groups\";0;11;60\n\"All adults\";\"Cutting out alcohol\";0;12;58\n\"All adults\";\"Counting calories\";0;13;56\n\"All adults\";\"Eating local foods\";0;14;46\n\"All adults\";\"Eating organic foods\";0;15;46\n\"All adults\";\"Intermittent fasting\";0;16;37\n\"All adults\";\"Going on a diet\";0;17;28\n\"Gen Zers & millennials\";\"Eating fruits and vegetables\";1;0;88\n\"Gen Zers & millennials\";\"Eating fresh foods\";1;1;86\n\"Gen Zers & millennials\";\"Limiting unhealthy snacks\";1;2;81\n\"Gen Zers & millennials\";\"Lowering heart disease/stroke risk\";1;3;77\n\"Gen Zers & millennials\";\"Limiting unhealthy fats\";1;4;77\n\"Gen Zers & millennials\";\"Limiting processed foods\";1;5;80\n\"Gen Zers & millennials\";\"Limiting certain drinks, like soda or juice\";1;6;80\n\"Gen Zers & millennials\";\"Focusing on portion control\";1;7;78\n\"Gen Zers & millennials\";\"Limiting sodium\";1;8;70\n\"Gen Zers & millennials\";\"Eating intuitively or mindfully\";1;9;76\n\"Gen Zers & millennials\";\"Limiting eating out at restaurants\";1;10;71\n\"Gen Zers & millennials\";\"Cutting out certain food groups\";1;11;61\n\"Gen Zers & millennials\";\"Cutting out alcohol\";1;12;64\n\"Gen Zers & millennials\";\"Counting calories\";1;13;55\n\"Gen Zers & millennials\";\"Eating local foods\";1;14;53\n\"Gen Zers & millennials\";\"Eating organic foods\";1;15;57\n\"Gen Zers & millennials\";\"Intermittent fasting\";1;16;43\n\"Gen Zers & millennials\";\"Going on a diet\";1;17;34\n\"Gen Xers\";\"Eating fruits and vegetables\";2;0;90\n\"Gen Xers\";\"Eating fresh foods\";2;1;88\n\"Gen Xers\";\"Limiting unhealthy snacks\";2;2;82\n\"Gen Xers\";\"Lowering heart disease/stroke risk\";2;3;85\n\"Gen Xers\";\"Limiting unhealthy fats\";2;4;84\n\"Gen Xers\";\"Limiting processed foods\";2;5;81\n\"Gen Xers\";\"Limiting certain drinks, like soda or juice\";2;6;81\n\"Gen Xers\";\"Focusing on portion control\";2;7;78\n\"Gen Xers\";\"Limiting sodium\";2;8;78\n\"Gen Xers\";\"Eating intuitively or mindfully\";2;9;75\n\"Gen Xers\";\"Limiting eating out at restaurants\";2;10;68\n\"Gen Xers\";\"Cutting out certain food groups\";2;11;59\n\"Gen Xers\";\"Cutting out alcohol\";2;12;61\n\"Gen Xers\";\"Counting calories\";2;13;57\n\"Gen Xers\";\"Eating local foods\";2;14;44\n\"Gen Xers\";\"Eating organic foods\";2;15;44\n\"Gen Xers\";\"Intermittent fasting\";2;16;41\n\"Gen Xers\";\"Going on a diet\";2;17;26\n\"Baby boomers\";\"Eating fruits and vegetables\";3;0;94\n\"Baby boomers\";\"Eating fresh foods\";3;1;92\n\"Baby boomers\";\"Limiting unhealthy snacks\";3;2;86\n\"Baby boomers\";\"Lowering heart disease/stroke risk\";3;3;87\n\"Baby boomers\";\"Limiting unhealthy fats\";3;4;85\n\"Baby boomers\";\"Limiting processed foods\";3;5;82\n\"Baby boomers\";\"Limiting certain drinks, like soda or juice\";3;6;82\n\"Baby boomers\";\"Focusing on portion control\";3;7;82\n\"Baby boomers\";\"Limiting sodium\";3;8;80\n\"Baby boomers\";\"Eating intuitively or mindfully\";3;9;75\n\"Baby boomers\";\"Limiting eating out at restaurants\";3;10;61\n\"Baby boomers\";\"Cutting out certain food groups\";3;11;59\n\"Baby boomers\";\"Cutting out alcohol\";3;12;51\n\"Baby boomers\";\"Counting calories\";3;13;58\n\"Baby boomers\";\"Eating local foods\";3;14;41\n\"Baby boomers\";\"Eating organic foods\";3;15;36\n\"Baby boomers\";\"Intermittent fasting\";3;16;29\n\"Baby boomers\";\"Going on a diet\";3;17;21","seriesMapping":[{"xLabel":0,"yLabel":1,"x":2,"y":3,"value":4}]}};
  var optionsStub;
  
  var templateDataSettings = {};

  var pluginCode = {};;

  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') ||
             (loadHighchartsModules && src === 'highcharts.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 allScriptsIncluded(){
    var allScripts = scripts.concat(extraScripts);
    var haveAllScriptsBeenIncluded = true;
    var scriptsToUse = document.getElementsByTagName("script");
    for(var n=0;n<allScripts.length;n++) {
      if (!isScriptAlreadyIncluded(allScripts[n], scriptsToUse)) {
        haveAllScriptsBeenIncluded = false;
        break;
      }
    }
    return haveAllScriptsBeenIncluded;
  }

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

        if (options && options.chart && options.chart.type === 'packedbubble') {
          chartOptions.series.forEach((series) => {
            series.data = series.data.filter((point) => point.value);
          });
        }

        return chartOptions;
      }
    }
    
    optionsStub = window["everviz"].createStub(options);
    window["everviz"].merge(options, pluginCode);
    if ('Chart' === 'Map') window["everviz"].modifyMapType(options);
  }

  function createChart() {
    if(chartCreated) return;

    var hasProj4 = extraScripts.indexOf('https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.6/proj4.js') > -1;

    if (!allScriptsIncluded() || 
      (hasProj4 && !window.proj4) || 
      !window["everviz"].merge ||
      !window["everviz"].createStub) {
      setTimeout(createChart, 200);
      return;
    }  

    modifyOptions();

    if (hasProj4) delayGen = 100;

    if (typeof window['Highcharts'] !== 'undefined') {
      
    if (window['everviz'] && window['everviz'].tooltipFormatter && 
        options.everviz && options.everviz.tooltip){
      if (!options.tooltip) options.tooltip = {};
      options.tooltip.formatter = window['everviz'].tooltipFormatter;
    }


    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];

    
// Sample of extending options:
Highcharts.merge(true, options, {
	responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            // Make the labels less space demanding on mobile
            chartOptions: {
              	xAxis: {
        			labels: {
            			style: {
               				fontSize: '12px'
            			}
        			}
    			},
				yAxis: {
        			labels: {
            			style: {
               				fontSize: '12px'
            			}
        			}
    			},
              	plotOptions: {
                  column: {
                    dataLabels: {
                      style: {
                        fontSize: '12px'
                      }
                    }
                  },
                  series: {
                    dataLabels: {
                      style: {
                        fontSize: '12px'
                      }
                    }
                  }
              	}
            }
        }]
    }
});


      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; 
      setTimeout(function(){
          if (window["everviz"] && window["everviz"].pendingAnim) {
            //TODO: change to using classes instead.
            //Bit of work to do there due to backward compatibility
            const elements = document.querySelectorAll(
              '#' + elementClassName + 
              ', #' + legacyElementClassName
            );
            const elementsArray = Array.prototype.slice.call(elements);
            elementsArray.forEach(function(element, elementIndex) {

              window["everviz"].updateRenderTo(optionsStub, element);
              chart = new Highcharts.Chart(optionsStub);
              

              window["everviz"].pendingAnim({
                id: element.id + '-' + elementIndex, 
                loaded: false,
                options: options,
                appear:function(){
                  window["everviz"].updateRenderTo(options, element);
                  chart = new Highcharts.Chart(options); 

                },
                element: element
              });
            });

          } else {
            const element = document.querySelector('#' + legacyElementClassName);

            if (element) chart = new Highcharts.Chart(legacyElementClassName, options);  
            else chart = new Highcharts.Chart(elementClassName, options);  

            
          }
      }, delayGen);
    }
  }

  function check(scripts, cb) {
    if (loaded === scripts.length) {
      if (cb) {
        cb();
      } else {


        //Create first project
        if (!window.HighchartsCloud.versions ||
           (window.HighchartsCloud.versions && window.HighchartsCloud.versions.length !== window.HighchartsCloud.ondone.length)) {
             
          for (var i = 0; i < window.HighchartsCloud.ondone.length; i++) {
            try {
              window.HighchartsCloud.ondone[i]();
            } catch(e) {
              console.error(e);
            }
          }
        } else {
          if (window.HighchartsCloud.stack.length) {
            window.HighchartsCloud.stack[0]();
            window.HighchartsCloud.stack.shift();
            const shouldRenderNextChart = window.HighchartsCloud.stack.length > 0;
            if (shouldRenderNextChart) {
              window.HighchartsCloud.stack[0](true);
            }
          }
        }
        
      }
    }
  }

  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('http') >= 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(isUsingStack){
    loaded = 0;
    loadCSS();
    if (extraScripts.length > 0) {
      if (isUsingStack) {
        window.HighchartsCloud.stack[0] = createChart;
        loadScript(extraScripts[0], extraScripts);
      }
      else loadScript(extraScripts[0], extraScripts, createChart);
    } else {
      check(extraScripts);
    }
  }

  function getAllScripts(){
    var evervizScripts = [];
    var allScripts = scripts.map(function(script) {
      return 'highcharts/'+ script.replace('highcharts/highcharts.js', 'highcharts.js').replace('.js', '');
    }).concat(
      extraScripts.map(function(script) {
        if (script.indexOf('https://code.highcharts.com/') > -1) {
          return 'highcharts/'+ script.replace('https://code.highcharts.com/', '').replace('.js', '');
        } else if (script.indexOf('https://app.everviz.com/') > -1) {
          evervizScripts.push(script);
          return null;
        } else return script;
      }).filter(function(s) {
        return s !== null;
      })
    );

    allScripts.forEach(function(script) {
      if (window.HighchartsCloud.allScripts)
        window.HighchartsCloud.allScripts[script] = 1
    });

    return {
      allHighchartsScripts: allScripts,
      evervizScripts: evervizScripts
    }
  }

  function loadRequireJSScript(){
    require.config({
      packages: [{
        name: 'highcharts',
        main: 'highcharts'
      }],
      paths: {
        'highcharts': 'https://code.highcharts.com'
      }
    });

    const allScripts = getAllScripts();

    require(
      allScripts.allHighchartsScripts,
      function (Highcharts) {
        //Attach highcharts to the window for use in the everviz scripts
        window.Highcharts = Highcharts;
        if (allScripts && allScripts.evervizScripts.length) {
          require(allScripts.evervizScripts, function(){
            createChart();
            loadCSS();
          })
        } else {
          createChart();
          loadCSS();
        }
      }
    );
  }

  function loadInitialScript(){
    if (window['require'] && typeof require === "function" && typeof require.specified === "function") {
      loadRequireJSScript();
    } else {
      getAllScripts()
      loadScript(scripts[0], scripts, loadExtraScripts);
      loadCSS();
    }
  }

  if (typeof window['HighchartsCloud'] === 'undefined') {
    window.HighchartsCloud = {
      ondone: [createChart],
      stack: [createChart],
      hasWrapped: false,
      hasLoaded: false,
      externalCSS: externalCSS,
      versions: [injectVersion],
      types: ['chart'],
      allScripts: {},
      projectUUIDs: {'uWc3GuuvU': 1},
    };

    loadInitialScript();

  } else {
    if (window.HighchartsCloud.externalCSS) window.HighchartsCloud.externalCSS.push(externalCSS);
    if (!window.HighchartsCloud.hasLoaded) {
      if (!window.HighchartsCloud.projectUUIDs) window.HighchartsCloud.projectUUIDs = {};

      if (!window.HighchartsCloud.projectUUIDs['uWc3GuuvU']) {

        window.HighchartsCloud.projectUUIDs['uWc3GuuvU'] = 1;
        window.HighchartsCloud.ondone.push(loadExtraScriptsAndMakeChart);
        if (window.HighchartsCloud.stack) {
          window.HighchartsCloud.stack.push(loadExtraScriptsAndMakeChart);
          window.HighchartsCloud.versions.push(injectVersion);
          window.HighchartsCloud.types.push('chart');
        }

      }
      if (window['require'] && typeof require === "function" && typeof require.specified === "function") {
        getAllScripts()
        loadRequireJSScript();
      }
    }
    else {
      if (window['require'] && typeof require === "function" && typeof require.specified === "function") {
        loadRequireJSScript();
      } else {
        getAllScripts()
        loadExtraScriptsAndMakeChart();
      }
    }
  }

}());
