$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip(),$('[data-toggle="popover"]').popover({trigger:"hover"}),$(".tabbed-carousel__nav a").click(function(){$(this).parent().find(".js-is-active").removeClass("js-is-active"),$(this).addClass("js-is-active");var e=$(this).index();return $(this).parent().parent().find(".tab_content").hide(),$(this).parent().parent().find(".tab_content").eq(e).show(),!1}),$("#faqs li h3").click(function(){$(this).parent().hasClass("active")?$(this).parent().removeClass("active"):($("#faqs li").removeClass("active"),$(this).parent().addClass("active"))}),$(".theme_wrap a").click(function(){var e=$(this).find("img").attr("src");return $("#screenshotModal").modal("show"),$("#screenshotModal img").attr("src",e),!1}),$(".read_more_btn").click(function(){var e=$("html, body"),n=$("#header").height()-50;e.stop().animate({scrollTop:n},500,"swing",function(){})}),$(".show_section").click(function(){var e=$(this).attr("id");return $(".section_info").hide(),$(".section_info#"+e).fadeIn(),!1}),$(".mark_as_completed").click(function(){var e=$(this).data("unit");let n=$(this).parent();var a=$(this).closest("div div");let i=$("[close-on-completed]");var o="",t=document.getElementById("display_next");$.ajax({url:window.location.origin+"/engine/inc/online_learning_ajax.php",data:"action=mark_unit_as_complete&unit_id="+e,dataType:"json",success:function(e){for(var s in e){var c=e[s];o=(o="

"+completedtext+"

").replace("{{date}}",c[0])}$(a).html(o),n.removeClass("col-md-4").addClass("col-md-8"),i.css({display:"none"}),t.style.display=""},error:function(e){console.log(e)}})}),$("#lms-notes-img").click(function(){$(".notes_icons").trigger("click")}),$(".notes_icons, .close_notes").click(function(){$("#side_notes").toggleClass("active"),$("#side_notes .content").animate({scrollTop:$("#side_notes .content").prop("scrollHeight")},500)}),$(".feedback_icons").click(function(){$("#side_feedback").toggleClass("active"),$("#side_feedback .content").animate({scrollTop:$("#side_feedback .content").prop("scrollHeight")},500)}),$(".delete_note").click(function(){if(!confirm("Are you sure you wish to 'Delete this note'?"))return!1;note_id=$(this).attr("id"),$.ajax({url:window.location.origin+"/online-learning/includes/ajax.php",data:"action=delete_note¬e_id="+note_id,type:"POST",success:function(e){$(".note_"+note_id+"_wrap").fadeOut()}})}),$(".edit_note").click(function(){note=$(this).attr("description"),note_id=$(this).attr("id"),unit_id=$(this).data("unit_id"),$(".note_description").val(note),$(".note_id").val(note_id),$(".unit_id").val(unit_id)}),$("#note_form").submit(function(){var e=$(".note_description").val();return note_id=$(".note_id").val(),unit_id=$(".unit_id").val(),$.ajax({url:window.location.origin+"/online-learning/includes/ajax.php",data:"action=submit_note¬e_id="+note_id+"¬e="+e+"&unit_id="+unit_id,dataType:"json",type:"POST",success:function(e){$(".note_description").val(""),$(".note_id").val(""),e.edit?$(".note_"+note_id+"_wrap").replaceWith(e.html):$("#notes_ul").append(e.html),$(".unit_id").val($(".current_unit_id").val()),$("#side_notes .content").animate({scrollTop:$("#side_notes .content").prop("scrollHeight")},500),$("#feedback_notes .content").animate({scrollTop:$("#feedback_notes .content").prop("scrollHeight")},500)}}),!1}),$("#feedback_form").submit(function(){var e=$(".feedback_description").val();return feedback_id=$(".feedback_id").val(),unit_id=$(".unit_id").val(),$.ajax({url:window.location.origin+"/online-learning/includes/ajax.php",data:"action=submit_feedback&feedback_id="+feedback_id+"&feedback="+e+"&unit_id="+unit_id,dataType:"json",type:"POST",success:function(e){$(".feedback_description").val(""),$(".feedback_id").val(""),e.edit?$(".feedback_"+note_id+"_wrap").replaceWith(e.html):$("#feedback_ul").append(e.html),$(".unit_id").val($(".current_unit_id").val()),$("#side_feedback .content").animate({scrollTop:$("#side_feedback .content").prop("scrollHeight")},500)}}),!1}),$(".check_access_plan_code_form").submit(function(){var e=$(this).find($("#access_plan_code_field")).val(),n=$(this).find($("#must_log_in")).val();return e&&($("#access_plan_modal").modal("show"),$.ajax({url:window.location.origin+"/online-learning/includes/ajax.php",data:"action=check_access_plan_code&must_log_in="+n+"&code="+e,dataType:"json",success:function(e){$("#access_plan_modal").modal("hide"),e.success&&"coupon"!=e.success?"no"==e.must_log_in?($("#verified_access_plan_modal").modal("show"),e.plan.access_plan_language&&""!=e.plan.access_plan_language?window.location=window.location.origin+"/online-learning/register_new/?plan="+e.plan.username_id+"&lang="+e.plan.access_plan_language:window.location=window.location.origin+"/online-learning/register_new/?plan="+e.plan.username_id):$("#must_register_or_login_modal").modal("show"):"coupon"==e.success?$("#invalid_access_plan_maybe_coupon_modal").modal("show"):$("#invalid_access_plan_modal").modal("show")}})),!1}),$(".check_access_plan_code_from_courses_form").submit(function(){var e=$(this).find($(".access_plan_code_field")).val(),n=$(this).find($(".must_log_in")).val(),a=$(this).find($(".course_id")).val();return e&&($("#access_plan_modal").modal("show"),$.ajax({url:window.location.origin+"/online-learning/includes/ajax.php",data:"action=check_access_plan_code&must_log_in="+n+"&code="+e+"&check_course="+a,dataType:"json",success:function(e){$("#access_plan_modal").modal("hide"),e.success&&"coupon"!=e.success&&"invalid_course"!=e.success?"no"==e.must_log_in?($("#verified_access_plan_modal").modal("show"),e.plan.access_plan_language&&""!=e.plan.access_plan_language?window.location=window.location.origin+"/online-learning/register_new/?plan="+e.plan.username_id+"&lang="+e.plan.access_plan_language:window.location=window.location.origin+"/online-learning/register_new/?plan="+e.plan.username_id):$("#must_register_or_login_modal").modal("show"):"coupon"==e.success?$("#invalid_access_plan_maybe_coupon_modal").modal("show"):"invalid_course"==e.success?$("#valid_access_plan_invalid_course_modal").modal("show"):$("#invalid_access_plan_modal").modal("show")}})),!1}),$(".apply_coupon").click(function(){var e=$(this).data("plan"),n=$("#coupon_code").val();$.ajax({url:window.location.origin+"/engine/inc/online_learning_ajax.php",data:"action=apply_coupon&plan_id="+e+"&coupon_code="+n,dataType:"json",success:function(e){var n="";for(var a in e)e.discount_amount,e.amount_to_pay,n=e.message;"Coupon applied successfully"==n?location.reload(!0):($("#coupon_error").html(n),$("#coupon_error").fadeIn("slow"),$("#coupon_error").delay(1e4).fadeOut("slow"))}})});var e,n=document.getElementsByClassName("module_accordion");for(e=0;e