/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */!function(t){function e(e){for(var n,i,o=e[0],u=e[1],a=0,s=[];at instanceof Date),((t,e)=>N.either.chain(I.string.validate(t,e),(n=>{const r=new Date(n);return isNaN(r.getTime())?I.failure(t,e):I.success(r)}))),(t=>t.toISOString())),T=I.type({date:R}),w=I.record(I.string,T),S=I.intersection([I.partial({subgroup:I.string}),I.type({group:I.string,date:R}),I.partial({actions:w})]),L=I.partial({lastScheduledActions:S,flappingHistory:I.array(I.boolean),flapping:I.boolean,maintenanceWindowIds:I.array(I.string),pendingRecoveredCount:I.number,uuid:I.string}),D=I.record(I.string,I.unknown),O=(I.record(I.string,I.unknown),I.partial({state:D,meta:L})),k=I.type({alertId:I.string,alertUuid:I.string,started:I.string,flappingHistory:I.array(I.boolean),flapping:I.boolean,pendingRecoveredCount:I.number}),P=()=>I.type({wrapped:I.record(I.string,I.unknown),trackedAlerts:I.record(I.string,k),trackedAlertsRecovered:I.record(I.string,k)});let W;!function(t){t.COMPLETE="complete",t.PARTIAL="partial"}(W||(W={}));const x=I.partial({alertTypeState:I.record(I.string,I.unknown),alertInstances:I.record(I.string,O),alertRecoveredInstances:I.record(I.string,O),previousStartedAt:I.union([I.null,R]),summaryActions:w}),M=I.intersection([I.type({alertId:I.string}),I.partial({spaceId:I.string})]);var U=n(1);const C=Object.freeze({id:"recovered",name:U.i18n.translate("xpack.alerting.builtinActionGroups.recovered",{defaultMessage:"Recovered"})});function G(t){return[null!=t?t:C]}const F={[C.id]:[".jira",".servicenow",".resilient"]},j=new Map(Object.entries(F));function B(t,e){return j.has(t)&&j.get(t).includes(e)}const H=["onActionGroupChange","onActiveAlert","onThrottleInterval"];let V;function $(t){if(!H.includes(t))return`string is not a valid RuleNotifyWhenType: ${t}`}!function(t){t.CHANGE="onActionGroupChange",t.ACTIVE="onActiveAlert",t.THROTTLE="onThrottleInterval"}(V||(V={}));var q=n(4);const z=["timestamp","execution_duration","total_search_duration","es_search_duration","schedule_delay","num_triggered_actions","num_generated_actions","num_active_alerts","num_recovered_alerts","num_new_alerts"],K=["@timestamp","event.start","event.end","event.duration","event.action"],J={success:0,unknown:0,failure:0,warning:0,activeAlerts:0,newAlerts:0,recoveredAlerts:0,erroredActions:0,triggeredActions:0},Y=t=>{const{maxTags:e=50}=t||{};return{status:{terms:{field:"alert.attributes.executionStatus.status"}},outcome:{terms:{field:"alert.attributes.lastRun.outcome"}},enabled:{terms:{field:"alert.attributes.enabled"}},muted:{terms:{field:"alert.attributes.muteAll"}},tags:{terms:{field:"alert.attributes.tags",order:{_key:"asc"},size:e}},snoozed:{nested:{path:"alert.attributes.snoozeSchedule"},aggs:{count:{filter:{exists:{field:"alert.attributes.snoozeSchedule.duration"}}}}}}},X=t=>{var e,n,o,u,a,c,s,l,f,d,p,g;if(!t){const t={ruleExecutionStatus:{},ruleLastRunOutcome:{},ruleEnabledStatus:{enabled:0,disabled:0},ruleMutedStatus:{muted:0,unmuted:0},ruleSnoozedStatus:{snoozed:0},ruleTags:[]};for(const e of r)t.ruleExecutionStatus[e]=0;return t}const _=t.status.buckets.map((({key:t,doc_count:e})=>({[t]:e}))),h=t.outcome.buckets.map((({key:t,doc_count:e})=>({[t]:e}))),m=t.enabled.buckets,y=t.muted.buckets,v={ruleExecutionStatus:_.reduce(((t,e)=>Object.assign(t,e)),{}),ruleLastRunOutcome:h.reduce(((t,e)=>Object.assign(t,e)),{}),ruleEnabledStatus:{enabled:null!==(e=null===(n=m.find((t=>1===t.key)))||void 0===n?void 0:n.doc_count)&&void 0!==e?e:0,disabled:null!==(o=null===(u=m.find((t=>0===t.key)))||void 0===u?void 0:u.doc_count)&&void 0!==o?o:0},ruleMutedStatus:{muted:null!==(a=null===(c=y.find((t=>1===t.key)))||void 0===c?void 0:c.doc_count)&&void 0!==a?a:0,unmuted:null!==(s=null===(l=y.find((t=>0===t.key)))||void 0===l?void 0:l.doc_count)&&void 0!==s?s:0},ruleSnoozedStatus:{snoozed:null!==(f=null===(d=t.snoozed)||void 0===d||null===(p=d.count)||void 0===p?void 0:p.doc_count)&&void 0!==f?f:0},ruleTags:[]};for(const t of r)v.ruleExecutionStatus.hasOwnProperty(t)||(v.ruleExecutionStatus[t]=0);for(const t of i)v.ruleLastRunOutcome.hasOwnProperty(t)||(v.ruleLastRunOutcome[t]=0);const E=(null===(g=t.tags)||void 0===g?void 0:g.buckets)||[];return v.ruleTags=E.map((t=>t.key)),v},Q=t=>{const{maxTags:e=50,after:n}=t||{};return{tags:{composite:{...n?{after:n}:{},size:e,sources:[{tags:{terms:{field:"alert.attributes.tags",order:"asc"}}}]}}}},Z=t=>t?{ruleTags:(t.tags.buckets||[]).map((t=>t.key.tags))}:{ruleTags:[]},tt=[1,2,3,4,5,6,7],et={dynamic:!1,properties:{enabled:{type:"boolean"},name:{type:"text",fields:{keyword:{type:"keyword",normalizer:"lowercase"}}},tags:{type:"keyword"},alertTypeId:{type:"keyword"},schedule:{properties:{interval:{type:"keyword"}}},consumer:{type:"keyword"},legacyId:{type:"keyword"},actions:{dynamic:!1,type:"nested",properties:{group:{type:"keyword"},actionRef:{type:"keyword"},actionTypeId:{type:"keyword"}}},params:{type:"flattened",ignore_above:4096},mapped_params:{properties:{risk_score:{type:"float"},severity:{type:"keyword"}}},scheduledTaskId:{type:"keyword"},createdBy:{type:"keyword"},updatedBy:{type:"keyword"},createdAt:{type:"date"},updatedAt:{type:"date"},throttle:{type:"keyword"},notifyWhen:{type:"keyword"},muteAll:{type:"boolean"},mutedInstanceIds:{type:"keyword"},monitoring:{properties:{run:{properties:{calculated_metrics:{properties:{p50:{type:"long"},p95:{type:"long"},p99:{type:"long"},success_ratio:{type:"float"}}},last_run:{properties:{timestamp:{type:"date"},metrics:{properties:{duration:{type:"long"},total_search_duration_ms:{type:"long"},total_indexing_duration_ms:{type:"long"},total_alerts_detected:{type:"float"},total_alerts_created:{type:"float"},gap_duration_s:{type:"float"}}}}}}}}},revision:{type:"long"},snoozeSchedule:{type:"nested",properties:{id:{type:"keyword"},duration:{type:"long"},skipRecurrences:{type:"date",format:"strict_date_time"}}},executionStatus:{properties:{numberOfTriggeredActions:{type:"long"},status:{type:"keyword"},lastExecutionDate:{type:"date"},lastDuration:{type:"long"},error:{properties:{reason:{type:"keyword"},message:{type:"keyword"}}},warning:{properties:{reason:{type:"keyword"},message:{type:"keyword"}}}}},lastRun:{properties:{outcome:{type:"keyword"},outcomeOrder:{type:"float"},alertsCount:{properties:{active:{type:"float"},new:{type:"float"},recovered:{type:"float"},ignored:{type:"float"}}}}},running:{type:"boolean"}}};let nt;!function(t){t.Running="running",t.Upcoming="upcoming",t.Finished="finished",t.Archived="archived"}(nt||(nt={}));const rt="maintenance-window",it="maintenanceWindow",ot={READ_MAINTENANCE_WINDOW:"read-maintenance-window",WRITE_MAINTENANCE_WINDOW:"write-maintenance-window"},ut="maintenanceWindows",at="management",ct={alerting:{maintenanceWindows:`/${ut}`,maintenanceWindowsCreate:"/create",maintenanceWindowsEdit:"/edit/:maintenanceWindowId"}},st={maintenanceWindows:ut,maintenanceWindowsCreate:"create",maintenanceWindowsEdit:"edit"},lt="MM/DD/YY hh:mm A";var ft=n(7);function dt(t,e="strict"){const n={dynamic:e,properties:{}};return Object.keys(t).map((e=>({name:e,...t[e]}))).forEach((t=>{const{name:e,required:r,array:i,multi_fields:o,...u}=t,a=o?{...u,fields:o.reduce(((t,e)=>(t[e.name]={type:e.type},t)),{})}:u;Object(ft.set)(n.properties,t.name.split(".").join(".properties."),a)})),n}const pt=({name:t,fieldMap:e,dynamic:n,includeSettings:r})=>({name:t,_meta:{managed:!0},template:{settings:{...r?{number_of_shards:1,"index.mapping.total_fields.limit":1e3*Math.ceil(Object.keys(e).length/1e3)+500}:{}},mappings:dt(e,null!=n?n:"strict")}});var gt=n(5);const _t=t=>`${t.split(".").map((t=>Object(gt.capitalize)(t))).join("")}Alert`,ht="/api/alerts",mt="/api/alerting",yt="/internal/alerting",vt=`${yt}/rule/{id}/_snooze`,Et=`${yt}/rules/_find`,At=`${yt}/rules/maintenance_window`,bt=`${At}/_active`,It="alerts",Nt=200,Rt=!0},function(t,e,n){t.exports=n(8)(1465)},function(t,e,n){"use strict";n.r(e),n.d(e,"parseDuration",(function(){return a})),n.d(e,"formatDuration",(function(){return c})),n.d(e,"getDurationNumberInItsUnit",(function(){return s})),n.d(e,"getDurationUnitValue",(function(){return l})),n.d(e,"validateDurationSchema",(function(){return f}));const r=/^[1-9][0-9]*s$/,i=/^[1-9][0-9]*m$/,o=/^[1-9][0-9]*h$/,u=/^[1-9][0-9]*d$/;function a(t){const e=parseInt(t,10);if(d(t))return 1e3*e;if(p(t))return 60*e*1e3;if(g(t))return 60*e*60*1e3;if(_(t))return 24*e*60*60*1e3;throw new Error(`Invalid duration "${t}". Durations must be of the form {number}x. Example: 5s, 5m, 5h or 5d"`)}function c(t,e){const n=parseInt(t,10);if(d(t))return`${n} ${e?n>1?"seconds":"second":"sec"}`;if(p(t))return`${n} ${e?n>1?"minutes":"minute":"min"}`;if(g(t))return`${n} ${e?n>1?"hours":"hour":"hr"}`;if(_(t))return`${n} ${n>1?"days":"day"}`;throw new Error(`Invalid duration "${t}". Durations must be of the form {number}x. Example: 5s, 5m, 5h or 5d"`)}function s(t){return parseInt(t.replace(/[^0-9.]/g,""),10)}function l(t){const e=s(t);return t.replace(e.toString(),"")}function f(t){if(!(t.match(r)||t.match(i)||t.match(o)||t.match(u)))return"string is not a valid duration: "+t}function d(t){return r.test(t)}function p(t){return i.test(t)}function g(t){return o.test(t)}function _(t){return u.test(t)}},function(t,e){t.exports=__kbnSharedDeps__.Lodash},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apS=e.apSW=e.bind=e.bindW=e.bindTo=e.exists=e.elem=e.toError=e.either=e.getValidationMonoid=e.MonadThrow=e.ChainRec=e.Extend=e.Alt=e.Bifunctor=e.Traversable=e.Foldable=e.Monad=e.Applicative=e.Functor=e.getValidationSemigroup=e.getValidation=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getApplyMonoid=e.getApplySemigroup=e.getSemigroup=e.getEq=e.getShow=e.URI=e.throwError=e.sequence=e.traverse=e.reduceRight=e.foldMap=e.reduce=e.duplicate=e.extend=e.alt=e.flatten=e.chainFirst=e.chainFirstW=e.chain=e.chainW=e.of=e.apSecond=e.apFirst=e.ap=e.apW=e.mapLeft=e.bimap=e.map=e.filterOrElse=e.orElse=e.swap=e.getOrElse=e.getOrElseW=e.fold=e.fromPredicate=e.fromOption=e.stringifyJSON=e.parseJSON=e.tryCatch=e.fromNullable=e.right=e.left=e.isRight=e.isLeft=void 0;var r=n(11),i=n(12);function o(t,n){try{return e.right(t())}catch(t){return e.left(n(t))}}e.isLeft=function(t){return"Left"===t._tag},e.isRight=function(t){return"Right"===t._tag},e.left=function(t){return{_tag:"Left",left:t}},e.right=function(t){return{_tag:"Right",right:t}},e.fromNullable=function(t){return function(n){return null==n?e.left(t):e.right(n)}},e.tryCatch=o,e.parseJSON=function(t,e){return o((function(){return JSON.parse(t)}),e)},e.stringifyJSON=function(t,e){return o((function(){return JSON.stringify(t)}),e)},e.fromOption=function(t){return function(n){return"None"===n._tag?e.left(t()):e.right(n.value)}},e.fromPredicate=function(t,n){return function(r){return t(r)?e.right(r):e.left(n(r))}},e.fold=function(t,n){return function(r){return e.isLeft(r)?t(r.left):n(r.right)}},e.getOrElseW=function(t){return function(n){return e.isLeft(n)?t(n.left):n.right}},e.getOrElse=e.getOrElseW,e.swap=function(t){return e.isLeft(t)?e.right(t.left):e.left(t.right)},e.orElse=function(t){return function(n){return e.isLeft(n)?t(n.left):n}},e.filterOrElse=function(t,n){return e.chain((function(r){return t(r)?e.right(r):e.left(n(r))}))};var u=function(t,n){return i.pipe(t,e.map(n))},a=function(t,n){return i.pipe(t,e.ap(n))},c=function(t,n){return i.pipe(t,e.chain(n))},s=function(t,n,r){return i.pipe(t,e.reduce(n,r))},l=function(t){return function(n,r){var o=e.foldMap(t);return i.pipe(n,o(r))}},f=function(t,n,r){return i.pipe(t,e.reduceRight(n,r))},d=function(t){var n=e.traverse(t);return function(t,e){return i.pipe(t,n(e))}},p=function(t,n,r){return i.pipe(t,e.bimap(n,r))},g=function(t,n){return i.pipe(t,e.mapLeft(n))},_=function(t,n){return i.pipe(t,e.alt(n))},h=function(t,n){return i.pipe(t,e.extend(n))},m=function(t,n){return r.tailRec(n(t),(function(t){return e.isLeft(t)?e.right(e.left(t.left)):e.isLeft(t.right)?e.left(n(t.right.left)):e.right(e.right(t.right.right))}))};function y(t){return{concat:function(n,r){return e.isLeft(n)?n:e.isLeft(r)?r:e.right(t.concat(n.right,r.right))}}}function v(t){var n=e.left(t.empty);return{URI:e.URI,_E:void 0,map:u,compact:function(t){return e.isLeft(t)?t:"None"===t.right._tag?n:e.right(t.right.value)},separate:function(t){return e.isLeft(t)?{left:t,right:t}:e.isLeft(t.right)?{left:e.right(t.right.left),right:n}:{left:n,right:e.right(t.right.right)}},filter:function(t,r){return e.isLeft(t)||r(t.right)?t:n},filterMap:function(t,r){if(e.isLeft(t))return t;var i=r(t.right);return"None"===i._tag?n:e.right(i.value)},partition:function(t,r){return e.isLeft(t)?{left:t,right:t}:r(t.right)?{left:n,right:e.right(t.right)}:{left:e.right(t.right),right:n}},partitionMap:function(t,r){if(e.isLeft(t))return{left:t,right:t};var i=r(t.right);return e.isLeft(i)?{left:e.right(i.left),right:n}:{left:n,right:e.right(i.right)}}}}function E(t){return{URI:e.URI,_E:void 0,map:u,ap:function(n,r){return e.isLeft(n)?e.isLeft(r)?e.left(t.concat(n.left,r.left)):n:e.isLeft(r)?r:e.right(n.right(r.right))},of:e.of}}function A(t){return{URI:e.URI,_E:void 0,map:u,alt:function(n,r){if(e.isRight(n))return n;var i=r();return e.isLeft(i)?e.left(t.concat(n.left,i.left)):i}}}function b(t,n){return{concat:function(r,i){return e.isLeft(r)?e.isLeft(i)?e.left(t.concat(r.left,i.left)):r:e.isLeft(i)?i:e.right(n.concat(r.right,i.right))}}}e.map=function(t){return function(n){return e.isLeft(n)?n:e.right(t(n.right))}},e.bimap=function(t,n){return function(r){return e.isLeft(r)?e.left(t(r.left)):e.right(n(r.right))}},e.mapLeft=function(t){return function(n){return e.isLeft(n)?e.left(t(n.left)):n}},e.apW=function(t){return function(n){return e.isLeft(n)?n:e.isLeft(t)?t:e.right(n.right(t.right))}},e.ap=e.apW,e.apFirst=function(t){return i.flow(e.map((function(t){return function(){return t}})),e.ap(t))},e.apSecond=function(t){return i.flow(e.map((function(){return function(t){return t}})),e.ap(t))},e.of=e.right,e.chainW=function(t){return function(n){return e.isLeft(n)?n:t(n.right)}},e.chain=e.chainW,e.chainFirstW=function(t){return function(n){return i.pipe(n,e.chainW((function(n){return i.pipe(t(n),e.map((function(){return n})))})))}},e.chainFirst=e.chainFirstW,e.flatten=e.chain(i.identity),e.alt=function(t){return function(n){return e.isLeft(n)?t():n}},e.extend=function(t){return function(n){return e.isLeft(n)?n:e.right(t(n))}},e.duplicate=e.extend(i.identity),e.reduce=function(t,n){return function(r){return e.isLeft(r)?t:n(t,r.right)}},e.foldMap=function(t){return function(n){return function(r){return e.isLeft(r)?t.empty:n(r.right)}}},e.reduceRight=function(t,n){return function(r){return e.isLeft(r)?t:n(r.right,t)}},e.traverse=function(t){return function(n){return function(r){return e.isLeft(r)?t.of(e.left(r.left)):t.map(n(r.right),e.right)}}},e.sequence=function(t){return function(n){return e.isLeft(n)?t.of(e.left(n.left)):t.map(n.right,e.right)}},e.throwError=e.left,e.URI="Either",e.getShow=function(t,n){return{show:function(r){return e.isLeft(r)?"left("+t.show(r.left)+")":"right("+n.show(r.right)+")"}}},e.getEq=function(t,n){return{equals:function(r,i){return r===i||(e.isLeft(r)?e.isLeft(i)&&t.equals(r.left,i.left):e.isRight(i)&&n.equals(r.right,i.right))}}},e.getSemigroup=function(t){return{concat:function(n,r){return e.isLeft(r)?n:e.isLeft(n)?r:e.right(t.concat(n.right,r.right))}}},e.getApplySemigroup=y,e.getApplyMonoid=function(t){return{concat:y(t).concat,empty:e.right(t.empty)}},e.getFilterable=v,e.getWitherable=function(t){var n=v(t);return{URI:e.URI,_E:void 0,map:u,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:d,sequence:e.sequence,reduce:s,foldMap:l,reduceRight:f,wither:function(t){var e=d(t);return function(r,i){return t.map(e(r,i),n.compact)}},wilt:function(t){var e=d(t);return function(r,i){return t.map(e(r,i),n.separate)}}}},e.getApplicativeValidation=E,e.getAltValidation=A,e.getValidation=function(t){var n=E(t),r=A(t);return{URI:e.URI,_E:void 0,map:u,of:e.of,chain:c,bimap:p,mapLeft:g,reduce:s,foldMap:l,reduceRight:f,extend:h,traverse:d,sequence:e.sequence,chainRec:m,throwError:e.throwError,ap:n.ap,alt:r.alt}},e.getValidationSemigroup=b,e.Functor={URI:e.URI,map:u},e.Applicative={URI:e.URI,map:u,ap:a,of:e.of},e.Monad={URI:e.URI,map:u,ap:a,of:e.of,chain:c},e.Foldable={URI:e.URI,reduce:s,foldMap:l,reduceRight:f},e.Traversable={URI:e.URI,map:u,reduce:s,foldMap:l,reduceRight:f,traverse:d,sequence:e.sequence},e.Bifunctor={URI:e.URI,bimap:p,mapLeft:g},e.Alt={URI:e.URI,map:u,alt:_},e.Extend={URI:e.URI,map:u,extend:h},e.ChainRec={URI:e.URI,map:u,ap:a,chain:c,chainRec:m},e.MonadThrow={URI:e.URI,map:u,ap:a,of:e.of,chain:c,throwError:e.throwError},e.getValidationMonoid=function(t,n){return{concat:b(t,n).concat,empty:e.right(n.empty)}},e.either={URI:e.URI,map:u,of:e.of,ap:a,chain:c,reduce:s,foldMap:l,reduceRight:f,traverse:d,sequence:e.sequence,bimap:p,mapLeft:g,alt:_,extend:h,chainRec:m,throwError:e.throwError},e.toError=function(t){return t instanceof Error?t:new Error(String(t))},e.elem=function(t){return function(n,r){return!e.isLeft(r)&&t.equals(n,r.right)}},e.exists=function(t){return function(n){return!e.isLeft(n)&&t(n.right)}},e.bindTo=function(t){return e.map(i.bindTo_(t))},e.bindW=function(t,n){return e.chainW((function(r){return i.pipe(n(r),e.map((function(e){return i.bind_(r,t,e)})))}))},e.bind=e.bindW,e.apSW=function(t,n){return i.flow(e.map((function(e){return function(n){return i.bind_(e,t,n)}})),e.apW(n))},e.apS=e.apSW},function(t,e){t.exports=__kbnSharedDeps__.SaferLodashSet},function(t,e){t.exports=__kbnSharedDeps_npm__},function(t,e,n){n(10),__kbnBundles__.define("plugin/alerting/public",n,13),__kbnBundles__.define("plugin/alerting/common",n,2),__kbnBundles__.define("plugin/alerting/common/parse_duration",n,4)},function(t,e,n){n.p=window.__kbnPublicPath__.alerting},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tailRec=void 0,e.tailRec=function(t,e){for(var n=e(t);"Left"===n._tag;)n=e(n.left);return n.right}},function(t,e,n){"use strict";function r(t){return t}function i(t){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(e,"__esModule",{value:!0}),e.bindTo_=e.bind_=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.not=e.unsafeCoerce=e.identity=void 0,e.identity=r,e.unsafeCoerce=r,e.not=function(t){return function(e){return!t(e)}},e.constant=function(t){return function(){return t}},e.constTrue=function(){return!0},e.constFalse=function(){return!1},e.constNull=function(){return null},e.constUndefined=function(){},e.constVoid=function(){},e.flip=function(t){return function(e,n){return t(n,e)}},e.flow=function(t,e,n,r,i,o,u,a,c){switch(arguments.length){case 1:return t;case 2:return function(){return e(t.apply(this,arguments))};case 3:return function(){return n(e(t.apply(this,arguments)))};case 4:return function(){return r(n(e(t.apply(this,arguments))))};case 5:return function(){return i(r(n(e(t.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(e(t.apply(this,arguments))))))};case 7:return function(){return u(o(i(r(n(e(t.apply(this,arguments)))))))};case 8:return function(){return a(u(o(i(r(n(e(t.apply(this,arguments))))))))};case 9:return function(){return c(a(u(o(i(r(n(e(t.apply(this,arguments)))))))))}}},e.tuple=function(){for(var t=[],e=0;e{this.alertNavigationRegistry.register(t,e,n)},registerDefaultNavigation:async(t,e)=>this.alertNavigationRegistry.registerDefault(t,e)}}start(t){return{getNavigation:async e=>{const n=await async function({http:t,ruleId:e}){return function(t){const{rule_type_id:e,created_by:n,updated_by:r,created_at:i,updated_at:o,api_key:u,api_key_owner:a,api_key_created_by_user:f,notify_when:d,mute_all:p,muted_alert_ids:g,scheduled_task_id:_,execution_status:h,actions:m,next_run:y,last_run:v,monitoring:E,view_in_app_relative_url:A,...b}=t;return{alertTypeId:e,createdBy:n,updatedBy:r,createdAt:new Date(i),updatedAt:new Date(o),apiKey:u,apiKeyOwner:a,notifyWhen:d,muteAll:p,mutedInstanceIds:g,executionStatus:c(h),actions:m?m.map((t=>function(t){const{connector_type_id:e,frequency:n,...r}=t;return{actionTypeId:e,...n?{frequency:{summary:n.summary,throttle:n.throttle,notifyWhen:n.notify_when}}:{},...r}}(t))):[],scheduledTaskId:_,...A?{viewInAppRelativeUrl:A}:{},...y?{nextRun:new Date(y)}:{},...E?{monitoring:s(E)}:{},...v?{lastRun:l(v)}:{},...void 0!==f?{apiKeyCreatedByUser:f}:{},...b}}(await t.get(`${a.INTERNAL_BASE_ALERTING_API_PATH}/rule/${e}`))}({http:t.http,ruleId:e}),r=await async function({http:t,id:e}){const n=await async function({http:t}){return(await t.get(`${a.BASE_ALERTING_API_PATH}/rule_types`)).map((t=>function(t){const{recovery_action_group:e,action_groups:n,default_action_group_id:r,minimum_license_required:i,action_variables:o,rule_task_timeout:u,is_exportable:a,authorized_consumers:c,enabled_in_license:s,...l}=t;return{recoveryActionGroup:e,actionGroups:n,defaultActionGroupId:r,minimumLicenseRequired:i,actionVariables:o,ruleTaskTimeout:u,isExportable:a,authorizedConsumers:c,enabledInLicense:s,...l}}(t)))}({http:t});return n.find((t=>t.id===e))}({http:t.http,id:n.alertTypeId});if(r)return this.alertNavigationRegistry.has(n.consumer,r)?this.alertNavigationRegistry.get(n.consumer,r)(n):n.viewInAppRelativeUrl?n.viewInAppRelativeUrl:void 0;console.log(`Unable to get navigation for rule type "${n.alertTypeId}" because it is not registered on the server side.`)}}}}function f(t){return new plugin_AlertingPublicPlugin(t)}},function(t,e){t.exports=__kbnSharedDeps__.React},function(t,e){t.exports=__kbnSharedDeps__.EmotionReact},function(t,e){t.exports=__kbnSharedDeps__.ElasticEui},function(t,e){t.exports=__kbnSharedDeps__.Moment},function(t,e){t.exports=__kbnSharedDeps__.ReactQuery},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/hook_form_lib");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))},function(t,e){t.exports=__kbnSharedDeps__.ReactRouterDom},function(t,e){t.exports=__kbnSharedDeps__.TsLib},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))},function(t,e){t.exports=__kbnSharedDeps__.MomentTimezone},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/components");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))},function(t,e){t.exports=__kbnSharedDeps__.ReactRouterDomV5Compat},function(t,e){t.exports=__kbnSharedDeps__.KbnUiTheme},function(t,e){t.exports=__kbnSharedDeps__.ReactDom},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/kibanaReact/common");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/kibanaUtils/public");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))},function(t,e){t.exports=__kbnSharedDeps__.Rxjs},function(t,e,n){n.r(e);var r=__kbnBundles__.get("plugin/esUiShared/static/forms/helpers");Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}]);