"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _extends2=require("babel-runtime/helpers/extends"),_extends3=_interopRequireDefault(_extends2),_defineProperty2=require("babel-runtime/helpers/defineProperty"),_defineProperty3=_interopRequireDefault(_defineProperty2),_classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require("babel-runtime/helpers/createClass"),_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_react=require("react"),React=_interopRequireWildcard(_react),_propTypes=require("prop-types"),PropTypes=_interopRequireWildcard(_propTypes),_rcAnimate=require("rc-animate"),_rcAnimate2=_interopRequireDefault(_rcAnimate),_ScrollNumber=require("./ScrollNumber"),_ScrollNumber2=_interopRequireDefault(_ScrollNumber),_classnames=require("classnames"),_classnames2=_interopRequireDefault(_classnames);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var __rest=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&(r[s[a]]=e[s[a]])}return r},Badge=function(e){function t(){return(0,_classCallCheck3.default)(this,t),(0,_possibleConstructorReturn3.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,_inherits3.default)(t,e),(0,_createClass3.default)(t,[{key:"render",value:function(){var e,t,r,s=this.props,a=s.count,l=s.showZero,o=s.prefixCls,n=s.scrollNumberPrefixCls,u=s.overflowCount,i=s.className,p=s.style,c=s.children,f=s.dot,_=s.status,d=s.text,m=s.offset,y=__rest(s,["count","showZero","prefixCls","scrollNumberPrefixCls","overflowCount","className","style","children","dot","status","text","offset"]),b=u<a?u+"+":a,h="0"===b||0===b,C=f&&!h||_;C&&(b="");var P=(null==b||""===b||h&&!l)&&!C,R=(0,_classnames2.default)((e={},(0,_defineProperty3.default)(e,o+"-status-dot",!!_),(0,_defineProperty3.default)(e,o+"-status-"+_,!!_),e)),q=(0,_classnames2.default)((t={},(0,_defineProperty3.default)(t,o+"-dot",C),(0,_defineProperty3.default)(t,o+"-count",!C),(0,_defineProperty3.default)(t,o+"-multiple-words",!C&&a&&a.toString&&1<a.toString().length),(0,_defineProperty3.default)(t,o+"-status-"+_,!!_),t)),x=(0,_classnames2.default)(i,o,(r={},(0,_defineProperty3.default)(r,o+"-status",!!_),(0,_defineProperty3.default)(r,o+"-not-a-wrapper",!c),r)),w=m?(0,_extends3.default)({marginTop:m[0],marginLeft:m[1]},p):p;if(!c&&_)return React.createElement("span",{className:x,style:w},React.createElement("span",{className:R}),React.createElement("span",{className:o+"-status-text"},d));var N=P?null:React.createElement(_ScrollNumber2.default,{prefixCls:n,"data-show":!P,className:q,count:b,title:a,style:w}),v=P||!d?null:React.createElement("span",{className:o+"-status-text"},d);return React.createElement("span",(0,_extends3.default)({},y,{className:x}),c,React.createElement(_rcAnimate2.default,{component:"",showProp:"data-show",transitionName:c?o+"-zoom":"",transitionAppear:!0},N),v)}}]),t}(React.Component);(exports.default=Badge).defaultProps={prefixCls:"dt-badge",scrollNumberPrefixCls:"dt-scroll-number",count:null,showZero:!1,dot:!1,overflowCount:99},Badge.propTypes={count:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),showZero:PropTypes.bool,dot:PropTypes.bool,overflowCount:PropTypes.number},module.exports=exports.default;