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.5f...

2 lines
28 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[137],{"9ivq":function(Et,lt,j){},axZZ:function(Et,lt,j){"use strict";j.r(lt);var Dt=j("DZo9"),bt=j("8z0m"),Ft=j("+L6B"),ot=j("2/Rp"),Gt=j("miYZ"),W=j("tsqr"),at=j("9og8"),V=j("tJVT"),A=j("q1tI"),b=j.n(A),Xt=j("5NDa"),wt=j("5rEg"),_t=j("Ot1p"),it=j("ErOA");function rt(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rt=function(){return u};var c,u={},N=Object.prototype,v=N.hasOwnProperty,x=Object.defineProperty||function(r,t,e){r[t]=e.value},S=typeof Symbol=="function"?Symbol:{},m=S.iterator||"@@iterator",M=S.asyncIterator||"@@asyncIterator",I=S.toStringTag||"@@toStringTag";function p(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(e,n,a){return e[n]=a}}function l(r,t,e,n){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype),i=new z(n||[]);return x(o,"_invoke",{value:K(r,e,i)}),o}function U(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}u.wrap=l;var Y="suspendedStart",R="suspendedYield",D="executing",k="completed",d={};function _(){}function T(){}function h(){}var H={};p(H,m,function(){return this});var F=Object.getPrototypeOf,C=F&&F(F(L([])));C&&C!==N&&v.call(C,m)&&(H=C);var O=h.prototype=_.prototype=Object.create(H);function Z(r){["next","throw","return"].forEach(function(t){p(r,t,function(e){return this._invoke(t,e)})})}function P(r,t){function e(a,o,i,s){var f=U(r[a],r,o);if(f.type!=="throw"){var g=f.arg,y=g.value;return y&&typeof y=="object"&&v.call(y,"__await")?t.resolve(y.__await).then(function(w){e("next",w,i,s)},function(w){e("throw",w,i,s)}):t.resolve(y).then(function(w){g.value=w,i(g)},function(w){return e("throw",w,i,s)})}s(f.arg)}var n;x(this,"_invoke",{value:function(o,i){function s(){return new t(function(f,g){e(o,i,f,g)})}return n=n?n.then(s,s):s()}})}function K(r,t,e){var n=Y;return function(a,o){if(n===D)throw new Error("Generator is already running");if(n===k){if(a==="throw")throw o;return{value:c,done:!0}}for(e.method=a,e.arg=o;;){var i=e.delegate;if(i){var s=B(i,e);if(s){if(s===d)continue;return s}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===Y)throw n=k,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=D;var f=U(r,t,e);if(f.type==="normal"){if(n=e.done?k:R,f.arg===d)continue;return{value:f.arg,done:e.done}}f.type==="throw"&&(n=k,e.method="throw",e.arg=f.arg)}}}function B(r,t){var e=t.method,n=r.iterator[e];if(n===c)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=c,B(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),d;var a=U(n,r.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function Q(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function G(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function z(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(Q,this),this.reset(!0)}function L(r){if(r||r===""){var t=r[m];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function a(){for(;++e<r.length;)if(v.call(r,e))return a.value=r[e],a.done=!1,a;return a.value=c,a.done=!0,a};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return T.prototype=h,x(O,"constructor",{value:h,configurable:!0}),x(h,"constructor",{value:T,configurable:!0}),T.displayName=p(h,I,"GeneratorFunction"),u.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===T||(t.displayName||t.name)==="GeneratorFunction")},u.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,h):(r.__proto__=h,p(r,I,"GeneratorFunction")),r.prototype=Object.create(O),r},u.awrap=function(r){return{__await:r}},Z(P.prototype),p(P.prototype,M,function(){return this}),u.AsyncIterator=P,u.async=function(r,t,e,n,a){a===void 0&&(a=Promise);var o=new P(l(r,t,e,n),a);return u.isGeneratorFunction(t)?o:o.next().then(function(i){return i.done?i.value:o.next()})},Z(O),p(O,I,"Generator"),p(O,m,function(){return this}),p(O,"toString",function(){return"[object Generator]"}),u.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var o=e.pop();if(o in t)return a.value=o,a.done=!1,a}return a.done=!0,a}},u.values=L,z.prototype={constructor:z,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(G),!t)for(var e in this)e.charAt(0)==="t"&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},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 e=this;function n(g,y){return i.type="throw",i.arg=t,e.next=g,y&&(e.method="next",e.arg=c),!!y}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var s=v.call(o,"catchLoc"),f=v.call(o,"finallyLoc");if(s&&f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&v.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){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"&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),G(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if(a.type==="throw"){var o=a.arg;G(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=c),d}},u}function Lt(c){var u=c.setIscreate,N=c.init,v=c.UpdateItem,x=Object(A.useState)(""),S=Object(V.a)(x,2),m=S[0],M=S[1],I=Object(A.useState)(""),p=Object(V.a)(I,2),l=p[0],U=p[1];Object(A.useEffect)(function(){if(!v)return;M(v&&v.name),U(v&&v.description)},[v]);function Y(){return R.apply(this,arguments)}function R(){return R=Object(at.a)(rt().mark(function d(){var _;return rt().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(m){h.next=3;break}return W.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),h.abrupt("return");case 3:if(l){h.next=6;break}return W.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),h.abrupt("return");case 6:if(!v){h.next=9;break}return D(),h.abrupt("return");case 9:return h.next=11,Object(it.a)("/api/hpc_courses.json",{method:"post",body:{name:m,description:l,container_type:window.location.pathname.split("/")[1]}});case 11:_=h.sent,_&&(W.b.info("\u521B\u5EFA\u6210\u529F"),u(!1),N("add"));case 13:case"end":return h.stop()}},d)})),R.apply(this,arguments)}function D(){return k.apply(this,arguments)}function k(){return k=Object(at.a)(rt().mark(function d(){var _;return rt().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Object(it.a)("/api/hpc_courses/".concat(v.id,".json"),{method:"put",body:{name:m,description:l,container_type:window.location.pathname.split("/")[1]}});case 2:_=h.sent,_&&(W.b.info("\u7F16\u8F91\u6210\u529F"),u(!1),N(""));case 4:case"end":return h.stop()}},d)})),k.apply(this,arguments)}return b.a.createElement("div",null,b.a.createElement(wt.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:m,maxLength:60,addonAfter:String(m.length)+"/60",onChange:function(_){return M(_.target.value)}}),b.a.createElement(_t.a,{id:"courseContentMD",defaultValue:l,onChange:function(_){return U(_)}}),b.a.createElement("div",{className:"clearfix mt30 mb30"},b.a.createElement(ot.a,{type:"primary",onClick:function(){return Y()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),b.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return u(!1)}},"\u53D6\u6D88")))}var xt=Lt,Ot=j("9Bee");function ft(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ft=function(){return u};var c,u={},N=Object.prototype,v=N.hasOwnProperty,x=Object.defineProperty||function(r,t,e){r[t]=e.value},S=typeof Symbol=="function"?Symbol:{},m=S.iterator||"@@iterator",M=S.asyncIterator||"@@asyncIterator",I=S.toStringTag||"@@toStringTag";function p(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(e,n,a){return e[n]=a}}function l(r,t,e,n){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype),i=new z(n||[]);return x(o,"_invoke",{value:K(r,e,i)}),o}function U(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}u.wrap=l;var Y="suspendedStart",R="suspendedYield",D="executing",k="completed",d={};function _(){}function T(){}function h(){}var H={};p(H,m,function(){return this});var F=Object.getPrototypeOf,C=F&&F(F(L([])));C&&C!==N&&v.call(C,m)&&(H=C);var O=h.prototype=_.prototype=Object.create(H);function Z(r){["next","throw","return"].forEach(function(t){p(r,t,function(e){return this._invoke(t,e)})})}function P(r,t){function e(a,o,i,s){var f=U(r[a],r,o);if(f.type!=="throw"){var g=f.arg,y=g.value;return y&&typeof y=="object"&&v.call(y,"__await")?t.resolve(y.__await).then(function(w){e("next",w,i,s)},function(w){e("throw",w,i,s)}):t.resolve(y).then(function(w){g.value=w,i(g)},function(w){return e("throw",w,i,s)})}s(f.arg)}var n;x(this,"_invoke",{value:function(o,i){function s(){return new t(function(f,g){e(o,i,f,g)})}return n=n?n.then(s,s):s()}})}function K(r,t,e){var n=Y;return function(a,o){if(n===D)throw new Error("Generator is already running");if(n===k){if(a==="throw")throw o;return{value:c,done:!0}}for(e.method=a,e.arg=o;;){var i=e.delegate;if(i){var s=B(i,e);if(s){if(s===d)continue;return s}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===Y)throw n=k,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=D;var f=U(r,t,e);if(f.type==="normal"){if(n=e.done?k:R,f.arg===d)continue;return{value:f.arg,done:e.done}}f.type==="throw"&&(n=k,e.method="throw",e.arg=f.arg)}}}function B(r,t){var e=t.method,n=r.iterator[e];if(n===c)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=c,B(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),d;var a=U(n,r.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function Q(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function G(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function z(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(Q,this),this.reset(!0)}function L(r){if(r||r===""){var t=r[m];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function a(){for(;++e<r.length;)if(v.call(r,e))return a.value=r[e],a.done=!1,a;return a.value=c,a.done=!0,a};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return T.prototype=h,x(O,"constructor",{value:h,configurable:!0}),x(h,"constructor",{value:T,configurable:!0}),T.displayName=p(h,I,"GeneratorFunction"),u.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===T||(t.displayName||t.name)==="GeneratorFunction")},u.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,h):(r.__proto__=h,p(r,I,"GeneratorFunction")),r.prototype=Object.create(O),r},u.awrap=function(r){return{__await:r}},Z(P.prototype),p(P.prototype,M,function(){return this}),u.AsyncIterator=P,u.async=function(r,t,e,n,a){a===void 0&&(a=Promise);var o=new P(l(r,t,e,n),a);return u.isGeneratorFunction(t)?o:o.next().then(function(i){return i.done?i.value:o.next()})},Z(O),p(O,I,"Generator"),p(O,m,function(){return this}),p(O,"toString",function(){return"[object Generator]"}),u.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var o=e.pop();if(o in t)return a.value=o,a.done=!1,a}return a.done=!0,a}},u.values=L,z.prototype={constructor:z,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(G),!t)for(var e in this)e.charAt(0)==="t"&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},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 e=this;function n(g,y){return i.type="throw",i.arg=t,e.next=g,y&&(e.method="next",e.arg=c),!!y}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var s=v.call(o,"catchLoc"),f=v.call(o,"finallyLoc");if(s&&f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&v.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){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"&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),G(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if(a.type==="throw"){var o=a.arg;G(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=c),d}},u}function jt(c){var u=c.CourseItem,N=c.userId,v=c.init,x=c.ItemUpdate,S=c.setSee,m=c.UserInfo;function M(){return I.apply(this,arguments)}function I(){return I=Object(at.a)(ft().mark(function l(){var U;return ft().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Object(it.a)("/api/hpc_courses/".concat(u.id,".json"),{method:"delete"});case 2:U=R.sent,U&&(W.b.info("\u5220\u9664\u6210\u529F"),v("delete"),S(!1));case 4:case"end":return R.stop()}},l)})),I.apply(this,arguments)}function p(){x(u)}return b.a.createElement("div",null,N===299635||N===301458||(m==null?void 0:m.admin)||(m==null?void 0:m.business)?b.a.createElement("div",{style:{textAlign:"right"}},b.a.createElement(ot.a,{onClick:function(){return p()}},"\u7F16\u8F91"),b.a.createElement(ot.a,{onClick:function(){return M()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,b.a.createElement("h1",null,u==null?void 0:u.name),b.a.createElement(Ot.a,{value:u==null?void 0:u.description}))}var It=jt,$t=j("9ivq"),yt=j("m3rI"),St=j("Ty5D"),Ut=j("9kvl");function dt(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */dt=function(){return u};var c,u={},N=Object.prototype,v=N.hasOwnProperty,x=Object.defineProperty||function(r,t,e){r[t]=e.value},S=typeof Symbol=="function"?Symbol:{},m=S.iterator||"@@iterator",M=S.asyncIterator||"@@asyncIterator",I=S.toStringTag||"@@toStringTag";function p(r,t,e){return Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{p({},"")}catch(r){p=function(e,n,a){return e[n]=a}}function l(r,t,e,n){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype),i=new z(n||[]);return x(o,"_invoke",{value:K(r,e,i)}),o}function U(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(n){return{type:"throw",arg:n}}}u.wrap=l;var Y="suspendedStart",R="suspendedYield",D="executing",k="completed",d={};function _(){}function T(){}function h(){}var H={};p(H,m,function(){return this});var F=Object.getPrototypeOf,C=F&&F(F(L([])));C&&C!==N&&v.call(C,m)&&(H=C);var O=h.prototype=_.prototype=Object.create(H);function Z(r){["next","throw","return"].forEach(function(t){p(r,t,function(e){return this._invoke(t,e)})})}function P(r,t){function e(a,o,i,s){var f=U(r[a],r,o);if(f.type!=="throw"){var g=f.arg,y=g.value;return y&&typeof y=="object"&&v.call(y,"__await")?t.resolve(y.__await).then(function(w){e("next",w,i,s)},function(w){e("throw",w,i,s)}):t.resolve(y).then(function(w){g.value=w,i(g)},function(w){return e("throw",w,i,s)})}s(f.arg)}var n;x(this,"_invoke",{value:function(o,i){function s(){return new t(function(f,g){e(o,i,f,g)})}return n=n?n.then(s,s):s()}})}function K(r,t,e){var n=Y;return function(a,o){if(n===D)throw new Error("Generator is already running");if(n===k){if(a==="throw")throw o;return{value:c,done:!0}}for(e.method=a,e.arg=o;;){var i=e.delegate;if(i){var s=B(i,e);if(s){if(s===d)continue;return s}}if(e.method==="next")e.sent=e._sent=e.arg;else if(e.method==="throw"){if(n===Y)throw n=k,e.arg;e.dispatchException(e.arg)}else e.method==="return"&&e.abrupt("return",e.arg);n=D;var f=U(r,t,e);if(f.type==="normal"){if(n=e.done?k:R,f.arg===d)continue;return{value:f.arg,done:e.done}}f.type==="throw"&&(n=k,e.method="throw",e.arg=f.arg)}}}function B(r,t){var e=t.method,n=r.iterator[e];if(n===c)return t.delegate=null,e==="throw"&&r.iterator.return&&(t.method="return",t.arg=c,B(r,t),t.method==="throw")||e!=="return"&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+e+"' method")),d;var a=U(n,r.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,d;var o=a.arg;return o?o.done?(t[r.resultName]=o.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=c),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function Q(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function G(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function z(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(Q,this),this.reset(!0)}function L(r){if(r||r===""){var t=r[m];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var e=-1,n=function a(){for(;++e<r.length;)if(v.call(r,e))return a.value=r[e],a.done=!1,a;return a.value=c,a.done=!0,a};return n.next=n}}throw new TypeError(typeof r+" is not iterable")}return T.prototype=h,x(O,"constructor",{value:h,configurable:!0}),x(h,"constructor",{value:T,configurable:!0}),T.displayName=p(h,I,"GeneratorFunction"),u.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return!!t&&(t===T||(t.displayName||t.name)==="GeneratorFunction")},u.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,h):(r.__proto__=h,p(r,I,"GeneratorFunction")),r.prototype=Object.create(O),r},u.awrap=function(r){return{__await:r}},Z(P.prototype),p(P.prototype,M,function(){return this}),u.AsyncIterator=P,u.async=function(r,t,e,n,a){a===void 0&&(a=Promise);var o=new P(l(r,t,e,n),a);return u.isGeneratorFunction(t)?o:o.next().then(function(i){return i.done?i.value:o.next()})},Z(O),p(O,I,"Generator"),p(O,m,function(){return this}),p(O,"toString",function(){return"[object Generator]"}),u.keys=function(r){var t=Object(r),e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var o=e.pop();if(o in t)return a.value=o,a.done=!1,a}return a.done=!0,a}},u.values=L,z.prototype={constructor:z,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(G),!t)for(var e in this)e.charAt(0)==="t"&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},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 e=this;function n(g,y){return i.type="throw",i.arg=t,e.next=g,y&&(e.method="next",e.arg=c),!!y}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if(o.tryLoc==="root")return n("end");if(o.tryLoc<=this.prev){var s=v.call(o,"catchLoc"),f=v.call(o,"finallyLoc");if(s&&f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&v.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){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"&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),G(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if(a.type==="throw"){var o=a.arg;G(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=c),d}},u}function kt(c){var u,N,v,x,S,m,M,I,p,l=c.user,U=c.dispatch,Y=Object(A.useState)(1),R=Object(V.a)(Y,2),D=R[0],k=R[1],d=Object(A.useState)(100),_=Object(V.a)(d,2),T=_[0],h=_[1],H=Object(A.useState)([]),F=Object(V.a)(H,2),C=F[0],O=F[1],Z=Object(A.useState)(!1),P=Object(V.a)(Z,2),K=P[0],B=P[1],Q=Object(A.useState)(!1),G=Object(V.a)(Q,2),z=G[0],L=G[1],r=Object(A.useState)(""),t=Object(V.a)(r,2),e=t[0],n=t[1],a=Object(A.useState)(""),o=Object(V.a)(a,2),i=o[0],s=o[1],f=Object(A.useState)(""),g=Object(V.a)(f,2),y=g[0],w=g[1],Nt=Object(St.m)(),q=Nt.itemname,Rt=Object(A.useState)(""),gt=Object(V.a)(Rt,2),ut=gt[0],tt=gt[1];Object(A.useEffect)(function(){U({type:"globalSetting/headerToggle",payload:!1}),D&&st("")},[D]);function st(X){return ht.apply(this,arguments)}function ht(){return ht=Object(at.a)(dt().mark(function X(J){var E,nt,pt,vt,ct;return dt().wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(it.a)("/api/hpc_courses.json",{method:"get",params:{page:D,per_page:T,container_type:window.location.pathname.split("/")[1]}});case 2:if(E=$.sent,!E){$.next=24;break}if(nt=E.data.hpc_courses.length,O(E.data.hpc_courses),w(E.data.file_url),s(""),nt){$.next=10;break}return $.abrupt("return");case 10:if(ut){$.next=14;break}q?(ct=0,E==null||((pt=E.data)===null||pt===void 0||((vt=pt.hpc_courses)===null||vt===void 0))||vt.map(function(et,Mt){var mt;(q==null?void 0:q.toLocaleLowerCase())===(et==null||((mt=et.name)===null||mt===void 0)?void 0:mt.toLocaleLowerCase())&&(ct=Mt)}),n(E.data.hpc_courses[ct]),L(!0),tt(E.data.hpc_courses[ct].id),(q==null?void 0:q.toLocaleLowerCase())==="resources"&&(n(E.data.hpc_courses.filter(function(et){return et.id===15})[0]),L(!0),tt(15))):(n(E.data.hpc_courses[0]),L(!0),tt(E.data.hpc_courses[0].id)),$.next=24;break;case 14:if(!(J==="delete")){$.next=23;break}if(!(nt===0)){$.next=18;break}return L(!1),$.abrupt("return");case 18:n(E.data.hpc_courses[0]),L(!0),tt(E.data.hpc_courses[0].id),$.next=24;break;case 23:J==="add"?(n(E.data.hpc_courses[nt-1]),L(!0),tt(E.data.hpc_courses[nt-1].id)):(n(E.data.hpc_courses.filter(function(et){return et.id===ut})[0]),L(!0),tt(ut));case 24:case"end":return $.stop()}},X)})),ht.apply(this,arguments)}function Tt(X){B(!1),L(!0),n(X),tt(X.id)}function Ct(X){s(X),B(!0),L(!1)}function Pt(){s(""),B(!0),L(!1)}var At={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(J){var E=J.file.status;E!=="uploading",E==="done"?(W.b.success("".concat(J.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),st("")):E==="error"&&W.b.error("".concat(J.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(J){var E=J.size/1024/1024<150;return E||W.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),E}};return b.a.createElement("div",{style:{marginBottom:"40px"}},b.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(yt.a.IMG_SERVER+"/".concat(y),")")}}),b.a.createElement("img",{style:{width:"100%"},src:yt.a.IMG_SERVER+"/".concat(y)}),b.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},b.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},C&&C.map(function(X,J){return b.a.createElement("p",{key:J,onClick:function(){return Tt(X)},className:ut===X.id?"menuitemselect":"menuitem task-hide"},X.name)}),(l==null||((u=l.userInfo)===null||u===void 0)?void 0:u.user_id)===299635||(l==null||((N=l.userInfo)===null||N===void 0)?void 0:N.user_id)===301458||(l==null||((v=l.userInfo)===null||v===void 0)?void 0:v.admin)||(l==null||((x=l.userInfo)===null||x===void 0)?void 0:x.business)?b.a.createElement("p",{onClick:function(){return Pt()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},b.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),b.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},K?b.a.createElement(xt,{UpdateItem:i,setIscreate:B,init:st}):null,z?b.a.createElement(It,{UserInfo:l==null?void 0:l.userInfo,setSee:L,userId:l==null||((S=l.userInfo)===null||S===void 0)?void 0:S.user_id,ItemUpdate:Ct,CourseItem:e,init:st}):null)),(l==null||((m=l.userInfo)===null||m===void 0)?void 0:m.user_id)===299635||(l==null||((M=l.userInfo)===null||M===void 0)?void 0:M.user_id)===301458||(l==null||((I=l.userInfo)===null||I===void 0)?void 0:I.admin)||(l==null||((p=l.userInfo)===null||p===void 0)?void 0:p.business)?b.a.createElement(bt.a,At,b.a.createElement(ot.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Yt=lt.default=Object(Ut.a)(function(c){var u=c.user;return{user:u}})(kt)}}]);