"use strict";

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _jade_template_fn(locals) {
  locals = locals || {};;;
  var result_of_with = function ($attrs, $helpers, JSON, Object, visibility) {
    var _Object$assign;

    var h = require('panel').h;
    var placement = $attrs["placement"];
    return {
      value: h("div", {
        "hook": {
          // The visibility of the tooltip can change, will change the size of the tooltip. Hence, the tooltip's
          // position should be recomputed when this happens.
          insert: $helpers.handleUpdatedTooltip,
          postpatch: $helpers.handleUpdatedTooltip
        },
        "on": {
          click: $helpers.handleClick
        },
        "class": Object.assign({}, (_Object$assign = {}, _defineProperty(_Object$assign, "mp-sh-tooltip-placement-" + placement, true), _defineProperty(_Object$assign, "mp-sh-tooltip-visibility-" + visibility, true), _Object$assign), {
          'mp-sh-tooltip-container': true
        })
      }, function () {
        var __jade_nodes = [];
        __jade_nodes = __jade_nodes.concat(h("mp-smart-hub-alert-v2", {
          "attrs": {
            'project-id': $attrs["project-id"],
            'utc-offset': $attrs["utc-offset"],
            'display-context': "IN_REPORT",
            'explains-value': $attrs["explains-value"],
            'alert': JSON.stringify($attrs["alert"]),
            'alert-color': $attrs["alert-color"],
            'visible': $helpers.isVisible()
          },
          "on": {
            changedAlert: $helpers.handleChangedAlert
          }
        }));;
        return __jade_nodes;
      }.call(this).filter(Boolean))
    };
  }.call(this, "$attrs" in locals ? locals.$attrs : typeof $attrs !== "undefined" ? $attrs : undefined, "$helpers" in locals ? locals.$helpers : typeof $helpers !== "undefined" ? $helpers : undefined, "JSON" in locals ? locals.JSON : typeof JSON !== "undefined" ? JSON : undefined, "Object" in locals ? locals.Object : typeof Object !== "undefined" ? Object : undefined, "visibility" in locals ? locals.visibility : typeof visibility !== "undefined" ? visibility : undefined);
  if (result_of_with) return result_of_with.value;
}
module.exports = _jade_template_fn;