text: define(["exports", "require", "../../lit-element/lit-element.js", "../schema-behaviors/schema-behaviors.js", "../simple-modal/lib/simple-modal-handler.js"], function (_exports, _require, _litElement, _schemaBehaviors, _simpleModalHandler) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.MediaImage = void 0;
    _require = babelHelpers.interopRequireWildcard(_require);
  
    function _templateObject11_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n        }\n\n        .caption {\n          padding-bottom: 25px;\n          border-bottom: dashed 2px lightgray;\n          margin-bottom: 25px;\n          line-height: 1.5;\n          font-size: 18px;\n        }\n\n        .caption ::slotted(*) {\n          margin-top: 0;\n        }\n        .caption ::slotted(*:last-child) {\n          margin-bottom: 0;\n        }\n      "]);
  
      _templateObject11_061c3da099b011eb851ed31c596cbbd8 = function _templateObject11_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject10_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral([" <slot id=\"slot\"></slot> "]);
  
      _templateObject10_061c3da099b011eb851ed31c596cbbd8 = function _templateObject10_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject9_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n      <div class=\"caption\">\n        ", "\n      </div>\n    "]);
  
      _templateObject9_061c3da099b011eb851ed31c596cbbd8 = function _templateObject9_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject8_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n        }\n\n        .citation {\n          font-size: 12.8px;\n          font-style: italic;\n          color: #4c4c4c;\n          margin: 15px 0 15px;\n        }\n      "]);
  
      _templateObject8_061c3da099b011eb851ed31c596cbbd8 = function _templateObject8_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject7_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral([" <div class=\"citation\"><slot></slot></div> "]);
  
      _templateObject7_061c3da099b011eb851ed31c596cbbd8 = function _templateObject7_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject6_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n      <div class=\"image-wrap\">\n        <img\n          src=\"", "\"\n          alt=\"", "\"\n          aria-describedby=\"", "\"\n          loading=\"lazy\"\n        />\n      </div>\n    "]);
  
      _templateObject6_061c3da099b011eb851ed31c596cbbd8 = function _templateObject6_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject5_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n        }\n        :host(:hover) {\n          cursor: pointer;\n        }\n        .image-wrap {\n          max-height: 600px;\n          overflow: hidden;\n        }\n        .image-wrap img {\n          width: 100%;\n        }\n        :host([round]) .image-wrap {\n          border-radius: 50%;\n        }\n      "]);
  
      _templateObject5_061c3da099b011eb851ed31c596cbbd8 = function _templateObject5_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
    function _templateObject4_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n            <media-image-caption>\n              <slot name=\"caption\"> ", " </slot>\n            </media-image-caption>\n          "]);
  
      _templateObject4_061c3da099b011eb851ed31c596cbbd8 = function _templateObject4_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject3_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n            <figure-label\n              title=\"", "\"\n              description=\"", "\"\n            ></figure-label>\n          "]);
  
      _templateObject3_061c3da099b011eb851ed31c596cbbd8 = function _templateObject3_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject2_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n      ", "\n      <media-image-image\n        ?round=\"", "\"\n        resource=\"", "-image\"\n        source=\"", "\"\n        modal-title=\"", "\"\n        alt=\"", "\"\n        .described-by=\"", "\"\n        @click=\"", "\"\n      ></media-image-image>\n      <media-image-citation>\n        <slot name=\"citation\"> ", " </slot>\n      </media-image-citation>\n      ", "\n    "]);
  
      _templateObject2_061c3da099b011eb851ed31c596cbbd8 = function _templateObject2_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    function _templateObject_061c3da099b011eb851ed31c596cbbd8() {
      var data = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n          width: auto;\n          margin: auto;\n          max-width: 600px;\n          max-height: 600px;\n          --box-background-color: #f7f6ef;\n        }\n\n        :host([card]) {\n          box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);\n          padding: 20px;\n        }\n\n        :host([box]) {\n          background-color: var(--box-background-color);\n          padding: 20px;\n        }\n\n        @media screen and (min-width: 450px) {\n          :host([size=\"small\"]) {\n            max-width: 50%;\n          }\n        }\n\n        @media screen and (min-width: 650px) {\n          :host([size=\"small\"]) {\n            max-width: 35%;\n          }\n        }\n\n        @media screen and (min-width: 900px) {\n          :host([size=\"small\"]) {\n            max-width: 25%;\n          }\n        }\n\n        :host([offset=\"left\"]) {\n          float: left;\n          margin: var(--media-image-offset-width, 1.5vw);\n          margin-left: calc(-2 * var(--media-image-offset-width, 1.5vw));\n          padding-left: calc(4 * var(--media-image-offset-width, 1.5vw));\n          margin-top: 0;\n          margin-bottom: calc(0.1 * var(--media-image-offset-width, 1.5vw));\n        }\n\n        :host([offset=\"right\"]) {\n          float: right;\n          margin: var(--media-image-offset-width, 1.5vw);\n          margin-right: calc(-2 * var(--media-image-offset-width, 1.5vw));\n          padding-right: calc(4 * var(--media-image-offset-width, 1.5vw));\n          margin-top: 0;\n          margin-bottom: calc(0.1 * var(--media-image-offset-width, 1.5vw));\n        }\n\n        :host([offset=\"wide\"]) {\n          margin: 0 calc(-1 * var(--media-image-offset-wide-width, 3.5vw));\n          max-width: 100vw;\n        }\n\n        :host([offset=\"narrow\"]) {\n          max-width: var(--media-image-offset-narrow-max-width, 500px);\n          margin: auto;\n        }\n      "]);
  
      _templateObject_061c3da099b011eb851ed31c596cbbd8 = function _templateObject_061c3da099b011eb851ed31c596cbbd8() {
        return data;
      };
  
      return data;
    }
  
    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; } }
  
    /**
     * `media-image`
     * `A simple image presentaiton with minor documented options`
     * @demo demo/index.html
     * @element media-image
     */
    var MediaImage = /*#__PURE__*/function (_SchemaBehaviors) {
      babelHelpers.inherits(MediaImage, _SchemaBehaviors);
  
      var _super = _createSuper(MediaImage);
  
      babelHelpers.createClass(MediaImage, null, [{
        key: "styles",
  
        /**
         * LitElement constructable styles enhancement
         */
        get: function get() {
          return [(0, _litElement.css)(_templateObject_061c3da099b011eb851ed31c596cbbd8())];
        }
      }]);
  
      function MediaImage() {
        var _this;
  
        babelHelpers.classCallCheck(this, MediaImage);
        _this = _super.call(this);
        _this.modalTitle = "";
        _this.source = "";
        _this.citation = "";
        _this.caption = "";
        _this.figureLabelTitle = "";
        _this.figureLabelDescription = "";
        _this.alt = "";
        _this.size = "wide";
        _this.round = false;
        _this.card = false;
        _this.box = false;
        _this.offset = "none";
        return _this;
      }
  
      babelHelpers.createClass(MediaImage, [{
        key: "updated",
        value: function updated(changedProperties) {
          var _this2 = this;
  
          changedProperties.forEach(function (oldValue, propName) {
            if (propName == "caption") {
              _this2._computeHasCaption(_this2[propName]);
            }
  
            if (["figureLabelTitle", "figureLabelDescription"].includes(propName)) {
              _this2.__figureLabel = _this2._hasFigureLabel(_this2.figureLabelTitle, _this2.figureLabelDescription);
            }
  
            if (["figureLabelTitle", "caption"].includes(propName)) {
              _this2.modalTitle = _this2.figureLabelTitle ? _this2.figureLabelTitle : _this2.caption;
              _this2.modalTitle += _this2.figureLabelDescription ? " - " + _this2.figureLabelDescription : "";
            }
  
            if (propName == "__figureLabel") {
              if (_this2[propName]) {
                new Promise(function (res, rej) {
                  return _require.default(["../figure-label/figure-label.js"], res, rej);
                });
              }
            }
          });
        }
      }, {
        key: "render",
        value: function render() {
          return (0, _litElement.html)(_templateObject2_061c3da099b011eb851ed31c596cbbd8(), this.__figureLabel ? (0, _litElement.html)(_templateObject3_061c3da099b011eb851ed31c596cbbd8(), this.figureLabelTitle, this.figureLabelDescription) : "", this.round, this.schemaResourceID, this.source, this.modalTitle, this.alt, this.describedBy, this._handleClick, this.citation, this._hasCaption ? (0, _litElement.html)(_templateObject4_061c3da099b011eb851ed31c596cbbd8(), this.caption) : "");
        }
      }, {
        key: "haxHooks",
        value: function haxHooks() {
          return {
            editModeChanged: "haxEditModeChanged",
            activeElementChanged: "haxActiveElementChanged"
          };
        }
      }, {
        key: "_handleClick",
        value: function _handleClick(event) {
          if (this._haxState) {
            event.preventDefault();
            event.stopPropagation();
            event.stopImmediatePropagation();
          }
        }
      }, {
        key: "haxEditModeChanged",
        value: function haxEditModeChanged(value) {
          this._haxState = value;
        }
      }, {
        key: "haxActiveElementChanged",
        value: function haxActiveElementChanged(element, value) {
          if (value) {
            this._haxState = value;
          }
        }
      }, {
        key: "_hasFigureLabel",
        // Observe the name sub-property on the user object
        // if the either of the figure label values are present then display
        // the figure label
        value: function _hasFigureLabel(title, description) {
          return title.length > 0 || description.length > 0;
        }
      }, {
        key: "_computeHasCaption",
        value: function _computeHasCaption() {
          this._hasCaption = this.caption.length > 0 || this.querySelector('[slot="caption"]') !== null;
        }
      }, {
        key: "connectedCallback",
        value: function connectedCallback() {
          var _this3 = this;
  
          babelHelpers.get(babelHelpers.getPrototypeOf(MediaImage.prototype), "connectedCallback", this).call(this);
          this._observer = new MutationObserver(function (mutations) {
            _this3._computeHasCaption();
          });
  
          this._observer.observe(this, {
            childList: true
          });
        }
      }, {
        key: "disconnectedCallback",
        value: function disconnectedCallback() {
          this._observer.disconnect();
  
          babelHelpers.get(babelHelpers.getPrototypeOf(MediaImage.prototype), "disconnectedCallback", this).call(this);
        }
      }], [{
        key: "tag",
        get: function get() {
          return "media-image";
        }
      }, {
        key: "properties",
        get: function get() {
          var _objectSpread2;
  
          return _objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(MediaImage), "properties", this)), {}, (_objectSpread2 = {
            __figureLabel: {
              type: Boolean
            },
            modalTitle: {
              type: String
            },
            _hasCaption: {
              type: Boolean
            },
  
            /**
             * Image source.
             */
            source: {
              type: String
            },
  
            /**
             * Image citation.
             */
            citation: {
              type: String
            },
  
            /**
             * image aria-described by
             */
            describedBy: {
              type: String,
              attribute: "described-by"
            },
  
            /**
             * Image caption.
             */
            caption: {
              type: String
            },
  
            /**
             * Image alt.
             */
            alt: {
              type: String
            },
  
            /**
             * The size of the image (small, wide).
             */
            size: {
              type: String,
              reflect: true
            },
  
            /**
             * The shape of the image (round).
             */
            round: {
              type: Boolean
            },
  
            /**
             * Applies card styling.
             */
            card: {
              type: Boolean,
              reflect: true
            }
          }, babelHelpers.defineProperty(_objectSpread2, "describedBy", {
            type: String,
            attrbute: "described-by"
          }), babelHelpers.defineProperty(_objectSpread2, "box", {
            type: Boolean,
            reflect: true
          }), babelHelpers.defineProperty(_objectSpread2, "offset", {
            type: String,
            reflect: true
          }), babelHelpers.defineProperty(_objectSpread2, "figureLabelTitle", {
            type: String,
            attribute: "figure-label-title"
          }), babelHelpers.defineProperty(_objectSpread2, "figureLabelDescription", {
            type: String,
            attribute: "figure-label-description"
          }), _objectSpread2));
        }
      }, {
        key: "haxProperties",
        get: function get() {
          return {
            canScale: true,
            canPosition: true,
            canEditSource: true,
            gizmo: {
              title: "Styled image",
              descrption: "An image gizmo with the ability to provide simple, consistent styling and accessibility options.",
              icon: "editor:insert-photo",
              color: "indigo",
              groups: ["Image", "Media"],
              handles: [{
                type: "image",
                source: "source",
                title: "alt",
                alt: "alt",
                citation: "citation",
                caption: "caption",
                ariaDescribedby: "describedBy"
              }],
              meta: {
                author: "ELMS:LN"
              }
            },
            settings: {
              configure: [{
                property: "source",
                title: "Source",
                description: "The URL for the image.",
                inputMethod: "haxupload",
                icon: "link",
                required: true
              }, {
                property: "alt",
                title: "Alternative text",
                description: "Text to describe the image to non-sighted users.",
                inputMethod: "alt",
                icon: "accessibility",
                required: true
              }, {
                property: "round",
                title: "Round image",
                description: "Crops the image appearance to be circle in shape.",
                inputMethod: "boolean",
                icon: "account",
                required: false
              }, {
                property: "card",
                title: "Card",
                description: "Apply a drop shadow to give the appearance of being a raised card.",
                inputMethod: "boolean",
                icon: "check-box-outline-blank",
                required: false
              }, {
                property: "box",
                title: "Box",
                description: "Apply a visual box around the image.",
                inputMethod: "boolean",
                icon: "image:crop-square",
                required: false
              }, {
                property: "offset",
                title: "Offset",
                description: "Apply a left or right offset to the image.",
                inputMethod: "select",
                icon: "image:crop-square",
                options: {
                  none: "none",
                  left: "left",
                  right: "right",
                  wide: "wide",
                  narrow: "narrow"
                }
              }, {
                property: "citation",
                title: "Citation",
                description: "Citation for the image.",
                inputMethod: "textfield",
                icon: "text-format",
                required: false
              }, {
                property: "caption",
                title: "Caption",
                description: "Caption for the image.",
                inputMethod: "textfield",
                icon: "text-format",
                required: false
              }, {
                property: "figureLabelTitle",
                title: "Figure Label Title",
                description: "Title for the figure label.",
                inputMethod: "textfield",
                icon: "text-format",
                required: false
              }, {
                property: "figureLabelDescription",
                title: "Figure Label Description",
                description: "Description for the figure label.",
                inputMethod: "textfield",
                icon: "text-format",
                required: false
              }],
              advanced: [{
                property: "describedBy",
                title: "aria-describedby",
                description: "Space-separated list of IDs for elements that describe the image.",
                inputMethod: "textfield"
              }]
            },
            demoSchema: [{
              tag: "media-image",
              properties: {
                source: "http://unsplash.it/600",
                figureLabelTitle: "1.3",
                figureLabelDescription: "This is the description of the figure.",
                citation: "This is my citation."
              }
            }]
          };
        }
      }]);
      return MediaImage;
    }((0, _schemaBehaviors.SchemaBehaviors)(_litElement.LitElement));
  
    _exports.MediaImage = MediaImage;
    window.customElements.define(MediaImage.tag, MediaImage);
    /**
     * `media-image-image`
     * `A simple image presentaiton with minor documented options`
     * @element media-image-image
     */
  
    var MediaImageImage = /*#__PURE__*/function (_SimpleModalHandler) {
      babelHelpers.inherits(MediaImageImage, _SimpleModalHandler);
  
      var _super2 = _createSuper(MediaImageImage);
  
      babelHelpers.createClass(MediaImageImage, null, [{
        key: "styles",
  
        /**
         * LitElement constructable styles enhancement
         */
        get: function get() {
          return [(0, _litElement.css)(_templateObject5_061c3da099b011eb851ed31c596cbbd8())];
        }
      }]);
  
      function MediaImageImage() {
        var _this4;
  
        babelHelpers.classCallCheck(this, MediaImageImage);
        _this4 = _super2.call(this);
        _this4.round = false;
        _this4.modalContent = document.createElement("image-inspector");
        _this4.modalContent.noLeft = true;
        _this4.modalTitle = "";
        setTimeout(function () {
          _this4.addEventListener("simple-modal-show", _this4.__modalShowEvent.bind(babelHelpers.assertThisInitialized(_this4)));
        }, 0);
        return _this4;
      }
      /**
       * Only import the definition if they call up the modal because it's a pretty
       * heavy library tree
       */
  
  
      babelHelpers.createClass(MediaImageImage, [{
        key: "__modalShowEvent",
        value: function __modalShowEvent(e) {
          new Promise(function (res, rej) {
            return _require.default(["../image-inspector/image-inspector.js"], res, rej);
          });
        }
      }, {
        key: "render",
        value: function render() {
          return (0, _litElement.html)(_templateObject6_061c3da099b011eb851ed31c596cbbd8(), this.source, this.alt, this.describedBy || "");
        }
      }, {
        key: "updated",
        value: function updated(changedProperties) {
          var _this5 = this;
  
          changedProperties.forEach(function (oldValue, propName) {
            // ensure pop up matches source url
            if (propName == "source") {
              _this5.modalContent.src = _this5[propName];
            }
          });
        }
      }], [{
        key: "properties",
        get: function get() {
          return {
            source: {
              type: String
            },
            alt: {
              type: String
            },
            describedBy: {
              type: String,
              attribute: "described-by"
            },
            round: {
              type: Boolean,
              reflect: true
            },
            modalTitle: {
              type: String,
              attribute: "modal-title"
            }
          };
        }
      }, {
        key: "tag",
        get: function get() {
          return "media-image-image";
        }
      }]);
      return MediaImageImage;
    }((0, _simpleModalHandler.SimpleModalHandler)(_litElement.LitElement));
  
    window.customElements.define(MediaImageImage.tag, MediaImageImage);
    /**
     * `media-image-citation`
     * `A simple image presentaiton with minor documented options`
     * @demo demo/index.html
     * @element media-image-citation
     */
  
    var MediaImageCitation = /*#__PURE__*/function (_LitElement) {
      babelHelpers.inherits(MediaImageCitation, _LitElement);
  
      var _super3 = _createSuper(MediaImageCitation);
  
      function MediaImageCitation() {
        babelHelpers.classCallCheck(this, MediaImageCitation);
        return _super3.apply(this, arguments);
      }
  
      babelHelpers.createClass(MediaImageCitation, [{
        key: "render",
        value: function render() {
          return (0, _litElement.html)(_templateObject7_061c3da099b011eb851ed31c596cbbd8());
        }
      }], [{
        key: "styles",
  
        /**
         * LitElement constructable styles enhancement
         */
        get: function get() {
          return [(0, _litElement.css)(_templateObject8_061c3da099b011eb851ed31c596cbbd8())];
        }
      }, {
        key: "tag",
        get: function get() {
          return "media-image-citation";
        }
      }]);
      return MediaImageCitation;
    }(_litElement.LitElement);
  
    window.customElements.define(MediaImageCitation.tag, MediaImageCitation);
    /**
     * `media-image-caption`
     * `A simple image presentaiton with minor documented options`
     * @demo demo/index.html
     * @element media-image-caption
     */
  
    var MediaImageCaption = /*#__PURE__*/function (_LitElement2) {
      babelHelpers.inherits(MediaImageCaption, _LitElement2);
  
      var _super4 = _createSuper(MediaImageCaption);
  
      function MediaImageCaption() {
        babelHelpers.classCallCheck(this, MediaImageCaption);
        return _super4.apply(this, arguments);
      }
  
      babelHelpers.createClass(MediaImageCaption, [{
        key: "render",
        value: function render() {
          return (0, _litElement.html)(_templateObject9_061c3da099b011eb851ed31c596cbbd8(), !this.__hasContent ? (0, _litElement.html)(_templateObject10_061c3da099b011eb851ed31c596cbbd8()) : "");
        }
      }], [{
        key: "styles",
  
        /**
         * LitElement constructable styles enhancement
         */
        get: function get() {
          return [(0, _litElement.css)(_templateObject11_061c3da099b011eb851ed31c596cbbd8())];
        }
      }, {
        key: "tag",
        get: function get() {
          return "media-image-caption";
        }
      }]);
      return MediaImageCaption;
    }(_litElement.LitElement);
  
    window.customElements.define(MediaImageCaption.tag, MediaImageCaption);
  });