import{a as X,b as Y,c as Z,d as $}from"./chunk-5YZW47FK.js";import{ha as te,j as ee}from"./chunk-ZSNLO3TX.js";import{a as z}from"./chunk-EHV5JSNA.js";import{b as G,c as q,e as J,f as K,g as Q,h as U}from"./chunk-S2V6IA2C.js";import{h as j,j as F}from"./chunk-ORQ34GH7.js";import{a as O}from"./chunk-DZT3OJCU.js";import{a as R}from"./chunk-3CODJNWE.js";import{h as A,m as V,z as N}from"./chunk-HJB5ICMZ.js";import{a as L}from"./chunk-L4FY67IO.js";import{m as I}from"./chunk-NMCXU7N6.js";import{$b as H,Ba as E,Bc as s,Dc as _,Fc as g,Gc as f,Hc as h,Jc as B,Ma as y,Na as w,Nb as M,Qb as S,Rb as p,Uc as b,Vc as x,Yb as v,_b as T,ac as k,bc as n,cc as r,hc as W,mc as D,oc as m,sb as l,tb as u,u as P}from"./chunk-IYD54RT7.js";function ie(o,d){if(o&1&&(n(0,"mat-list-option",16),s(1),b(2,"async"),r()),o&2){let a,e=m().$implicit,t=m(2);p("value",e),S("data-cy","header-"+e)("data-cy-checked","selection-"+t.isChecked(0,e)),l(),_(" ",(a=x(2,4,t.getHeaderByName(e,"structure")))==null?null:a.humanReadable," ")}}function ae(o,d){if(o&1&&M(0,ie,3,6,"mat-list-option",16),o&2){let a=d.$implicit,e=m(2);v(0,e.isString(a)?0:-1)}}function ne(o,d){if(o&1&&(n(0,"mat-list-option",16),s(1),b(2,"async"),r()),o&2){let a,e=d.$implicit,t=m(2);p("value",e),S("data-cy","header-"+e)("data-cy-checked","selection-"+t.isChecked(1,e)),l(),_(" ",(a=x(2,4,t.getHeaderByName(e,"element")))==null?null:a.humanReadable," ")}}function oe(o,d){if(o&1){let a=W();n(0,"div",7)(1,"h2",8),s(2,"Column Preferences"),r(),n(3,"button",9),D("click",function(t){y(a);let i=m();return w(i.resetToDefaultHeaders(t))}),s(4," Reset to Defaults "),r()(),n(5,"table",10)(6,"tr",11)(7,"th",12)(8,"mat-label"),s(9),r()(),n(10,"th",12)(11,"mat-label"),s(12),r()()(),n(13,"tr",13)(14,"td",14)(15,"mat-selection-list",15),h("ngModelChange",function(t){y(a);let i=m();return f(i.data.allowedHeaders1,t)||(i.data.allowedHeaders1=t),w(t)}),H(16,ae,1,1,null,null,T),r()(),n(18,"td",14)(19,"mat-selection-list",15),h("ngModelChange",function(t){y(a);let i=m();return f(i.data.allowedHeaders2,t)||(i.data.allowedHeaders2=t),w(t)}),H(20,ne,3,6,"mat-list-option",16,T),r()()()()}if(o&2){let a=m();l(9),_("",a.data.headers1Label,":"),l(3),_("",a.data.headers2Label,":"),l(3),g("ngModel",a.data.allowedHeaders1),l(),k(a.data.allHeaders1),l(3),g("ngModel",a.data.allowedHeaders2),l(),k(a.data.allHeaders2)}}var we=(()=>{let d=class d{constructor(e,t,i,C){this.dialogRef=e,this.data=t,this.editAuthService=i,this._headerService=C,this.editability=this.editAuthService.branchEditability.pipe(P(c=>c?.editable)),this.editAuthService.BranchIdString=t.branchId}onNoClick(){this.dialogRef.close()}getHeaderByName(e,t){return this._headerService.getHeaderByName(e,t)}resetToDefaultHeaders(e){if(this.data.editable){this.data.allowedHeaders1=Z,this.data.allowedHeaders2=X;return}this.data.allowedHeaders1=$,this.data.allowedHeaders2=Y}isChecked(e,t){return this.getHeaderList(e).includes(t)}getHeaderList(e){return e?this.data.allowedHeaders2:this.data.allowedHeaders1}isString(e){return typeof e=="string"}};d.\u0275fac=function(t){return new(t||d)(u(G),u(q),u(te),u(ee))},d.\u0275cmp=E({type:d,selectors:[["osee-messaging-column-preferences-dialog"]],standalone:!0,features:[B],decls:17,vars:8,consts:[["mat-dialog-title",""],[1,"tw-flex","tw-flex-col","tw-items-start"],["color","primary",3,"ngModelChange","ngModel","disabled"],["matTooltip","Turn on to view full length content in tables","color","primary",3,"ngModelChange","ngModel","matTooltipPosition"],["align","end"],["mat-button","","data-cy","cancel-btn",3,"click"],["mat-raised-button","","color","primary","data-cy","submit-btn",3,"mat-dialog-close"],[1,"tw-flex","tw-justify-between","tw-justify-items-center","tw-px-0","tw-pb-1","tw-pt-2"],[1,"tw-m-0"],["mat-stroked-button","","data-cy","reset-default-btn",3,"click"],[1,"mat-table","mat-elevation-z8"],[1,"mat-header-row"],[1,"mat-header-cell"],[1,"mat-row"],[1,"mat-cell","tw-align-top"],["color","primary",3,"ngModelChange","ngModel"],[3,"value"]],template:function(t,i){t&1&&(n(0,"h1",0),s(1,"Settings"),r(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-checkbox",2),b(5,"async"),h("ngModelChange",function(c){return f(i.data.editable,c)||(i.data.editable=c),c}),n(6,"mat-label"),s(7,"Edit Mode"),r()(),n(8,"mat-checkbox",3),h("ngModelChange",function(c){return f(i.data.wordWrap,c)||(i.data.wordWrap=c),c}),n(9,"mat-label"),s(10,"Word Wrap"),r()()(),M(11,oe,22,4),r(),n(12,"mat-dialog-actions",4)(13,"button",5),D("click",function(){return i.onNoClick()}),s(14," Cancel "),r(),n(15,"button",6),s(16," Ok "),r()()),t&2&&(l(4),g("ngModel",i.data.editable),p("disabled",x(5,6,i.editability)===!1||!1),l(4),g("ngModel",i.data.wordWrap),p("matTooltipPosition","right"),l(3),v(11,i.data.headersTableActive?11:-1),l(4),p("mat-dialog-close",i.data))},dependencies:[N,A,V,I,K,Q,z,R,O,L,F,j,U,J],encapsulation:2});let o=d;return o})();export{we as a};
