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.
NewEduCoderBuild/p__HttpStatus__hpcCourse.4e...

14 lines
52 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[122,10],{"7ahc":function(je,J,i){"use strict";i.d(J,"a",function(){return Be});var le=i("k1fw"),Le=i("0Owb"),Se=i("+L6B"),K=i("2/Rp"),oe=i("y8nQ"),E=i("Vl3Y"),s=i("tJVT"),x=i("OaEy"),T=i("2fM7"),_=i("q1tI"),w=i.n(_),H=i("VrN/"),pe=i.n(H),ne=i("p77/"),_e=i.n(ne),Ve=i("c5Ni"),Je=i.n(Ve),De=T.a.Option,Ie={labelCol:{span:4},wrapperCol:{span:20}},we={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"]};J.b=function(Ee){var ge=Ee.callback,Ne=Ee.onCancel,Me=Object(_.useState)("python"),ue=Object(s.a)(Me,2),Xe=ue[0],q=ue[1];function h(v){q(we[v][1])}function S(v){ge(v)}return w.a.createElement(E.a,Object(Le.a)({},Ie,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),w.a.createElement(E.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},w.a.createElement(T.a,{onChange:h},Object.keys(we).map(function(v){return w.a.createElement(De,{key:v,value:v},we[v][0])}))),w.a.createElement(E.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},w.a.createElement(Be,{mode:Xe})),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(K.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function Be(Ee){var ge=Ee.value,Ne=Ee.onChange,Me=Ee.mode,ue=Ee.options,Xe=ue===void 0?{}:ue,q=Object(_.useRef)(),h=Object(_.useState)(),S=Object(s.a)(h,2),v=S[0],B=S[1];return Object(_.useEffect)(function(){if(v){var G=function(f){var d=f.getValue();Ne&&Ne(d)};return v.on("change",G),function(){v.off("change",G)}}},[v,Ne]),Object(_.useEffect)(function(){v&&v.setOption("mode",Me)},[v,Me]),Object(_.useEffect)(function(){v&&((ge!==v.getValue()||ge==="")&&setTimeout(function(){v.setValue(ge||" ")},300))},[v,ge]),Object(_.useEffect)(function(){if(q.current&&!v){var G=pe.a.fromTextArea(q.current,Object(le.a)({mode:Me,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Xe));B(G)}},[q.current,v]),w.a.createElement("div",{className:"my-codemirror-container"},w.a.createElement("textarea",{ref:q}))}},"9Bee":function(je,J,i){"use strict";var le=i("q1tI"),Le=i.n(le),Se=i("vg9a"),K=i("tJVT"),oe=i("DlQD"),E=i.n(oe),s=i("rUJ1");function x(y,f){var d=y.match(/^(\s+)(?:```)/);if(d===null)return f;var b=d[1];return f.split(`
`).map(function(N){var l=N.match(/^\s+/);if(l===null)return N;var k=Object(K.a)(l,1),X=k[0];return X.length>=b.length?N.slice(b.length):N}).join(`
`)}var T=[],_=["<ul>"],w=new E.a.Renderer,H=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function pe(){T.length=0,_=["<ul>"]}function ne(y,f,d,b){if(f>=y.length||y[f].level<=d)return f;var N=y[f];b.push("<li><a href='#"+N.anchor+"'>"+N.text+"</a>"),f++;var l=[];return f=ne(y,f,N.level,l),l.length>0&&(b.push("<ul>"),l.forEach(function(k){b.push(k)}),b.push("</ul>")),b.push("</li>"),f=ne(y,f,d,b),f}function _e(){return ne(T,0,0,_),_.push("</ul>"),_.join("")}var Ve={heading:function(f){var d=H.exec(f);if(d)return{type:"heading",raw:d[0],depth:d[1].length,text:d[2]}},fences:function(f){var d=this.rules.block.fences.exec(f);if(d){var b=d[0],N=x(b,d[3]||""),l=d[2]?d[2].trim():d[2];if(["latex","katex","math"].indexOf(l)>=0){var k=Ie(),X=N;N=k,we[k]={type:"block",expression:X}}return{type:"code",raw:b,lang:l,text:N}}}},Je=/(?:\${2})([^\n`]+?)(?:\${2})/gi,De=0,Ie=function(){return"__special_katext_id_".concat(De++,"__")},we={};function Be(){return we}function Ee(){De=0,we={}}function ge(y){return y=y.replace(Je,function(f,d){var b=Ie();return we[b]={type:"inline",expression:d},b}),y}var Ne=w.listitem;w.listitem=function(y){return Ne(ge(y))};var Me=w.paragraph;w.paragraph=function(y){return Me(ge(y))};var ue=w.tablecell;w.tablecell=function(y,f){return ue(ge(y),f)},w.code=function(y,f,d){var b=(f||"").match(/\S*/)[0];return b?["latex","katex","math"].indexOf(b)>=0?"<p class='editormd-tex'>".concat(y,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(f,'">').concat(d?y:Object(s.escape)(y,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(d?y:Object(s.escape)(y,!0))+"</code></pre>"},w.heading=function(y,f,d){var b=this.options.headerPrefix+d.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return T.push({anchor:b,level:f,text:y}),"<h"+f+' id="'+b+'">'+y+"</h"+f+">"},E.a.setOptions({silent:!0,smartypants:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:Ve,renderer:w});var Xe=E.a,q=i("SJMd"),h=i("m3rI"),S=i("Oy/b"),v=/<pre[^>]*>/g;function B(y){var f=document.createElement("div");return f.innerHTML=y,f.childNodes.length===0?"":f.childNodes[0].nodeValue}var G=J.a=function(y){var f=y.value,d=f===void 0?"":f,b=y.className,N=y.style,l=N===void 0?{}:N,k=String(d),X=Object(le.useMemo)(function(){try{var ee=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,I=/\"\/api\/attachments\/|\"\/attachments\/download\//g,j=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;k=k.replace(ee,"("+h.a.API_SERVER+"/api/attachments/").replace(I,'"'+h.a.API_SERVER+"/api/attachments/").replace(j,'"'+h.a.API_SERVER+"/files/uploads/")}catch(se){}var $=Xe(k),D=Be();return k.match(/\[TOC\]/)&&($=$.replace("<p>[TOC]</p>",_e()),pe()),$=$.replace(/(__special_katext_id_\d+__)/g,function(se,ve){var Q=D[ve],te=Q.type,ae=Q.expression;return Object(S.renderToString)(B(ae)||"",{displayMode:te==="block",throwOnError:!1,output:"html"})}),$=$.replace(/▁/g,"\u2581\u2581\u2581"),Ee(),$},[k]),O=Object(le.useRef)();function Y(ee){var I=ee.target;if(I.tagName.toUpperCase()==="A"){var j=I.getAttribute("href");if(j.startsWith("#")){ee.preventDefault();var $=document.getElementById(j.replace("#",""));$&&$.scrollIntoView(!0)}}}return Object(le.useEffect)(function(){if(O.current&&X&&(X.match(v)&&window.PR.prettyPrint()),O.current)return O.current.addEventListener("click",Y),function(){O.current.removeEventListener("click",Y),Ee(),pe()}},[X,O.current,Y]),Le.a.createElement("div",{ref:O,style:l,className:"".concat(b||""," markdown-body"),dangerouslySetInnerHTML:{__html:X}})}},"9VGf":function(je,J,i){"use strict";i.d(J,"a",function(){return Se});var le=i("q1tI"),Le=i.n(le);function Se(K,oe){var E=Object(le.useRef)();Object(le.useEffect)(function(){E.current=K}),Object(le.useEffect)(function(){function s(){E.current()}if(oe!==null){var x=setInterval(s,oe);return function(){return clearInterval(x)}}},[oe])}},"9ivq":function(je,J,i){},BjJ7:function(je,J,i){"use strict";i.d(J,"d",function(){return Le}),i.d(J,"c",function(){return Se}),i.d(J,"e",function(){return K}),i.d(J,"b",function(){return oe}),i.d(J,"a",function(){return s});var le=i("m3rI");function Le(x){var T=!0;if(x.length>0){for(var _=0;_<x.length;_++)if(x[_].compile_success==0||!x[_].compile_success){T=!1;break}}else T=!1;return T}function Se(x){for(var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=[],w=0;w<x.length;w++){var H=x[w],pe=T?"".concat(T,"/").concat(H.name):"".concat(H.name);_.push({title:H.name,isLeaf:!(H.type==="tree"),key:pe})}return _}function K(x,T,_){for(var w=0;w<x.length;w++){var H=x[w];if(H.key===T){H.children=_;break}H.children&&K(H.children,T,_)}return x}function oe(x,T,_){var w;return function(){var H=this,pe=arguments,ne=function(){w=null,_||x.apply(H,pe)},_e=_&&!w;clearTimeout(w),w=setTimeout(ne,T),_e&&x.apply(H,pe)}}var E=!0,s=le.a.API_SERVER},"C+DQ":function(je,J,i){},HmJG:function(je,J,i){},M8RZ:function(je,J,i){"use strict";i.d(J,"a",function(){return T});var le=i("fWQN"),Le=i("mtLc"),Se=i("yKVA"),K=i("879j"),oe=i("q1tI"),E=i.n(oe),s=i("i8i4"),x=i.n(s),T=function(_){Object(Se.a)(H,_);var w=Object(K.a)(H);function H(pe){var ne;Object(le.a)(this,H),ne=w.call(this,pe);var _e=window.document;return ne.node=_e.createElement("div"),_e.body.appendChild(ne.node),ne}return Object(Le.a)(H,[{key:"render",value:function(){var ne=this.props.children;return Object(s.createPortal)(ne,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),H}(E.a.Component)},Ot1p:function(je,J,i){"use strict";var le=i("2qtc"),Le=i("kLXV"),Se=i("rAM+"),K=i("tJVT"),oe=i("jrin"),E=i("q1tI"),s=i.n(E),x=i("VrN/"),T=i.n(x),_=i("bdgK"),w=i("p77/"),H=i("Bd2K"),pe=i("ELLl"),ne=i("19Vz"),_e=i("lZu9"),Ve=i("kSUc"),Je=i("9Bee"),De=i("0Owb"),Ie=i("dejd"),we=i("C+DQ"),Be=[{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 Ee(p){var F=p.onActionCallback,L=p.title,Z=p.icon,ie=p.actionName,Te=p.className,ce=Te===void 0?"":Te,Re=p.children;function xe(){F(ie)}return s.a.createElement("a",{title:L,className:ce,onClick:xe},s.a.createElement("i",{className:"md-iconfont ".concat(Z)}),Re)}var ge=function(p){var F=p.watch,L=p.showNullButton,Z=p.onActionCallback,ie=p.fullScreen,Te=[].concat(Be,[{title:"".concat(F?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(F?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return s.a.createElement("ul",{className:"markdown-toolbar-container"},Te.map(function(ce,Re){return s.a.createElement("li",{key:Re},ce.actionName?s.a.createElement(Ee,Object(De.a)({},ce,{onActionCallback:Z})):s.a.createElement("span",{className:"v-line"}))}),L?s.a.createElement("li",null,s.a.createElement(Ee,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Z},s.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,s.a.createElement("li",{className:"btn-full-screen"},s.a.createElement(Ee,{icon:"".concat(ie?"icon-shrink":"icon-enlarge"),title:ie?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Z})))},Ne=i("M8RZ"),Me=i("+L6B"),ue=i("2/Rp"),Xe=i("y8nQ"),q=i("Vl3Y"),h=i("5NDa"),S=i("5rEg"),v={labelCol:{span:4},wrapperCol:{span:20}},B=function(p){var F=p.callback,L=p.onCancel;function Z(ie){F(ie)}return s.a.createElement(q.a,Object(De.a)({},v,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Z}),s.a.createElement(q.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},s.a.createElement(S.a,null)),s.a.createElement(q.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},s.a.createElement(S.a,null)),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(ue.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))},G=i("7ahc"),y=i("HmJG"),f=i("BjJ7"),d=q.a.useForm,b={width:280,marginRight:10},N={labelCol:{span:5},wrapperCol:{span:19}},l=function(p){var F=p.callback,L=p.onCancel,Z=d(),ie=Object(K.a)(Z,1),Te=ie[0];function ce(Oe){F(Oe)}function Re(Oe){Te.setFieldsValue({src:"/api/attachments/".concat(Oe.id)})}function xe(Oe){var Ue=Oe.target.files[0];X(Ue,Re)}return s.a.createElement(q.a,Object(De.a)({form:Te},N,{className:"upload-image-panel",onFinish:ce}),s.a.createElement(q.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},s.a.createElement("div",{className:"flex-container"},s.a.createElement(q.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},s.a.createElement(S.a,{style:b})),s.a.createElement(k,{onFileChange:xe}))),s.a.createElement(q.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},s.a.createElement(S.a,{style:{width:264}})),s.a.createElement(q.a.Item,{style:{textAlign:"right"}},s.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(ue.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function k(p){var F=p.onFileChange;return s.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",s.a.createElement("input",{type:"file",accept:"image/*",onChange:F}))}function X(p,F){if(!p)throw new String("\u6CA1\u6709\u6587\u4EF6");var L=new FormData;L.append("editormd-image-file",p),L.append("file_param_name","editormd-image-file"),L.append("byxhr","true");var Z=new window.XMLHttpRequest;Z.withCredentials=!0,Z.addEventListener("load",function(ie){F(JSON.parse(ie.target.responseText))},!1),Z.addEventListener("error",function(ie){console.error(ie)},!1),Z.open("POST","".concat(f.a,"/api/attachments.json")),Z.send(L)}var O=i("giR+"),Y=i("fyUT"),ee=i("7Kak"),I=i("9yH6"),j=I.a.Group,$={margin:"0 8px"},D=function(p){var F=p.callback,L=p.onCancel;function Z(ie){F(ie)}return s.a.createElement(q.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Z},s.a.createElement("div",{className:"flex-container"},s.a.createElement("span",{style:$},"\u5355\u5143\u683C\u6570\uFF1A"),s.a.createElement("span",{style:$},"\u884C\u6570"),s.a.createElement(q.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},s.a.createElement(Y.a,null)),s.a.createElement("span",{style:$},"\u5217\u6570"),s.a.createElement(q.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},s.a.createElement(Y.a,null))),s.a.createElement("div",{className:"flex-container",style:{marginTop:12}},s.a.createElement("span",{style:$},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),s.a.createElement(q.a.Item,{name:"align"},s.a.createElement(j,null,s.a.createElement(I.a,{value:"default"},s.a.createElement("i",{className:"fa fa-align-justify"})),s.a.createElement(I.a,{value:"left"},s.a.createElement("i",{className:"fa fa-align-left"})),s.a.createElement(I.a,{value:"center"},s.a.createElement("i",{className:"fa fa-align-center"})),s.a.createElement(I.a,{value:"right"},s.a.createElement("i",{className:"fa fa-align-right"}))))),s.a.createElement("div",{className:"flex-container flex-end"},s.a.createElement(ue.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),s.a.createElement(ue.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))},se="link",ve="upload-image",Q="code-block",te="add-table",ae="------------",be={default:ae,left:":".concat(ae),center:":".concat(ae,":"),right:"".concat(ae,":")},t=i("9VGf"),e,r;function n(){}var o=0,a=1e4,m="\u2581";function C(p){return/^\d+$/.test(p)?"".concat(p,"px"):p}var M=navigator.platform.toUpperCase().indexOf("MAC")>=0,u=M?"Cmd":"Ctrl",g=(e={},Object(oe.a)(e,u+"-B","bold"),Object(oe.a)(e,u+"-I","italic"),e),A=(r={},Object(oe.a)(r,se,"\u6DFB\u52A0\u94FE\u63A5"),Object(oe.a)(r,Q,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(oe.a)(r,ve,"\u6DFB\u52A0\u56FE\u7247"),Object(oe.a)(r,te,"\u6DFB\u52A0\u8868\u683C"),r),Ae=J.a=function(p){var F=p.defaultValue,L=F===void 0?"":F,Z=p.onChange,ie=p.width,Te=ie===void 0?"100%":ie,ce=p.height,Re=ce===void 0?400:ce,xe=p.miniToolbar,Oe=xe===void 0?!1:xe,Ue=p.isFocus,$e=Ue===void 0?!1:Ue,Ke=p.watch,ot=p.id,Ye=ot===void 0?"markdown-editor-id":ot,it=p.showResizeBar,ht=it===void 0?!1:it,de=p.noStorage,Pe=de===void 0?!1:de,V=p.showNullButton,We=V===void 0?!1:V,Qe=p.fullScreen,Fe=Qe===void 0?!1:Qe,Ge=p.onBlur,ut=p.onCMBeforeChange,fe=p.className,ke=fe===void 0?"":fe,st=p.placeholder,et=st===void 0?"":st,bt=p.values,pt=bt===void 0?"":bt,kt=Object(E.useState)(null),Ot=Object(K.a)(kt,2),c=Ot[0],Bt=Ot[1],Xt=Object(E.useState)(L),Lt=Object(K.a)(Xt,2),vt=Lt[0],lt=Lt[1],Ft=Object(E.useState)(Ke),Rt=Object(K.a)(Ft,2),He=Rt[0],Ut=Rt[1],Gt=Object(E.useState)(Fe),Pt=Object(K.a)(Gt,2),ze=Pt[0],Ct=Pt[1],Vt=Object(E.useState)(""),jt=Object(K.a)(Vt,2),Ze=jt[0],qe=jt[1],$t=Object(E.useState)(0),St=Object(K.a)($t,2),tt=St[0],Et=St[1],Kt=Object(E.useState)(Re),wt=Object(K.a)(Kt,2),_t=wt[0],Nt=wt[1],Wt=Object(E.useState)(!1),At=Object(K.a)(Wt,2),Qt=At[0],gt=At[1],rt=Object(E.useRef)(),nt=Object(E.useRef)(),ct=Object(E.useRef)(),dt=Object(E.useRef)();Object(E.useEffect)(function(){lt(pt),c==null||c.setValue(pt)},[pt]),Object(E.useEffect)(function(){if(rt.current){var R=function(W,z){var re=z.clipboardData;if(re){var me=re.types.toString(),ye=re.items;if(me==="text/html,Files"||me==="Files"){var he=ye[1];me==="Files"&&(he=ye[0]),he.kind==="file"&&he.type.match(/^image\//i)&&X(he.getAsFile(),function(Ce){Ce.id?U.replaceSelection("![,](/api/attachments/".concat(Ce.id,")")):(Ce==null?void 0:Ce.status)===401&&(document.location.href="/user/login")})}else return!0}return!0},U=T.a.fromTextArea(rt.current,{mode:"markdown",inputStyle:"contenteditable",lineNumbers:!Oe,lineWrapping:!0,value:L,autoCloseTags:!0,autoCloseBrackets:!0});return U.on("paste",R),Bt(U),function(){U.off("paste",R)}}},[]);var Tt=Object(E.useCallback)(function(){if(nt.current)try{var R=nt.current.getElementsByClassName("markdown-toolbar-container")[0].offsetHeight,U=nt.current.getElementsByClassName("markdown-editor-body")[0];ze?U.style.height="calc(100vh - ".concat(R,"px)"):U.style.height="".concat(_t-R,"px")}catch(P){console.log(P,"---- to set md editor body height")}},[_t,nt,ze]);Object(E.useEffect)(function(){function R(){var P=new _.default(function(W){var z=Object(Se.a)(W),re;try{for(z.s();!(re=z.n()).done;){var me=re.value;(me.target.offsetHeight>0||me.target.offsetWidth>0)&&(Tt(),c.setSize("100%","100%"),c.refresh())}}catch(ye){z.e(ye)}finally{z.f()}});return P.observe(rt.current.parentElement),P}if(c){var U=R();return function(){U.unobserve(rt.current.parentElement)}}},[c,Tt]),Object(E.useEffect)(function(){if(c){for(var R=[],U=function(){var me=W[P];z=Object(K.a)(me,2);var ye=z[0],he=z[1],Ce=Object(oe.a)({},ye,function(){Dt(he)});R.push(Ce),c.addKeyMap(Ce)},P=0,W=Object.entries(g);P<W.length;P++){var z;U()}return function(){var re=Object(Se.a)(R),me;try{for(re.s();!(me=re.n()).done;){var ye=me.value;c.removeKeyMap(ye)}}catch(he){re.e(he)}finally{re.f()}}}},[c]),Object(E.useEffect)(function(){Fe!==ze&&Ct(Fe)},[Fe]),Object(t.a)(function(){if(!Pe&&tt>0){var R=new Date().getTime(),U=window.sessionStorage.getItem(Ye);R>=tt+a&&(!U||U!==vt)&&(window.sessionStorage.setItem(Ye,vt),gt(!0))}},a),Object(E.useEffect)(function(){Ut(Ke)},[c,Ke]),Object(E.useEffect)(function(){c&&($e&&c.focus())},[c,$e]),Object(E.useEffect)(function(){if(He&&c){var R=function(W){var z=W.target;if(dt.current){var re=z.scrollTop/z.scrollHeight;dt.current.scrollTop=dt.current.scrollHeight*re}},U=c.getScrollerElement();return U.addEventListener("scroll",R),function(){U.removeEventListener("scroll",R)}}},[c,He]),Object(E.useEffect)(function(){if(c&&ut){var R=function(P,W){ut(P,W)};return c.on("beforeChange",R),function(){c.off("beforeChange",R)}}},[c,ut]),Object(E.useEffect)(function(){if(c&&Ge){var R=function(){Ge(c.getValue())};return c.on("blur",R),function(){c.off("blur",R)}}},[c,Ge]),Object(E.useEffect)(function(){if(c){var R=function(P){var W=P.getValue();lt(W),Et(new Date().getTime()),P.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Z&&Z(W)};return c.on("change",R),function(){c.off("change",R)}}},[c,Z]),Object(E.useEffect)(function(){c&&(L==null?(c.setValue(""),lt("")):L!==c.getValue()&&(c.setValue(L),lt(L)))},[c,L]);var Dt=Object(E.useCallback)(function(R){var U=c.getCursor(),P=c.getSelection(),W=P.split(`
`);switch(R){case"bold":return c.replaceSelection("**"+P+"**"),P===""&&c.setCursor(U.line,U.ch+2),c.focus();case"italic":return c.replaceSelection("*"+P+"*"),P===""&&c.setCursor(U.line,U.ch+1),c.focus();case"code":return c.replaceSelection("`"+P+"`"),P===""&&c.setCursor(U.line,U.ch+1),c.focus();case"inline-latex":return c.replaceSelection("`$$"+P+"$$`"),P===""&&c.setCursor(U.line,U.ch+3),c.focus();case"latex":return c.replaceSelection("```latex\n"+P+"\n```"),c.setCursor(U.line+1,P.length+1),c.focus();case"line-break":return c.replaceSelection(`<br/>
`),c.focus();case"list-ul":return P===""?c.replaceSelection("- "+P):c.replaceSelection(W.map(function(z){return z===""?"":"- ".concat(z)}).join(`
`)),c.focus();case"list-ol":return P===""?c.replaceSelection("1. "+P):c.replaceSelection(W.map(function(z,re){return z===""?"":"".concat(re+1,". ").concat(z)}).join(`
`)),c.focus();case"add-null-ch":return P===""&&c.setCursor(U.line,U.ch+1),c.replaceSelection(m),c.focus();case"eraser":return c.setValue(""),c.focus();case"trigger-watch":return Ut(!He),c.focus();case"trigger-full-screen":return Ct(!ze),c.focus();case se:qe(se);return;case Q:qe(Q);return;case ve:qe(ve);return;case te:qe(te);return;default:throw new Error}},[c,He,ze]),ft=Object(E.useCallback)(function(R){qe("");switch(Ze){case se:var U=R.title,P=R.link;return c.replaceSelection("[".concat(U,"](").concat(P,")")),c.focus();case Q:var W=R.language,z=R.content;return c.replaceSelection(["```"+W,z,"```"].join(`
`)),c.focus();case ve:var re=R.src,me=R.alt;return c.replaceSelection("![ ".concat(me," ]( ").concat(re,' "').concat(me,'" )')),c.focus();case te:for(var ye=R.row,he=R.col,Ce=R.align,yt=`
`,mt=0;mt<ye;mt++){for(var Mt=[],It=[],xt=0;xt<he;xt++)mt===1&&It.push(be[Ce]),Mt.push(" ");mt===1&&(yt+="| ".concat(It.join(" | "),` |
`)),yt+="| ".concat(Mt.join(he===1?"":" | "),` |
`)}return c.replaceSelection(yt+`
`),c.focus();default:throw new Error}},[c,Ze]),Ht=Object(E.useMemo)(function(){switch(Ze){case se:return s.a.createElement(B,{callback:ft,onCancel:at});case Q:return s.a.createElement(G.b,{callback:ft,onCancel:at});case ve:return s.a.createElement(l,{callback:ft,onCancel:at});case te:return s.a.createElement(D,{callback:ft,onCancel:at});default:return null}},[Ze]);function at(){qe("")}Object(E.useEffect)(function(){if(ct.current){var R=function(ye){z=!0,re=ye.pageY},U=function(){z=!1},P=function(ye){if(z){var he=ye.pageY-re;he<0&&(he=0),he>300&&(he=300);var Ce=Re+he+"px";Nt(Ce)}},W=ct.current,z=!1,re=0;return W.addEventListener("mousedown",R),document.addEventListener("mousemove",P),document.addEventListener("mouseup",U),function(){W.removeEventListener("mousedown",R),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",U)}}},[c,ct]),Object(E.useEffect)(function(){Nt(Re)},[Re]);var zt=C(Te),Jt=C(_t),Yt={width:zt,height:Jt},Zt=Object(E.useMemo)(function(){if(tt){var R=new Date(tt),U=R.getHours(),P=R.getMinutes(),W=R.getSeconds();return U=U<10?"0"+U:U,P=P<10?"0"+P:P,W=W<10?"0"+W:W,"".concat(U,":").concat(P,":").concat(W)}return 0},[tt]);function qt(){window.sessionStorage.removeItem(Ye),gt(!1),Et(0)}function er(){gt(!1),Et(0),c.setValue(window.sessionStorage.getItem(Ye))}return s.a.createElement(E.Fragment,null,s.a.createElement("div",{className:"markdown-editor-wrapper",ref:nt},s.a.createElement("div",{className:"markdown-editor-container ".concat(ke," ").concat(He?"on-preview":""," ").concat(Oe?"mini":""," ").concat(ze?"full-screen":""),style:Yt},s.a.createElement(ge,{watch:He,fullScreen:ze,showNullButton:We,onActionCallback:Dt}),s.a.createElement("div",{className:"markdown-editor-body"},s.a.createElement("div",{className:"codemirror-container"},s.a.createElement("textarea",{ref:rt,placeholder:et})),He?s.a.createElement("div",{ref:dt,className:"preview-container"},s.a.createElement(Je.a,{value:vt})):null))),ht?s.a.createElement("a",{ref:ct,className:"editor-resize"}):null,s.a.createElement(Ne.a,null,A[Ze]?s.a.createElement(Le.a,{centered:!0,title:A[Ze],visible:!0,onCancel:at,footer:null},Ht):null))}},axZZ:function(je,J,i){"use strict";i.r(J);var le=i("DZo9"),Le=i("8z0m"),Se=i("+L6B"),K=i("2/Rp"),oe=i("miYZ"),E=i("tsqr"),s=i("9og8"),x=i("tJVT"),T=i("q1tI"),_=i.n(T),w=i("5NDa"),H=i("5rEg"),pe=i("Ot1p"),ne=i("ErOA");function _e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_e=function(){return h};var h={},S=Object.prototype,v=S.hasOwnProperty,B=typeof Symbol=="function"?Symbol:{},G=B.iterator||"@@iterator",y=B.asyncIterator||"@@asyncIterator",f=B.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(r,n,o){return r[n]=o}}function b(t,e,r,n){var o=e&&e.prototype instanceof k?e:k,a=Object.create(o.prototype),m=new te(n||[]);return a._invoke=function(C,M,u){var g="suspendedStart";return function(A,Ae){if(g==="executing")throw new Error("Generator is already running");if(g==="completed"){if(A==="throw")throw Ae;return be()}for(u.method=A,u.arg=Ae;;){var p=u.delegate;if(p){var F=se(p,u);if(F){if(F===l)continue;return F}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(g==="suspendedStart")throw g="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);g="executing";var L=N(C,M,u);if(L.type==="normal"){if(g=u.done?"completed":"suspendedYield",L.arg===l)continue;return{value:L.arg,done:u.done}}L.type==="throw"&&(g="completed",u.method="throw",u.arg=L.arg)}}}(t,r,m),a}function N(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}h.wrap=b;var l={};function k(){}function X(){}function O(){}var Y={};d(Y,G,function(){return this});var ee=Object.getPrototypeOf,I=ee&&ee(ee(ae([])));I&&I!==S&&v.call(I,G)&&(Y=I);var j=O.prototype=k.prototype=Object.create(Y);function $(t){["next","throw","return"].forEach(function(e){d(t,e,function(r){return this._invoke(e,r)})})}function D(t,e){function r(o,a,m,C){var M=N(t[o],t,a);if(M.type!=="throw"){var u=M.arg,g=u.value;return g&&typeof g=="object"&&v.call(g,"__await")?e.resolve(g.__await).then(function(A){r("next",A,m,C)},function(A){r("throw",A,m,C)}):e.resolve(g).then(function(A){u.value=A,m(u)},function(A){return r("throw",A,m,C)})}C(M.arg)}var n;this._invoke=function(o,a){function m(){return new e(function(C,M){r(o,a,C,M)})}return n=n?n.then(m,m):m()}}function se(t,e){var r=t.iterator[e.method];if(r===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,se(t,e),e.method==="throw"))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=N(r,t.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function ve(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function te(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(ve,this),this.reset(!0)}function ae(t){if(t){var e=t[G];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var r=-1,n=function o(){for(;++r<t.length;)if(v.call(t,r))return o.value=t[r],o.done=!1,o;return o.value=void 0,o.done=!0,o};return n.next=n}}return{next:be}}function be(){return{value:void 0,done:!0}}return X.prototype=O,d(j,"constructor",O),d(O,"constructor",X),X.displayName=d(O,f,"GeneratorFunction"),h.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===X||(e.displayName||e.name)==="GeneratorFunction")},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,d(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},h.awrap=function(t){return{__await:t}},$(D.prototype),d(D.prototype,y,function(){return this}),h.AsyncIterator=D,h.async=function(t,e,r,n,o){o===void 0&&(o=Promise);var a=new D(b(t,e,r,n),o);return h.isGeneratorFunction(e)?a:a.next().then(function(m){return m.done?m.value:a.next()})},$(j),d(j,f,"Generator"),d(j,G,function(){return this}),d(j,"toString",function(){return"[object Generator]"}),h.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},h.values=ae,te.prototype={constructor:te,reset:function(e){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(Q),!e)for(var r in this)r.charAt(0)==="t"&&v.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(u,g){return m.type="throw",m.arg=e,r.next=u,g&&(r.method="next",r.arg=void 0),!!g}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],m=a.completion;if(a.tryLoc==="root")return n("end");if(a.tryLoc<=this.prev){var C=v.call(a,"catchLoc"),M=v.call(a,"finallyLoc");if(C&&M){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(C){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&(e==="break"||e==="continue")&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var m=a?a.completion:{};return m.type=e,m.arg=r,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(m)},complete:function(e,r){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&r&&(this.next=r),l},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Q(n),l}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if(o.type==="throw"){var a=o.arg;Q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:ae(e),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),l}},h}function Ve(h){var S=h.setIscreate,v=h.init,B=h.UpdateItem,G=Object(T.useState)(""),y=Object(x.a)(G,2),f=y[0],d=y[1],b=Object(T.useState)(""),N=Object(x.a)(b,2),l=N[0],k=N[1];Object(T.useEffect)(function(){if(!B)return;d(B&&B.name),k(B&&B.description)},[B]);function X(){return O.apply(this,arguments)}function O(){return O=Object(s.a)(_e().mark(function I(){var j;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(f){D.next=3;break}return E.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),D.abrupt("return");case 3:if(l){D.next=6;break}return E.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),D.abrupt("return");case 6:if(!B){D.next=9;break}return Y(),D.abrupt("return");case 9:return D.next=11,Object(ne.a)("/api/hpc_courses.json",{method:"post",body:{name:f,description:l,container_type:window.location.pathname.split("/")[1]}});case 11:j=D.sent,j&&(E.b.info("\u521B\u5EFA\u6210\u529F"),S(!1),v("add"));case 13:case"end":return D.stop()}},I)})),O.apply(this,arguments)}function Y(){return ee.apply(this,arguments)}function ee(){return ee=Object(s.a)(_e().mark(function I(){var j;return _e().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Object(ne.a)("/api/hpc_courses/".concat(B.id,".json"),{method:"put",body:{name:f,description:l,container_type:window.location.pathname.split("/")[1]}});case 2:j=D.sent,j&&(E.b.info("\u7F16\u8F91\u6210\u529F"),S(!1),v(""));case 4:case"end":return D.stop()}},I)})),ee.apply(this,arguments)}return _.a.createElement("div",null,_.a.createElement(H.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:f,maxLength:60,addonAfter:String(f.length)+"/60",onChange:function(j){return d(j.target.value)}}),_.a.createElement(pe.a,{id:"courseContentMD",defaultValue:l,onChange:function(j){return k(j)}}),_.a.createElement("div",{className:"clearfix mt30 mb30"},_.a.createElement(K.a,{type:"primary",onClick:function(){return X()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),_.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return S(!1)}},"\u53D6\u6D88")))}var Je=Ve,De=i("9Bee");function Ie(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ie=function(){return h};var h={},S=Object.prototype,v=S.hasOwnProperty,B=typeof Symbol=="function"?Symbol:{},G=B.iterator||"@@iterator",y=B.asyncIterator||"@@asyncIterator",f=B.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(r,n,o){return r[n]=o}}function b(t,e,r,n){var o=e&&e.prototype instanceof k?e:k,a=Object.create(o.prototype),m=new te(n||[]);return a._invoke=function(C,M,u){var g="suspendedStart";return function(A,Ae){if(g==="executing")throw new Error("Generator is already running");if(g==="completed"){if(A==="throw")throw Ae;return be()}for(u.method=A,u.arg=Ae;;){var p=u.delegate;if(p){var F=se(p,u);if(F){if(F===l)continue;return F}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(g==="suspendedStart")throw g="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);g="executing";var L=N(C,M,u);if(L.type==="normal"){if(g=u.done?"completed":"suspendedYield",L.arg===l)continue;return{value:L.arg,done:u.done}}L.type==="throw"&&(g="completed",u.method="throw",u.arg=L.arg)}}}(t,r,m),a}function N(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}h.wrap=b;var l={};function k(){}function X(){}function O(){}var Y={};d(Y,G,function(){return this});var ee=Object.getPrototypeOf,I=ee&&ee(ee(ae([])));I&&I!==S&&v.call(I,G)&&(Y=I);var j=O.prototype=k.prototype=Object.create(Y);function $(t){["next","throw","return"].forEach(function(e){d(t,e,function(r){return this._invoke(e,r)})})}function D(t,e){function r(o,a,m,C){var M=N(t[o],t,a);if(M.type!=="throw"){var u=M.arg,g=u.value;return g&&typeof g=="object"&&v.call(g,"__await")?e.resolve(g.__await).then(function(A){r("next",A,m,C)},function(A){r("throw",A,m,C)}):e.resolve(g).then(function(A){u.value=A,m(u)},function(A){return r("throw",A,m,C)})}C(M.arg)}var n;this._invoke=function(o,a){function m(){return new e(function(C,M){r(o,a,C,M)})}return n=n?n.then(m,m):m()}}function se(t,e){var r=t.iterator[e.method];if(r===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,se(t,e),e.method==="throw"))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=N(r,t.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function ve(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function te(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(ve,this),this.reset(!0)}function ae(t){if(t){var e=t[G];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var r=-1,n=function o(){for(;++r<t.length;)if(v.call(t,r))return o.value=t[r],o.done=!1,o;return o.value=void 0,o.done=!0,o};return n.next=n}}return{next:be}}function be(){return{value:void 0,done:!0}}return X.prototype=O,d(j,"constructor",O),d(O,"constructor",X),X.displayName=d(O,f,"GeneratorFunction"),h.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===X||(e.displayName||e.name)==="GeneratorFunction")},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,d(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},h.awrap=function(t){return{__await:t}},$(D.prototype),d(D.prototype,y,function(){return this}),h.AsyncIterator=D,h.async=function(t,e,r,n,o){o===void 0&&(o=Promise);var a=new D(b(t,e,r,n),o);return h.isGeneratorFunction(e)?a:a.next().then(function(m){return m.done?m.value:a.next()})},$(j),d(j,f,"Generator"),d(j,G,function(){return this}),d(j,"toString",function(){return"[object Generator]"}),h.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},h.values=ae,te.prototype={constructor:te,reset:function(e){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(Q),!e)for(var r in this)r.charAt(0)==="t"&&v.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(u,g){return m.type="throw",m.arg=e,r.next=u,g&&(r.method="next",r.arg=void 0),!!g}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],m=a.completion;if(a.tryLoc==="root")return n("end");if(a.tryLoc<=this.prev){var C=v.call(a,"catchLoc"),M=v.call(a,"finallyLoc");if(C&&M){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(C){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&(e==="break"||e==="continue")&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var m=a?a.completion:{};return m.type=e,m.arg=r,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(m)},complete:function(e,r){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&r&&(this.next=r),l},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Q(n),l}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if(o.type==="throw"){var a=o.arg;Q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:ae(e),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),l}},h}function we(h){var S=h.CourseItem,v=h.userId,B=h.init,G=h.ItemUpdate,y=h.setSee,f=h.UserInfo;function d(){return b.apply(this,arguments)}function b(){return b=Object(s.a)(Ie().mark(function l(){var k;return Ie().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,Object(ne.a)("/api/hpc_courses/".concat(S.id,".json"),{method:"delete"});case 2:k=O.sent,k&&(E.b.info("\u5220\u9664\u6210\u529F"),B("delete"),y(!1));case 4:case"end":return O.stop()}},l)})),b.apply(this,arguments)}function N(){G(S)}return _.a.createElement("div",null,v===299635||v===301458||(f==null?void 0:f.admin)||(f==null?void 0:f.business)?_.a.createElement("div",{style:{textAlign:"right"}},_.a.createElement(K.a,{onClick:function(){return N()}},"\u7F16\u8F91"),_.a.createElement(K.a,{onClick:function(){return d()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,_.a.createElement("h1",null,S==null?void 0:S.name),_.a.createElement(De.a,{value:S==null?void 0:S.description}))}var Be=we,Ee=i("9ivq"),ge=i("m3rI"),Ne=i("Ty5D"),Me=i("9kvl");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 h};var h={},S=Object.prototype,v=S.hasOwnProperty,B=typeof Symbol=="function"?Symbol:{},G=B.iterator||"@@iterator",y=B.asyncIterator||"@@asyncIterator",f=B.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(r,n,o){return r[n]=o}}function b(t,e,r,n){var o=e&&e.prototype instanceof k?e:k,a=Object.create(o.prototype),m=new te(n||[]);return a._invoke=function(C,M,u){var g="suspendedStart";return function(A,Ae){if(g==="executing")throw new Error("Generator is already running");if(g==="completed"){if(A==="throw")throw Ae;return be()}for(u.method=A,u.arg=Ae;;){var p=u.delegate;if(p){var F=se(p,u);if(F){if(F===l)continue;return F}}if(u.method==="next")u.sent=u._sent=u.arg;else if(u.method==="throw"){if(g==="suspendedStart")throw g="completed",u.arg;u.dispatchException(u.arg)}else u.method==="return"&&u.abrupt("return",u.arg);g="executing";var L=N(C,M,u);if(L.type==="normal"){if(g=u.done?"completed":"suspendedYield",L.arg===l)continue;return{value:L.arg,done:u.done}}L.type==="throw"&&(g="completed",u.method="throw",u.arg=L.arg)}}}(t,r,m),a}function N(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}h.wrap=b;var l={};function k(){}function X(){}function O(){}var Y={};d(Y,G,function(){return this});var ee=Object.getPrototypeOf,I=ee&&ee(ee(ae([])));I&&I!==S&&v.call(I,G)&&(Y=I);var j=O.prototype=k.prototype=Object.create(Y);function $(t){["next","throw","return"].forEach(function(e){d(t,e,function(r){return this._invoke(e,r)})})}function D(t,e){function r(o,a,m,C){var M=N(t[o],t,a);if(M.type!=="throw"){var u=M.arg,g=u.value;return g&&typeof g=="object"&&v.call(g,"__await")?e.resolve(g.__await).then(function(A){r("next",A,m,C)},function(A){r("throw",A,m,C)}):e.resolve(g).then(function(A){u.value=A,m(u)},function(A){return r("throw",A,m,C)})}C(M.arg)}var n;this._invoke=function(o,a){function m(){return new e(function(C,M){r(o,a,C,M)})}return n=n?n.then(m,m):m()}}function se(t,e){var r=t.iterator[e.method];if(r===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,se(t,e),e.method==="throw"))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=N(r,t.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function ve(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Q(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function te(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(ve,this),this.reset(!0)}function ae(t){if(t){var e=t[G];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var r=-1,n=function o(){for(;++r<t.length;)if(v.call(t,r))return o.value=t[r],o.done=!1,o;return o.value=void 0,o.done=!0,o};return n.next=n}}return{next:be}}function be(){return{value:void 0,done:!0}}return X.prototype=O,d(j,"constructor",O),d(O,"constructor",X),X.displayName=d(O,f,"GeneratorFunction"),h.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===X||(e.displayName||e.name)==="GeneratorFunction")},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,d(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},h.awrap=function(t){return{__await:t}},$(D.prototype),d(D.prototype,y,function(){return this}),h.AsyncIterator=D,h.async=function(t,e,r,n,o){o===void 0&&(o=Promise);var a=new D(b(t,e,r,n),o);return h.isGeneratorFunction(e)?a:a.next().then(function(m){return m.done?m.value:a.next()})},$(j),d(j,f,"Generator"),d(j,G,function(){return this}),d(j,"toString",function(){return"[object Generator]"}),h.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function n(){for(;e.length;){var o=e.pop();if(o in t)return n.value=o,n.done=!1,n}return n.done=!0,n}},h.values=ae,te.prototype={constructor:te,reset:function(e){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(Q),!e)for(var r in this)r.charAt(0)==="t"&&v.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(u,g){return m.type="throw",m.arg=e,r.next=u,g&&(r.method="next",r.arg=void 0),!!g}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],m=a.completion;if(a.tryLoc==="root")return n("end");if(a.tryLoc<=this.prev){var C=v.call(a,"catchLoc"),M=v.call(a,"finallyLoc");if(C&&M){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(C){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&(e==="break"||e==="continue")&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var m=a?a.completion:{};return m.type=e,m.arg=r,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(m)},complete:function(e,r){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&r&&(this.next=r),l},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),Q(n),l}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if(o.type==="throw"){var a=o.arg;Q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:ae(e),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),l}},h}function Xe(h){var S,v,B,G,y,f,d,b,N,l=h.user,k=h.dispatch,X=Object(T.useState)(1),O=Object(x.a)(X,2),Y=O[0],ee=O[1],I=Object(T.useState)(100),j=Object(x.a)(I,2),$=j[0],D=j[1],se=Object(T.useState)([]),ve=Object(x.a)(se,2),Q=ve[0],te=ve[1],ae=Object(T.useState)(!1),be=Object(x.a)(ae,2),t=be[0],e=be[1],r=Object(T.useState)(!1),n=Object(x.a)(r,2),o=n[0],a=n[1],m=Object(T.useState)(""),C=Object(x.a)(m,2),M=C[0],u=C[1],g=Object(T.useState)(""),A=Object(x.a)(g,2),Ae=A[0],p=A[1],F=Object(T.useState)(""),L=Object(x.a)(F,2),Z=L[0],ie=L[1],Te=Object(Ne.m)(),ce=Te.itemname,Re=Object(T.useState)(""),xe=Object(x.a)(Re,2),Oe=xe[0],Ue=xe[1];Object(T.useEffect)(function(){k({type:"globalSetting/headerToggle",payload:!1}),Y&&$e("")},[Y]);function $e(de){return Ke.apply(this,arguments)}function Ke(){return Ke=Object(s.a)(ue().mark(function de(Pe){var V,We,Qe,Fe,Ge;return ue().wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return fe.next=2,Object(ne.a)("/api/hpc_courses.json",{method:"get",params:{page:Y,per_page:$,container_type:window.location.pathname.split("/")[1]}});case 2:if(V=fe.sent,!V){fe.next=24;break}if(We=V.data.hpc_courses.length,te(V.data.hpc_courses),ie(V.data.file_url),p(""),We){fe.next=10;break}return fe.abrupt("return");case 10:if(Oe){fe.next=14;break}ce?(Ge=0,V==null||((Qe=V.data)===null||Qe===void 0||((Fe=Qe.hpc_courses)===null||Fe===void 0))||Fe.map(function(ke,st){var et;(ce==null?void 0:ce.toLocaleLowerCase())===(ke==null||((et=ke.name)===null||et===void 0)?void 0:et.toLocaleLowerCase())&&(Ge=st)}),u(V.data.hpc_courses[Ge]),a(!0),Ue(V.data.hpc_courses[Ge].id),(ce==null?void 0:ce.toLocaleLowerCase())==="resources"&&(u(V.data.hpc_courses.filter(function(ke){return ke.id===15})[0]),a(!0),Ue(15))):(u(V.data.hpc_courses[0]),a(!0),Ue(V.data.hpc_courses[0].id)),fe.next=24;break;case 14:if(!(Pe==="delete")){fe.next=23;break}if(!(We===0)){fe.next=18;break}return a(!1),fe.abrupt("return");case 18:u(V.data.hpc_courses[0]),a(!0),Ue(V.data.hpc_courses[0].id),fe.next=24;break;case 23:Pe==="add"?(u(V.data.hpc_courses[We-1]),a(!0),Ue(V.data.hpc_courses[We-1].id)):(u(V.data.hpc_courses.filter(function(ke){return ke.id===Oe})[0]),a(!0),Ue(Oe));case 24:case"end":return fe.stop()}},de)})),Ke.apply(this,arguments)}function ot(de){e(!1),a(!0),u(de),Ue(de.id)}function Ye(de){p(de),e(!0),a(!1)}function it(){p(""),e(!0),a(!1)}var ht={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(Pe){var V=Pe.file.status;V!=="uploading",V==="done"?(E.b.success("".concat(Pe.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),$e("")):V==="error"&&E.b.error("".concat(Pe.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(Pe){var V=Pe.size/1024/1024<150;return V||E.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),V}};return _.a.createElement("div",{style:{marginBottom:"40px"}},_.a.createElement("img",{style:{width:"100%"},src:ge.a.IMG_SERVER+"/".concat(Z)}),_.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},_.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},Q&&Q.map(function(de,Pe){return _.a.createElement("p",{key:Pe,onClick:function(){return ot(de)},className:Oe===de.id?"menuitemselect":"menuitem task-hide"},de.name)}),(l==null||((S=l.userInfo)===null||S===void 0)?void 0:S.user_id)===299635||(l==null||((v=l.userInfo)===null||v===void 0)?void 0:v.user_id)===301458||(l==null||((B=l.userInfo)===null||B===void 0)?void 0:B.admin)||(l==null||((G=l.userInfo)===null||G===void 0)?void 0:G.business)?_.a.createElement("p",{onClick:function(){return it()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},_.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),_.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},t?_.a.createElement(Je,{UpdateItem:Ae,setIscreate:e,init:$e}):null,o?_.a.createElement(Be,{UserInfo:l==null?void 0:l.userInfo,setSee:a,userId:l==null||((y=l.userInfo)===null||y===void 0)?void 0:y.user_id,ItemUpdate:Ye,CourseItem:M,init:$e}):null)),(l==null||((f=l.userInfo)===null||f===void 0)?void 0:f.user_id)===299635||(l==null||((d=l.userInfo)===null||d===void 0)?void 0:d.user_id)===301458||(l==null||((b=l.userInfo)===null||b===void 0)?void 0:b.admin)||(l==null||((N=l.userInfo)===null||N===void 0)?void 0:N.business)?_.a.createElement(Le.a,ht,_.a.createElement(K.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var q=J.default=Object(Me.a)(function(h){var S=h.user;return{user:S}})(Xe)},dejd:function(je,J,i){},kSUc:function(je,J,i){}}]);