var LLMS=window.LLMS||{};!function(t){"use strict";LLMS.Achievements={init:function(){if(t(".llms-achievement").length){var e=this;t(function(){e.bind(),e.maybe_open()})}},bind:function(){var e=this;t(".llms-achievement").each(function(){e.create_modal(t(this))}),t(".llms-achievement").on("click",function(){var n=t(this),i="achievement-"+n.attr("data-id"),s=t("#"+i);s.length||e.create_modal(n),s.iziModal("open")})},create_modal:function(e){var n="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(){var e=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"!=typeof e)return!1;e.url="url"in e?e.url:this.url,e.type="type"in e?e.type:this.type,e.data="data"in e?e.data:this.data,e.cache="cache"in e?e.cache:this.cache,e.dataType="dataType"in e?e.dataType:this.dataType,e.async="async"in e?e.async:this.async,e.data._ajax_nonce=window.llms.ajax_nonce||wp_ajax_data.nonce;var n=LLMS.Rest,i=n.get_query_vars();return e.data.post_id="post"in i?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){var e=this.init(t);return!!e&&(this.request(e),this)},request:function(e){return t.ajax(e),this}},LLMS.Donut=function(e){function n(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;var t,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)}}function i(t){var e='<path d="M100,100" />';t.append('<svg preserveAspectRatio="xMidYMid" xmlns:xlink="http://www.w3.org/1999/xlink">'+e+"</svg>");var i=new n({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")){var e=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(){var e=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){var n=function(){return void 0!==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(){var n=t(this).val();e.update_locale_info(n)}).trigger("change")},"llmsSelect2")}},bind_matching_fields:function(){var e=t("input[data-match]").not('[type="password"]');e.each(function(){var e,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(){var t=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){var e=t.closest(".wp-block-column");return e.length?e:t.closest(".llms-form-field")},get_label_text:function(t){var e=t.clone();return e.find("*").remove(),e.text().trim()},handle_toggle_click:function(e){e.preventDefault();var n=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(){var e=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){var n=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]){var e=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){var e=this.$holder.find('optgroup[data-key="'+t+'"] option').clone();e.length?(this.enable_field(this.$states),this.$states.html(e)):(this.$states.html("<option>&nbsp</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(){var e=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){var e=this;return e.strings[t]?e.strings[t]:t},LLMS.l10n.replace=function(e,n){var i=this.translate(e);return t.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(){var e=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(){var e=this;this.$locked.on("click",function(){return!1}),this.$locked.on("mouseenter",function(){var n=t(this).find(".llms-tooltip");if(!n.length){var i=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(){var e=t(this).find(".llms-tooltip");e.removeClass("show")})},match_height:function(){t(".llms-course-navigation .llms-lesson-link").matchHeight()},get_tooltip:function(e){var n=t('<div class="llms-tooltip" />');return n.append('<div class="llms-tooltip-content">'+e+"</div>"),n}},LLMS.Loops={init:function(){var e=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(){var e=this;this.$outlines.each(function(){var n=t(this),i=n.find(".llms-section .section-header");i.on("click",function(n){n.preventDefault();var i=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();var s=t(this),o=s.attr("data-action"),a="close"===o?"opened":"closed";i.each(function(){var n=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){return t.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()){var e=this;LLMS.wait_for(function(){return"undefined"!=typeof wp&&"undefined"!=typeof wp.passwordStrength},function(){e.bind(),e.$form.trigger("llms-password-strength-ready")})}},bind:function(){var t=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(){var t=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;return n||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")),void this.$meter.html(this.get_current_strength("text"))):(t.removeClass("valid invalid"),e&&e.removeClass("valid invalid"),void this.$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(){var e=wp.passwordStrength.userInputDisallowedList().concat(this.get_setting("blocklist",[]));return this.$form.find('input[type="text"], input[type="email"], input[type="tel"], input[type="number"]').each(function(){var n=t(this).val();n&&e.push(n)}),e},get_current_strength:function(t){t=t||"int";var e,n=this.$pass.val(),i=this.$conf&&this.$conf.length?this.$conf.val():"";return n.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(){var t=this.get_current_strength(),e=this.get_strength_value(this.get_minimum_strength());return 5!==t&&t>=e},get_minimum_strength:function(){return this.get_setting("min_strength","strong")},get_setting:function(t,e){var n=this.get_settings();return n[t]?n[t]:e},get_strength_slug:function(t){var e={"-1":"too-short",1:"very-weak",2:"weak",3:"medium",4:"strong",5:"mismatch"};return e[t]?e[t]:e[5]},get_strength_text:function(t){var e={"-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")};return e[t]?e[t]:e[5]},get_strength_value:function(t){var e={"too-short":-1,"very-weak":1,weak:2,medium:3,strong:4,mismatch:5};return e[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){var n=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(){return console.log("Method `get_blacklist()` is deprecated in favor of `get_blocklist()`."),this.get_blacklist()}}),LLMS.Pricing_Tables={init:function(){var e=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){var n=t('<div class="llms-members-only-restrictions" />');return n.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){var i=e.find(".llms-spinning").first();return i.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){var i=this;e.each(function(){i.get(t(this),n).show()})},stop:function(e){var n=this;e.each(function(){n.get(t(this)).hide()})}},function(t){var e;if("function"==typeof define&&define.amd&&(define(t),e=!0),"object"==typeof exports&&(module.exports=t(),e=!0),!e){var n=window.Cookies,i=window.Cookies=t();i.noConflict=function(){return window.Cookies=n,i}}}(function(){function t(){for(var t=0,e={};t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(i){function s(){}function o(e,n,o){if("undefined"!=typeof document){o=t({path:"/"},s.defaults,o),"number"==typeof o.expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=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);var r="";for(var c in o)o[c]&&(r+="; "+c,o[c]!==!0&&(r+="="+o[c].split(";")[0]));return document.cookie=e+"="+n+r}}function a(t,n){if("undefined"!=typeof document){for(var s={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var l=o[a].split("="),r=l.slice(1).join("=");n||'"'!==r.charAt(0)||(r=r.slice(1,-1));try{var c=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){}}return t?s[t]:s}}return s.set=o,s.get=function(t){return a(t,!1)},s.getJSON=function(t){return a(t,!0)},s.remove=function(e,n){o(e,"",t(n,{expires:-1}))},s.defaults={},s.withConverter=n,s}return n(function(){})}),LLMS.CookieStore=Cookies.noConflict(),LLMS.Storage=function(t){var e=this,n=LLMS.CookieStore;this.clearAll=function(){n.remove(t)},this.clear=function(i){var s=e.getAll();return delete s[i],n.set(t,s)},this.getAll=function(){return n.getJSON(t)||{}},this.get=function(t,n){var i=e.getAll();return i[t]?i[t]:n},this.set=function(i,s){var o=e.getAll();return o[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(){return this.screen||(this.screen=t(".llms-student-dashboard").attr("data-current")),this.screen},order_cancel_warning:function(e){e.preventDefault();var n=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){function n(){e.nonce&&l.set("nonce",e.nonce),a.addEvent("page.load"),window.addEventListener("beforeunload",i),window.addEventListener("unload",s),document.addEventListener("visibilitychange",o)}function i(t){document.removeEventListener("visibilitychange",o)}function s(t){a.addEvent("page.exit")}function o(t){var e=document.hidden?"page.blur":"page.focus";a.addEvent(e)}e=e||{};var a=this,l=new LLMS.Storage("llms-tracking");e="string"==typeof e?JSON.parse(e):e,this.addEvent=function(t,n){if(n=n||{},"string"==typeof t&&(n.event=t),e.events&&-1!==e.events.indexOf(n.event)){l.set("nonce",e.nonce),t=a.makeEventObj(n);var i=l.get("events",[]);if(i.push(t),l.set("events",i),i.length>l.get("events",[]).length){var s=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(){return e},this.makeEventObj=function(e){return t.extend(e,{url:window.location.href,time:Math.round((new Date).getTime()/1e3)})},t("body").hasClass("wp-admin")||n()},llms.tracking=new LLMS.Tracking(llms.tracking),LLMS.Rest={init:function(){this.bind()},bind:function(){},is_path:function(t){for(var e=!1,n=window.location.href,i=0;i<t.length;i++)n.search(t[i])>0&&!e&&(e=!0);return e},get_query_vars:function(){for(var t,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];return e}},LLMS.init=function(){for(var t in LLMS)"object"==typeof LLMS[t]&&null!==LLMS[t]&&void 0!==LLMS[t].init&&"function"==typeof LLMS[t].init&&LLMS[t].init()},LLMS.is_touch_device=function(){var t=" -webkit- -moz- -o- -ms- ".split(" "),e=function(t){return window.matchMedia(t).matches};if("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)return!0;var n=["(",t.join("touch-enabled),("),"heartz",")"].join("");return e(n)},LLMS.wait_for_matchHeight=function(e){this.wait_for(function(){return void 0!==t.fn.matchHeight},e,"matchHeight")},LLMS.wait_for_popover=function(e){this.wait_for(function(){return void 0!==t.fn.webuiPopover},e,"webuiPopover")},LLMS.wait_for=function(t,e,n){var i,s=0;n=n?n:"unnamed",i=setInterval(function(){if(s>=300)console.log("Unable to load dependency: "+n);else{if(!t())return void s++;e()}clearInterval(i)},100)},LLMS.init(t)}(jQuery);
//# sourceMappingURL=../maps/js/llms.min.js.map