forgeplus/public/react/build/static/js/13.2c49bc62.chunk.js

1 line
36 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([[13,132],{"85A0":function(e,t,n){},NUct:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=g(n("W9HT")),r=g(n("3S7+")),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();n("04bd"),n("TfFZ");var i=n("q1tI"),c=g(i),s=n("eO8H"),u=n("spEH"),d=g(n("q7EM"));n("sYIF");n("7dqz"),n("85A0");var p=n("qmW9"),f=g(n("CnBM")),m=g(n("HUFq")),h=g(n("vDqi"));function g(e){return e&&e.__esModule?e:{default:e}}var b=(0,f.default)({loader:function(){return n.e(119).then(n.t.bind(null,"6dZj",7))},loading:m.default}),x=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(4),n.e(29),n.e(104)]).then(n.t.bind(null,"DTGX",7))},loading:m.default}),y=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(4),n.e(9),n.e(39)]).then(n.t.bind(null,"IZ3b",7))},loading:m.default}),E=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(3),n.e(4),n.e(34)]).then(n.t.bind(null,"SqvK",7))},loading:m.default}),w=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(19),n.e(62),n.e(81)]).then(n.t.bind(null,"WT1Z",7))},loading:m.default}),_=(0,f.default)({loader:function(){return n.e(112).then(n.t.bind(null,"+JVH",7))},loading:m.default}),v=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(21),n.e(115)]).then(n.t.bind(null,"fyLZ",7))},loading:m.default}),k=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(17),n.e(117)]).then(n.t.bind(null,"s4sY",7))},loading:m.default}),j=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(17),n.e(116)]).then(n.t.bind(null,"IxYK",7))},loading:m.default}),I=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(4),n.e(9),n.e(40)]).then(n.t.bind(null,"+JJy",7))},loading:m.default}),N=((0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(4),n.e(9),n.e(38)]).then(n.t.bind(null,"Gofe",7))},loading:m.default}),(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(50)]).then(n.t.bind(null,"VSCt",7))},loading:m.default})),S=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(12),n.e(66),n.e(55)]).then(n.t.bind(null,"Yg6f",7))},loading:m.default}),O=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(3),n.e(4),n.e(33)]).then(n.t.bind(null,"TiQt",7))},loading:m.default}),C=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(12),n.e(48)]).then(n.t.bind(null,"vhIH",7))},loading:m.default}),P=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(59)]).then(n.t.bind(null,"+nTR",7))},loading:m.default}),R=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(93)]).then(n.t.bind(null,"cFFD",7))},loading:m.default}),B=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(92)]).then(n.t.bind(null,"zM51",7))},loading:m.default}),D=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(120)]).then(n.t.bind(null,"LMhh",7))},loading:m.default}),F=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(113)]).then(n.t.bind(null,"p6ow",7))},loading:m.default}),L=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(18)]).then(n.t.bind(null,"VEFH",7))},loading:m.default}),M=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(11),n.e(21),n.e(44),n.e(36)]).then(n.t.bind(null,"gUMM",7))},loading:m.default}),A=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(87)]).then(n.t.bind(null,"rS1K",7))},loading:m.default}),z=(0,f.default)({loader:function(){return Promise.all([n.e(3),n.e(4),n.e(9),n.e(67)]).then(n.t.bind(null,"B3S4",7))},loading:m.default}),T=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(1),n.e(3),n.e(4),n.e(32)]).then(n.t.bind(null,"tF+v",7))},loading:m.default}),q=(0,f.default)({loader:function(){return n.e(111).then(n.t.bind(null,"cuo/",7))},loading:m.default}),H=(0,f.default)({loader:function(){return Promise.all([n.e(0),n.e(3),n.e(4),n.e(9),n.e(54)]).then(n.t.bind(null,"dINp",7))},loading:m.default}),W=(0,f.default)({loader:function(){return n.e(52).then(n.t.bind(null,"RS/3",7))},loading:m.default});var G=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 a=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 a.componentDidMount=function(){a.getProject()},a.componentDidUpdate=function(e){var t=e.match.params,n=a.props.match.params;e&&a.props&&(t.projectsId!==n.projectsId||t.owner!==n.owner)&&a.getProject()},a.getProject=function(e){var t=a.props.match.params,n=t.projectsId,r="/"+t.owner+"/"+n+"/simple.json";h.default.get(r).then((function(t){t&&t.data&&(a.setState({project:t.data,open_devops:t.data.open_devops,platform:t.data.platform&&"educoder"!==t.data.platform}),0!==t.data.type&&1===t.data.mirror_status?(console.log("--------start channel --------"),a.canvasChannel(),e?a.setState({secondSync:!0,firstSync:!1}):a.setState({firstSync:!0,secondSync:!1})):2===t.data.mirror_status?a.deleteProjectBack():(a.getDetail(),a.setState({firstSync:!1,secondSync:!1})))}))},a.changeOpenDevops=function(e){a.setState({open_devops:e})},a.canvasChannel=function(e){var t="localhost"===window.location.hostname?"testforgeplus.trustie.net":window.location.hostname,r=n("9e53"),o=a.state.project,l=r.createConsumer("wss://"+t+"/cable");a.canvasChannel1=l.subscriptions.create({channel:"MirrorProjectChannel",id:o&&o.id},{connected:function(){console.log("###### channel connected! ######")},disconnected:function(){},received:function(t){console.log("###### ---received data--- ######"),console.log(t),t&&(e?(a.props.showNotification("镜像同步成功!"),window.location.reload()):(t.project&&2===t.project.mirror_status&&a.deleteProjectBack(),a.getDetail()),a.setState({firstSync:!1,secondSync:!1}),l.subscriptions.consumer.disconnect())}})},a.deleteProjectBack=function(){var e=a.props.history,t=a.props.match.params,n=t.projectsId,r=t.owner;h.default.delete("/"+r+"/"+n+".json").then((function(t){var n="/projects/mirror/new";t&&t.data?e.push({pathname:n,mirror_status:2}):window.location.hash=n}))},a.getDetail=function(){var e=a.props.match.params,t=e.projectsId,n=e.owner;a.getBanner();var r="/"+n+"/"+t+"/detail.json";h.default.get(r).then((function(e){e&&e.data&&(404===e.data.status&&a.props.history.push("/nopage"),a.setState({projectDetail:e.data,project_id:e.data.project_id,isManager:e.data.permission&&("Manager"===e.data.permission||"Admin"===e.data.permission||"Owner"===e.data.permission),isReporter:e.data.permission&&"Reporter"===e.data.permission,isDeveloper:e.data.permission&&"Developer"===e.data.permission,http_url:e.data.clone_url,praised:e.data.praised,watched:e.data.watched,watchers_count:e.data.watchers_count,praises_count:e.data.praises_count,forked_count:e.data.forked_count,defaultBranch:e.data.default_branch}))})).catch((function(e){}))},a.focusFunc=function(e){if(a.state.platform){var t=a.state.project_id;(0,h.default)({method:e?"delete":"post",url:"/watchers/"+(e?"unfollow":"follow")+".json",params:{target_type:"project",id:t}}).then((function(e){e&&0===e.data.status&&a.setWatchersCount(e.data.watchers_count,e.data.watched)})).catch((function(e){console.log(e)}))}},a.pariseFunc=function(e){if(a.state.platform){var t=a.state.project_id;(0,h.default)({method:e?"delete":"post",url:"/projects/"+t+"/praise_tread/"+(e?"unlike":"like")+".json"}).then((function(e){e&&0===e.data.status&&a.setPraisesCount(e.data.praises_count,e.data.praised)})).catch((function(e){console.log(e)}))}},a.setWatchersCount=function(e,t){a.setState({watched:t,watchers_count:e})},a.setPraisesCount=function(e,t){a.setState({praised:t,praises_count:e})},a.forkFunc=function(){if(a.state.platform){a.setState({forkSpin:!0});var e=a.props.current_user,t=a.props.match.params,n=t.projectsId,r="/"+t.owner+"/"+n+"/forks.json";h.default.post(r).then((function(t){t&&0===t.data.status&&(a.props.history.push("/"+(e&&e.login)+"/"+t.data.identifier),a.props.showNotification(t.data.message)),a.setState({forkSpin:!1})})).catch((function(e){a.setState({forkSpin:!1})}))}},a.synchronismMirror=function(){if(a.state.platform){var e=a.props.match.params,t=e.projectsId,n="/"+e.owner+"/"+t+"/sync_mirror.json";h.default.post(n).then((function(e){e&&e.data&&0===e.data.status?(a.setState({secondSync:!0}),a.canvasChannel(!0)):a.props.showNotification("镜像同步失败!")})).catch((function(e){console.log(e)}))}},a.textFunc=function(e,t){t&&t.fork_project_user_type;return e&&t?c.default.createElement("div",{className:"color-grey-9 df"},c.default.createElement("span",null,"复刻自"),c.default.createElement(s.Link,{to:"/"+t.fork_project_user_login,className:"show-user-link color-grey-6 ml5"},t.fork_project_user_name),c.default.createElement("span",null," / "),c.default.createElement(s.Link,{to:"/"+t.fork_project_user_login+"/"+t.fork_project_identifier,className:"color-grey-6 task-hide flex1",style:{maxWidth:"400px"},title:t.fork_form_name},t.fork_form_name)):""},a.state={projectDetail:void 0,isManager:!1,isReporter:!1,isDeveloper:!1,project_id:void 0,watchers_count:void 0,praises_count:void 0,forked_count:void 0,watched:!1,praised:!1,http_url:void 0,branchs:void 0,branchList:void 0,project:null,firstSync:!1,secondSync:!1,open_devops:!1,forkSpin:!1,defaultBranch:void 0,platform:!1},a}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),l(t,[{key:"getBanner",value:function(){var e=this,t=this.props.match.params,n=t.projectsId,a="/"+t.owner+"/"+n+"/menu_list.json";h.default.get(a).then((function(t){t&&e.setState({bannerList:t.data})})).catch((function(e){}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.projectDetail,l=t.watchers_count,i=t.praises_count,p=t.forked_count,f=t.firstSync,m=t.secondSync,h=t.isManager,g=t.watched,G=t.praised,J=t.project,U=t.open_devops,Y=t.platform,Z=t.defaultBranch,V=t.bannerList,K=t.forkSpin,Q=this.props.history.location.pathname,X=3===Q.split("/").length,$=this.props.match.params,ee=$.projectsId,te=$.owner,ne=this.props.current_user,ae=function(e,t,n){var a="";if(n&&n!=="/"+t+"/"+e){var r=n.split("/"+t+"/"+e)[1]||"";r.indexOf("/about")>-1?a="about":r.indexOf("/issues")>-1||r.indexOf("Milepost")>0?a="issues":r.indexOf("/pulls")>-1||r.indexOf("/compare")>-1?a="pulls":r.indexOf("/milestones")>-1?a="milestones":r.indexOf("/activity")>-1?a="activity":r.indexOf("/settings")>-1?a="settings":r.indexOf("/devops")>-1?a="devops":r.indexOf("/source")>-1?a="source":r.indexOf("/wiki")>-1&&(a="wiki")}return a}(ee,te,Q),re=this.props.history.location.state,oe={getDetail:this.getDetail,changeOpenDevops:this.changeOpenDevops,defaultBranch:Z};return c.default.createElement("div",null,c.default.createElement("div",{className:"detailHeader-wrapper"},c.default.createElement("div",{className:"normal"},c.default.createElement(u.AlignTop,{style:{padding:"18px 0px 10px",justifyContent:"space-between"}},c.default.createElement("div",null,c.default.createElement(u.AlignTop,null,c.default.createElement("div",{className:"projectallName"},J&&J.author&&c.default.createElement(s.Link,{to:"/"+J.author.login},J.author.name),c.default.createElement("span",{className:"ml5 mr5"},"/"),c.default.createElement(s.Link,{to:"/"+te+"/"+ee,className:"projectN mt6"},n&&n.name)),n&&n.private&&c.default.createElement("span",{className:"privateTag mt6"},"私有")),c.default.createElement("div",{className:"mt8"},n&&n.forked_from_project_id&&n.fork_info?this.textFunc(n.forked_from_project_id,n.fork_info):"",n&&n.type&&0!==n.type?c.default.createElement("span",{className:"color-grey-9"},"导入于 ",c.default.createElement("a",{className:"color-grey-6",target:"_blank",href:n.mirror_url},n.mirror_url)):"")),c.default.createElement("div",null,f?"":c.default.createElement("span",{className:"df"},(ne&&ne.admin||h)&&n&&n.type&&2===n.type?c.default.createElement("a",{className:"synchronism ml30",onClick:this.synchronismMirror},"同步镜像"):"",c.default.createElement("span",{className:"detail_tag_btn"},c.default.createElement("a",{className:"detail_tag_btn_name",style:{cursor:Y?"pointer":"default"},onClick:function(){return e.focusFunc(g)}},c.default.createElement("i",{className:g?"iconfont icon-shixing color-orange font-16 mr3":"iconfont icon-kongxing color-grey-9 font-16 mr3"}),c.default.createElement("span",null,g?"取消关注":"关注")),l>0?Y?c.default.createElement(s.Link,{className:"detail_tag_btn_count",style:{color:"#666"},to:Y?{pathname:"/"+te+"/"+ee+"/following",state:re}:""},l):c.default.createElement("span",{className:"detail_tag_btn_count"},l):""),c.default.createElement("span",{className:"detail_tag_btn"},c.default.createElement("a",{className:"detail_tag_btn_name",style:{cursor:Y?"pointer":"default"},onClick:function(){return e.pariseFunc(G)}},c.default.createElement("i",{className:G?"iconfont icon-weibiaoti105 color-orange font-14 mr3":"iconfont icon-guanzhu color-grey-9 font-14 mr3"}),c.default.createElement("span",null,G?"取消点赞":"点赞")),i>0?Y?c.default.createElement(s.Link,{className:"detail_tag_btn_count",style:{color:"#666"},to:{pathname:"/"+te+"/"+ee+"/stargazers",state:re}},i):c.default.createElement("span",{className:"detail_tag_btn_count"},i):""),c.default.createElement("span",{className:"detail_tag_btn",loading:K},c.default.createElement(r.default,{title:"复刻是fork的中文名即复制代码仓库",placement:"bottom"},c.default.createElement("a",{className:"detail_tag_btn_name",style:{cursor:Y?"pointer":"default"},onClick:this.forkFunc},c.default.createElement("i",{className:"iconfont icon-fork color-grey-9 mr3 font-16"}),c.default.createElement("span",null,"复刻(Fork)"))),p>0?Y?c.default.createElement(s.Link,{className:"detail_tag_btn_count",to:{pathname:"/"+te+"/"+ee+"/members",state:re}},p):c.default.createElement("span",{className:"detail_tag_btn_count"},p):"")))),f?"":c.default.createElement(d.default,{history:this.props.history,list:V,owner:te,projectsId:ee,pathname:ae,state:re,projectDetail:n,open_devops:U,platform:Y,urlFlag:X,isManager:h}))),f?c.default.createElement(u.Content,{className:"spincontent"},c.default.createElement(a.default,{className:"spinstyle",tip:J&&"正在从 "+J.mirror_url+" 迁移",size:"large"})):c.default.createElement(a.default,{spinning:m,className:"spinstyle",tip:"正在同步镜像",size:"large"},c.default.createElement(s.Switch,this.props,c.default.createElement(s.Route,{path:"/:owner/:projectsId/source",render:function(){return c.default.createElement(T,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/about",render:function(){return c.default.createElement(z,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/wiki/add",render:function(){return c.default.createElement(W,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/wiki/edit/:wikiName",render:function(){return c.default.createElement(W,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/wiki",render:function(){return c.default.createElement(H,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/devops",render:function(){return c.default.createElement(q,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/tags",render:function(t){return c.default.createElement(x,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/settings",render:function(t){return c.default.createElement(b,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/milestones/:meilid/edit",render:function(t){return c.default.createElement(j,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/milestones/new",render:function(t){return c.default.createElement(k,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/milestones/:meilid",render:function(t){return c.default.createElement(P,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/milestones",render:function(t){return c.default.createElement(v,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/:milepostId/new",render:function(t){return c.default.createElement(y,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/new",render:function(t){return c.default.createElement(y,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/:orderId/:operateName",render:function(t){return c.default.createElement(I,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/:orderId/copyetail",render:function(t){return c.default.createElement(I,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues/:orderId",render:function(t){return c.default.createElement(E,o({},e.props,e.state,t,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/activity",render:function(t){return c.default.createElement(A,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/issues",render:function(t){return c.default.createElement(w,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/compare",render:function(t){return c.default.createElement(S,o({},e.props,t,e.state,oe,{is_fork:!0}))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls/:mergeId/edit",render:function(t){return c.default.createElement(C,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls/:mergeId",render:function(t){return c.default.createElement(O,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls/:mergeId/commits",render:function(t){return c.default.createElement(O,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls/:mergeId/files",render:function(t){return c.default.createElement(O,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls/:mergeId/MergeSubmit",render:function(t){return c.default.createElement(O,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/pulls",render:function(t){return c.default.createElement(N,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/following",render:function(t){return c.default.createElement(R,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/stargazers",render:function(t){return c.default.createElement(B,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/members",render:function(t){return c.default.createElement(D,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/contribute",render:function(){return c.default.createElement(F,o({},e.props,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/commits/branch/:branchName",render:function(t){return c.default.createElement(L,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/tree/:branchName",render:function(t){return c.default.createElement(M,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId/:subIndex",render:function(t){return c.default.createElement(_,o({},e.props,t,e.state,oe))}}),c.default.createElement(s.Route,{path:"/:owner/:projectsId",render:function(t){return c.default.createElement(M,o({},e.props,t,e.state,oe))}}))))}}]),t}(i.Component);t.default=(0,p.ImageLayerOfCommentHOC)({imgSelector:".imageLayerParent img, .imageLayerParent .imageTarget",parentSelector:".newContainer"})(G)},q7EM:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=d(n("/ezw")),r=d(n("3S7+")),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,r=!1,o=void 0;try{for(var l,i=e[Symbol.iterator]();!(a=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){r=!0,o=e}finally{try{!a&&i.return&&i.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("chzn"),n("TfFZ");var i=n("q1tI"),c=d(i),s=n("eO8H"),u=n("sYIF");function d(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.history,n=e.list,d=e.owner,p=e.projectsId,f=(e.isManager,e.url),m=e.pathname,h=e.state,g=e.urlFlag,b=e.projectDetail,x=e.platform,y=e.open_devops,E=(0,i.useState)(void 0),w=l(E,2),_=w[0],v=w[1];return(0,i.useEffect)((function(){if(n){if(m&&"source"===m){var e=n.filter((function(e){return"resources"===e.menu_name}));e&&0===e.length&&t.push("/"+d+"/"+p)}v(n)}}),[n]),c.default.createElement("div",{className:"f-wrap-between mt25"},_&&b?c.default.createElement("ul",{className:"headerMenu-wrapper"},Array.isArray(_)&&_.map((function(e,t){return c.default.createElement(c.default.Fragment,{key:e.menu_name},"home"===e.menu_name&&c.default.createElement("li",{className:"about"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/about",state:h}},c.default.createElement("i",{className:"iconfont icon-zhuye-fill color-grey-3 mr5 font-14"}),c.default.createElement("span",null,"主页"))),"code"===e.menu_name&&c.default.createElement("li",{className:""===m||g?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p,state:h}},c.default.createElement("i",{className:"iconfont icon-daimakuicon1 color-grey-3 mr5 font-14"}),c.default.createElement("span",null,"代码库"))),"issues"===e.menu_name&&c.default.createElement("li",{className:"issues"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/issues",state:h}},c.default.createElement(r.default,{title:"易修是Issue的中文名即问题列表",placement:"bottom"},c.default.createElement("i",{className:"iconfont icon-yixiuicon1 color-grey-3 mr5 font-14"}),c.default.createElement("span",null,"易修(Issue)")),b&&b.issues_count?c.default.createElement("span",{className:"num"},(0,u.numFormat)(b.issues_count)):"")),"pulls"===e.menu_name&&b&&2!==parseInt(b.type)&&x?c.default.createElement("li",{className:"pulls"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/pulls",state:h}},c.default.createElement("i",{className:"iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14"}),c.default.createElement("span",null,"合并请求"),b&&b.pull_requests_count?c.default.createElement("span",{className:"num"},(0,u.numFormat)(b.pull_requests_count)):"")):"","wiki"===e.menu_name&&c.default.createElement("li",{className:"wiki"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/wiki",state:h}},c.default.createElement("i",{className:"iconfont icon-a-wikiicon1 color-grey-3 mr5 font-14"}),c.default.createElement("span",null,"Wiki"))),"devops"===e.menu_name&&x?c.default.createElement("li",{className:"devops"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/devops",state:o({},h,{open_devops:y})}},c.default.createElement("i",{className:"iconfont icon-gongzuoliuicon font-13 mr5 color-grey-3"}),"工作流(beta版)",b&&b.ops_count?c.default.createElement("span",null,b.ops_count):"")):"","versions"===e.menu_name&&c.default.createElement("li",{className:"milestones"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/milestones",state:h}},c.default.createElement("i",{className:"milestones"===m?"iconfont icon-lichengbeiicon color-grey-3 mr5 font-14":"iconfont icon-lichengbeiicon color-grey-6 font-14 mr5"}),c.default.createElement("span",null,"里程碑"),b&&b.versions_count?c.default.createElement("span",{className:"num"},(0,u.numFormat)(b.versions_count)):"")),"activity"===e.menu_name&&c.default.createElement("li",{className:"activity"===m?"active":""},c.default.createElement(s.Link,{to:{pathname:"/"+d+"/"+p+"/activity",state:h}},c.default.createElement("i",{className:"activity"===m?"iconfont icon-dongtaiicon color-grey-3 mr5 font-14":"iconfont icon-dongtaiicon color-grey-6 font-14 mr5"}),c.default.createElement("span",null,"动态"))),"settings"===e.menu_name&&c.default.createElement("li",{className:"settings"===m?"active":""},c.default.createElement(s.Link,{to:"/"+d+"/"+p+"/settings"},c.default.createElement("i",{className:f&&f.indexOf("/settings")>0?"iconfont icon-cangkushezhiicon color-grey-3 mr5 font-14":"iconfont icon-cangkushezhiicon color-grey-6 font-14 mr5"}),c.default.createElement("span",null,"仓库设置"))))}))):c.default.createElement(a.default,{paragraph:!1,active:!0}))}},qmW9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();t.ImageLayerOfCommentHOC=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){return function(n){function o(e){u(this,o);var t=d(this,(o.__proto__||Object.getPrototypeOf(o)).call(this,e));return t.onDelegateClick=function(e){var n=e.target.src||e.target.getAttribute("src")||e.target.getAttribute("href"),a=e.target.innerHTML.trim();if((0,c.isImageExtension)(n.trim())||(0,c.isImageExtension)(a)||"IMG"==e.target.tagName)return-1===n.indexOf("/images/avatars/User")&&-1===n.indexOf("kindeditor/plugins/emoticons")&&t.setState({showImage:!0,imageSrc:n}),e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.originalEvent.preventDefault(),!1},t.onImageLayerClose=function(){t.setState({showImage:!1,imageSrc:""})},t.MdifHasAnchorJustScorll=function(){var e=decodeURI(t.props.location.hash).replace("#","");if(e){var n=document.getElementsByName(e);n&&0!=n.length&&n[n.length-1].scrollIntoView()}},t.state={showImage:!1,imageSrc:""},t}return p(o,n),r(o,[{key:"componentDidMount",value:function(){var t=this;this.props.wrappedComponentRef&&this.props.wrappedComponentRef(this.refs.wrappedComponentRef),setTimeout((function(){f(e.parentSelector||".commentsDelegateParent").delegate(e.imgSelector||".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click",t.onDelegateClick)}),1200)}},{key:"componentWillUnmount",value:function(){f(e.parentSelector||".commentsDelegateParent","click",this.onDelegateClick)}},{key:"render",value:function(){return this.MdifHasAnchorJustScorll(),l.default.createElement(l.default.Fragment,null,l.default.createElement(i.default,a({},this.state,{onImageLayerClose:this.onImageLayerClose})),l.default.createElement(t,a({},this.props,{ref:"wrappedComponentRef"})))}}]),o}(o.Component)}};var o=n("q1tI"),l=s(o),i=s(n("Ozcj")),c=n("sYIF");function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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}function p(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)}var f=window.$},spEH:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupProjectBackgroup=t.Content=t.Cancel=t.GreenUnder=t.NumUl=t.Redback=t.Blueback=t.Greenback=t.Greenline=t.Redline=t.Blueline=t.WhiteBack=t.Gap=t.Short=t.ShortWidth=t.Long=t.LongWidth=t.Box=t.AlignAJBottom=t.AlignTop=t.AlignCenter=t.FlexAJ=t.AlignCenterBetween=t.Banner=void 0;var a,r=C(["{\n padding:20px 25px;\n color:#333;\n font-size:18px;\n border-bottom:1px solid #eee;\n background-color:#fff;\n border-radius:5px 5px 0px 0px;\n}"],["{\n padding:20px 25px;\n color:#333;\n font-size:18px;\n border-bottom:1px solid #eee;\n background-color:#fff;\n border-radius:5px 5px 0px 0px;\n}"]),o=C(["{\n display:flex;\n align-items: center;\n padding: 14px 14px 14px 20px;\n justify-content: space-between;\n border-bottom:1px solid #eee;\n}"],["{\n display:flex;\n align-items: center;\n padding: 14px 14px 14px 20px;\n justify-content: space-between;\n border-bottom:1px solid #eee;\n}"]),l=C(["{\n display:flex;\n align-items: center;\n justify-content: space-between;\n}"],["{\n display:flex;\n align-items: center;\n justify-content: space-between;\n}"]),i=C(["{\n display:flex;\n align-items: center;\n}"],["{\n display:flex;\n align-items: center;\n}"]),c=C(["{\n display:flex;\n align-items: flex-start;\n}"],["{\n display:flex;\n align-items: flex-start;\n}"]),s=C(["{\n display:flex;\n justify-content: space-between;\n align-items: flex-end;\n}"],["{\n display:flex;\n justify-content: space-between;\n align-items: flex-end;\n}"]),u=C(["{\n display:flex;\n align-items:flex-start;\n}"],["{\n display:flex;\n align-items:flex-start;\n}"]),d=C(["{\n flex:1;\n width:0;\n border-radius:5px;\n margin-bottom:30px;\n}"],["{\n flex:1;\n width:0;\n border-radius:5px;\n margin-bottom:30px;\n}"]),p=C(["{\n width:78%;\n border-radius:5px;\n margin-bottom:30px;\n}"],["{\n width:78%;\n border-radius:5px;\n margin-bottom:30px;\n}"]),f=C(["{\n width:300px;\n border-radius:5px;\n margin-bottom:30px;\n}"],["{\n width:300px;\n border-radius:5px;\n margin-bottom:30px;\n}"]),m=C(["{\n flex:1;\n border-radius:5px;\n margin-bottom:30px;\n}"],["{\n flex:1;\n border-radius:5px;\n margin-bottom:30px;\n}"]),h=C(["{\n padding-left:20px;\n box-sizing:border-box;\n}"],["{\n padding-left:20px;\n box-sizing:border-box;\n}"]),g=C(["{\n background-color:#fff;\n border-radius:5px;\n}"],["{\n background-color:#fff;\n border-radius:5px;\n}"]),b=C(["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid rgba(80,145,255,1);\n color:rgba(80,145,255,1);\n padding:0px 12px;\n display:inline-block;\n}"],["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid rgba(80,145,255,1);\n color:rgba(80,145,255,1);\n padding:0px 12px;\n display:inline-block;\n}"]),x=C(["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid #F73030;\n color:"," !important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n background:",";\n}"],["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid #F73030;\n color:"," !important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n background:",";\n}"]),y=C(["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid #28BD6C;\n color:"," !important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n background:",";\n}"],["{\n height:30px;\n line-height:28px;\n border-radius:2px;\n border:1px solid #28BD6C;\n color:"," !important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n background:",";\n}"]),E=C(["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:#28BD6C;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"],["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:#28BD6C;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"]),w=C(["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:rgba(80,145,255,1);\n color:#fff!important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"],["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:rgba(80,145,255,1);\n color:#fff!important;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"]),_=C(["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:#F73030;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"],["{\n height:30px;\n line-height:30px;\n border-radius:2px;\n background-color:#F73030;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:80px;\n text-align:center;\n}"]),v=C(["{\n padding-left: 20px;\n & > li{\n list-style-type: decimal;\n color:#888;\n height:24px;\n line-height:24px;\n }\n}"],["{\n padding-left: 20px;\n & > li{\n list-style-type: decimal;\n color:#888;\n height:24px;\n line-height:24px;\n }\n}"]),k=C(["{\n color:#28BD6C!important;\n position:relative;\n &:after{\n position:absolute;\n bottom:-2px;\n left:0px;\n width:100%;\n height:1px;\n content:'';\n background:#28BD6C;\n }\n}"],["{\n color:#28BD6C!important;\n position:relative;\n &:after{\n position:absolute;\n bottom:-2px;\n left:0px;\n width:100%;\n height:1px;\n content:'';\n background:#28BD6C;\n }\n}"]),j=C(["{\n height:32px;\n line-height:32px;\n border-radius:2px;\n background-color:#BBBBBB;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:64px;\n text-align:center;\n letter-spacing: 4px;\n}"],["{\n height:32px;\n line-height:32px;\n border-radius:2px;\n background-color:#BBBBBB;\n color:#fff;\n padding:0px 12px;\n display:inline-block;\n min-width:64px;\n text-align:center;\n letter-spacing: 4px;\n}"]),I=C(["{\n width:1200px;\n margin:20px auto;\n text-align:center;\n display:flex;\n align-Items:center;\n background-color:#fff;\n justify-content: center;\n}"],["{\n width:1200px;\n margin:20px auto;\n text-align:center;\n display:flex;\n align-Items:center;\n background-color:#fff;\n justify-content: center;\n}"]),N=C(["{\n background:#fafafa;\n padding:20px 30px;\n width:100%;\n}"],["{\n background:#fafafa;\n padding:20px 30px;\n width:100%;\n}"]),S=n("vOnD"),O=(a=S)&&a.__esModule?a:{default:a};function C(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}t.Banner=O.default.div(r),t.AlignCenterBetween=O.default.div(o),t.FlexAJ=O.default.div(l),t.AlignCenter=O.default.div(i),t.AlignTop=O.default.div(c),t.AlignAJBottom=O.default.div(s),t.Box=O.default.div(u),t.LongWidth=O.default.div(d),t.Long=O.default.div(p),t.ShortWidth=O.default.div(f),t.Short=O.default.div(m),t.Gap=O.default.div(h),t.WhiteBack=O.default.div(g),t.Blueline=O.default.a(b),t.Redline=O.default.a(x,(function(e){return e.bold?"#fff":"#F73030"}),(function(e){return e.bold?"#F73030":"#fff"})),t.Greenline=O.default.a(y,(function(e){return e.bold?"#fff":"#28BD6C"}),(function(e){return e.bold?"#28BD6C":"#fff"})),t.Greenback=O.default.a(E),t.Blueback=O.default.a(w),t.Redback=O.default.a(_),t.NumUl=O.default.ul(v),t.GreenUnder=O.default.a(k),t.Cancel=O.default.a(j),t.Content=O.default.div(I),t.GroupProjectBackgroup=O.default.div(N)}}]);