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.
1 line
23 KiB
1 line
23 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[139],{X0ci:function(t,e,r){},iIVh:function(t,e,r){},nojB:function(t,e,r){"use strict";r.r(e);r("T2oS");var n=r("W9HT"),a=r("9og8"),o=r("tJVT"),i=r("k1fw"),c=r("q1tI"),u=r.n(c),l=(r("X0ci"),r("iIVh"),r("Ty5D")),s=r("55Ip"),f=(r("+L6B"),r("2/Rp")),h=(r("5NDa"),r("5rEg")),p=(r("2qtc"),r("kLXV")),d=(r("miYZ"),r("tsqr")),m=r("PpiC"),v=(r("y8nQ"),r("Vl3Y")),y=(r("DZo9"),r("8z0m")),g=(r("sRBo"),r("kaz8")),w=r("LtfV"),E=r("m3rI"),b=r("Ot1p"),_=g["a"].Group,L=y["a"].Dragger;function O(t,e){var r=new FileReader;r.addEventListener("load",(function(){return e(r.result)})),r.readAsDataURL(t)}var j=function(t){var e=t.callback,r=t.tags,n=void 0===r?[]:r,a=t.initialValues,l=void 0===a?{}:a,s=t.removeAttachment,j=Object(c["useState"])(""),x=Object(o["a"])(j,2),T=x[0],k=x[1],N=v["a"].useForm(),G=Object(o["a"])(N,1),I=G[0];function S(t){var r=t.cover_id,n=t.attachment_ids,a=Object(m["a"])(t,["cover_id","attachment_ids"]);e(Object(i["a"])(Object(i["a"])({},a),{},{cover_id:null===r||void 0===r?void 0:r.map((function(t){return t.response?t.response.id:t.uid}))[(null===r||void 0===r?void 0:r.length)-1],attachment_ids:n?null===n||void 0===n?void 0:n.map((function(t){return t.response?t.response.id:t.uid})):[]}))}function A(t){return Array.isArray(t)?t:t&&t.fileList}var P={multiple:!0,beforeUpload:function(t){var e=t.size/1024/1024<100;if(!e)return d["b"].error("\u8be5\u6587\u4ef6\u65e0\u6cd5\u4e0a\u4f20\u3002\u8d85\u8fc7\u6587\u4ef6\u5927\u5c0f\u9650\u5236(100MB),\u5efa\u8bae\u4e0a\u4f20\u5230\u767e\u5ea6\u4e91\u7b49\u5176\u5b83\u5171\u4eab\u5de5\u5177\u91cc\uff0c\u7136\u540e\u518dtxt\u6587\u6863\u91cc\u7ed9\u51fa\u94fe\u63a5\u4ee5\u53ca\u5171\u4eab\u5bc6\u7801\u5e76\u4e0a\u4f20"),e},action:"".concat(E["a"].API_SERVER,"/api/attachments.json"),onRemove:function(t){p["a"].confirm({centered:!0,okText:"\u786e\u5b9a",cancelText:"\u53d6\u6d88",content:"\u662f\u5426\u786e\u8ba4\u5220\u9664?",onOk:function(){return s(t.response?t.response.id:t.uid)},onCancel:function(){return!1}})}};function F(t){"done"===t.file.status&&O(t.file.originFileObj,(function(t){return k(t)}))}var V={showUploadList:!1,withCredentials:!0,action:"".concat(E["a"].API_SERVER,"/api/attachments.json"),onChange:F};return Object(c["useEffect"])((function(){l.title&&(I.setFieldsValue(l),l.cover_id.length>0&&k(E["a"].IMG_SERVER+l.cover_id[0].url))}),[l]),u.a.createElement(v["a"],{form:I,initialValues:l,className:"moop-panel",onFinish:S},u.a.createElement(v["a"].Item,{label:"\u6807\u9898",name:"title",extra:u.a.createElement("p",{className:"tip"},"\u7b80\u660e\u627c\u8981\u4ecb\u7ecd\u6587\u6863/\u89c6\u9891\u6240\u5305\u542b\u7684\u4e3b\u8981\u7684\u5185\u5bb9"),rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u6807\u9898"}]},u.a.createElement(h["a"],{placeholder:"\u4f8b\u5982\uff1a\u8f6f\u4ef6\u5de5\u7a0b\u6559\u5b66\u6848\u4f8b"})),u.a.createElement("div",{className:"flex-container"},u.a.createElement(v["a"].Item,{label:"\u4f5c\u8005",name:"author_name",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4f5c\u8005\u540d\u79f0"}]},u.a.createElement(h["a"],{placeholder:"\u8bf7\u8f93\u5165\u59d3\u540d",style:{marginRight:20,width:200}})),u.a.createElement(v["a"].Item,{name:"author_school_name",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u4f5c\u8005\u5355\u4f4d\u540d\u79f0"}]},u.a.createElement(h["a"],{placeholder:"\u8bf7\u8f93\u5165\u4f5c\u8005\u5355\u4f4d\u540d\u79f0",style:{width:200}}))),u.a.createElement(v["a"].Item,{name:"tag_ids",label:"\u6807\u7b7e",rules:[{required:!0,message:"\u8bf7\u9009\u62e9\u4e00\u4e2a\u6807\u7b7e"}]},u.a.createElement(_,null,n.map((function(t){return u.a.createElement(g["a"],{key:t.id,value:t.id}," ",t.name," ")})))),u.a.createElement(v["a"].Item,{name:"publish",valuePropName:"checked"},u.a.createElement(g["a"],null,"\u662f\u5426\u7533\u8bf7\u53d1\u5e03")),u.a.createElement(v["a"].Item,{name:"content",label:"\u63cf\u8ff0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8bf7\u8f93\u5165\u63cf\u8ff0\u5185\u5bb9"}]},u.a.createElement(b["a"],{id:"moop_cases_content",height:400})),u.a.createElement(v["a"].Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:A},u.a.createElement(L,P,u.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4e0a\u4f20\u9644\u4ef6"),u.a.createElement("p",{className:"c-grey-c"},"\u4ece\u6211\u7684\u7535\u8111\u9009\u62e9\u8981\u4e0a\u4f20\u7684\u6587\u6863\uff1a\u6309\u4f4fCTRL\u53ef\u4ee5\u4e0a\u4f20\u591a\u4efd\u6587\u6863\u3002\u5355\u4e2a\u6587\u4ef6\u6700\u5927\u9650\u5236\uff1a100MB"))),u.a.createElement(v["a"].Item,{name:"cover_id",label:"\u5c01\u9762\u56fe",extra:"\u4e0a\u4f20\u5c3a\u5bf8\uff1a120*90 px",getValueFromEvent:A,valuePropName:"fileList",rules:[{required:!0,message:"\u8bf7\u4e0a\u4f20\u5c01\u9762\u56fe"}]},u.a.createElement(y["a"],V,T?u.a.createElement("img",{src:T,width:120}):u.a.createElement("a",{title:"\u4e0a\u4f20\u5c01\u9762\u56fe",className:"upload-cover"}," ",u.a.createElement(w["a"],null)," "))),u.a.createElement("div",{className:"desc"},u.a.createElement("h3",null,"\u5ba1\u6838\u8bf4\u660e"),u.a.createElement("p",null," \u5e73\u53f0\u7ba1\u7406\u5458\u5c06\u5bf9\u6bcf\u5929\u65b0\u4e0a\u4f20\u7684\u6587\u6863\u8fdb\u884c\u5ba1\u6838\uff0c\u5ba1\u6838\u901a\u8fc7\u7684\u6587\u6863\u5c06\u516c\u5f00\u663e\u793a\uff0c\u5426\u5219\u5c06\u79c1\u6709\u5316\u6216\u79fb\u9664 ")),u.a.createElement("div",{className:"desc"},u.a.createElement("h3",null,"\u6e29\u99a8\u63d0\u793a"),u.a.createElement("ul",{style:{padding:0}},u.a.createElement("li",null,"1.\u8bf7\u52ff\u4e0a\u4f20\u5df2\u8bbe\u7f6e\u52a0\u5bc6\u53e3\u4ee4\u7684\u6587\u6863\u8d44\u6e90\uff1b"),u.a.createElement("li",null,"2.\u53ef\u4ee5\u4e0a\u4f20\u7b26\u5408\u6559\u5b66\u6848\u4f8b\u6807\u51c6\u7684\u6587\u6863\u8d44\u6599\uff0c\u5982",u.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4f8b\u5165\u5e93\u6807\u51c6 ")," \u3001",u.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4f8b\u4f7f\u7528\u8bf4\u660e\u4e66"),"\u4ee5\u53ca\u5176\u4ed6\u8d44\u6599\u7b49\uff0c\u4e0a\u4f20\u652f\u6301\u7684\u6587\u4ef6\u6700\u5927\u5bb9\u91cf\uff1a100MB\uff1b"),u.a.createElement("li",null,"3.\u8bf7\u786e\u4fdd\u4e0a\u4f20\u5185\u5bb9\u65e0\u4fb5\u6743\u6216\u8fdd\u53cd\u56fd\u5bb6\u5173\u4e8e\u4e92\u8054\u7f51\u653f\u7b56\u7684\u4e0d\u826f\u884c\u4e3a\uff1b"),u.a.createElement("li",null,"4.\u8bf7\u4f7f\u7528Chrome\uff0cFirefox\uff0cSafari\uff0cIE11\uff08\u53ca\u4ee5\u4e0a\u7248\u672c\uff09\u6d4f\u89c8\u5668\uff1b"))),u.a.createElement(v["a"].Item,{style:{marginTop:10}},u.a.createElement(f["a"],{type:"primary",htmlType:"submit"},"\u63d0\u4ea4")))},x=r("wzkS");function T(){T=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",v={};function y(){}function g(){}function w(){}var E={};l(E,i,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(S([])));_&&_!==r&&n.call(_,i)&&(E=_);var L=w.prototype=y.prototype=Object.create(E);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function x(e,r,n){var a=h;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?m:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=m,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function N(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 G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return g.prototype=w,a(L,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},O(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new j(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(L),l(L,u,"Generator"),l(L,i,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(G),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&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,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;G(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}var k={loading:!1,data:{},tags:[]},N=function(t){return t[t["GET_DATA"]=0]="GET_DATA",t[t["SET_LOADING"]=1]="SET_LOADING",t[t["GET_TAGS"]=2]="GET_TAGS",t}(N||{});function G(t,e){switch(e.type){case N.GET_DATA:return Object(i["a"])(Object(i["a"])({},t),e.payload);case N.GET_TAGS:return Object(i["a"])(Object(i["a"])({},t),{},{tags:e.payload});case N.SET_LOADING:return Object(i["a"])(Object(i["a"])({},t),{},{loading:e.payload});default:throw new Error}}e["default"]=function(){var t=Object(l["m"])(),e=t.caseId,r=Object(l["k"])(),i=Object(c["useReducer"])(G,k),f=Object(o["a"])(i,2),h=f[0],p=f[1],d=h.loading,m=h.tags,v=h.data;function y(t){return g.apply(this,arguments)}function g(){return g=Object(a["a"])(T().mark((function t(n){var a,o;return T().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e){t.next=6;break}return t.next=3,Object(x["e"])(e,n);case 3:r.push("/moop_cases/".concat(e,"/publish-success")),t.next=11;break;case 6:return t.next=8,Object(x["a"])(n);case 8:a=t.sent,o=a.id,o&&r.push("/moop_cases/".concat(o,"/publish-success"));case 11:case"end":return t.stop()}}),t)}))),g.apply(this,arguments)}Object(c["useEffect"])((function(){function t(){return e.apply(this,arguments)}function e(){return e=Object(a["a"])(T().mark((function t(){var e;return T().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(x["b"])();case 2:e=t.sent,p({type:N.GET_TAGS,payload:e.library_tags});case 4:case"end":return t.stop()}}),t)}))),e.apply(this,arguments)}t()}),[]),Object(c["useEffect"])((function(){var t=!1;function n(){return o.apply(this,arguments)}function o(){return o=Object(a["a"])(T().mark((function n(){var a,o,i,c,u,l,s,f,h;return T().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return p({type:N.SET_LOADING,payload:!1}),n.next=3,Object(x["c"])(e);case 3:a=n.sent,o=a.author_name,i=a.author_school_name,c=a.content,u=a.cover,l=a.attachments,s=a.status,f=a.title,h=a.tags,t||(404===a.status?r.push("/moop_cases"):p({type:N.GET_DATA,payload:{data:{title:f,author_name:o,author_school_name:i,content:c,tag_ids:h.map((function(t){return t.id})),publish:"published"===s,attachment_ids:l.map((function(t){return{uid:t.id,id:t.id,name:t.title,url:t.url,filesize:t.filesize,status:"done"}})),cover_id:(null===u||void 0===u?void 0:u.id)?[{uid:null===u||void 0===u?void 0:u.id,id:null===u||void 0===u?void 0:u.id,name:null===u||void 0===u?void 0:u.title,url:null===u||void 0===u?void 0:u.url,filesize:null===u||void 0===u?void 0:u.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return n.stop()}}),n)}))),o.apply(this,arguments)}return!t&&e&&n(),function(){t=!0}}),[e]);var w={initialValues:v,tags:m,removeAttachment:x["d"],callback:y};return u.a.createElement(n["a"],{spinning:d,delay:500},u.a.createElement("div",{className:"moop-info"},u.a.createElement("div",{className:"crumb"},u.a.createElement(s["Link"],{to:"/moop_cases"},"\u6559\u5b66\u6848\u4f8b > "),u.a.createElement("span",null,"\u65b0\u5efa")),u.a.createElement("div",{className:"title"},u.a.createElement("h2",null,"\u4e0a\u4f20\u6559\u5b66\u6848\u4f8b"),u.a.createElement(s["Link"],{to:"/moop_cases"},"\u8fd4\u56de")),u.a.createElement(j,w)))}},wzkS:function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"b",(function(){return c})),r.d(e,"d",(function(){return u})),r.d(e,"a",(function(){return s})),r.d(e,"e",(function(){return f}));var n=r("9og8"),a=r("ErOA");function o(){o=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:T(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",d="suspendedYield",m="executing",v="completed",y={};function g(){}function w(){}function E(){}var b={};s(b,c,(function(){return this}));var _=Object.getPrototypeOf,L=_&&_(_(S([])));L&&L!==r&&n.call(L,c)&&(b=L);var O=E.prototype=g.prototype=Object.create(b);function j(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,c){var u=h(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function T(e,r,n){var a=p;return function(o,i){if(a===m)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===p)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var l=h(e,r,n);if("normal"===l.type){if(a=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=h(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function N(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 G(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function S(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return w.prototype=E,a(O,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=s(E,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,s(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},j(x.prototype),s(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(f(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(O),s(O,l,"Generator"),s(O,c,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(G),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&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,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),G(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;G(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function i(t){return Object(a["c"])("libraries/".concat(t,".json"))}function c(){return Object(a["c"])("library_tags.json")}function u(t){return l.apply(this,arguments)}function l(){return l=Object(n["a"])(o().mark((function t(e){var r;return o().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(a["b"])("attachments/".concat(e,".json"));case 2:return r=t.sent,t.abrupt("return",0===r.status);case 4:case"end":return t.stop()}}),t)}))),l.apply(this,arguments)}function s(t){return Object(a["f"])("libraries.json",t)}function f(t,e){return Object(a["g"])("libraries/".concat(t,".json"),e)}}}]); |