"use strict";var _a,_b,_c,_d;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LegendPosition=exports.Color=exports.Shading=exports.SingleValueWidget=exports.GraphWidget=exports.GraphWidgetView=exports.AlarmWidget=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),rendering_1=require("./private/rendering"),widget_1=require("./widget");class AlarmWidget extends widget_1.ConcreteWidget{constructor(props){super(props.width||6,props.height||6);jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_AlarmWidgetProps(props),this.props=props}toJson(){var _e;return[{type:"metric",width:this.width,height:this.height,x:this.x,y:this.y,properties:{view:"timeSeries",title:this.props.title,region:this.props.region||cdk.Aws.REGION,annotations:{alarms:[this.props.alarm.alarmArn]},yAxis:{left:(_e=this.props.leftYAxis)!==null&&_e!==void 0?_e:void 0}}}]}}exports.AlarmWidget=AlarmWidget,_a=JSII_RTTI_SYMBOL_1,AlarmWidget[_a]={fqn:"aws-cdk-lib.aws_cloudwatch.AlarmWidget",version:"2.13.0"};var GraphWidgetView;(function(GraphWidgetView2){GraphWidgetView2.TIME_SERIES="timeSeries",GraphWidgetView2.BAR="bar",GraphWidgetView2.PIE="pie"})(GraphWidgetView=exports.GraphWidgetView||(exports.GraphWidgetView={}));class GraphWidget extends widget_1.ConcreteWidget{constructor(props){var _e,_f;super(props.width||6,props.height||6);jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_GraphWidgetProps(props),this.props=props,this.leftMetrics=(_e=props.left)!==null&&_e!==void 0?_e:[],this.rightMetrics=(_f=props.right)!==null&&_f!==void 0?_f:[]}addLeftMetric(metric){jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_IMetric(metric),this.leftMetrics.push(metric)}addRightMetric(metric){jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_IMetric(metric),this.rightMetrics.push(metric)}toJson(){var _e,_f,_g,_h;const horizontalAnnotations=[...(this.props.leftAnnotations||[]).map(mapAnnotation("left")),...(this.props.rightAnnotations||[]).map(mapAnnotation("right"))],metrics=rendering_1.allMetricsGraphJson(this.leftMetrics,this.rightMetrics);return[{type:"metric",width:this.width,height:this.height,x:this.x,y:this.y,properties:{view:(_e=this.props.view)!==null&&_e!==void 0?_e:GraphWidgetView.TIME_SERIES,title:this.props.title,region:this.props.region||cdk.Aws.REGION,stacked:this.props.stacked,metrics:metrics.length>0?metrics:void 0,annotations:horizontalAnnotations.length>0?{horizontal:horizontalAnnotations}:void 0,yAxis:{left:(_f=this.props.leftYAxis)!==null&&_f!==void 0?_f:void 0,right:(_g=this.props.rightYAxis)!==null&&_g!==void 0?_g:void 0},legend:this.props.legendPosition!==void 0?{position:this.props.legendPosition}:void 0,liveData:this.props.liveData,setPeriodToTimeRange:this.props.setPeriodToTimeRange,period:(_h=this.props.period)===null||_h===void 0?void 0:_h.toSeconds(),stat:this.props.statistic}}]}}exports.GraphWidget=GraphWidget,_b=JSII_RTTI_SYMBOL_1,GraphWidget[_b]={fqn:"aws-cdk-lib.aws_cloudwatch.GraphWidget",version:"2.13.0"};class SingleValueWidget extends widget_1.ConcreteWidget{constructor(props){super(props.width||6,props.height||3);jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_SingleValueWidgetProps(props),this.props=props}toJson(){return[{type:"metric",width:this.width,height:this.height,x:this.x,y:this.y,properties:{view:"singleValue",title:this.props.title,region:this.props.region||cdk.Aws.REGION,metrics:rendering_1.allMetricsGraphJson(this.props.metrics,[]),setPeriodToTimeRange:this.props.setPeriodToTimeRange,singleValueFullPrecision:this.props.fullPrecision}}]}}exports.SingleValueWidget=SingleValueWidget,_c=JSII_RTTI_SYMBOL_1,SingleValueWidget[_c]={fqn:"aws-cdk-lib.aws_cloudwatch.SingleValueWidget",version:"2.13.0"};var Shading;(function(Shading2){Shading2.NONE="none",Shading2.ABOVE="above",Shading2.BELOW="below"})(Shading=exports.Shading||(exports.Shading={}));class Color{}exports.Color=Color,_d=JSII_RTTI_SYMBOL_1,Color[_d]={fqn:"aws-cdk-lib.aws_cloudwatch.Color",version:"2.13.0"},Color.BLUE="#1f77b4",Color.BROWN="#8c564b",Color.GREEN="#2ca02c",Color.GREY="#7f7f7f",Color.ORANGE="#ff7f0e",Color.PINK="#e377c2",Color.PURPLE="#9467bd",Color.RED="#d62728";var LegendPosition;(function(LegendPosition2){LegendPosition2.BOTTOM="bottom",LegendPosition2.RIGHT="right",LegendPosition2.HIDDEN="hidden"})(LegendPosition=exports.LegendPosition||(exports.LegendPosition={}));function mapAnnotation(yAxis){return a=>({...a,yAxis})}
//# sourceMappingURL=graph.js.map
