"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[69006],{69006:(e,n,t)=>{t.d(n,{y:()=>y});var o=t(10467),r=t(23063),s=t(49882),i=t(44682),u=t(55554),a=t(51024),l=t(52749),c=t(25572),d=t(79555),h=t(95384),C=t(54438),f=t(2910);let y=(()=>{var e;class CoreCourseModuleMainActivityComponent extends r.x{constructor(e="CoreCourseModuleMainResourceComponent",n,t){super(e,t),this.content=n,this.moduleName=""}ngOnInit(){var _superprop_getNgOnInit=()=>super.ngOnInit,e=this;return(0,o.A)((function*(){yield _superprop_getNgOnInit().call(e),e.hasOffline=!1,e.moduleName=h.CoreCourseModuleHelper.translateModuleName(e.pluginName||e.moduleName||""),e.syncEventName&&(e.syncObserver=s.z.on(e.syncEventName,(n=>{e.autoSyncEventReceived(n)}),e.siteId))}))()}isRefreshSyncNeeded(e){return!1}autoSyncEventReceived(e){this.isRefreshSyncNeeded(e)&&this.showLoadingAndRefresh(!1)}refreshContent(e=!1,n=!1){var t=this;return(0,o.A)((function*(){t.module&&(yield u.g.ignoreErrors(Promise.all([t.invalidateContent(),t.showCompletion?i.CoreCourse.invalidateModule(t.module.id):void 0])),yield t.loadContent(!0,e,n))}))()}showLoadingAndFetch(e=!1,n=!1){var t=this;return(0,o.A)((function*(){var o;t.showLoading=!0,null===(o=t.content)||void 0===o||o.scrollToTop(),yield t.loadContent(!1,e,n)}))()}showLoadingAndRefresh(e=!1,n=!1){var t;return this.showLoading=!0,null===(t=this.content)||void 0===t||t.scrollToTop(),this.refreshContent(e,n)}fetchContent(e=!1,n=!1,t=!1){return(0,o.A)((function*(){}))()}loadContent(e,n=!1,t=!1){var r=this;return(0,o.A)((function*(){if(r.module)try{e&&r.showCompletion&&(yield u.g.ignoreErrors(r.fetchModule())),yield r.fetchContent(e,n,t),r.finishSuccessfulFetch()}catch(t){var o;if(!e&&(null===(o=l.CoreSites.getCurrentSite())||void 0===o||!o.isOfflineDisabled())&&h.CoreCourseModuleHelper.isNotFoundError(t))return yield r.refreshContent(n);c.CoreAlerts.showError(t,{default:d.HT.instant(r.fetchContentDefaultError)})}finally{r.showLoading=!1}}))()}sync(){return(0,o.A)((function*(){return{updated:!1,warnings:[]}}))()}hasSyncSucceed(e){return e.updated}syncActivity(e=!1){var n=this;return(0,o.A)((function*(){try{const e=yield n.sync();return e.warnings.length&&c.CoreAlerts.show({message:e.warnings[0]}),n.hasSyncSucceed(e)}catch(n){return e&&c.CoreAlerts.showError(n,{default:d.HT.instant("core.errorsync")}),!1}}))()}ngOnDestroy(){var e;super.ngOnDestroy(),null===(e=this.syncObserver)||void 0===e||e.off()}}return(e=CoreCourseModuleMainActivityComponent).ɵfac=function CoreCourseModuleMainActivityComponent_Factory(n){return new(n||e)(C.rXU("",8),C.rXU(f.W9),C.rXU(a.A))},e.ɵcmp=C.VBU({type:e,selectors:[["ng-component"]],inputs:{group:"group"},features:[C.Vt3],decls:0,vars:0,template:function CoreCourseModuleMainActivityComponent_Template(e,n){},encapsulation:2}),CoreCourseModuleMainActivityComponent})()}}]);