varLLMS=window.LLMS||{};!function(t){"use strict";LLMS.Achievements={init:function(){if(t(".llms-achievement").length){vare=this;t(function(){e.bind(),e.maybe_open()})}},bind:function(){vare=this;t(".llms-achievement").each(function(){e.create_modal(t(this))}),t(".llms-achievement").on("click",function(){varn=t(this),i="achievement-"+n.attr("data-id"),s=t("#"+i);s.length||e.create_modal(n),s.iziModal("open")})},create_modal:function(e){varn="achievement-"+e.attr("data-id"),i=t("#"+n);i.length||(i=t('<div class="llms-achievement-modal" id="'+n+'" />'),t("body").append(i)),i.iziModal({headerColor:"#3a3a3a",group:"achievements",history:!0,loop:!0,overlayColor:"rgba( 0, 0, 0, 0.6 )",transitionIn:"fadeInDown",transitionOut:"fadeOutDown",width:340,onOpening:function(t){t.setTitle(e.find(".llms-achievement-title").html()),t.setSubtitle(e.find(".llms-achievement-date").html()),t.setContent('<div class="llms-achievement">'+e.html()+"</div>")},onClosing:function(){window.history.pushState("",document.title,window.location.pathname+window.location.search)}})},maybe_open:function(){vare=window.location.hash;e&&-1!==e.indexOf("achievement-")&&t('a[href="'+e+'"]').first().trigger("click")}},LLMS.Ajax={url:window.ajaxurl||window.llms.ajaxurl,type:"post",data:[],cache:!1,dataType:"json",async:!0,response:[],init:function(e){if(null===e||"object"!=typeofe)return!1;e.url="url"ine?e.url:this.url,e.type="type"ine?e.type:this.type,e.data="data"ine?e.data:this.data,e.cache="cache"ine?e.cache:this.cache,e.dataType="dataType"ine?e.dataType:this.dataType,e.async="async"ine?e.async:this.async,e.data._ajax_nonce=window.llms.ajax_nonce||wp_ajax_data.nonce;varn=LLMS.Rest,i=n.get_query_vars();returne.data.post_id="post"ini?i.post:null,!e.data.post_id&&t("input#post_ID").length&&(e.data.post_id=t("input#post_ID").val()),e},call:function(t){vare=this.init(t);return!!e&&(this.request(e),this)},request:function(e){returnt.ajax(e),this}},LLMS.Donut=function(e){functionn(e){this.settings=t.extend({element:e.element,percent:100},e),this.circle=this.settings.element.find("path"),this.settings.stroke_width=parseInt(this.circle.css("stroke-width")),this.radius=(parseInt(this.settings.element.css("width"))-this.settings.stroke_width)/2,this.angle=t("body").hasClass("rtl")?82.5:97.5,this.i=Math.round(.75*this.settings.percent),this.first=!0,this.increment=t("body").hasClass("rtl")?-5:5,this.animate=function(){this.timer=setInterval(this.loop.bind(this),10)},this.loop=function(){this.angle+=this.increment,this.angle%=360;vart,e=this.angle/180*Math.PI,n=this.radius+this.settings.stroke_width/2+Math.cos(e)*this.radius,i=this.radius+this.settings.stroke_width/2+Math.sin(e)*this.radius;this.first===!0?(t=this.circle.attr("d")+" M "+n+" "+i,this.first=!1):t=this.circle.attr("d")+" L "+n+" "+i,this.circle.attr("d",t),this.i--,this.i<=0&&clearInterval(this.timer)}}functioni(t){vare='<path d="M100,100" />';t.append('<svg preserveAspectRatio="xMidYMid" xmlns:xlink="http://www.w3.org/1999/xlink">'+e+"</svg>");vari=newn({element:t,percent:t.attr("data-perc")});i.animate()}i(e)},LLMS.Forms={address_info:{},$cities:null,$countries:null,$states:null,$states_holder:null,init:function(){if(!t("body").hasClass("wp-admin")||t("body").hasClass("profile-php")||t("body").hasClass("user-edit-php")){vare=this;e.bind_matching_fields(),e.bind_voucher_field(),e.bind_edit_account(),e.bind_l10n_selects()}},bind_edit_account:function(){t("form.llms-person-form.edit-account").length&&t(".llms-toggle-fields").on("click",this.handle_toggle_click)},bind_l10n_selects:function(){vare=this;if(e.$cities=t("#llms_billing_city"),e.$countries=t(".llms-l10n-country-select select"),e.$states=t(".llms-l10n-state-select select"),e.$zips=t("#llms_billing_zip"),e.$countries.length){varn=function(){returnvoid0!==t.fn.llmsSelect2};LLMS.wait_for(n,function(){e.$states.length&&e.prep_state_field(),e.$countries.add(e.$states).llmsSelect2({width:"100%"}),window.llms.address_info&&(e.address_info=JSON.parse(window.llms.address_info)),e.$countries.on("change",function(){varn=t(this).val();e.update_locale_info(n)}).trigger("change")},"llmsSelect2")}},bind_matching_fields:function(){vare=t("input[data-match]").not('[type="password"]');e.each(function(){vare,n=t(this),i=t("#"+n.attr("data-match"));i.length&&(e=n.closest(".llms-form-field").add(i.closest(".llms-form-field")),n.on("input change",function(){vart=n.val(),s=i.val();t&&s&&t!==s?e.addClass("invalid"):e.removeClass("invalid")}))})},bind_voucher_field:function(){t("#llms-voucher-toggle").on("click",function(e){e.preventDefault(),t("#llms_voucher").toggle()})},get_field_parent:function(t){vare=t.closest(".wp-block-column");returne.length?e:t.closest(".llms-form-field")},get_label_text:function(t){vare=t.clone();returne.find("*").remove(),e.text().trim()},handle_toggle_click:function(e){e.preventDefault();varn=t(this),i=t(t(this).attr("data-fields")),s=n.attr("data-is-showing")||"no",o="yes"===s?"hide":"show",a="yes"===s?"disabled":null,l="yes"===s?"data-change-text":"data-cancel-text";i.each(function(){t(this).closest(".llms-form-field")[o](),t(this).attr("disabled",a)}),n.text(n.attr(l)),n.attr("data-is-showing","yes"===s?"no":"yes")},prep_state_field:function(){vare=this.$states.closest(".llms-form-field");this.$holder=t('<select disabled style="display:none !important;" />'),this.$holder.appendTo(e),this.$states.find("optgroup").appendTo(this.$holder)},update_label:function(t,e){varn=this.get_field_parent(t).find("label"),i=n.find(".llms-required").clone();n.html(e),n.append(i)},update_locale_info:function(t){if(this.address_info&&this.address_info[t]){vare=this.address_info[t];this.update_state_options(t),this.update_label(this.$states,e.state),this.update_locale_info_for_field(this.$cities,e.city),this.update_locale_info_for_field(this.$zips,e.postcode)}},update_locale_info_for_field:function(t,e){e?(this.update_label(t,e),this.enable_field(t)):this.disable_field(t)},update_state_options:function(t){if(this.$states.length){vare=this.$holder.find('optgroup[data-key="'+t+'"] option').clone();e.length?(this.enable_field(this.$states),this.$states.html(e)):(this.$states.html("<option> </option>"),this.disable_field(this.$states))}},disable_field:function(e){t("<input>",{name:e.attr("name"),"class":e.attr("class")+" hidden",type:"hidden"}).insertAfter(e),e.attr("disabled","disabled"),this.get_field_parent(e).hide()},enable_field:function(t){t.removeAttr("disabled"),t.next(".hidden[name="+t.attr("name")+"]").detach(),this.get_field_parent(t).show()}},LLMS.Instructors={init:function(){vare=this;t("body").hasClass("wp-admin")||t(".llms-instructors").length&&LLMS.wait_for_matchHeight(function(){e.bind()})},bind:function(){t(".llms-instructors .llms-author").matchHeight()}},LLMS.l10n=LLMS.l10n||{},LLMS.l10n.translate=function(t){vare=this;returne.strings[t]?e.strings[t]:t},LLMS.l10n.replace=function(e,n){vari=this.translate(e);returnt.each(n,function(t,e){-1!==t.indexOf("s")?e=e.toString():-1!==t.indexOf("d")&&(e=1*e),i=i.replace(t,e)}),i},LLMS.LessonPreview={$els:null,init:function(){vare=this;this.$locked=t('a[href="#llms-lesson-locked"]'),this.$locked.length&&e.bind(),t(".llms-course-navigation").length&&LLMS.wait_for_matchHeight(function(){e.match_height()})},bind:function(){vare=this;this.$locked.on("click",function(){return!1}),this.$locked.on("mouseenter",function(){varn=t(this).find(".llms-tooltip");if(!n.length){vari=t(this).attr("data-tooltip-msg");i||(i=LLMS.l10n.translate("You do not have permission to access this content")),n=e.get_tooltip(i),t(this).append(n)}setTimeout(function(){n.addClass("show")},10)}),this.$locked.on("mouseleave",function(){vare=t(this).find(".llms-tooltip");e.removeClass("show")})},match_height:function(){t(".llms-course-navigation .llms-lesson-link").matchHeight()},get_tooltip:function(e){varn=t('<div class="llms-tooltip" />');returnn.append('<div class="llms-tooltip-content">'+e+"</div>"),n}},LLMS.Loops={init:function(){vare=this;t(".llms-loop").length&&LLMS.wait_for_matchHeight(function(){e.match_height()})},match_height:function(){t(".llms-loop-item .llms-loop-item-content").matchHeight(),t(".llms-achievement-loop-item .llms-achievement").matchHeight(),t(".llms-certificate-loop-item .llms-certificate").matchHeight()}},LLMS.OutlineCollapse={$outlines:null,init:function(){this.$outlines=t(".llms-widget-syllabus--collapsible"),this.$outlines.length&&this.bind()},bind:function(){vare=this;this.$outlines.each(function(){varn=t(this),i=n.find(".llms-section .section-header");i.on("click",function(n){n.preventDefault();vari=t(this),s=i.closest(".llms-section"),o=e.get_section_state(s);switch(o){case"closed":e.open_section(s);break;case"opened":e.close_section(s)}}),n.find(".llms-collapse-toggle").on("click",function(n){n.preventDefault();vars=t(this),o=s.attr("data-action"),a="close"===o?"opened":"closed";i.each(function(){varn=t(this).closest(".llms-section"),i=e.get_section_state(n);if(a!==i)return!0;switch(i){case"closed":e.close_section(n);break;case"opened":e.open_section(n)}t(this).trigger("click")})})})},close_section:function(t){t.removeClass("llms-section--opened").addClass("llms-section--closed")},open_section:function(t){t.removeClass("llms-section--closed").addClass("llms-section--opened")},get_section_state:function(t){returnt.hasClass("llms-section--opened")?"opened":"closed"}},t.extend(LLMS.PasswordStrength,{$meter:t(".llms-password-strength-meter"),$pass:null,$conf:null,$form:null,init:function(){if(!t("body").hasClass("wp-admin")&&this.setup_references()){vare=this;LLMS.wait_for(function(){return"undefined"!=typeofwp&&"undefined"!=typeofwp.passwordStrength},function(){e.bind(),e.$form.trigger("llms-password-strength-ready")})}},bind:function(){vart=this;this.$form.hasClass("llms-checkout")||t.$form.on("submit",t,t.submit),t.$pass.add(t.$conf).on("keyup",function(){t.check_strength()})},check_strength:function(){vart=this.$pass.closest(".llms-form-field"),e=this.$conf&&this.$conf.length?this.$conf.closest(".llms-form-field"):null,n=this.$pass.val().length,i=this.$conf&&this.$conf.length?this.$conf.val().length:0;returnn||i?(this.get_current_strength_status()?(t.removeClass("invalid").addClass("valid"),i&&e.removeClass("invalid").addClass("valid")):(t.removeClass("valid").addClass("invalid"),i&&e.removeClass("valid").addClass("invalid")),this.$meter.removeClass("too-short very-weak weak medium strong mismatch"),this.$meter.show().addClass(this.get_current_strength("slug")),voidthis.$meter.html(this.get_current_strength("text"))):(t.removeClass("valid invalid"),e&&e.removeClass("valid invalid"),voidthis.$meter.hide())},checkout:function(t,e){e(t.get_current_strength_status()?!0:LLMS.l10n.translate("There is an issue with your chosen password."))},get_blocklist:function(){vare=wp.passwordStrength.userInputDisallowedList().concat(this.get_setting("blocklist",[]));returnthis.$form.find('input[type="text"], input[type="email"], input[type="tel"], input[type="number"]').each(function(){varn=t(this).val();n&&e.push(n)}),e},get_current_strength:function(t){t=t||"int";vare,n=this.$pass.val(),i=this.$conf&&this.$conf.length?this.$conf.val():"";returnn.length<this.get_setting("min_length",6)?e=-1:(e=wp.passwordStrength.meter(n,this.get_blocklist(),i),0===e&&(e=1)),"slug"===t?this.get_strength_slug(e):"text"===t?this.get_strength_text(e):e},get_current_strength_status:function(){vart=this.get_current_strength(),e=this.get_strength_value(this.get_minimum_strength());return5!==t&&t>=e},get_minimum_strength:function(){returnthis.get_setting("min_strength","strong")},get_setting:function(t,e){varn=this.get_settings();returnn[t]?n[t]:e},get_strength_slug:function(t){vare={"-1":"too-short",1:"very-weak",2:"weak",3:"medium",4:"strong",5:"mismatch"};returne[t]?e[t]:e[5]},get_strength_text:function(t){vare={"-1":LLMS.l10n.translate("Too Short"),1:LLMS.l10n.translate("Very Weak"),2:LLMS.l10n.translate("Weak"),3:LLMS.l10n.translate("Medium"),4:LLMS.l10n.translate("Strong"),5:LLMS.l10n.translate("Mismatch")};returne[t]?e[t]:e[5]},get_strength_value:function(t){vare={"too-short":-1,"very-weak":1,weak:2,medium:3,strong:4,mismatch:5};returne[t]?e[t]:e.mismatch},setup_references:function(){return!!this.$meter.length&&(this.$form=this.$meter.closest("form"),this.$pass=this.$form.find("input#password"),this.$pass.length&&this.$pass.attr("data-match")&&(this.$conf=this.$form.find("#"+this.$pass.attr("data-match"))),this.$pass.length>0)},submit:function(e){varn=e.data;e.preventDefault(),n.$pass.trigger("keyup"),n.get_current_strength_status()||n.$form.hasClass("edit-account")&&"disabled"===n.$pass.attr("disabled")?(n.$form.off("submit",n.submit),n.$form.trigger("submit")):(t("html, body").animate({scrollTop:n.$meter.offset().top-100},200),n.$meter.hide(),setTimeout(function(){n.$meter.fadeIn(400)},220))},get_blacklist:function(){returnconsole.log("Method `get_blacklist()` is deprecated in favor of `get_blocklist()`."),this.get_blacklist()}}),LLMS.Pricing_Tables={init:function(){vare=this;t("body").hasClass("wp-admin")||t(".llms-access-plans").length&&(LLMS.wait_for_matchHeight(function(){e.bind()}),this.$locked=t('a[href="#llms-plan-locked"]'),this.$locked.length&&LLMS.wait_for_popover(function(){e.bind_locked()}))},bind:function(){t(".llms-access-plan-content").matchHeight(),t(".llms-access-plan-pricing.trial").matchHeight()},bind_locked:function(){this.$locked.each(function(){t(this).webuiPopover({animation:"pop",closeable:!0,content:function(e){varn=t('<div class="llms-members-only-restrictions" />');returnn.append(e.$element.closest(".llms-access-plan").find(".llms-access-plan-restrictions ul").clone()),n},placement:"top",style:"inverse",title:LLMS.l10n.translate("Members Only Pricing"),width:"280px"})})}},LLMS.Review={init:function(){this.bind()},bind:function(){t("#llms_review_submit_button").click(function(){""!==t("#review_title").val()&&""!==t("#review_text").val()?jQuery.ajax({type:"post",dataType:"json",url:window.llms.ajaxurl,data:{action:"LLMSSubmitReview",review_title:t("#review_title").val(),review_text:t("#review_text").val(),pageID:t("#post_ID").val()},success:function(){console.log("Review success"),t("#review_box").hide("swing"),t("#thank_you_box").show("swing")},error:function(t,e,n){console.log(t),console.log(e),console.log(n)}}):(""===t("#review_title").val()?t("#review_title_error").show("swing"):t("#review_title_error").hide("swing"),""===t("#review_text").val()?t("#review_text_error").show("swing"):t("#review_text_error").hide("swing"))}),t("#_llms_display_reviews").attr("checked")?(t(".llms-num-reviews-top").addClass("top"),t(".llms-num-reviews-bottom").show()):t(".llms-num-reviews-bottom").hide(),t("#_llms_display_reviews").change(function(){t("#_llms_display_reviews").attr("checked")?(t(".llms-num-reviews-top").addClass("top"),t(".llms-num-reviews-bottom").show()):(t(".llms-num-reviews-top").removeClass("top"),t(".llms-num-reviews-bottom").hide())})}},LLMS.Spinner={get:function(e,n){vari=e.find(".llms-spinning").first();returni.length||(n=n?n:"default",i=t('<div class="llms-spinning"><i class="llms-spinner '+n+'"></i></div>'),e.append(i)),i},start:function(e,n){vari=this;e.each(function(){i.get(t(this),n).show()})},stop:function(e){varn=this;e.each(function(){n.get(t(this)).hide()})}},function(t){vare;if("function"==typeofdefine&&define.amd&&(define(t),e=!0),"object"==typeofexports&&(module.exports=t(),e=!0),!e){varn=window.Cookies,i=window.Cookies=t();i.noConflict=function(){returnwindow.Cookies=n,i}}}(function(){functiont(){for(vart=0,e={};t<arguments.length;t++){varn=arguments[t];for(variinn)e[i]=n[i]}returne}functione(t){returnt.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}functionn(i){functions(){}functiono(e,n,o){if("undefined"!=typeofdocument){o=t({path:"/"},s.defaults,o),"number"==typeofo.expires&&(o.expires=newDate(1*newDate+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{vara=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(l){}n=i.write?i.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);varr="";for(varcino)o[c]&&(r+="; "+c,o[c]!==!0&&(r+="="+o[c].split(";")[0]));returndocument.cookie=e+"="+n+r}}functiona(t,n){if("undefined"!=typeofdocument){for(vars={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){varl=o[a].split("="),r=l.slice(1).join("=");n||'"'!==r.charAt(0)||(r=r.slice(1,-1));try{varc=e(l[0]);if(r=(i.read||i)(r,c)||e(r),n)try{r=JSON.parse(r)}catch(h){}if(s[c]=r,t===c)break}catch(h){}}returnt?s[t]:s}}returns.set=o,s.get=function(t){returna(t,!1)},s.getJSON=function(t){returna(t,!0)},s.remove=function(e,n){o(e,"",t(n,{expires:-1}))},s.defaults={},s.withConverter=n,s}returnn(function(){})}),LLMS.CookieStore=Cookies.noConflict(),LLMS.Storage=function(t){vare=this,n=LLMS.CookieStore;this.clearAll=function(){n.remove(t)},this.clear=function(i){vars=e.getAll();returndeletes[i],n.set(t,s)},this.getAll=function(){returnn.getJSON(t)||{}},this.get=function(t,n){vari=e.getAll();returni[t]?i[t]:n},this.set=function(i,s){varo=e.getAll();returno[i]=s,n.set(t,o,{sameSite:"strict"})}},LLMS.StudentDashboard={screen:"",init:function(){t(".llms-student-dashboard").length&&(this.bind(),"orders"===this.get_screen()&&this.bind_orders())},bind:function(){t(".llms-donut").each(function(){LLMS.Donut(t(this))})},bind_orders:function(){t("#llms-cancel-subscription-form").on("submit",this.order_cancel_warning),t("#llms_update_payment_method").on("click",function(){t('input[name="llms_payment_gateway"]:checked').trigger("change"),t(this).closest("form").find(".llms-switch-payment-source-main").slideToggle("200")})},get_screen:function(){returnthis.screen||(this.screen=t(".llms-student-dashboard").attr("data-current")),this.screen},order_cancel_warning:function(e){e.preventDefault();varn=LLMS.l10n.translate("Are you sure you want to cancel your subscription?");window.confirm(LLMS.l10n.translate(n))&&(t(this).off("submit",this.order_cancel_warning),t(this).submit())}},LLMS.Tracking=function(e){functionn(){e.nonce&&l.set("nonce",e.nonce),a.addEvent("page.load"),window.addEventListener("beforeunload",i),window.addEventListener("unload",s),document.addEventListener("visibilitychange",o)}functioni(t){document.removeEventListener("visibilitychange",o)}functions(t){a.addEvent("page.exit")}functiono(t){vare=document.hidden?"page.blur":"page.focus";a.addEvent(e)}e=e||{};vara=this,l=newLLMS.Storage("llms-tracking");e="string"==typeofe?JSON.parse(e):e,this.addEvent=function(t,n){if(n=n||{},"string"==typeoft&&(n.event=t),e.events&&-1!==e.events.indexOf(n.event)){l.set("nonce",e.nonce),t=a.makeEventObj(n);vari=l.get("events",[]);if(i.push(t),l.set("events",i),i.length>l.get("events",[]).length){vars=l.getAll();l.clear("events"),s.events.push(t),LLMS.Ajax.call({data:{action:"persist_tracking_events","llms-tracking":JSON.stringify(s)},error:function(t,e,n){console.log(t,e,n)},success:function(t){"error"===t.code&&console.log(t.code,t.message)}})}}},this.getSettings=function(){returne},this.makeEventObj=function(e){returnt.extend(e,{url:window.location.href,time:Math.round((newDate).getTime()/1e3)})},t("body").hasClass("wp-admin")||n()},llms.tracking=newLLMS.Tracking(llms.tracking),LLMS.Rest={init:function(){this.bind()},bind:function(){},is_path:function(t){for(vare=!1,n=window.location.href,i=0;i<t.length;i++)n.search(t[i])>0&&!e&&(e=!0);returne},get_query_vars:function(){for(vart,e=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<n.length;i++)t=n[i].split("="),e.push(t[0]),e[t[0]]=t[1];returne}},LLMS.init=function(){for(vartinLLMS)"object"==typeofLLMS[t]&&null!==LLMS[t]&&void0!==LLMS[t].init&&"function"==typeofLLMS[t].init&&LLMS[t].init()},LLMS.is_touch_device=function(){vart=" -webkit- -moz- -o- -ms- ".split(" "),e=function(t){returnwindow.matchMedia(t).matches};if("ontouchstart"inwindow||window.DocumentTouch&&documentinstanceofDocumentTouch)return!0;varn=["(",t.join("touch-enabled),("),"heartz",")"].join("");returne(n)},LLMS.wait_for_matchHeight=function(e){this.wait_for(function(){returnvoid0!==t.fn.matchHeight},e,"matchHeight")},LLMS.wait_for_popover=function(e){this.wait_for(function(){returnvoid0!==t.fn.webuiPopover},e,"webuiPopover")},LLMS.wait_for=function(t,e,n){vari,s=0;n=n?n:"unnamed",i=setInterval(function(){if(s>=300)console.log("Unable to load dependency: "+n);else{if(!t())returnvoids++;e()}clearInterval(i)},100)},LLMS.init(t)}(jQuery);//# sourceMappingURL=../maps/js/llms.min.js.map