module.exports = elementorModules.frontend.handlers.Base.extend({
  getDefaultSettings: function getDefaultSettings() {
    return {
      selectors: {
        icon: ".elementor-icon",
        button: '.elementor-button'
      },
    };
  },

  getDefaultElements: function getDefaultElements() {
    var selectors = this.getSettings("selectors");

    return {
      $icon: this.$element.find(selectors.icon),
      $button: this.$element.find(selectors.button),
    };
  },

  hoverAnimations: function hoverAnimations() {
    var hoverAnimation = this.getElementSettings("hover_animation"),
      $icon = this.elements.$icon,
      $button = this.elements.$button;

    // Icon Element
    if (hoverAnimation == 'neuron-animation--playCircle') {
      var $clone = $icon.find('svg, i').clone()
      $icon.append($clone)
    }

    // Button Element
    if (hoverAnimation == 'neuron-animation--iconForward') {
      var $clone = $button.find('.elementor-button-icon svg, .elementor-button-icon i').clone()
      $button.find(".elementor-button-icon").append($clone)
    }
  },

  onInit: function onInit() {
    elementorModules.frontend.handlers.Base.prototype.onInit.apply(
      this,
      arguments
    );

    this.hoverAnimations(); 
  },
});
