|
|
(self.webpackChunk=self.webpackChunk||[]).push([[7043,7382],{48553: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={},n="5.0",t={},i=null,r=!1,a=!1,o=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":n=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?n=d:o=d;break;case"object":void 0!==d.is3D?i=d:t=d;break;case"boolean":r=d,a=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===t.material_id||a||(r=!0)),null!==o&&void 0===t.id&&(t.id=o);var p="",f=!1,h=null,m=null,g=null,x=!1,v=null,w=null,b=null;void 0!==t.height&&(t.height=Math.round(t.height)),void 0!==t.width&&(t.width=Math.round(t.width));var _=function(e){return parseFloat(e)>4?parseFloat(e):5};function y(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,G(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(l=e,q(e,n))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){b=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",a=t.id,o=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?r=c:a=arguments[l]:"boolean"==typeof c?o=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){r=A(r);var l=i||document.getElementById(a);if(l)if(e.removeExistingApplet(l,!1),void 0===t.width&&l.clientWidth&&(t.width=l.clientWidth),void 0===t.height&&l.clientHeight&&(t.height=l.clientHeight),t.width&&t.height||"html5"!==r||(delete t.width,delete t.height),h=r,"screenshot"===r)T(l,t);else{var c=!1;t.hasOwnProperty("playButton")&&t.playButton||t.hasOwnProperty("clickToLoad")&&t.clickToLoad?c=!0:t.hasOwnProperty("playButtonAutoDecide")&&t.playButtonAutoDecide&&(c=(!y()||n())&&k()),c?(h="screenshot",E(l,t,o,r)):B(l,t,o)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var j=function(n){var r=function(){t.onError&&t.onError(),I("Error: Fetching material (id "+t.material_id+") failed.",t)},a=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",o="/materials/"+t.material_id+"?scope=basic";N("https://"+a+"/api/proxy.php?path="+encodeURIComponent(o),(function(a){var o=JSON.parse(a),s=o.elements?o.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:o;if(s&&s.url){t.fileName=s.url,S(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";e.setPreviewImage(v||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),n()}else r()}),r)};function S(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(n){e[n]=!!e[n]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(n){void 0===t[n]&&void 0!==e[n]&&(t[n]=e[n])})),void 0===t.showToolBarHelp&&(t.showToolBarHelp=t.showToolBar)}function N(e,n,t){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){n(i.responseText)},i.onerror=t,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return h},e.setPreviewImage=function(e,n,t){v=e,w=n,t},e.removeExistingApplet=function(e,n){var i;"string"==typeof e&&(e=document.getElementById(e)),h=null;var r=null;for(i=0;i<e.childNodes.length;i++){var a=e.childNodes[i],o=a.className;"applet_screenshot"===o?n?(a.style.display="block",h="screenshot"):a.style.display="none":"applet_scaler prerender"!==o&&(e.removeChild(a),r=o&&-1!=o.indexOf("appletParameters")?a.id:null,i--)}var s=void 0!==t.id?t.id:r,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},e.refreshHitPoints=function(){if(_(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var C=function(e){return e&&"false"!==e},B=function(n,t,i){_(m)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!x)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var a=document.createElement("div");a.classList.add("appletParameters","notranslate");var o=t.width,s=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(_(m)<=4.4)C(t.showToolBar)&&(t.height-=7),C(t.showAlgebraInput)&&(t.height-=37),t.width<605&&C(t.showToolBar)&&(t.width=605,o=605);else{var u=100;(C(t.showToolBar)||C(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=C(t.showMenuBar)?245:155),o<u&&(t.width=u,o=u)}for(var d in a.style.border="none",a.style.display="inline-block",t)t.hasOwnProperty(d)&&"appletOnLoad"!==d&&a.setAttribute("data-param-"+d,t[d]);b&&a.setAttribute("data-param-fontscssurl",b),e.resize=function(){GGBAppletUtils.responsiveResize(n,t)},window.addEventListener("resize",(function(n){e.resize()}));var f="function"==typeof t.appletOnLoad?t.appletOnLoad:function(){};if(i||void 0===t.width){var h=document.createElement("div");h.className="applet_scaler",h.style.position="relative",h.style.display="block",h.appendChild(a),n.appendChild(h),t.appletOnLoad=function(n){e.resize(),f(n)}}else{t.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var v=n.querySelector(".applet_scaler.prerender"),w=null!==v;if(w)y=v.querySelector(".ggb_preview");else{var y=Z(o,s,t.borderColor,!1);(v=document.createElement("div")).className="applet_scaler",v.style.position="relative",v.style.display="block",v.style.width=o+"px",v.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(v,"66%"),_(m)>=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(v),window.GGBT_wsf_view&&$(window).trigger("resize"),f(e)},w||v.appendChild(y)):a.appendChild(y),v.appendChild(a),w||n.appendChild(v),setTimeout((function(){e.resize()}),1)}function k(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),I("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function j(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},_(m)<5&&(e.className+=" geogebraweb")):k(e,n)}if(r){scriptLoadStarted=!0;for(var S=0;S<a.childNodes.length;S++){"TABLE"===a.childNodes[S].tagName&&(a.removeChild(a.childNodes[S]),S--)}if(null!==ggbHTML5LoadedScript){var N=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=N&&N.parentNode.removeChild(N)}var B=document.createElement("script"),T=function(){j(a,t)};B.src=p+g,ggbHTML5LoadedCodebaseIsWebSimple=x,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=B.src,I("GeoGebra HTML5 codebase loaded: '"+p+"'.",t),c||l&&"5.0"!=l?p.requirejs?__webpack_require__.e(34941).then(function(){var e=[__webpack_require__(36743)];T.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(B.onload=T,n.appendChild(B)):(x?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),T())}else j(a,t);t.height=s,t.width=o},T=function(n,t,i){var r=Z(t.width,t.height,t.borderColor,i),a=document.createElement("div");a.style.position="relative",a.style.display="block",a.style.width=t.width+"px",a.style.height=t.height+"px",a.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),a.appendChild(r);var o=GGBAppletUtils.getScale(t,n,i);i?(n.appendChild(L()),window.GGBT_wsf_view||(n.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(a,"66%"),n.appendChild(a),1===o||isNaN(o)||(GGBAppletUtils.scaleElement(a,o),a.style.width=t.width+"px",a.style.height=t.height+"px",a.parentNode.style.width=t.width*o+"px",a.parentNode.style.height=t.height*o+"px"),e.resize=function(){P(n,r,a,i)},window.addEventListener("resize",(function(n){e.resize()})),e.resize()};function P(e,n,i,r){if(e.contains(n)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var a=GGBAppletUtils.getScale(t,e,r);null!==i.parentNode&&(isNaN(a)||1===a?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=t.width+"px",i.parentNode.style.height=t.height+"px"):(GGBAppletUtils.scaleElement(i,a),i.parentNode.style.width=t.width*a+"px",i.parentNode.style.height=t.height*a+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,n){n.appendChild(e)};var E=function(e,n,t,i){T(e,n,!0);for(var r=function(){var t=[];for(o=0;o<e.childNodes.length;o++)t.push(e.childNodes[o]);if(window.GGBT_wsf_view){var r=window.GGBT_wsf_view.renderFullScreen(e,n.id),a=document.getElementById("fullscreencontainer"),s=jQuery(e).find(".fullscreencontent");s.length>0?(r.remove(),s.attr("id","fullscreencontent").show(),jQuery(a).append(s),window.dispatchEvent(new Event("resize"))):B(r,n,!1),window.GGBT_wsf_view.launchFullScreen(a)}else h=i,B(e,n,!1);if(!window.GGBT_wsf_view)for(o=0;o<t.length;o++)e.removeChild(t[o])},a=e.getElementsByClassName("ggb_preview_play"),o=0;o<a.length;o++)a[o].addEventListener("click",r,!1),a[o].addEventListener("ontouchstart",r,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),k()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},L=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var n='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',t=document.createElement("style");t.styleSheet?t.styleSheet.cssText=n:t.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(t)}return e},Z=function(e,n,t,i){var r=document.createElement("div");r.className="ggb_preview",r.style.position="absolute",r.style.zIndex="90",r.style.width=e-2+"px",r.style.height=n-2+"px",r.style.top="0px",r.style.left="0px",r.style.overflow="hidden",r.style.backgroundColor="white";var a="lightgrey";void 0!==t&&(a="none"===t?"transparent":t),r.style.border="1px solid "+a;var o,s,l,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==v&&c.setAttribute("src",v),c.style.opacity=.7,null!==w)&&!i){(o=document.createElement("img")).style.position="absolute",o.style.zIndex="1001",o.style.opacity=1,c.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,o.setAttribute("src",w),o.setAttribute("width",s),o.setAttribute("height",l);var u=(e-s)/2,d=(n-l)/2;o.style.left=u+"px",o.style.top=d+"px",r.appendChild(o)}return r.appendChild(c),r},A=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},M=["web","webSimple","web3d","tablet","tablet3d","phone"],q=function(e,n){if(m=e,n)G(m,!0);else{var a,o,s=!r;if(s){var l=_(m);!isNaN(l)&&l<4.4&&(s=!1)}a="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in o=c>0?m:0===c?a+m:"https://www.geogebra.org/apps/5.2.814.0/",M)if(m.slice(-1*M[u].length)===M[u]||m.slice(-1*(M[u].length+1))===M[u]+"/")return void G(o,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||C(t.showToolBar)||C(t.showMenuBar)||C(t.showAlgebraInput)||C(t.enableRightClick)||t.appName&&"classic"!=t.appName?o+="web3d/":o+="webSimple/",G(o,!1)}},G=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),f=n,g="web.nocache.js",x=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?M.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",x=!0)),t=e.split("/"),"test"===(m=t[t.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 i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),q("5.0",n))}},I=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function O(){var e=n;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),q(e,!1),null!==c&&G(c,f),s=!0}return void 0!==t.material_id?j(O):O(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",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 t(e,n,t,i,r){if(e.isScreenshoGenerator)return 1;var a,o=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(a=e.autoHeight)&&"false"!==a,c=function(e,n,t,i,r,a){var o=null;if(null!=a&&""!=a)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+a+" ")>-1){o=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,p=0,f=0,h=0;if(o)l=o.offsetWidth,c=Math.max(i?o.offsetWidth:0,o.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===r||!r)&&("rtl"===document.dir?(p=l-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===t||!t)&&n>0&&n+d<l?l=n:l-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==t&&t||(c-=h)),{width:l,height:c}}(n,e.width,t,l,o&&window.GGBT_wsf_view||s,r),u=parseInt(c.width),d=e.width,p=e.height;if(void 0===d){var f=n.querySelector(".appletParameters");f&&(d=f.offsetWidth,p=f.offsetHeight)}var h=u/d,m=o?1:c.height/p;return void 0===t||t||(h=Math.min(1,h),m=Math.min(1,m)),Math.min(h,m)}function i(e,n,i){var r,a=1,o=!1;return e.hasOwnProperty("allowUpscale")&&(o=e.allowUpscale),e.hasOwnProperty("scale")&&(a=parseFloat(e.scale),(isNaN(a)||null===a||0===a)&&(a=1),a>1&&(o=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(o=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?a:(r=t(e,n,o,i,e.scaleContainerClass),!o||e.hasOwnProperty("scale")&&1!==a?Math.min(a,r):r)}function r(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(n-i.width)/2,a=(t-i.height)/2;a<0&&(a=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=a+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=a<40?"40px":a+"px",e.style.left=r+"px")}return{responsiveResize:function(t,a){var o=t.querySelector(".appletParameters");if(o){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(a.id!==o.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(o.parentElement&&/fullscreen/.test(o.parentElement.className))return;var s=i(a,t);e()&&o.setAttribute("data-param-scale",s);for(var l=null,c=0;c<t.childNodes.length;c++)if(void 0!==t.childNodes[c].className&&t.childNodes[c].className.match(/^applet_scaler/)){l=t.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==a.id?a.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(n(l,1),l.parentNode.style.width=a.width+"px",l.parentNode.style.height=a.height+"px"):(l.parentNode.style.width=a.width*s+"px",l.parentNode.style.height=a.height*s+"px",n(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&r(t),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(o).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:r,getScale:i,scaleElement:n}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,n){}q(H,I),webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function n(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var t=n();if(t)e();else{o.addEventListener&&o.addEventListener(Z,r,!1);var i=setInterval((function(){r()}),$)}function r(){if(!t){if(!n())return;t=!0,e(),o.removeEventListener&&o.removeEventListener(Z,r,!1),i&&clearInterval(i)}}}((function(){var n,t,i,r;n=e,t=u(),i=t.body,(r=t.createElement(_)).language=ab,r.crossOrigin=W,r.src=n,webModule.__errFn&&(r.onerror=function(){webModule.__errFn(L,new Error(bb+n))}),i.appendChild(r),q(cb,db)}))}function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=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 n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;t<n.length;++t)if(-1!=n[t].src.indexOf(xb))return e(n[t].src);return W}()),t==W&&(t=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],a=[];function o(e){var n=a[e](),t=i[e];if(n in t)return n;var o=[];for(var s in t)o[t[s]]=s;throw r&&r(e,o,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=o(n));return e},webModule.__computePropValue=o,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}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 n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],r=O;r<i.length;r++){var a=i[r];t[a[O]]=a[P]}return t}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var n=u(),t=n.body,i=n.createElement(_);i.language=ab,i.text=e,t.appendChild(i),t.removeChild(i)},A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},79661:function(e,n,t){"use strict";function i(e){var n=!0;if(e.length>0){for(var t=0;t<e.length;t++)if(0==e[t].compile_success||!e[t].compile_success){n=!1;break}}else n=!1;return n}function r(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i<e.length;i++){var r=e[i],a=n?"".concat(n,"/").concat(r.name):"".concat(r.name);t.push({title:r.name,type:r.type,isLeaf:"tree"!==r.type,key:a})}return t}function a(e,n,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.key===n){r.children=t;break}r.children&&a(r.children,n,t)}return e}function o(e,n,t){var i;return function(){var r=this,a=arguments,o=function(){i=null,t||e.apply(r,a)},s=t&&!i;clearTimeout(i),i=setTimeout(o,n),s&&e.apply(r,a)}}t.d(n,{Ax:function(){return a},Ds:function(){return o},KI:function(){return s},SI:function(){return r},f1:function(){return i}});var s=t(84666).Z.API_SERVER},43311:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(82100),r=t.n(i),a=t(29186),o=t.n(a),s=t(80619),l=t.n(s),c=t(47074),u=t.n(c),d=t(59301),p=t(92832),f=t(12563),h=t(8591),m="flex___eLcnP",g="color666___TiUhG",x=t(67147),v=t(37712),w=(p.Z.TextArea,function(e){l()(t,e);var n=u()(t);function t(e){var i;return r()(this,t),(i=n.call(this,e)).state={inputVisible:!1,EditInputIndex:-1},i}return o()(t,[{key:"render",value:function(){var e=this,n=this.props,t=n.index,i=n.onAnswerChange,r=n.addChildAnswer,a=(n.exerciseIsPublish,n.answers);n.activeOptionErrorIndex,n.flex;console.log("----",a);var o=this.state,s=o.inputVisible,l=o.EditInputIndex;return(0,v.jsxs)("div",{className:m,children:[(0,v.jsxs)("div",{className:"".concat(g," mb5 mt6"),style:{flex:"0 0 90px"},children:["答案(填空",t+1,"):"]}),(0,v.jsxs)("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10},children:[null==a?void 0:a.map((function(n,r){return(0,v.jsx)(v.Fragment,{children:l!==r&&(null==n?void 0:n.length)>0?(0,v.jsx)(f.Z,{className:"edit-tag",closable:!(1===(null==a?void 0:a.length)&&0===r),onClose:function(n){n.preventDefault(),1===(null==a?void 0:a.length)&&0===r?e.props.deleteChildAnswermain(t,r):e.props.deleteChildAnswer(t,r)},children:(0,v.jsx)("span",{onDoubleClick:function(n){e.setState({EditInputIndex:r}),n.preventDefault()},children:n})},n):(0,v.jsx)(p.Z,{defaultValue:n,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:function(n){n.target.value.replaceAll(" ","").length<=0?h.ZP.info("内容不能为纯空格"):(i(t,r,n.target.value),e.setState({EditInputIndex:-1,inputVisible:!1}))}})})})),!s&&(0,v.jsxs)(f.Z,{className:"site-tag-plus",onClick:function(){r(t),e.setState({inputVisible:!0})},children:[(0,v.jsx)(x.Z,{})," 新增答案"]})]})]})}}]),t}(d.Component))},87976:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(82242),r=t.n(i),a=t(82100),o=t.n(a),s=t(29186),l=t.n(s),c=t(13720),u=t.n(c),d=t(80619),p=t.n(d),f=t(47074),h=t.n(f),m=t(85573),g=t.n(m),x=t(59301),v=t(42903),w=t(37712),b="▁",_=function(e){p()(t,e);var n=h()(t);function t(){var e;o()(this,t);for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),g()(u()(e),"getChCountBeforeCursor",(function(e,n){for(var t=n.line,i=0,r=0;r<t;r++)i+=e.getLine(r).split(b).length-1;return i+=e.getLine(t).substring(0,n.ch).split(b).length-1})),g()(u()(e),"onCMBeforeChange",(function(n,t){var i=n.getRange(t.from,t.to),r=0;if(t.text.forEach((function(e){r+=e.split(b).length-1})),i&&-1!=i.indexOf(b)){var a=i.split(b).length-1,o=e.getChCountBeforeCursor(n,t.from);console.log("删除".concat(a,"个, 之前有").concat(o,"个,新增").concat(r,"个")),e.props.deleteEmptyDisabled?t.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(o,a,r)}else if(r){var s=e.getChCountBeforeCursor(n,t.from);console.log("新增".concat(r,"个,之前有").concat(s,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(s,0,r)}})),e}return l()(t,[{key:"render",value:function(){return(0,w.jsx)(v.Z,r()(r()({},this.props),{},{onCMBeforeChange:this.onCMBeforeChange}))}}]),t}(x.Component)},36572:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var i=t(7557),r=t.n(i),a=t(41498),o=t.n(a),s=t(79800),l=t.n(s),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",f=t(92310),h=t.n(f),m=t(71418),g=t(2859),x=t(67444),v=t(16739),w=t(37712),b=function(e){var n=e.data,t=e.className,i=e.fullWidth,a=e.style,s=void 0===a?{}:a,f=e.onClose,b=e.onOk,_=e.showFullTools,y=e.noAssociationId,k=(0,c.useRef)(null),j=(0,c.useRef)(null),S=(0,c.useRef)(null),N=(0,c.useRef)(null),C=(0,c.useState)(!1),B=l()(C,2),T=B[0],P=B[1],E=(0,c.useState)("正在加载中"),L=l()(E,2),Z=L[0],A=L[1];(0,c.useEffect)((function(){S.current||(S.current=document.createElement("style"),document.head.appendChild(S.current)),null!=n&&n.visible?(document.body.setAttribute("data-custom","y-hidden"),S.current.innerHTML=" html { overflow-y: hidden; }",null!=n&&n.src&&M()):(document.body.removeAttribute("data-custom"),S.current&&(document.head.removeChild(S.current),S.current=null))}),[null==n?void 0:n.visible]);var M=function(){var e=o()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(!0),A("正在加载中"),e.next=4,(0,v.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,k.current.src="",k.current.src=t,k.current.onload=function(){G()},P(!1),A("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=function(){var e=o()(r()().mark((function e(t){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(!0),A("正在保存中"),e.next=4,(0,x.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:n.title,file:t.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||y){e.next=12;break}return e.next=8,(0,x.ZP)("/api/attachments/".concat(n.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(t.state)}});case 8:0===e.sent.status&&b(),e.next=13;break;case 12:null!=i&&i.id&&b(i);case 13:P(!1),A("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),G=function(){j.current=new g.hP(k.current),j.current.targetRoot=N.current,j.current.addEventListener("render",q),j.current.addEventListener("beforeclose",f),_&&(j.current.availableMarkerTypes=j.current.ALL_MARKER_TYPES,j.current.uiStyleSettings.redoButtonVisible=!0,j.current.uiStyleSettings.notesButtonVisible=!0,j.current.uiStyleSettings.zoomButtonVisible=!0,j.current.uiStyleSettings.zoomOutButtonVisible=!0,j.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=j.current.uiStyleSettings,j.current.show(),null!=n&&n.snapshotData&&j.current.restoreState(n.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(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 n=document.querySelector(e.name);n&&n.setAttribute("title",e.title)}))}),300)};return(0,w.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,w.jsx)(m.Z,{spinning:T,tip:Z,style:{position:"absolute"},children:(0,w.jsx)("div",{ref:N,className:h()(u,t,i?p:""),style:s,children:(0,w.jsx)("img",{className:d,ref:k})})})})}},7435:function(e,n,t){"use strict";t.d(n,{h:function(){return x}});var i=t(82242),r=t.n(i),a=t(79800),o=t.n(a),s=t(59301),l=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),f=(t(80577),t(82612),t(37712)),h=l.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 x(e){var n=e.value,t=e.onChange,i=e.mode,a=e.options,l=void 0===a?{}:a,c=(0,s.useRef)(),u=(0,s.useState)(),d=o()(u,2),h=d[0],m=d[1];return(0,s.useEffect)((function(){if(h){var e=function(e){var n=e.getValue();t&&t(n)};return h.on("change",e),function(){h.off("change",e)}}}),[h,t]),(0,s.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,s.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,s.useEffect)((function(){if(c.current&&!h){var e=p().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[c.current,h]),(0,f.jsx)("div",{className:"my-codemirror-container",children:(0,f.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,s.useState)("python"),a=o()(i,2),d=a[0],p=a[1];return(0,f.jsxs)(c.Z,r()(r()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,f.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,f.jsx)(l.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)(x,{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:t,children:"取消"})]})]}))}},42903:function(e,n,t){"use strict";t.d(n,{Z:function(){return _e}});var i=t(91232),r=t.n(i),a=t(79800),o=t.n(a),s=t(85573),l=t.n(s),c=t(59301),u=t(89780),d=t.n(u),p=t(76374),f=(t(80577),t(6313),t(25717),t(99498),t(25419),t(67549),t(8292)),h=t(37712),m=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=t(82242),x=t.n(g),v=[{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 w(e){var n=e.onActionCallback,t=e.title,i=e.icon,r=e.actionName,a=e.className,o=void 0===a?"":a,s=e.children;return(0,h.jsxs)("a",{title:t,className:o,onClick:function(){n(r)},children:[(0,h.jsx)("i",{className:"".concat(i)}),s]})}var b=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,a=e.fullScreen,o=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(v,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,n){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(w,x()(x()({},e),{},{onActionCallback:r})):(0,h.jsx)("span",{className:"v-line"})},n)})),t?(0,h.jsx)("li",{children:(0,h.jsx)(w,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)(w,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(w,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,o&&(0,h.jsx)("li",{children:(0,h.jsx)(w,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),onActionCallback:r,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,h.jsx)("li",{children:l}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(w,{icon:"".concat(a?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:a?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},_=t(39205),y=t(78241),k=t(92832),j=t(3113),S={labelCol:{span:4},wrapperCol:{span:20}},N=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(y.Z,x()(x()({},S),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,h.jsx)(y.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,h.jsx)(k.Z,{})}),(0,h.jsx)(y.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)(j.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(j.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},C=t(7435),B=t(55314),T=t(95237),P=t(36572),E=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var a=i.toDataURL("image/png");return(0,h.jsx)(T.Z,{style:{height:"100vh"},children:(0,h.jsx)(P.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:a,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},L=t(7557),Z=t.n(L),A=t(41498),M=t.n(A),q=t(37205),G=t.n(q),I=t(12378);function O(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(O,go.CommandHandler),O.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},O.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},O.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},O.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},O.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},O.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},O.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},O.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var r=t[i],a=r.actualBounds.y+r.actualBounds.height+e;t[i+1].move(new go.Point(r.actualBounds.x,a))}n.commitTransaction("align Column")},O.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var n=this.diagram;n.startTransaction("align Row");var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i<t.length-1;i++){var r=t[i],a=r.actualBounds.x+r.actualBounds.width+e;t[i+1].move(new go.Point(a,r.actualBounds.y))}n.commitTransaction("align Row")},O.prototype.canRotate=function(e){var n=this.diagram;return null!==n&&!n.isReadOnly&&!n.isModelReadOnly&&!(n.selection.count<1)},O.prototype.rotate=function(e){var n;void 0===e&&(e=90),(n=this.diagram).startTransaction("rotate "+e.toString()),(n=this.diagram).selection.each((function(n){n instanceof go.Link||n instanceof go.Group||(n.angle+=e)})),n.commitTransaction("rotate "+e.toString())},O.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.max(t,n)}})),n.set(e,t)})),e.selection.each((function(e){O._assignZOrder(e,n.get(e.layer)+1)})),e.commitTransaction("pullToFront")},O.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var n=new go.Map;e.selection.each((function(e){n.set(e.layer,0)})),n.iteratorKeys.each((function(e){var t=0;e.parts.each((function(e){if(!e.isSelected){var n=e.zOrder;isNaN(n)?e.zOrder=0:t=Math.min(t,n)}})),n.set(e,t)})),e.selection.each((function(e){O._assignZOrder(e,n.get(e.layer)-1-O._findGroupDepth(e))})),e.commitTransaction("pushToBack")},O._assignZOrder=function(e,n,t){void 0===t&&(t=e),e.layer===t.layer&&(e.zOrder=n),e instanceof go.Group&&e.memberParts.each((function(e){O._assignZOrder(e,n+1,t)}))},O._findGroupDepth=function(e){if(e instanceof go.Group){var n=0;return e.memberParts.each((function(e){n=Math.max(n,O._findGroupDepth(e))})),n+1}return 0},O.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var n=e.lastInput;if("Up"===n.key||"Down"===n.key||"Left"===n.key||"Right"===n.key){var t=this.arrowKeyBehavior;if("none"===t)return;if("select"===t)return void this._arrowKeySelect();if("move"===t)return void this._arrowKeyMove();if("tree"===t)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},O.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(n){e.push(n)})),this.diagram.parts.each((function(n){e.push(n)})),e},O.prototype._arrowKeyMove=function(){var e=this.diagram,n=e.lastInput,t=0,i=0;if(n.control||n.meta)t=1,i=1;else if(null!==e.grid){var r=e.grid.gridCellSize;i=r.width,t=r.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-t)):"Down"===n.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+t)):"Left"===n.key?e.move(new go.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===n.key&&e.move(new go.Point(e.actualBounds.x+i,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},O.prototype._arrowKeySelect=function(){var e=this.diagram,n=e.lastInput,t=null;"Up"===n.key?t=this._findNearestPartTowards(270):"Down"===n.key?t=this._findNearestPartTowards(90):"Left"===n.key?t=this._findNearestPartTowards(180):"Right"===n.key&&(t=this._findNearestPartTowards(0)),null!==t&&(n.shift?t.isSelected=!0:n.control||n.meta?t.isSelected=!t.isSelected:e.select(t))},O.prototype._findNearestPartTowards=function(e){var n=this.diagram.selection.first();if(null===n)return null;for(var t=n.actualBounds.center,i=this._getAllParts(),r=1/0,a=n,o=0;o<i.length;o++){var s=i[o];if(s!==n&&s.canSelect()){var l=s.actualBounds.center,c=t.directionPoint(l),u=this._angleCloseness(c,e);if(u<=45){var d=t.distanceSquaredPoint(l);(d*=1+Math.sin(u*Math.PI/180))<r&&(r=d,a=s)}}}return a},O.prototype._angleCloseness=function(e,n){return Math.min(Math.abs(n-e),Math.min(Math.abs(n+360-e),Math.abs(n-360-e)))},O.prototype._arrowKeyTree=function(){var e=this.diagram,n=e.selection.first();if(n instanceof go.Node){var t=e.lastInput;if("Right"===t.key)if(n.isTreeLeaf);else if(n.isTreeExpanded){null!==(r=this._sortTreeChildrenByY(n).first())&&e.select(r)}else e.commandHandler.canExpandTree(n)&&e.commandHandler.expandTree(n);else if("Left"===t.key){if(!n.isTreeLeaf&&n.isTreeExpanded)e.commandHandler.canCollapseTree(n)&&e.commandHandler.collapseTree(n);else null!==(a=n.findTreeParentNode())&&e.select(a)}else if("Up"===t.key){if(null!==(a=n.findTreeParentNode()))if((s=(o=this._sortTreeChildrenByY(a)).indexOf(n))>0){for(var i=o.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(a)}else if("Down"===t.key){var r;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(r=this._sortTreeChildrenByY(n).first())&&e.select(r);else for(;null!==n;){var a,o,s;if(null===(a=n.findTreeParentNode()))break;if((s=(o=this._sortTreeChildrenByY(a)).indexOf(n))<o.length-1){e.select(o.elt(s+1));break}n=a}}var l=e.selection.first();null!==l&&e.scrollToRect(l.actualBounds)}},O.prototype._sortTreeChildrenByY=function(e){var n=(new go.List).addAll(e.findTreeChildrenNodes());return n.sort((function(e,n){var t=e.location,i=n.location;return t.y<i.y?-1:t.y>i.y?1:t.x<i.x?-1:t.x>i.x?1:0})),n},O.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},O.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(O.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(O.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 R=O,D=(t(88772),t(85160)),F=t(43418),H=t(43604),W=t(67444),V="myPaletteDiv___Xjz2I",z="maxH60___Pd4Re";window.go=I;var U=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),r=(0,c.useRef)(),a=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),u=(0,c.useState)(0),d=o()(u,2),p=d[0],f=d[1],m=function(){var e=M()(Z()().mark((function e(){var n,r;return Z()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,W.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:r=e.sent,t({src:r.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:l,className:s.current?"".concat(z," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(F.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(T.Z,{children:[(0,h.jsx)(H.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(H.Z,{onClick:function(){s.current=!s.current,f(p+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,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:V,ref:a})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(D.FI,{initDiagram:function(){var e=I.GraphObject.make,n="#ff3333",t="#3358ff",o="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",f="#d5ebff",h="#f2dfe0",m="#a5d2fa",g="#cccccc",x="#b3e6b3",v="#fcbbbd";function w(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var r=t.part.adornedPart,a=(new I.Point).setRectSpot(r.actualBounds,n);a.subtract(r.location),a.scale(2,2),a.x+=130*Math.sign(a.x),a.y+=130*Math.sign(a.y),a.add(r.location),a.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var o=i.copyNodeData(r.data);i.setGroupKeyForNodeData(o,i.getGroupKeyForNodeData(r.data)),i.addNodeData(o);var s={from:r.key,to:i.getKeyForNodeData(o)};i.addLinkData(s);var l=e.diagram.findNodeForData(o);l.location=a,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(I.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(I.Spot.Top)||n.equals(I.Spot.Bottom)?25:18,height:n.equals(I.Spot.Top)||n.equals(I.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function b(n){return e(I.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,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function _(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function y(n,t){return t||(t="color"),e(I.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:_(t,n),contextClick:_(t,n)})}function k(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",y(u,"fill"),y(p,"fill"),y(f,"fill"),y(h,"fill"))),e("ContextMenuButton",e(I.Panel,"Horizontal",y(g,"fill"),y(x,"fill"),y(m,"fill"),y(v,"fill")))]}function j(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",y(d),y(o),y(t),y(n))),e("ContextMenuButton",e(I.Panel,"Horizontal",y(u),y(s),y(l),y(c)))]}function S(n,t){return t||(t="thickness"),e(I.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:_(t,n),contextClick:_(t,n)})}function N(n,t){return t||(t="dash"),e(I.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:_(t,n),contextClick:_(t,n)})}function C(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",S(1),S(2),S(3),S(4))),e("ContextMenuButton",e(I.Panel,"Horizontal",N(null),N([2,4]),N([4,4])))]}function B(n,t){return t||(t="figure"),e(I.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:_(t,n),contextClick:_(t,n)})}function T(n){return e(I.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function P(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(I.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:_("dir",n),contextClick:_("dir",n)})}function E(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",I.Spot.stringify(I.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(I.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function L(n,t){var i=0,r=I.Spot.RightSide;n.equals(I.Spot.Top)?(i=270,r=I.Spot.TopSide):n.equals(I.Spot.Left)?(i=180,r=I.Spot.LeftSide):n.equals(I.Spot.Bottom)&&(i=90,r=I.Spot.BottomSide),t||(i-=180);var a=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",I.Spot.stringify(r)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(I.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:a,contextClick:a})}return i.current=new I.Diagram(r.current,{padding:20,grid:e(I.Panel,"Grid",e(I.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(I.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(R),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.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 n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(I.Node,"Auto",{locationSpot:I.Spot.Center,locationObjectName:"SHAPE",desiredSize:new I.Size(120,60),minSize:new I.Size(40,40),resizable:!0,resizeCellSize:new I.Size(10,10),rotatable:!0},new I.Binding("location","loc",I.Point.parse).makeTwoWay(I.Point.stringify),new I.Binding("desiredSize","size",I.Size.parse).makeTwoWay(I.Size.stringify),e(I.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:I.Spot.AllSides,toSpot:I.Spot.AllSides},new I.Binding("figure"),new I.Binding("fill"),new I.Binding("stroke","borderColor"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(I.TextBlock,{margin:1,textAlign:"center",overflow:I.TextBlock.OverflowEllipsis,editable:!0},new I.Binding("text").makeTwoWay(),new I.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(I.Panel,"Vertical",{maxSize:new I.Size(200,NaN)},e(I.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new I.Binding("text")),e(I.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new I.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(I.Adornment,"Spot",e(I.Placeholder,{padding:10}),w(I.Spot.Top,"TriangleUp"),w(I.Spot.Left,"TriangleLeft"),w(I.Spot.Right,"TriangleRight"),w(I.Spot.Bottom,"TriangleDown"),b({alignment:new I.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(I.Panel,"Horizontal",B("Rectangle"),B("RoundedRectangle"),B("Ellipse"),B("Diamond"))),e("ContextMenuButton",e(I.Panel,"Horizontal",B("Parallelogram2"),B("ManualOperation"),B("Procedure"),B("Cylinder1"))),e("ContextMenuButton",e(I.Panel,"Horizontal",B("Terminator"),B("CreateRequest"),B("Document"),B("TriangleDown"))),k(),j(),C()),i.current.groupTemplate=e(I.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:I.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new I.Binding("location","loc",I.Point.parse).makeTwoWay(I.Point.stringify),e(I.Panel,"Auto",{name:"BODY"},e(I.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:I.Spot.AllSides,toSpot:I.Spot.AllSides},new I.Binding("fill"),new I.Binding("stroke","color"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Placeholder,{background:"transparent",margin:20})),e(I.TextBlock,{alignment:I.Spot.Top,alignmentFocus:I.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new I.Binding("text"),new I.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(I.Adornment,"Spot",e(I.Panel,"Auto",e(I.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(I.Placeholder,{margin:1.5})),b({alignment:I.Spot.TopRight,alignmentFocus:I.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),j(),C()),i.current.linkTemplate=e(I.Link,{layerName:"Foreground",routing:I.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new I.Binding("fromSpot","fromSpot",I.Spot.parse),new I.Binding("toSpot","toSpot",I.Spot.parse),new I.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new I.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new I.Binding("points").makeTwoWay(),e(I.Shape,{strokeWidth:2},new I.Binding("stroke","color"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Shape,{segmentIndex:0,segmentOffset:new I.Point(15,0),segmentOrientation:I.Link.OrientAlong,alignmentFocus:I.Spot.Right,figure:"circle",width:10,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return 1===e}))),e(I.Shape,{segmentIndex:-1,segmentOffset:new I.Point(-10,6),segmentOrientation:I.Link.OrientPlus90,alignmentFocus:I.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return e>=1})),new I.Binding("width","thickness",(function(e){return 7+3*e})),new I.Binding("height","thickness",(function(e){return 7+3*e})),new I.Binding("segmentOffset","thickness",(function(e){return new I.Point(-15,4+1.5*e)}))),e(I.Shape,{segmentIndex:0,segmentOffset:new I.Point(15,-6),segmentOrientation:I.Link.OrientMinus90,alignmentFocus:I.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return 2===e})),new I.Binding("width","thickness",(function(e){return 7+3*e})),new I.Binding("height","thickness",(function(e){return 7+3*e})),new I.Binding("segmentOffset","thickness",(function(e){return new I.Point(-15,4+1.5*e)}))),e(I.TextBlock,{alignmentFocus:new I.Spot(0,1,-4,0),editable:!0},new I.Binding("text").makeTwoWay(),new I.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(I.Adornment,e(I.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:T(2)},new I.Binding("pathPattern","thickness",T)),b({alignmentFocus:new I.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",j(),C(),e("ContextMenuButton",e(I.Panel,"Horizontal",P(0),P(1),P(2))),e("ContextMenuButton",e(I.Panel,"Horizontal",e(I.Panel,"Spot",E(!1),L(I.Spot.Top,!1),L(I.Spot.Left,!1),L(I.Spot.Right,!1),L(I.Spot.Bottom,!1)),e(I.Panel,"Spot",{margin:new I.Margin(0,0,0,2)},E(!0),L(I.Spot.Top,!0),L(I.Spot.Left,!0),L(I.Spot.Right,!0),L(I.Spot.Bottom,!0))))),new I.Palette(a.current,{maxSelectionCount:1,linkTemplate:e(I.Link,{locationSpot:I.Spot.Center,selectionAdornmentTemplate:e(I.Adornment,"Link",{locationSpot:I.Spot.Center},e(I.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(I.Shape,{toArrow:"Standard",stroke:null}))},{routing:I.Link.AvoidsNodes,curve:I.Link.JumpOver,corner:5,toShortLength:4},new I.Binding("points"),e(I.Shape,{isPanelMain:!0,strokeWidth:2}),e(I.Shape,{toArrow:"Standard",stroke:null})),model:new I.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(G()(I.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(I.Node,"Auto",{locationSpot:I.Spot.Center},new I.Binding("location","location",I.Point.parse).makeTwoWay(I.Point.stringify),e(I.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 I.Binding("stroke").makeTwoWay(),new I.Binding("fill").makeTwoWay(),new I.Binding("figure")),e(I.TextBlock,{margin:new I.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new I.Size(16,16),maxSize:new I.Size(10,NaN),textAlign:"center",editable:!0},new I.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(I.Panel,"Grid",e(I.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(I.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,h.jsx)("div",{ref:r})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(j.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},K=t(5112),Y=t(94001),J=K.ZP.Group,$={margin:"0 8px"},X=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(y.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:$,children:"单元格数:"}),(0,h.jsx)("span",{style:$,children:"行数"}),(0,h.jsx)(y.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(Y.Z,{})}),(0,h.jsx)("span",{style:$,children:"列数"}),(0,h.jsx)(y.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(Y.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:$,children:"对齐方式:"}),(0,h.jsx)(y.Z.Item,{name:"align",children:(0,h.jsxs)(J,{children:[(0,h.jsx)(K.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(K.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(K.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(K.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)(j.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(j.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},Q=t(78673),ee=t(48553),ne=t.n(ee),te=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,r=e.height,a=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=o()(u,2),p=d[0],f=d[1],m=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:r||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(){l.current=new(ne())(m.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return a&&a(e),e};return(0,c.useEffect)((function(){m.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){f(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:g}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,h.jsxs)(T.Z,{align:"middle",children:[(0,h.jsx)(H.Z,{flex:1,children:(0,h.jsx)(Q.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return f(e)}})}),(0,h.jsx)(H.Z,{children:(0,h.jsx)(j.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ie=t(22262),re=t(84666),ae=t(8591),oe="link",se="upload-image",le="add-flowchart",ce="draw-image",ue="code-block",de="add-table",pe="------------",fe={default:pe,left:":".concat(pe),center:":".concat(pe,":"),right:"".concat(pe,":")},he=t(6487);var me="@▁▁@",ge=["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 xe(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var ve=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",we=l()(l()({},ve+"-B","bold"),ve+"-I","italic"),be=l()(l()(l()(l()(l()(l()(l()(l()({},oe,"添加链接"),ue,"添加代码块"),se,"添加图片"),ce,"添加画图"),le,"插入流程图"),de,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),_e=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,a=e.width,s=void 0===a?"100%":a,u=e.height,g=void 0===u?400:u,x=e.miniToolbar,v=void 0!==x&&x,w=e.isFocus,y=void 0!==w&&w,k=e.watch,j=e.insertTemp,S=e.mode,T=void 0===S?"markdown":S,P=e.id,L=void 0===P?"markdown-editor-id":P,Z=e.showResizeBar,A=void 0!==Z&&Z,M=e.noStorage,q=void 0!==M&&M,G=e.showNullButton,I=void 0!==G&&G,O=e.showNullProgramButton,R=void 0!==O&&O,D=e.hidetoolBar,H=void 0!==D&&D,W=e.fullScreen,V=void 0!==W&&W,z=e.onBlur,K=e.onCMBeforeChange,Y=e.onFullScreen,J=e.className,$=void 0===J?"":J,Q=e.disablePaste,ee=void 0!==Q&&Q,ne=e.disabled,pe=void 0!==ne&&ne,ve=e.disabledFill,_e=void 0!==ve&&ve,ye=e.placeholder,ke=void 0===ye?"":ye,je=e.values,Se=void 0===je?"":je,Ne=e.extraUse,Ce=(0,c.useState)(null),Be=o()(Ce,2),Te=Be[0],Pe=Be[1],Ee=(0,c.useState)(t),Le=o()(Ee,2),Ze=Le[0],Ae=Le[1],Me=(0,c.useState)(k),qe=o()(Me,2),Ge=qe[0],Ie=qe[1],Oe=(0,c.useState)(V),Re=o()(Oe,2),De=Re[0],Fe=Re[1],He=(0,c.useState)(""),We=o()(He,2),Ve=We[0],ze=We[1],Ue=(0,c.useState)(0),Ke=o()(Ue,2),Ye=Ke[0],Je=Ke[1],$e=(0,c.useState)(g),Xe=o()($e,2),Qe=Xe[0],en=Xe[1],nn=(0,c.useState)(!1),tn=o()(nn,2),rn=(tn[0],tn[1]),an=(0,c.useState)(0),on=o()(an,2),sn=on[0],ln=on[1],cn=(0,c.useState)(0),un=o()(cn,2),dn=un[0],pn=un[1],fn=(0,c.useRef)(),hn=(0,c.useRef)(),mn=(0,c.useRef)(),gn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Ae(Se),null==Te||Te.setValue(Se),window.scrollTo(0,e)}),[Se]),(0,c.useEffect)((function(){null==Y||Y(De)}),[De]),(0,c.useEffect)((function(){if(fn.current){var e=function(e,t){if(!ee){var i=t.clipboardData;if(i){var r=i.types.toString(),a=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==T)return;try{var o,s=a[1];"file"===(null===(o=a[0])||void 0===o?void 0:o.kind)&&(s=a[0]);var l=s.getAsFile(),c=l.name.split(".").pop();(0,B.I)(l,(function(e){var t,i,r;e.id?(null==l||null===(t=l.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection(".concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(re.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==l||null===(r=l.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(re.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):ge.includes(c)?n.replaceSelection('<a href="'.concat(re.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):n.replaceSelection("[".concat(l.name,"](").concat(re.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(t){ae.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(fn.current,{mode:T,lineNumbers:!v,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",ke):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),r=t.getLine(i.line),a=r.charAt(i.ch-1),o=r.lastIndexOf("@▁@",i.ch),s=r.lastIndexOf("@▁▁@",i.ch),l=o>s?o:s,c=o>s?3:4;if(-1===me.indexOf(a))return null;if(console.log("change1:",n,e,r,i,l,o,s,a),l>=0&&i.ch-l<5){var u=l+c;return t.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),y&&n.focus(),n.on("paste",e),pe&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Pe(n),function(){n.off("paste",e)}}}),[]);var xn=(0,c.useCallback)((function(){hn.current}),[Qe,hn,De]);(0,c.useEffect)((function(){if(Te){var e=function(){var e=new p.Z((function(e){var n,t=r()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(xn(),Te.setSize("100%","100%"),Te.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(fn.current.parentElement),e}();return function(){var n,t;null!==(n=fn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=fn.current)||void 0===t?void 0:t.parentElement)}}}),[Te,xn]),(0,c.useEffect)((function(){if(Te){for(var e=[],n=function(){var n=o()(i[t],2),r=n[0],a=n[1],s=l()({},r,(function(){vn(a)}));e.push(s),Te.addKeyMap(s)},t=0,i=Object.entries(we);t<i.length;t++)n();return function(){for(var n=0,t=e;n<t.length;n++){var i=t[n];Te.removeKeyMap(i)}}}}),[Te]),(0,c.useEffect)((function(){V!==De&&Fe(V)}),[V]),(0,he.Z)((function(){if(!q&&Ye>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(L);e>=Ye+1e4&&(!n||n!==Ze)&&(window.sessionStorage.setItem(L,Ze),rn(!0))}}),1e4),(0,c.useEffect)((function(){Ie(k)}),[Te,k]),(0,c.useEffect)((function(){Te&&y&&Te.focus()}),[Te,y]),(0,c.useEffect)((function(){if(Ge&&Te){var e=function(e){var n=e.target;if(gn.current){var t=n.scrollTop/n.scrollHeight;gn.current.scrollTop=gn.current.scrollHeight*t}},n=Te.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Te,Ge]),(0,c.useEffect)((function(){if(Te&&K){var e=function(e,n){K(e,n)};return Te.on("beforeChange",e),function(){Te.off("beforeChange",e)}}}),[Te,K]),(0,c.useEffect)((function(){if(Te&&z){var e=function(){z(Te.getValue())};return Te.on("blur",e),function(){Te.off("blur",e)}}}),[Te,z]),(0,c.useEffect)((function(){if(Te){var e=function(e,n){var t=e.getValue();Ae(t),Je((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(R?i(t,kn(t)):i(t))};return Te.on("change",e),function(){Te.off("change",e)}}}),[Te,i]),(0,c.useEffect)((function(){if(Te)if(null==t)Te.setValue(""),Ae("");else{var e=window.scrollY||window.pageYOffset;t!==Te.getValue()&&(Te.setValue(t),Ae(t),Te.setCursor(pe?1:Te.lineCount(),0),window.scrollTo(0,e))}}),[Te,t]);var vn=(0,c.useCallback)((function(e){var n=Te.getCursor(),t=Te.getSelection(),i=t.split("\n");switch(e){case"bold":return Te.replaceSelection("**"+t+"**"),""===t&&Te.setCursor(n.line,n.ch+2),Te.focus();case"italic":return Te.replaceSelection("*"+t+"*"),""===t&&Te.setCursor(n.line,n.ch+1),Te.focus();case"code":return Te.replaceSelection("`"+t+"`"),""===t&&Te.setCursor(n.line,n.ch+1),Te.focus();case"inline-latex":return ze("inline-latex"),Te.focus();case"latex":return Te.replaceSelection("```latex\n"+t+"\n```"),Te.setCursor(n.line+1,t.length+1),Te.focus();case"line-break":return Te.replaceSelection("<br/>\n"),Te.focus();case"list-ul":return""===t?Te.replaceSelection("- "+t):Te.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Te.focus();case"list-ol":return""===t?Te.replaceSelection("1. "+t):Te.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Te.focus();case"add-null-ch":return""===t&&Te.setCursor(n.line,n.ch),Te.replaceSelection("▁"),Te.focus();case"add-signal":return""===t&&Te.setCursor(n.line,n.ch),Te.replaceSelection("@▁@"),Te.focus();case"add-multiple":return""===t&&Te.setCursor(n.line,n.ch),Te.replaceSelection(me),Te.focus();case"inster-template-1":return""===t&&Te.setCursor(n.line,n.ch),Te.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Te.focus();case"eraser":return Te.setValue(""),Te.focus();case"trigger-watch":return Ie(!Ge),Te.focus();case"trigger-full-screen":return Fe(!De),Te.focus();case oe:return void ze(oe);case ue:return void ze(ue);case se:return void ze(se);case ce:return void ze(ce);case"maths-latex":return void ze("maths-latex");case le:return void ze(le);case de:return void ze(de);default:throw new Error}}),[Te,Ge,De]),wn=(0,c.useCallback)((function(e,n){var t,i,r,a,o;switch(ze(""),Ve){case oe:var s=e.title,l=e.link;return Te.replaceSelection("[".concat(s,"](").concat(l,")")),Te.focus();case ue:var c=e.language,u=e.content;return Te.replaceSelection(["```"+c,u,"```"].join("\n")),Te.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),f=0;f<d.length;f++)p[f]=d.charCodeAt(f);var h=new Blob([p],{type:"image/png"});(0,B.I)(h,(function(e){e.id?Te.replaceSelection(".concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":Te.replaceSelection("`$$"+e+"$$`");break;case se:case ce:case"add-flowchart":var m=e.src,g=e.alt,x=n,v=null==x||null===(t=x.name)||void 0===t||null===(t=t.split("."))||void 0===t||null===(i=t.pop)||void 0===i?void 0:i.call(t);return(null==x||null===(r=x.type)||void 0===r?void 0:r.indexOf("image"))>-1||null==x||!x.type?g?Te.replaceSelection(".concat(m,' "').concat(g,'" )')):Te.replaceSelection("")):(null==x||null===(a=x.type)||void 0===a?void 0:a.indexOf("video"))>-1?Te.replaceSelection('<video width="100%" controls src="'.concat(re.Z.API_SERVER).concat(m,'"></video>')):(null==x||null===(o=x.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?Te.replaceSelection('<a href="'.concat(re.Z.API_SERVER).concat(m,"?type=").concat(x.type,'&disposition=inline" target="_blank">').concat(x.name,"</a>")):ge.includes(v)?Te.replaceSelection('<a href="'.concat(re.Z.API_SERVER).concat(m,'?type=office&disposition=inline" target="_blank">').concat(x.name,"</a>")):Te.replaceSelection("[".concat(x.name,"](").concat(re.Z.API_SERVER).concat(m,")")),Te.focus();case de:for(var w=e.row,b=e.col,_=e.align,y="\n",k=0;k<w;k++){for(var j=[],S=[],N=0;N<b;N++)1===k&&S.push(fe[_]),j.push(" ");1===k&&(y+="| ".concat(S.join(" | ")," |\n")),y+="| ".concat(j.join(1===b?"":" | ")," |\n")}return Te.replaceSelection(y+"\n"),Te.focus();default:throw new Error}}),[Te,Ve]),bn=(0,c.useMemo)((function(){switch(Ve){case oe:return(0,h.jsx)(N,{callback:wn,onCancel:_n});case ue:return(0,h.jsx)(C.Z,{callback:wn,onCancel:_n});case se:return(0,h.jsx)(B.Z,{callback:wn,onCancel:_n});case le:return(0,h.jsx)(U,{callback:wn,onCancel:_n});case de:return(0,h.jsx)(X,{callback:wn,onCancel:_n});case"maths-latex":return(0,h.jsx)(te,{showSaveButton:!0,callback:wn});case"inline-latex":return(0,h.jsx)(ie.Z,{showSaveButton:!0,callback:wn});default:return null}}),[Ve]);function _n(){ze("")}(0,c.useEffect)((function(){if(mn.current){var e=function(e){r=!0,a=e.pageY},n=function(){r=!1},t=function(e){if(r){var n=e.pageY-a;n<0&&(n=0),n>300&&(n=300),en(g+n+"px")}},i=mn.current,r=!1,a=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Te,mn]),(0,c.useEffect)((function(){en(g)}),[g]);var yn={width:xe(s),height:xe(Qe)},kn=((0,c.useMemo)((function(){if(Ye){var e=new Date(Ye),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Ye]),function(e){var n=[];if(R){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){be[Ve]&&Ve!==ce&&Ve!==le&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;ln(n),pn(t)}),0)}),[Ve]);var jn=function(e,n,t,i){var r=document.body.clientHeight,a=document.body.clientWidth;return!(e<20&&t>e||e>a-20&&t<e||n<20&&i>n||n>r-20&&i<n)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("div",{className:"markdown-editor-wrapper",ref:hn,children:(0,h.jsxs)("div",{className:"markdown-editor-container ".concat($," ").concat(Ge?"on-preview":""," ").concat(v?"mini":""," ").concat(De?"full-screen":""),style:yn,children:[(0,h.jsx)(b,{insertTemp:j,watch:Ge,fullScreen:De,showNullButton:I,showNullProgramButton:R,onActionCallback:vn,hidetoolBar:H,extraUse:Ne}),(0,h.jsxs)("div",{className:"markdown-editor-body",children:[(0,h.jsx)("div",{className:"codemirror-container",children:(0,h.jsx)("textarea",{ref:fn,placeholder:ke})}),Ge?(0,h.jsxs)("div",{ref:gn,className:"preview-container",children:["stex"===T&&(0,h.jsx)(m,{value:Ze}),"stex"!==T&&(0,h.jsx)(f.Z,{disabledFill:_e,showProgramFill:R,value:Ze})]}):null]})]})}),A?(0,h.jsx)("a",{ref:mn,className:"editor-resize"}):null,Ve===ce&&(0,h.jsx)(E,{callback:wn,onCancel:_n}),Ve===le&&(0,h.jsx)(U,{callback:wn,onCancel:_n}),(0,h.jsx)(_.Z,{children:be[Ve]&&Ve!==ce&&Ve!==le?(0,h.jsx)(F.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:sn,top:dn},title:(0,h.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var n=e.clientX-sn,t=e.clientY-dn;document.body.onmousemove=function(e){var i=e.clientX-n,r=e.clientY-t,a=document.getElementsByClassName("markdown-popup-form")[0],o=window.innerWidth-a.offsetWidth,s=window.innerHeight-a.offsetHeight;i=Math.max(0,Math.min(i,o)),r=Math.max(0,Math.min(r,s)),jn(e.clientX,e.clientY,n,t)&&(ln(i),pn(r))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:be[Ve]}),open:!0,onCancel:_n,footer:null,destroyOnClose:!0,width:Ve===le?"1200px":null,height:Ve===le?"80vh":null,className:"markdown-popup-form",children:bn}):null})]})}},55314:function(e,n,t){"use strict";t.d(n,{Z:function(){return x},I:function(){return w}});var i=t(82242),r=t.n(i),a=t(79800),o=t.n(a),s=t(78241),l=t(8591),c=t(92832),u=t(3113),d=t(79661),p=t(59301),f=t(37712),h=s.Z.useForm,m={width:280,marginRight:10},g={labelCol:{span:5},wrapperCol:{span:19}},x=function(e){var n=e.callback,t=e.onCancel,i=h(),a=o()(i,1)[0],d=(0,p.useRef)();function x(e,n){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):l.ZP.error(e.message)}return(0,f.jsxs)(s.Z,r()(r()({form:a},g),{},{className:"upload-image-panel",onFinish:function(e){n(e,d.current)},style:{width:470,overflow:"hidden"},children:[(0,f.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,f.jsxs)("div",{className:"flex-container",children:[(0,f.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,f.jsx)(c.Z,{style:m})}),(0,f.jsx)(v,{onFileChange:function(e){var n=e.target.files[0];d.current=n,w(n,x)}})]})}),(0,f.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,f.jsx)(c.Z,{style:{width:264}})}),(0,f.jsxs)(s.Z.Item,{style:{textAlign:"right"},children:[(0,f.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(u.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function v(e){var n=e.onFileChange;return(0,f.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,f.jsx)("input",{type:"file",onChange:n})]})}function w(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(d.KI,"/api/attachments.json")),i.send(t)}},39205:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var i=t(82100),r=t.n(i),a=t(29186),o=t.n(a),s=t(80619),l=t.n(s),c=t(47074),u=t.n(c),d=t(59301),p=t(4676),f=function(e){l()(t,e);var n=u()(t);function t(e){var i;r()(this,t),i=n.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return o()(t,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(d.Component)},6487:function(e,n,t){"use strict";t.d(n,{Z:function(){return r}});var i=t(59301);function r(e,n){var t=(0,i.useRef)();(0,i.useEffect)((function(){t.current=e})),(0,i.useEffect)((function(){if(null!==n){var e=setInterval((function(){t.current()}),n);return function(){return clearInterval(e)}}}),[n])}},20067:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Fe}});var i=t(7557),r=t.n(i),a=t(41498),o=t.n(a),s=t(82242),l=t.n(s),c=t(37205),u=t.n(c),d=t(79800),p=t.n(d),f=t(39647),h=t.n(f),m=t(59301),g=t(12606),x=t(20834),v=t(44e3),w=t(78241),b=t(8591),_=t(28103),y=t(66104),k=t(95237),j=t(43604),S=t(6848),N=t(92832),C=t(3113),B=t(65547),T=t(34614),P=t(43418),E=t(24905),L=t(94001),Z=t(75278),A=t(42903),M=t(8292),q="wrap___GtXAk",G="modal___mDuC3",I="titleWrap___EzCZh",O="required___KgfdI",R="title___TMgfc",D="colorGray___xNVTs",F="choiceWrap___Rv9ug",H="answer___hVpls",W="activeAnswer___oJoq9",V="deleteIcon___bkn4b",z="addIcon___S2pDY",U="editorWrap___BOx_r",K="htmlWrap___ERVlQ",Y="radio___lrt5b",J="color333___pz3OT",$="color999___jtQ7e",X="questionType___qUnUb",Q="questionChoices___n36qp",ee=t(37712),ne=["problemset","globalSetting","loading","dispatch","onRef","editData"],te=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ie=function(e,n){e.problemset,e.globalSetting,e.loading;var t=e.dispatch,i=(e.onRef,e.editData),a=(h()(e,ne),(0,m.useState)([])),s=p()(a,2),c=s[0],d=s[1],f=(0,m.useState)(),x=p()(f,2),v=x[0],w=x[1],_=(0,m.useState)([]),y=p()(_,2),N=y[0],B=y[1],T=(0,m.useState)(""),G=p()(T,2),D=G[0],Y=G[1],J=(0,m.useState)(5),$=p()(J,2),ie=$[0],re=$[1],ae=(0,m.useState)(!1),oe=p()(ae,2),se=oe[0],le=oe[1],ce=(0,g.useParams)();(0,m.useEffect)((function(){d(["","","",""])}),[]),(0,m.useEffect)((function(){if(null!=i&&i.question_choices){Y(null==i?void 0:i.question_title),re(parseInt(null==i?void 0:i.question_score)),d(null==i?void 0:i.question_choices.map((function(e){return e.choice_text})));var e=[];null==i||i.standard_answer.map((function(n,t){e.push(n-1)})),B(e)}else le(!0)}),[i]),(0,m.useImperativeHandle)(n,(function(){return{onSave:de,isEdit:se}}));var ue,de=function(){var e=o()(r()().mark((function e(){var n,a,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(D){e.next=3;break}return b.ZP.info("请您输入题目"),e.abrupt("return",!1);case 3:if(!((n=c.findIndex((function(e){return!e})))>-1)){e.next=7;break}return b.ZP.info("请先输入 ".concat(te[n]," 选项的内容")),e.abrupt("return",!1);case 7:if(N.length){e.next=10;break}return b.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),e.abrupt("return",!1);case 10:if(!(N.length<1)){e.next=13;break}return b.ZP.info("请选择答案"),e.abrupt("return",!1);case 13:if(a=c.map((function(e,n){return{choice_text:e,is_answer:N.includes(n)?n+1:0}})),!i.question_id){e.next=20;break}return e.next=17,t({type:"exercise/editExerciseQuestion",payload:{id:i.question_id,question_title:D,question_type:1,question_score:"5.0",question_choices:a.map((function(e){return e.choice_text})),standard_answers:a.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))}});case 17:o=e.sent,e.next=23;break;case 20:return e.next=22,t({type:"exercise/addExerciseQuestion",payload:{categoryId:ce.categoryId,question_title:D,question_type:1,question_score:"5.0",question_choices:a.map((function(e){return e.choice_text})),standard_answers:a.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))}});case 22:o=e.sent;case 23:0===o.status&&(b.ZP.success("保存成功"),le(!1),t({type:"exercise/editExercise",payload:l()({},ce)}));case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],fe=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.Fl)({id:i.question_id});case 2:t({type:"exercise/editExercise",payload:l()({},ce)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,t({type:"exercise/exeriseMoveUpDown",payload:{id:i.question_id,opr:n.id}});case 7:return t({type:"exercise/editExercise",payload:l()({},ce)}),e.abrupt("break",11);case 9:return le(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!se&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、多选题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&pe.map((function(e,n){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return fe(e)},className:e.icon})},n)}))]}),(0,ee.jsx)("div",{className:"mt5",children:(0,ee.jsx)(M.Z,{value:i.question_title})}),(0,ee.jsx)("div",{className:Q,children:null==i||null===(ue=i.question_choices)||void 0===ue?void 0:ue.map((function(e,n){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsx)(j.Z,{children:(0,ee.jsxs)(E.Z,{checked:i.standard_answer.includes(n+1),disabled:!0,children:[te[n],"."]},n)}),(0,ee.jsx)(j.Z,{flex:"1",children:(0,ee.jsx)("span",{className:"c-black font14",children:(0,ee.jsx)(M.Z,{value:e.choice_text})})})]})}))})]}),se&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:X,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"选择题"}),"(客观题,由系统自动评分,请设置标准答案)"]})}),(0,ee.jsxs)("p",{className:I,children:[(0,ee.jsx)("span",{className:O,children:"*"}),(0,ee.jsx)("span",{className:R,children:"题干:"})]}),(0,ee.jsx)(A.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:D,onChange:function(e){return Y(e)}}),c.map((function(e,n){return(0,ee.jsxs)("div",{className:F,children:[(0,ee.jsx)(S.Z,{title:"点击设置为标准答案",placement:"left",children:(0,ee.jsx)("div",{className:"".concat(H," ").concat(N.includes(n)?W:""),onClick:function(){N.includes(n)?B(N.filter((function(e){return e!==n}))):B([].concat(u()(N),[n]))},children:te[n]})}),(0,ee.jsx)("div",{className:U,children:v===n?(0,ee.jsx)(A.Z,{id:"single-question-option-".concat(n),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){c[n]=e,d(c)}}):(0,ee.jsx)("div",{className:K,onClick:function(){return w(n)},children:(0,ee.jsx)(M.Z,{value:e})})}),n>1&&(0,ee.jsx)(S.Z,{title:"删除",children:(0,ee.jsx)("i",{className:"".concat(V," iconfont icon-htmal5icon19"),onClick:function(){return d(c.filter((function(e,t){return t!==n})))}})}),n<7&&n===c.length-1&&(0,ee.jsx)(S.Z,{title:"新增参考答案",children:(0,ee.jsx)("i",{className:"".concat(z," iconfont icon-roundaddfill ml6"),onClick:function(){return d([].concat(u()(c),[""]))}})})]},n)})),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(L.Z,{value:ie,max:1e4,min:-1,onChange:function(e){re(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return le(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return de()},children:"保存"})]})]})]})},re=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(ie)),ae=t(5112),oe=["problemset","globalSetting","loading","dispatch","onRef","editData"],se=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],le=function(e,n){e.problemset,e.globalSetting,e.loading;var t=e.dispatch,i=(e.onRef,e.editData),a=(h()(e,oe),(0,m.useState)([])),s=p()(a,2),c=s[0],d=s[1],f=(0,m.useState)(),x=p()(f,2),v=x[0],w=x[1],_=(0,m.useState)([]),y=p()(_,2),N=y[0],B=y[1],E=(0,m.useState)(""),Z=p()(E,2),G=Z[0],D=Z[1],Y=(0,m.useState)(0),J=p()(Y,2),$=J[0],ne=J[1],te=(0,m.useState)(!1),ie=p()(te,2),re=ie[0],le=ie[1],ce=(0,g.useParams)();(0,m.useEffect)((function(){d(["","","",""])}),[]),(0,m.useEffect)((function(){if(null!=i&&i.question_choices){D(null==i?void 0:i.question_title),ne(parseInt(null==i?void 0:i.question_score)),d(null==i?void 0:i.question_choices.map((function(e){return e.choice_text})));var e=[];null==i||i.standard_answer.map((function(n,t){e.push(n-1)})),B(e)}else le(!0)}),[i]),(0,m.useImperativeHandle)(n,(function(){return{onSave:de,isEdit:re}}));var ue,de=function(){var e=o()(r()().mark((function e(){var n,a,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G){e.next=3;break}return b.ZP.info("请您输入题目"),e.abrupt("return",!1);case 3:if(!((n=c.findIndex((function(e){return!e})))>-1)){e.next=7;break}return b.ZP.info("请先输入 ".concat(se[n]," 选项的内容")),e.abrupt("return",!1);case 7:if(N.length){e.next=10;break}return b.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),e.abrupt("return",!1);case 10:if(!(N.length<1)){e.next=13;break}return b.ZP.info("请选择答案"),e.abrupt("return",!1);case 13:if(a=c.map((function(e,n){return{choice_text:e,is_answer:N.includes(n)?n+1:0}})),!i.question_id){e.next=20;break}return e.next=17,(0,T.Kc)({id:i.question_id,question_title:G,question_type:1,question_score:$,question_choices:a.map((function(e){return e.choice_text})),standard_answers:a.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 17:o=e.sent,e.next=23;break;case 20:return e.next=22,(0,T.iV)({exercise_bank_id:ce.topicId,question_title:G,question_type:1,question_score:"5.0",question_choices:a.map((function(e){return e.choice_text})),standard_answers:a.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 22:o=e.sent;case 23:return 0===o.status&&(b.ZP.success("保存成功"),le(!1)),e.next=26,t({type:"polls/getExerciseBanks",payload:l()({},ce)});case 26:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],fe=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,T.x$)({pollsId:i.question_id});case 2:t({type:"polls/getExerciseBanks",payload:l()({},ce)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,T.W)({exerciseId:null==i?void 0:i.question_id,opr:n.id});case 7:return t({type:"polls/getExerciseBanks",payload:l()({},ce)}),e.abrupt("break",11);case 9:return le(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!re&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、单选题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&pe.map((function(e,n){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return fe(e)},className:e.icon})},n)}))]}),(0,ee.jsx)("div",{className:"mt5",children:(0,ee.jsx)(M.Z,{value:i.question_title})}),(0,ee.jsx)("div",{className:Q,children:null==i||null===(ue=i.question_choices)||void 0===ue?void 0:ue.map((function(e,n){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsx)(j.Z,{children:(0,ee.jsxs)(ae.ZP,{checked:i.standard_answer.includes(n+1),disabled:!0,children:[se[n],"."]},n)}),(0,ee.jsx)(j.Z,{flex:"1",children:(0,ee.jsx)("span",{className:"c-black font14",children:(0,ee.jsx)(M.Z,{value:e.choice_text})})})]})}))})]}),re&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:X,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"选择题"}),"(客观题,由系统自动评分,请设置标准答案)"]})}),(0,ee.jsxs)("p",{className:I,children:[(0,ee.jsx)("span",{className:O,children:"*"}),(0,ee.jsx)("span",{className:R,children:"题干:"})]}),(0,ee.jsx)(A.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:G,onChange:function(e){return D(e)}}),c.map((function(e,n){return(0,ee.jsxs)("div",{className:F,children:[(0,ee.jsx)(S.Z,{title:"点击设置为标准答案",placement:"left",children:(0,ee.jsx)("div",{className:"".concat(H," ").concat(N.includes(n)?W:""),onClick:function(){N.includes(n)?B(N.filter((function(e){return e!==n}))):B([].concat(u()(N),[n]))},children:se[n]})}),(0,ee.jsx)("div",{className:U,children:v===n?(0,ee.jsx)(A.Z,{id:"single-question-option-".concat(n),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){c[n]=e,d(c)}}):(0,ee.jsx)("div",{className:K,onClick:function(){return w(n)},children:(0,ee.jsx)(M.Z,{value:e})})}),n>1&&(0,ee.jsx)(S.Z,{title:"删除",children:(0,ee.jsx)("i",{className:"".concat(V," iconfont icon-htmal5icon19"),onClick:function(){return d(c.filter((function(e,t){return t!==n})))}})}),n<7&&n===c.length-1&&(0,ee.jsx)(S.Z,{title:"新增参考答案",children:(0,ee.jsx)("i",{className:"".concat(z," iconfont icon-roundaddfill ml6"),onClick:function(){return d([].concat(u()(c),[""]))}})})]},n)})),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(L.Z,{value:$,max:1e4,min:-1,onChange:function(e){ne(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return le(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return de()},children:"保存"})]})]})]})},ce=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(le)),ue=["problemset","globalSetting","loading","dispatch","onRef","editData"],de=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pe=function(e,n){e.problemset,e.globalSetting,e.loading;var t=e.dispatch,i=(e.onRef,e.editData),a=(h()(e,ue),(0,m.useState)()),s=p()(a,2),c=s[0],u=s[1],d=(0,m.useState)(""),f=p()(d,2),x=f[0],v=f[1],w=(0,m.useState)(!1),_=p()(w,2),y=_[0],k=_[1],j=(0,m.useState)(5),N=p()(j,2),B=N[0],E=N[1],Z=(0,g.useParams)();(0,m.useEffect)((function(){null!=i&&i.question_choices?(v(null==i?void 0:i.question_title),E(null==i?void 0:i.question_score),u(i.standard_answer[0]+"")):k(!0)}),[i]),(0,m.useImperativeHandle)(n,(function(){return{onSave:G,isEdit:y}}));var M,G=function(){var e=o()(r()().mark((function e(){var n,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x){e.next=3;break}return b.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:if(c){e.next=6;break}return b.ZP.info("请先点击选择本选择题的正确选项"),e.abrupt("return",!1);case 6:if(n=[{choice_text:"正确",is_answer:"1"===c?1:0},{choice_text:"错误",is_answer:"2"===c?2:0}],!i.question_id){e.next=13;break}return e.next=10,(0,T.Kc)({id:i.question_id,question_title:x,question_type:2,question_score:B,question_choices:n.map((function(e){return e.choice_text})),standard_answers:n.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 10:a=e.sent,e.next=16;break;case 13:return e.next=15,(0,T.iV)({exercise_bank_id:Z.topicId,question_title:x,question_type:2,question_score:B,question_choices:n.map((function(e){return e.choice_text})),standard_answers:n.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 15:a=e.sent;case 16:return 0===a.status&&(b.ZP.success("保存成功"),k(!1)),t({type:"polls/getExerciseBanks",payload:l()({},Z)}),e.abrupt("return",{name:x,choices:n});case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],H=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,T.x$)({pollsId:i.question_id});case 2:t({type:"polls/getExerciseBanks",payload:l()({},Z)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,T.W)({exerciseId:null==i?void 0:i.question_id,opr:n.id});case 7:return t({type:"polls/getExerciseBanks",payload:l()({},Z)}),e.abrupt("break",11);case 9:return k(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!y&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、判断题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&F.map((function(e,n){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return H(e)},className:e.icon})},n)}))]}),(0,ee.jsx)("div",{className:"mt5",children:i.question_title}),(0,ee.jsx)("div",{className:Q,children:null==i||null===(M=i.question_choices)||void 0===M?void 0:M.map((function(e,n){return(0,ee.jsxs)(ae.ZP,{checked:i.standard_answer.includes(n+1),disabled:!0,children:[de[n],". ",(0,ee.jsx)("span",{className:"c-black font14",children:e.choice_text})]},n)}))})]}),y&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"判断题"}),"(客观题,由系统自动评分,请设置标准答案)"]}),(0,ee.jsxs)("p",{className:I,children:[(0,ee.jsx)("span",{className:O,children:"*"}),(0,ee.jsx)("span",{className:R,children:"题干:"})]}),(0,ee.jsx)(A.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:x,onChange:function(e){return v(e)}}),(0,ee.jsxs)("p",{className:I,children:[(0,ee.jsx)("span",{className:O,children:"*"}),(0,ee.jsxs)("span",{className:R,children:["答案选项:",(0,ee.jsx)("span",{className:D,children:"点击选项可设置正确答案"})]})]}),(0,ee.jsxs)(ae.ZP.Group,{buttonStyle:"solid",value:c,onChange:function(e){return u(e.target.value)},children:[(0,ee.jsx)(ae.ZP.Button,{value:"1",className:"".concat(Y," mr40"),children:"正确"}),(0,ee.jsx)(ae.ZP.Button,{value:"2",className:Y,children:"错误"})]}),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项,可以直接设置标准答案"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(L.Z,{value:B,max:1e4,min:-1,onChange:function(e){E(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return k(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return G()},children:"保存"})]})]})]})},fe=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(pe)),he=t(87976),me=t(43311),ge=t(16739),xe=["problemset","globalSetting","loading","dispatch","editData"],ve=function(e,n){var t=e.problemset,i=(e.globalSetting,e.loading,e.dispatch),a=e.editData,s=(h()(e,xe),(0,m.useState)("")),c=p()(s,2),d=c[0],f=c[1],x=(0,m.useState)(""),v=p()(x,2),w=v[0],_=(v[1],(0,m.useState)([])),y=p()(_,2),B=y[0],Z=y[1],A=(0,m.useState)(""),M=p()(A,2),I=M[0],O=M[1],R=(0,m.useState)(),D=p()(R,2),F=D[0],H=D[1],W=(0,m.useState)(!1),V=p()(W,2),z=V[0],U=V[1],K=(0,m.useState)(5),Y=p()(K,2),ne=Y[0],te=Y[1],ie=(0,m.useState)(!1),re=p()(ie,2),ae=re[0],oe=re[1],se=(0,g.useParams)();(0,m.useEffect)((function(){if(null!=a&&a.question_title){f(null==a?void 0:a.question_title),H(null==a?void 0:a.is_ordered),te(null==a?void 0:a.question_score);var e=null==a?void 0:a.standard_answer.map((function(e){return e.answer_text}));Z(e)}else oe(!0)}),[t.editData]),(0,m.useEffect)((function(){U(!1)}),[ae]),(0,m.useImperativeHandle)(n,(function(){return{onSave:ce,isEdit:ae}}));var le,ce=function(){var e=o()(r()().mark((function e(){var n,t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],t=!1,B.forEach((function(e,i){n.push({choice_id:i+1,answer_text:[]}),e.forEach((function(e,r){n[i].answer_text.push(e),e&&(0,ge.eR)(e,1e4)||(O("".concat(i,"-").concat(r)),b.ZP.info(e?"答案不能超过10000字符":"答案:不能为空"),t=!0)}))})),!t){e.next=5;break}return e.abrupt("return",!1);case 5:if(!a.question_id){e.next=11;break}return e.next=8,(0,T.Kc)({id:a.question_id,question_title:d,question_type:3,question_score:ne,is_ordered:F,standard_answers:n});case 8:o=e.sent,e.next=14;break;case 11:return e.next=13,(0,T.iV)({exercise_bank_id:se.topicId,question_title:d,question_type:3,question_score:ne,is_ordered:F,standard_answers:n});case 13:o=e.sent;case 14:return 0===o.status&&(b.ZP.success("保存成功"),oe(!1)),i({type:"polls/getExerciseBanks",payload:l()({},se)}),e.abrupt("return",{name:d,analysis:w,standard_answers:n,is_ordered:F});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(e,n,t){var i=B.slice();if(n&&i.splice(e,n),t&&z)for(var r=0;r<t;r++)i.splice(e+r,0,[""]);U(!0),Z(i)},de=function(e,n,t){O("");var i=B.slice();i[e][n]=t,Z(i)},pe=function(e){var n=B.slice();n[e]=[].concat(u()(n[e]),[""]),Z(n)},fe=function(e,n){var t=B.slice();if(!t[e][n])return t[e]=t[e].filter((function(e,t){return t!==n})),void Z(t);P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:G,onOk:function(){t[e]=t[e].filter((function(e,t){return t!==n})),Z(t)}})},ve=function(e){P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:G,onOk:function(){var n=B.slice();n=B.filter((function(n,t){return e!==t})),Z(n)}})},we=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],be=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,T.x$)({pollsId:a.question_id});case 2:i({type:"polls/getExerciseBanks",payload:l()({},se)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,T.W)({exerciseId:null==a?void 0:a.question_id,opr:n.id});case 7:return i({type:"polls/getExerciseBanks",payload:l()({},se)}),e.abrupt("break",11);case 9:return oe(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!ae&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[a.key,"、填空题"]}),"(",a.question_score,"分)"]}),!a.hideAction&&we.map((function(e,n){return"up"===e.id&&1===a.key||"down"===e.id&&a.key===a.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return be(e)},className:e.icon})},n)}))]}),(0,ee.jsx)("div",{className:"mt5",children:a.question_title}),(0,ee.jsx)("div",{className:Q,children:null==a||null===(le=a.standard_answer)||void 0===le?void 0:le.map((function(e,n){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsxs)(j.Z,{children:["答案(填空",e.choice_id,"):"]}),(0,ee.jsx)(j.Z,{flex:"1",children:(0,ee.jsx)(N.Z,{checked:a.standard_answer.includes(n),disabled:!0,value:e.answer_text},n)})]})}))})]}),ae&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:X,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"填空题"}),"(客观题,由系统自动评分,允许手动调分,请设置标准答案 ;支持最多5个空,每空得分按照本题的总分平均计算)"]})}),(0,ee.jsx)("div",{children:(0,ee.jsx)(he.Z,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:d,onChange:function(e){return f(e)},showNullButton:!0,onPlaceholderChange:ue})}),(0,ee.jsx)("div",{className:"mt20",children:B.map((function(e,n){return(0,ee.jsx)(me.Z,{answers:e,index:n,is_md:!0,activeOptionErrorIndex:I,onAnswerChange:de,addChildAnswer:pe,deleteChildAnswer:fe,deleteChildAnswermain:ve},n)}))}),(0,ee.jsx)("div",{className:"mt20",children:B.length>1&&(0,ee.jsxs)("span",{children:[(0,ee.jsx)(E.Z,{checked:F,onChange:function(e){return H(e.target.checked)},className:"".concat(J," font14"),children:"多个填空的答案有顺序要求"}),(0,ee.jsx)("span",{className:"".concat($," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(L.Z,{value:ne,max:1e4,min:-1,onChange:function(e){te(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[a.question_id&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return oe(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return ce()},children:"保存"})]})]})]})},we=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(ve)),be=["problemset","globalSetting","loading","dispatch","onRef","editData"],_e=function(e,n){var t=e.problemset,i=(e.globalSetting,e.loading,e.dispatch),a=(e.onRef,e.editData),s=(h()(e,be),(0,m.useState)("")),c=p()(s,2),u=c[0],d=c[1],f=(0,m.useState)(""),x=p()(f,2),v=x[0],w=(x[1],(0,m.useState)("")),_=p()(w,2),y=_[0],k=_[1],j=(0,m.useState)(5),N=p()(j,2),B=N[0],E=N[1],Z=(0,m.useState)(!1),G=p()(Z,2),O=G[0],D=G[1],F=(0,g.useParams)();(0,m.useEffect)((function(){var e;null!=a&&a.question_title?(d(null==a?void 0:a.question_title),k(null==a||null===(e=a.standard_answer)||void 0===e?void 0:e[0]),E(null==a?void 0:a.question_score)):D(!0)}),[t.editData]),(0,m.useImperativeHandle)(n,(function(){return{onSave:H,isEdit:O}}));var H=function(){var e=o()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=3;break}return b.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:if(!a.question_id){e.next=9;break}return e.next=6,(0,T.Kc)({id:a.question_id,question_title:u,question_type:4,question_score:B,standard_answers:[y]});case 6:n=e.sent,e.next=12;break;case 9:return e.next=11,(0,T.iV)({exercise_bank_id:F.topicId,question_title:u,question_type:4,question_score:B,standard_answers:[y]});case 11:n=e.sent;case 12:return 0===n.status&&(b.ZP.success("保存成功"),D(!1),i({type:"polls/getExerciseBanks",payload:l()({},F)})),e.abrupt("return",{name:u,answer_texts:[y],analysis:v});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),W=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],V=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,T.x$)({pollsId:a.question_id});case 2:i({type:"polls/getExerciseBanks",payload:l()({},F)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,T.W)({exerciseId:null==a?void 0:a.question_id,opr:n.id});case 7:return i({type:"polls/getExerciseBanks",payload:l()({},F)}),e.abrupt("break",11);case 9:return D(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!O&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[a.key,"、简答题"]}),"(",a.question_score,"分)"]}),!a.hideAction&&W.map((function(e,n){return"up"===e.id&&1===a.key||"down"===e.id&&a.key===a.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return V(e)},className:e.icon})},n)}))]}),(0,ee.jsx)("div",{className:"mt5",children:a.question_title}),(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsx)("p",{children:(0,ee.jsx)("strong",{children:"参考答案:"})}),(0,ee.jsx)(M.Z,{value:y})]})]}),O&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:X,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"简答题"}),"(主观题,未作答的情况下自动评为零分)"]})}),(0,ee.jsx)(A.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:u,onChange:function(e){return d(e)}}),(0,ee.jsx)("p",{className:I,children:(0,ee.jsx)("span",{className:R,children:"参考答案:"})}),(0,ee.jsx)(A.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:y,onChange:function(e){return k(e)}}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(L.Z,{value:B,max:1e4,min:-1,onChange:function(e){E(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[a.question_id&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return D(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return H()},children:"保存"})]})]})]})},ye=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(_e)),ke=["problemset","globalSetting","loading","dispatch","editData"],je=function(e,n){e.problemset,e.globalSetting,e.loading;var t=e.dispatch,i=e.editData,a=(h()(e,ke),(0,m.useState)("")),s=p()(a,2),c=s[0],u=s[1],d=(0,m.useState)(""),f=p()(d,2),x=f[0],v=f[1],w=(0,m.useState)(""),_=p()(w,2),y=_[0],B=(_[1],(0,m.useState)([])),Z=p()(B,2),M=Z[0],G=(Z[1],(0,m.useState)("")),I=p()(G,2),O=(I[0],I[1],(0,m.useState)()),R=p()(O,2),D=R[0],F=R[1],H=(0,m.useState)(!1),W=p()(H,2),V=(W[0],W[1]),z=(0,m.useState)([]),U=p()(z,2),K=U[0],Y=U[1],Q=(0,m.useState)(!1),ne=p()(Q,2),te=ne[0],ie=ne[1],re=(0,g.useParams)();(0,m.useEffect)((function(){var e;i.edit&&ie(!0),u(i.shixun_name),v(i.question_title);var n=[];null===(e=i.shixun)||void 0===e||e.map((function(e){n.push(e.challenge_score)})),Y(n)}),[i]),(0,m.useEffect)((function(){V(!1)}),[te]),(0,m.useImperativeHandle)(n,(function(){return{onSave:se,isEdit:te}}));var ae,oe,se=function(){var e=o()(r()().mark((function e(){var n,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],!1,e.next=4;break;case 4:if(!i.question_id){e.next=10;break}return e.next=7,(0,T.Kc)({id:i.question_id,question_title:x,shixun_name:c,shixun_id:i.shixun_id,question_type:5,question_scores:K});case 7:a=e.sent,e.next=13;break;case 10:return e.next=12,(0,T.iV)({exercise_bank_id:re.topicId,question_title:x,shixun_name:c,shixun_id:i.shixun_id,question_type:5,question_scores:K});case 12:a=e.sent;case 13:return 0===a.status&&(b.ZP.success("保存成功"),ie(!1)),e.next=16,t({type:"polls/getExerciseBanks",payload:l()({},re)});case 16:return e.abrupt("return",{name:x,analysis:y,standard_answers:n,is_ordered:D});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ce=function(){var e=o()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return P.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,T.x$)({pollsId:i.question_id});case 2:t({type:"polls/getExerciseBanks",payload:l()({},re)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,T.W)({exerciseId:null==i?void 0:i.question_id,opr:n.id});case 7:return t({type:"polls/getExerciseBanks",payload:l()({},re)}),e.abrupt("break",11);case 9:return ie(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:q,children:[!te&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:X,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、实训题"]}),"(",i.question_score,"分)"]}),(0,ee.jsxs)("div",{className:"tr",children:[(0,ee.jsx)(g.Link,{target:"_blank",to:"/shixuns/".concat(i.shixun_identifier,"/challenges"),children:"实训详情"}),!i.hideAction&&le.map((function(e,n){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(S.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return ce(e)},className:e.icon})},n)}))]})]}),(0,ee.jsx)("div",{className:"font16",children:i.shixun_name}),(0,ee.jsx)("div",{className:"mt30"}),null===(oe=i.shixun)||void 0===oe?void 0:oe.map((function(e,n){return(0,ee.jsxs)("div",{children:["第",n+1,"关 ",(0,ee.jsx)("span",{className:"ml10",children:e.challenge_name})," ",(0,ee.jsx)("span",{className:"ml10",children:e.challenge_score})]},n)}))]}),te&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:X,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"实训题"}),"(客观题,由系统自动评分,允许手动调分)"]})}),(0,ee.jsx)("div",{className:"mt10",children:(0,ee.jsx)(N.Z,{defaultValue:c,onChange:function(e){u(e.target.value)}})}),(0,ee.jsx)("div",{className:"mt10",children:(0,ee.jsx)(A.Z,{id:"single-question-option-0",height:155,placeholder:"请输入实训题完成要求",defaultValue:x,onChange:function(e){v(e)}})}),(0,ee.jsx)("div",{className:"mt20",children:null===(ae=i.shixun)||void 0===ae?void 0:ae.map((function(e,n){return(0,ee.jsxs)(k.Z,{gutter:[20,20],children:[(0,ee.jsxs)(j.Z,{flex:"1",children:[n+1,".",e.challenge_name]}),(0,ee.jsx)(j.Z,{children:(0,ee.jsx)(L.Z,{defaultValue:K[n],onChange:function(e){K[n]=e,Y(K),console.log("srore:L",K[n])}})})]})}))}),(0,ee.jsx)("div",{className:"mt20",children:M.length>1&&(0,ee.jsxs)("span",{children:[(0,ee.jsx)(E.Z,{checked:D,onChange:function(e){return F(e.target.checked)},className:"".concat(J," font14"),children:"多个填空的答案有顺序要求"}),(0,ee.jsx)("span",{className:"".concat($," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})}),(0,ee.jsxs)("aside",{className:"tr",children:[!(null!=i&&i.edit)&&(0,ee.jsx)(C.ZP,{type:"default",onClick:function(){return ie(!1)},children:"取消"}),(0,ee.jsx)(C.ZP,{className:"ml20",type:"primary",onClick:function(){return se()},children:"保存"})]})]})]})},Se=(0,g.connect)((function(e){var n=e.problemset,t=e.loading;return{problemset:n,globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(je)),Ne=t(43428),Ce=t(86859),Be="drawer___aMsAr",Te="menu___EdF6h",Pe="actived___rUgO6",Ee="listItem___Ixzli",Le="info___KHkuz",Ze="title___pDJPn",Ae="titleLeft___UBBKz",Me="search___AEwRm",qe="description___CYPQc",Ge=N.Z.Search,Ie=[{id:"type",name:"筛选",children:[{name:"全部实训",id:"all",type:"type"},{name:"我的实训",id:"mine",type:"type"}]},{id:"diff",name:"难度",children:[{name:"全部",id:"",type:"diff"},{name:"初级",id:1,type:"diff"},{name:"中级",id:2,type:"diff"},{name:"中高级",id:3,type:"diff"},{name:"高级",id:4,type:"diff"}]}],Oe=(0,g.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var n,t=e.classroomList,i=(e.loading,e.dispatch),a=e.callback,s=(0,g.useParams)(),c=((0,g.useLocation)(),t.actionTabs,w.Z.useForm()),u=(p()(c,1)[0],t.shixunLists),d=(0,m.useState)([]),f=p()(d,2),h=f[0],x=f[1],v=(0,m.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1}),y=p()(v,2),k=y[0],j=y[1];return(0,m.useEffect)((function(){i({type:"classroomList/getShixunLists",payload:l()({},k)})}),[s.categoryId]),(0,m.useEffect)((function(){x([])}),[t.actionTabs.key]),"选用实践项目"!==t.actionTabs.key?null:(0,ee.jsxs)(Ne.Z,{title:"选用实践项目",placement:"bottom",height:"100%",closable:!1,open:"选用实践项目"===t.actionTabs.key,rootClassName:Be,footer:(0,ee.jsxs)("div",{className:"tc",children:[(0,ee.jsx)(C.ZP,{size:"middle",onClick:function(){i({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8},children:"取消"}),(0,ee.jsx)(C.ZP,{size:"middle",onClick:o()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.length>1?b.ZP.error("只能选择一个实践项目"):0===h.length?b.ZP.error("请选择实践项目"):(a&&a(null==u||null===(n=u.shixun_list)||void 0===n?void 0:n.filter((function(e){return e.id===h[0]}))[0]),i({type:"classroomList/setActionTabs",payload:{key:""}}));case 1:case"end":return e.stop()}}),e)}))),type:"primary",children:"确定"})]}),children:[(0,ee.jsx)("section",{className:"tc",children:(0,ee.jsx)(Ge,{placeholder:"实训信息/院校名称/创建者",enterButton:"搜索",size:"middle",className:Me,onSearch:function(e){k.keyword=e,i({type:"classroomList/getShixunLists",payload:l()({},k)})}})}),(0,ee.jsxs)("section",{className:"edu-container",children:[Ie.map((function(e,n){var t;return(0,ee.jsxs)("ul",{className:Te,children:[(0,ee.jsx)("li",{children:e.name}),null==e||null===(t=e.children)||void 0===t?void 0:t.map((function(n,t){return(0,ee.jsx)("li",{className:k[e.id]==n.id?Pe:"",onClick:function(){k[e.id]=n.id,j(l()({},k)),i({type:"classroomList/getShixunLists",payload:l()({},k)})},children:(0,ee.jsx)("strong",{children:n.name})},t)}))]},n)})),null==u||null===(n=u.shixun_list)||void 0===n?void 0:n.map((function(e,n){return(0,ee.jsxs)("div",{className:Ee,children:[(0,ee.jsx)(E.Z,{checked:h.includes(e.id),value:e.id,onChange:function(n){h.indexOf(e.id);h.indexOf(e.id)>-1?x(h.filter((function(n){return n!==e.id}))):x(h.concat(e.id))}}),(0,ee.jsxs)("div",{className:Le,children:[(0,ee.jsx)("div",{className:Ze,children:(0,ee.jsx)("div",{className:Ae,children:(0,ee.jsx)("strong",{className:"font16",dangerouslySetInnerHTML:{__html:e.title}})})}),(0,ee.jsx)("div",{className:"flex-wrp mt10 font14 c-light-black",children:(0,ee.jsx)("span",{className:qe,dangerouslySetInnerHTML:{__html:e.description}})}),(0,ee.jsx)("div",{className:" mt15",children:e.challenge_names.map((function(e,n){return(0,ee.jsxs)("span",{className:"mr30",children:["第",n+1,"关 ",e," "]},n)}))}),(0,ee.jsx)(_.Z,{dashed:!0}),(0,ee.jsxs)("div",{className:"c-light-black mt20",children:[(0,ee.jsx)("span",{children:e.author_name}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsx)("span",{children:e.author_school_name}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsxs)("span",{children:["难度系数:",e.level]}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsx)("span",{children:"学习人数:"}),(0,ee.jsx)("span",{children:e.study_count})]})]})]},n)})),(0,ee.jsx)("p",{})]}),(0,ee.jsx)("div",{className:"tc",children:(0,ee.jsx)(Ce.Z,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,total:null==u?void 0:u.shixuns_count,onChange:function(e){k.page=e,x([]),i({type:"classroomList/getShixunLists",payload:l()({},k)})}})})]},"bottom")})),Re={flex_box_center:"flex_box_center___SQWFF",flex_space_between:"flex_space_between___CnFKV",flex_box_vertical_center:"flex_box_vertical_center___pIPP9",flex_box_center_end:"flex_box_center_end___wiYA8",flex_box_column:"flex_box_column___elCPc",bg:"bg___EaPuT",containerTitle:"containerTitle___ixpkx",containerDesc:"containerDesc___r2R0u",listItem:"listItem___jvD98",info:"info___dCwGz",title:"title___UW6TT",titleLeft:"titleLeft___MquHc",titleRight:"titleRight___aWhE3",acitons:"acitons___yle7y"},De=["polls","globalSetting","loading","user","dispatch"],Fe=(x.Z.SubMenu,v.Z.Content,v.Z.Sider,(0,g.connect)((function(e){var n=e.polls,t=e.loading,i=e.user;return{polls:n,globalSetting:e.globalSetting,user:i,loading:t.effects}}))((function(e){var n,t,i,a,s,c,d,f,x,v,P,E,L,Z,A,M,q,G,I,O,R,D,F,H,W,V,z,U,K=e.polls,Y=(e.globalSetting,e.loading,e.user),J=e.dispatch,$=(h()(e,De),(0,g.useParams)()),X=((0,g.useLocation)(),Y.userInfo),Q=w.Z.useForm(),ne=p()(Q,1)[0],te=(0,m.useState)([]),ie=p()(te,2),ae=ie[0],oe=ie[1],se=(0,m.useState)(!1),le=p()(se,2),ue=le[0],de=le[1],pe=(0,m.useRef)();(0,m.useEffect)((function(){var e,n,t,i;null!==(e=K.exerciseBanks)&&void 0!==e&&e.exercise_questions&&(oe(u()(null===(n=K.exerciseBanks)||void 0===n?void 0:n.exercise_questions)),ne.setFieldsValue({exercise_name:null===(t=K.exerciseBanks)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.exercise_name,exercise_description:null===(i=K.exerciseBanks)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_description}))}),[K.exerciseBanks]),(0,m.useEffect)((function(){J({type:"polls/getExerciseBanks",payload:l()({},$)})}),[$.categoryId]);var he=function(){var e=o()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ne.validateFields();case 2:return(t=ne.getFieldValue()).is_md=!0,t.topicId=null===(n=K.exerciseBanks)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.id,de(!1),e.next=8,(0,T.hO)(l()({},t));case 8:J({type:"polls/getExerciseBanks",payload:l()({},$)});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=o()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==pe?void 0:pe.current;case 2:if(null==(t=e.sent)||!t.isEdit){e.next=6;break}return b.ZP.error("不能同时编辑两题"),e.abrupt("return");case 6:5===n?J({type:"classroomList/setActionTabs",payload:{key:"选用实践项目"}}):oe([].concat(u()(ae),[{question_type:n}]));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:"edu-container",children:[(0,ee.jsxs)("section",{className:"animated fadeIn",children:[(0,ee.jsx)("aside",{className:"mt10",children:X&&(0,ee.jsxs)(y.Z,{separator:">",children:[(0,ee.jsx)(y.Z.Item,{children:(0,ee.jsx)(g.Link,{to:"/users/".concat(X.login,"/topics/personal"),children:"我的题库"})}),(0,ee.jsx)(y.Z.Item,{children:(0,ee.jsx)(g.Link,{to:"/users/".concat(null==X?void 0:X.login,"/topics/").concat($.topicId,"/").concat($.topictype,"/exercise/detail"),children:"详情"})}),(0,ee.jsx)(y.Z.Item,{children:"编辑"})]})}),(0,ee.jsx)("aside",{className:[Re.title,"mt20"].join(" "),children:(0,ee.jsxs)(k.Z,{style:{width:"100%"},align:"middle",children:[(0,ee.jsxs)(j.Z,{flex:"1",children:[(0,ee.jsx)("strong",{className:"font20 ml5",children:"编辑试卷"}),(0,ee.jsx)(ge.VV,{status:[null!==(n=K.exerciseBanks)&&void 0!==n&&null!==(n=n.exercise)&&void 0!==n&&n.is_public?"公开":"私有"]})]}),(0,ee.jsx)(j.Z,{children:(0,ee.jsx)(g.Link,{className:"font16 c-light-black",to:"/users/".concat(X.login,"/topics/personal"),children:"返回"})})]})})]}),(0,ee.jsxs)("section",{className:[Re.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:[!ue&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Re.containerDesc,children:[(0,ee.jsx)("div",{children:null===(t=K.exerciseBanks)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.exercise_name}),(0,ee.jsx)("div",{children:(0,ee.jsx)(S.Z,{title:"编辑",children:(0,ee.jsx)("span",{onClick:function(){return de(!0)},className:"iconfont c-green ml30 icon-bianjishijuan3x"})})})]}),(0,ee.jsx)("div",{className:"c-light-black",children:null===(i=K.exerciseBanks)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_description})]}),ue&&(0,ee.jsxs)(w.Z,{layout:"vertical",form:ne,children:[(0,ee.jsx)(w.Z.Item,{name:"exercise_name",label:"试卷标题:",rules:[{required:!0,message:"请填写试卷标题"}],children:(0,ee.jsx)(N.Z,{maxLength:60,placeholder:"试卷标题,最大限制60个字符"})}),(0,ee.jsx)(w.Z.Item,{label:"试卷须知:",name:"exercise_description",children:(0,ee.jsx)(N.Z.TextArea,{rows:6,placeholder:"请在此输入本次试卷答题的相关说明,最大限制100个字符"})}),(0,ee.jsx)(w.Z.Item,{className:"tr",children:(0,ee.jsx)(C.ZP,{type:"primary",onClick:function(){he()},children:"保存"})})]})]}),(0,ee.jsxs)("p",{className:"mt10",style:{display:"flex"},children:[(0,ee.jsxs)("span",{className:"fl",style:{flex:"1"},children:[!(null===(a=K.exerciseBanks)||void 0===a||null===(a=a.exercise_types)||void 0===a||!a.q_singles)&&(0,ee.jsxs)("span",{className:"ml20",children:["单选题",null===(s=K.exerciseBanks)||void 0===s||null===(s=s.exercise_types)||void 0===s?void 0:s.q_singles,"题,共",null===(c=K.exerciseBanks)||void 0===c||null===(c=c.exercise_types)||void 0===c?void 0:c.q_singles_scores,"分"]}),!(null===(d=K.exerciseBanks)||void 0===d||null===(d=d.exercise_types)||void 0===d||!d.q_doubles)&&(0,ee.jsxs)("span",{className:"ml20",children:["多选题",null===(f=K.exerciseBanks)||void 0===f||null===(f=f.exercise_types)||void 0===f?void 0:f.q_doubles,"题,共",null===(x=K.exerciseBanks)||void 0===x||null===(x=x.exercise_types)||void 0===x?void 0:x.q_doubles_scores,"分"]}),!(null===(v=K.exerciseBanks)||void 0===v||null===(v=v.exercise_types)||void 0===v||!v.q_judges)&&(0,ee.jsxs)("span",{className:"ml20",children:["判断题",null===(P=K.exerciseBanks)||void 0===P||null===(P=P.exercise_types)||void 0===P?void 0:P.q_judges,"题,共",null===(E=K.exerciseBanks)||void 0===E||null===(E=E.exercise_types)||void 0===E?void 0:E.q_judges_scores,"分"]}),!(null===(L=K.exerciseBanks)||void 0===L||null===(L=L.exercise_types)||void 0===L||!L.q_nulls)&&(0,ee.jsxs)("span",{className:"ml20",children:["填空题",null===(Z=K.exerciseBanks)||void 0===Z||null===(Z=Z.exercise_types)||void 0===Z?void 0:Z.q_nulls,"题,共",null===(A=K.exerciseBanks)||void 0===A||null===(A=A.exercise_types)||void 0===A?void 0:A.q_nulls_scores,"分"]}),!(null===(M=K.exerciseBanks)||void 0===M||null===(M=M.exercise_types)||void 0===M||!M.q_mains)&&(0,ee.jsxs)("span",{className:"ml20",children:["简答题",null===(q=K.exerciseBanks)||void 0===q||null===(q=q.exercise_types)||void 0===q?void 0:q.q_mains,"题,共",null===(G=K.exerciseBanks)||void 0===G||null===(G=G.exercise_types)||void 0===G?void 0:G.q_mains_scores,"分"]}),!(null===(I=K.exerciseBanks)||void 0===I||null===(I=I.exercise_types)||void 0===I||!I.q_shixuns)&&(0,ee.jsxs)("span",{className:"ml20",children:["实训题",null===(O=K.exerciseBanks)||void 0===O||null===(O=O.exercise_types)||void 0===O?void 0:O.q_shixuns,"题,共",null===(R=K.exerciseBanks)||void 0===R||null===(R=R.exercise_types)||void 0===R?void 0:R.q_shixuns_scores,"分"]}),!(null===(D=K.exerciseBanks)||void 0===D||null===(D=D.exercise_types)||void 0===D||!D.q_pros)&&(0,ee.jsxs)("span",{className:"ml20",children:["编程题",null===(F=K.exerciseBanks)||void 0===F||null===(F=F.exercise_types)||void 0===F?void 0:F.q_pros,"题,共",null===(H=K.exerciseBanks)||void 0===H||null===(H=H.exercise_types)||void 0===H?void 0:H.q_pros_scores,"分"]})]}),(0,ee.jsx)("span",{className:"fr",children:!(null===(W=K.exerciseBanks)||void 0===W||null===(W=W.exercise_types)||void 0===W||!W.q_counts)&&(0,ee.jsxs)("span",{children:["合计 ",(0,ee.jsx)("span",{className:"color-blue",children:null===(V=K.exerciseBanks)||void 0===V||null===(V=V.exercise_types)||void 0===V?void 0:V.q_counts})," 题, 共 ",(0,ee.jsx)("span",{className:"".concat((null===(z=K.exerciseBanks)||void 0===z||null===(z=z.exercise_types)||void 0===z?void 0:z.q_scores)>100?"color-red font-bd":"color-orange"),children:null===(U=K.exerciseBanks)||void 0===U||null===(U=U.exercise_types)||void 0===U?void 0:U.q_scores})," 分"]})})]}),""!=ae&&(0,ee.jsx)("section",{className:[Re.bg,"pt30","pl20","pr20","pb20","mt20"].join(" "),children:null==ae?void 0:ae.map((function(e,n){return e.key=n+1,e.len=ae.length,0===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(ce,{ref:pe,editData:e}),(0,ee.jsx)(_.Z,{})]}):1===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(re,{ref:pe,editData:e}),(0,ee.jsx)(_.Z,{})]}):2===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(fe,{ref:pe,editData:e}),(0,ee.jsx)(_.Z,{})]}):3===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(we,{editData:e}),(0,ee.jsx)(_.Z,{})]}):4===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(ye,{editData:e}),(0,ee.jsx)(_.Z,{})]}):5===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(Se,{editData:e}),(0,ee.jsx)(_.Z,{})]}):void 0}))}),(0,ee.jsx)("section",{style:{display:"flex"},className:[Re.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:(0,ee.jsx)("div",{style:{flex:"1"},children:[{name:"选择题",id:0},{name:"判断题",id:2},{name:"填空题",id:3},{name:"简答题",id:4},{name:"实训题",id:5}].map((function(e,n){return(0,ee.jsxs)(C.ZP,{className:"mr20",type:"primary",onClick:function(){return me(e.id)},children:[(0,ee.jsx)(B.Z,{className:"mr5"}),e.name]})}))})}),(0,ee.jsx)(Oe,{callback:function(e){ae.push({shixun:e.challenge_names.map((function(e){return{challenge_name:e,challenge_score:5}})),shixun_name:e.title,shixun_id:e.id,question_type:5,edit:!0}),oe(u()(ae))}})]})})))}}]); |