"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6618],{17589:(L,i,t)=>{t.r(i),t.d(i,{default:()=>M});var e=t(85960),s=t(30694),g=t(8958),r=t(3693),f=t(65892);const d=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(9244),t.e(4339),t.e(5970),t.e(335)]).then(t.bind(t,35970))),h=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(6026),t.e(5482),t.e(2815),t.e(3293)]).then(t.bind(t,83293))),E=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(6026),t.e(5482),t.e(2815),t.e(710)]).then(t.bind(t,50710))),v=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(6026),t.e(5624),t.e(5864)]).then(t.bind(t,85864))),P=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(6026),t.e(5624),t.e(2900)]).then(t.bind(t,42900))),u=(0,r.Q)(()=>Promise.all([t.e(5482),t.e(5799)]).then(t.bind(t,95799))),m=(0,r.Q)(()=>Promise.all([t.e(3638),t.e(6026),t.e(5624),t.e(5222)]).then(t.bind(t,35222))),C=O=>e.createElement(f.O,{navId:"receivers",accessType:"notification"},e.createElement(s.rs,null,e.createElement(s.AW,{exact:!0,path:"/alerting/notifications",component:d}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/receivers/new",component:E}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/receivers/:name/edit",component:h}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/templates/:name/edit",component:v}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/templates/new",component:P}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/templates/:name/duplicate",component:m}),e.createElement(s.AW,{exact:!0,path:"/alerting/notifications/global-config",component:u}))),M=(0,g.Pf)(C,{style:"page"})},65892:(L,i,t)=>{t.d(i,{J:()=>W,O:()=>F});var e=t(85960),s=t(8134),g=t(20989),r=t(90857),f=t(79055),d=t(66681),h=t(6753),E=t(47257),v=t(74042),P=t(14607),u=t(29165),m=t(49199);const C=({localStoreKey:n,startClosed:l=!1,severity:a="error",collapseText:c,collapseTooltip:y,collapseJustify:A="flex-end",alertTitle:o,children:V})=>{const Y=(0,E.l4)(),z=M(Y,a),[x,D]=(0,h.Z)(n,l);return e.createElement(e.Fragment,null,x&&e.createElement(v.Lh,{justify:A},e.createElement(P.u,{content:y,placement:"bottom"},e.createElement(u.zx,{fill:"text",variant:"secondary",icon:(0,m.j)(a),className:z.warningButton,onClick:()=>D(!1)},c))),!x&&e.createElement(m.b,{severity:a,title:o,onRemove:()=>D(!0)},V))},M=(n,l)=>{const a=n.colors[l];return{warningButton:(0,d.css)({color:a.text,"&:hover":{background:a.transparent}})}},O="grafana.unifiedalerting.upgrade.previewNotice",S=()=>r.config.unifiedAlertingEnabled||!r.config.featureToggles.alertingPreviewUpgrade?null:e.createElement(C,{localStoreKey:O,alertTitle:"This is a preview of the upgraded Grafana Alerting",collapseText:"Grafana Alerting Preview",collapseTooltip:"Show preview warning",severity:"warning"},e.createElement("p",null,"No rules are being evaluated and legacy alerting is still running.",e.createElement("br",null),"Please contact your administrator to upgrade permanently."),e.createElement(f.h,{external:!0,href:"https://grafana.com/docs/grafana/latest/alerting/set-up/migrating-alerts/"},"Read about upgrading"));var T=t(84954),N=t(84933),I=t(27436),R=t(76679);function U(n){return n.name===R.GC?"Grafana":n.name.slice(0,37)}const B=({disabled:n=!1})=>{const l=(0,E.wW)(K),{selectedAlertmanager:a,availableAlertManagers:c,setSelectedAlertmanager:y}=(0,T.ZA)(),A=(0,e.useMemo)(()=>c.map(o=>({label:U(o),value:o.name,imgUrl:o.imgUrl,meta:o.meta})),[c]);return e.createElement(N._,{className:l.field,label:n?"Alertmanager":"Choose Alertmanager",disabled:n||A.length===1,"data-testid":"alertmanager-picker"},e.createElement(I.Ph,{"aria-label":n?"Alertmanager":"Choose Alertmanager",width:29,className:"ds-picker select-container",backspaceRemovesValue:!1,onChange:o=>{o?.value&&y(o.value)},options:A,maxMenuHeight:500,noOptionsMessage:"No datasources found",value:a,getOptionLabel:o=>o.label}))},K=n=>({field:(0,d.css)`
    margin: 0;
  `}),G=()=>e.createElement(m.b,{title:"No Alertmanager found",severity:"warning"},"We could not find any external Alertmanagers and you may not have access to the built-in Grafana Alertmanager."),Q=()=>e.createElement(m.b,{title:"Selected Alertmanager not found.",severity:"warning"},"The selected Alertmanager no longer exists or you may not have permission to access it. You can select a different Alertmanager from the dropdown."),p=({availableAlertManagers:n})=>{const l=n.length>0;return e.createElement("div",null,l?e.createElement(Q,null):e.createElement(G,null))},W=({children:n,isLoading:l,...a})=>e.createElement(g.T,{...a},e.createElement(g.T.Contents,{isLoading:l},e.createElement("div",null,e.createElement(S,null),n))),F=({children:n,accessType:l,...a})=>{const c=Z();return e.createElement(T.h5,{accessType:l},e.createElement(W,{...a,actions:e.createElement(B,{disabled:c})},e.createElement(j,null,n)))};function Z(){const n=(0,s.Z)();return["/edit","/new"].some(a=>n?.pathname?.includes(a))}const j=({children:n})=>{const{availableAlertManagers:l,selectedAlertmanager:a}=(0,T.ZA)();return a?e.createElement(e.Fragment,null,n):e.createElement(p,{availableAlertManagers:l})}}}]);

//# sourceMappingURL=NotificationsListPage.e08295fa8e0cf0925249.js.map