text: define(["exports", "../../lit/index.js"], function (_exports, _index) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.RandomImage = void 0;
  
    var _templateObject_34b53a80012611ec9676957c409166bc, _templateObject2_34b53a80012611ec9676957c409166bc;
  
    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; } }
  
    /**
    `random-image`
    Element to show random image from a given group.
    
    * @demo demo/index.html
    */
    var RandomImage = /*#__PURE__*/function (_LitElement) {
      babelHelpers.inherits(RandomImage, _LitElement);
  
      var _super = _createSuper(RandomImage);
  
      function RandomImage() {
        var _this;
  
        babelHelpers.classCallCheck(this, RandomImage);
        _this = _super.call(this);
        _this.mode = "";
        _this.imagesList = [];
        return _this;
      }
  
      babelHelpers.createClass(RandomImage, [{
        key: "render",
        value: function render() {
          return (0, _index.html)(_templateObject_34b53a80012611ec9676957c409166bc || (_templateObject_34b53a80012611ec9676957c409166bc = babelHelpers.taggedTemplateLiteral(["\n      <img\n        style=\"width:200px; height:200px;\"\n        class=\"", "\"\n        loading=\"lazy\"\n        src=\"", "\"\n        title=\"", "\"\n      />\n    "])), this.mode, this._imgSrc, this._imgTitle);
        }
      }, {
        key: "_pickRandomProperty",
        value: function _pickRandomProperty(obj) {
          var result;
          var count = 0;
  
          for (var prop in obj) {
            if (Math.random() < 1 / ++count) result = prop;
          }
  
          return result;
        }
      }, {
        key: "updated",
        value: function updated(changedProperties) {
          var _this2 = this;
  
          changedProperties.forEach(function (oldValue, propName) {
            if (propName == "imagesList") {
              var randomPos = _this2._pickRandomProperty(_this2.imagesList);
  
              _this2._imgSrc = _this2.imagesList[randomPos].path;
              _this2._imgTitle = _this2.imagesList[randomPos].title;
            }
  
            var notifiedProps = ["imagesList", "mode"];
  
            if (notifiedProps.includes(propName)) {
              // notify
              var eventName = "".concat(propName.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), "-changed");
  
              _this2.dispatchEvent(new CustomEvent(eventName, {
                detail: {
                  value: _this2[propName]
                }
              }));
            }
          });
        }
      }], [{
        key: "styles",
        get:
        /**
         * LitElement constructable styles enhancement
         */
        function get() {
          return [(0, _index.css)(_templateObject2_34b53a80012611ec9676957c409166bc || (_templateObject2_34b53a80012611ec9676957c409166bc = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n        }\n        .is-circle {\n          border: 1px solid grey;\n          border-radius: 50%;\n          box-shadow: 0px 5px 10px #ccc;\n        }\n      "])))];
        }
      }, {
        key: "tag",
        get: function get() {
          return "random-image";
        }
      }, {
        key: "properties",
        get: function get() {
          return {
            mode: {
              type: String
            },
            _imgSrc: {
              type: String
            },
            _imgTitle: {
              type: String
            },
            imagesList: {
              type: Array,
              attribute: "images-list"
            }
          };
        }
      }]);
      return RandomImage;
    }(_index.LitElement);
  
    _exports.RandomImage = RandomImage;
    window.customElements.define(RandomImage.tag, RandomImage);
  });