import{a as E,b as F}from"./chunk-36RFM2QR.js";import{c as y}from"./chunk-LMI6FIPG.js";import{b as D}from"./chunk-5TTXT2K2.js";import{E as T}from"./chunk-MDIMQ3H3.js";import{Bb as h,Db as d,Eb as u,Gb as _,Hb as x,Ib as C,Jb as l,Kb as s,Ub as g,Xb as f,Xc as O,Yc as v,Za as c,Zb as a,ib as M,lc as I,mc as k,oc as b,va as m,wa as p}from"./chunk-GJDGQISV.js";function R(t,o){if(t&1){let e=g();l(0,"li",2)(1,"mat-checkbox",3),f("change",function(){let i=m(e).$implicit,r=a(2);return p(r.change(i.ID))}),k(2),s()()}if(t&2){let e=o.$implicit,n=a(2);c(),C("checked",n.checkingCheckbox(e.ID))("value",e.ID)("name",n.name()),c(),b("",e.Name," ")}}function S(t,o){if(t&1&&(l(0,"ul",0),_(1,R,3,4,"li",2,u),s()),t&2){let e=a();c(),x(e.options())}}function V(t,o){if(t&1){let e=g();l(0,"li",2)(1,"mat-checkbox",5),f("change",function(){let i=m(e).$implicit,r=a(2);return p(r.change(i.ID))}),k(2),s()()}if(t&2){let e=o.$implicit,n=a(2);I("col-"+12/((n.config==null?null:n.config.totalColumn)??2)),c(),C("checked",n.checkingCheckbox(e.ID))("value",e.ID)("name",n.name()),c(),b("",e.Name," ")}}function N(t,o){if(t&1&&(l(0,"ul",1),_(1,V,3,6,"li",4,u),s()),t&2){let e=a();c(),x(e.options())}}var w=class{constructor(o,e){this.viewGrid=o||!1,this.totalColumn=e||2}},L=(()=>{class t{constructor(){this.options=v(),this.name=v(""),this.modelChange=O()}ngOnInit(){this.config==null&&(this.config=new w)}change(e){this.checkingCheckbox(e)?this.model=this.removeItemRow(this.model,e):this.model.push(e),this.modelChange.emit(this.model)}checkingCheckbox(e){return this.model.filter(i=>i==e).length>0}removeItemRow(e,n){let i=e.findIndex(r=>r==n);return e.splice(i,1),e}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["checkbox-options"]],inputs:{model:"model",options:[1,"options"],name:[1,"name"],config:"config"},outputs:{modelChange:"modelChange"},decls:2,vars:2,consts:[[1,"checkbox-group"],[1,"checkbox-group","view-grid","row"],[1,"checkbox-group-item"],[3,"change","checked","value","name"],[1,"checkbox-group-item",3,"class"],[1,"label-custom",3,"change","checked","value","name"]],template:function(n,i){n&1&&(h(0,S,3,0,"ul",0),h(1,N,3,0,"ul",1)),n&2&&(d(i.config!=null&&i.config.viewGrid?-1:0),c(),d(i.config!=null&&i.config.viewGrid?1:-1))},dependencies:[y,F,E,T,D],encapsulation:2})}}return t})();export{w as a,L as b};
