import {K as Ke,P as Pt}from'./chunk-CMFbAvbn.js';import {w,W}from'./chunk-DCkN4Kxk.js';import {y,H}from'./chunk-BhXYzBYS.js';import {J as J$1,$ as $$1}from'./chunk-DTKExQCa.js';import {J,a5 as fh,cI as p,aU as rs,i as S,aV as ut,c as tS,aZ as Dt,cN as g,bE as ff,aq as Sr,ah as ot,ay as df,w as wo,f as QT,be as q3,bf as ns,cA as Qi,bg as lt,b_ as iH,c0 as XN,c1 as Tc,u as R,bp as QC,br as ZC,bu as dy,a6 as pi,bP as he,ad as ce,bk as i_,a0 as ks,z as vM,bl as dv,a3 as Py,a1 as Ny,a2 as Uu,cE as py,co as E_,bz as f_,bs as k_,bt as cM,a4 as Sy,cg as J_,F as EM,bq as uv,A as Iw,bm as Bp,bo as $p,bn as Z_}from'./main-WUGO6e7n.js';var $,ee=J(()=>{pi();tS();$=(()=>{class i{constructor(){this.editRequestSource=new he,this.editRequest=this.editRequestSource.asObservable();}edit(e){this.editRequestSource.next(e);}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();});function ue(i,te){if(i&1){let e=i_();ks(0,"sd-submit-button",6),vM(1,"translate"),Py("onClick",function(){Bp(e);let n=f_(2);return $p(n.save())}),Uu(),ks(2,"sd-cancel-button",7),vM(3,"translate"),Py("onClick",function(){Bp(e);let n=f_(2);return $p(n.cancel())}),Uu();}if(i&2){f_();let e=E_(3);Sy("disabled",!e.dirty||e.form.invalid)("label",EM(1,5,"lblSave"))("parent",e),Iw(2),Sy("label",EM(3,7,"lblCancel"))("parent",e);}}function fe(i,te){if(i&1){let e=i_();ks(0,"p-dialog",2),vM(1,"translate"),dv("visibleChange",function(n){Bp(e);let C=f_();return Z_(C.displayDialog,n)||(C.displayDialog=n),$p(n)}),Py("onHide",function(){Bp(e);let n=f_();return $p(n.cancel())}),ks(2,"form",3,0),Ny(4,"dps-pam-settings",4),Uu(),py(5,ue,4,9,"ng-template",5),Uu();}if(i&2){let e=E_(3),t=f_();k_(cM(15,ge)),Sy("header",J_(EM(1,13,"lblDefaultSettings"))),uv("visible",t.displayDialog),Sy("draggable",false)("maximizable",true)("modal",true)("focusOnShow",false),Iw(4),Sy("target",t.requestParams?.target)("settings",t.settings)("form",e)("mdColSize",12);}}var ge,Te,_e=J(()=>{fh();p();rs();S();Ke();w();y();ut();tS();ee();J$1();rs();Dt();ut();ge=()=>({width:"650px",height:"780px"});Te=(()=>{class i extends g{constructor(e,t){super(),this.pamSystemSettingsEditService=e,this.pamSettingsService=t,this.displayDialog=!1;}ngOnInit(){this.subscribeToEditRequest();}save(){this.callActionAccept();}cancel(){this.callActionCancel();}callActionAccept(e=!0){this.pamSettingsService.setSettings(this.settings).pipe(ff(this.destroyed$),Sr(t=>!!t),ot(t=>!!t)).subscribe(()=>{this.requestParams&&this.requestParams.accept&&(this.requestParams.accept(),this.requestParams=null),e&&(this.displayDialog=!1);});}callActionCancel(e=!0){this.requestParams&&this.requestParams.cancel&&(this.requestParams.cancel(),this.requestParams=null),e&&(this.displayDialog=!1);}subscribeToEditRequest(){this.pamSystemSettingsEditService.editRequest.pipe(Sr(e=>e.key===this.key),df(e=>this.getSettings(e)),Sr(e=>!!e.settings),ff(this.destroyed$)).subscribe(e=>{this.settings=e.settings,this.requestParams=e.request,this.displayDialog=!0;});}getSettings(e){return this.pamSettingsService.getSettings(!0).pipe(ot(t=>({settings:t,request:e})))}static{this.\u0275fac=function(t){return new(t||i)(wo($),wo($$1))};}static{this.\u0275cmp=QT({type:i,selectors:[["dvl-pam-system-settings-dialog"]],features:[dy],decls:1,vars:1,consts:[["form","ngForm"],["closeIcon","di dvl-icon-close","minimizeIcon","di dvl-icon-minimize","maximizeIcon","di dvl-icon-expand",3,"header","visible","style","draggable","maximizable","modal","focusOnShow"],["closeIcon","di dvl-icon-close","minimizeIcon","di dvl-icon-minimize","maximizeIcon","di dvl-icon-expand",3,"visibleChange","onHide","header","visible","draggable","maximizable","modal","focusOnShow"],["autocomplete","off","novalidate","",1,"full-height"],[3,"target","settings","form","mdColSize"],["pTemplate","footer"],[3,"onClick","disabled","label","parent"],[3,"onClick","label","parent"]],template:function(t,n){t&1&&QC(0,fe,6,16,"p-dialog",1),t&2&&ZC(n.displayDialog?0:-1);},dependencies:[q3,ns,Qi,Pt,W,H,lt,iH,XN,Tc,R],styles:["[_nghost-%COMP%]     .p-dialog .p-dialog-content{overflow:auto}@supports not selector(::-webkit-scrollbar){[_nghost-%COMP%]     .p-dialog .p-dialog-content{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color) var(--scrollbar-background-color)}}"],changeDetection:1});}}return i})();});export{$,Te as T,_e as _,ee as e};