build/static/js/60.0990e7fa.chunk.js

1 line
42 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(this.webpackJsonp=this.webpackJsonp||[]).push([[60],{"+KLJ":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return w}));var r=n("q1tI"),a=n("i8i4"),o=n("MFj2"),l=n("TSYQ"),i=n.n(l),c=n("CtXQ"),s=n("H84U"),u=n("RqAY"),f=n("6CfX");function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=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(e){return!1}}();return function(){var n,r=_(e);if(t){var a=_(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?b(e):t}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(){}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(y,e);var t,n,l,d=v(y);function y(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),(t=d.call(this,e)).handleClose=function(e){e.preventDefault();var n=a.findDOMNode(b(t));n.style.height="".concat(n.offsetHeight,"px"),n.style.height="".concat(n.offsetHeight,"px"),t.setState({closing:!0}),(t.props.onClose||E)(e)},t.animationEnd=function(){t.setState({closing:!1,closed:!0}),(t.props.afterClose||E)()},t.renderAlert=function(e){var n,a=e.getPrefixCls,l=t.props,s=l.description,f=l.prefixCls,d=l.message,h=l.closeText,g=l.banner,v=l.className,y=void 0===v?"":v,b=l.style,_=l.icon,E=t.props,w=E.closable,j=E.type,O=E.showIcon,S=E.iconType,C=t.state,N=C.closing,P=C.closed,x=a("alert",f);O=!(!g||void 0!==O)||O,j=g&&void 0===j?"warning":j||"info";var k="filled";if(!S){switch(j){case"success":S="check-circle";break;case"info":S="info-circle";break;case"error":S="close-circle";break;case"warning":S="exclamation-circle";break;default:S="default"}s&&(k="outlined")}h&&(w=!0);var I=i()(x,"".concat(x,"-").concat(j),(m(n={},"".concat(x,"-closing"),N),m(n,"".concat(x,"-with-description"),!!s),m(n,"".concat(x,"-no-icon"),!O),m(n,"".concat(x,"-banner"),!!g),m(n,"".concat(x,"-closable"),w),n),y),B=w?r.createElement("button",{type:"button",onClick:t.handleClose,className:"".concat(x,"-close-icon"),tabIndex:0},h?r.createElement("span",{className:"".concat(x,"-close-text")},h):r.createElement(c.default,{type:"close"})):null,T=Object(u.a)(t.props),M=_&&(r.isValidElement(_)?r.cloneElement(_,{className:i()("".concat(x,"-icon"),m({},_.props.className,_.props.className))}):r.createElement("span",{className:"".concat(x,"-icon")},_))||r.createElement(c.default,{className:"".concat(x,"-icon"),type:S,theme:k});return P?null:r.createElement(o.a,{component:"",showProp:"data-show",transitionName:"".concat(x,"-slide-up"),onEnd:t.animationEnd},r.createElement("div",p({"data-show":!N,className:I,style:b},T),O?M:null,r.createElement("span",{className:"".concat(x,"-message")},d),r.createElement("span",{className:"".concat(x,"-description")},s),B))},Object(f.a)(!("iconType"in e),"Alert","`iconType` is deprecated. Please use `icon` instead."),t.state={closing:!1,closed:!1},t}return t=y,(n=[{key:"render",value:function(){return r.createElement(s.a,null,this.renderAlert)}}])&&h(t.prototype,n),l&&h(t,l),y}(r.Component)},"0lcf":function(e,t,n){"use strict";n.r(t);n("SchZ"),n("u3En")},"2DKY":function(e,t,n){"use strict";n.r(t);n("SchZ"),n("n5Yh")},"6JOy":function(e,t,n){},AubP:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n("NUBc"));n("YQTV");var a=u(n("q1tI")),o=n("spEH"),l=u(n("Rs/d")),i=n("PhNK"),c=n("sYIF"),s=n("eO8H");function u(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.commits,n=e.projectsId,u=e.owner,f=e.total,d=e.limit,p=e.changeCommitFunc;return a.default.createElement("div",{className:"pb20"},t.map((function(e,t){return a.default.createElement("div",{className:"prCommits"},a.default.createElement("p",{className:"prCreate"},e.created_at),a.default.createElement("div",{className:"prInfo"},a.default.createElement(o.FlexAJ,null,a.default.createElement(o.AlignCenter,null,a.default.createElement(s.Link,{to:"/"+u+"/"+n+"/commits/"+(0,i.truncateCommitId)(""+e.sha),className:"commitKey",style:{marginLeft:0}},(0,i.truncateCommitId)(""+e.sha)),a.default.createElement("p",{className:"ml15 font-16 color-grey-3 task-hide",style:{maxWidth:"700px"}},e.message)),a.default.createElement(s.Link,{to:"/"+u+"/"+n+"/commits/"+(0,i.truncateCommitId)(e.sha),className:"color-blue"},"浏览代码")),a.default.createElement(o.AlignCenter,{className:"mt15"},a.default.createElement(l.default,{url:(0,c.getImageUrl)("/"+(e.committer&&e.committer.image_url)),name:""+(e.committer&&e.committer.name)}),a.default.createElement("span",null,":提交于",e.time_from_now))))})),f>d&&a.default.createElement("div",{style:{textAlign:"center",paddingTop:"20px"}},a.default.createElement(r.default,{pageSize:d,total:f,onChange:function(e){return p(e)}})))}},Fyak:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n("ZTPi")),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n("AUBz");var l=n("q1tI"),i=u(l),c=u(n("AubP")),s=u(n("aABL"));function u(e){return e&&e.__esModule?e:{default:e}}n("6JOy"),n("js5m");var f=r.default.TabPane,d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.changeTab=function(e){n.setState({activeKey:e})},n.changeCommitFunc=function(e){var t=n.props.changeCommitFunc;t&&t(e)},n.state={activeKey:"1"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"render",value:function(){var e=this.props.match.params,t=e.projectsId,n=e.owner,o=this.props,l=o.comparesData,u=void 0===l?{}:l,d=o.limit,p=u.commits,m=u.diff,h=u.commits_count,g=this.state.activeKey;return p&&0===p.length||!m?"":i.default.createElement("div",{className:"main mergeRequest",style:{paddingTop:"0px"}},i.default.createElement(r.default,{activeKey:g,className:"custom-commit-tabs",animated:!1,onChange:this.changeTab},p&&p.length>0&&i.default.createElement(f,{tab:i.default.createElement("span",null,i.default.createElement("span",{className:"font-16"},"提交"),h>0&&i.default.createElement("span",{className:"tabNum"},h)),key:"1"},i.default.createElement(c.default,a({},this.props,{commits:p,total:h,limit:d,changeCommitFunc:this.changeCommitFunc,projectsId:t,owner:n}))),m&&m.files&&m.files.length>0&&i.default.createElement(f,{tab:i.default.createElement("span",null,i.default.createElement("span",{className:"font-16"},"文件"),m.files_count>0&&i.default.createElement("span",{className:"tabNum"},m.files_count)),key:"3"},i.default.createElement(s.default,a({},this.props,{data:m,projectsId:t,owner:n})))))}}]),t}(l.Component);t.default=d},PhNK:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.truncateCommitId=function(e){return e&&e.length>11?e.substring(0,10):e},t.timeFormat=function(e){var t=new Date(1e3*e),n=t.getHours()<10?"0".concat(t.getHours()):t.getHours(),r=t.getMinutes()<10?"0".concat(t.getMinutes()):t.getMinutes();return t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" "+n+":"+r}},QCvN:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=g(n("W9HT")),a=g(n("2/Rp")),o=g(n("Vl3Y")),l=g(n("5rEg")),i=g(n("mr32")),c=g(n("BvKs")),s=g(n("2fM7")),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n("04bd"),n("L/Qf"),n("tULf"),n("1vPl"),n("0lcf"),n("2WkQ"),n("8QGh");var d=n("q1tI"),p=g(d),m=g(n("vDqi"));n("6JOy"),n("js5m");var h=g(n("p7gc"));function g(e){return e&&e.__esModule?e:{default:e}}var v=s.default.Option,y=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentDidMount=function(){n.get_default_selects(),n.set_defatul()},n.componentDidUpdate=function(e){var t=n.props.match.params,r=t.projectsId,a=t.owner,o=e.match.params.projectsId,l=e.match.params.owner;o===r&&l===a||n.get_default_selects(),e&&n.props&&!n.props.checkIfLogin()&&n.props.history.push("/403")},n.get_default_selects=function(){var e=n.props.match.params,t=e.projectsId,r=e.owner;n.setState({isSpin:!0}),m.default.get("/"+r+"/"+t+"/pulls/create_merge_infos.json").then((function(e){e&&n.setState({members:e.data.members,issue_tags:e.data.issue_tags,issue_versions:e.data.issue_versions,issue_priories:e.data.issue_priories}),n.setState({isSpin:!1})})).catch((function(e){n.setState({isSpin:!1}),console.log(e)}))},n.set_defatul=function(){var e=n.props,t=e.data,r=e.merge_type;t&&"edit"===r&&n.setState({desc:t.body,issue_tag_ids:t.issue_tag_ids?t.issue_tag_ids[0]:void 0,fixed_version_id:t.fixed_version_id?String(t.fixed_version_id):void 0,assigned_to_id:t.assigned_to_id?String(t.assigned_to_id):void 0,priority_id:t.priority_id?String(t.priority_id):void 0,title:t.title}),n.InitData()},n.InitData=function(){setTimeout((function(){n.props.form.setFieldsValue(u({},n.state))}),100)},n.onPanelChange=function(e,t){n.setState({value:e})},n.onSelect=function(e){n.setState({value:e,selectedValue:e})},n.renderMenu=function(e,t){return p.default.createElement(c.default,null,e&&e.length>0&&e.map((function(e,r){return p.default.createElement(c.default.Item,{key:e,onClick:function(){return n.getOption(e,t)}},e)})))},n.renderSelect=function(e){if(e&&e.length>0)return e.map((function(e,t){return p.default.createElement(v,{key:t+1,value:e.id+""},e.name)}))},n.handleSubmit=function(){n.setState({isSpin:!0}),n.props.form.validateFieldsAndScroll((function(e,t){if(e)n.setState({isSpin:!1});else{var r=n.props.match.params,a=r.projectsId,o=r.mergeId,l=r.owner,i=n.props,c=i.merge,s=i.pull,f=i.merge_type,d=i.data,p=i.commits_count,h=i.files_count;t.issue_tag_ids&&t.issue_tag_ids.length>0?t.issue_tag_ids=[parseInt(t.issue_tag_ids)]:t.issue_tag_ids=[];var g=n.state,v=g.desc,y=g.atWhoLoginList;if("new"===f){var b="/"+l+"/"+a+"/pulls.json";m.default.post(b,u({},t,{body:v,head:s,base:c,is_original:d&&d.is_original,fork_project_id:d&&d.fork_project_id,merge_user_login:d&&d.merge_user_login,files_count:h,commits_count:p,receivers_login:y})).then((function(e){if(e){n.setState({isSpin:!1});var t=e.data.pull_request_number;n.props.history.push("/"+l+"/"+a+"/pulls/"+t);var r=n.props.getDetail;r&&r()}else n.setState({isSpin:!1})})).catch((function(e){n.setState({isSpin:!1})}))}else{var _="/"+l+"/"+a+"/pulls/"+o+".json";m.default.put(_,u({},t,{body:v,head:s,base:c,receivers_login:y})).then((function(e){e?(n.setState({isSpin:!1}),n.props.history.push("/"+l+"/"+a+"/pulls/"+o)):n.setState({isSpin:!1})})).catch((function(e){n.setState({isSpin:!1}),console.log(e)}))}}}))},n.onContentChange=function(e){n.setState({desc:e})},n.changeAtWhoLoginList=function(e){n.setState({atWhoLoginList:e})},n.state={desc:void 0,issue_tag_ids:void 0,fixed_version_id:void 0,assigned_to_id:void 0,titledata:void 0,isSpin:!1,mergedata:void 0,priority_id:void 0,title:void 0,members:void 0,issue_tags:void 0,issue_versions:void 0,issue_priories:void 0,atWhoLoginList:void 0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),f(t,[{key:"render",value:function(){var e=this,t=this.props.merge_type,n=this.props.form.getFieldDecorator,c=this.props.match.params,u=c.projectsId,f=c.mergeId,d=c.owner,m=this.state,g=m.issue_tag_ids,y=m.fixed_version_id,b=m.assigned_to_id,_=m.priority_id,E=m.desc,w=m.isSpin,j=m.title,O=m.members,S=m.issue_tags,C=m.issue_versions,N=m.issue_priories;return p.default.createElement("div",null,p.default.createElement(r.default,{spinning:w},p.default.createElement("div",{className:"mb20"},p.default.createElement("span",{className:"font-16 fwb mr10 ver-middle"},"new"===t?"新建":"编辑","合并请求:"),p.default.createElement(i.default,{color:"#28BD6C",className:"ver-middle"},"可合并的")),p.default.createElement(o.default,null,p.default.createElement("div",{className:"width100 inline-block"},p.default.createElement("div",{className:"width70 pull-left"},p.default.createElement(o.default.Item,null,n("title",{rules:[{required:!0,message:"请填写请求标题"}],initialValue:j})(p.default.createElement(l.default,{placeholder:"标题",maxLength:200}))),p.default.createElement(h.default,{placeholder:"请输入合并请求的描述...",height:450,mdID:"merge-new-description",initValue:E,onChange:this.onContentChange,isCanAtme:!0,changeAtWhoLoginList:this.changeAtWhoLoginList,owner:d,projectsId:u}),p.default.createElement("p",{className:"clearfix mt20"},p.default.createElement(a.default,{type:"primary",loading:w,onClick:this.handleSubmit},p.default.createElement("span",{className:"plr10"},"new"===t?"创建":"提交")),p.default.createElement(a.default,{type:"default",className:"ml30",onClick:function(){e.props.history.push("new"===t?"/"+d+"/"+u+"/pulls":"/"+d+"/"+u+"/pulls/"+f)}},p.default.createElement("span",{className:"plr10"},"取消")))),p.default.createElement("div",{className:"width30 pull-left"},p.default.createElement("div",{className:"pl30"},p.default.createElement(o.default.Item,null,n("assigned_to_id",{initialValue:b})(p.default.createElement(s.default,{placeholder:"未选择审查人员",showSearch:!0,className:"searchIcon",suffixIcon:p.default.createElement("i",{className:"iconfont icon-sousuo1"}),optionFilterProp:"children",filterOption:function(e,t){return t.props.value&&t.props.children&&t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0}},p.default.createElement(v,{key:0,value:""},"未选择审查人员"),this.renderSelect(O)))),p.default.createElement(o.default.Item,null,n("fixed_version_id",{initialValue:y})(p.default.createElement(s.default,{placeholder:C&&C.length>0?"未选择里程碑":"请添加里程碑",showSearch:!0,className:"searchIcon",suffixIcon:p.default.createElement("i",{className:"iconfont icon-sousuo1"}),optionFilterProp:"children",filterOption:function(e,t){return t.props.value&&t.props.children&&t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0}},p.default.createElement(v,{key:0,value:""},C&&C.length>0?"未选择里程碑":"请添加里程碑"),this.renderSelect(C)))),p.default.createElement(o.default.Item,null,n("issue_tag_ids",{initialValue:g})(p.default.createElement(s.default,{placeholder:S&&S.length>0?"未选择标记":"请在仓库设置里添加标记",showSearch:!0,className:"searchIcon",suffixIcon:p.default.createElement("i",{className:"iconfont icon-sousuo1"}),optionFilterProp:"children",filterOption:function(e,t){return t.props.value&&t.props.children&&t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0}},p.default.createElement(v,{key:0,value:""},S&&S.length>0?"未选择标记":"请在仓库设置里添加标记"),this.renderSelect(S)))),p.default.createElement(o.default.Item,null,n("priority_id",{initialValue:_})(p.default.createElement(s.default,{placeholder:"优先级",showSearch:!0},this.renderSelect(N))))))))))}}]),t}(d.Component),b=o.default.create({name:"NewMergeForm"})(y);t.default=b},RqAY:function(e,t,n){"use strict";function r(e){return Object.keys(e).reduce((function(t,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||"data-__"===n.substr(0,7)||(t[n]=e[n]),t}),{})}n.d(t,"a",(function(){return r}))},"Rs/d":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a,o=(r=["\n display:flex;\n font-weight: bold;\n ","\n align-items: center;\n & img{\n width:30px;\n height:30px;\n border-radius:50%;\n }\n ","\n "],a=["\n display:flex;\n font-weight: bold;\n ","\n align-items: center;\n & img{\n width:30px;\n height:30px;\n border-radius:50%;\n }\n ","\n "],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(a)}}))),l=s(n("q1tI")),i=s(n("vOnD")),c=n("eO8H");function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.url,n=e.name,r=e.column,a=e.id,s=e.login,u=i.default.span(o,r&&"flex-direction: column;text-align:center;",!r&&"\n & span{\n margin-left:8px;\n }");return a?l.default.createElement(c.Link,{to:"/"+s},l.default.createElement(u,null,t&&l.default.createElement("img",{src:t,alt:""}),l.default.createElement("span",null,n))):l.default.createElement(u,null,t&&l.default.createElement("img",{src:t,alt:""}),l.default.createElement("span",null,n))}},VPG4:function(e,t,n){},Yg6f:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=y(n("14Xm")),a=y(n("W9HT")),o=y(n("+KLJ")),l=y(n("5rEg")),i=y(n("2fM7")),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("04bd"),n("2DKY"),n("1vPl"),n("8QGh");var f=n("q1tI"),d=y(f),p=y(n("vDqi")),m=y(n("QCvN")),h=y(n("Fyak")),g=n("sYIF"),v=n("J66h");function y(e){return e&&e.__esModule?e:{default:e}}function b(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(a,o){try{var l=t[a](o),i=l.value}catch(e){return void n(e)}if(!l.done)return Promise.resolve(i).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(i)}("next")}))}}n("6JOy"),n("js5m");function _(e){var t={mergeOwner:void 0,mergeBranch:"master",pullOwner:void 0,pullBranch:"master",projectId:void 0},n=e.slice(1).split("/compare"),r=u(n,2),a=r[0],o=r[1],l=a.split("/"),i=u(l,2),c=i[0],s=i[1];if(t.mergeOwner=c,t.pullOwner=c,t.projectId=s,o){var f=o.slice(1);if(f.indexOf("...")>-1){var d=f.split("..."),p=u(d,2),m=p[0],h=p[1];if(t.mergeBranch=m,h.indexOf(":")>-1){var g=h.split(":"),v=u(g,2),y=v[0],b=v[1];t.pullOwner=y,t.pullBranch=b}else t.pullBranch=h}else t.pullBranch=f}return t}var E=i.default.Option,w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));j.call(n);var r=_(n.props.location.pathname),a=r.pullBranch,o=r.mergeBranch;return n.state={data:void 0,pullBranches:void 0,mergeBranches:void 0,mergeProjects:void 0,merge:(0,g.returnbar)(o)||"master",pull:(0,g.returnbar)(a)||"master",id:void 0,projects_names:void 0,isSpin:!0,showMessage:!1,merge_head:!1,defaultMessage:"必须选择不同的分支",project_id:void 0,merge_project_user:void 0,comparesData:void 0,isCompareSpin:!0,isFirstLoading:!0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.data,r=t.pullBranches,s=t.mergeBranches,u=t.mergeProjects,f=t.pull,p=t.merge,g=t.isSpin,v=t.isCompareSpin,y=t.isFirstLoading,b=t.showMessage,_=t.defaultMessage,E=t.projects_names,w=t.id,j=t.comparesData,O=this.props.project;return d.default.createElement("div",null,d.default.createElement(a.default,{spinning:g||v},d.default.createElement("div",{className:"main"},d.default.createElement("div",{className:"merge-header width100 inline-block"},d.default.createElement("div",{className:"width40 pull-left"},d.default.createElement("div",{className:"color-grey-3 mb10 fwb"},"源分支 : "),d.default.createElement(l.default.Group,{compact:!0,className:"display-flex"},d.default.createElement(i.default,{value:w,className:"hide-1 task-hide flex1",disabled:!0},this.renderProjectNames(E)),d.default.createElement(i.default,{value:f,onSelect:function(t){return e.selectBrach("pull",t)},showSearch:!0,className:"merge-flex1 flex1 matchwidth",dropdownMatchSelectWidth:!1,dropdownClassName:"overlihide"},this.renderBrances(r)))),d.default.createElement("div",{className:"width10 pull-left text-center mt25"},d.default.createElement("i",{className:"iconfont icon-youjiang color-grey-c font-32"})),d.default.createElement("div",{className:"width40 pull-left"},d.default.createElement("div",null,d.default.createElement("div",{className:"color-grey-3 mb10 fwb"},"目标分支 : "),d.default.createElement(l.default.Group,{compact:!0,className:"display-flex"},d.default.createElement(i.default,{value:O&&O.id,className:"hide-1 task-hide flex1",onSelect:function(t){return e.selectProjectName(t,!0)}},this.renderProjectNames(u)),d.default.createElement(i.default,{value:p,onSelect:function(t){return e.selectBrach("merge",t)},showSearch:!0,className:"merge-flex1 flex1 matchwidth",dropdownMatchSelectWidth:!1,dropdownClassName:"overlihide"},this.renderBrances(s)))))),!v&&b&&d.default.createElement("div",{className:"mb20"},d.default.createElement(o.default,{description:this.withHtml(_),type:"error"})),!v&&!b&&d.default.createElement(m.default,c({},this.props,{merge_type:"new",data:n,merge:p,pull:f,files_count:j&&j.diff&&j.diff.files_count,commits_count:j&&j.commits_count}))),!y&&d.default.createElement(h.default,c({},this.props,{merge:p,pull:f,limit:15,changeCommitFunc:this.changeCommitFunc,comparesData:j}))))}}]),t}(f.Component),j=function(){var e,t,n,a=this;this.componentDidMount=function(){var e=_(a.props.location.pathname);a.getMergeInfo(e,!0),a.checkBranch(e)},this.componentDidUpdate=function(e){var t=e.location.pathname,n=a.props.location.pathname;if(t!==n){var r=_(n);a.getMergeInfo(r),a.checkBranch(r)}},this.getMergeInfo=function(e,t){a.setState({isSpin:!0});var n=e.pullOwner,r=e.pullBranch,o=(e.mergeOwner,e.mergeBranch),l="/"+n+"/"+e.projectId+"/pulls/new.json";p.default.get(l).then((function(n){if(n){if(t){var l=n.data.projects_names&&n.data.projects_names.filter((function(t){return t.project_user_login===e.mergeOwner}));l&&l[0]&&a.selectProjectName(l[0].id,!1,{projects_names:n.data.projects_names,id:n.data.id})}a.setState({projects_names:n.data.projects_names,mergeProjects:n.data.merge_projects,project_id:n.data.project_id,id:n.data.id,merge:(0,g.returnbar)(o),pull:(0,g.returnbar)(r)})}})).catch((function(e){a.setState({isSpin:!1}),console.log(e)}))},this.checkBranch=(e=b(r.default.mark((function e(t){var n,o,l,i,c,s,u;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.mergeBranch,o=t.mergeOwner,l=t.projectId,i=t.pullBranch,c=t.pullOwner,e.next=3,a.getBranchList(o,l,i,n,"merge");case 3:return s=e.sent,e.next=6,a.getBranchList(c,l,i,n,"pull");case 6:u=e.sent,s&&u?a.compareProject(o===c,t,1):a.setState({isSpin:!1,isCompareSpin:!1});case 8:case"end":return e.stop()}}),e,a)}))),function(t){return e.apply(this,arguments)}),this.compareProject=function(e,t,n){var r=t.pullOwner,o=t.pullBranch,l=t.mergeOwner,i=t.mergeBranch,c=t.projectId,s="/"+l+"/"+c+"/compare";s+=e?"/"+v.Base64.encode((0,g.returnbar)(o))+"..."+v.Base64.encode((0,g.returnbar)(i))+".json":"/"+v.Base64.encode((0,g.returnbar)(i))+"..."+r+"/"+c+":"+v.Base64.encode((0,g.returnbar)(o))+".json",p.default.get(s,{params:{limit:15,page:n}}).then((function(e){e&&(0===e.data.status?a.setState({showMessage:!1}):a.setState({showMessage:!0,defaultMessage:e.data.message}),a.setState({comparesData:e.data,isSpin:!1,isCompareSpin:!1,isFirstLoading:!1}))})).catch((function(e){a.setState({isSpin:!1,isCompareSpin:!1})}))},this.getBranchList=(t=b(r.default.mark((function e(t,n,o,l,i){var c,s;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c="/"+t+"/"+n+"/branches.json",e.next=3,p.default.get(c).then((function(e){if(e.data){var t=0===(e.data||[]).filter((function(e){return e.name===o})).length,n=0===(e.data||[]).filter((function(e){return e.name===l})).length;return"pull"===i?a.setState({pullBranches:e.data}):a.setState({mergeBranches:e.data}),"pull"===i&&t?(a.setState({showMessage:o,defaultMessage:"源分支不存在",isCompareSpin:!1}),!1):"merge"!==i||!n||(a.setState({showMessage:l,defaultMessage:"目标分支不存在",isCompareSpin:!1}),!1)}})).catch((function(e){a.setState({isSpin:!1}),s=!1}));case 3:return s=e.sent,e.abrupt("return",s);case 5:case"end":return e.stop()}}),e,a)}))),function(e,n,r,a,o){return t.apply(this,arguments)}),this.selectBrach=function(e,t){var n=_(a.props.location.pathname),r=n.pullOwner,o=n.pullBranch,l=n.mergeOwner,i=n.mergeBranch,c="/"+l+"/"+n.projectId+"/compare/",s="pull"===e?t:o,u="pull"===e?i:t;c+=r===l?(0,g.turnbar)(u)+"..."+(0,g.turnbar)(s):(0,g.turnbar)(u)+"..."+r+":"+(0,g.turnbar)(s),a.props.history.push(c)},this.selectProjectName=function(e,t,n){var r=t?a.state:n,o=r.projects_names,l=r.id,i=_(a.props.location.pathname),c=i.pullOwner,s=i.pullBranch,u=o&&o.filter((function(t){return t.id===e})),f=u&&u[0].project_id,d=u&&u[0].project_user_login,p=parseInt(e,10)!==parseInt(l,10);if(a.setState({data:{is_original:p,fork_project_id:p?l:"",merge_user_login:p?o[0].project_user_login:void 0}}),t){var m=a.props.defaultBranch,h=(0,g.turnbar)(m)||"master";d===c?a.props.history.push("/"+d+"/"+f+"/compare/"+h+"..."+(0,g.turnbar)(s)):a.props.history.push("/"+d+"/"+f+"/compare/"+h+"..."+c+":"+(0,g.turnbar)(s))}},this.renderBrances=function(e){if(e&&e.length>0)return e.map((function(e,t){return d.default.createElement(E,{key:t+1,value:e.name},e.name)}))},this.renderProjectNames=function(e){if(e&&e.length>0)return e.map((function(e,t){return d.default.createElement(E,{key:t+1,value:e.id},e.project_name)}))},this.withHtml=function(e){return d.default.createElement("div",{dangerouslySetInnerHTML:{__html:e}})},this.changePullValue=(n=b(r.default.mark((function e(t,n){var o,l,i,c,s;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=_(a.props.location.pathname),l=o.pullOwner,i=o.mergeOwner,c=o.projectId,s="/"+("pull"===n?l:i)+"/"+c+"/pulls/get_branches.json",p.default.get(s,{params:{name:t||void 0}}).then((function(e){e&&("pull"===n?a.setState({pullBranches:e.data,pullBranch:e.data}):a.setState({mergeBranches:e.data,mergeBranch:e.data}))})).catch((function(e){}));case 4:case"end":return e.stop()}}),e,a)}))),function(e,t){return n.apply(this,arguments)}),this.changeCommitFunc=function(e){a.setState({isSpin:!0});var t=_(a.props.location.pathname),n=t.mergeOwner,r=t.pullOwner;a.compareProject(n===r,t,e)}};t.default=w},aABL:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n("3S7+")),a=u(n("CFYs")),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("TfFZ"),n("D8SU");var l=n("q1tI"),i=u(l),c=n("PhNK"),s=n("spEH");function u(e){return e&&e.__esModule?e:{default:e}}n("js5m"),n("VPG4"),t.default=function(e){var t=e.data,n=e.history,u=e.owner,f=e.projectsId,d=e.parentsSha,p=(0,l.useState)(t&&t.files),m=o(p,2),h=m[0],g=m[1],v=(0,l.useState)("复制文件路径"),y=o(v,2),b=y[0],_=y[1],E=(0,l.useState)(!1),w=o(E,2),j=w[0],O=w[1];function S(e,t,n){if(!n){var r=h.concat();r[t].flag=!e,r.splice(),g(r)}}(0,l.useEffect)((function(){t&&g(t.files)}),[t]),(0,l.useEffect)((function(){document.addEventListener("click",(function(){O(!1)}))}),[]);var C=i.default.createElement("div",{className:"folders"},i.default.createElement("div",{className:"folderList"},h&&h.map((function(e,t){return i.default.createElement("a",{href:"#value"+t},i.default.createElement(s.FlexAJ,{className:"filesInfo",key:t,onClick:function(){e.flag&&S(e.flag,t,e.isBin),O(!1)}},i.default.createElement(s.AlignCenter,null,i.default.createElement("i",{className:"iconfont icon-wenjianicon mr4"}),i.default.createElement("span",{className:"cursor-pointer","data-clipboard-text":e.name},e.name)),i.default.createElement("div",{className:"see-file"},i.default.createElement(r.default,{placement:"top",title:e.addition+e.deletion+"处更改"+(e.addition+e.deletion>0?"":"")+(e.addition>0?e.addition+"处添加":"")+(e.addition>0&&e.deletion>0?"和":"")+(e.deletion>0?e.deletion+"处删除":"")},i.default.createElement(a.default,{showInfo:!1,strokeColor:"#2DB44D",size:"small",percent:e.addition/(e.addition+e.deletion)*100}),e.addition>0&&i.default.createElement("span",{className:"color-green ml10"},"+",e.addition),e.deletion>0&&i.default.createElement("span",{className:"color-red ml10"},"-",e.deletion)))))}))));return i.default.createElement("div",{onClick:function(e){e.nativeEvent.stopImmediatePropagation()}},i.default.createElement(s.AlignCenter,{className:"color-grey-9",style:{position:"relative"}},i.default.createElement("div",{onClick:function(){O(!j)}},i.default.createElement("i",{className:"iconfont mr5 "+(j?"font-18 icon-sanjiaoxing-down":"font-16 icon-triangle")}),i.default.createElement("span",{className:"color-grey-6 update-file-count"},"共有",i.default.createElement("span",{className:"color-grey-3"}," ",t&&t.files_count," 个文件 "),"被更改,包括",t&&t.total_addition?i.default.createElement("span",{className:"color-green"}," ",t&&t.total_addition," 次插入"):"",t&&t.total_addition&&t.total_deletion?" 和 ":"",t&&t.total_deletion?i.default.createElement("span",{className:"color-red"}," ",t&&t.total_deletion," 次删除"):"")),j&&C),h&&h.length>0&&i.default.createElement("div",{className:"fileList"},h.map((function(e,t){return i.default.createElement("div",{className:"files",key:t},i.default.createElement("a",{id:"value"+t,className:"anchorPoint"}),i.default.createElement(s.FlexAJ,{className:"filesInfo"},i.default.createElement(s.AlignCenter,null,e.isBin?"":i.default.createElement("i",{className:e.flag?"iconfont icon-triangle font-15 color-grey-9":"iconfont icon-sanjiaoxing-down color-grey-9 mt4",onClick:function(){return S(e.flag,t,e.isBin)}}),i.default.createElement("span",{className:"cursor-pointer","data-clipboard-text":e.name,onClick:function(){return S(e.flag,t,e.isBin)}},e.name),i.default.createElement(r.default,{title:b,onVisibleChange:function(){return _("复制文件路径")}},i.default.createElement("i",{className:"iconfont icon-fuzhiicon ml6",onClick:function(){return t=e.name,(n=document.createElement("input")).defaultValue=t,document.body.appendChild(n),n.select(),document.execCommand("Copy"),n.className="copyCont",n.style.display="none",void _("复制成功");var t,n}}))),i.default.createElement("div",{className:"see-file"},i.default.createElement(r.default,{placement:"top",title:e.addition+e.deletion+"处更改"+(e.addition+e.deletion>0?"":"")+" "+(e.addition>0?e.addition+"处添加":"")+(e.addition>0&&e.deletion>0?"和":"")+(e.deletion>0?e.deletion+"处删除":"")},i.default.createElement(a.default,{showInfo:!1,strokeColor:"#2DB44D",size:"small",percent:e.addition/(e.addition+e.deletion)*100}),i.default.createElement("span",{className:"ml10"},e.addition+e.deletion,"处")),!e.isSubmodule&&i.default.createElement("span",{className:"see-file-btn",onClick:function(){n.push("/"+u+"/"+f+(e.isDeleted?"/commits/"+(0,c.truncateCommitId)(d):"/tree/"+(0,c.truncateCommitId)(e.sha)+"/"+e.name))}},"查看文件"))),e.sections&&e.sections.length>=1&&!e.flag&&i.default.createElement("div",{className:"filesContent"},e.sections.map((function(e,t){return e.lines&&e.lines.length>0&&e.lines.map((function(e,n){return i.default.createElement("div",{key:t+n,className:2===e.type?"linesContent add":3===e.type?"linesContent reduce":4===e.type?"linesContent translate":"linesContent"},i.default.createElement("span",{className:"lines"},i.default.createElement("span",null,e.leftIdx&&"0"!==e.leftIdx?e.leftIdx:""),i.default.createElement("span",null,e.rightIdx&&"0"!==e.rightIdx?e.rightIdx:"")),i.default.createElement("p",null,e.content))}))}))))}))))}},js5m:function(e,t,n){},mr32:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("TSYQ"),o=n.n(a),l=n("BGR+"),i=n("VCL8"),c=n("CtXQ"),s=n("H84U");function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=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(e){return!1}}();return function(){var n,r=y(e);if(t){var a=y(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return v(this,n)}}function v(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(i,e);var t,n,a,l=g(i);function i(){var e;return p(this,i),(e=l.apply(this,arguments)).handleClick=function(){var t=e.props,n=t.checked,r=t.onChange;r&&r(!n)},e.renderCheckableTag=function(t){var n,a=t.getPrefixCls,l=e.props,i=l.prefixCls,c=l.className,s=l.checked,u=b(l,["prefixCls","className","checked"]),p=a("tag",i),m=o()(p,(d(n={},"".concat(p,"-checkable"),!0),d(n,"".concat(p,"-checkable-checked"),s),n),c);return delete u.onChange,r.createElement("span",f({},u,{className:m,onClick:e.handleClick}))},e}return t=i,(n=[{key:"render",value:function(){return r.createElement(s.a,null,this.renderCheckableTag)}}])&&m(t.prototype,n),a&&m(t,a),i}(r.Component),E=n("09Wf"),w=n("6CfX"),j=n("g0mS");function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t=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(e){return!1}}();return function(){var n,r=I(e);if(t){var a=I(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},T=new RegExp("^(".concat(E.a.join("|"),")(-inverse)?$")),M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(u,e);var t,n,a,i=x(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=i.call(this,e)).state={visible:!0},t.handleIconClick=function(e){e.stopPropagation(),t.setVisible(!1,e)},t.renderTag=function(e){var n=t.props,a=n.children,o=B(n,["children"]),i="onClick"in o||a&&"a"===a.type,c=Object(l.default)(o,["onClose","afterClose","color","visible","closable","prefixCls"]);return i?r.createElement(j.a,null,r.createElement("span",C({},c,{className:t.getTagClassName(e),style:t.getTagStyle()}),a,t.renderCloseIcon())):r.createElement("span",C({},c,{className:t.getTagClassName(e),style:t.getTagStyle()}),a,t.renderCloseIcon())},Object(w.a)(!("afterClose"in e),"Tag","'afterClose' will be deprecated, please use 'onClose', we will remove this in the next version."),t}return t=u,a=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:null}}],(n=[{key:"getTagStyle",value:function(){var e=this.props,t=e.color,n=e.style,r=this.isPresetColor();return C({backgroundColor:t&&!r?t:void 0},n)}},{key:"getTagClassName",value:function(e){var t,n=e.getPrefixCls,r=this.props,a=r.prefixCls,l=r.className,i=r.color,c=this.state.visible,s=this.isPresetColor(),u=n("tag",a);return o()(u,(S(t={},"".concat(u,"-").concat(i),s),S(t,"".concat(u,"-has-color"),i&&!s),S(t,"".concat(u,"-hidden"),!c),t),l)}},{key:"setVisible",value:function(e,t){var n=this.props,r=n.onClose,a=n.afterClose;r&&r(t),a&&!r&&a(),t.defaultPrevented||"visible"in this.props||this.setState({visible:e})}},{key:"isPresetColor",value:function(){var e=this.props.color;return!!e&&T.test(e)}},{key:"renderCloseIcon",value:function(){return this.props.closable?r.createElement(c.default,{type:"close",onClick:this.handleIconClick}):null}},{key:"render",value:function(){return r.createElement(s.a,null,this.renderTag)}}])&&N(t.prototype,n),a&&N(t,a),u}(r.Component);M.CheckableTag=_,M.defaultProps={closable:!1},Object(i.polyfill)(M);t.default=M},n5Yh:function(e,t,n){},u3En:function(e,t,n){}}]);