"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9224],{90263(U,d,e){e.r(d),e.d(d,{default:()=>W});var t=e(14553),l=e(54148),a=e(52358),s=e(64702),r=e(13400),m=e(33100),p=e(51389),L=e(57440),u=e(30465),v=e(71897),M=e(47062),C=e(29959),x=e(93621),D=e(6736),f=e(77628),T=e(25877),N=e(36860),y=e(63184);const V=(0,t.jsx)(p.L,{entity:"Notification template"}),F=()=>{const{selectedAlertmanager:n}=(0,v.VI)(),{name:i}=(0,l.g)(),o=i?decodeURIComponent(i):void 0,{currentData:c,isLoading:j,error:g}=(0,y.J2)({alertmanager:n??"",uid:o??""}),{currentData:h,isLoading:G,error:H}=(0,y.cC)({alertmanager:n??""}),K=j||G,E=g||H;if(!n)return(0,t.jsx)(p.L,{entity:"Alertmanager"});if(!o)return(0,t.jsx)(p.L,{entity:"Notification template"});if(K)return(0,t.jsx)(r._,{text:(0,a.t)("alerting.duplicate-message-template.text-loading-notification-template","Loading notification template")});if(E)return(0,L.E)(E)?V:(0,t.jsx)(m.F,{title:(0,a.t)("alerting.duplicate-message-template.title-error-loading-notification-template","Error loading notification template"),severity:"error",children:(0,C.JZ)(E)});if(!c)return V;const O=(0,M.V)(c.title,h?.map(Q=>Q.title)??[]);return(0,t.jsx)(N.By,{alertmanager:n,prefill:{title:O,content:(0,D.a)(c.content)}})};function A(){const{navId:n}=(0,u.yy)(),i=s.$.featureToggles.alertingNavigationV2,o=(0,x.UE)(i);return(0,t.jsx)(T.y,{navId:n,accessType:"notification",pageNav:{id:"templates",text:(0,a.t)("alerting.notification-templates.duplicate.title","Duplicate notification template group"),subTitle:(0,a.t)("alerting.notification-templates.duplicate.subTitle","Duplicate a group of notification templates"),parentItem:{text:(0,a.t)("alerting.common.titles.notification-templates","Notification Templates"),url:o}},children:(0,t.jsx)(F,{})})}const $=(0,f.S)(A),I=(0,t.jsx)(p.L,{entity:"Notification template"}),B=()=>{const{name:n}=(0,l.g)(),i=n?decodeURIComponent(n):void 0,{selectedAlertmanager:o}=(0,v.VI)(),{currentData:c,isLoading:j,error:g,isUninitialized:h}=(0,y.J2)({alertmanager:o??"",uid:i??""});return i?j||h?(0,t.jsx)(r._,{text:(0,a.t)("alerting.edit-message-template.text-loading-template","Loading template...")}):g?(0,L.E)(g)?I:(0,t.jsx)(m.F,{severity:"error",title:(0,a.t)("alerting.edit-message-template.title-failed-to-fetch-notification-template","Failed to fetch notification template"),children:(0,C.JZ)(g)}):c?(0,t.jsx)(N.By,{alertmanager:o??"",originalTemplate:c}):I:(0,t.jsx)(p.L,{entity:"Notification template"})};function J(){const{navId:n}=(0,u.yy)(),i=s.$.featureToggles.alertingNavigationV2,o=(0,x.UE)(i);return(0,t.jsx)(T.y,{navId:n,accessType:"notification",pageNav:{id:"templates",text:(0,a.t)("alerting.notification-templates.edit.title","Edit notification template group"),subTitle:(0,a.t)("alerting.notification-templates.edit.subTitle","Edit a group of notification templates"),parentItem:{text:(0,a.t)("alerting.common.titles.notification-templates","Notification Templates"),url:o}},children:(0,t.jsx)(B,{})})}const P=(0,f.S)(J);function S(){const{navId:n}=(0,u.yy)(),i=s.$.featureToggles.alertingNavigationV2,o=(0,x.UE)(i);return(0,t.jsx)(T.y,{navId:n,accessType:"notification",pageNav:{id:"templates",text:(0,a.t)("alerting.notification-templates.new.title","New notification template group"),subTitle:(0,a.t)("alerting.notification-templates.new.subTitle","Create a new group of notification templates"),parentItem:{text:(0,a.t)("alerting.common.titles.notification-templates","Notification Templates"),url:o}},children:(0,t.jsx)(R,{})})}function R(){const{selectedAlertmanager:n}=(0,v.VI)();return(0,t.jsx)(N.By,{alertmanager:n??""})}const Z=(0,f.S)(S);function z(){return(0,t.jsxs)(l.BV,{children:[(0,t.jsx)(l.qh,{path:"new",element:(0,t.jsx)(Z,{})}),(0,t.jsx)(l.qh,{path:":name/edit",element:(0,t.jsx)(P,{})}),(0,t.jsx)(l.qh,{path:":name/duplicate",element:(0,t.jsx)($,{})})]})}const W=(0,f.S)(z)},47062(U,d,e){e.d(d,{V:()=>t});function t(l,a){const s=l.replace(/\(copy( [0-9]+)?\)$/,"").trim();let r=`${s} (copy)`;for(let m=2;a.includes(r);m++)r=`${s} (copy ${m})`;return r}}}]);

//# sourceMappingURL=Templates-react19.7769a2c70a12a7818935.js.map