const $ = require('jquery');
import tippy from 'tippy.js';

class Tooltip{
  constructor(element) {
    $(element).addClass("initiated");
    const tooltip = document.querySelector($(element).data("href"));
    tippy(element, {
      content: $(tooltip).html(),
      allowHTML: true,
      appendTo: 'parent',
    });
  }

}
$('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  $(".ihk-popper-tooltip:not(.initiated)").each(function () {
      new Tooltip($(this));
  });

});
