import{Aa as f,Cc as k,Gb as m,Hb as p,Jb as d,Lb as o,Qa as r,Tb as w,Ub as v,Yb as y,Zb as u,_b as D,ab as C,eb as M,md as b,na as a,nd as P,oa as c,qb as x,sb as h,xb as g,yb as l,za as _,zb as s}from"./chunk-RGCH6K7F.js";import"./chunk-W7GRJBO5.js";var V=["dialog"];function S(t,E){if(t&1){let e=p();l(0,"dialog",2,0),d("click",function(i){a(e);let O=o();return c(O.handleDialogClick(i))}),l(2,"section")(3,"div",3)(4,"button",2),d("click",function(){a(e);let i=o();return c(i.closeDialog())}),l(5,"span",4),D(6,"close"),s()()(),m(7,5),s()()}if(t&2){let e=o();u(e.theme.components.Modal.backdrop),r(2),y(e.theme.additionalStyles==null?null:e.theme.additionalStyles.Modal),u(e.theme.components.Modal.element),r(5),g("surfaceId",e.surfaceId())("component",e.component().properties.contentChild)}}function T(t,E){if(t&1){let e=p();l(0,"section",2),d("click",function(){a(e);let i=o();return c(i.showDialog.set(!0))}),m(1,5),s()}if(t&2){let e=o();r(),g("surfaceId",e.surfaceId())("component",e.component().properties.entryPointChild)}}var j=(()=>{class t extends b{showDialog=_(!1);dialog=k("dialog");constructor(){super(),f(()=>{let e=this.dialog();e&&!e.nativeElement.open&&e.nativeElement.showModal()})}handleDialogClick(e){e.target instanceof HTMLDialogElement&&this.closeDialog()}closeDialog(){let e=this.dialog();e&&(e.nativeElement.open||e.nativeElement.close(),this.showDialog.set(!1))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=C({type:t,selectors:[["a2ui-modal"]],viewQuery:function(n,i){n&1&&w(i.dialog,V,5),n&2&&v()},features:[M],decls:2,vars:1,consts:[["dialog",""],[3,"class"],[3,"click"],[1,"controls"],[1,"g-icon"],["a2ui-renderer","",3,"surfaceId","component"]],template:function(n,i){n&1&&x(0,S,8,8,"dialog",1)(1,T,2,2,"section"),n&2&&h(i.showDialog()?0:1)},dependencies:[P],styles:["dialog[_ngcontent-%COMP%]{padding:0;border:none;background:none}dialog[_ngcontent-%COMP%]   section[_ngcontent-%COMP%]   .controls[_ngcontent-%COMP%]{display:flex;justify-content:end;margin-bottom:4px}dialog[_ngcontent-%COMP%]   section[_ngcontent-%COMP%]   .controls[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:0;background:none;width:20px;height:20px;pointer:cursor;border:none;cursor:pointer}"]})}return t})();export{j as Modal};
