import{e as _}from"./chunk-J4X74MLG.js";import{F as l,G as T}from"./chunk-57DG2VC5.js";import{g as E}from"./chunk-EU5XKS65.js";import{c as b}from"./chunk-XALE2GEX.js";import{Eb as g,Fd as v,Kb as f,Vb as a,cc as c,dc as s,ec as A,nc as h,oc as u,pc as C,rb as m,tc as x,uc as y,ud as w,vc as r,wc as d}from"./chunk-J476KISY.js";var M=["*"];function P(t,Q){if(t&1&&(c(0,"div",3),A(1,"paw-action",4),s()),t&2){let o=h();m(),a("id",(o.id?o.id+"-":"accordion-")+o.toggleAllAction.id)("action",o.toggleAllAction)}}var V=(()=>{class t{constructor(){this.toggle=!0,this.toggleAllAction={id:"toggle-all-panels",label:"HideAll",icon:"fa-regular fa-chevron-down paw-font-size-xs",styleClass:"paw-accordion-panel-toggle",onSelected:o=>{if(this.allCollapsed){this.expandAll(),this.allCollapsed=!1;return}this.collapseAll(),this.allCollapsed=!0}},this.allCollapsed=!0}ngOnInit(){this.setToggleLabel()}ngAfterViewInit(){this.assignAccordionToPannels(),this.syncToggledState()}expandAll(){this.panels.forEach(o=>{o.expansionPanel.accordion=this.matAccordion,o.expansionPanel.open()}),this.toggleAllAction.label="HideAll"}collapseAll(){this.panels.forEach(o=>{o.expansionPanel.accordion=this.matAccordion,o.expansionPanel.close()}),this.toggleAllAction.label="ShowAll"}setToggleLabel(){this.toggleAllAction.label=this.allCollapsed?"ShowAll":"HideAll"}assignAccordionToPannels(){this.panels.forEach(o=>{o.expansionPanel.accordion=this.matAccordion})}syncToggledState(){let o=!0;this.panels.forEach(e=>{o&&(o=e.isExpanded)}),this.allCollapsed=!o,this.setToggleLabel()}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=g({type:t,selectors:[["paw-accordion"]],contentQueries:function(e,i,n){if(e&1&&x(n,_,5),e&2){let p;r(p=d())&&(i.panels=p)}},viewQuery:function(e,i){if(e&1&&y(l,7),e&2){let n;r(n=d())&&(i.matAccordion=n.first)}},inputs:{toggle:"toggle",id:"id"},ngContentSelectors:M,decls:5,vars:1,consts:[["matAccordion",""],["class","paw-padding-bottom-s",4,"ngIf"],["multi",""],[1,"paw-padding-bottom-s"],[3,"id","action"]],template:function(e,i){e&1&&(u(),f(0,P,2,2,"div",1),c(1,"div")(2,"mat-accordion",2,0),C(4),s()()),e&2&&a("ngIf",i.toggle)},dependencies:[v,w,T,l,E,b],encapsulation:2})}}return t})();export{V as a};
