!function(e){e("[data-antragsgruen-load-class]").each(function(){var a=e(this).data("antragsgruen-load-class");requirejs([a])}),e("[data-antragsgruen-widget]").each(function(){var a=e(this),t=a.data("antragsgruen-widget");requirejs([t],function(e){var n=t.split("/");new e[n[n.length-1]](a)})}),e(".jsProtectionHint").each(function(){var a=e(this);e('<input type="hidden" name="jsprotection">').attr("value",a.data("value")).appendTo(a.parent()),a.remove()}),bootbox.setLocale(e("html").attr("lang").split("_")[0]),e(document).on("click",".amendmentAjaxTooltip",function(a){var t=e(a.currentTarget);if("0"==t.data("initialized")){t.data("initialized","1");var n="right";t.data("placement")&&(n=t.data("placement")),t.popover({html:!0,trigger:"manual",container:"body",placement:n,template:'<div class="popover popover-amendment-ajax" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',content:function(){var a="pop_"+(new Date).getTime(),n='<div id="'+a+'">Loading...</div>',o=t.data("url");return e.get(o,function(t){e("#"+a).html(t)}),n}})}e(".amendmentAjaxTooltip").not(t).popover("hide"),e(".ajaxAmendment").parents(".popover").remove(),t.popover("toggle")}),e(document).on("click",function(a){var t=e(a.target);t.hasClass("amendmentAjaxTooltip")||t.hasClass("popover")||0!=t.parents(".amendmentAjaxTooltip").length||0!=t.parents(".popover").length||(e(".amendmentAjaxTooltip").popover("hide"),e(".ajaxAmendment").parents(".popover").remove())});var a=function(t){var n="0.";t.find("> li.agendaItem").each(function(){var t=e(this),o=t.data("code"),i="",r=t.find("> ol");if("#"==o){var d=n.split(".");if(d[0].match(/^[a-y]$/i))d[0]=String.fromCharCode(d[0].charCodeAt(0)+1);else{var p=d[0].match(/^(.*[^0-9])?([0-9]*)$/),l=void 0===p[1]?"":p[1],c=parseInt(""==p[2]?"1":p[2]);d[0]=l+ ++c}n=i=d.join(".")}else i=n=o+"";t.find("> div > h3 .code").text(i),r.length>0&&a(r)})};e("ol.motionListAgenda").on("antragsgruen:agenda-change",function(){a(e(this))}).trigger("antragsgruen:agenda-change"),window.__t=function(e,a){return"undefined"==typeof ANTRAGSGRUEN_STRINGS?"@TRANSLATION STRINGS NOT LOADED":void 0===ANTRAGSGRUEN_STRINGS[e]?"@UNKNOWN CATEGORY: "+e:void 0===ANTRAGSGRUEN_STRINGS[e][a]?"@UNKNOWN STRING: "+e+" / "+a:ANTRAGSGRUEN_STRINGS[e][a]}}(jQuery);
//# sourceMappingURL=Antragsgruen.js.map
