var IusInfoAlerting=function(){function t(){$("#chbAlertsDisabled").change(function(){var n=$("#chbAlertsDisabled").prop("checked");$.ajax({type:"POST",url:"/Alerting/UpdateAlertMailing/",data:{_bEnable:n},cache:!1,success:function(){$.ajax({dataType:"html",contentType:"application/json; charset=utf-8",type:"GET",url:"/Alerting/SubscriptionsList/",data:{},cache:!1,success:function(n){$("#SubscriptionsList").html(n)}})}})});$(".active-alerting-option").change(function(){var t=$(this).attr("data-id"),i="#ActiveSubscriptionItem_"+t.toString(),r=$(".active-alerting-Value",i).val(),u=$(".active-alerting-Title",i).val(),f=$(".active-alerting-Tooltip",i).val(),e=$(".active-alerting-VirtualDocName",i).val(),o=$(".active-alerting-DefinitionDetail",i).val(),s=$("#chBox1_"+t.toString()).prop("checked"),h=$("#chBox2_"+t.toString()).prop("checked"),c=$("#chBox3_"+t.toString()).prop("checked"),l=$("#chBox4_"+t.toString()).prop("checked"),a=$("#chBox5_"+t.toString()).prop("checked");n(r,u,f,e,o,!0,s,h,c,l,a,!1,!1,"")});$("#SaveSetUserAlert").click(function(){var t="#ActiveSubscriptionItem",i=$(".active-alerting-Value",t).val(),r=$(".active-alerting-Title",t).val(),u=$(".active-alerting-Tooltip",t).val(),f=$(".active-alerting-VirtualDocName",t).val(),e=$(".active-alerting-DefinitionDetail",t).val(),o=$("#chBox1").prop("checked"),s=$("#chBox2").prop("checked"),h=$("#chBox3").prop("checked"),c=$("#chBox4").prop("checked"),l=$("#chBox5").prop("checked");n(i,r,u,f,e,!0,o,s,h,c,l,!0,!1,"")});$("#chBoxAll").change(function(){var n=$("#chBoxAll").prop("checked");n===!0?($("#chBox1").prop("checked",!0),$("#chBox2").prop("checked",!0),$("#chBox3").prop("checked",!0),$("#chBox4").prop("checked",!0),$("#chBox5").prop("checked",!0)):($("#chBox1").prop("checked",!1),$("#chBox2").prop("checked",!1),$("#chBox3").prop("checked",!1),$("#chBox4").prop("checked",!1),$("#chBox5").prop("checked",!1))})}function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v){$.ajax({type:"POST",url:"/Alerting/SetUserAlert/",data:{_sValue:n,_sTitle:t,_sTooltip:i,_sVirtualDocName:r,_sDefinitionDetail:u,_bEnable:f,_bEnableOption1:e,_bEnableOption2:o,_bEnableOption3:s,_bEnableOption4:h,_bEnableOption5:c,_bClipping:a,_sParameterObject:v},cache:!1,success:function(n){if(n.Success==!1){window.location.href="/message/"+n.EventType+"/"+n.Success;return}l===!0?$("#SaveSetUserAlertReturnMessage").text("Nastavitve obveščanja so bile uspešno spremenjene."):a?($(".SearchClippingOnOff").removeClass("li-bell"),$(".SearchClippingOnOff").addClass("li-bell-full"),$("#buSaveClipping").removeAttr("disabled"),$("#diaAddUpdateSearchClipping").dialog("close")):$.ajax({dataType:"html",contentType:"application/json; charset=utf-8",type:"GET",url:"/Alerting/SubscriptionsList/",data:{},cache:!1,success:function(n){$("#SubscriptionsList").html(n)}})}})}function i(n){$(".profile-alerting-calendar").block();var t=n;$.ajax({dataType:"html",type:"GET",url:"/Alerting/Calendar/",data:{_ForDate:t},cache:!1,success:function(n){$(".profile-alerting-calendar").html(n)},complete:function(){$(".profile-alerting-calendar").unblock()}})}function r(){$.ajax({type:"POST",url:"/Alerting/CalendarToday/",cache:!1,success:function(n){n&&n.has_results&&($("#notificationIconImg").attr("src","/Content/Images/obvestila-koledar-danes.svg"),$("#notificationIconImg").css("padding","3px 6px 3px 6px"))}})}function u(n,t,i){confirm("Ali ste prepričani, da želite izbrisati obvestilo?")==!0&&$.ajax({type:"POST",url:"/Alerting/DeleteAlert/",data:{_sValue:n,_sTitle:t,_sVirtualDocName:i},cache:!1,success:function(n){if(n.Success==!1){window.location.href="/message/"+n.EventType+"/"+n.Success;return}$.ajax({dataType:"html",contentType:"application/json; charset=utf-8",type:"GET",url:"/Alerting/SubscriptionsList/",data:{},cache:!1,success:function(n){$("#SubscriptionsList").html(n)}})}})}function f(n,t){$("#ClippingNotificationList").block();let i=!1;i=t=="true"?!1:!0;$.ajax({type:"POST",url:"/Alerting/ToggleEnableUserAlert/",data:{value:n,enabled:i},cache:!1,success:function(n){if(n.Success==!1){window.location.href="/message/"+n.EventType+"/"+n.Success;return}$.ajax({dataType:"html",contentType:"application/json; charset=utf-8",type:"GET",url:"/Alerting/SubscriptionsList/",data:{},cache:!1,success:function(n){$("#SubscriptionsList").html(n);$("#ClippingNotificationList").unblock()}})}})}function e(){$.ajax({dataType:"json",contentType:"application/json; charset=utf-8",type:"POST",url:"/Alerting/GetAdditionalServicesData",cache:!1,async:!0,success:function(n){let i=`Vaš naročniški paket ne vključuje Pravnega posveta.`,r=`Vaš naročniški paket ne vključuje GDPR posveta.`,t=`Vaš naročniški paket ne vključuje kotizacij za dogodke.`;if(n&&n.additionalServices&&n.success&&(i=`Število pravnih posvetov, ki jih še imate na voljo.

Ugodnost lahko izkoristite do: ${n.endDate}`,r=`Število GDPR nasvetov, ki jih še imate na voljo.

Ugodnost lahko izkoristite do: ${n.endDate}`,t=`Število kotizacij za dogodke, ki jih imate na voljo:`,t+=n.additionalServices.IndividualEducation>0?`
Enkratne kotizacije: ${n.additionalServices.IndividualEducation}`:"",t+=n.additionalServices.PermanentEducation>0?`
Permanentne kotizacije (Paket D): ${n.additionalServices.PermanentEducation}`:"",t+=`

Ugodnost lahko izkoristite do: ${n.endDate}`,n.additionalServices.GdprAdvice>0&&($("#gdprIconToken").text(n.additionalServices.GdprAdvice),$("#gdprIconToken").show()),n.additionalServices.LegalAdvice>0&&($("#legalConsultationIconToken").text(n.additionalServices.LegalAdvice),$("#legalConsultationIconToken").show()),n.additionalServices.IndividualEducation>0||n.additionalServices.PermanentEducation>0)){let t=n.additionalServices.IndividualEducation>0?n.additionalServices.IndividualEducation:0,i=n.additionalServices.PermanentEducation>0?n.additionalServices.PermanentEducation:0,r=t+i;$("#workshopsIconToken").text(r);$("#workshopsIconToken").show()}$("#lnkUserGdprIcon").prop("title",r);$("#lnkUserLegalConsultationIcon").prop("title",i);$("#lnkUserWorkshopsIcon").prop("title",t)}})}function o(n){n==""?($(".SearchClippingOnOff").removeClass("li-bell"),$(".SearchClippingOnOff").addClass("li-bell")):n=="0"?($(".SearchClippingOnOff").removeClass("li-bell"),$(".SearchClippingOnOff").addClass("li-bell")):($(".SearchClippingOnOff").removeClass("li-bell"),$(".SearchClippingOnOff").addClass("li-bell-full"))}return{init:function(){t()},changeCalendar:i,deleteAlert:u,toggleClippingActive:f,setUserAlert:n,GetAdditionalServicesData:e,CalendarToday:r,isClipping:o}}()