build/static/js/60.38ee1b58.chunk.js

1 line
46 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,8],{"4sNH":function(e,t,n){"use strict";n("cYy4")},"54hm":function(e,t){},AySf:function(e,t,n){"use strict";var a=n("yQr1"),r=n.n(a),o=(n("Pwec"),n("CtXQ")),c=n("EcSs"),l=n.n(c),i=(n("+L6B"),n("2/Rp")),s=n("06Pm"),u=n.n(s),f=n("kA7L"),m=n.n(f),d=n("3SUL"),p=n.n(d),h=n("eYnF"),v=n.n(h),g=n("hO3g"),b=n.n(g),y=n("X5/F"),w=n.n(y),E=n("04Ix"),_=n.n(E),j=(n("DZo9"),n("8z0m")),x=n("FLGM"),O=n.n(x),N=n("ZbhI"),S=n.n(N),k=n("UtpJ"),L=n.n(k),C=n("M5Mt"),R=n.n(C),I=n("cDcd"),D=n.n(I),P=n("sYIF"),U=n("vDqi"),B=n.n(U);var M=j.a.Dragger,q=function(e){function t(e){var n;return u()(this,t),n=function(e,t,n){return t=v()(t),p()(e,function(){try{var e=!Boolean.prototype.valueOf.call(r()(Boolean,[],(function(){})))}catch(e){}return!!e}()?r()(t,n||[],v()(e).constructor):t.apply(e,n))}(this,t,[e]),_()(b()(n),"componentDidMount",(function(){var e=n.props.defaultFileList;if(e){var t=[];O()(e).call(e,(function(e){t.push({uid:e.id,name:e.title,status:"done",url:e.url})})),n.setState({fileList:t})}n.checkInitFile()})),_()(b()(n),"componentDidUpdate",(function(e){e&&e.fileList!==n.props.fileList&&n.checkInitFile()})),_()(b()(n),"checkInitFile",(function(){var e=n.props.fileList;e&&e.length>0&&n.setState({fileList:Object(P.d)(e)})})),_()(b()(n),"onAttachmentRemove",(function(e){if(!e.percent||100===e.percent)return n.deleteAttachment(e),!1})),_()(b()(n),"deleteAttachment",(function(e){var t="/attachments/".concat(e.response?e.response.id:e.uid,".json");B.a.delete(t,{}).then((function(t){t.data&&(0===t.data.status?n.setState((function(t){var n,a,r=S()(n=t.fileList).call(n,e),o=L()(a=t.fileList).call(a);return R()(o).call(o,r,1),{fileList:o}}),(function(){n.fileIdList(n.state.fileList)})):n.props.showNotification(t.data.message))})).catch((function(e){}))})),_()(b()(n),"handleChange",(function(e){var t=n.props.changeIsComplete;if(t&&t(!0),"uploading"===e.file.status||"done"===e.file.status||"removed"===e.file.status){var a=e.fileList;n.setState({fileList:Object(P.d)(a)}),n.fileIdList(a)}})),_()(b()(n),"fileIdList",(function(e){var t=[];e&&e.length>0?(O()(e).call(e,(function(e){return e.response&&"done"===e.status&&t.push(e.response.id||e.response.data&&e.response.data.id)})),t&&t.length>0&&n.props.load(t)):n.props.load([])})),_()(b()(n),"checkFile",(function(e){for(var t=[".rar",".iso",".flv",".rmvb",".mmf",".ape",".vsdx",".msi",".md"],n=!1,a=0;a<t.length;a++)if(n=new RegExp("(.+(?=["+t[a]+"]$))").test(e))return n;return!1})),_()(b()(n),"beforeUpload",(function(e){var t=n.props.size,a=e.size/1024/1024<t;return a||n.props.showNotification("文件大小必须小于".concat(t,"MB!")),a})),n.state={fileList:void 0},n}return w()(t,e),m()(t,[{key:"render",value:function(){var e=this.props,t=e.isComplete,n=e.icon,a=e.btn,r=e.className,c=e.size,s=e.actionUrl,u=this.state.fileList,f={name:"file",fileList:!0===t?u:void 0,action:s||"".concat(Object(P.l)()),onChange:this.handleChange,onRemove:this.onAttachmentRemove,beforeUpload:this.beforeUpload,multiple:!0};return a?D.a.createElement(j.a,l()({},f,{className:r}),D.a.createElement(i.a,{type:"default"},"上传文件"),D.a.createElement("span",{className:"ml10 color-grey-9"},"(你可以上传小于",D.a.createElement("span",{className:"color-red"},c,"MB"),"的文件)")):D.a.createElement(M,l()({},f,{className:r}),n||D.a.createElement(o.a,{type:"inbox"}),D.a.createElement("p",{className:"ant-upload-text font-16 color-grey-3"},"拖动文件或点击此处上传"))}}]),t}(I.Component);t.a=q},HU8g:function(e,t,n){e.exports=n("XDk8")},IwPY:function(e,t){},LZ3y:function(e,t,n){"use strict";var a=n("yQr1"),r=n.n(a),o=(n("2qtc"),n("kLXV")),c=(n("T2oS"),n("W9HT")),l=(n("P2fV"),n("NJEC")),i=n("06Pm"),s=n.n(i),u=n("kA7L"),f=n.n(u),m=n("3SUL"),d=n.n(m),p=n("eYnF"),h=n.n(p),v=n("hO3g"),g=n.n(v),b=n("X5/F"),y=n.n(b),w=n("04Ix"),E=n.n(w),_=n("ZbhI"),j=n.n(_),x=n("o+MX"),O=n.n(x),N=n("FLGM"),S=n.n(N),k=n("cDcd"),L=n.n(k),C=n("2iEm"),R=n("vDqi"),I=n.n(R),D=n("zLi2"),P=n.n(D),U=n("6tYh"),B=n.n(U),M=function(e){var t=Object(k.useState)(null),n=P()(t,2),a=n[0],r=n[1];return Object(k.useEffect)((function(){r(e.video_url)}),[]),L.a.createElement(B.a,{url:a,controls:!0,playing:!1})};var q=function(e){function t(e){var n;return s()(this,t),n=function(e,t,n){return t=h()(t),d()(e,function(){try{var e=!Boolean.prototype.valueOf.call(r()(Boolean,[],(function(){})))}catch(e){}return!!e}()?r()(t,n||[],h()(e).constructor):t.apply(e,n))}(this,t,[e]),E()(g()(n),"componentDidMount",(function(){n.getDetail()})),E()(g()(n),"getDetail",(function(){n.setState({canDelete:n.props.canDelete})})),E()(g()(n),"show_video_modal",(function(e){n.setState({video_title:e.title,move_spin:!0,video_id:e.id}),n.move_attachment(e.id,"preview")})),E()(g()(n),"hide_video_modal",(function(){var e=n.state.video_id;n.setState({video_title:void 0}),n.move_attachment(e,"close")})),E()(g()(n),"move_attachment",(function(e,t){I.a.post("/attachments/".concat(e,"/preview_attachment"),{status:t}).then((function(e){e?n.setState({show_video:"preview"===t,video_url:"preview"===t?"https://www.gitlink.org.cn"+e.data.url:void 0,move_spin:!1}):n.setState({move_spin:!1})})).catch((function(e){n.setState({move_spin:!1})}))})),E()(g()(n),"is_video",(function(e){var t=["mp4","flv","mkv","3gp"];return j()(t).call(t,e.split(".").pop())>-1})),E()(g()(n),"deleteAttachment",(function(e){var t=n.props.deleteLoad,a="/attachments/".concat(e,".json");I.a.delete(a,{}).then((function(a){var r;a.data&&(0===a.data.status?(n.setState({Deleted:O()(r=n.state.Deleted).call(r,e)}),n.props.showNotification("附件删除成功"),t&&t(e)):n.props.showNotification(a.data.message))})).catch((function(e){}))})),n.state={canDelete:!1,show_video:!1,video_url:void 0,video_title:void 0,video_id:void 0,move_spin:!1,Deleted:[]},n}return y()(t,e),f()(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.Deleted,a=t.canDelete,r=t.show_video,i=t.video_url,s=t.video_title,u=t.move_spin,f=this.props.attachments;return L.a.createElement("div",null,f?L.a.createElement("div",{className:"attachmentsList mt5"},S()(f).call(f,(function(t,r){return L.a.createElement("div",{key:r,style:{display:n.length>0&&-1!==j()(n).call(n,t.id)?"none":"block",padding:"4px"},className:"attachment-list-div"},L.a.createElement(c.a,{spinning:u},e.is_video(t.title)?L.a.createElement("a",{onClick:function(){return e.show_video_modal(t)},className:"attachment-list-a"},L.a.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),L.a.createElement("span",null,t.title),L.a.createElement("span",{className:"ml20"},t.filesize)):L.a.createElement(C.a,{to:"".concat(t.url),target:"_blank",className:"attachment-list-a",download:!0},L.a.createElement("i",{className:"iconfont icon-fujian mr8 paper-clip-color font-12"}),L.a.createElement("span",null,t.title),L.a.createElement("span",{className:"ml20"},t.filesize)),a?L.a.createElement(l.a,{placement:"bottom",title:"您确定要删除附件吗",okText:"是",cancelText:"否",onConfirm:function(){return e.deleteAttachment(t.id)}},L.a.createElement("span",{className:"attachment-list-delete fr"},L.a.createElement("i",{className:"iconfont icon-lajitong mr10 color-grey-9 font-14"}))):""))}))):"",r?L.a.createElement(o.a,{title:s,visible:!0,width:690,footer:null,onCancel:this.hide_video_modal},L.a.createElement(M,{video_url:i})):"")}}]),t}(k.Component);t.a=q},NrgU:function(e,t,n){"use strict";var a=n("Bvq2"),r=n("A2Ma"),o=n("wbIY"),c=n("cEKj"),l=r("iterator");e.exports=!a((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),a="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),a+=n+e})),n.delete("a",2),n.delete("b",void 0),c&&(!e.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!t.size&&(c||!o)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[l]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==a||"x"!==new URL("http://x",void 0).host}))},"O/iA":function(e,t,n){var a=n("SE3x");"string"==typeof a&&(a=[[e.i,a,""]]);n("aET+")(a,{hmr:!0,transform:void 0}),a.locals&&(e.exports=a.locals)},O3gP:function(e,t,n){"use strict";n("cIOH"),n("O/iA"),n("OaEy"),n("5NDa")},SE3x:function(e,t,n){(t=n("JPst")(!1)).push([e.i,"/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable no-duplicate-selectors */\n/* stylelint-disable */\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\n.ant-select-auto-complete {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n font-feature-settings: 'tnum';\n}\n.ant-select-auto-complete.ant-select .ant-select-selection {\n border: 0;\n box-shadow: none;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection__rendered {\n height: 100%;\n margin-right: 0;\n margin-left: 0;\n line-height: 32px;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection__placeholder {\n margin-right: 12px;\n margin-left: 12px;\n}\n.ant-select-auto-complete.ant-select .ant-select-selection--single {\n height: auto;\n}\n.ant-select-auto-complete.ant-select .ant-select-search--inline {\n position: static;\n float: left;\n}\n.ant-select-auto-complete.ant-select-allow-clear .ant-select-selection:hover .ant-select-selection__rendered {\n margin-right: 0 !important;\n}\n.ant-select-auto-complete.ant-select .ant-input {\n height: 32px;\n line-height: 1.5;\n background: transparent;\n border-width: 1px;\n}\n.ant-select-auto-complete.ant-select .ant-input:focus,\n.ant-select-auto-complete.ant-select .ant-input:hover {\n border-color: #6e90ff;\n border-right-width: 1px !important;\n}\n.ant-select-auto-complete.ant-select .ant-input[disabled] {\n color: rgba(0, 0, 0, 0.25);\n background-color: #f5f5f5;\n cursor: not-allowed;\n opacity: 1;\n background-color: transparent;\n}\n.ant-select-auto-complete.ant-select .ant-input[disabled]:hover {\n border-color: #d9d9d9;\n border-right-width: 1px !important;\n}\n.ant-select-auto-complete.ant-select-lg .ant-select-selection__rendered {\n line-height: 40px;\n}\n.ant-select-auto-complete.ant-select-lg .ant-input {\n height: 40px;\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.ant-select-auto-complete.ant-select-sm .ant-select-selection__rendered {\n line-height: 24px;\n}\n.ant-select-auto-complete.ant-select-sm .ant-input {\n height: 24px;\n padding-top: 1px;\n padding-bottom: 1px;\n}\n.ant-input-group > .ant-select-auto-complete .ant-select-search__field.ant-input-affix-wrapper {\n display: inline;\n float: none;\n}\n",""]),e.exports=t},XDk8:function(e,t,n){"use strict";var a=n("a1FM");n("UUWy"),e.exports=a},a1FM:function(e,t,n){"use strict";n("4sNH"),n("IwPY"),n("54hm"),n("tKpz");var a=n("dktu");e.exports=a.URLSearchParams},cYy4:function(e,t,n){"use strict";n("kQON");var a=n("pevS"),r=n("OsYe"),o=n("+zDa"),c=n("cQZY"),l=n("zhhU"),i=n("wbIY"),s=n("NrgU"),u=n("/b46"),f=n("IpbS"),m=n("vEpQ"),d=n("KHTo"),p=n("mdol"),h=n("L1rz"),v=n("X32N"),g=n("+y2l"),b=n("Dm96"),y=n("ZBQp"),w=n("j5XY"),E=n("b42z"),_=n("39uu"),j=n("jBKu"),x=n("SJYm"),O=n("LGyv"),N=n("2fOL"),S=n("C3ug"),k=n("3bWX"),L=n("+GjA"),C=n("A2Ma"),R=n("reVg"),I=C("iterator"),D=h.set,P=h.getterFor("URLSearchParams"),U=h.getterFor("URLSearchParamsIterator"),B=o("fetch"),M=o("Request"),q=o("Headers"),F=M&&M.prototype,z=q&&q.prototype,T=r.RegExp,A=r.TypeError,V=r.decodeURIComponent,H=r.encodeURIComponent,Y=l("".charAt),K=l([].join),X=l([].push),G=l("".replace),Q=l([].shift),J=l([].splice),Z=l("".split),$=l("".slice),W=/\+/g,ee=Array(4),te=function(e){return ee[e-1]||(ee[e-1]=T("((?:%[\\da-f]{2}){"+e+"})","gi"))},ne=function(e){try{return V(e)}catch(t){return e}},ae=function(e){var t=G(e,W," "),n=4;try{return V(t)}catch(e){for(;n;)t=G(t,te(n--),ne);return t}},re=/[!'()~]|%20/g,oe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ce=function(e){return oe[e]},le=function(e){return G(H(e),re,ce)},ie=p((function(e,t){D(this,{type:"URLSearchParamsIterator",target:P(e).entries,index:0,kind:t})}),"URLSearchParams",(function(){var e=U(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,k(void 0,!0);var a=t[n];switch(e.kind){case"keys":return k(a.key,!1);case"values":return k(a.value,!1)}return k([a.key,a.value],!1)}),!0),se=function(e){this.entries=[],this.url=null,void 0!==e&&(_(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?$(e,1):e:j(e)))};se.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,a,r,o,l,i,s=this.entries,u=S(e);if(u)for(n=(t=N(e,u)).next;!(a=c(n,t)).done;){if(o=(r=N(E(a.value))).next,(l=c(o,r)).done||(i=c(o,r)).done||!c(o,r).done)throw new A("Expected sequence with length 2");X(s,{key:j(l.value),value:j(i.value)})}else for(var f in e)b(e,f)&&X(s,{key:f,value:j(e[f])})},parseQuery:function(e){if(e)for(var t,n,a=this.entries,r=Z(e,"&"),o=0;o<r.length;)(t=r[o++]).length&&(n=Z(t,"="),X(a,{key:ae(Q(n)),value:ae(K(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],a=0;a<t.length;)e=t[a++],X(n,le(e.key)+"="+le(e.value));return K(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ue=function(){v(this,fe);var e=arguments.length>0?arguments[0]:void 0,t=D(this,new se(e));i||(this.size=t.entries.length)},fe=ue.prototype;if(m(fe,{append:function(e,t){var n=P(this);L(arguments.length,2),X(n.entries,{key:j(e),value:j(t)}),i||this.length++,n.updateURL()},delete:function(e){for(var t=P(this),n=L(arguments.length,1),a=t.entries,r=j(e),o=n<2?void 0:arguments[1],c=void 0===o?o:j(o),l=0;l<a.length;){var s=a[l];if(s.key!==r||void 0!==c&&s.value!==c)l++;else if(J(a,l,1),void 0!==c)break}i||(this.size=a.length),t.updateURL()},get:function(e){var t=P(this).entries;L(arguments.length,1);for(var n=j(e),a=0;a<t.length;a++)if(t[a].key===n)return t[a].value;return null},getAll:function(e){var t=P(this).entries;L(arguments.length,1);for(var n=j(e),a=[],r=0;r<t.length;r++)t[r].key===n&&X(a,t[r].value);return a},has:function(e){for(var t=P(this).entries,n=L(arguments.length,1),a=j(e),r=n<2?void 0:arguments[1],o=void 0===r?r:j(r),c=0;c<t.length;){var l=t[c++];if(l.key===a&&(void 0===o||l.value===o))return!0}return!1},set:function(e,t){var n=P(this);L(arguments.length,1);for(var a,r=n.entries,o=!1,c=j(e),l=j(t),s=0;s<r.length;s++)(a=r[s]).key===c&&(o?J(r,s--,1):(o=!0,a.value=l));o||X(r,{key:c,value:l}),i||(this.size=r.length),n.updateURL()},sort:function(){var e=P(this);R(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=P(this).entries,a=y(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)a((t=n[r++]).value,t.key,this)},keys:function(){return new ie(this,"keys")},values:function(){return new ie(this,"values")},entries:function(){return new ie(this,"entries")}},{enumerable:!0}),u(fe,I,fe.entries,{name:"entries"}),u(fe,"toString",(function(){return P(this).serialize()}),{enumerable:!0}),i&&f(fe,"size",{get:function(){return P(this).entries.length},configurable:!0,enumerable:!0}),d(ue,"URLSearchParams"),a({global:!0,constructor:!0,forced:!s},{URLSearchParams:ue}),!s&&g(q)){var me=l(z.has),de=l(z.set),pe=function(e){if(_(e)){var t,n=e.body;if("URLSearchParams"===w(n))return t=e.headers?new q(e.headers):new q,me(t,"content-type")||de(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),x(e,{body:O(0,j(n)),headers:O(0,t)})}return e};if(g(B)&&a({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return B(e,arguments.length>1?pe(arguments[1]):{})}}),g(M)){var he=function(e){return v(this,F),new M(e,arguments.length>1?pe(arguments[1]):{})};F.constructor=he,he.prototype=F,a({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:he})}}e.exports={URLSearchParams:ue,getState:P}},eXKH:function(e,t,n){},ex8r:function(e,t,n){},lLsn:function(e,t,n){"use strict";n.r(t);var a,r=n("+oHS"),o=n.n(r),c=n("OWCx"),l=n.n(c),i=n("fHi0"),s=n.n(i),u=n("RXMP"),f=n.n(u),m=n("qjzJ"),d=n.n(m),p=n("HnXd"),h=n.n(p),v=n("LYCE"),g=n.n(v),b=(n("+L6B"),n("2/Rp")),y=(n("sRBo"),n("kaz8")),w=(n("5NDa"),n("5rEg")),E=n("04Ix"),_=n.n(E),j=n("zLi2"),x=n.n(j),O=(n("y8nQ"),n("Vl3Y")),N=n("YdDX"),S=n.n(N),k=(n("O3gP"),n("lrIw")),L=n("HU8g"),C=n.n(L),R=n("o+MX"),I=n.n(R),D=n("FLGM"),P=n.n(D),U=n("5PDf"),B=n.n(U),M=n("ZbhI"),q=n.n(M),F=n("cDcd"),z=n.n(F),T=n("vOnD"),A=n("3Diz"),V=n("p7gc"),H=n("AySf"),Y=n("LZ3y"),K=n("vDqi"),X=n.n(K),G=(n("e4dm"),n("LvDl"));function Q(e,t){var n=o()(e);if(l.a){var a=l()(e);t&&(a=B()(a).call(a,(function(t){return s()(e,t).enumerable}))),n.push.apply(n,a)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n,a,r=null!=arguments[t]?arguments[t]:{};t%2?f()(n=Q(Object(r),!0)).call(n,(function(t){_()(e,t,r[t])})):d.a?h()(e,d()(r)):f()(a=Q(Object(r))).call(a,(function(t){g()(e,t,s()(r,t))}))}return e}var Z=k.a.Option,$=T.a.span(a||(a=S()(["\n margin: 0px 15px;\n color: #bbb;\n line-height: 35px;\n font-size:16px;\n font-weight:400;\n color:#666;\n"])));t.default=O.a.create()(Object(F.forwardRef)((function(e,t){var n=e.form,a=e.projectDetail,r=e.match,o=e.showNotification,c=e.history,l=e.getDetail,i=n.getFieldDecorator,s=n.validateFields,u=n.setFieldsValue,f=Object(F.useState)(void 0),m=x()(f,2),d=m[0],p=m[1],h=Object(F.useState)(null),v=x()(h,2),g=v[0],E=v[1],_=Object(F.useState)(null),j=x()(_,2),N=j[0],S=j[1],L=Object(F.useState)(null),R=x()(L,2),D=R[0],U=R[1],M=Object(F.useState)(void 0),T=x()(M,2),K=T[0],Q=T[1],W=Object(F.useState)(void 0),ee=x()(W,2),te=ee[0],ne=ee[1],ae=Object(F.useState)(void 0),re=x()(ae,2),oe=re[0],ce=re[1],le=c&&c.location&&c.location.state&&c.location.state.stable,ie=r.params,se=ie.projectsId,ue=ie.versionId,fe=ie.owner,me=new C.a(c.location.search);function de(e){if(e)return P()(e).call(e,(function(e,t){return z.a.createElement(Z,{key:t,value:e.name},e.name)}))||void 0}return Object(F.useEffect)((function(){a&&a.default_branch&&S(a.default_branch)}),[a]),Object(F.useEffect)((function(){if(a){var e,t,n=a.author,r=a.name;document.title=I()(e=I()(t="".concat(ue?"编辑":"创建","发行版-")).call(t,n.name,"/")).call(e,r)}}),[a,ue]),Object(F.useEffect)((function(){if(ue){var e,t,n=I()(e=I()(t="/".concat(fe,"/")).call(t,se,"/releases/")).call(e,ue,"/edit.json");X.a.get(n).then((function(e){e&&(u(e.data),E(e.data.body),ne(e.data.attachments))}))}}),[ue]),Object(F.useEffect)((function(){if(se){var e,t=I()(e="/".concat(fe,"/")).call(e,se,"/tags.json");X.a.get(t,{params:{page:1,limit:1e3}}).then((function(e){e.data&&(p(e.data.tags),ce(de(e.data.tags)))})).catch((function(e){}))}}),[se]),z.a.createElement("div",{className:"df pt15"},z.a.createElement(O.a,{className:"versionForm"},z.a.createElement("div",{className:"itemInline"},z.a.createElement(O.a.Item,null,i("tag_name",{rules:[{required:!0,message:"请输入获取或选择一个标签"},{validator:function(e,t,n){t.length>30||q()(t).call(t," ")>0||t.match(/^\s+$/)||Object(G.trim)(t).length!=t.length?n("无效的标签名称请参考右侧建议命名标签并确认长度在1~30个字符之间"):n()}}],validateFirst:!0,initialValue:me.get("tag")})(z.a.createElement(k.a,{placeholder:"标记一个版本",onChange:function(e){var t=B()(d).call(d,(function(t){var n;return q()(n=t.name).call(n,e)>-1}));ce(de(t))},style:{width:"200px"}},oe))),z.a.createElement($,null,"@"),z.a.createElement(A.a,{repo_id:a&&a.repo_id,projectsId:se,branch:N,changeBranch:function(e){U(e)},owner:fe,history:c,tagflag:!1,commitflag:!0,branchList:a&&a.branches&&a.branches.list}),z.a.createElement("p",{className:"font-12 color-grey-6 weight400"},"选择一个已经存在的标签,或者在发布时新建一个标签")),z.a.createElement(O.a.Item,{className:"pt20"},i("name",{rules:[{required:!0,message:"请输入发行版的标题"},{validator:function(e,t,n){t.length>50?n("标题长度在1~50个字符之间"):n()}}],validateFirst:!0})(z.a.createElement(w.a,{placeholder:"发行版的标题"}))),z.a.createElement(V.a,{placeholder:"描述此发行版",height:200,mdID:"version-comments-description",initValue:g,onChange:E,noStorage:!0}),z.a.createElement("div",{className:"mt5 dragBox"},z.a.createElement(H.a,{className:"versionStyle",isComplete:!0,load:Q,icon:z.a.createElement("i",{className:"iconfont icon-shangchuanicon dragIcon"}),size:300,showNotification:o}),ue&&te&&te.length>0?z.a.createElement(Y.a,{attachments:te,showNotification:o,canDelete:!0}):""),z.a.createElement(O.a.Item,{className:"prerelease"},i("prerelease",{rules:[],validateFirst:!0})(z.a.createElement(y.a,{defaultChecked:!le},"这是一个预览版本"))),z.a.createElement("p",{className:"pt20 pb20",style:{borderTop:"1px solid #eee"}},z.a.createElement(b.a,{onClick:function(){s((function(e,t){if(!e)if(ue){var n,a,r=I()(n=I()(a="/".concat(fe,"/")).call(a,se,"/releases/")).call(n,ue,".json");X.a.put(r,J(J({},t),{},{body:g,attachment_ids:K,target_commitish:D})).then((function(e){var t;e&&(o("版本修改成功!"),c.push(I()(t="/".concat(fe,"/")).call(t,se,"/releases")))}))}else{var i,s=I()(i="/".concat(fe,"/")).call(i,se,"/releases.json");X.a.post(s,J(J({},t),{},{body:g,attachment_ids:K,target_commitish:D})).then((function(e){var t;e&&(l(),o("版本发布成功!"),c.push(I()(t="/".concat(fe,"/")).call(t,se,"/releases")))}))}}))},type:"primary",className:"mr30 btnblue"},ue?"保存":"创建","发行版"),z.a.createElement(b.a,{onClick:function(){var e;return c.push(I()(e="/".concat(fe,"/")).call(e,se,"/releases"))},className:"btngrey"},"取消"))),z.a.createElement("div",{className:"versionTips"},z.a.createElement("div",{className:"infosTip"},z.a.createElement("p",{className:"font-16 mb14 weight"},"标签命名建议"),z.a.createElement("p",{className:"mb15"},"通常的做法是在版本名称前加上字母 v 前缀, v1.0 或者 v2.3.4。"),z.a.createElement("p",null,"如果标签不适合在生产环境下使用请在版本名称后添加预发行版本。例如v0.2-alpha 或者 v5.9-beta.3。")),z.a.createElement("div",{className:"infosTip"},z.a.createElement("p",{className:"font-16 mb14 weight"},"语义化版本"),z.a.createElement("p",null,"如果你是第一次发布版本,我们强烈建议你阅读",z.a.createElement("a",{href:"https://semver.org/lang/zh-CN",target:"_blank",className:"color-blue"},"语义化版本"),"。")),z.a.createElement("div",{className:"infosTip"},z.a.createElement("p",{className:"font-16 mb14 weight"},"附件大小说明"),z.a.createElement("p",null,"单个附件不能超过 300M每个仓库总附件不可超过 1G。附件总容量统计包括仓库附件和发行版附件。"))))})))},lrIw:function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var a=n("cDcd"),r=n("i+PK"),o=n("eHJ2"),c=n.n(o);function l(e){return(l="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 i(){return(i=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}).apply(this,arguments)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==l(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 d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=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&&f(e,t)}(o,e);var t,n,r=function(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,a=d(e);if(t){var r=d(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return m(this,n)}}(o);function o(){var e;return s(this,o),(e=r.apply(this,arguments)).saveRef=function(t){var n=e.props.children.ref;"function"==typeof n&&n(t)},e}return t=o,(n=[{key:"render",value:function(){return a.cloneElement(this.props.children,i(i({},this.props),{ref:this.saveRef}),null)}}])&&u(t.prototype,n),o}(a.Component),h=n("5rEg"),v=n("2fM7"),g=n("H84U");function b(e){return(b="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 y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(){return(w=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}).apply(this,arguments)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(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)}}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return!t||"object"!==b(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 O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function N(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var S=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&&j(e,t)}(l,e);var t,n,o=function(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,a=O(e);if(t){var r=O(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return x(this,n)}}(l);function l(){var e;return E(this,l),(e=o.apply(this,arguments)).saveSelect=function(t){e.select=t},e.getInputElement=function(){var t=e.props.children,n=t&&a.isValidElement(t)&&t.type!==r.b?a.Children.only(e.props.children):a.createElement(h.a,null),o=w({},n.props);return delete o.children,a.createElement(p,o,n)},e.renderAutoComplete=function(t){var n,o,l=t.getPrefixCls,i=e.props,s=i.prefixCls,u=i.size,f=i.className,m=void 0===f?"":f,d=i.notFoundContent,p=i.optionLabelProp,h=i.dataSource,g=i.children,E=l("select",s),_=c()((y(n={},"".concat(E,"-lg"),"large"===u),y(n,"".concat(E,"-sm"),"small"===u),y(n,m,!!m),y(n,"".concat(E,"-show-search"),!0),y(n,"".concat(E,"-auto-complete"),!0),n)),j=a.Children.toArray(g);return o=j.length&&N(j[0])?g:h?h.map((function(e){if(a.isValidElement(e))return e;switch(b(e)){case"string":return a.createElement(r.b,{key:e},e);case"object":return a.createElement(r.b,{key:e.value},e.text);default:throw new Error("AutoComplete[dataSource] only supports type `string[] | Object[]`.")}})):[],a.createElement(v.a,w({},e.props,{className:_,mode:v.a.SECRET_COMBOBOX_MODE_DO_NOT_USE,optionLabelProp:p,getInputElement:e.getInputElement,notFoundContent:d,ref:e.saveSelect}),o)},e}return t=l,(n=[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){return a.createElement(g.a,null,this.renderAutoComplete)}}])&&_(t.prototype,n),l}(a.Component);S.Option=r.b,S.OptGroup=r.a,S.defaultProps={transitionName:"slide-up",optionLabelProp:"children",choiceTransitionName:"zoom",showSearch:!1,filterOption:!1}},p7gc:function(e,t,n){"use strict";var a=n("UtpJ"),r=n.n(a),o=n("O0yt"),c=n.n(o),l=n("Dcj1"),i=n.n(l),s=n("6UaR"),u=n.n(s),f=n("zLi2"),m=n.n(f),d=n("IeeE"),p=n.n(d),h=n("RKTd"),v=n.n(h),g=n("pPxq"),b=n.n(g),y=n("o+MX"),w=n.n(y),E=n("FLGM"),_=n.n(E),j=n("BfIq"),x=n.n(j),O=n("BF1V"),N=n.n(O),S=n("0lTi"),k=n.n(S),L=n("lHQ6"),C=n.n(L),R=n("ZbhI"),I=n.n(R),D=n("UF4K"),P=n.n(D),U=n("xlHU"),B=n.n(U),M=n("5tqG"),q=n.n(M),F=n("cDcd"),z=n.n(F),T=n("sYIF"),A=n("bdgK"),V=n("vDqi"),H=n.n(V);function Y(e,t){var n=void 0!==c.a&&i()(e)||e["@@iterator"];if(!n){if(u()(e)||(n=function(e,t){var n;if(e){if("string"==typeof e)return K(e,t);var a=r()(n=Object.prototype.toString.call(e)).call(n,8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?k()(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?K(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,s=!0,f=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){f=!0,l=e},f:function(){try{s||null==n.return||n.return()}finally{if(f)throw l}}}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}n("pb8e"),n("ex8r"),n("p77/"),n("eXKH");var X=window.$,G=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","image","table","|","line-break","watch","clear","emoji","fullscreen"],Q=["bold","italic","del","|","list-ul","list-ol","|","code","code-block","link","|","inline-latex","latex","|","image","table","|","line-break","watch","clear","emoji","fullscreen"];function J(e,t,n){window.sessionStorage.removeItem(e+t);var a="#e_tip_"+n;"content"==e?X("#e_tips_"+n).html(" "):X(a).html(" ")}function Z(e,t,n){var a=window.sessionStorage.getItem("content"+t);if(null!==a&&a!==e.getValue()){X("#e_tips_"+n).data("editor",e);var r='您上次有已保存的数据,是否<a style="cursor: pointer;" class="link-color-blue" onclick="md_rec_data(\'content\',\''+t+"','"+n+'\')">恢复</a> ? / <a style="cursor: pointer;" class="link-color-blue" onclick="md_clear_data(\'content\',\''+t+"','"+n+"')\">不恢复</a>";X("#e_tips_"+n).html(r)}return p()((function(){var a,r=new Date,o=r.getHours(),c=r.getMinutes(),l=r.getSeconds();if(o=o<10?"0"+o:o,c=c<10?"0"+c:c,l=l<10?"0"+l:l,""!==v()(a=e.getValue()).call(a)){!function(e,t,n){window.sessionStorage.setItem("content"+t,n)}(0,t,e.getValue());var i="#e_tips_"+n,s=" 数据已于 "+o+":"+c+":"+l+" 保存 ",u=X(i).html();u&&" "!==u&&!1===b()(u).call(u," 数据已于 ")?X(i).html(u.split(" (")[0]+" (".concat(s,")")):X(i).html(s)}}),1e4)}window.md_clear_data=J,window.md_rec_data=function(e,t,n){null!==window.sessionStorage.getItem(e+t)&&(X("#e_tips_"+n).data("editor").setValue(window.sessionStorage.getItem(e+t)),J(e,t,n))},t.a=function(e){var t,n,a=e.mdID,r=e.onChange,o=e.onCMBeforeChange,c=e.onCMBlur,l=e.error,i=void 0!==l&&l,s=e.className,u=void 0===s?"":s,f=e.noStorage,d=void 0!==f&&f,p=e.imageExpand,h=void 0===p||p,v=e.placeholder,g=void 0===v?"":v,b=e.width,y=void 0===b?"100%":b,E=e.height,j=void 0===E?400:E,O=e.initValue,S=void 0===O?"":O,L=(e.emoji,e.watch),R=void 0===L||L,D=(e.showNullButton,e.showResizeBar),U=void 0!==D&&D,M=e.startInit,V=void 0===M||M,K=(e.forMember,e.isCanAtme),X=void 0!==K&&K,J=e.isQuoteIssue,$=void 0!==J&&J,W=e.changeAtWhoLoginList,ee=e.owner,te=e.projectsId,ne=e.isFocus,ae=void 0===ne||ne,re=e.showLatexButton,oe=void 0===re||re,ce=Object(F.useRef)(),le=Object(F.useRef)(),ie=Object(F.useState)(),se=m()(ie,2),ue=se[0],fe=se[1],me=Object(F.useState)(!1),de=m()(me,2),pe=de[0],he=de[1],ve=Object(F.useState)([]),ge=m()(ve,2),be=ge[0],ye=ge[1],we=Object(F.useState)([]),Ee=m()(we,2),_e=Ee[0],je=Ee[1],xe=Object(F.useState)([]),Oe=m()(xe,2),Ne=Oe[0],Se=Oe[1],ke=Object(F.useRef)([]),Le=Object(F.useRef)(!1),Ce="mdEditor_".concat(a),Re="mdEditors_".concat(a),Ie="e_tips_mdEditor_".concat(a),De=Object(F.useState)([]),Pe=m()(De,2),Ue=Pe[0],Be=Pe[1],Me=Object(F.useState)(!1),qe=m()(Me,2),Fe=qe[0],ze=qe[1],Te=Object(F.useState)([]),Ae=m()(Te,2),Ve=Ae[0],He=Ae[1],Ye=Object(F.useRef)(!1),Ke=Object(F.useRef)([]);function Xe(e){var t;H.a.get(w()(t="/v1/".concat(ee,"/")).call(t,te,"/issues"),{params:{only_name:!0,keyword:e,sort_direction:"desc",sort_by:"issues.created_on",limit:500,page:1}}).then((function(t){if(t){!e&&Be(t.data.issues);var n=t.data.issues;He(n&&n.length>0?n:void 0)}}))}Object(F.useEffect)((function(){var e;X&&H.a.get(w()(e="/".concat(ee,"/")).call(e,te,"/members.json")).then((function(e){0!==e.data.total_count&&(Se(e.data.users),je(e.data.users))})),document.addEventListener("click",(function(){Le.current=!1,he(!1),Ye.current=!1,ze(!1)})),$&&Xe()}),[]);var Ge=z.a.createElement("div",{id:"quoteDiv",className:"quoteDiv"},Ve&&_()(Ve).call(Ve,(function(e,t){return z.a.createElement("li",{className:"quote ".concat(0===t&&"active"),onClick:function(){return function(e){var t,n,a,r;Ye.current=!1,ze(!1);var o=ue.cm,c=o.doc.getCursor(),l=c.line,i=c.ch,s=x()(t=o.getRange({line:l,ch:0},{line:l,ch:i})).call(t,"#");o.replaceRange(w()(n=w()(a=w()(r="[#".concat(e.subject,"](/")).call(r,ee,"/")).call(a,te,"/issues/")).call(n,e.project_issues_index,") "),{line:l,ch:s},{line:l,ch:i}),o.focus();var u=new N.a(Ke.current);u.add(e.project_issues_index),Ke.current=k()(u)}(e)},onMouseOver:function(){return e=t,document.getElementsByClassName("quote active")[0]&&(document.getElementsByClassName("quote active")[0].className="quote"),void(document.getElementsByClassName("quote")[e]&&(document.getElementsByClassName("quote")[e].className="quote active"));var e}},z.a.createElement("span",{style:{minWidth:"40px"}},z.a.createElement("span",{className:"issueIndex",title:e.project_issues_index},"#",e.project_issues_index)),z.a.createElement("span",{className:"issueName task-hide"},e.subject))})));function Qe(e){var t=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,n=ue.cm.getValue();if(e.shiftKey&&"Digit2"===e.code&&(Le.current=!0,he(!0),document.getElementById("at_who_list").style.top=C()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("at_who_list").style.left=C()(t.getPropertyValue("left").replace("px",""))+20+"px"),e.ctrlKey&&"KeyZ"===e.code&&0!==Ne.length){if(S){var a=[];_()(Ne).call(Ne,(function(e){var t;-1!=I()(S).call(S,e.username)&&"@"===S.charAt(I()(S).call(S,e.username)-1)&&I()(S).call(S,"@".concat(e.username))===I()(n).call(n,"@".concat(e.username))&&(a[a.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=a.length&&_()(a).call(a,(function(e){n=n.replace(e,"")}))}-1!=I()(n).call(n,"@")&&_()(Ne).call(Ne,(function(e){if(-1!=I()(n).call(n,e.username)&&"@"===n.charAt(I()(n).call(n,e.username)-1)){var t=new N.a(ke.current);t.add(e.login),ke.current=k()(t),ye(k()(t))}}))}e.shiftKey&&"Digit3"===e.code&&$&&(Ye.current=!0,ze(!0),document.getElementById("quoteDiv").style.top=C()(t.getPropertyValue("top").replace("px",""))+62+"px",document.getElementById("quoteDiv").style.left=C()(t.getPropertyValue("left").replace("px",""))+20+"px")}Object(F.useEffect)((function(){if(Ze)if(Ye.current){var e=document.getElementById("quoteDiv"),t=document.getElementsByClassName("quote");Ze.addKeyMap({Up:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n>0&&(n<=t.length-4&&(e.scrollTop-=40),t[n].className="quote",t[n-1].className="quote active")},Down:function(){for(var n,a=0;a<t.length;a++)"quote active"===t[a].className&&(n=a);n<t.length-1&&(n>=3&&(e.scrollTop+=40),t[n].className="quote",t[n+1].className="quote active")},Enter:function(){document.getElementsByClassName("quote active")[0]&&document.getElementsByClassName("quote active")[0].click()}})}else Ze.removeKeyMap()}),[Fe]),Object(F.useEffect)((function(){W&&W(be)}),[be]);var Je=z.a.createElement("div",{className:"at_who_list",id:"at_who_list"},_e&&_()(_e).call(_e,(function(e,t){return z.a.createElement("div",{key:t,className:"at_who ".concat(0===t&&"active"),onClick:function(){!function(e){var t;Le.current=!1,he(!1);var n=ue.cm,a=n.doc.getCursor(),r=a.line,o=a.ch,c=x()(t=n.getRange({line:r,ch:0},{line:r,ch:o})).call(t,"@"),l=void 0;_()(_e).call(_e,(function(t){t.username===e&&(l=t.login)})),n.replaceRange("[@"+e+"]"+"(/".concat(l,") "),{line:r,ch:c},{line:r,ch:o}),n.focus();var i=new N.a(ke.current);i.add(l),ke.current=k()(i),ye(k()(i))}(e.username)},onMouseOver:function(){!function(e){document.getElementsByClassName("at_who active")[0]&&(document.getElementsByClassName("at_who active")[0].className="at_who"),document.getElementsByClassName("at_who")[e]&&(document.getElementsByClassName("at_who")[e].className="at_who active")}(t)}},e.image_url&&z.a.createElement("img",{src:Object(T.i)("/".concat(e.image_url)),alt:""}),z.a.createElement("span",null,e.username))})));Object(F.useEffect)((function(){!ue&&V&&window.editormd(Ce,{width:y,height:j,path:Object(T.m)("/editormd/lib/"),markdown:S,syncScrolling:"single",tex:!0,tocm:!0,emoji:!0,taskList:!0,codeFold:!0,searchReplace:!0,htmlDecode:"style,script,iframe",sequenceDiagram:!0,autoFocus:!1,watch:R,saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:g,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:Object(T.l)(),toolbarIcons:function(){return oe?Q:G},toolbarIconsClass:{"line-break":"fa-minus",fullScreen:"iconfont icon-fangdaicon font-14"},toolbarCustomIcons:{"inline-latex":"<a title='行内公式' class='latex' ><i name='inline-latex' class='fa iconfont icon-hangneigongshi font-14'></i></a>",latex:"<a title='多行公式' class='latex' ><i name='latex' class='fa iconfont icon-duohanggongshi font-16'></i></a>","null-button":"<a class='pr' title='增加填空'><i class='border-left'><span></span></i><span name='null-button' class='fa fillTip'>点击插入填空项</span><i class='iconfont fa icon-edit font-16' name='null-button'></i></a>"},toolbarHandlers:{"line-break":function(e,t,n,a){e.replaceSelection("<br/>")},"null-button":function(e,t,n,a){""===a&&e.setCursor(n.line,n.ch+1),e.replaceSelection("▁")},fullScreen:function(e,t,n,a){t.addClass("none")},"inline-latex":function(e,t,n,a){e.replaceSelection("$"+a+"$"),e.setCursor(n.line,n.ch+2),e.focus()},latex:function(e,t,n,a){e.replaceSelection("$$\n\n"+a+"$$"),e.setCursor(n.line+1,0),e.focus()}},lang:{toolbar:{latex:"多行公式","line-break":"换行",fullScreen:"开启全屏"}},onload:function(){fe(this)}})}),[Ce,ue,V]);var Ze=ue&&ue.cm;return Object(F.useEffect)((function(){Le.current?Ze.addKeyMap({Up:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e>0&&(e<=n.length-4&&(t.scrollTop-=40),n[e].className="at_who",n[e-1].className="at_who active")},Down:function(){for(var e,t=document.getElementById("at_who_list"),n=document.getElementsByClassName("at_who"),a=0;a<n.length;a++)"at_who active"===n[a].className&&(e=a);e<n.length-1&&(e>=3&&(t.scrollTop+=40),n[e].className="at_who",n[e+1].className="at_who active")},Enter:function(){if(document.getElementsByClassName("at_who active")[0])document.getElementsByClassName("at_who active")[0].click();else{var e=ue.cm,t=e.doc.getCursor(),n=t.line,a=t.ch;e.replaceRange("\n",{line:n,ch:a},{line:n,ch:a}),he(!1),Le.current=!1}}}):Ze&&Ze.removeKeyMap()}),[pe]),Object(F.useEffect)((function(){if(Le.current&&_e){var e=document.getElementsByClassName("CodeMirror cm-s-default CodeMirror-wrap")[0].firstChild.style,t="添加评论..."===g?80:10;document.getElementById("at_who_list").style.left=C()(e.getPropertyValue("left").replace("px",""))+t+"px"}}),[_e]),Object(F.useEffect)((function(){if(Ze){var e,t=null;return c&&ue.cm.on("blur",(function(){c(ue.getValue())})),o&&ue.cm.on("beforeChange",(function(e,t){o(e,t)})),d||(t=Z(ue,"MDEditor__".concat(Ce),Ce)),(X||$)&&ue.cm.on("focus",(function(){document.addEventListener("keydown",Qe)})),(X||$)&&ue.cm.on("blur",(function(){document.removeEventListener("keydown",Qe)})),ue.cm.on("change",(function(e){var t=e.getValue();if(t){var n=t.match(/alert\((.*?)\)/g);if(n&&n.length>0)for(var a=0;a<n.length;a++)t=t.replace(n[a],"")}if(r&&r(t),Ye.current){var o=e.doc.getCursor(),c=o.line,l=o.ch,i=Ze.getRange({line:c,ch:0},{line:c,ch:l});-1===I()(i).call(i,"#")||" "===(i=i.substring(x()(i).call(i,"#")+1))?(ze(!1),Ye.current=!1):Xe(i)}if(Le.current){var s,u=e.doc.getCursor(),f=u.line,m=u.ch,d=Ze.getRange({line:f,ch:0},{line:f,ch:m});-1===I()(d).call(d,"@")?(he(!1),Le.current=!1):(d=d.substring(x()(d).call(d,"@")+1))?H.a.get(w()(s="/".concat(ee,"/")).call(s,te,"/members.json"),{params:{search:d}}).then((function(e){e&&e.data&&0!==e.data.total_count?je(e.data.users):je(void 0)})):je(Ne)}if(function(e,t,n){if(0!=n.length){var a,r=ue.cm,o=r.getValue();if(S){var c=[];_()(t).call(t,(function(t){var n,a,r,l,i,s,u,f,m=t.username;m=t.project_issues_index,-1!=I()(S).call(S,m)&&S.charAt(I()(S).call(S,m)-1)===e&&I()(S).call(S,w()(n="".concat(e)).call(n,m))===I()(o).call(o,w()(a="".concat(e)).call(a,m))&&(c[c.length]=w()(r=w()(l="[".concat(e)).call(l,m,"](/")).call(r,m,")"),c[c.length]=w()(i=w()(s=w()(u=w()(f="[".concat(e)).call(f,m,"](")).call(u,ee,"/")).call(s,te,"/issues/")).call(i,m,")"))})),0!=c.length&&_()(c).call(c,(function(e){o=o.replace(e,"")}))}var l=new P.a;_()(a=k()(n)).call(a,(function(e){_()(t).call(t,(function(t){t.project_issues_index===e&&l.set(t.project_issues_index,t.project_issues_index)}))}));var i=r.doc.getCursor(),s=i.line,u=i.ch;-1===I()(o).call(o,e)&&(Ke.current=[]);var f,m,d=r.getRange({line:s,ch:0},{line:s,ch:u}),p=r.getLine(s);p&&-1!==I()(p).call(p,e)?_()(f=k()(B()(l).call(l))).call(f,(function(t){var n,a,c,i,f=w()(n=w()(a=w()(c=w()(i="[".concat(e)).call(i,t,"](/")).call(c,ee,"/")).call(a,te,"/issues/")).call(n,l.get(t),")");if(q()(d).call(d,f)&&r.setSelection({line:s,ch:x()(d).call(d,e)-1},{line:s,ch:u}),-1===I()(o).call(o,f)){var m=new N.a(Ke.current);m.delete(l.get(t)),Ke.current=k()(m)}})):_()(m=k()(B()(l).call(l))).call(m,(function(t){var n,a,r,c,i=w()(n=w()(a=w()(r=w()(c="[".concat(e)).call(c,t,"](/")).call(r,ee,"/")).call(a,te,"/issues/")).call(n,l.get(t),")");if(-1===I()(o).call(o,i)){var s=new N.a(Ke.current);s.delete(l.get(t)),Ke.current=k()(s)}}))}}("#",Ue,Ke.current),0!=ke.current.length){var p,h=ue.cm,v=h.getValue();if(S){var g=[];_()(Ne).call(Ne,(function(e){var t;-1!=I()(S).call(S,e.username)&&"@"===S.charAt(I()(S).call(S,e.username)-1)&&I()(S).call(S,"@".concat(e.username))===I()(v).call(v,"@".concat(e.username))&&(g[g.length]=w()(t="[@".concat(e.username,"](/")).call(t,e.login,")"))})),0!=g.length&&_()(g).call(g,(function(e){v=v.replace(e,"")}))}var b=new P.a;_()(p=k()(ke.current)).call(p,(function(e){_()(Ne).call(Ne,(function(t){t.login===e&&b.set(t.username,t.login)}))}));var y=h.doc.getCursor(),E=y.line,j=y.ch;-1===I()(v).call(v,"@")&&(ke.current=[],ye([]));var O,L,C=h.getRange({line:E,ch:0},{line:E,ch:j}),R=h.getLine(E);R&&-1!==I()(R).call(R,"@")?_()(O=k()(B()(b).call(b))).call(O,(function(e){var t,n=w()(t="[@".concat(e,"](/")).call(t,b.get(e),")");if(q()(C).call(C,n)&&h.setSelection({line:E,ch:x()(C).call(C,"@")-1},{line:E,ch:j}),-1===I()(v).call(v,n)){var a=new N.a(ke.current);a.delete(b.get(e)),ke.current=k()(a),ye(k()(a))}})):_()(L=k()(B()(b).call(b))).call(L,(function(e){var t,n=w()(t="[@".concat(e,"](/")).call(t,b.get(e),")");if(-1===I()(v).call(v,n)){var a=new N.a(ke.current);a.delete(b.get(e)),ke.current=k()(a),ye(k()(a))}}))}})),e=function(){var e;return ce.current&&(e=new A.default((function(e){var t,n=Y(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&(ue.resize(),ue.cm.refresh(),ae&&ue.cm.focus())}}catch(e){n.e(e)}finally{n.f()}}))).observe(ce.current),e}(),function(){d||clearInterval(t),e&&e.unobserve(ce.current)}}}),[Ze]),Object(F.useEffect)((function(){ue&&null!=S&&S!==ue.getValue()&&ue.setValue(S.toString())}),[ue,S,Ce]),Object(F.useEffect)((function(){if(le.current){var e=function(e){r=!0,o=e.pageY},t=function(){r=!1},n=function(e){if(r){var t=e.pageY-o;t<0&&(t=0),t>300&&(t=300);var n=j+t+"px";ue.resize("",n)}},a=le.current,r=!1,o=0;return a.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){a.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[ue,le]),z.a.createElement(F.Fragment,null,z.a.createElement("div",{ref:ce,className:w()(t=w()(n="df editormd-editing ".concat(u," ")).call(n,h&&"editormd-image-click-expand"," ")).call(t,Fe||pe?"quoteBox":""," ")},z.a.createElement("div",{className:"edu-back-greyf5 radius4 editormd ".concat(i?"error":""),id:Ce},Fe&&Ge,pe&&Je,z.a.createElement("textarea",{style:{display:"none"},id:Re,name:"content"}),z.a.createElement("div",{className:"CodeMirror cm-s-defualt",style:{display:"none"}}))),U?z.a.createElement("a",{ref:le,className:"editor-resize"}):null,z.a.createElement("div",{className:"fr rememberTip"},!0===d?null:z.a.createElement("div",{id:Ie,className:"edu-txt-right color-grey-cd font-12"})))}},reVg:function(e,t,n){"use strict";var a=n("61Qb"),r=Math.floor,o=function(e,t){var n=e.length;if(n<8)for(var c,l,i=1;i<n;){for(l=i,c=e[i];l&&t(e[l-1],c)>0;)e[l]=e[--l];l!==i++&&(e[l]=c)}else for(var s=r(n/2),u=o(a(e,0,s),t),f=o(a(e,s),t),m=u.length,d=f.length,p=0,h=0;p<m||h<d;)e[p+h]=p<m&&h<d?t(u[p],f[h])<=0?u[p++]:f[h++]:p<m?u[p++]:f[h++];return e};e.exports=o},tKpz:function(e,t){}}]);