"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[15871],{15871:(e,n,o)=>{o.r(n),o.d(n,{AddonModDataFieldMenuComponent:()=>_});var t=o(10093),a=o(86654),d=o(54438),r=o(60177),i=o(89417),s=o(2910),l=o(25880),p=o(17778),c=o(58197),u=o(73955);const _c0=e=>({header:e});function AddonModDataFieldMenuComponent_span_0_span_1_Template(e,n){if(1&e&&d.nrm(0,"span",8),2&e){const e=d.XpG(2);d.Y8G("core-mark-required",e.field.required)}}function AddonModDataFieldMenuComponent_span_0_ion_select_option_5_Template(e,n){1&e&&(d.j41(0,"ion-select-option",9),d.EFF(1),d.nI1(2,"translate"),d.k0s()),2&e&&(d.R7$(),d.JRh(d.bMT(2,1,"addon.mod_data.menuchoose")))}function AddonModDataFieldMenuComponent_span_0_ion_select_option_6_Template(e,n){if(1&e&&(d.j41(0,"ion-select-option",10),d.nrm(1,"core-format-text",11),d.k0s()),2&e){const e=n.$implicit,o=d.XpG(2);d.Y8G("value",e),d.R7$(),d.Y8G("text",e)("contextInstanceId",null==o.database?null:o.database.coursemodule)("courseId",null==o.database?null:o.database.course)("wsNotFiltered",!0)}}function AddonModDataFieldMenuComponent_span_0_core_input_errors_7_Template(e,n){if(1&e&&d.nrm(0,"core-input-errors",12),2&e){const e=d.XpG(2);d.Y8G("control",e.form.controls["f_"+e.field.id])("errorText",e.error)}}function AddonModDataFieldMenuComponent_span_0_Template(e,n){if(1&e&&(d.j41(0,"span",2),d.DNE(1,AddonModDataFieldMenuComponent_span_0_span_1_Template,1,1,"span",3),d.j41(2,"ion-select",4),d.nI1(3,"translate"),d.nI1(4,"translate"),d.DNE(5,AddonModDataFieldMenuComponent_span_0_ion_select_option_5_Template,3,3,"ion-select-option",5)(6,AddonModDataFieldMenuComponent_span_0_ion_select_option_6_Template,2,5,"ion-select-option",6),d.k0s(),d.DNE(7,AddonModDataFieldMenuComponent_span_0_core_input_errors_7_Template,1,2,"core-input-errors",7),d.k0s()),2&e){const e=d.XpG();d.Y8G("formGroup",e.form),d.R7$(),d.Y8G("ngIf",e.editMode),d.R7$(),d.Y8G("formControlName","f_"+e.field.id)("placeholder",d.bMT(3,9,"addon.mod_data.menuchoose"))("cancelText",d.bMT(4,11,"core.cancel"))("interfaceOptions",d.eq3(13,_c0,e.field.name)),d.R7$(3),d.Y8G("ngIf",!e.editMode||!e.field.required),d.R7$(),d.Y8G("ngForOf",e.options),d.R7$(),d.Y8G("ngIf",e.error&&e.editMode)}}function AddonModDataFieldMenuComponent_span_1_Template(e,n){if(1&e&&(d.j41(0,"span"),d.EFF(1),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.JRh(e.value.content)}}let _=(()=>{var e;class AddonModDataFieldMenuComponent extends t.u{constructor(){super(...arguments),this.options=[]}init(){if(this.displayMode)return;let e;this.options=this.field.param1.split("\n"),this.options=this.options.filter((e=>""!==e)),this.editMode&&this.value&&(e=this.value.content),this.addControl(`f_${this.field.id}`,e)}}return(e=AddonModDataFieldMenuComponent).ɵfac=(()=>{let n;return function AddonModDataFieldMenuComponent_Factory(o){return(n||(n=d.xGo(e)))(o||e)}})(),e.ɵcmp=d.VBU({type:e,selectors:[["addon-mod-data-field-menu"]],standalone:!0,features:[d.Vt3,d.aNF],decls:2,vars:2,consts:[[3,"formGroup",4,"ngIf"],[4,"ngIf"],[3,"formGroup"],["class","core-mark-required",3,"core-mark-required",4,"ngIf"],["interface","action-sheet",3,"formControlName","placeholder","cancelText","interfaceOptions"],["value","",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"control","errorText",4,"ngIf"],[1,"core-mark-required",3,"core-mark-required"],["value",""],[3,"value"],["contextLevel","module",3,"text","contextInstanceId","courseId","wsNotFiltered"],[3,"control","errorText"]],template:function AddonModDataFieldMenuComponent_Template(e,n){1&e&&d.DNE(0,AddonModDataFieldMenuComponent_span_0_Template,8,15,"span",0)(1,AddonModDataFieldMenuComponent_span_1_Template,2,1,"span",1),2&e&&(d.Y8G("ngIf",n.inputMode&&n.form),d.R7$(),d.Y8G("ngIf",n.displayMode&&n.value&&n.value.content))},dependencies:[a.n,r.Sq,r.bT,i.BC,i.cb,s.Nm,s.Ip,s.Je,i.j4,i.JD,l.q,p.j,c.B,u.D9],encapsulation:2}),AddonModDataFieldMenuComponent})()}}]);