!function(j){"use strict";Drupal.behaviors.addDefinitions={attach:function(i,o){var t=100,e=100,n="termlookup-js-tooltip-hover termlookup-js-tooltip-locked";function s(){j("a.termlookup-js-tooltip").off(".mobile").on("click.desktop",function(){var o;"true"!==this.getAttribute("data-popup-lock")&&j(o=this).find("span.termlookup-js-custom",i).fadeOut(0,function(){k(o)})}).on("mouseleave.desktop",function(){"true"!==this.getAttribute("data-popup-lock")&&v(this)}).on("click.desktop",function(){!function(o){j(o).find("span.termlookup-js-custom",i).is(":visible")||k(o);"true"!==o.getAttribute("data-popup-lock")?(h(),(t=o).className=n,t.setAttribute("data-popup-lock","true"),t.style.zIndex=++e):(f(o),h());var t}(this)})}function a(){j("a.termlookup-js-tooltip").off(".desktop").on("click.mobile",function(o){o.preventDefault(),function(o){j(".definition-modal").length||j("body").append(j('<div class="definition-modal hidden" />')).append(j('<div class="modal-overlay"/>'));var t=o.find(".termlookup-js-custom").html(),i=j(".definition-modal"),e=j(".modal-overlay");i.html(t),i.addClass("is-active"),e.addClass("is-active")}(j(this))}),j("body").on("click.mobile",".definition-modal",function(){m()})}j("span.termlookup-custom",i).each(function(){this.className="termlookup-js-custom",this.parentNode.className="termlookup-js-tooltip"});var l,u,c,p,d=function(){j(window).width()<800?a():(s(),m())},r=(l=function(){d()},u=250,function(){var o=this,t=arguments,i=c&&!p;clearTimeout(p),p=setTimeout(function(){p=null,c||l.apply(o,t)},u),i&&l.apply(o,t)});function m(){var o=j(".definition-modal"),t=j(".modal-overlay");o.removeClass("is-active"),t.removeClass("is-active")}function f(o){j(o).removeAttr("data-popup-lock"),v(o)}function k(o){o.className="termlookup-js-tooltip-hover",o.style.zIndex=++e,j(o).find("span.termlookup-js-custom").fadeIn(t)}function v(o){j(o).find("span.termlookup-js-custom",i).fadeOut(t,function(){o.className="termlookup-js-tooltip"})}function h(){f(j("a.termlookup-js-tooltip-locked",i))}window.addEventListener("resize",r),d()}}}(jQuery);