(self.webpackChunk=self.webpackChunk||[]).push([[51582,39752],{66455:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},o=null,i=!1,r=!1,a=null,l=!1,s=null,c=null,u=0;u4?parseFloat(e):5};function _(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,O(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(s=e,Z(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){y=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var o,i="auto",r=n.id,a=!1,s=0;s=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var C=function(e){return e&&"false"!==e},T=function(t,n,o){x(m)<=4.2&&(o=!0);var i=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(i=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var r=document.createElement("div");r.classList.add("appletParameters","notranslate");var a=n.width,l=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(x(m)<=4.4)C(n.showToolBar)&&(n.height-=7),C(n.showAlgebraInput)&&(n.height-=37),n.width<605&&C(n.showToolBar)&&(n.width=605,a=605);else{var u=100;(C(n.showToolBar)||C(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=C(n.showMenuBar)?245:155),a=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),f(e)},b||w.appendChild(_)):r.appendChild(_),w.appendChild(r),b||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),I("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function S(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},x(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(i){scriptLoadStarted=!0;for(var j=0;j0?(i.remove(),l.attr("id","fullscreencontent").show(),jQuery(r).append(l),window.dispatchEvent(new Event("resize"))):T(i,t,!1),window.GGBT_wsf_view.launchFullScreen(r)}else h=o,T(e,t,!1);if(!window.GGBT_wsf_view)for(a=0;ae/4*3&&(l=e/4*3),s=l/5.8,a.setAttribute("src",b),a.setAttribute("width",l),a.setAttribute("height",s);var u=(e-l)/2,d=(t-s)/2;a.style.left=u+"px",a.style.top=d+"px",i.appendChild(a)}return i.appendChild(c),i},A=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},G=["web","webSimple","web3d","tablet","tablet3d","phone"],Z=function(e,t){if(m=e,t)O(m,!0);else{var r,a,l=!i;if(l){var s=x(m);!isNaN(s)&&s<4.4&&(l=!1)}r="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in a=c>0?m:0===c?r+m:"https://www.geogebra.org/apps/5.2.814.0/",G)if(m.slice(-1*G[u].length)===G[u]||m.slice(-1*(G[u].length+1))===G[u]+"/")return void O(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||o.is3D||o.AV||o.SV||o.CV||o.EV2||o.CP||o.PC||o.DA||o.FI||o.PV||C(n.showToolBar)||C(n.showMenuBar)||C(n.showAlgebraInput)||C(n.enableRightClick)||n.appName&&"classic"!=n.appName?a+="web3d/":a+="webSimple/",O(a,!1)}},O=function(e,t){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===t&&(t=-1===e.indexOf("http")),f=t,g="web.nocache.js",v=!1;var n=p.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?G.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var o=parseFloat(m);NaN!==o&&o<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+o+" is deprecated. Using version latest instead."),Z("5.0",t))}},I=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function R(){var e=t;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),Z(e,!1),null!==c&&O(c,f),l=!0}return void 0!==n.material_id?S(R):R(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,o,i){if(e.isScreenshoGenerator)return 1;var r,a=void 0!==o&&o,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(r=e.autoHeight)&&"false"!==r,c=function(e,t,n,o,i,r){var a=null;if(null!=r&&""!=r)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+r+" ")>-1){a=l;break}l=l.parentNode}var s=0,c=0,u=0,d=0,p=0,f=0,h=0;if(a)s=a.offsetWidth,c=Math.max(o?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=s&&(void 0===i||!i)&&("rtl"===document.dir?(p=s-m.width-m.left,f=u<=480?10:30):(f=m.left,p=u<=480?10:30),d=f+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,h=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,h=40))}return e&&((void 0===n||!n)&&t>0&&t+d1&&(a=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?r:(i=n(e,t,a,o,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==r?Math.min(r,i):i)}function i(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),o=e.getBoundingClientRect(),i=(t-o.width)/2,r=(n-o.height)/2;r<0&&(r=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=i<40?"40px":i+"px",e.style.top=r+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=r<40?"40px":r+"px",e.style.left=i+"px")}return{responsiveResize:function(n,r){var a=n.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(r.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var l=o(r,n);e()&&a.setAttribute("data-param-scale",l);for(var s=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var o=e.lastIndexOf(tb,Math.min(n,t));return o>=O?e.substring(O,o+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;nO?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,o=[],i=[];function a(e){var t=i[e](),n=o[e];if(t in n)return t;var a=[];for(var l in n)a[n[l]]=l;throw r&&r(e,a,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in o[e]},webModule.__getPropMap=function(){var e={};for(var t in o)o.hasOwnProperty(t)&&(e[t]=a(t));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},o=e[webModule.__softPermutationId],i=O;i0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],o=0;o0&&(s=[],null==n||null===(o=n.data)||void 0===o||o.map((function(e){var t;null==e||null===(t=e.ec_point_ids)||void 0===t||t.map((function(e){s.push(e)}))})),h(a()(a()({},null==n||null===(r=n.data)||void 0===r?void 0:r[0]),{},{ec_point_ids:s})),x(null==n?void 0:n.data));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(){return(N=u()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.ZP)("/api/schools/".concat(null==o||null===(t=o.userInfo)||void 0===t||null===(t=t.course)||void 0===t?void 0:t.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:n=e.sent,C(null==n?void 0:n.data),(d||l)&&T();case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,f.useEffect)((function(){var e;null!=o&&null!==(e=o.userInfo)&&void 0!==e&&null!==(e=e.course)&&void 0!==e&&e.course_school_id&&function(){N.apply(this,arguments)}()}),[null==o||null===(t=o.userInfo)||void 0===t||null===(t=t.course)||void 0===t?void 0:t.course_school_id]),(0,_.jsxs)("div",{style:{display:null!==(n=o.userInfo.course)&&void 0!==n&&n.is_openengineering?"":"none"},children:[(0,_.jsx)("p",{style:{fontSize:"16px",fontWeight:400},children:"工程认证考核知识点"}),null==y?void 0:y.map((function(e,t){return(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"},children:[(0,_.jsx)(k,{rz:B,item:e,type:t,setitem:function(e){y.splice(t,1,e),x(s()(y));var n=[];null==y||y.map((function(e){var t;null==e||null===(t=e.ec_point_ids)||void 0===t||t.map((function(e){n.push(e)}))})),h(a()(a()({},e),{},{ec_point_ids:n}))}}),0!=t&&(0,_.jsx)(g.Z,{onClick:function(){y.splice(t,1),x(s()(y))},style:{marginLeft:10,fontSize:"20px"}}),(0,_.jsx)(v.Z,{onClick:function(){y.push({}),x(s()(y))},style:{marginLeft:10,fontSize:"20px"}})]},t)}))]})})))},74908:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var o=n(7557),i=n.n(o),r=n(41498),a=n.n(r),l=n(79800),s=n.n(l),c=n(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",f=n(92310),h=n.n(f),m=n(71418),g=n(2859),v=n(51136),w=n(6457),b=n(37712),y=function(e){var t=e.data,n=e.className,o=e.fullWidth,r=e.style,l=void 0===r?{}:r,f=e.onClose,y=e.onOk,x=e.showFullTools,_=e.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),j=(0,c.useState)(!1),B=s()(j,2),C=B[0],T=B[1],P=(0,c.useState)("正在加载中"),N=s()(P,2),L=N[0],E=N[1];(0,c.useEffect)((function(){null!=t&&t.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=t&&t.src&&M()}),[null==t?void 0:t.visible]);var M=function(){var e=a()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){G()},T(!1),E("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=a()(i()().mark((function e(n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(o=e.sent)||!o.id||_){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==o?void 0:o.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&y(),e.next=13;break;case 12:null!=o&&o.id&&y(o);case 13:T(!1),E("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),G=function(){S.current=new g.hP(k.current),S.current.addEventListener("render",A),S.current.addEventListener("beforeclose",f),x&&(S.current.availableMarkerTypes=S.current.ALL_MARKER_TYPES,S.current.uiStyleSettings.redoButtonVisible=!0,S.current.uiStyleSettings.notesButtonVisible=!0,S.current.uiStyleSettings.zoomButtonVisible=!0,S.current.uiStyleSettings.zoomOutButtonVisible=!0,S.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=S.current.uiStyleSettings,S.current.show(),null!=t&&t.snapshotData&&S.current.restoreState(t.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsxs)("div",{className:h()(u,n,o?p:""),style:l,children:[(0,b.jsx)(m.Z,{spinning:C,tip:L,style:{position:"absolute"}}),(0,b.jsx)("img",{className:d,ref:k})]})})}},42658:function(e,t,n){"use strict";n.d(t,{z:function(){return B},Z:function(){return C}});var o=n(7557),i=n.n(o),r=n(41498),a=n.n(r),l=n(82242),s=n.n(l),c=n(37205),u=n.n(c),d=n(79800),p=n.n(d),f=n(59301),h=n(46651),m=n(8591),g=n(43418),v=n(3113),w=n(27065),b=n(28838),y=n(37712),x="  ";function _(e){if(0==e)return"0 Byte";var t=parseInt(""+Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,t)).toFixed(1)+" "+["Bytes","KB","MB","GB","TB"][t]}var k=n(93737),S=n(89392);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var j=h.Z.Dragger;function B(e){var t=[];return e&&e.length>0&&(t=e.map((function(e){return{uid:e.id,id:e.id,name:e.title+x+e.filesize,url:e.url,filesize:e.filesize,status:"done",response:{id:e.id}}}))),t}var C=function(e){var t=e.value,n=e.onChange,o=e.action,r=e.data,l=e.className,c=e.maxSize,d=void 0===c?150:c,B=e.title,C=void 0===B?"上传附件":B,T=e.showRemoveModal,P=void 0!==T&&T,N=e.accept,L=void 0===N?"":N,E=e.additionalText,M=e.isDragger,A=e.number,G=void 0===A?1e3:A,Z=e.aloneClear,O=void 0!==Z&&Z,I=(0,f.useState)(!1),R=p()(I,2),D=R[0],F=R[1],z=(0,f.useState)(t||[]),W=p()(z,2),H=W[0],V=W[1],q=(0,f.useState)(1),U=p()(q,2),K=U[0],Y=U[1];(0,f.useEffect)((function(){t&&(1===K&&V(u()(t)),Y(2),G===(null==t?void 0:t.length)&&F(!0))}),[t]);var J,X=function(){setTimeout((function(){H.pop(),V(u()(H))}),500)},$={multiple:!0,disabled:D,accept:L,withCredentials:!0,fileList:H,beforeUpload:function(e,t){var n=e.size/1024/1024;return H.concat(t).length>G?(H.pop(),V(u()(H)),m.ZP.error("最多只能上传".concat(G,"个文件")),O?Promise.reject():(X(),!1)):n=G?F(!0):F(!1),V(u()(H)),H=H.map((function(e){var t,n;null!=e&&null!==(t=e.response)&&void 0!==t&&t.id&&(e.url="/api/attachments/".concat(null==e||null===(n=e.response)||void 0===n?void 0:n.id));return-1===e.name.indexOf(x)&&(e.name="".concat(e.name).concat(x).concat(_(e.size))),s()({},e)})),console.log("info:",e,H),n(H)):m.ZP.error(null===(o=e.file)||void 0===o||null===(o=o.response)||void 0===o?void 0:o.message)},onRemove:(J=a()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(){var e=a()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.response?t.response.id:t.id)){e.next=8;break}return e.next=4,(0,b.JZ)(t.response?t.response.id:t.uid);case 4:return n=e.sent,e.abrupt("return",Promise.resolve(n));case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!P){e.next=5;break}return e.abrupt("return",new Promise((function(e,t){var o;g.Z.confirm({centered:!0,width:530,okText:"确定",cancelText:"取消",title:"提示",content:(0,y.jsx)("div",{className:"tc font16",children:"是否确认删除?"}),onOk:(o=a()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:t.sent,m.ZP.success("删除成功"),e(!0);case 5:case"end":return t.stop()}}),t)}))),function(){return o.apply(this,arguments)}),onCancel:function(){return e(!1)}})})));case 5:return e.next=7,n();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)}))),function(e){return J.apply(this,arguments)})};return(0,y.jsxs)("div",{className:"multi-upload ".concat(l||""),children:[M&&(0,y.jsxs)(j,s()(s()({},$),{},{children:[(0,y.jsx)("p",{className:"ant-upload-drag-icon",children:(0,y.jsx)(k.Z,{})}),(0,y.jsxs)("p",{className:"ant-upload-text",children:["点击上传图标,选择要上传的文件或将文件拖拽到此",(0,y.jsx)("br",{}),"(单个文件最大限制为",d,"MB)"," "]}),E]})),!M&&(0,y.jsxs)(h.Z,s()(s()({},$),{},{children:[(0,y.jsxs)(v.ZP,{disabled:D,className:"upload_button",children:[(0,y.jsx)("img",{className:"aBtn_img",src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4="}),C]}),(0,y.jsxs)("span",{onClick:function(e){e.preventDefault(),e.stopPropagation()},className:"upload_text",children:["(单个文件最大",d,"MB)"," "]})]}))]})}},37507:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var o=n(82242),i=n.n(o),r=n(79800),a=n.n(r),l=n(59301),s=n(57809),c=n(78241),u=n(3113),d=n(89780),p=n.n(d),f=(n(81974),n(3693),n(37712)),h=s.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};function v(e){var t=e.value,n=e.onChange,o=e.mode,r=e.options,s=void 0===r?{}:r,c=(0,l.useRef)(),u=(0,l.useState)(),d=a()(u,2),h=d[0],m=d[1];return(0,l.useEffect)((function(){if(h){var e=function(e){var t=e.getValue();n&&n(t)};return h.on("change",e),function(){h.off("change",e)}}}),[h,n]),(0,l.useEffect)((function(){h&&h.setOption("mode",o)}),[h,o]),(0,l.useEffect)((function(){h&&(t===h.getValue()&&""!==t||setTimeout((function(){h.setValue(t||"")}),300))}),[h,t]),(0,l.useEffect)((function(){if(c.current&&!h){var e=p().fromTextArea(c.current,i()({mode:o,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));m(e)}}),[c.current,h]),(0,f.jsx)("div",{className:"my-codemirror-container",children:(0,f.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,o=(0,l.useState)("python"),r=a()(o,2),d=r[0],p=r[1];return(0,f.jsxs)(c.Z,i()(i()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,f.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,f.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,f.jsx)(h,{value:e,children:g[e][0]},e)}))})}),(0,f.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,f.jsx)(v,{mode:d})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},11094:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ce}});var o=n(91232),i=n.n(o),r=n(79800),a=n.n(r),l=n(85573),s=n.n(l),c=n(59301),u=n(89780),d=n.n(u),p=n(76374),f=(n(81974),n(6313),n(25717),n(99498),n(25419),n(67549),n(42783)),h=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,o=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:o}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,o=e.icon,i=e.actionName,r=e.className,a=void 0===r?"":r,l=e.children;return(0,h.jsxs)("a",{title:n,className:a,onClick:function(){t(i)},children:[(0,h.jsx)("i",{className:"".concat(o)}),l]})}var y=function(e){var t=e.watch,n=e.showNullButton,o=e.showNullProgramButton,i=e.onActionCallback,r=e.fullScreen,a=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!l&&c.map((function(e,t){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(b,v()(v()({},e),{},{onActionCallback:i})):(0,h.jsx)("span",{className:"v-line"})},t)})),n?(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:i,children:(0,h.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,o?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:i,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:i,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:i,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,h.jsx)("li",{children:s}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(b,{icon:"".concat(r?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:i})})]})},x=n(27308),_=n(78241),k=n(98135),S=n(3113),j={labelCol:{span:4},wrapperCol:{span:20}},B=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(_.Z,v()(v()({},j),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(_.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,h.jsx)(k.Z,{})}),(0,h.jsx)(_.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,h.jsx)(k.Z,{})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},C=n(37507),T=n(8591),P=n(55087),N=_.Z.useForm,L={width:280,marginRight:10},E={labelCol:{span:5},wrapperCol:{span:19}},M=function(e){var t=e.callback,n=e.onCancel,o=N(),i=a()(o,1)[0],r=(0,c.useRef)();function l(e,t){-1!==e.status?i.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):T.ZP.error(e.message)}return(0,h.jsxs)(_.Z,v()(v()({form:i},E),{},{className:"upload-image-panel",onFinish:function(e){t(e,r.current)},style:{width:470,overflow:"hidden"},children:[(0,h.jsx)(_.Z.Item,{label:"图片地址",required:!0,children:(0,h.jsxs)("div",{className:"flex-container",children:[(0,h.jsx)(_.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,h.jsx)(k.Z,{style:L})}),(0,h.jsx)(A,{onFileChange:function(e){var t=e.target.files[0];r.current=t,G(t,l)}})]})}),(0,h.jsx)(_.Z.Item,{label:"图片描述",name:"alt",children:(0,h.jsx)(k.Z,{style:{width:264}})}),(0,h.jsxs)(_.Z.Item,{style:{textAlign:"right"},children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function A(e){var t=e.onFileChange;return(0,h.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,h.jsx)("input",{type:"file",onChange:t})]})}function G(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var o=new window.XMLHttpRequest;o.withCredentials=!0,o.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),o.addEventListener("error",(function(e){console.error(e)}),!1),o.open("POST","".concat(P.KI,"/api/attachments.json")),o.send(n)}var Z=n(95237),O=n(74908),I=function(e){var t=e.callback,n=e.onCancel,o=document.createElement("canvas"),i=o.getContext("2d");o.width=1e3,o.height=800,i.fillStyle="#ffffff",i.fillRect(0,0,o.width,o.height);var r=o.toDataURL("image/png");return(0,h.jsx)(Z.Z,{style:{height:"100vh"},children:(0,h.jsx)(O.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:r,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},R=n(7557),D=n.n(R),F=n(41498),z=n.n(F),W=n(37205),H=n.n(W),V=n(12378);function q(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(q,go.CommandHandler),q.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},q.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},q.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},q.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},q.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},q.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},q.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},q.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var o=0;o0){for(var o=a.elt(l-1);null!==o&&o.isTreeExpanded&&!o.isTreeLeaf;){o=this._sortTreeChildrenByY(o).last()}null!==o&&e.select(o)}else e.select(r)}else if("Down"===n.key){var i;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(i=this._sortTreeChildrenByY(t).first())&&e.select(i);else for(;null!==t;){var r,a,l;if(null===(r=t.findTreeParentNode()))break;if((l=(a=this._sortTreeChildrenByY(r)).indexOf(t))o.y?1:n.xo.x?1:0})),t},q.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},q.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(q.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(q.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var U=q,K=(n(31270),n(85160)),Y=n(43418),J=n(43604),X=n(51136),$="myPaletteDiv___Xjz2I",Q="maxH60___Pd4Re";window.go=V;var ee=function(e){var t=e.onCancel,n=e.callback,o=(0,c.useRef)(),i=(0,c.useRef)(),r=(0,c.useRef)(),l=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useState)(0),d=a()(u,2),p=d[0],f=d[1],m=function(){var e=z()(D()().mark((function e(){var t,i;return D()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.current.makeImage(),e.next=3,(0,X.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:i=e.sent,n({src:i.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){f(p+1)}),[]),(0,h.jsx)("div",{ref:s,className:l.current?"".concat(Q," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:s.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(Z.Z,{children:[(0,h.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(J.Z,{onClick:function(){l.current=!l.current,f(p+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,h.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,h.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,h.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,h.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,h.jsx)("div",{style:{height:"calc(100% - 50px)"},className:$,ref:r})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(K.FI,{initDiagram:function(){var e=V.GraphObject.make,t="#ff3333",n="#3358ff",a="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",f="#d5ebff",h="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function b(t,n){var o=function(e,n){e.handled=!0,e.diagram.model.commit((function(o){var i=n.part.adornedPart,r=(new V.Point).setRectSpot(i.actualBounds,t);r.subtract(i.location),r.scale(2,2),r.x+=130*Math.sign(r.x),r.y+=130*Math.sign(r.y),r.add(i.location),r.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=o.copyNodeData(i.data);o.setGroupKeyForNodeData(a,o.getGroupKeyForNodeData(i.data)),o.addNodeData(a);var l={from:i.key,to:o.getKeyForNodeData(a)};o.addLinkData(l);var s=e.diagram.findNodeForData(a);s.location=r,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?25:18,height:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:o,contextClick:o})}function y(t){return e(V.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function x(e,t){return function(n,o){n.handled=!0,n.diagram.model.commit((function(n){n.set(o.part.adornedPart.data,e,t)}))}}function _(t,n){return n||(n="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:x(n,t),contextClick:x(n,t)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(u,"fill"),_(p,"fill"),_(f,"fill"),_(h,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(g,"fill"),_(v,"fill"),_(m,"fill"),_(w,"fill")))]}function S(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(d),_(a),_(n),_(t))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(u),_(l),_(s),_(c)))]}function j(t,n){return n||(n="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function B(t,n){return n||(n="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function C(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(1),j(2),j(3),j(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",B(null),B([2,4]),B([4,4])))]}function T(t,n){return n||(n="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:x(n,t),contextClick:x(n,t)})}function P(t){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function N(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x("dir",t),contextClick:x("dir",t)})}function L(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var o=n.part.adornedPart;e.set(o.data,t?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(t?o.toNode:o.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var o=0,i=V.Spot.RightSide;t.equals(V.Spot.Top)?(o=270,i=V.Spot.TopSide):t.equals(V.Spot.Left)?(o=180,i=V.Spot.LeftSide):t.equals(V.Spot.Bottom)&&(o=90,i=V.Spot.BottomSide),n||(o-=180);var r=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var o=t.part.adornedPart;e.set(o.data,n?"toSpot":"fromSpot",V.Spot.stringify(i)),(n?o.toNode:o.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:o,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:r,contextClick:r})}return o.current=new V.Diagram(i.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(U),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),o.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),o.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),o.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),b(V.Spot.Top,"TriangleUp"),b(V.Spot.Left,"TriangleLeft"),b(V.Spot.Right,"TriangleRight"),b(V.Spot.Bottom,"TriangleDown"),y({alignment:new V.Spot(.75,0)})),o.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",T("Rectangle"),T("RoundedRectangle"),T("Ellipse"),T("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Parallelogram2"),T("ManualOperation"),T("Procedure"),T("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Terminator"),T("CreateRequest"),T("Document"),T("TriangleDown"))),k(),S(),C()),o.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),o.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),y({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),o.current.groupTemplate.contextMenu=e("ContextMenu",k(),S(),C()),o.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),o.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:P(2)},new V.Binding("pathPattern","thickness",P)),y({alignmentFocus:new V.Spot(0,0,-6,-4)})),o.current.linkTemplate.contextMenu=e("ContextMenu",S(),C(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",L(!1),E(V.Spot.Top,!1),E(V.Spot.Left,!1),E(V.Spot.Right,!1),E(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},L(!0),E(V.Spot.Top,!0),E(V.Spot.Left,!0),E(V.Spot.Right,!0),E(V.Spot.Bottom,!0))))),new V.Palette(r.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(H()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){o.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),o.current.grid.visible=!0,o.current.grid.gridCellStroke="darkgray",o.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=o.current,o.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,h.jsx)("div",{ref:i})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(S.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},te=n(5112),ne=n(54449),oe=te.ZP.Group,ie={margin:"0 8px"},re=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(_.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:ie,children:"单元格数:"}),(0,h.jsx)("span",{style:ie,children:"行数"}),(0,h.jsx)(_.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(ne.Z,{})}),(0,h.jsx)("span",{style:ie,children:"列数"}),(0,h.jsx)(_.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(ne.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:ie,children:"对齐方式:"}),(0,h.jsx)(_.Z.Item,{name:"align",children:(0,h.jsxs)(oe,{children:[(0,h.jsx)(te.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(te.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(te.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(te.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},ae=n(78673),le=n(66455),se=n.n(le),ce=(0,c.forwardRef)((function(e,t){var n=e.use3d,o=e.width,i=e.height,r=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),p=d[0],f=d[1],m=(0,c.useRef)({id:l,appName:"graphing",width:o||1e3,height:i||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(se())(m.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return r&&r(e),e};return(0,c.useEffect)((function(){m.current.appName=p?"3D":"graphing",s.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){f(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:l}),(0,h.jsxs)(Z.Z,{align:"middle",children:[(0,h.jsx)(J.Z,{flex:1,children:(0,h.jsx)(ae.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return f(e)}})}),(0,h.jsx)(J.Z,{children:(0,h.jsx)(S.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ue=n(33773),de=n(27065),pe="link",fe="upload-image",he="add-flowchart",me="draw-image",ge="code-block",ve="add-table",we="------------",be={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},ye=n(56266);var xe="@▁▁@",_e=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Se=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",je=s()(s()({},Se+"-B","bold"),Se+"-I","italic"),Be=s()(s()(s()(s()(s()(s()(s()(s()({},pe,"添加链接"),ge,"添加代码块"),fe,"添加图片"),me,"添加画图"),he,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ce=function(e){var t=e.defaultValue,n=void 0===t?"":t,o=e.onChange,r=e.width,l=void 0===r?"100%":r,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,b=e.isFocus,_=void 0!==b&&b,k=e.watch,S=e.insertTemp,j=e.mode,P=void 0===j?"markdown":j,N=e.id,L=void 0===N?"markdown-editor-id":N,E=e.showResizeBar,A=void 0!==E&&E,Z=e.noStorage,O=void 0!==Z&&Z,R=e.showNullButton,D=void 0!==R&&R,F=e.showNullProgramButton,z=void 0!==F&&F,W=e.hidetoolBar,H=void 0!==W&&W,V=e.fullScreen,q=void 0!==V&&V,U=e.onBlur,K=e.onCMBeforeChange,J=e.onFullScreen,X=e.className,$=void 0===X?"":X,Q=e.disablePaste,te=void 0!==Q&&Q,ne=e.disabled,oe=void 0!==ne&&ne,ie=e.disabledFill,ae=void 0!==ie&&ie,le=e.placeholder,se=void 0===le?"":le,we=e.values,Se=void 0===we?"":we,Ce=e.extraUse,Te=(0,c.useState)(null),Pe=a()(Te,2),Ne=Pe[0],Le=Pe[1],Ee=(0,c.useState)(n),Me=a()(Ee,2),Ae=Me[0],Ge=Me[1],Ze=(0,c.useState)(k),Oe=a()(Ze,2),Ie=Oe[0],Re=Oe[1],De=(0,c.useState)(q),Fe=a()(De,2),ze=Fe[0],We=Fe[1],He=(0,c.useState)(""),Ve=a()(He,2),qe=Ve[0],Ue=Ve[1],Ke=(0,c.useState)(0),Ye=a()(Ke,2),Je=Ye[0],Xe=Ye[1],$e=(0,c.useState)(g),Qe=a()($e,2),et=Qe[0],tt=Qe[1],nt=(0,c.useState)(!1),ot=a()(nt,2),it=(ot[0],ot[1]),rt=(0,c.useState)(0),at=a()(rt,2),lt=at[0],st=at[1],ct=(0,c.useState)(0),ut=a()(ct,2),dt=ut[0],pt=ut[1],ft=(0,c.useRef)(),ht=(0,c.useRef)(),mt=(0,c.useRef)(),gt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Ge(Se),null==Ne||Ne.setValue(Se),window.scrollTo(0,e)}),[Se]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(ft.current){var e=function(e,n){if(!te){var o=n.clipboardData;if(o){var i=o.types.toString(),r=o.items;if("Files"===i||o.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==P)return;try{var a,l=r[1];"file"===(null===(a=r[0])||void 0===a?void 0:a.kind)&&(l=r[0]);var s=l.getAsFile(),c=s.name.split(".").pop();G(s,(function(e){var n,o,i;e.id?(null==s||null===(n=s.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==s||null===(o=s.type)||void 0===o?void 0:o.indexOf("video"))>-1?t.replaceSelection('')):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("pdf"))>-1?t.replaceSelection('').concat(s.name,"")):_e.includes(c)?t.replaceSelection('').concat(s.name,"")):t.replaceSelection("[".concat(s.name,"](").concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){T.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=d().fromTextArea(ft.current,{mode:P,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",se):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),o=n.getCursor(),i=n.getLine(o.line),r=i.charAt(o.ch-1),a=i.lastIndexOf("@▁@",o.ch),l=i.lastIndexOf("@▁▁@",o.ch),s=a>l?a:l,c=a>l?3:4;if(-1===xe.indexOf(r))return null;if(console.log("change1:",t,e,i,o,s,a,l,r),s>=0&&o.ch-s<5){var u=s+c;return n.replaceRange("",{line:o.line,ch:s},{line:o.line,ch:u}),{line:o.line,ch:u}}return null}(e);n&&t.preventDefault()}})),_&&t.focus(),t.on("paste",e),oe&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Le(t),function(){t.off("paste",e)}}}),[]);var vt=(0,c.useCallback)((function(){ht.current}),[et,ht,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var t,n=i()(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;(o.target.offsetHeight>0||o.target.offsetWidth>0)&&(vt(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(ft.current.parentElement),e}();return function(){var t,n;null!==(t=ft.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=ft.current)||void 0===n?void 0:n.parentElement)}}}),[Ne,vt]),(0,c.useEffect)((function(){if(Ne){for(var e=[],t=function(){var t=a()(o[n],2),i=t[0],r=t[1],l=s()({},i,(function(){wt(r)}));e.push(l),Ne.addKeyMap(l)},n=0,o=Object.entries(je);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(L);e>=Je+1e4&&(!t||t!==Ae)&&(window.sessionStorage.setItem(L,Ae),it(!0))}}),1e4),(0,c.useEffect)((function(){Re(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&_&&Ne.focus()}),[Ne,_]),(0,c.useEffect)((function(){if(Ie&&Ne){var e=function(e){var t=e.target;if(gt.current){var n=t.scrollTop/t.scrollHeight;gt.current.scrollTop=gt.current.scrollHeight*n}},t=Ne.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ne,Ie]),(0,c.useEffect)((function(){if(Ne&&K){var e=function(e,t){K(e,t)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,K]),(0,c.useEffect)((function(){if(Ne&&U){var e=function(){U(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,U]),(0,c.useEffect)((function(){if(Ne){var e=function(e,t){var n=e.getValue();Ge(n),Xe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),o&&(z?o(n,kt(n)):o(n))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,o]),(0,c.useEffect)((function(){if(Ne)if(null==n)Ne.setValue(""),Ge("");else{var e=window.scrollY||window.pageYOffset;n!==Ne.getValue()&&(Ne.setValue(n),Ge(n),Ne.setCursor(oe?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,n]);var wt=(0,c.useCallback)((function(e){var t=Ne.getCursor(),n=Ne.getSelection(),o=n.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+n+"**"),""===n&&Ne.setCursor(t.line,t.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+n+"*"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+n+"`"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"inline-latex":return Ue("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+n+"\n```"),Ne.setCursor(t.line+1,n.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===n?Ne.replaceSelection("- "+n):Ne.replaceSelection(o.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===n?Ne.replaceSelection("1. "+n):Ne.replaceSelection(o.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection(xe),Ne.focus();case"inster-template-1":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return Re(!Ie),Ne.focus();case"trigger-full-screen":return We(!ze),Ne.focus();case pe:return void Ue(pe);case ge:return void Ue(ge);case fe:return void Ue(fe);case me:return void Ue(me);case"maths-latex":return void Ue("maths-latex");case he:return void Ue(he);case ve:return void Ue(ve);default:throw new Error}}),[Ne,Ie,ze]),bt=(0,c.useCallback)((function(e,t){var n,o,i,r,a;switch(Ue(""),qe){case pe:var l=e.title,s=e.link;return Ne.replaceSelection("[".concat(l,"](").concat(s,")")),Ne.focus();case ge:var c=e.language,u=e.content;return Ne.replaceSelection(["```"+c,u,"```"].join("\n")),Ne.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),f=0;f-1||null==g||!g.type?m?Ne.replaceSelection("![ ".concat(m," ]( ").concat(h,' "').concat(m,'" )')):Ne.replaceSelection("![,](".concat(h,")")):(null==g||null===(r=g.type)||void 0===r?void 0:r.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(a=g.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):_e.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(de.Z.API_SERVER).concat(h,")")),Ne.focus();case ve:for(var w=e.row,b=e.col,y=e.align,x="\n",_=0;_300&&(t=300),tt(g+t+"px")}},o=mt.current,i=!1,r=0;return o.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){o.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ne,mt]),(0,c.useEffect)((function(){tt(g)}),[g]);var _t={width:ke(l),height:ke(et)},kt=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return n=n<10?"0"+n:n,o=o<10?"0"+o:o,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(o)}return 0}),[Je]),function(e){var t=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,o){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){if(Be[qe]&&qe!==me&&qe!==he){var e=document.getElementsByClassName("ant-modal")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;st(t),pt(n)}}),[qe]);var St=function(e,t,n,o){var i=document.body.clientHeight,r=document.body.clientWidth;return!(e<20&&n>e||e>r-20&&nt||t>i-20&&oD.max_num)){e.next=3;break}return h.ZP.info("最大人数不能小于最小人数"),e.abrupt("return");case 3:return(n=a()({},D)).attachment_ids&&(n.attachment_ids=null==n||null===(o=n.attachment_ids)||void 0===o?void 0:o.map((function(e){return e.response.id}))),n.reference_attachment_ids&&(n.reference_attachment_ids=null==n||null===(r=n.reference_attachment_ids)||void 0===r?void 0:r.map((function(e){return e.response.id}))),s=(l=G).coursesId,c=l.categoryId,e.next=9,(0,S.H1)(a()(a()({coursesId:s,category:c},n),{},{type:3}));case 9:0===(u=e.sent).status&&(K(u.homework_id),(0,_.L9)(["教学课堂","分组作业","新建分组作业"]),p.history.push("/classrooms/".concat(s,"/group_homework/").concat(u.homework_id,"/detail")));case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function K(e){return Y.apply(this,arguments)}function Y(){return(Y=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=V&&V.ec_point_ids){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,M.ZP)("/api/ec_courses/".concat(null==V?void 0:V.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:a()({homework_common_id:t},V)});case 4:e.sent;case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,A.jsxs)("section",{className:j,children:[z.course_name&&(0,A.jsx)("section",{className:"animated fadeIn",children:(0,A.jsx)("aside",{className:"mt10",children:z.category&&(0,A.jsxs)(m.Z,{separator:">",children:[(0,A.jsx)(m.Z.Item,{children:(0,A.jsx)(p.Link,{to:"/classrooms/".concat(z.course_id,"/group_homework"),children:z.course_name})}),(0,A.jsx)(m.Z.Item,{children:(0,A.jsx)(p.Link,{to:"/classrooms/".concat(z.course_id,"/group_homework"),children:z.category.category_name})}),(0,A.jsx)(m.Z.Item,{children:"新建详情"})]})})}),(0,A.jsx)("aside",{className:"font24 bold mt20 mb20",children:"新建分组作业"}),(0,A.jsxs)(f.Z,{form:O,className:B,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){F(a()({},O.getFieldsValue()))},initialValues:{base_on_project:!1},onFinish:U,children:[(0,A.jsx)("div",{className:C,children:(0,A.jsx)(f.Z.Item,{name:"name",label:"标题:",rules:[{required:!0,message:"请输入标题"}],children:(0,A.jsx)(g.Z,{maxLength:60,suffix:"".concat((null===(t=D.name)||void 0===t?void 0:t.length)||0,"/60"),placeholder:"例如:从Python程序设计-入门精通"})})}),(0,A.jsxs)("div",{className:T,children:[(0,A.jsx)(f.Z.Item,{name:"description",label:"内容:",rules:[{required:!0,message:"请输入作业的简介"},{max:5e3,message:"作业简介最大限制5000个字符"}],children:(0,A.jsx)(k.Z,{watch:!0,defaultValue:D.intro})}),(0,A.jsx)("div",{children:(0,A.jsx)(f.Z.Item,{name:"attachment_ids",children:(0,A.jsx)(L.Z,{})})}),(0,A.jsxs)(v.Z,{gutter:[20,20],children:[(0,A.jsx)(w.Z,{flex:"230px",children:(0,A.jsx)(f.Z.Item,{name:"min_num",label:"分组设置",rules:[{required:!0,message:"请填写每组最小人数"}],children:(0,A.jsx)(b.Z,{style:{width:200},min:1,placeholder:"请填写每组最小人数"})})}),(0,A.jsx)(w.Z,{flex:"230px",children:(0,A.jsx)(f.Z.Item,{name:"max_num",label:(0,A.jsx)("div",{children:" "}),rules:[{required:!0,message:"请填写每组最大人数"}],children:(0,A.jsx)(b.Z,{style:{width:200},max:100,placeholder:"请填写每组最大人数"})})}),(0,A.jsx)(w.Z,{children:(0,A.jsx)("div",{className:"mt30",children:"(学生提交作品时需要关联同组成员,组内成员作品共享)"})})]}),!(null!=r&&null!==(n=r.setting)&&void 0!==n&&n.is_local)&&(0,A.jsx)(v.Z,{children:(0,A.jsxs)(w.Z,{children:[(0,A.jsx)(f.Z.Item,{name:"base_on_project",valuePropName:"checked",children:(0,A.jsx)(y.Z,{value:!0,children:"基于项目实施"})}),(0,A.jsx)("span",{className:"c-light-black",children:"(选中,则必须在本平台创建项目,项目管理员可以提交作品;不选中,无需在平台创建项目,任意小组成员均可以提交作品)"})]})})]}),(0,A.jsxs)("div",{className:T,children:[(0,A.jsx)(f.Z.Item,{name:"reference_answer",label:"参考答案:",children:(0,A.jsx)(k.Z,{watch:!0,defaultValue:D.notice})}),(0,A.jsx)("div",{children:(0,A.jsx)(f.Z.Item,{name:"reference_attachment_ids",children:(0,A.jsx)(L.Z,{})})})]})]}),(0,A.jsx)("div",{className:T,children:(0,A.jsx)(E.Z,{setitem:function(e){return q(a()({},e))}})}),(0,A.jsx)("div",{className:P,children:(0,A.jsx)("div",{className:"pt40 mb30",children:(0,A.jsxs)(f.Z.Item,{children:[(0,A.jsx)(x.ZP,{size:"middle",type:"primary",onClick:function(){O.submit()},className:"".concat(N," mr20"),htmlType:"submit",loading:l["newCourse/editCourse"]||l["newCourse/submitCourse"],children:"提交"}),(0,A.jsx)(x.ZP,{size:"middle",type:"primary",ghost:!0,className:N,onClick:function(){return p.history.push("/classrooms/".concat(G.coursesId,"/group_homework"))},children:"取消"})]})})})]})}))},28838:function(e,t,n){"use strict";n.d(t,{$J:function(){return s},JZ:function(){return u},bN:function(){return f},jP:function(){return p},rO:function(){return c}});var o=n(7557),i=n.n(o),r=n(41498),a=n.n(r),l=n(51136);function s(e){return(0,l.U2)("libraries/".concat(e,".json"))}function c(){return(0,l.U2)("library_tags.json")}function u(e){return d.apply(this,arguments)}function d(){return(d=a()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.IV)("attachments/".concat(t,".json"));case 2:return n=e.sent,e.abrupt("return",0===n.status);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return(0,l.v_)("libraries.json",e)}function f(e,t){return(0,l.gz)("libraries/".concat(e,".json"),t)}}}]);