"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[53],{59140:(C,d,i)=>{i.r(d),i.d(d,{plugin:()=>D});var p=i(38792),u=i(72629),l=i(69108),h=i(64284),r=i(65237),m=i(35149),c=i(52609),n=i(44545);class f extends r.Component{constructor(e){super(e),this.initElement=t=>(this.element=new c.f(l.e,t.options.root),this.updateSize(t),this.element.updateData(this.dims),this.element),this.updateSize=t=>{const{width:o,height:a}=t;this.element.options.constraint={vertical:m.fJ.Top,horizontal:m._5.Left},this.element.options.placement={left:0,top:0,width:o,height:a}},this.dims={getColor:t=>(0,n.getColorDimensionFromData)(this.props.data,t),getScale:t=>(0,n.getScaleDimensionFromData)(this.props.data,t),getScalar:t=>(0,n.getScalarDimensionFromData)(this.props.data,t),getText:t=>(0,n.getTextDimensionFromData)(this.props.data,t),getResource:t=>(0,n.getResourceDimensionFromData)(this.props.data,t),getPanelData:()=>this.props.data},this.element=this.initElement(e)}shouldComponentUpdate(e){const{width:t,height:o,data:a}=this.props;let s=!1;return(t!==e.width||o!==e.height)&&(this.updateSize(e),s=!0),a!==e.data&&(this.element.updateData(this.dims),s=!0),this.props.options?.root!==e.options?.root&&(this.initElement(e),s=!0),s}render(){const{width:e,height:t}=this.props;return r.createElement("div",{style:{width:e,height:t,overflow:"hidden",position:"relative"}},this.element.render())}}const v={root:{config:{path:{mode:n.ResourceDimensionMode.Fixed,fixed:"img/icons/unicons/analysis.svg"},fill:{fixed:"green"}}}},D=new p.c(f).setNoPadding().useFieldConfig({standardOptions:{[u.qb.Mappings]:{settings:{icon:!0}}}}).setPanelOptions(g=>{g.addNestedOptions({category:["Icon"],path:"root",build:(e,t)=>{l.e.registerOptionsUI(e,t),h.I.addBackground(e,t),h.I.addBorder(e,t)},defaultValue:v.root})})}}]);

//# sourceMappingURL=iconPanel.a7d720860cd94d84e3bd.js.map