'use strict';require('./es.object.values-c87c60cb.js'),require('./es.array.join-821b566c.js'),require('./es.array.map-8db08687.js'),require('./es.object.keys-f43d926a.js'),require('./es.array.concat-2f004403.js'),require('lazysizes');var normalizeComponent=require('./normalize-component-ebe0c011.js');require('./well-known-symbol-08f3111a.js'),require('./object-keys-5cf8040b.js'),require('./array-method-is-strict-46936434.js'),require('./array-iteration-7afe833b.js'),require('./function-bind-context-e4685306.js'),require('./array-species-create-447f37c0.js'),require('./array-method-has-species-support-9fe8fcbb.js'),require('./create-property-8fd8ad81.js');/**
 * Component to render an image and optional lazy-loading
 */

var script = {
  name: 'BaseImage',
  props: {
    /**
     * set alt attribute
     */
    alt: {
      type: String,
      default: ''
    },

    /**
     * specify lazy image loading
     */
    lazyload: {
      type: Boolean,
      default: false
    },

    /**
     * set src attribute
     */
    src: {
      type: String,
      default: ''
    },

    /**
     * set srcSet attribute<br>
     * structure: [
     *   {
     *     '640w': 'path'
     *   },
     * ]
     */
    srcset: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  computed: {
    clearPng: function clearPng() {
      return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8//t3PQAJbAN2AyakNQAAAABJRU5ErkJggg==';
    },
    source: function source() {
      var last = this.srcset.length - 1;
      return this.srcset[last] ? Object.values(this.srcset[last])[0] : this.src;
    },
    sourceSet: function sourceSet() {
      return this.srcset.length ? this.srcset.map(function (size) {
        return Object.keys(size).map(function (width) {
          return "".concat(size[width], " ").concat(width);
        });
      }).join(', ') : null;
    }
  },
  methods: {
    emitError: function emitError(event) {
      this.$emit('error', event);
    }
  }
};/* script */
var __vue_script__ = script;
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('img', {
    class: ['base-image', {
      'lazyload': _vm.lazyload
    }],
    attrs: {
      "alt": _vm.alt,
      "data-src": _vm.lazyload ? _vm.source : null,
      "data-srcset": _vm.lazyload ? _vm.sourceSet : null,
      "src": _vm.lazyload ? _vm.clearPng : _vm.source,
      "srcset": _vm.lazyload ? null : _vm.sourceSet
    },
    on: {
      "error": _vm.emitError
    }
  }, []);
};

var __vue_staticRenderFns__ = [];
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = "data-v-8d7112ca";
/* module identifier */

var __vue_module_identifier__ = "data-v-8d7112ca";
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

/* style inject shadow dom */

var __vue_component__ = /*#__PURE__*/normalizeComponent.n({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);

var BaseImage = __vue_component__;exports["default"]=BaseImage;