import{a as N}from"./chunk-6ZKGRR6F.js";import{a as E}from"./chunk-VCR32QDE.js";import"./chunk-HSBVAXVK.js";import{b as C}from"./chunk-MOT3DGUI.js";import"./chunk-MJMWESWV.js";import{a as g}from"./chunk-PKUFMOZE.js";import{V as w}from"./chunk-52M7WMZM.js";import"./chunk-FCHM4KKB.js";import"./chunk-HZCNZJUF.js";import{g as x}from"./chunk-DFEQHBPN.js";import{c as b}from"./chunk-ZEBPBUY2.js";import"./chunk-Q7WVU44Z.js";import"./chunk-W5A7VAW2.js";import"./chunk-UGQL4IPH.js";import"./chunk-4TDNJBFX.js";import"./chunk-LI2NM675.js";import"./chunk-M2LMD7BR.js";import"./chunk-YK4A5QUC.js";import"./chunk-I6HXBYFU.js";import{p as y}from"./chunk-AVXTYPYF.js";import"./chunk-HNZDUL32.js";import"./chunk-5EZRMHVZ.js";import{$b as r,Hc as i,Ic as v,Kb as m,Lb as S,Nd as u,Td as k,ic as e,jc as t,kc as d,od as p,ra as f,xb as c,yb as h}from"./chunk-HEIW4SFT.js";k();p();var A=(()=>{class a{static{this.\u0275fac=function(n){return new(n||a)}}static{this.\u0275cmp=m({type:a,selectors:[["paw-sb-guide-notification-a"]],inputs:{randomNumber:"randomNumber"},standalone:!1,decls:6,vars:1,consts:[[1,"far","fa-home","paw-margin-right-m"],[1,"paw-font-size-l"]],template:function(n,o){n&1&&(e(0,"div"),d(1,"span",0),e(2,"span"),i(3,"Opened with random number "),e(4,"span",1),i(5),t()()()),n&2&&(c(5),v(o.randomNumber))},encapsulation:2})}}return a})();p();var O=(()=>{class a{constructor(l){this.notificationService=l,this.notify={id:"example-00",label:"Show snackbar notification",type:"paw-icon-btn",onSelected:()=>{this.notificationService.notify({text:"This is a snackbar notification example with custom text"})}},this.notify1={id:"example-01",label:"Show snackbar notification",type:"paw-icon-btn",onSelected:()=>{this.notificationService.notify({text:"This is a snackbar notification example with custom text",onClose:()=>{console.log("Notification closed")}})}},this.notify2={id:"example-02",label:"Show snackbar notification",type:"paw-icon-btn",onSelected:()=>{this.notificationService.notify({component:A,bind:{randomNumber:E.randomNumber(1,1e3)}})}},this.notify3={id:"example-03",label:"Show snackbar notification",type:"paw-icon-btn",onSelected:()=>{this.notify3ref=this.notificationService.notify({text:"This is a snackbar notification example with custom text",actions:[{id:"custom-action-1",label:"Action 1",onSelected:()=>{console.log("Action 1 selected")}},{id:"custom-action-2",label:"Action 2",moreMenu:{actions:[{id:"custom-action-2-1",label:"Action 2.1",onSelected:()=>{console.log("Action 2.1 selected")}}]}},{id:"custom-action-3",label:"Action 3 - close",onSelected:()=>{console.log("Action 3 selected, closes notification"),this.notify3ref?.close()}}]})}},this.notifyShort1={id:"notify-short",label:"Show saved",type:"paw-icon-btn",onSelected:(n,o,s)=>{this.notificationService.saved()}},this.notifyShort2={id:"notify-short",label:"Show sent",type:"paw-icon-btn",onSelected:(n,o,s)=>{this.notificationService.sent()}},this.notifyShort3={id:"notify-short",label:"Show deleted",type:"paw-icon-btn",onSelected:(n,o,s)=>{this.notificationService.deleted()}},this.notifyShort4={id:"notify-short",label:"Show deleted with Undo action",type:"paw-icon-btn",onSelected:(n,o,s)=>{this.notificationService.deleted(()=>{console.log("Undo deletion action executed")})}},this.notifyShort5={id:"notify-short",label:"Show error",type:"paw-icon-btn",onSelected:(n,o,s)=>{this.notificationService.error("This is an error notification example")}}}ngOnDestroy(){this.notificationService.dismiss()}static{this.\u0275fac=function(n){return new(n||a)(h(C))}}static{this.\u0275cmp=m({type:a,selectors:[["paw-sb-guide-notification"]],standalone:!1,decls:76,vars:14,consts:[[1,"paw-padding-m"],[1,""],["rows","6","disabled","",1,"sb-example-code"],[1,"paw-font-size-m"],[1,"paw-area-h","paw-padding-m"],[1,"paw-col","paw-col-8","paw-offset-right"],[1,"paw-col","paw-col-4","sb-example-podium"],[3,"action"],["rows","12","disabled","",1,"sb-example-code"],["rows","25","disabled","",1,"sb-example-code"],[3,"id","action"]],template:function(n,o){n&1&&(e(0,"div",0)(1,"span",1)(2,"code"),i(3,"NotificationModule"),t(),i(4," must be imported in your module in order to use notifications."),t()(),e(5,"div",0)(6,"span"),i(7,"Inject "),e(8,"code"),i(9,"NotificationService"),t(),i(10," in your component constructor."),t()(),e(11,"div",0)(12,"span"),i(13,"We dismiss any potentially opened notifications in "),e(14,"code"),i(15,"ngOnDestroy()"),t(),i(16," lifecycle hook. NOTE: Notifications with High duration priority will not be dismissed."),t(),e(17,"textarea",2),i(18,`ngOnDestroy(): void {
    this.notificationService.dismiss();
}
    `),t()(),e(19,"div",0)(20,"span",3),i(21,"Simple text"),t()(),e(22,"div",4)(23,"div",5)(24,"textarea",2),i(25,`...
this.notificationService.notify({
    text: 'This is a snackbar notification example with custom text',
});
...
        `),t()(),e(26,"div",6),d(27,"paw-action",7),t()(),e(28,"div",0)(29,"span",3),i(30,"On close callback"),t()(),e(31,"div",4)(32,"div",5)(33,"textarea",2),i(34,`...
this.notificationService.notify({
    text: 'This is a snackbar notification example with custom text',
    onClose: () => {
        console.log("Notification closed");
    }
});
...
        `),t()(),e(35,"div",6),d(36,"paw-action",7),t()(),e(37,"div",0)(38,"span",3),i(39,"Custom content component"),t()(),e(40,"div",4)(41,"div",5)(42,"textarea",8),i(43,`...
this.notificationService.notify({
    component: MyComponent,
    bind: {
        randomNumber: RandomUtils.randomNumber(1, 1000)
    };
});
...
        `),t()(),e(44,"div",6),d(45,"paw-action",7),t()(),e(46,"div",0)(47,"span",3),i(48,"Custom actions"),t()(),e(49,"div",0)(50,"span"),i(51,' By default "Close" action is always displayed in the notification. We can remove it by setting an empty actions array in definition. '),t()(),e(52,"div",4)(53,"div",5)(54,"textarea",9),i(55,`...
private notifRef?:NotificationRef;
...
this.notificationService.notify({
    text: 'This is a snackbar notification example with custom text',
    actions: [
        {
            id: 'custom-action-1',
            label: 'Action 1',
            onSelected: () => { console.log('Action 1 selected'); }
        },
        {
            id: 'custom-action-2',
            label: 'Action 2',
            moreMenu: {
                actions: [
                    {
                        id: 'custom-action-2-1',
                        label: 'Action 2.1',
                        onSelected: () => { console.log('Action 2.1 selected'); }
                    }
                ]
            }
        },
        {
            id: 'custom-action-3',
            label: 'Action 3',
            onSelected: () => {
                console.log('Action 3 selected, closes notification');
                this.notify3ref?.close();
            }
        },
    ]
});
...
        `),t()(),e(56,"div",6),d(57,"paw-action",7),t()(),e(58,"div",0)(59,"span",3),i(60,"Prepared shorthand notifications"),t()(),e(61,"div",4)(62,"div",5)(63,"textarea",9),i(64,`// saved
this.notificationService.saved();

// sent
this.notificationService.sent();

// deleted
this.notificationService.deleted();

// deleted with "undo" action
this.notificationService.deleted(() => {
    return this.myService.undoDelete();
});

// error
this.notificationService.error("This is an error notification example");

        `),t()(),e(65,"div",6)(66,"div"),d(67,"paw-action",10),t(),e(68,"div"),d(69,"paw-action",10),t(),e(70,"div"),d(71,"paw-action",10),t(),e(72,"div"),d(73,"paw-action",10),t(),e(74,"div"),d(75,"paw-action",10),t()()()),n&2&&(c(27),r("action",o.notify),c(9),r("action",o.notify1),c(9),r("action",o.notify2),c(12),r("action",o.notify3),c(10),r("id","saved")("action",o.notifyShort1),c(2),r("id","sent")("action",o.notifyShort2),c(2),r("id","deleted")("action",o.notifyShort3),c(2),r("id","deleted-undo")("action",o.notifyShort4),c(2),r("id","error")("action",o.notifyShort5))},dependencies:[b],styles:["[_nghost-%COMP%]   .sb-example-podium[_ngcontent-%COMP%]{padding:16px;border:1px solid var(--paw-color-divider);border-radius:6px}[_nghost-%COMP%]   .sb-example-code[_ngcontent-%COMP%]{width:100%;resize:none;padding:4px}[_nghost-%COMP%]   .sb-example-outline[_ngcontent-%COMP%]{border:1px dashed var(--paw-color-divider)}[_nghost-%COMP%]   code[_ngcontent-%COMP%]{color:#8d0101;padding:4px;background:var(--paw-color-page-bg);border-radius:4px}"]})}}return a})();p();var J=(()=>{class a{static{this.\u0275fac=function(n){return new(n||a)}}static{this.\u0275mod=S({type:a})}static{this.\u0275inj=f({imports:[u,x,w,N,g,y.forChild([{path:"",component:O}])]})}}return a})();export{J as SbGuideNotificationModule};
