(()=>{var t={};/************************************************************************/// The module cache
var e={};// The require function
function a(n){// Check if module is in cache
var r=e[n];if(r!==undefined){return r.exports}// Create a new module (and put it into the cache)
var o=e[n]={exports:{}};// Execute the module function
t[n](o,o.exports,a);// Return the exports of the module
return o.exports}/************************************************************************/// webpack/runtime/rspack_version
(()=>{a.rv=()=>"1.5.7"})();// webpack/runtime/rspack_unique_id
(()=>{a.ruid="bundler=rspack@1.5.7"})();/************************************************************************/window.onload=()=>{var t=document.getElementById("tutor_analytics_search_icon");if(t){t.onclick=()=>{var t=document.getElementById("tutor_analytics_search_form");t.submit()}}var e=document.querySelectorAll(".tutor-admin-report-frequency");for(var a of e){a.onclick=t=>{var e=t.target.dataset.key;if(e==="custom"){return}var a=new URL(window.location.href);var n=a.searchParams;// if(params.has('period') && params.get('period') === period) {
//     return;
// }
if(n.has("start_date")){n.delete("start_date")}if(n.has("end_date")){n.delete("end_date")}n.set("period",e);window.location=a}}/**
	 * Course progress popup
	 *
	 *//**
	 * Prepare Line Charts for creating dynamically
	 *
	 * It will create four graph as mentioned on charts array of obj
	 *
	 * @since 1.9.9
	 */for(var n of _tutor_h5p_analytics){var r=document.getElementById("".concat(n.id,"_canvas"))?document.getElementById("".concat(n.id,"_canvas")).getContext("2d"):null;var o=[];var i=[];var s=[];for(var[d,l]of Object.entries(n.data)){var c={month:"short",day:"numeric"};var u=new Date(l.saved_date);var v=u.toLocaleDateString("en-US",c);o.push(v);i.push(l.total);if(l.fees){s.push(l.fees)}}var m=[];m.push({label:n.label,backgroundColor:"#3057D5",borderColor:"#3057D5",data:i,borderWidth:2,fill:false,lineTension:0});if(s.length){m.push({label:n.label2,backgroundColor:"rgba(200, 0, 0, 1)",borderColor:"rgba(200, 0, 0, 1)",data:s,borderWidth:2,fill:false,lineTension:0})}if(r){new Chart(r,{type:"line",data:{labels:o,datasets:m},options:{scales:{yAxes:[{ticks:{min:0,beginAtZero:true,callback:function t(t,e,a){if(Math.floor(t)===t){return t}}}}]},legend:{display:false}}})}}//modal
(function t(){document.addEventListener("click",t=>{var e="data-tutor-modal-target";var a="data-tutor-modal-close";var n="tutor-modal-overlay";if(t.target.hasAttribute(e)||t.target.closest("[".concat(e,"]"))){t.preventDefault();var r=t.target.hasAttribute(e)?t.target.getAttribute(e):t.target.closest("[".concat(e,"]")).getAttribute(e);var o=document.getElementById(r);if(o){//modal.classList.add('tutor-is-active');
}}if(t.target.hasAttribute(a)||t.target.classList.contains(n)||t.target.closest("[".concat(a,"]"))){t.preventDefault();var i=document.querySelectorAll(".tutor-modal.tutor-is-active");i.forEach(t=>{t.classList.remove("tutor-is-active")})}})})()};window.jQuery(document).ready(t=>{// Show activities statements modal
t(document).on("click",".open-activities-modal",function(e){e.preventDefault();var a=t(this);var n=a.data("verb");var r=t(".h5p-activities-statements-modal");var o=parseInt(a.data("user-id"),10);t.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"view_activities_statements_modal",verb:n,user_id:o},beforeSend:function t(){a.addClass("is-loading").attr("disabled",true)},success:function t(t){r.find(".tutor-modal-container").html(t.data.output);r.addClass("tutor-is-active");window.dispatchEvent(new Event(_tutorobject.content_change_event))},complete:function t(){a.removeClass("is-loading").attr("disabled",false)}})});// Show verb statements modal
t(document).on("click",".open-verbs-modal",function(e){e.preventDefault();var a=t(this);var n=a.data("activity-name");var r=t(".h5p-verbs-statements-modal");var o=parseInt(a.data("user-id"),10);t.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"view_verb_statements_modal",activity_name:n,user_id:o},beforeSend:function t(){a.addClass("is-loading").attr("disabled",true)},success:function t(t){r.find(".tutor-modal-container").html(t.data.output);r.addClass("tutor-is-active");window.dispatchEvent(new Event(_tutorobject.content_change_event))},complete:function t(){a.removeClass("is-loading").attr("disabled",false)}})});// Show learners statements modal
t(document).on("click",".open-learners-modal",function(e){e.preventDefault();var a=t(this);var n=a.data("activity-name");var r=a.data("verb");var o=t(".h5p-learners-statements-modal");t.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"view_learners_statements_modal",activity_name:n,verb:r},beforeSend:function t(){a.addClass("is-loading").attr("disabled",true)},success:function t(t){o.find(".tutor-modal-container").html(t.data.output);o.addClass("tutor-is-active");window.dispatchEvent(new Event(_tutorobject.content_change_event))},complete:function t(){a.removeClass("is-loading").attr("disabled",false)}})});// Opens a modal to show the last ten statements sorted by date
t(document).on("click",".open-last-ten-statements-modal",function(e){e.preventDefault();var a=t(this);var n=a.data("activity-name");var r=a.data("verb");var o=t(".h5p-last-ten-statements-modal");var i=parseInt(a.data("user-id"),10);t.ajax({url:window._tutorobject.ajaxurl,type:"POST",data:{action:"view_last_ten_statements_modal",activity_name:n,verb:r,user_id:i},beforeSend:function t(){a.addClass("is-loading").attr("disabled",true)},success:function t(t){o.find(".tutor-modal-container").html(t.data.output);o.addClass("tutor-is-active");window.dispatchEvent(new Event(_tutorobject.content_change_event))},complete:function t(){a.removeClass("is-loading").attr("disabled",false)}})})})})();