import{a as m}from"./chunk-YFD64PBL.js";import"./chunk-54KCU5AE.js";import"./chunk-MJMWESWV.js";import{c as E,e as q}from"./chunk-XIVGJNTN.js";import{f as j}from"./chunk-YXII5GZB.js";import{g as C}from"./chunk-ZVSE3X37.js";import"./chunk-XBVGOYFB.js";import{C as V,R as $,g as N,o as A,s as R,t as G}from"./chunk-ZTDS3DNS.js";import"./chunk-PQUUPIVM.js";import"./chunk-LLMEQ7XK.js";import{E as T,v}from"./chunk-ES7DY2DS.js";import"./chunk-XU5DJZLA.js";import"./chunk-4TDNJBFX.js";import{p as M}from"./chunk-52PVRKG2.js";import"./chunk-SL537SOB.js";import{Ac as b,Ba as S,Bc as y,Ca as w,Eb as f,Fb as h,Fd as I,Kb as p,Vb as a,Vc as F,bc as i,cc as r,dc as g,hc as x,kc as D,la as _,mc as d,rb as n,sb as s,td as u,ud as O}from"./chunk-PJGPU3FT.js";function z(e,l){if(e&1&&(i(0,"div"),g(1,"paw-input-field",5),r()),e&2){let t=l.$implicit,o=d();n(),a("field",t)("model",o.dataModel)("form",o.formGroup)}}function J(e,l){if(e&1&&(i(0,"div",6),g(1,"paw-action",7),r()),e&2){let t=l.$implicit;n(),a("action",t)}}var U=(()=>{class e{constructor(t){this.dialogService=t,this.formGroup=new N([]),this.fields=[{id:"text",label:"Demo",required:!0,component:R},{id:"switch",label:"Demo",component:V},{id:"textarea",label:"Demo",component:G}],this.dataModel={text:m.randomName(),switch:m.randomBoolean(),textarea:m.randomName()+`
`+m.randomFullName()+`
`+m.randomColor()},this.actions=[{id:"submit",label:"Submit",type:"mat-flat-button",formGroup:this.formGroup,onSelected:()=>{this.dialogService.open({text:"Form submitted"}),this.dialogRef.close()}}]}ngOnInit(){}ngOnDestroy(){}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog-content"]],inputs:{dialogRef:"dialogRef"},standalone:!1,decls:6,vars:2,consts:[[4,"ngFor","ngForOf"],[1,"paw-area-h"],[1,"paw-col-d"],[1,"paw-col","paw-area-h"],["class","paw-col",4,"ngFor","ngForOf"],[3,"field","model","form"],[1,"paw-col"],[3,"action"]],template:function(o,c){o&1&&(i(0,"div"),p(1,z,2,3,"div",0),i(2,"div",1),g(3,"div",2),i(4,"div",3),p(5,J,2,1,"div",4),r()()()),o&2&&(n(),a("ngForOf",c.fields),n(4),a("ngForOf",c.actions))},dependencies:[u,A,v],encapsulation:2})}}return e})();function K(e,l){if(e&1&&(i(0,"div",7)(1,"span",8),b(2),r()()),e&2){let t=d().$implicit;n(2),y(t.title)}}function L(e,l){if(e&1){let t=x();i(0,"div",2),p(1,K,3,1,"div",4),i(2,"div",5)(3,"paw-action",6),D("selected",function(){let c=S(t).$implicit,P=d(2);return w(P.onOpenDialog(c))}),r()()()}if(e&2){let t=l.$implicit,o=d(2);n(),a("ngIf",t.title),n(2),a("id",o.dialogOpenAction.id+"-"+t.id)("action",o.dialogOpenAction)}}function X(e,l){if(e&1&&(i(0,"div",2),p(1,L,4,3,"div",3),r()),e&2){let t=d();n(),a("ngForOf",t.dialogCases)}}var B=(()=>{class e{constructor(t){this.dialogService=t,this.mainHeaderDef={viewSwitch:{viewTitle:"PAW Dialog"}},this.dialogCases=[{id:"text-only",title:"Text only",onShow:()=>{this.dialogService.open({text:m.loremIpsum()})}},{id:"question",title:"Question",onShow:()=>{this.dialogService.openTyped({text:m.loremIpsum(),onConfirm:()=>{}})}},{id:"component",title:"Component",onShow:()=>{this.dialogService.open({component:U})}}],this.dialogOpenAction={id:"open-dialog",type:"mat-flat-button",label:"Open dialog"}}ngOnInit(){}ngOnDestroy(){}onOpenDialog(t){t.onShow()}static{this.\u0275fac=function(o){return new(o||e)(s(C))}}static{this.\u0275cmp=f({type:e,selectors:[["paw-sb-dialog"]],standalone:!1,decls:3,vars:1,consts:[["contentTpl",""],[3,"headerDef"],[1,""],["class","",4,"ngFor","ngForOf"],["class","paw-offset-s",4,"ngIf"],[1,"paw-offset"],[3,"selected","id","action"],[1,"paw-offset-s"],[1,"paw-text-l","paw-noselect"]],template:function(o,c){o&1&&(i(0,"paw-main-view",1),p(1,X,2,1,"ng-template",null,0,F),r()),o&2&&a("headerDef",c.mainHeaderDef)},dependencies:[u,O,E,v],encapsulation:2})}}return e})();var _e=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275mod=h({type:e})}static{this.\u0275inj=_({imports:[I,q,$,T,j,M.forChild([{path:"",component:B}])]})}}return e})();export{_e as SbDialogModule};
