text: define(["exports", "../simple-modal.js"], function (_exports, _simpleModal) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.SimpleModalHandler = void 0;
  
    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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  
    /**
     * SuperClass to add in accessible clicking capabilities to anything
     * to pop passed in items up via...
     * @var {string} this.modalTitle - title to display in modal
     * @var {object} this.modalContent - HTML element to display as content
     */
    var SimpleModalHandler = function SimpleModalHandler(SuperClass) {
      return /*#__PURE__*/function (_SuperClass) {
        babelHelpers.inherits(_class, _SuperClass);
  
        var _super = _createSuper(_class);
  
        babelHelpers.createClass(_class, [{
          key: "connectedCallback",
          value: function connectedCallback() {
            babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "connectedCallback", this).call(this);
            this.setAttribute("tabindex", "0");
          }
        }]);
  
        function _class() {
          var _this;
  
          babelHelpers.classCallCheck(this, _class);
          _this = _super.call(this);
          setTimeout(function () {
            window.SimpleModal.requestAvailability();
  
            _this.addEventListener("click", _this.__SimpleModalHandlerClick.bind(babelHelpers.assertThisInitialized(_this)));
  
            _this.addEventListener("keypress", _this._keyPress.bind(babelHelpers.assertThisInitialized(_this)));
          }, 0);
          return _this;
        }
        /**
         * A11y because we are delegating keyboard function to hit the link when enter pressed
         */
  
  
        babelHelpers.createClass(_class, [{
          key: "_keyPress",
          value: function _keyPress(e) {
            switch (e.key) {
              case "Enter":
                // simulate click to go to whatever link / action it has
                this.click();
                break;
            }
          }
          /**
           * Click callback
           */
  
        }, {
          key: "__SimpleModalHandlerClick",
          value: function __SimpleModalHandlerClick(e) {
            // fire event
            var evt = new CustomEvent("simple-modal-show", {
              bubbles: true,
              cancelable: true,
              composed: true,
              detail: {
                title: this.modalTitle,
                elements: {
                  content: this.modalContent
                },
                styles: {
                  "--simple-modal-min-width": "50vw",
                  "--simple-modal-min-height": "50vh"
                },
                invokedBy: this,
                clone: false
              }
            });
            this.dispatchEvent(evt);
          }
        }]);
        return _class;
      }(SuperClass);
    };
  
    _exports.SimpleModalHandler = SimpleModalHandler;
  });