(function(a){window.GdprCheckbox=function(){var n=this,p=function(g,l){var b=a(g).data("formselector");if(b){var c=a(b);c.length||(c=a(g).parents("form"))}else c=a(g).parents("form");if(l&&!c.length&&b)try{window.self!==window.top&&(c=a(b,window.parent.document))}catch(d){}return c};this.dispatch=function(){"undefined"!==typeof gdprDynamicCheckboxArray&&(gdprDynamicCheckboxArray=JSON.parse(gdprDynamicCheckboxArray));if(a.isArray(gdprDynamicCheckboxArray)){var g=[],l=gdpr_livesite+"index.php?option=com_gdpr&task=user.getCheckbox&format=json";
a.each(gdprDynamicCheckboxArray,function(b,c){g[b]=a.Deferred(function(b){var f=a('*:contains("'+c+'"):last:not(script)',"body");if(f.length){var d={checkbox_placeholder:c,url:a(location).attr("href").replace("?tmpl=component","")};a.ajax({type:"POST",url:l,data:d,dataType:"json"}).done(function(e,d,g){if(e){var k=e.checked?" checked":"",r=e.checked?"":" checked",l=e.checked?" checked":"",m=gdprDynamicCheckboxControlsClass?' class="'+gdprDynamicCheckboxControlsClassList+'"':"";d=parseInt(e.required)?
"<span>&nbsp;*</span>":"";k=gdprPrivacyPolicyDynamicControl?'<input data-formselector="'+e.formselector+'" data-role="gdpr_dynamic_privacy_policy_checkbox" type="checkbox"'+k+' data-placeholder="'+c+'" value="1" data-required="'+e.required+'" aria-required="'+!!e.required+'"'+m+"/>":'<input style="margin:0;padding:0" type="radio" value="0"'+r+' id="'+c+'_noaccept" name="'+c+'" data-formselector="'+e.formselector+'" data-role="gdpr_dynamic_privacy_policy_checkbox" data-placeholder="'+c+'" data-required="'+
e.required+'" aria-required="'+!!e.required+'"'+m+'><label for="'+c+'_noaccept" style="margin:0 15px 0 5px;display:inline-block">'+COM_GDPR_DYNAMIC_PRIVACY_POLICY_NOACCEPT+'</label><input style="margin:0;padding:0" type="radio" value="1"'+l+' id="'+c+'_accept" name="'+c+'" data-formselector="'+e.formselector+'" data-role="gdpr_dynamic_privacy_policy_checkbox" data-placeholder="'+c+'" data-required="'+e.required+'" aria-required="'+!!e.required+'"'+m+'><label for="'+c+'_accept" style="margin:0 0 0 5px;display:inline-block">'+
COM_GDPR_DYNAMIC_PRIVACY_POLICY_ACCEPT+"</label>";d=gdprPrivacyPolicyDynamicCheckboxLabelTemplate.replace("{label}",'<a data-role="gdpr_dynamic_privacy_policy_checkbox" data-placeholder="'+c+'" href="javascript:void(0);" target="_blank"><label>'+e.name+d+"</label></a>");k=gdprPrivacyPolicyDynamicCheckboxCheckboxTemplate.replace("{checkbox}",k);if("right"==gdprDynamicCheckboxOrder)var h=d+k;else"left"==gdprDynamicCheckboxOrder&&(h=k+d);h=gdprPrivacyPolicyDynamicCheckboxContainerTemplate.replace("{field}",
h);e.allowed||(h="");parseInt(e.published)||(h="");GdprCheckbox.disabledByLaw&&(h="");d=a(f).html();d=d.replace(c,h);a(f).html(d)}b.resolve(e,g.status)})}else b.resolve()}).promise()});a.when.apply(a,g).then(function(){a("a[data-role=gdpr_dynamic_privacy_policy_checkbox]").on("click",function(a){n.lastClickedDynamicCheckbox=jQuery(this).attr("data-placeholder")});a("a[data-role=gdpr_dynamic_privacy_policy_checkbox]").gdprfancybox({type:"ajax",iframe:{css:{width:gdprDynamicFancyboxWidth,height:gdprDynamicFancyboxHeight}},
buttons:["close"],beforeLoad:function(a){var c=a.$lastFocus.attr("data-placeholder");c||0!=jQuery("div.fancybox-content").length||(c=n.lastClickedDynamicCheckbox);if(!c||jQuery("div.fancybox-content").length)return a.close(),a.current.src=null,setTimeout(function(){jQuery("div.fancybox-loading").remove();jQuery("div.fancybox-is-closing").hide()},0),!1;a.current.src=gdpr_livesite+"index.php?option=com_gdpr&task=user.getCheckboxDescription&format=raw&checkbox_placeholder="+c},afterLoad:function(b){b=
a("div.fancybox-toolbar").clone(!0).end().remove();a("div.fancybox-content").prepend(b);a("div.fancybox-content").addClass("fancybox-30")},lang:"all",i18n:{all:{CLOSE:gdprDynamicFancyboxCloseText}}});a("input[data-role=gdpr_dynamic_privacy_policy_checkbox]").on("change",function(b){var c={url:a(location).attr("href").replace("?tmpl=component",""),formid:a(this).data("placeholder"),formfields:{}};a(this).is(":checked")&&0<parseInt(a(this).val())?(b=p(this,!0),b.length&&(b=a("input[type=text]:not(:hidden), input[type=email], input[type=search], textarea",
b),b.length&&a.each(b,function(d,b){(d=a(b).attr("id"))||(d=a(b).attr("name"));d&&(d=d.replace(/[-_]/gi," "),d=d.replace(/[\[\]]/gi,""),d=d.replace("jform",""),d=d.trim(),b=a(b).val(),c.formfields[d]=b)})),a.ajax({type:"POST",url:gdpr_livesite+"index.php?option=com_gdpr&task=user.storeConsent&format=raw",data:c})):a.ajax({type:"POST",url:gdpr_livesite+"index.php?option=com_gdpr&task=user.deleteConsent&format=raw",data:c})});a("input[data-role=gdpr_dynamic_privacy_policy_checkbox][value=1]").each(function(b,
c){b=a(this).data("required");var d=a(this).data("placeholder"),f=p(this,!1);if(b&&f.length){if(gdprDynamicRemoveSubmitButtonEvents&&(b=a(gdprDynamicCheckboxCustomSubmissionMethodSelector,f),b.length)){var g=b.clone(!1);b.after(g);b.remove()}gdprDynamicCheckboxRemoveAttributes&&(a(gdprDynamicCheckboxCustomSubmissionMethodSelector,f).removeAttr("onclick"),a(f).removeAttr("onsubmit"),gdprDynamicForceSubmitButton&&!a("input[type=submit],button[type=submit]",f).length&&a("button[type=button],input[type=button]",
f).last().attr("type","submit"));var e=function(b){try{if(typeof ff_validate_submit===typeof Function){a(".bfErrorMessage").html("").css("display","none");var c=ff_validation(0);c?bfShowErrors(c):a(this).is(":checked")&&ff_validate_submit(this,"click")}}catch(q){}try{if("object"===typeof Onepage&&typeof Onepage.validateFormOnePage===typeof Function&&a(this).is(":checked"))return a("#adminForm").attr("id","opcform"),Onepage.validateFormOnePage(jqEvent,a("#confirmbtn").get(0),!0)}catch(q){}try{if(typeof submitacymailingform===
typeof Function&&a(this).is(":checked")){var d=a("div.acymailing_module form").attr("id");if(d==a(f).attr("id"))return submitacymailingform("optin",d)}}catch(q){}if(a(this).is(":checked"))return a("a[data-role=gdpr_dynamic_privacy_policy_checkbox][data-placeholder='"+b+"']").removeAttr("style"),a("label.privacy_policy_required[data-placeholder='"+b+"']").remove(),!0;a("label.privacy_policy_required[data-placeholder='"+b+"']").remove();(a(this).next("label").length?a(this).next("label"):a(this)).after('<label class="privacy_policy_required" data-placeholder="'+
b+'" style="color:#F00;display:inline-block;margin-left:5px">'+gdprDynamicCheckboxRequiredText+"</label>");a("a[data-role=gdpr_dynamic_privacy_policy_checkbox][data-placeholder='"+b+"']").css({color:"#F00","font-weight":"bold"});return!1};a("input[type=submit],button[type=submit]",f).on("click",function(a){return e.apply(c,[d])});a(f).on("submit",function(a){return e.apply(c,[d])})}})})}}};window.GdprCheckbox.disabledByLaw=!1;a(function(){(new GdprCheckbox).dispatch()})})(jQuery);
