(e=>{"function"==typeof define&&define.amd?define("checklistLimit",e):e()})(function(){jQuery(function(l){l("ul.c27-term-checklist[data-selection-limit]").each(function(){var t,i,n,e=l(this),c=parseInt(e.data("selection-limit"),10);c&&(t=e.find('input[type="checkbox"]'),i=l(t.map(function(){var e=l(this).closest("li.c27-term");return e.length||(e=l(this).closest("div.md-checkbox")).length?e.get(0):this}).get()),n=function(){var e=t.filter(":checked").length;i.toggleClass("disabled-term",c<=e)},t.on("change",function(){var e=t.filter(":checked").length;c<e?(this.checked=!1,window.alert(CASE27.l10n.terms_limit.replace("%s",c))):n()}),n())})})});
