You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
64 KiB
14 lines
64 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[117,6],{"500L":function(je,Q,e){"use strict";e.d(Q,"a",function(){return me});var ye=e("DZo9"),pe=e("8z0m"),Ue=e("+L6B"),ce=e("2/Rp"),Ee=e("2qtc"),D=e("kLXV"),d=e("9og8"),de=e("k1fw"),oe=e("oBTY"),U=e("miYZ"),j=e("tsqr"),I=e("tJVT"),ie=e("q1tI"),Y=e.n(ie),be=e("m3rI"),Me=e("wzkS"),k=e("y5JW");function g(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */g=function(){return w};var w={},re=Object.prototype,x=re.hasOwnProperty,ne=Object.defineProperty||function(n,t,r){n[t]=r.value},Z=typeof Symbol=="function"?Symbol:{},q=Z.iterator||"@@iterator",H=Z.asyncIterator||"@@asyncIterator",se=Z.toStringTag||"@@toStringTag";function C(n,t,r){return Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),n[t]}try{C({},"")}catch(n){C=function(r,f,y){return r[f]=y}}function ve(n,t,r,f){var y=t&&t.prototype instanceof X?t:X,E=Object.create(y.prototype),K=new s(f||[]);return ne(E,"_invoke",{value:h(n,r,K)}),E}function A(n,t,r){try{return{type:"normal",arg:n.call(t,r)}}catch(f){return{type:"throw",arg:f}}}w.wrap=ve;var O={};function X(){}function F(){}function P(){}var L={};C(L,q,function(){return this});var B=Object.getPrototypeOf,M=B&&B(B(a([])));M&&M!==re&&x.call(M,q)&&(L=M);var l=P.prototype=X.prototype=Object.create(L);function i(n){["next","throw","return"].forEach(function(t){C(n,t,function(r){return this._invoke(t,r)})})}function u(n,t){function r(y,E,K,ee){var G=A(n[y],n,E);if(G.type!=="throw"){var ge=G.arg,m=ge.value;return m&&typeof m=="object"&&x.call(m,"__await")?t.resolve(m.__await).then(function(c){r("next",c,K,ee)},function(c){r("throw",c,K,ee)}):t.resolve(m).then(function(c){ge.value=c,K(ge)},function(c){return r("throw",c,K,ee)})}ee(G.arg)}var f;ne(this,"_invoke",{value:function(E,K){function ee(){return new t(function(G,ge){r(E,K,G,ge)})}return f=f?f.then(ee,ee):ee()}})}function h(n,t,r){var f="suspendedStart";return function(y,E){if(f==="executing")throw new Error("Generator is already running");if(f==="completed"){if(y==="throw")throw E;return o()}for(r.method=y,r.arg=E;;){var K=r.delegate;if(K){var ee=R(K,r);if(ee){if(ee===O)continue;return ee}}if(r.method==="next")r.sent=r._sent=r.arg;else if(r.method==="throw"){if(f==="suspendedStart")throw f="completed",r.arg;r.dispatchException(r.arg)}else r.method==="return"&&r.abrupt("return",r.arg);f="executing";var G=A(n,t,r);if(G.type==="normal"){if(f=r.done?"completed":"suspendedYield",G.arg===O)continue;return{value:G.arg,done:r.done}}G.type==="throw"&&(f="completed",r.method="throw",r.arg=G.arg)}}}function R(n,t){var r=t.method,f=n.iterator[r];if(f===void 0)return t.delegate=null,r==="throw"&&n.iterator.return&&(t.method="return",t.arg=void 0,R(n,t),t.method==="throw")||r!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),O;var y=A(f,n.iterator,t.arg);if(y.type==="throw")return t.method="throw",t.arg=y.arg,t.delegate=null,O;var E=y.arg;return E?E.done?(t[n.resultName]=E.value,t.next=n.nextLoc,t.method!=="return"&&(t.method="next",t.arg=void 0),t.delegate=null,O):E:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function b(n){var t={tryLoc:n[0]};1 in n&&(t.catchLoc=n[1]),2 in n&&(t.finallyLoc=n[2],t.afterLoc=n[3]),this.tryEntries.push(t)}function S(n){var t=n.completion||{};t.type="normal",delete t.arg,n.completion=t}function s(n){this.tryEntries=[{tryLoc:"root"}],n.forEach(b,this),this.reset(!0)}function a(n){if(n){var t=n[q];if(t)return t.call(n);if(typeof n.next=="function")return n;if(!isNaN(n.length)){var r=-1,f=function y(){for(;++r<n.length;)if(x.call(n,r))return y.value=n[r],y.done=!1,y;return y.value=void 0,y.done=!0,y};return f.next=f}}return{next:o}}function o(){return{value:void 0,done:!0}}return F.prototype=P,ne(l,"constructor",{value:P,configurable:!0}),ne(P,"constructor",{value:F,configurable:!0}),F.displayName=C(P,se,"GeneratorFunction"),w.isGeneratorFunction=function(n){var t=typeof n=="function"&&n.constructor;return!!t&&(t===F||(t.displayName||t.name)==="GeneratorFunction")},w.mark=function(n){return Object.setPrototypeOf?Object.setPrototypeOf(n,P):(n.__proto__=P,C(n,se,"GeneratorFunction")),n.prototype=Object.create(l),n},w.awrap=function(n){return{__await:n}},i(u.prototype),C(u.prototype,H,function(){return this}),w.AsyncIterator=u,w.async=function(n,t,r,f,y){y===void 0&&(y=Promise);var E=new u(ve(n,t,r,f),y);return w.isGeneratorFunction(t)?E:E.next().then(function(K){return K.done?K.value:E.next()})},i(l),C(l,se,"Generator"),C(l,q,function(){return this}),C(l,"toString",function(){return"[object Generator]"}),w.keys=function(n){var t=Object(n),r=[];for(var f in t)r.push(f);return r.reverse(),function y(){for(;r.length;){var E=r.pop();if(E in t)return y.value=E,y.done=!1,y}return y.done=!0,y}},w.values=a,s.prototype={constructor:s,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var r in this)r.charAt(0)==="t"&&x.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function f(ge,m){return K.type="throw",K.arg=t,r.next=ge,m&&(r.method="next",r.arg=void 0),!!m}for(var y=this.tryEntries.length-1;y>=0;--y){var E=this.tryEntries[y],K=E.completion;if(E.tryLoc==="root")return f("end");if(E.tryLoc<=this.prev){var ee=x.call(E,"catchLoc"),G=x.call(E,"finallyLoc");if(ee&&G){if(this.prev<E.catchLoc)return f(E.catchLoc,!0);if(this.prev<E.finallyLoc)return f(E.finallyLoc)}else if(ee){if(this.prev<E.catchLoc)return f(E.catchLoc,!0)}else{if(!G)throw new Error("try statement without catch or finally");if(this.prev<E.finallyLoc)return f(E.finallyLoc)}}}},abrupt:function(t,r){for(var f=this.tryEntries.length-1;f>=0;--f){var y=this.tryEntries[f];if(y.tryLoc<=this.prev&&x.call(y,"finallyLoc")&&this.prev<y.finallyLoc){var E=y;break}}E&&(t==="break"||t==="continue")&&E.tryLoc<=r&&r<=E.finallyLoc&&(E=null);var K=E?E.completion:{};return K.type=t,K.arg=r,E?(this.method="next",this.next=E.finallyLoc,O):this.complete(K)},complete:function(t,r){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&r&&(this.next=r),O},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var f=this.tryEntries[r];if(f.finallyLoc===t)return this.complete(f.completion,f.afterLoc),S(f),O}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var f=this.tryEntries[r];if(f.tryLoc===t){var y=f.completion;if(y.type==="throw"){var E=y.arg;S(f)}return E}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,f){return this.delegate={iterator:a(t),resultName:r,nextLoc:f},this.method==="next"&&(this.arg=void 0),O}},w}function me(w){var re=[];return w&&w.length>0&&(re=w.map(function(x){return{uid:x.id,id:x.id,name:x.title+k.c+x.filesize,url:x.url,filesize:x.filesize,status:"done",response:{id:x.id}}})),re}Q.b=function(w){var re=w.value,x=w.onChange,ne=w.className,Z=w.maxSize,q=Z===void 0?300:Z,H=w.title,se=H===void 0?"\u4E0A\u4F20\u9644\u4EF6":H,C=w.showRemoveModal,ve=C===void 0?!1:C,A=w.accept,O=A===void 0?"":A,X=w.number,F=X===void 0?1e3:X,P=Object(ie.useState)(!1),L=Object(I.a)(P,2),B=L[0],M=L[1],l=Object(ie.useState)([]),i=Object(I.a)(l,2),u=i[0],h=i[1],R={multiple:!0,disabled:B,accept:O,withCredentials:!0,fileList:re,beforeUpload:function(s,a){var o=s.size/1024/1024;return u.concat(a).length>F?(j.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(F,"\u4E2A\u6587\u4EF6")),!1):o<q?!0:(j.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(q,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},action:"".concat(be.a.API_SERVER,"/api/attachments.json"),onChange:function(s){var a=Object(oe.a)(s.fileList);a.length>=F?M(!0):M(!1),h(Object(oe.a)(a)),a=a.map(function(o){var n;if(o==null||((n=o.response)===null||n===void 0)?void 0:n.id){var t;o.url="/api/attachments/".concat(o==null||((t=o.response)===null||t===void 0)?void 0:t.id)}return o.name.indexOf(k.c)===-1&&(o.name="".concat(o.name).concat(k.c).concat(Object(k.a)(o.size))),Object(de.a)({},o)}),console.log("info:",s),x(a)},onRemove:function(){var S=Object(d.a)(g().mark(function a(o){var n;return g().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=function(){var f=Object(d.a)(g().mark(function y(){var E,K;return g().wrap(function(G){for(;;)switch(G.prev=G.next){case 0:if(E=o.response?o.response.id:o.id,!E){G.next=8;break}return G.next=4,Object(Me.d)(o.response?o.response.id:o.uid);case 4:return K=G.sent,G.abrupt("return",K);case 8:return G.abrupt("return",!0);case 9:case"end":return G.stop()}},y)}));return function(){return f.apply(this,arguments)}}(),!ve){r.next=5;break}return r.abrupt("return",new Promise(function(f,y){D.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:Y.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var E=Object(d.a)(g().mark(function ee(){var G;return g().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,n();case 2:G=m.sent,j.b.success("\u5220\u9664\u6210\u529F"),f(!0);case 5:case"end":return m.stop()}},ee)}));function K(){return E.apply(this,arguments)}return K}(),onCancel:function(){return f(!1)}})}));case 5:return r.next=7,n();case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}},a)}));function s(a){return S.apply(this,arguments)}return s}()};function b(S){S.preventDefault(),S.stopPropagation()}return Y.a.createElement("div",{className:"multi-upload ".concat(ne||"")},Y.a.createElement(pe.a,R,Y.a.createElement(ce.a,{disabled:B,type:"primary",ghost:!0},se),Y.a.createElement("span",{onClick:b,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",q,"M) ")))}},"7/Dv":function(je,Q,e){je.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"7ahc":function(je,Q,e){"use strict";e.d(Q,"a",function(){return re});var ye=e("k1fw"),pe=e("0Owb"),Ue=e("+L6B"),ce=e("2/Rp"),Ee=e("y8nQ"),D=e("Vl3Y"),d=e("tJVT"),de=e("OaEy"),oe=e("2fM7"),U=e("q1tI"),j=e.n(U),I=e("VrN/"),ie=e.n(I),Y=e("p77/"),be=e.n(Y),Me=e("c5Ni"),k=e.n(Me),g=oe.a.Option,me={labelCol:{span:4},wrapperCol:{span:20}},w={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Q.b=function(x){var ne=x.callback,Z=x.onCancel,q=Object(U.useState)("python"),H=Object(d.a)(q,2),se=H[0],C=H[1];function ve(O){C(w[O][1])}function A(O){ne(O)}return j.a.createElement(D.a,Object(pe.a)({},me,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),j.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},j.a.createElement(oe.a,{onChange:ve},Object.keys(w).map(function(O){return j.a.createElement(g,{key:O,value:O},w[O][0])}))),j.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},j.a.createElement(re,{mode:se})),j.a.createElement("div",{className:"flex-container flex-end"},j.a.createElement(ce.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),j.a.createElement(ce.a,{type:"ghost",onClick:Z},"\u53D6\u6D88")))};function re(x){var ne=x.value,Z=x.onChange,q=x.mode,H=x.options,se=H===void 0?{}:H,C=Object(U.useRef)(),ve=Object(U.useState)(),A=Object(d.a)(ve,2),O=A[0],X=A[1];return Object(U.useEffect)(function(){if(O){var F=function(L){var B=L.getValue();Z&&Z(B)};return O.on("change",F),function(){O.off("change",F)}}},[O,Z]),Object(U.useEffect)(function(){O&&O.setOption("mode",q)},[O,q]),Object(U.useEffect)(function(){O&&((ne!==O.getValue()||ne==="")&&setTimeout(function(){O.setValue(ne||" ")},300))},[O,ne]),Object(U.useEffect)(function(){if(C.current&&!O){var F=ie.a.fromTextArea(C.current,Object(ye.a)({mode:q,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},se));X(F)}},[C.current,O]),j.a.createElement("div",{className:"my-codemirror-container"},j.a.createElement("textarea",{ref:C}))}},"9Bee":function(je,Q,e){"use strict";var ye=e("q1tI"),pe=e.n(ye),Ue=e("vg9a"),ce=e("tJVT"),Ee=e("DlQD"),D=e.n(Ee),d=e("rUJ1");function de(P,L){var B=P.match(/^(\s+)(?:```)/);if(B===null)return L;var M=B[1];return L.split(`
|
|
`).map(function(l){var i=l.match(/^\s+/);if(i===null)return l;var u=Object(ce.a)(i,1),h=u[0];return h.length>=M.length?l.slice(M.length):l}).join(`
|
|
`)}var oe=[],U=["<ul>"],j=new D.a.Renderer,I=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function ie(){oe.length=0,U=["<ul>"]}function Y(P,L,B,M){if(L>=P.length||P[L].level<=B)return L;var l=P[L];M.push("<li><a href='#"+l.anchor+"'>"+l.text+"</a>"),L++;var i=[];return L=Y(P,L,l.level,i),i.length>0&&(M.push("<ul>"),i.forEach(function(u){M.push(u)}),M.push("</ul>")),M.push("</li>"),L=Y(P,L,B,M),L}function be(){return Y(oe,0,0,U),U.push("</ul>"),U.join("")}var Me={heading:function(L){var B=I.exec(L);if(B)return{type:"heading",raw:B[0],depth:B[1].length,text:B[2]}},fences:function(L){var B=this.rules.block.fences.exec(L);if(B){var M=B[0],l=de(M,B[3]||""),i=B[2]?B[2].trim():B[2];if(["latex","katex","math"].indexOf(i)>=0){var u=me(),h=l;l=u,w[u]={type:"block",expression:h}}return{type:"code",raw:M,lang:i,text:l}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,me=function(){return"__special_katext_id_".concat(g++,"__")},w={};function re(){return w}function x(){g=0,w={}}function ne(P){return P=P.replace(k,function(L,B){var M=me();return w[M]={type:"inline",expression:B},M}),P}var Z=j.listitem;j.listitem=function(P){return Z(ne(P))};var q=j.paragraph;j.paragraph=function(P){return q(ne(P))};var H=j.tablecell;j.tablecell=function(P,L){return H(ne(P),L)},j.code=function(P,L,B){var M=(L||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"<p class='editormd-tex'>".concat(P,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(B?P:Object(d.escape)(P,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(B?P:Object(d.escape)(P,!0))+"</code></pre>"},j.heading=function(P,L,B){var M=this.options.headerPrefix+B.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return oe.push({anchor:M,level:L,text:P}),"<h"+L+' id="'+M+'">'+P+"</h"+L+">"},D.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:Me,renderer:j});var se=D.a,C=e("SJMd"),ve=e("m3rI"),A=e("Oy/b"),O=/<pre[^>]*>/g;function X(P){var L=document.createElement("div");return L.innerHTML=P,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var F=Q.a=function(P){var L=P.value,B=L===void 0?"":L,M=P.className,l=P.style,i=l===void 0?{}:l,u=String(B),h=Object(ye.useMemo)(function(){try{var S=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,s=/\"\/api\/attachments\/|\"\/attachments\/download\//g,a=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;u=u.replace(S,"("+ve.a.API_SERVER+"/api/attachments/").replace(s,'"'+ve.a.API_SERVER+"/api/attachments/").replace(a,'"'+ve.a.API_SERVER+"/files/uploads/")}catch(t){}var o=se(u),n=re();return u.match(/\[TOC\]/)&&(o=o.replace("<p>[TOC]</p>",be()),ie()),o=o.replace(/(__special_katext_id_\d+__)/g,function(t,r){var f=n[r],y=f.type,E=f.expression;return Object(A.renderToString)(X(E)||"",{displayMode:y==="block",throwOnError:!1,output:"html"})}),o=o.replace(/▁/g,"\u2581\u2581\u2581"),x(),o},[u]),R=Object(ye.useRef)();function b(S){var s=S.target;if(s.tagName.toUpperCase()==="A"){var a=s.getAttribute("href");if(a.startsWith("#")){S.preventDefault();var o=document.getElementById(a.replace("#",""));o&&o.scrollIntoView(!0)}}}return Object(ye.useEffect)(function(){if(R.current&&h&&(h.match(O)&&window.PR.prettyPrint()),R.current)return R.current.addEventListener("click",b),function(){R.current.removeEventListener("click",b),x(),ie()}},[h,R.current,b]),pe.a.createElement("div",{ref:R,style:i,className:"".concat(M||""," markdown-body"),dangerouslySetInnerHTML:{__html:h}})}},"9VGf":function(je,Q,e){"use strict";e.d(Q,"a",function(){return Ue});var ye=e("q1tI"),pe=e.n(ye);function Ue(ce,Ee){var D=Object(ye.useRef)();Object(ye.useEffect)(function(){D.current=ce}),Object(ye.useEffect)(function(){function d(){D.current()}if(Ee!==null){var de=setInterval(d,Ee);return function(){return clearInterval(de)}}},[Ee])}},BjJ7:function(je,Q,e){"use strict";e.d(Q,"d",function(){return pe}),e.d(Q,"c",function(){return Ue}),e.d(Q,"e",function(){return ce}),e.d(Q,"b",function(){return Ee}),e.d(Q,"a",function(){return d});var ye=e("m3rI");function pe(de){var oe=!0;if(de.length>0){for(var U=0;U<de.length;U++)if(de[U].compile_success==0||!de[U].compile_success){oe=!1;break}}else oe=!1;return oe}function Ue(de){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",U=[],j=0;j<de.length;j++){var I=de[j],ie=oe?"".concat(oe,"/").concat(I.name):"".concat(I.name);U.push({title:I.name,isLeaf:!(I.type==="tree"),key:ie})}return U}function ce(de,oe,U){for(var j=0;j<de.length;j++){var I=de[j];if(I.key===oe){I.children=U;break}I.children&&ce(I.children,oe,U)}return de}function Ee(de,oe,U){var j;return function(){var I=this,ie=arguments,Y=function(){j=null,U||de.apply(I,ie)},be=U&&!j;clearTimeout(j),j=setTimeout(Y,oe),be&&de.apply(I,ie)}}var D=!0,d=ye.a.API_SERVER},"C+DQ":function(je,Q,e){},CKgm:function(je,Q,e){"use strict";e.r(Q);var ye=e("+L6B"),pe=e("2/Rp"),Ue=e("5NDa"),ce=e("5rEg"),Ee=e("sPJy"),D=e("bE4q"),d=e("miYZ"),de=e("tsqr"),oe=e("9og8"),U=e("k1fw"),j=e("y8nQ"),I=e("Vl3Y"),ie=e("tJVT"),Y=e("PpiC"),be=e("OaEy"),Me=e("2fM7"),k=e("q1tI"),g=e.n(k),me=e("Ty5D"),w=e("9kvl"),re=e("55Ip"),x=e("Ot1p"),ne=e("500L"),Z=e("h+Ho"),q=e("7/Dv"),H=e.n(q);function se(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */se=function(){return A};var A={},O=Object.prototype,X=O.hasOwnProperty,F=Object.defineProperty||function(m,c,_){m[c]=_.value},P=typeof Symbol=="function"?Symbol:{},L=P.iterator||"@@iterator",B=P.asyncIterator||"@@asyncIterator",M=P.toStringTag||"@@toStringTag";function l(m,c,_){return Object.defineProperty(m,c,{value:_,enumerable:!0,configurable:!0,writable:!0}),m[c]}try{l({},"")}catch(m){l=function(_,T,W){return _[T]=W}}function i(m,c,_,T){var W=c&&c.prototype instanceof R?c:R,N=Object.create(W.prototype),fe=new ee(T||[]);return F(N,"_invoke",{value:f(m,_,fe)}),N}function u(m,c,_){try{return{type:"normal",arg:m.call(c,_)}}catch(T){return{type:"throw",arg:T}}}A.wrap=i;var h={};function R(){}function b(){}function S(){}var s={};l(s,L,function(){return this});var a=Object.getPrototypeOf,o=a&&a(a(G([])));o&&o!==O&&X.call(o,L)&&(s=o);var n=S.prototype=R.prototype=Object.create(s);function t(m){["next","throw","return"].forEach(function(c){l(m,c,function(_){return this._invoke(c,_)})})}function r(m,c){function _(W,N,fe,Pe){var Le=u(m[W],m,N);if(Le.type!=="throw"){var Be=Le.arg,v=Be.value;return v&&typeof v=="object"&&X.call(v,"__await")?c.resolve(v.__await).then(function(J){_("next",J,fe,Pe)},function(J){_("throw",J,fe,Pe)}):c.resolve(v).then(function(J){Be.value=J,fe(Be)},function(J){return _("throw",J,fe,Pe)})}Pe(Le.arg)}var T;F(this,"_invoke",{value:function(N,fe){function Pe(){return new c(function(Le,Be){_(N,fe,Le,Be)})}return T=T?T.then(Pe,Pe):Pe()}})}function f(m,c,_){var T="suspendedStart";return function(W,N){if(T==="executing")throw new Error("Generator is already running");if(T==="completed"){if(W==="throw")throw N;return ge()}for(_.method=W,_.arg=N;;){var fe=_.delegate;if(fe){var Pe=y(fe,_);if(Pe){if(Pe===h)continue;return Pe}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(T==="suspendedStart")throw T="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);T="executing";var Le=u(m,c,_);if(Le.type==="normal"){if(T=_.done?"completed":"suspendedYield",Le.arg===h)continue;return{value:Le.arg,done:_.done}}Le.type==="throw"&&(T="completed",_.method="throw",_.arg=Le.arg)}}}function y(m,c){var _=c.method,T=m.iterator[_];if(T===void 0)return c.delegate=null,_==="throw"&&m.iterator.return&&(c.method="return",c.arg=void 0,y(m,c),c.method==="throw")||_!=="return"&&(c.method="throw",c.arg=new TypeError("The iterator does not provide a '"+_+"' method")),h;var W=u(T,m.iterator,c.arg);if(W.type==="throw")return c.method="throw",c.arg=W.arg,c.delegate=null,h;var N=W.arg;return N?N.done?(c[m.resultName]=N.value,c.next=m.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,h):N:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,h)}function E(m){var c={tryLoc:m[0]};1 in m&&(c.catchLoc=m[1]),2 in m&&(c.finallyLoc=m[2],c.afterLoc=m[3]),this.tryEntries.push(c)}function K(m){var c=m.completion||{};c.type="normal",delete c.arg,m.completion=c}function ee(m){this.tryEntries=[{tryLoc:"root"}],m.forEach(E,this),this.reset(!0)}function G(m){if(m){var c=m[L];if(c)return c.call(m);if(typeof m.next=="function")return m;if(!isNaN(m.length)){var _=-1,T=function W(){for(;++_<m.length;)if(X.call(m,_))return W.value=m[_],W.done=!1,W;return W.value=void 0,W.done=!0,W};return T.next=T}}return{next:ge}}function ge(){return{value:void 0,done:!0}}return b.prototype=S,F(n,"constructor",{value:S,configurable:!0}),F(S,"constructor",{value:b,configurable:!0}),b.displayName=l(S,M,"GeneratorFunction"),A.isGeneratorFunction=function(m){var c=typeof m=="function"&&m.constructor;return!!c&&(c===b||(c.displayName||c.name)==="GeneratorFunction")},A.mark=function(m){return Object.setPrototypeOf?Object.setPrototypeOf(m,S):(m.__proto__=S,l(m,M,"GeneratorFunction")),m.prototype=Object.create(n),m},A.awrap=function(m){return{__await:m}},t(r.prototype),l(r.prototype,B,function(){return this}),A.AsyncIterator=r,A.async=function(m,c,_,T,W){W===void 0&&(W=Promise);var N=new r(i(m,c,_,T),W);return A.isGeneratorFunction(c)?N:N.next().then(function(fe){return fe.done?fe.value:N.next()})},t(n),l(n,M,"Generator"),l(n,L,function(){return this}),l(n,"toString",function(){return"[object Generator]"}),A.keys=function(m){var c=Object(m),_=[];for(var T in c)_.push(T);return _.reverse(),function W(){for(;_.length;){var N=_.pop();if(N in c)return W.value=N,W.done=!1,W}return W.done=!0,W}},A.values=G,ee.prototype={constructor:ee,reset:function(c){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(K),!c)for(var _ in this)_.charAt(0)==="t"&&X.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=void 0)},stop:function(){this.done=!0;var c=this.tryEntries[0].completion;if(c.type==="throw")throw c.arg;return this.rval},dispatchException:function(c){if(this.done)throw c;var _=this;function T(Be,v){return fe.type="throw",fe.arg=c,_.next=Be,v&&(_.method="next",_.arg=void 0),!!v}for(var W=this.tryEntries.length-1;W>=0;--W){var N=this.tryEntries[W],fe=N.completion;if(N.tryLoc==="root")return T("end");if(N.tryLoc<=this.prev){var Pe=X.call(N,"catchLoc"),Le=X.call(N,"finallyLoc");if(Pe&&Le){if(this.prev<N.catchLoc)return T(N.catchLoc,!0);if(this.prev<N.finallyLoc)return T(N.finallyLoc)}else if(Pe){if(this.prev<N.catchLoc)return T(N.catchLoc,!0)}else{if(!Le)throw new Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return T(N.finallyLoc)}}}},abrupt:function(c,_){for(var T=this.tryEntries.length-1;T>=0;--T){var W=this.tryEntries[T];if(W.tryLoc<=this.prev&&X.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var N=W;break}}N&&(c==="break"||c==="continue")&&N.tryLoc<=_&&_<=N.finallyLoc&&(N=null);var fe=N?N.completion:{};return fe.type=c,fe.arg=_,N?(this.method="next",this.next=N.finallyLoc,h):this.complete(fe)},complete:function(c,_){if(c.type==="throw")throw c.arg;return c.type==="break"||c.type==="continue"?this.next=c.arg:c.type==="return"?(this.rval=this.arg=c.arg,this.method="return",this.next="end"):c.type==="normal"&&_&&(this.next=_),h},finish:function(c){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.finallyLoc===c)return this.complete(T.completion,T.afterLoc),K(T),h}},catch:function(c){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc===c){var W=T.completion;if(W.type==="throw"){var N=W.arg;K(T)}return N}}throw new Error("illegal catch attempt")},delegateYield:function(c,_,T){return this.delegate={iterator:G(c),resultName:_,nextLoc:T},this.method==="next"&&(this.arg=void 0),h}},A}var C=Me.a.Option,ve=function(O){var X,F,P,L=O.forumsDetail,B=O.globalSetting,M=O.loading,l=O.dispatch,i=Object(Y.a)(O,["forumsDetail","globalSetting","loading","dispatch"]),u=Object(me.m)(),h=I.a.useForm(),R=Object(ie.a)(h,1),b=R[0],S=Object(k.useState)({}),s=Object(ie.a)(S,2),a=s[0],o=s[1],n=Object(k.useState)(0),t=Object(ie.a)(n,2),r=t[0],f=t[1],y=Object(k.useState)(!1),E=Object(ie.a)(y,2),K=E[0],ee=E[1],G=Object(k.useState)({}),ge=Object(ie.a)(G,2),m=ge[0],c=ge[1],_=Object(k.useState)(1),T=Object(ie.a)(_,2),W=T[0],N=T[1];Object(k.useEffect)(function(){if(fe(),u.memoId)ee(!0),Pe();else{ee(!1);var v={forum_id:5};o(Object(U.a)({},v)),b.setFieldsValue(Object(U.a)({},v))}},[u.memoId]);var fe=function(){var v=Object(oe.a)(se().mark(function J(){var te;return se().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,Object(Z.f)({});case 2:te=le.sent,c(te||{});case 4:case"end":return le.stop()}},J)}));return function(){return v.apply(this,arguments)}}(),Pe=function(){var v=Object(oe.a)(se().mark(function J(){var te,ue,le;return se().wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Object(Z.e)({id:u.memoId});case 2:if(ae.t0=ae.sent,ae.t0){ae.next=5;break}ae.t0={};case 5:ue=ae.t0,le={subject:ue.subject,content:ue.content,attachments:Object(ne.a)(ue.attachments),forum_id:ue.forum_id,memo_tags:(te=ue.memo_tags)===null||te===void 0?void 0:te.map(function(we){return we.id})},o(Object(U.a)({},le)),b.setFieldsValue(Object(U.a)({},le));case 9:case"end":return ae.stop()}},J)}));return function(){return v.apply(this,arguments)}}(),Le=function(){var v=Object(oe.a)(se().mark(function J(te){var ue,le,Ae,ae;return se().wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:if(Ae=Object(U.a)(Object(U.a)({id:K?u.memoId:null},a),{},{attachment_ids:(ue=a.attachments)===null||ue===void 0||((le=ue.filter(function(Se){var Ne;return(Ne=Se.response)===null||Ne===void 0?void 0:Ne.id}))===null||le===void 0)?void 0:le.map(function(Se){var Ne;return(Ne=Se.response)===null||Ne===void 0?void 0:Ne.id}),tags:a.memo_tags}),!K){Re.next=7;break}return Re.next=4,Object(Z.n)(Ae);case 4:Re.t0=Re.sent,Re.next=10;break;case 7:return Re.next=9,Object(Z.j)(Ae);case 9:Re.t0=Re.sent;case 10:ae=Re.t0,f(0),(ae==null?void 0:ae.status)===0&&(de.b.success(ae==null?void 0:ae.message),W===1?w.c.push("/forums/".concat(K?u==null?void 0:u.memoId:ae==null?void 0:ae.memo_id)):w.c.push("/forums/".concat(K?u==null?void 0:u.memoId:ae==null?void 0:ae.memo_id,"/edit")));case 13:case"end":return Re.stop()}},J)}));return function(te){return v.apply(this,arguments)}}(),Be=function(){document.body.scrollIntoView(),window.location.href.includes("new")?w.c.goBack():w.c.push("/forums/".concat(u.memoId))};return g.a.createElement("section",{className:H.a.bg},g.a.createElement("section",{className:"animated fadeIn mb10"},g.a.createElement("aside",{className:"mt10"},g.a.createElement(D.a,{separator:"/"},g.a.createElement(D.a.Item,null,g.a.createElement(re.Link,{to:"/forums"},"\u4EA4\u6D41\u95EE\u7B54")),g.a.createElement(D.a.Item,null,"\u8BE6\u60C5")))),g.a.createElement("aside",{className:"bg-white font16 pt20 pb20 pl20"},K?"\u7F16\u8F91\u8BDD\u9898":"\u53D1\u5E03\u8BDD\u9898"),g.a.createElement(I.a,{form:b,className:H.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(J,te){console.log(te,"values"),o(Object(U.a)(Object(U.a)({},a),J))},onFinish:Le,onFinishFailed:function(){f(0)}},g.a.createElement("div",{className:H.a.fieldWrap},g.a.createElement(I.a.Item,{name:"subject",label:g.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u540D\u79F0: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u540D\u79F0"}]},g.a.createElement(ce.a,{maxLength:50,suffix:"".concat(((X=a.subject)===null||X===void 0?void 0:X.length)||0,"/50")}))),g.a.createElement("div",{className:H.a.mdWrap},g.a.createElement(I.a.Item,{name:"content",label:g.a.createElement("span",{className:"font16"},"\u5185\u5BB9: "),rules:[{required:!0,message:"\u8BF7\u5148\u8F93\u5165\u8BDD\u9898\u5185\u5BB9"}]},g.a.createElement(x.a,{height:600,id:"forums-new-content",watch:!0,defaultValue:a.content})),g.a.createElement("div",null,g.a.createElement(I.a.Item,{name:"attachments",style:{width:350}},g.a.createElement(ne.b,{showRemoveModal:!0})))),g.a.createElement("div",{className:H.a.mdWrap},g.a.createElement(I.a.Item,{name:"forum_id",label:g.a.createElement("span",{className:"font16"},"\u8BDD\u9898\u7C7B\u578B: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u8BDD\u9898\u7C7B\u578B"}]},g.a.createElement(Me.a,{style:{width:300}},m==null||((F=m.forums)===null||F===void 0)?void 0:F.map(function(v){return g.a.createElement(C,{key:v.id,value:v.id},v.name)})))),a.forum_id===5&&g.a.createElement("div",{className:H.a.mdWrap},g.a.createElement(I.a.Item,{name:"memo_tags",label:g.a.createElement("span",{className:"font16"},"\u6280\u672F\u6807\u7B7E: "),rules:[{required:!0,message:"\u8BF7\u5148\u9009\u62E9\u6280\u672F\u6807\u7B7E"}]},g.a.createElement(Me.a,{style:{width:300},placeholder:"\u8BF7\u9009\u62E9\u6280\u672F\u6807\u7B7E",mode:"multiple",tokenSeparators:[";"],filterOption:function(J,te){return te.props.children.toLocaleLowerCase().indexOf(J.toLocaleLowerCase())!=-1}},m==null||((P=m.tag_list)===null||P===void 0)?void 0:P.map(function(v){return g.a.createElement(C,{key:v.id,value:v.id},v.name)})))),g.a.createElement("div",{className:H.a.backgroundFa},g.a.createElement("div",{className:"pt40 mb30"},g.a.createElement(I.a.Item,null,g.a.createElement(pe.a,{size:"large",type:"primary",className:"".concat(H.a.button," mr20"),htmlType:"submit",loading:r===1,onClick:function(){N(1),f(1)}},"\u63D0\u4EA4"),g.a.createElement(pe.a,{size:"large",type:"primary",className:"".concat(H.a.button," mr20"),htmlType:"submit",loading:r===2,onClick:function(){N(2),f(2)}},"\u4FDD\u5B58"),g.a.createElement(pe.a,{size:"large",type:"primary",ghost:!0,className:"".concat(H.a.button," mr20"),onClick:Be},"\u53D6\u6D88"))))))};Q.default=Object(w.a)(function(A){var O=A.forumsDetail,X=A.loading,F=A.globalSetting;return{forumsDetail:O,globalSetting:F,loading:X.models.forumsDetail}})(ve)},HmJG:function(je,Q,e){},M8RZ:function(je,Q,e){"use strict";e.d(Q,"a",function(){return oe});var ye=e("fWQN"),pe=e("mtLc"),Ue=e("yKVA"),ce=e("879j"),Ee=e("q1tI"),D=e.n(Ee),d=e("i8i4"),de=e.n(d),oe=function(U){Object(Ue.a)(I,U);var j=Object(ce.a)(I);function I(ie){var Y;Object(ye.a)(this,I),Y=j.call(this,ie);var be=window.document;return Y.node=be.createElement("div"),be.body.appendChild(Y.node),Y}return Object(pe.a)(I,[{key:"render",value:function(){var Y=this.props.children;return Object(d.createPortal)(Y,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),I}(D.a.Component)},Ot1p:function(je,Q,e){"use strict";var ye=e("2qtc"),pe=e("kLXV"),Ue=e("rAM+"),ce=e("tJVT"),Ee=e("jrin"),D=e("q1tI"),d=e.n(D),de=e("VrN/"),oe=e.n(de),U=e("bdgK"),j=e("p77/"),I=e("Bd2K"),ie=e("ELLl"),Y=e("19Vz"),be=e("lZu9"),Me=e("kSUc"),k=e("9Bee"),g=e("0Owb"),me=e("dejd"),w=e("C+DQ"),re=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function x(v){var J=v.onActionCallback,te=v.title,ue=v.icon,le=v.actionName,Ae=v.className,ae=Ae===void 0?"":Ae,we=v.children;function Re(){J(le)}return d.a.createElement("a",{title:te,className:ae,onClick:Re},d.a.createElement("i",{className:"md-iconfont ".concat(ue)}),we)}var ne=function(v){var J=v.watch,te=v.showNullButton,ue=v.onActionCallback,le=v.fullScreen,Ae=[].concat(re,[{title:"".concat(J?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(J?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},Ae.map(function(ae,we){return d.a.createElement("li",{key:we},ae.actionName?d.a.createElement(x,Object(g.a)({},ae,{onActionCallback:ue})):d.a.createElement("span",{className:"v-line"}))}),te?d.a.createElement("li",null,d.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ue},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(x,{icon:"".concat(le?"icon-shrink":"icon-enlarge"),title:le?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ue})))},Z=e("M8RZ"),q=e("+L6B"),H=e("2/Rp"),se=e("y8nQ"),C=e("Vl3Y"),ve=e("5NDa"),A=e("5rEg"),O={labelCol:{span:4},wrapperCol:{span:20}},X=function(v){var J=v.callback,te=v.onCancel;function ue(le){J(le)}return d.a.createElement(C.a,Object(g.a)({},O,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ue}),d.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(A.a,null)),d.a.createElement(C.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(A.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(H.a,{type:"ghost",onClick:te},"\u53D6\u6D88")))},F=e("7ahc"),P=e("HmJG"),L=e("BjJ7"),B=C.a.useForm,M={width:280,marginRight:10},l={labelCol:{span:5},wrapperCol:{span:19}},i=function(v){var J=v.callback,te=v.onCancel,ue=B(),le=Object(ce.a)(ue,1),Ae=le[0];function ae(Se){J(Se)}function we(Se){Ae.setFieldsValue({src:"/api/attachments/".concat(Se.id)})}function Re(Se){var Ne=Se.target.files[0];h(Ne,we)}return d.a.createElement(C.a,Object(g.a)({form:Ae},l,{className:"upload-image-panel",onFinish:ae}),d.a.createElement(C.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(C.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(A.a,{style:M})),d.a.createElement(u,{onFileChange:Re}))),d.a.createElement(C.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},d.a.createElement(A.a,{style:{width:264}})),d.a.createElement(C.a.Item,{style:{textAlign:"right"}},d.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(H.a,{type:"ghost",onClick:te},"\u53D6\u6D88")))};function u(v){var J=v.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",accept:"image/*",onChange:J}))}function h(v,J){if(!v)throw new String("\u6CA1\u6709\u6587\u4EF6");var te=new FormData;te.append("editormd-image-file",v),te.append("file_param_name","editormd-image-file"),te.append("byxhr","true");var ue=new window.XMLHttpRequest;ue.withCredentials=!0,ue.addEventListener("load",function(le){J(JSON.parse(le.target.responseText))},!1),ue.addEventListener("error",function(le){console.error(le)},!1),ue.open("POST","".concat(L.a,"/api/attachments.json")),ue.send(te)}var R=e("giR+"),b=e("fyUT"),S=e("7Kak"),s=e("9yH6"),a=s.a.Group,o={margin:"0 8px"},n=function(v){var J=v.callback,te=v.onCancel;function ue(le){J(le)}return d.a.createElement(C.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ue},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:o},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:o},"\u884C\u6570"),d.a.createElement(C.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(b.a,null)),d.a.createElement("span",{style:o},"\u5217\u6570"),d.a.createElement(C.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(b.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:o},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(C.a.Item,{name:"align"},d.a.createElement(a,null,d.a.createElement(s.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(s.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(s.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(s.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(H.a,{type:"ghost",onClick:te},"\u53D6\u6D88")))},t="link",r="upload-image",f="code-block",y="add-table",E="------------",K={default:E,left:":".concat(E),center:":".concat(E,":"),right:"".concat(E,":")},ee=e("9VGf"),G,ge;function m(){}var c=0,_=1e4,T="\u2581";function W(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}var N=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=N?"Cmd":"Ctrl",Pe=(G={},Object(Ee.a)(G,fe+"-B","bold"),Object(Ee.a)(G,fe+"-I","italic"),G),Le=(ge={},Object(Ee.a)(ge,t,"\u6DFB\u52A0\u94FE\u63A5"),Object(Ee.a)(ge,f,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(Ee.a)(ge,r,"\u6DFB\u52A0\u56FE\u7247"),Object(Ee.a)(ge,y,"\u6DFB\u52A0\u8868\u683C"),ge),Be=Q.a=function(v){var J=v.defaultValue,te=J===void 0?"":J,ue=v.onChange,le=v.width,Ae=le===void 0?"100%":le,ae=v.height,we=ae===void 0?400:ae,Re=v.miniToolbar,Se=Re===void 0?!1:Re,Ne=v.isFocus,st=Ne===void 0?!1:Ne,qe=v.watch,lt=v.id,$e=lt===void 0?"markdown-editor-id":lt,ct=v.showResizeBar,wt=ct===void 0?!1:ct,dt=v.noStorage,St=dt===void 0?!1:dt,mt=v.showNullButton,Nt=mt===void 0?!1:mt,ft=v.fullScreen,Xe=ft===void 0?!1:ft,et=v.onBlur,tt=v.onCMBeforeChange,_t=v.className,It=_t===void 0?"":_t,ht=v.placeholder,Bt=ht===void 0?"":ht,pt=v.values,rt=pt===void 0?"":pt,Wt=Object(D.useState)(null),Et=Object(ce.a)(Wt,2),p=Et[0],xt=Et[1],Ft=Object(D.useState)(te),vt=Object(ce.a)(Ft,2),nt=vt[0],He=vt[1],Kt=Object(D.useState)(qe),yt=Object(ce.a)(Kt,2),We=yt[0],gt=yt[1],kt=Object(D.useState)(Xe),Ot=Object(ce.a)(kt,2),xe=Ot[0],bt=Ot[1],Gt=Object(D.useState)(""),Pt=Object(ce.a)(Gt,2),Fe=Pt[0],Ke=Pt[1],zt=Object(D.useState)(0),Lt=Object(ce.a)(zt,2),ke=Lt[0],at=Lt[1],Vt=Object(D.useState)(we),Rt=Object(ce.a)(Vt,2),ot=Rt[0],Ut=Rt[1],$t=Object(D.useState)(!1),Dt=Object(ce.a)($t,2),Qt=Dt[0],it=Dt[1],Ge=Object(D.useRef)(),ze=Object(D.useRef)(),Ye=Object(D.useRef)(),Je=Object(D.useRef)();Object(D.useEffect)(function(){He(rt),p==null||p.setValue(rt)},[rt]),Object(D.useEffect)(function(){if(Ge.current){var z=function(_e,he){var Oe=he.clipboardData;if(Oe){var De=Oe.types.toString(),Te=Oe.items;if(De==="text/html,Files"||De==="Files"){var Ce=Te[1];De==="Files"&&(Ce=Te[0]),Ce.kind==="file"&&Ce.type.match(/^image\//i)&&h(Ce.getAsFile(),function(Ie){Ie.id?V.replaceSelection("")):(Ie==null?void 0:Ie.status)===401&&(document.location.href="/user/login")})}else return!0}return!0},V=oe.a.fromTextArea(Ge.current,{mode:"markdown",inputStyle:"contenteditable",lineNumbers:!Se,lineWrapping:!0,value:te,autoCloseTags:!0,autoCloseBrackets:!0});return V.on("paste",z),xt(V),function(){V.off("paste",z)}}},[]);var Ct=Object(D.useCallback)(function(){if(ze.current)try{var z=ze.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,V=ze.current.getElementsByClassName("markdown-editor-body")[0];xe?V.style.height="calc(100vh - ".concat(z,"px)"):V.style.height="".concat(ot-z,"px")}catch($){console.log($,"---- to set md editor body height")}},[ot,ze,xe]);Object(D.useEffect)(function(){function z(){var $=new U.default(function(_e){var he=Object(Ue.a)(_e),Oe;try{for(he.s();!(Oe=he.n()).done;){var De=Oe.value;(De.target.offsetHeight>0||De.target.offsetWidth>0)&&(Ct(),p.setSize("100%","100%"),p.refresh())}}catch(Te){he.e(Te)}finally{he.f()}});return $.observe(Ge.current.parentElement),$}if(p){var V=z();return function(){V.unobserve(Ge.current.parentElement)}}},[p,Ct]),Object(D.useEffect)(function(){if(p){for(var z=[],V=function(){var De=_e[$];he=Object(ce.a)(De,2);var Te=he[0],Ce=he[1],Ie=Object(Ee.a)({},Te,function(){Mt(Ce)});z.push(Ie),p.addKeyMap(Ie)},$=0,_e=Object.entries(Pe);$<_e.length;$++){var he;V()}return function(){var Oe=Object(Ue.a)(z),De;try{for(Oe.s();!(De=Oe.n()).done;){var Te=De.value;p.removeKeyMap(Te)}}catch(Ce){Oe.e(Ce)}finally{Oe.f()}}}},[p]),Object(D.useEffect)(function(){Xe!==xe&&bt(Xe)},[Xe]),Object(ee.a)(function(){if(!St&&ke>0){var z=new Date().getTime(),V=window.sessionStorage.getItem($e);z>=ke+_&&(!V||V!==nt)&&(window.sessionStorage.setItem($e,nt),it(!0))}},_),Object(D.useEffect)(function(){gt(qe)},[p,qe]),Object(D.useEffect)(function(){p&&(st&&p.focus())},[p,st]),Object(D.useEffect)(function(){if(We&&p){var z=function(_e){var he=_e.target;if(Je.current){var Oe=he.scrollTop/he.scrollHeight;Je.current.scrollTop=Je.current.scrollHeight*Oe}},V=p.getScrollerElement();return V.addEventListener("scroll",z),function(){V.removeEventListener("scroll",z)}}},[p,We]),Object(D.useEffect)(function(){if(p&&tt){var z=function($,_e){tt($,_e)};return p.on("beforeChange",z),function(){p.off("beforeChange",z)}}},[p,tt]),Object(D.useEffect)(function(){if(p&&et){var z=function(){et(p.getValue())};return p.on("blur",z),function(){p.off("blur",z)}}},[p,et]),Object(D.useEffect)(function(){if(p){var z=function($){var _e=$.getValue();He(_e),at(new Date().getTime()),$.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ue&&ue(_e)};return p.on("change",z),function(){p.off("change",z)}}},[p,ue]),Object(D.useEffect)(function(){p&&(te==null?(p.setValue(""),He("")):te!==p.getValue()&&(p.setValue(te),He(te)))},[p,te]);var Mt=Object(D.useCallback)(function(z){var V=p.getCursor(),$=p.getSelection(),_e=$.split(`
|
|
`);switch(z){case"bold":return p.replaceSelection("**"+$+"**"),$===""&&p.setCursor(V.line,V.ch+2),p.focus();case"italic":return p.replaceSelection("*"+$+"*"),$===""&&p.setCursor(V.line,V.ch+1),p.focus();case"code":return p.replaceSelection("`"+$+"`"),$===""&&p.setCursor(V.line,V.ch+1),p.focus();case"inline-latex":return p.replaceSelection("`$$"+$+"$$`"),$===""&&p.setCursor(V.line,V.ch+3),p.focus();case"latex":return p.replaceSelection("```latex\n"+$+"\n```"),p.setCursor(V.line+1,$.length+1),p.focus();case"line-break":return p.replaceSelection(`<br/>
|
|
`),p.focus();case"list-ul":return $===""?p.replaceSelection("- "+$):p.replaceSelection(_e.map(function(he){return he===""?"":"- ".concat(he)}).join(`
|
|
`)),p.focus();case"list-ol":return $===""?p.replaceSelection("1. "+$):p.replaceSelection(_e.map(function(he,Oe){return he===""?"":"".concat(Oe+1,". ").concat(he)}).join(`
|
|
`)),p.focus();case"add-null-ch":return $===""&&p.setCursor(V.line,V.ch+1),p.replaceSelection(T),p.focus();case"eraser":return p.setValue(""),p.focus();case"trigger-watch":return gt(!We),p.focus();case"trigger-full-screen":return bt(!xe),p.focus();case t:Ke(t);return;case f:Ke(f);return;case r:Ke(r);return;case y:Ke(y);return;default:throw new Error}},[p,We,xe]),Qe=Object(D.useCallback)(function(z){Ke("");switch(Fe){case t:var V=z.title,$=z.link;return p.replaceSelection("[".concat(V,"](").concat($,")")),p.focus();case f:var _e=z.language,he=z.content;return p.replaceSelection(["```"+_e,he,"```"].join(`
|
|
`)),p.focus();case r:var Oe=z.src,De=z.alt;return p.replaceSelection(".concat(Oe,' "').concat(De,'" )')),p.focus();case y:for(var Te=z.row,Ce=z.col,Ie=z.align,ut=`
|
|
`,Ze=0;Ze<Te;Ze++){for(var jt=[],At=[],Tt=0;Tt<Ce;Tt++)Ze===1&&At.push(K[Ie]),jt.push(" ");Ze===1&&(ut+="| ".concat(At.join(" | "),` |
|
|
`)),ut+="| ".concat(jt.join(Ce===1?"":" | "),` |
|
|
`)}return p.replaceSelection(ut+`
|
|
`),p.focus();default:throw new Error}},[p,Fe]),Xt=Object(D.useMemo)(function(){switch(Fe){case t:return d.a.createElement(X,{callback:Qe,onCancel:Ve});case f:return d.a.createElement(F.b,{callback:Qe,onCancel:Ve});case r:return d.a.createElement(i,{callback:Qe,onCancel:Ve});case y:return d.a.createElement(n,{callback:Qe,onCancel:Ve});default:return null}},[Fe]);function Ve(){Ke("")}Object(D.useEffect)(function(){if(Ye.current){var z=function(Te){he=!0,Oe=Te.pageY},V=function(){he=!1},$=function(Te){if(he){var Ce=Te.pageY-Oe;Ce<0&&(Ce=0),Ce>300&&(Ce=300);var Ie=we+Ce+"px";Ut(Ie)}},_e=Ye.current,he=!1,Oe=0;return _e.addEventListener("mousedown",z),document.addEventListener("mousemove",$),document.addEventListener("mouseup",V),function(){_e.removeEventListener("mousedown",z),document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",V)}}},[p,Ye]),Object(D.useEffect)(function(){Ut(we)},[we]);var Ht=W(Ae),Yt=W(ot),Jt={width:Ht,height:Yt},Zt=Object(D.useMemo)(function(){if(ke){var z=new Date(ke),V=z.getHours(),$=z.getMinutes(),_e=z.getSeconds();return V=V<10?"0"+V:V,$=$<10?"0"+$:$,_e=_e<10?"0"+_e:_e,"".concat(V,":").concat($,":").concat(_e)}return 0},[ke]);function qt(){window.sessionStorage.removeItem($e),it(!1),at(0)}function er(){it(!1),at(0),p.setValue(window.sessionStorage.getItem($e))}return d.a.createElement(D.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:ze},d.a.createElement("div",{className:"markdown-editor-container ".concat(It," ").concat(We?"on-preview":""," ").concat(Se?"mini":""," ").concat(xe?"full-screen":""),style:Jt},d.a.createElement(ne,{watch:We,fullScreen:xe,showNullButton:Nt,onActionCallback:Mt}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Ge,placeholder:Bt})),We?d.a.createElement("div",{ref:Je,className:"preview-container"},d.a.createElement(k.a,{value:nt})):null))),wt?d.a.createElement("a",{ref:Ye,className:"editor-resize"}):null,d.a.createElement(Z.a,null,Le[Fe]?d.a.createElement(pe.a,{centered:!0,title:Le[Fe],visible:!0,onCancel:Ve,footer:null},Xt):null))}},dejd:function(je,Q,e){},kSUc:function(je,Q,e){},wzkS:function(je,Q,e){"use strict";e.d(Q,"c",function(){return ce}),e.d(Q,"b",function(){return Ee}),e.d(Q,"d",function(){return D}),e.d(Q,"a",function(){return de}),e.d(Q,"e",function(){return oe});var ye=e("9og8"),pe=e("ErOA");function Ue(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ue=function(){return U};var U={},j=Object.prototype,I=j.hasOwnProperty,ie=Object.defineProperty||function(l,i,u){l[i]=u.value},Y=typeof Symbol=="function"?Symbol:{},be=Y.iterator||"@@iterator",Me=Y.asyncIterator||"@@asyncIterator",k=Y.toStringTag||"@@toStringTag";function g(l,i,u){return Object.defineProperty(l,i,{value:u,enumerable:!0,configurable:!0,writable:!0}),l[i]}try{g({},"")}catch(l){g=function(u,h,R){return u[h]=R}}function me(l,i,u,h){var R=i&&i.prototype instanceof x?i:x,b=Object.create(R.prototype),S=new L(h||[]);return ie(b,"_invoke",{value:O(l,u,S)}),b}function w(l,i,u){try{return{type:"normal",arg:l.call(i,u)}}catch(h){return{type:"throw",arg:h}}}U.wrap=me;var re={};function x(){}function ne(){}function Z(){}var q={};g(q,be,function(){return this});var H=Object.getPrototypeOf,se=H&&H(H(B([])));se&&se!==j&&I.call(se,be)&&(q=se);var C=Z.prototype=x.prototype=Object.create(q);function ve(l){["next","throw","return"].forEach(function(i){g(l,i,function(u){return this._invoke(i,u)})})}function A(l,i){function u(R,b,S,s){var a=w(l[R],l,b);if(a.type!=="throw"){var o=a.arg,n=o.value;return n&&typeof n=="object"&&I.call(n,"__await")?i.resolve(n.__await).then(function(t){u("next",t,S,s)},function(t){u("throw",t,S,s)}):i.resolve(n).then(function(t){o.value=t,S(o)},function(t){return u("throw",t,S,s)})}s(a.arg)}var h;ie(this,"_invoke",{value:function(b,S){function s(){return new i(function(a,o){u(b,S,a,o)})}return h=h?h.then(s,s):s()}})}function O(l,i,u){var h="suspendedStart";return function(R,b){if(h==="executing")throw new Error("Generator is already running");if(h==="completed"){if(R==="throw")throw b;return M()}for(u.method=R,u.arg=b;;){var S=u.delegate;if(S){var s=X(S,u);if(s){if(s===re)continue;return s}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(h==="suspendedStart")throw h="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);h="executing";var a=w(l,i,u);if(a.type==="normal"){if(h=u.done?"completed":"suspendedYield",a.arg===re)continue;return{value:a.arg,done:u.done}}a.type==="throw"&&(h="completed",u.method="throw",u.arg=a.arg)}}}function X(l,i){var u=i.method,h=l.iterator[u];if(h===void 0)return i.delegate=null,u==="throw"&&l.iterator.return&&(i.method="return",i.arg=void 0,X(l,i),i.method==="throw")||u!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+u+"' method")),re;var R=w(h,l.iterator,i.arg);if(R.type==="throw")return i.method="throw",i.arg=R.arg,i.delegate=null,re;var b=R.arg;return b?b.done?(i[l.resultName]=b.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=void 0),i.delegate=null,re):b:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,re)}function F(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i)}function P(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i}function L(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(F,this),this.reset(!0)}function B(l){if(l){var i=l[be];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var u=-1,h=function R(){for(;++u<l.length;)if(I.call(l,u))return R.value=l[u],R.done=!1,R;return R.value=void 0,R.done=!0,R};return h.next=h}}return{next:M}}function M(){return{value:void 0,done:!0}}return ne.prototype=Z,ie(C,"constructor",{value:Z,configurable:!0}),ie(Z,"constructor",{value:ne,configurable:!0}),ne.displayName=g(Z,k,"GeneratorFunction"),U.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return!!i&&(i===ne||(i.displayName||i.name)==="GeneratorFunction")},U.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,Z):(l.__proto__=Z,g(l,k,"GeneratorFunction")),l.prototype=Object.create(C),l},U.awrap=function(l){return{__await:l}},ve(A.prototype),g(A.prototype,Me,function(){return this}),U.AsyncIterator=A,U.async=function(l,i,u,h,R){R===void 0&&(R=Promise);var b=new A(me(l,i,u,h),R);return U.isGeneratorFunction(i)?b:b.next().then(function(S){return S.done?S.value:b.next()})},ve(C),g(C,k,"Generator"),g(C,be,function(){return this}),g(C,"toString",function(){return"[object Generator]"}),U.keys=function(l){var i=Object(l),u=[];for(var h in i)u.push(h);return u.reverse(),function R(){for(;u.length;){var b=u.pop();if(b in i)return R.value=b,R.done=!1,R}return R.done=!0,R}},U.values=B,L.prototype={constructor:L,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!i)for(var u in this)u.charAt(0)==="t"&&I.call(this,u)&&!isNaN(+u.slice(1))&&(this[u]=void 0)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var u=this;function h(o,n){return S.type="throw",S.arg=i,u.next=o,n&&(u.method="next",u.arg=void 0),!!n}for(var R=this.tryEntries.length-1;R>=0;--R){var b=this.tryEntries[R],S=b.completion;if(b.tryLoc==="root")return h("end");if(b.tryLoc<=this.prev){var s=I.call(b,"catchLoc"),a=I.call(b,"finallyLoc");if(s&&a){if(this.prev<b.catchLoc)return h(b.catchLoc,!0);if(this.prev<b.finallyLoc)return h(b.finallyLoc)}else if(s){if(this.prev<b.catchLoc)return h(b.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return h(b.finallyLoc)}}}},abrupt:function(i,u){for(var h=this.tryEntries.length-1;h>=0;--h){var R=this.tryEntries[h];if(R.tryLoc<=this.prev&&I.call(R,"finallyLoc")&&this.prev<R.finallyLoc){var b=R;break}}b&&(i==="break"||i==="continue")&&b.tryLoc<=u&&u<=b.finallyLoc&&(b=null);var S=b?b.completion:{};return S.type=i,S.arg=u,b?(this.method="next",this.next=b.finallyLoc,re):this.complete(S)},complete:function(i,u){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&u&&(this.next=u),re},finish:function(i){for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u];if(h.finallyLoc===i)return this.complete(h.completion,h.afterLoc),P(h),re}},catch:function(i){for(var u=this.tryEntries.length-1;u>=0;--u){var h=this.tryEntries[u];if(h.tryLoc===i){var R=h.completion;if(R.type==="throw"){var b=R.arg;P(h)}return b}}throw new Error("illegal catch attempt")},delegateYield:function(i,u,h){return this.delegate={iterator:B(i),resultName:u,nextLoc:h},this.method==="next"&&(this.arg=void 0),re}},U}function ce(U){return Object(pe.c)("libraries/".concat(U,".json"))}function Ee(){return Object(pe.c)("library_tags.json")}function D(U){return d.apply(this,arguments)}function d(){return d=Object(ye.a)(Ue().mark(function U(j){var I;return Ue().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(pe.b)("attachments/".concat(j,".json"));case 2:return I=Y.sent,Y.abrupt("return",I.status===0);case 4:case"end":return Y.stop()}},U)})),d.apply(this,arguments)}function de(U){return Object(pe.f)("libraries.json",U)}function oe(U,j){return Object(pe.g)("libraries/".concat(U,".json"),j)}},y5JW:function(je,Q,e){"use strict";e.d(Q,"c",function(){return be}),e.d(Q,"a",function(){return Me});var ye=e("DZo9"),pe=e("8z0m"),Ue=e("+L6B"),ce=e("2/Rp"),Ee=e("9og8"),D=e("k1fw"),d=e("oBTY"),de=e("miYZ"),oe=e("tsqr"),U=e("q1tI"),j=e.n(U),I=e("m3rI"),ie=e("wzkS");function Y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return k};var k={},g=Object.prototype,me=g.hasOwnProperty,w=Object.defineProperty||function(s,a,o){s[a]=o.value},re=typeof Symbol=="function"?Symbol:{},x=re.iterator||"@@iterator",ne=re.asyncIterator||"@@asyncIterator",Z=re.toStringTag||"@@toStringTag";function q(s,a,o){return Object.defineProperty(s,a,{value:o,enumerable:!0,configurable:!0,writable:!0}),s[a]}try{q({},"")}catch(s){q=function(o,n,t){return o[n]=t}}function H(s,a,o,n){var t=a&&a.prototype instanceof ve?a:ve,r=Object.create(t.prototype),f=new R(n||[]);return w(r,"_invoke",{value:l(s,o,f)}),r}function se(s,a,o){try{return{type:"normal",arg:s.call(a,o)}}catch(n){return{type:"throw",arg:n}}}k.wrap=H;var C={};function ve(){}function A(){}function O(){}var X={};q(X,x,function(){return this});var F=Object.getPrototypeOf,P=F&&F(F(b([])));P&&P!==g&&me.call(P,x)&&(X=P);var L=O.prototype=ve.prototype=Object.create(X);function B(s){["next","throw","return"].forEach(function(a){q(s,a,function(o){return this._invoke(a,o)})})}function M(s,a){function o(t,r,f,y){var E=se(s[t],s,r);if(E.type!=="throw"){var K=E.arg,ee=K.value;return ee&&typeof ee=="object"&&me.call(ee,"__await")?a.resolve(ee.__await).then(function(G){o("next",G,f,y)},function(G){o("throw",G,f,y)}):a.resolve(ee).then(function(G){K.value=G,f(K)},function(G){return o("throw",G,f,y)})}y(E.arg)}var n;w(this,"_invoke",{value:function(r,f){function y(){return new a(function(E,K){o(r,f,E,K)})}return n=n?n.then(y,y):y()}})}function l(s,a,o){var n="suspendedStart";return function(t,r){if(n==="executing")throw new Error("Generator is already running");if(n==="completed"){if(t==="throw")throw r;return S()}for(o.method=t,o.arg=r;;){var f=o.delegate;if(f){var y=i(f,o);if(y){if(y===C)continue;return y}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(n==="suspendedStart")throw n="completed",o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);n="executing";var E=se(s,a,o);if(E.type==="normal"){if(n=o.done?"completed":"suspendedYield",E.arg===C)continue;return{value:E.arg,done:o.done}}E.type==="throw"&&(n="completed",o.method="throw",o.arg=E.arg)}}}function i(s,a){var o=a.method,n=s.iterator[o];if(n===void 0)return a.delegate=null,o==="throw"&&s.iterator.return&&(a.method="return",a.arg=void 0,i(s,a),a.method==="throw")||o!=="return"&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+o+"' method")),C;var t=se(n,s.iterator,a.arg);if(t.type==="throw")return a.method="throw",a.arg=t.arg,a.delegate=null,C;var r=t.arg;return r?r.done?(a[s.resultName]=r.value,a.next=s.nextLoc,a.method!=="return"&&(a.method="next",a.arg=void 0),a.delegate=null,C):r:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,C)}function u(s){var a={tryLoc:s[0]};1 in s&&(a.catchLoc=s[1]),2 in s&&(a.finallyLoc=s[2],a.afterLoc=s[3]),this.tryEntries.push(a)}function h(s){var a=s.completion||{};a.type="normal",delete a.arg,s.completion=a}function R(s){this.tryEntries=[{tryLoc:"root"}],s.forEach(u,this),this.reset(!0)}function b(s){if(s){var a=s[x];if(a)return a.call(s);if(typeof s.next=="function")return s;if(!isNaN(s.length)){var o=-1,n=function t(){for(;++o<s.length;)if(me.call(s,o))return t.value=s[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return A.prototype=O,w(L,"constructor",{value:O,configurable:!0}),w(O,"constructor",{value:A,configurable:!0}),A.displayName=q(O,Z,"GeneratorFunction"),k.isGeneratorFunction=function(s){var a=typeof s=="function"&&s.constructor;return!!a&&(a===A||(a.displayName||a.name)==="GeneratorFunction")},k.mark=function(s){return Object.setPrototypeOf?Object.setPrototypeOf(s,O):(s.__proto__=O,q(s,Z,"GeneratorFunction")),s.prototype=Object.create(L),s},k.awrap=function(s){return{__await:s}},B(M.prototype),q(M.prototype,ne,function(){return this}),k.AsyncIterator=M,k.async=function(s,a,o,n,t){t===void 0&&(t=Promise);var r=new M(H(s,a,o,n),t);return k.isGeneratorFunction(a)?r:r.next().then(function(f){return f.done?f.value:r.next()})},B(L),q(L,Z,"Generator"),q(L,x,function(){return this}),q(L,"toString",function(){return"[object Generator]"}),k.keys=function(s){var a=Object(s),o=[];for(var n in a)o.push(n);return o.reverse(),function t(){for(;o.length;){var r=o.pop();if(r in a)return t.value=r,t.done=!1,t}return t.done=!0,t}},k.values=b,R.prototype={constructor:R,reset:function(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(h),!a)for(var o in this)o.charAt(0)==="t"&&me.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=void 0)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if(a.type==="throw")throw a.arg;return this.rval},dispatchException:function(a){if(this.done)throw a;var o=this;function n(K,ee){return f.type="throw",f.arg=a,o.next=K,ee&&(o.method="next",o.arg=void 0),!!ee}for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t],f=r.completion;if(r.tryLoc==="root")return n("end");if(r.tryLoc<=this.prev){var y=me.call(r,"catchLoc"),E=me.call(r,"finallyLoc");if(y&&E){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(y){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(a,o){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc<=this.prev&&me.call(t,"finallyLoc")&&this.prev<t.finallyLoc){var r=t;break}}r&&(a==="break"||a==="continue")&&r.tryLoc<=o&&o<=r.finallyLoc&&(r=null);var f=r?r.completion:{};return f.type=a,f.arg=o,r?(this.method="next",this.next=r.finallyLoc,C):this.complete(f)},complete:function(a,o){if(a.type==="throw")throw a.arg;return a.type==="break"||a.type==="continue"?this.next=a.arg:a.type==="return"?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):a.type==="normal"&&o&&(this.next=o),C},finish:function(a){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.finallyLoc===a)return this.complete(n.completion,n.afterLoc),h(n),C}},catch:function(a){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc===a){var t=n.completion;if(t.type==="throw"){var r=t.arg;h(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(a,o,n){return this.delegate={iterator:b(a),resultName:o,nextLoc:n},this.method==="next"&&(this.arg=void 0),C}},k}var be="\u3000\u3000";function Me(k){var g=["Bytes","KB","MB","GB","TB"];if(k==0)return"0 Byte";var me=parseInt(""+Math.floor(Math.log(k)/Math.log(1024)),10);return(k/Math.pow(1024,me)).toFixed(1)+" "+g[me]}Q.b=function(k){var g=k.value,me=g===void 0?[]:g,w=k.onChange,re=k.className,x=k.maxSize,ne=x===void 0?150:x,Z=k.title,q=Z===void 0?"\u6587\u4EF6\u4E0A\u4F20":Z,H=k.accept,se=H===void 0?null:H,C={multiple:!1,fileList:me,accept:se,withCredentials:!0,beforeUpload:function(O){O.newname=encodeURIComponent(O.name);var X=O.size/1024/1024;return X<ne?!0:(oe.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(ne,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),!1)},data:function(O){return O.newfilename=encodeURIComponent(O.name),O},action:"".concat(I.a.API_SERVER,"/api/attachments.json"),onChange:function(O){var X=Object(d.a)(O.fileList);X=X.map(function(F){return F.name.indexOf(be)===-1&&(F.name="".concat(F.name).concat(be).concat(Me(F.size))),Object(D.a)({},F)}),w(X)},onRemove:function(){var A=Object(Ee.a)(Y().mark(function X(F){var P,L;return Y().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(P=F.response?F.response.id:F.uid,!P){M.next=8;break}return M.next=4,Object(ie.d)(F.response?F.response.id:F.id);case 4:return L=M.sent,M.abrupt("return",L);case 8:return M.abrupt("return",!0);case 9:case"end":return M.stop()}},X)}));function O(X){return A.apply(this,arguments)}return O}()};function ve(A){A.preventDefault(),A.stopPropagation()}return j.a.createElement("div",{className:"single-upload ".concat(re||"")},j.a.createElement(pe.a,C,j.a.createElement(ce.a,{type:"primary",title:me.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:me.length>0,ghost:!0},q),j.a.createElement("span",{onClick:ve,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",ne,"M) ")))}}}]);
|