(()=>{"use strict";var e={};// The module cache
var t={};// The require function
function n(i){// Check if module is in cache
var r=t[i];if(r!==undefined){return r.exports}// Create a new module (and put it into the cache)
var o=t[i]={exports:{}};// Execute the module function
e[i](o,o.exports,n);// Return the exports of the module
return o.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(e,t,n,i,r,o,s){try{var a=e[o](s);var u=a.value}catch(e){n(e);return}if(a.done)t(u);else Promise.resolve(u).then(i,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var s=e.apply(t,n);function a(e){i(s,r,o,a,u,"next",e)}function u(e){i(s,r,o,a,u,"throw",e)}a(undefined)})}};// CONCATENATED MODULE: ./addons/google-meet/assets/src/js/meet.ts
var o=e=>{var{deleteModalId:t,editModalId:n}=e;var{query:i,toast:o,modal:s,endpoints:a}=window.TutorCore;var{wpPost:u}=window.TutorCore.api;var{convertToErrorMessage:l}=window.TutorCore.error;return{query:i,uploadMutation:null,resetMutation:null,settingsMutation:null,deleteMutation:null,updateMutation:null,init(){this.handleUploadCredentials=this.handleUploadCredentials.bind(this);this.handleResetCredentials=this.handleResetCredentials.bind(this);this.uploadMutation=this.query.useMutation(this.uploadCredentials,{onSuccess:e=>{o.success(e.message);window.location.reload()},onError:e=>{o.error(l(e))}});this.resetMutation=this.query.useMutation(this.resetCredentials,{onSuccess:e=>{o.success(e.message);window.location.reload()},onError:e=>{o.error(l(e))}});this.settingsMutation=this.query.useMutation(this.saveSettings,{onSuccess:e=>{o.success(e.message)},onError:e=>{o.error(l(e))}});this.deleteMutation=this.query.useMutation(this.deleteMeeting,{onSuccess:()=>{s.closeModal(t);window.location.reload()},onError:e=>{o.error(l(e))}});this.updateMutation=this.query.useMutation(this.updateMeeting,{onSuccess:e=>{o.success(e.message);s.closeModal(n);window.location.reload()},onError:e=>{o.error(l(e))}})},handleSaveSettings(e){return r(function*(){var t;yield(t=this.settingsMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},saveSettings(e){return r(function*(){return u(a.UPDATE_GOOGLE_MEET_SETTINGS,e)})()},handleUploadCredentials(e){return r(function*(){var t;yield(t=this.uploadMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},uploadCredentials(e){return r(function*(){return u(a.UPLOAD_GOOGLE_MEET_CREDENTIALS,{file:e[0]})})()},resetCredentials(){return r(function*(){return u(a.RESET_GOOGLE_MEET_CREDENTIALS)})()},handleResetCredentials(){return r(function*(){var e;yield(e=this.resetMutation)===null||e===void 0?void 0:e.mutate({})}).call(this)},deleteMeeting(e){return u(a.DELETE_GOOGLE_MEET,{"event-id":e.eventId,"post-id":e.postId})},handleGoogleMeetDeleteMeeting(e){return r(function*(){var t;yield(t=this.deleteMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},updateMeeting(e){if(e.meeting_attendees_enroll_students===true){e.attendees="Yes"}else{e.attendees="No"}return u(a.SAVE_GOOGLE_MEET,e)},handleGoogleMeetUpdateMeeting(e){return r(function*(){var t;yield(t=this.updateMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)}}};var s=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"liveClass",component:o}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};document.addEventListener("alpine:init",()=>{s()})})();