'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var decal = require('../util/decal.js');

function decalVisual(ecModel, api) {
  ecModel.eachRawSeries(function (seriesModel) {
    if (ecModel.isSeriesFiltered(seriesModel)) {
      return;
    }
    var data = seriesModel.getData();
    if (data.hasItemVisual()) {
      data.each(function (idx) {
        var decal$1 = data.getItemVisual(idx, 'decal');
        if (decal$1) {
          var itemStyle = data.ensureUniqueItemVisual(idx, 'style');
          itemStyle.decal = decal.createOrUpdatePatternFromDecal(decal$1, api);
        }
      });
    }
    var decal$1 = data.getVisual('decal');
    if (decal$1) {
      var style = data.getVisual('style');
      style.decal = decal.createOrUpdatePatternFromDecal(decal$1, api);
    }
  });
}

exports.default = decalVisual;
