"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, Object, mainStyles, visibility, wrapperStyles) {
    var h = require('panel').h;
    return {
      value: h("div", {
        "style": Object.assign({
          // It's necessary to set the width on the wrapper to be max-width so that the .mp-tooltip-main element has
          // enough width available from the parent to grow up to the max-width.
          'width': $attrs["max-width"]
        }, wrapperStyles),
        "on": {
          click: $helpers.stopPropagation,
          mousedown: $helpers.stopPropagation
        },
        "class": Object.assign({}, {
          'mp-tooltip-hidden': visibility === 'hidden',
          'mp-tooltip-transitioning': visibility === 'transitioning'
        }, {
          'mp-tooltip-wrapper': true
        })
      }, function () {
        var _Object$assign;

        var __jade_nodes = [];
        __jade_nodes = __jade_nodes.concat(h("div", {
          "style": Object.assign({
            'max-width': $attrs["max-width"]
          }, mainStyles),
          "class": Object.assign({}, (_Object$assign = {}, _defineProperty(_Object$assign, "mp-tooltip-placement-" + $attrs["placement"], true), _defineProperty(_Object$assign, "mp-tooltip-type-" + $helpers.getType(), true), _Object$assign), { 'mp-tooltip-main': true }) }, function () {
          var __jade_nodes = [];__jade_nodes = __jade_nodes.concat(h("slot"));__jade_nodes = __jade_nodes.concat(!$attrs["hide-arrow"] ? function () {
            var __jade_nodes = [];__jade_nodes = __jade_nodes.concat(h("div", { "class": { 'mp-tooltip-arrow': true } }));;return __jade_nodes;
          }.call(this) : undefined);;return __jade_nodes;
        }.call(this).filter(Boolean)));;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, "Object" in locals ? locals.Object : typeof Object !== "undefined" ? Object : undefined, "mainStyles" in locals ? locals.mainStyles : typeof mainStyles !== "undefined" ? mainStyles : undefined, "visibility" in locals ? locals.visibility : typeof visibility !== "undefined" ? visibility : undefined, "wrapperStyles" in locals ? locals.wrapperStyles : typeof wrapperStyles !== "undefined" ? wrapperStyles : undefined);if (result_of_with) return result_of_with.value;
}
module.exports = _jade_template_fn;