(()=>{"use strict";var t={};// The module cache
var e={};// The require function
function n(i){// Check if module is in cache
var o=e[i];if(o!==undefined){return o.exports}// Create a new module (and put it into the cache)
var r=e[i]={exports:{}};// Execute the module function
t[i](r,r.exports,n);// Return the exports of the module
return r.exports}// webpack/runtime/rspack_version
(()=>{n.rv=()=>"1.6.5"})();// webpack/runtime/rspack_unique_id
(()=>{n.ruid="bundler=rspack@1.6.5"})();// CONCATENATED MODULE: ./node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_async_to_generator.js
function i(t,e,n,i,o,r,s){try{var u=t[r](s);var a=u.value}catch(t){n(t);return}if(u.done)e(a);else Promise.resolve(a).then(i,o)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(o,r){var s=t.apply(e,n);function u(t){i(s,o,r,u,a,"next",t)}function a(t){i(s,o,r,u,a,"throw",t)}u(undefined)})}};// CONCATENATED MODULE: ./addons/tutor-zoom/assets/src/js/dashboard.ts
var r="save_zoom_api_settings_btn";var s="tutor-btn-loading";var u=t=>{var{deleteModalID:e,editModalID:n}=t;var{query:i,toast:u,modal:a,endpoints:d}=window.TutorCore;var{wpPost:l}=window.TutorCore.api;var{convertToErrorMessage:c}=window.TutorCore.error;return{query:i,setApiMutation:null,settingsMutation:null,deleteMutation:null,updateMutation:null,init(){this.setApiMutation=this.query.useMutation(this.setApi,{onSuccess(t){u.success(t.message);window.location.reload()},onError(t){u.error(c(t));window.location.reload()},onSettled(){var t,e;(t=document.getElementById(r))===null||t===void 0?void 0:t.classList.remove(s);(e=document.getElementById(r))===null||e===void 0?void 0:e.removeAttribute("disabled")}});this.settingsMutation=this.query.useMutation(this.saveSettings,{onSuccess(t){u.success(t.message)},onError(t){u.error(c(t))}});this.deleteMutation=this.query.useMutation(this.deleteZoomMeeting,{onSuccess(t){u.success(t.message);a.closeModal(e);window.location.reload()},onError(t){u.error(c(t))}});this.updateMutation=this.query.useMutation(this.updateMeeting,{onSuccess:t=>{u.success(t.message);a.closeModal(n);window.location.reload()},onError:t=>{u.error(c(t))}})},handleSetApi(t){return o(function*(){var e,n,i;var o={tutor_zoom_api:t};(e=document.getElementById(r))===null||e===void 0?void 0:e.classList.add(s);(n=document.getElementById(r))===null||n===void 0?void 0:n.setAttribute("disabled","disabled");yield(i=this.setApiMutation)===null||i===void 0?void 0:i.mutate(o)}).call(this)},setApi(t){return l(d.ZOOM_SAVE_API,t)},handleSaveSettings(t){return o(function*(){var e;yield(e=this.settingsMutation)===null||e===void 0?void 0:e.mutate(t)}).call(this)},saveSettings(t){return l(d.ZOOM_SAVE_SETTINGS,t)},handleDeleteZoomMeeting(t){return o(function*(){var e;yield(e=this.deleteMutation)===null||e===void 0?void 0:e.mutate(t)}).call(this)},deleteZoomMeeting(t){return l(d.DELETE_ZOOM_MEETING,{meeting_id:t})},updateMeeting(t){return l(d.SAVE_ZOOM_MEETING,t)},handleZoomUpdateMeeting(t){return o(function*(){var e;yield(e=this.updateMutation)===null||e===void 0?void 0:e.mutate(t)}).call(this)}}};var a=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"zoomLiveClass",component:u}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};document.addEventListener("alpine:init",()=>{a()})})();