(this.webpackJsonp=this.webpackJsonp||[]).push([[149],{f0GN:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n("kLXV")),a=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 i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("2qtc");var o=n("cDcd"),i=d(o),c=n("J66h");n("tdQw");var s=n("eO8H"),l=n("sYIF"),u=d(n("vDqi"));function d(e){return e&&e.__esModule?e:{default:e}}var f={manager:"管理员",developer:"开发者",reporter:"报告者",owner:"所有者"};t.default=function(e){var t=e.history,n=e.current_user,d=e.match,p=e.projectDetail,m=e.showNotification;if(!n.login){var v=window.location,w=v.pathname,h=v.search;window.location.href="/login?go_page="+w+h}var g=p&&p.permission,_=d.params,j=_.projectsId,k=_.owner,y=window.location.search&&window.location.search.split("?invite=")[1],b=y&&JSON.parse(c.Base64.decode(y)),E=(0,o.useState)({}),N=a(E,2),I=N[0],L=N[1],O=(0,o.useState)(!0),S=a(O,2),x=S[0],J=S[1];return(0,o.useEffect)((function(){g&&I.role&&I.role==g.toLocaleLowerCase()||"Owner"==g?(m("您已经是"+f[I.role]+"了"),setTimeout((function(){t.push("/"+k+"/"+j)}),2e3)):J(!0)}),[g,I.role]),(0,o.useEffect)((function(){var e="/"+k+"/"+j+"/project_invite_links/show_link.json?invite_sign="+b.sign;u.default.get(e).then((function(e){e&&e.data?L(e.data):m("查询邀请链接失败")}))}),[]),i.default.createElement("div",{className:""},b&&i.default.createElement(r.default,{visible:x,className:"invite_development",title:i.default.createElement("div",{className:"ownerImage"},i.default.createElement("img",{src:I.project&&(0,l.getImageUrl)(I.project.owner.image_url)})),width:"548px",closable:!0,onCancel:function(){J(!1),t.push("/"+n.login)},centered:!0,okText:"接受",cancelText:"拒绝",onOk:function(){var e="/"+k+"/"+j+"/project_invite_links/redirect_link.json?invite_sign="+b.sign;u.default.post(e).then((function(e){e&&"success"==e.data.message&&(I.is_apply?(J(!1),r.default.success({content:"提交申请成功，请等待该仓库管理员审核"})):t.push("/"+k+"/"+j))})).catch((function(e){}))},maskClosable:!1},i.default.createElement(s.Link,{className:"invite_project link",target:"_blank",to:"/"+b.ownerLogin+"/"+b.projectId},I.project&&I.project.owner.name,"/",I.project&&I.project.name),i.default.createElement("div",{className:"invite_content"},i.default.createElement(s.Link,{className:"link",to:"/"+(I.user&&I.user.login)},I.user&&I.user.name)," 邀请您以",f[I.role],"的身份加入此代码库 是否接受邀请？")))}},tdQw:function(e,t,n){}}]);