"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6003],{6003:(e,o,t)=>{t.r(o),t.d(o,{AddonBlockActivityModulesComponent:()=>M});var n=t(10467),i=t(44682),d=t(97086),r=t(3484),s=t(52749),c=t(79555),l=t(58364),a=t(15324),m=t(94247),u=t(8014),p=t(86654),C=t(95384),h=t(54438),g=t(60177),v=t(2910),y=t(64422),k=t(32572),A=t(73955);function AddonBlockActivityModulesComponent_ion_item_6_Template(e,o){if(1&e){const e=h.RV6();h.j41(0,"ion-item",3),h.bIt("click",(function AddonBlockActivityModulesComponent_ion_item_6_Template_ion_item_click_0_listener(){const o=h.eBV(e).$implicit,t=h.XpG();return h.Njj(t.gotoCoureListModType(o))})),h.nrm(1,"core-mod-icon",4),h.j41(2,"ion-label"),h.EFF(3),h.k0s()()}if(2&e){const e=o.$implicit;h.Y8G("detail",!0),h.R7$(),h.Y8G("modicon",e.icon)("modname",e.iconModName)("showAlt",!1)("colorize",!1)("isBranded",e.branded),h.R7$(2),h.JRh(e.name)}}let M=(()=>{var e;class AddonBlockActivityModulesComponent extends r.d{constructor(){super("AddonBlockActivityModulesComponent"),this.entries=[],this.fetchContentDefaultError="Error getting activity modules data."}invalidateContent(){var e=this;return(0,n.A)((function*(){yield i.CoreCourse.invalidateSections(e.instanceId)}))()}fetchContent(){var e=this;return(0,n.A)((function*(){const o=yield i.CoreCourse.getSections(e.getCourseId(),!1,!0);e.entries=[];const t={},n={};let r={};const s={};i.CoreCourse.getSectionsModules(o,{ignoreSection:e=>!m.CoreCourseHelper.canUserViewSection(e),ignoreModule:e=>!m.CoreCourseHelper.canUserViewModule(e)||!C.CoreCourseModuleHelper.moduleHasView(e)}).forEach((e=>{void 0===t[e.modname]&&(t[e.modname]=d.CoreCourseModuleDelegate.supportsFeature(e.modname,"mod_archetype",0),1===t[e.modname]?r.resources||(r.resources=c.HT.instant("core.resources")):r[e.modname]=e.modplural,s[e.modname]=e.branded,u.F.isThemeImageUrl(e.modicon)&&(n[e.modname]=e.modicon))})),r=l.T.sortValues(r);for(const o in r){const t="resources"===o?"page":o,i=yield d.CoreCourseModuleDelegate.getModuleIconSrc(t,n[t]);e.entries.push({icon:i,iconModName:t,name:r[o],modName:o,branded:s[t]})}}))()}getCourseId(){return"course"==this.contextLevel?this.instanceId:s.CoreSites.getCurrentSiteHomeId()}gotoCoureListModType(e){a.CoreNavigator.navigateToSitePath("course/"+this.getCourseId()+"/list-mod-type",{params:{modName:e.modName,title:e.name}})}}return(e=AddonBlockActivityModulesComponent).ɵfac=function AddonBlockActivityModulesComponent_Factory(o){return new(o||e)},e.ɵcmp=h.VBU({type:e,selectors:[["addon-block-activitymodules"]],standalone:!0,features:[h.Vt3,h.aNF],decls:7,vars:7,consts:[[3,"sticky"],["placeholderType","column","placeholderHeight","48px",3,"hideUntil","placeholderLimit"],["class","ion-text-wrap","button","",3,"detail","click",4,"ngFor","ngForOf"],["button","",1,"ion-text-wrap",3,"click","detail"],["slot","start",3,"modicon","modname","showAlt","colorize","isBranded"]],template:function AddonBlockActivityModulesComponent_Template(e,o){1&e&&(h.j41(0,"ion-item-divider",0)(1,"ion-label")(2,"h2"),h.EFF(3),h.nI1(4,"translate"),h.k0s()()(),h.j41(5,"core-loading",1),h.DNE(6,AddonBlockActivityModulesComponent_ion_item_6_Template,4,7,"ion-item",2),h.k0s()),2&e&&(h.Y8G("sticky",!0),h.R7$(3),h.JRh(h.bMT(4,5,"addon.block_activitymodules.pluginname")),h.R7$(2),h.Y8G("hideUntil",o.loaded)("placeholderLimit",8),h.R7$(),h.Y8G("ngForOf",o.entries))},dependencies:[p.n,g.Sq,v.uz,v.Dg,v.he,y.R,k.I,A.D9],styles:["[_nghost-%COMP%]   core-mod-icon[_ngcontent-%COMP%]{--margin-vertical: 0px;--margin-end: 12px;--module-icon-size: 24px}"]}),AddonBlockActivityModulesComponent})()}}]);