/*! For license information please see dll.ShapedImage.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[121],{919:function(t,e,n){"use strict";n.r(e);var r=n(14),s=n.n(r),i=n(12),o=n.n(i),a=n(15),h=n.n(a),c=n(16),l=n.n(c),u=n(8),p=n.n(u),d=n(0),f=n.n(d),g=n(1),m=n.n(g);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var s=p()(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return l()(this,n)}}var k=function(t){h()(n,t);var e=w(n);function n(t){var r;return s()(this,n),(r=e.call(this,t)).state={loaded:!1},r}return o()(n,[{key:"componentDidMount",value:function(){var t=this;if(this.props.src){var e=new Image;e.src=this.props.src,e.onload=function(){t.setState({loaded:!0,width:e.width,height:e.height})}}}},{key:"getDimensions",value:function(t){t.width||t.height||(t.width=this.state.width,t.height=this.state.height);var e=this.state.width/this.state.height;t.width&&(t.height=t.width/e),t.height&&!t.width&&(t.width=t.height*e)}},{key:"render",value:function(){var t="url("+this.props.src+")",e=null;this.props.onClick&&(e="pointer");var n={float:"left",shapeImageThreshold:this.props.threshold,shapeMargin:this.props.margin,shapeOutside:t,cursor:e,overflow:"hidden"};return Object.assign(n,this.props.style),this.props.background&&(n.backgroundImage=t,n.backgroundSize="100% auto"),!1===this.state.loaded?null:(this.getDimensions(n),this.props.background?f.a.createElement("div",{style:n},this.props.children,";"):f.a.createElement("span",{onClick:this.props.onClick,onKeyPress:this.props.onClick,role:"button",tabIndex:0},f.a.createElement("img",{style:n,src:this.props.src,alt:this.props.alt})))}}]),n}(d.Component);k.propTypes={alt:m.a.string,background:m.a.bool,margin:m.a.number,onClick:m.a.func,src:m.a.string,style:m.a.object,threshold:m.a.number},k.defaultProps={alt:"",background:!1,src:"",margin:10,threshold:1,style:{},onClick:null},e.default=k}}]);