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.
5 lines
14 KiB
5 lines
14 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[130],{"5oB3":function(ue,Q,l){ue.exports={flex_box_center:"flex_box_center___2WENa",flex_space_between:"flex_space_between___32o_C",flex_box_vertical_center:"flex_box_vertical_center___VReNJ",flex_box_center_end:"flex_box_center_end___VidHP",flex_box_column:"flex_box_column___7bh0_",guidance:"guidance___1zlCK",title:"title___TLK56",u:"u___1YcNG",active:"active___2cPfY",content:"content___3PW9_",btn:"btn___26Rnl"}},"9Bee":function(ue,Q,l){"use strict";var ne=l("k1fw"),V=l("q1tI"),ae=l.n(V),de=l("vg9a"),se=l("tJVT"),$=l("DlQD"),z=l.n($),w=l("rUJ1");function T(a,i){var c=a.match(/^(\s+)(?:```)/);if(c===null)return i;var d=c[1];return i.split(`
|
|
`).map(function(m){var g=m.match(/^\s+/);if(g===null)return m;var O=Object(se.a)(g,1),R=O[0];return R.length>=d.length?m.slice(d.length):m}).join(`
|
|
`)}var Z=[],J=["<ul>"],x=new z.a.Renderer,le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function U(){Z.length=0,J=["<ul>"]}var oe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function q(a,i,c,d){if(i>=a.length||a[i].level<=c)return i;var m=a[i];d.push("<li><a href='#"+m.anchor+"'>"+m.text+"</a>"),i++;var g=[];return i=q(a,i,m.level,g),g.length>0&&(d.push("<ul>"),g.forEach(function(O){d.push(O)}),d.push("</ul>")),d.push("</li>"),i=q(a,i,c,d),i}function ie(){return q(Z,0,0,J),J.push("</ul>"),J.join("")}var ee={heading:function(i){var c=le.exec(i);if(c)return{type:"heading",raw:c[0],depth:c[1].length,text:c[2]}},fences:function(i){var c=this.rules.block.fences.exec(i);if(c){var d=c[0],m=T(d,c[3]||""),g=c[2]?c[2].trim():c[2];if(["latex","katex","math"].indexOf(g)>=0){var O=C(),R=m;m=O,v[O]={type:"block",expression:R}}return{type:"code",raw:d,lang:g,text:m}}}},ce=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,C=function(){return"__special_katext_id_".concat(p++,"__")},v={};function B(){return v}function A(){p=0,v={}}function b(a){return a=a.replace(ce,function(i,c){var d=C();return v[d]={type:"inline",expression:c},d}),a}var Y=x.listitem;x.listitem=function(a){return Y(b(a))};var E=x.paragraph;x.paragraph=function(a){return E(b(a))};var H=x.tablecell;x.tablecell=function(a,i){return H(b(a),i)},x.code=function(a,i,c){var d=(i||"").match(/\S*/)[0];return d?["latex","katex","math"].indexOf(d)>=0?"<p class='editormd-tex'>".concat(a,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(i,'">').concat(c?a:Object(w.escape)(a,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(c?a:Object(w.escape)(a,!0))+"</code></pre>"},x.heading=function(a,i,c){var d=this.options.headerPrefix+c.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Z.push({anchor:d,level:i,text:a}),"<h"+i+' id="'+d+'">'+a+"</h"+i+">"},z.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),z.a.use({tokenizer:ee,renderer:x});var S=z.a,y=l("SJMd"),W=l("m3rI"),k=l("Oy/b"),I=/<pre[^>]*>/g;function X(a){var i=document.createElement("div");return i.innerHTML=a,i.childNodes.length===0?"":i.childNodes[0].nodeValue}var F=Q.a=function(a){var i=a.value,c=i===void 0?"":i,d=a.className,m=a.showTextOnly,g=a.showLines,O=a.style,R=O===void 0?{}:O,M=String(c),K=Object(V.useMemo)(function(){try{var n=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,o=/\"\/api\/attachments\/|\"\/attachments\/download\//g,u=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;M=M.replace(n,"("+W.a.API_SERVER+"/api/attachments/").replace(o,'"'+W.a.API_SERVER+"/api/attachments/").replace(u,'"'+W.a.API_SERVER+"/files/uploads/")}catch(_){}var s=S(M);setTimeout(function(){return r()},300);var L=B();if(M.match(/\[TOC\]/)&&(s=s.replace("<p>[TOC]</p>",ie()),U()),s=s.replace(/(__special_katext_id_\d+__)/g,function(_,f){var h=L[f],N=h.type,j=h.expression;return Object(k.renderToString)(X(j)||"",{displayMode:N==="block",throwOnError:!1,output:"html"})}),s=s.replace(/▁/g,"\u2581\u2581\u2581"),A(),m){var P=document.createElement("div");return P.innerHTML=s,P.innerText}return s},[M]),t=Object(V.useRef)();oe.WebkitLineClamp=g,g&&(R=Object(ne.a)(Object(ne.a)({},R),oe));function e(n){var o=n.target;if(o.tagName.toUpperCase()==="A"){var u=o.getAttribute("href");if(u.startsWith("#")){n.preventDefault();var s=document.getElementById(u.replace("#",""));s&&s.scrollIntoView(!0)}}}var r=function(){};return Object(V.useEffect)(function(){if(t.current&&K&&(K.match(I)&&window.PR.prettyPrint()),t.current)return t.current.addEventListener("click",e),function(){t.current.removeEventListener("click",e),A(),U()}},[K,t.current,e]),ae.a.createElement(ae.a.Fragment,null,ae.a.createElement("div",{ref:t,style:Object(ne.a)({},R),className:"".concat(d||""," markdown-body "),dangerouslySetInnerHTML:{__html:K}}))}},ObO0:function(ue,Q,l){"use strict";l.r(Q);var ne=l("cWXX"),V=l("/ezw"),ae=l("+L6B"),de=l("2/Rp"),se=l("9og8"),$=l("tJVT"),z=l("PpiC"),w=l("q1tI"),T=l.n(w),Z=l("Ty5D"),J=l("9kvl"),x=l("1vsH"),le=l("5oB3"),U=l.n(le),oe=l("ErOA"),q=l("m3rI"),ie=l("9Bee");function ee(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ee=function(){return p};var p={},C=Object.prototype,v=C.hasOwnProperty,B=typeof Symbol=="function"?Symbol:{},A=B.iterator||"@@iterator",b=B.asyncIterator||"@@asyncIterator",Y=B.toStringTag||"@@toStringTag";function E(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{E({},"")}catch(t){E=function(r,n,o){return r[n]=o}}function H(t,e,r,n){var o=e&&e.prototype instanceof W?e:W,u=Object.create(o.prototype),s=new R(n||[]);return u._invoke=function(L,P,_){var f="suspendedStart";return function(h,N){if(f==="executing")throw new Error("Generator is already running");if(f==="completed"){if(h==="throw")throw N;return K()}for(_.method=h,_.arg=N;;){var j=_.delegate;if(j){var G=m(j,_);if(G){if(G===y)continue;return G}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(f==="suspendedStart")throw f="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);f="executing";var D=S(L,P,_);if(D.type==="normal"){if(f=_.done?"completed":"suspendedYield",D.arg===y)continue;return{value:D.arg,done:_.done}}D.type==="throw"&&(f="completed",_.method="throw",_.arg=D.arg)}}}(t,r,s),u}function S(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}p.wrap=H;var y={};function W(){}function k(){}function I(){}var X={};E(X,A,function(){return this});var F=Object.getPrototypeOf,a=F&&F(F(M([])));a&&a!==C&&v.call(a,A)&&(X=a);var i=I.prototype=W.prototype=Object.create(X);function c(t){["next","throw","return"].forEach(function(e){E(t,e,function(r){return this._invoke(e,r)})})}function d(t,e){function r(o,u,s,L){var P=S(t[o],t,u);if(P.type!=="throw"){var _=P.arg,f=_.value;return f&&typeof f=="object"&&v.call(f,"__await")?e.resolve(f.__await).then(function(h){r("next",h,s,L)},function(h){r("throw",h,s,L)}):e.resolve(f).then(function(h){_.value=h,s(_)},function(h){return r("throw",h,s,L)})}L(P.arg)}var n;this._invoke=function(o,u){function s(){return new e(function(L,P){r(o,u,L,P)})}return n=n?n.then(s,s):s()}}function m(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,m(t,e),e.method==="throw"))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var n=S(r,t.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,y;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,y):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function g(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(g,this),this.reset(!0)}function M(t){if(t){var e=t[A];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:K}}function K(){return{value:void 0,done:!0}}return k.prototype=I,E(i,"constructor",I),E(I,"constructor",k),k.displayName=E(I,Y,"GeneratorFunction"),p.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===k||(e.displayName||e.name)==="GeneratorFunction")},p.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,I):(t.__proto__=I,E(t,Y,"GeneratorFunction")),t.prototype=Object.create(i),t},p.awrap=function(t){return{__await:t}},c(d.prototype),E(d.prototype,b,function(){return this}),p.AsyncIterator=d,p.async=function(t,e,r,n,o){o===void 0&&(o=Promise);var u=new d(H(t,e,r,n),o);return p.isGeneratorFunction(e)?u:u.next().then(function(s){return s.done?s.value:u.next()})},c(i),E(i,Y,"Generator"),E(i,A,function(){return this}),E(i,"toString",function(){return"[object Generator]"}),p.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}},p.values=M,R.prototype={constructor:R,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(O),!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(_,f){return s.type="throw",s.arg=e,r.next=_,f&&(r.method="next",r.arg=void 0),!!f}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if(u.tryLoc==="root")return n("end");if(u.tryLoc<=this.prev){var L=v.call(u,"catchLoc"),P=v.call(u,"finallyLoc");if(L&&P){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(L){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!P)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.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 u=o;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var s=u?u.completion:{};return s.type=e,s.arg=r,u?(this.method="next",this.next=u.finallyLoc,y):this.complete(s)},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),y},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),O(n),y}},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 u=o.arg;O(n)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},this.method==="next"&&(this.arg=void 0),y}},p}var ce=function(C){var v,B,A,b=C.user,Y=Object(z.a)(C,["user"]),E=Object(w.useState)(1),H=Object($.a)(E,2),S=H[0],y=H[1],W=Object(w.useState)(!1),k=Object($.a)(W,2),I=k[0],X=k[1],F=Object(w.useState)(!1),a=Object($.a)(F,2),i=a[0],c=a[1],d=Object(w.useState)(""),m=Object($.a)(d,2),g=m[0],O=m[1],R=Object(w.useState)(!0),M=Object($.a)(R,2),K=M[0],t=M[1],e=Object(w.useState)([{},{}]),r=Object($.a)(e,2),n=r[0],o=r[1],u=Object(Z.l)(),s=u.pathname;console.log(u,"location"),Object(w.useEffect)(function(){var f;(b==null||((f=b.userInfo)===null||f===void 0)?void 0:f.identity)&&L()},[b==null||((v=b.userInfo)===null||v===void 0)?void 0:v.identity]),Object(w.useEffect)(function(){P()},[]);var L=function(){if(s.includes("classrooms")){var h;(b==null||((h=b.userInfo)===null||h===void 0)?void 0:h.identity)==="student"&&(X(!0),y(2));return}if(s.includes("paths")){c(!0);return}},P=function(){var f=Object(se.a)(ee().mark(function h(N){var j,G,D,_e;return ee().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(oe.a)("/api/introductions.json",{method:"get"});case 2:j=te.sent,(j==null?void 0:j.introductions)&&(G=null,s.includes("classrooms")&&(G="course",O("\u6559\u5B66\u8BFE\u5802")),s.includes("paths")&&(G="subject",O("\u5B9E\u8DF5\u8BFE\u7A0B")),D=j.introductions,_e=[D==null?void 0:D.find(function(re){return re.clazz==="teacher"&&re.page_type===G}),D==null?void 0:D.find(function(re){return re.clazz==="student"&&re.page_type===G})],o(_e)),t(!1);case 5:case"end":return te.stop()}},h)}));return function(N){return f.apply(this,arguments)}}(),_=function(){var h,N,j=q.a.API_SERVER+"/api/attachments/"+(S===1?(h=n[0])===null||h===void 0?void 0:h.attachment_id:(N=n[1])===null||N===void 0?void 0:N.attachment_id);Object(x.r)("",j)};return T.a.createElement("section",{className:U.a.guidance},T.a.createElement(V.a,{loading:K,active:!0,paragraph:{rows:5}},T.a.createElement("div",{className:U.a.title},g,"\u65B0\u624B\u6307\u5F15"),T.a.createElement("ul",{className:U.a.u},!I&&T.a.createElement("li",{onClick:function(){return y(1)},className:S===1?U.a.active:""},"\u6559\u5E08\u7248"),!i&&T.a.createElement("li",{onClick:function(){return y(2)},className:S===2?U.a.active:""},"\u5B66\u751F\u7248")),S===1&&T.a.createElement("div",{className:U.a.content},T.a.createElement(ie.a,{value:((B=n[0])===null||B===void 0?void 0:B.content)||""})),S===2&&T.a.createElement("div",{className:U.a.content},T.a.createElement(ie.a,{value:((A=n[1])===null||A===void 0?void 0:A.content)||""})),T.a.createElement("div",{className:U.a.btn},T.a.createElement(de.a,{type:"primary",onClick:_},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};Q.default=Object(J.a)(function(p){var C=p.user;return{user:C}})(ce)}}]);
|