"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[58841],{58841:(n,o,i)=>{i.r(o),i.d(o,{AddonModAssignSubmissionPluginComponent:()=>C});var e=i(10467),s=i(68162),t=i(5505),d=i(20218),l=i(95790),p=i(66016),m=i(91416),u=i(86654),a=i(54438),g=i(60177),c=i(2910),r=i(6128),f=i(64422),_=i(58197),A=i(35407),b=i(73955);function AddonModAssignSubmissionPluginComponent_ion_item_2_ion_badge_4_Template(n,o){1&n&&(a.j41(0,"ion-badge",7),a.EFF(1),a.nI1(2,"translate"),a.k0s()),2&n&&(a.R7$(),a.SpI(" ",a.bMT(2,1,"addon.mod_assign.submissionnotsupported")," "))}function AddonModAssignSubmissionPluginComponent_ion_item_2_p_5_Template(n,o){if(1&n&&(a.j41(0,"p"),a.nrm(1,"core-format-text",8),a.k0s()),2&n){const n=a.XpG(2);a.R7$(),a.Y8G("component",n.component)("componentId",n.assign.cmid)("text",n.text)("contextInstanceId",n.assign.cmid)("courseId",n.assign.course)}}function AddonModAssignSubmissionPluginComponent_ion_item_2_core_file_6_Template(n,o){if(1&n&&a.nrm(0,"core-file",9),2&n){const n=o.$implicit,i=a.XpG(2);a.Y8G("file",n)("component",i.component)("componentId",i.assign.cmid)("alwaysDownload",!0)}}function AddonModAssignSubmissionPluginComponent_ion_item_2_Template(n,o){if(1&n&&(a.j41(0,"ion-item",3)(1,"ion-label")(2,"h2"),a.EFF(3),a.k0s(),a.DNE(4,AddonModAssignSubmissionPluginComponent_ion_item_2_ion_badge_4_Template,3,3,"ion-badge",4)(5,AddonModAssignSubmissionPluginComponent_ion_item_2_p_5_Template,2,5,"p",5)(6,AddonModAssignSubmissionPluginComponent_ion_item_2_core_file_6_Template,1,4,"core-file",6),a.k0s()()),2&n){const n=a.XpG();a.R7$(3),a.JRh(n.plugin.name),a.R7$(),a.Y8G("ngIf",n.notSupported),a.R7$(),a.Y8G("ngIf",n.text),a.R7$(),a.Y8G("ngForOf",n.files)}}let C=(()=>{var n;class AddonModAssignSubmissionPluginComponent{constructor(){this.edit=!1,this.allowOffline=!1,this.component=p.It,this.text="",this.files=[],this.notSupported=!1,this.pluginLoaded=!1}ngOnChanges(n){var o=this;return(0,e.A)((function*(){if(!o.plugin)return o.pluginLoaded=!0,void 0;const i=l.AddonModAssignSubmissionDelegate.getPluginName(o.plugin);if(!i)return o.pluginLoaded=!0,void 0;o.plugin.name=i,(n.plugin||n.edit)&&(o.pluginComponent=yield l.AddonModAssignSubmissionDelegate.getComponentForPlugin(o.plugin,o.edit),o.pluginLoaded=!o.pluginComponent,o.pluginComponent||(o.text=t.AddonModAssign.getSubmissionPluginText(o.plugin),o.files=t.AddonModAssign.getSubmissionPluginAttachments(o.plugin),o.notSupported=l.AddonModAssignSubmissionDelegate.isPluginSupported(o.plugin.type))),o.pluginComponent&&(o.data={assign:o.assign,submission:o.submission,plugin:o.plugin,configs:d.AddonModAssignHelper.getPluginConfig(o.assign,"assignsubmission",o.plugin.type),edit:o.edit,allowOffline:o.allowOffline})}))()}invalidate(){var n=this;return(0,e.A)((function*(){yield n.dynamicComponent.callComponentMethod("invalidate")}))()}}return(n=AddonModAssignSubmissionPluginComponent).ɵfac=function AddonModAssignSubmissionPluginComponent_Factory(o){return new(o||n)},n.ɵcmp=a.VBU({type:n,selectors:[["addon-mod-assign-submission-plugin"]],viewQuery:function AddonModAssignSubmissionPluginComponent_Query(n,o){if(1&n&&a.GBs(s.m,5),2&n){let n;a.mGM(n=a.lsd())&&(o.dynamicComponent=n.first)}},inputs:{assign:"assign",submission:"submission",plugin:"plugin",edit:[a.Mj6.HasDecoratorInputTransform,"edit","edit",m.G],allowOffline:[a.Mj6.HasDecoratorInputTransform,"allowOffline","allowOffline",m.G]},standalone:!0,features:[a.GFd,a.OA$,a.aNF],decls:3,vars:4,consts:[[3,"component","data"],[3,"hideUntil"],["class","ion-text-wrap",4,"ngIf"],[1,"ion-text-wrap"],["color","primary",4,"ngIf"],[4,"ngIf"],[3,"file","component","componentId","alwaysDownload",4,"ngFor","ngForOf"],["color","primary"],["collapsible-item","","contextLevel","module",3,"component","componentId","text","contextInstanceId","courseId"],[3,"file","component","componentId","alwaysDownload"]],template:function AddonModAssignSubmissionPluginComponent_Template(n,o){1&n&&(a.j41(0,"core-dynamic-component",0)(1,"core-loading",1),a.DNE(2,AddonModAssignSubmissionPluginComponent_ion_item_2_Template,7,4,"ion-item",2),a.k0s()()),2&n&&(a.Y8G("component",o.pluginComponent)("data",o.data),a.R7$(),a.Y8G("hideUntil",o.pluginLoaded),a.R7$(),a.Y8G("ngIf",o.text.length>0||o.files.length>0))},dependencies:[u.n,g.Sq,g.bT,c.In,c.uz,c.he,s.m,r.t,f.R,_.B,A.K,b.D9],encapsulation:2}),AddonModAssignSubmissionPluginComponent})()}}]);