text: define(["exports", "../../../lit-element/lit-element.js", "../simple-modal.js"], function (_exports, _litElement, _simpleModal) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.SimpleModalTemplate = void 0;
  
    var _templateObject_b892bea0af6311ebbe560fe9c4727db1, _templateObject2_b892bea0af6311ebbe560fe9c4727db1;
  
    function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; }
  
    function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  
    /**
     * `simple-modal-template`
     * `A simple modal that ensures accessibility and stack order context appropriately`
     * @demo ./demo/template.html
     * @element simple-modal-template
     */
    var SimpleModalTemplate = /*#__PURE__*/function (_LitElement) {
      babelHelpers.inherits(SimpleModalTemplate, _LitElement);
  
      var _super = _createSuper(SimpleModalTemplate);
  
      function SimpleModalTemplate() {
        var _this;
  
        babelHelpers.classCallCheck(this, SimpleModalTemplate);
        _this = _super.call(this);
        _this.title = "";
        _this.modal = window.SimpleModal.requestAvailability();
        return _this;
      } //render function
  
  
      babelHelpers.createClass(SimpleModalTemplate, [{
        key: "render",
        value: //render function
        function render() {
          return (0, _litElement.html)(_templateObject_b892bea0af6311ebbe560fe9c4727db1 || (_templateObject_b892bea0af6311ebbe560fe9c4727db1 = babelHelpers.taggedTemplateLiteral(["\n      <slot name=\"header\"></slot>\n      <slot name=\"content\"></slot>\n      <slot name=\"buttons\"></slot>\n    "])));
        }
        /**
         * sets event listeners for a specified target
         *
         * @param {object} the object that will have the event listener
         * @param {string} the event name
         * @param {boolean} whether the event bubbles (default is true)
         * @param {boolean} whether the event can be canceled (default is true)
         * @returns {object} the modal object
         */
  
      }, {
        key: "associateEvents",
        value: function associateEvents(target) {
          var _this2 = this;
  
          var evt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "click";
          var bubbles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
          var cancelable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
          target.addEventListener(evt, function (e) {
            _this2.openModal(target, bubbles, cancelable);
          });
          return this.modal;
        }
        /**
         * dispatches event to populate and open the simple modal based template values
         *
         * @param {object} the object that will have the event listener
         * @param {boolean} whether the event bubbles (default is true)
         * @param {boolean} whether the event can be canceled (default is true)
         */
  
      }, {
        key: "openModal",
        value: function openModal(target) {
          var bubbles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
          var cancelable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
          var tplStyles = getComputedStyle(this),
              styles = {};
  
          _simpleModal.SimpleModalCssVars.forEach(function (prop) {
            styles[prop] = tplStyles.getPropertyValue(prop); // support mosterously large values
  
            if (prop == "--simple-modal-z-index") {
              styles[prop] = Number(styles[prop]);
            }
          });
  
          var evt = new CustomEvent("simple-modal-show", {
            bubbles: bubbles,
            cancelable: cancelable,
            composed: true,
            detail: {
              id: this.getAttribute("modal-id"),
              elements: {
                header: this._getSlot("header"),
                content: this._getSlot("content"),
                buttons: this._getSlot("buttons"),
                custom: this._getCustom()
              },
              resize: this.resize,
              invokedBy: target,
              modalClass: this.getAttribute("class"),
              styles: styles,
              clone: false,
              mode: this.mode !== null ? this.mode : false,
              title: this.title !== null ? this.title : false
            }
          });
          window.dispatchEvent(evt);
        }
      }, {
        key: "_getCustom",
        value: function _getCustom() {
          var slot = this.querySelectorAll('[slot="custom"]');
          return slot.length == 1 ? slot[0].cloneNode(true) : this._getSlot("custom");
        }
        /**
         * clones content in a named slot
         *
         * @param {string} the name of the slot
         * @returns {object} a clone of the slotted content (or false if there is no slotted content)
         */
  
      }, {
        key: "_getSlot",
        value: function _getSlot(slotName) {
          var slot = this.querySelectorAll('[slot="' + slotName + '"]'); // account for slot passing down from parent element
  
          if (slot && slot[0] && slot[0].tagName == "SLOT") {
            slot = slot[0].assignedNodes({
              flatten: true
            });
          }
  
          var container = document.createElement("div");
          slot.forEach(function (el) {
            container.appendChild(el.cloneNode(true));
          });
          return slot !== null ? container.cloneNode(true) : false;
        }
      }], [{
        key: "styles",
        get:
        /**
         * LitElement constructable styles enhancement
         */
        function get() {
          return [(0, _litElement.css)(_templateObject2_b892bea0af6311ebbe560fe9c4727db1 || (_templateObject2_b892bea0af6311ebbe560fe9c4727db1 = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: none;\n        }\n      "])))];
        }
        /**
         * Store the tag name to make it easier to obtain directly.
         */
  
      }, {
        key: "tag",
        get: function get() {
          return "simple-modal-template";
        }
      }, {
        key: "properties",
        get: function get() {
          return {
            /**
             * the simple-modal
             */
            modal: {
              type: Object
            },
  
            /**
             * the modal title
             */
            title: {
              type: String
            },
  
            /**
             * the modal title
             */
            mode: {
              type: String
            }
          };
        }
      }]);
      return SimpleModalTemplate;
    }(_litElement.LitElement);
  
    _exports.SimpleModalTemplate = SimpleModalTemplate;
    window.customElements.define(SimpleModalTemplate.tag, SimpleModalTemplate);
  });