|
|
(self.webpackChunk=self.webpackChunk||[]).push([[41657,98772],{38229: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,o=!1,r=!1,a=null,l=!1,s=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:a=d;break;case"object":void 0!==d.is3D?i=d:t=d;break;case"boolean":o=d,r=!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||r||(o=!0)),null!==a&&void 0===t.id&&(t.id=a);var f="",p=!1,h=null,m=null,g=null,v=!1,w=null,x=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,I(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."):(s=e,Z(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,o="auto",r=t.id,a=!1,s=0;s<arguments.length;s++){var c=arguments[s];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?o=c:r=arguments[s]:"boolean"==typeof c?a=c:c instanceof HTMLElement&&(i=c)}function u(){if(l){o=M(o);var s=i||document.getElementById(r);if(s)if(e.removeExistingApplet(s,!1),void 0===t.width&&s.clientWidth&&(t.width=s.clientWidth),void 0===t.height&&s.clientHeight&&(t.height=s.clientHeight),t.width&&t.height||"html5"!==o||(delete t.width,delete t.height),h=o,"screenshot"===o)T(s,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",P(s,t,a,o)):N(s,t,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var S=function(n){var o=function(){t.onError&&t.onError(),O("Error: Fetching material (id "+t.material_id+") failed.",t)},r=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+t.material_id+"?scope=basic";C("https://"+r+"/api/proxy.php?path="+encodeURIComponent(a),(function(r){var a=JSON.parse(r),l=a.elements?a.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:a;if(l&&l.url){t.fileName=l.url,j(l.settings||{}),i.is3D=!0;var s="https://www.geogebra.org/images/";e.setPreviewImage(w||l.previewUrl,s+"GeoGebra_loading.png",s+"applet_play.png"),n()}else o()}),o)};function j(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 C(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){w=e,x=n,t},e.removeExistingApplet=function(e,n){var i;"string"==typeof e&&(e=document.getElementById(e)),h=null;var o=null;for(i=0;i<e.childNodes.length;i++){var r=e.childNodes[i],a=r.className;"applet_screenshot"===a?n?(r.style.display="block",h="screenshot"):r.style.display="none":"applet_scaler prerender"!==a&&(e.removeChild(r),o=a&&-1!=a.indexOf("appletParameters")?r.id:null,i--)}var l=void 0!==t.id?t.id:o,s=window[l];s&&"function"==typeof s.getBase64&&(s.remove(),window[l]=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 B=function(e){return e&&"false"!==e},N=function(n,t,i){_(m)<=4.2&&(i=!0);var o=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(o=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var r=document.createElement("div");r.classList.add("appletParameters","notranslate");var a=t.width,l=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(_(m)<=4.4)B(t.showToolBar)&&(t.height-=7),B(t.showAlgebraInput)&&(t.height-=37),t.width<605&&B(t.showToolBar)&&(t.width=605,a=605);else{var u=100;(B(t.showToolBar)||B(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=B(t.showMenuBar)?245:155),a<u&&(t.width=u,a=u)}for(var d in r.style.border="none",r.style.display="inline-block",t)t.hasOwnProperty(d)&&"appletOnLoad"!==d&&r.setAttribute("data-param-"+d,t[d]);b&&r.setAttribute("data-param-fontscssurl",b),e.resize=function(){GGBAppletUtils.responsiveResize(n,t)},window.addEventListener("resize",(function(n){e.resize()}));var p="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(r),n.appendChild(h),t.appletOnLoad=function(n){e.resize(),p(n)}}else{t.hasOwnProperty("showSplash")||r.setAttribute("data-param-showSplash","false");var w=n.querySelector(".applet_scaler.prerender"),x=null!==w;if(x)y=w.querySelector(".ggb_preview");else{var y=L(a,l,t.borderColor,!1);(w=document.createElement("div")).className="applet_scaler",w.style.position="relative",w.style.display="block",w.style.width=a+"px",w.style.height=l+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(w,"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(w),window.GGBT_wsf_view&&$(window).trigger("resize"),p(e)},x||w.appendChild(y)):r.appendChild(y),w.appendChild(r),x||n.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),O("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function S(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(o){scriptLoadStarted=!0;for(var j=0;j<r.childNodes.length;j++){"TABLE"===r.childNodes[j].tagName&&(r.removeChild(r.childNodes[j]),j--)}if(null!==ggbHTML5LoadedScript){var C=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=C&&C.parentNode.removeChild(C)}var N=document.createElement("script"),T=function(){S(r,t)};N.src=f+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=N.src,O("GeoGebra HTML5 codebase loaded: '"+f+"'.",t),c||s&&"5.0"!=s?f.requirejs?__webpack_require__.e(43547).then(function(){var e=[__webpack_require__(43547)];T.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(N.onload=T,n.appendChild(N)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),T())}else S(r,t);t.height=l,t.width=a},T=function(n,t,i){var o=L(t.width,t.height,t.borderColor,i),r=document.createElement("div");r.style.position="relative",r.style.display="block",r.style.width=t.width+"px",r.style.height=t.height+"px",r.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),r.appendChild(o);var a=GGBAppletUtils.getScale(t,n,i);i?(n.appendChild(E()),window.GGBT_wsf_view||(n.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(r,"66%"),n.appendChild(r),1===a||isNaN(a)||(GGBAppletUtils.scaleElement(r,a),r.style.width=t.width+"px",r.style.height=t.height+"px",r.parentNode.style.width=t.width*a+"px",r.parentNode.style.height=t.height*a+"px"),e.resize=function(){A(n,o,r,i)},window.addEventListener("resize",(function(n){e.resize()})),e.resize()};function A(e,n,i,o){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 r=GGBAppletUtils.getScale(t,e,o);null!==i.parentNode&&(isNaN(r)||1===r?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=t.width+"px",i.parentNode.style.height=t.height+"px"):(GGBAppletUtils.scaleElement(i,r),i.parentNode.style.width=t.width*r+"px",i.parentNode.style.height=t.height*r+"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 P=function(e,n,t,i){T(e,n,!0);for(var o=function(){var t=[];for(a=0;a<e.childNodes.length;a++)t.push(e.childNodes[a]);if(window.GGBT_wsf_view){var o=window.GGBT_wsf_view.renderFullScreen(e,n.id),r=document.getElementById("fullscreencontainer"),l=jQuery(e).find(".fullscreencontent");l.length>0?(o.remove(),l.attr("id","fullscreencontent").show(),jQuery(r).append(l),window.dispatchEvent(new Event("resize"))):N(o,n,!1),window.GGBT_wsf_view.launchFullScreen(r)}else h=i,N(e,n,!1);if(!window.GGBT_wsf_view)for(a=0;a<t.length;a++)e.removeChild(t[a])},r=e.getElementsByClassName("ggb_preview_play"),a=0;a<r.length;a++)r[a].addEventListener("click",o,!1),r[a].addEventListener("ontouchstart",o,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),k()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},E=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},L=function(e,n,t,i){var o=document.createElement("div");o.className="ggb_preview",o.style.position="absolute",o.style.zIndex="90",o.style.width=e-2+"px",o.style.height=n-2+"px",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.backgroundColor="white";var r="lightgrey";void 0!==t&&(r="none"===t?"transparent":t),o.style.border="1px solid "+r;var a,l,s,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==w&&c.setAttribute("src",w),c.style.opacity=.7,null!==x)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,c.style.opacity=.3,(l=360)>e/4*3&&(l=e/4*3),s=l/5.8,a.setAttribute("src",x),a.setAttribute("width",l),a.setAttribute("height",s);var u=(e-l)/2,d=(n-s)/2;a.style.left=u+"px",a.style.top=d+"px",o.appendChild(a)}return o.appendChild(c),o},M=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},G=["web","webSimple","web3d","tablet","tablet3d","phone"],Z=function(e,n){if(m=e,n)I(m,!0);else{var r,a,l=!o;if(l){var s=_(m);!isNaN(s)&&s<4.4&&(l=!1)}r="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in a=c>0?m:0===c?r+m:"https://www.geogebra.org/apps/5.2.814.0/",G)if(m.slice(-1*G[u].length)===G[u]||m.slice(-1*(G[u].length+1))===G[u]+"/")return void I(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||B(t.showToolBar)||B(t.showMenuBar)||B(t.showAlgebraInput)||B(t.enableRightClick)||t.appName&&"classic"!=t.appName?a+="web3d/":a+="webSimple/",I(a,!1)}},I=function(e,n){if(e.requirejs)f=e;else{"/"!==e.slice(-1)&&(e+="/"),f=e,null===n&&(n=-1===e.indexOf("http")),p=n,g="web.nocache.js",v=!1;var t=f.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?G.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!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."),Z("5.0",n))}},O=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function D(){var e=n;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),Z(e,!1),null!==c&&I(c,p),l=!0}return void 0!==t.material_id?S(D):D(),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,o){if(e.isScreenshoGenerator)return 1;var r,a=void 0!==i&&i,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(r=e.autoHeight)&&"false"!==r,c=function(e,n,t,i,o,r){var a=null;if(null!=r&&""!=r)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+r+" ")>-1){a=l;break}l=l.parentNode}var s=0,c=0,u=0,d=0,f=0,p=0,h=0;if(a)s=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=s&&(void 0===o||!o)&&("rtl"===document.dir?(f=s-m.width-m.left,p=u<=480?10:30):(p=m.left,f=u<=480?10:30),d=p+f)}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<s?s=n:s-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==t&&t||(c-=h)),{width:s,height:c}}(n,e.width,t,s,a&&window.GGBT_wsf_view||l,o),u=parseInt(c.width),d=e.width,f=e.height;if(void 0===d){var p=n.querySelector(".appletParameters");p&&(d=p.offsetWidth,f=p.offsetHeight)}var h=u/d,m=a?1:c.height/f;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 o,r=1,a=!1;return e.hasOwnProperty("allowUpscale")&&(a=e.allowUpscale),e.hasOwnProperty("scale")&&(r=parseFloat(e.scale),(isNaN(r)||null===r||0===r)&&(r=1),r>1&&(a=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?r:(o=t(e,n,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==r?Math.min(r,o):o)}function o(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),o=(n-i.width)/2,r=(t-i.height)/2;r<0&&(r=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=o<40?"40px":o+"px",e.style.top=r+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=r<40?"40px":r+"px",e.style.left=o+"px")}return{responsiveResize:function(t,r){var a=t.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(r.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var l=i(r,t);e()&&a.setAttribute("data-param-scale",l);for(var s=null,c=0;c<t.childNodes.length;c++)if(void 0!==t.childNodes[c].className&&t.childNodes[c].className.match(/^applet_scaler/)){s=t.childNodes[c];break}if(null!==s&&null!==s.querySelector(".noscale"))return;var u=void 0!==r.id?r.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===s||s.className.match(/fullscreen/)||(s.parentNode.style.transform="",isNaN(l)||1===l?(n(s,1),s.parentNode.style.width=r.width+"px",s.parentNode.style.height=r.height+"px"):(s.parentNode.style.width=r.width*l+"px",s.parentNode.style.height=r.height*l+"px",n(s,l))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&o(t),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(a).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:o,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,o;n=e,t=u(),i=t.body,(o=t.createElement(_)).language=ab,o.crossOrigin=W,o.src=n,webModule.__errFn&&(o.onerror=function(){webModule.__errFn(L,new Error(bb+n))}),i.appendChild(o),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=[],o=[];function a(e){var n=o[e](),t=i[e];if(n in t)return n;var a=[];for(var l in t)a[t[l]]=l;throw r&&r(e,a,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]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],o=O;o<i.length;o++){var r=i[o];t[r[O]]=r[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")})()},44177: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 o(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i<e.length;i++){var o=e[i],r=n?"".concat(n,"/").concat(o.name):"".concat(o.name);t.push({title:o.name,type:o.type,isLeaf:"tree"!==o.type,key:r})}return t}function r(e,n,t){for(var i=0;i<e.length;i++){var o=e[i];if(o.key===n){o.children=t;break}o.children&&r(o.children,n,t)}return e}function a(e,n,t){var i;return function(){var o=this,r=arguments,a=function(){i=null,t||e.apply(o,r)},l=t&&!i;clearTimeout(i),i=setTimeout(a,n),l&&e.apply(o,r)}}t.d(n,{Ax:function(){return r},Ds:function(){return a},KI:function(){return l},SI:function(){return o},f1:function(){return i}});var l=t(20817).Z.API_SERVER},32524:function(e,n,t){"use strict";t.d(n,{Z:function(){return W}});var i=t(7557),o=t.n(i),r=t(82242),a=t.n(r),l=t(41498),s=t.n(l),c=t(37205),u=t.n(c),d=t(79800),f=t.n(d),p=t(59301),h=t(8591),m=t(53326),g=t(43428),v=t(95237),w=t(3113),x=t(92832),b=t(32007),_=t(39647),y=t.n(_),k=t(91336),S=t(50457),j=t(59455),C=t(56102),B="wrp___H70W8",N="file-list___S5XYJ",T="ExtraEdit___K6Xf2",A="btn___Yiu8q",P=t(43604),E=t(63217),L=t(37712),M=["node","inline","className","children"],G=function(e){var n=e.onCallback,t=e.scrollBox,i=e.Data,r=e.extraEdit,l=i.allowCopy,c=void 0!==l&&l,u=i.fileList,d=i.hideTextEffect,m=void 0!==d&&d,g=i.text,w=void 0===g?"":g,x=(0,p.useState)(""),b=f()(x,2),_=b[0],G=b[1],Z=(0,p.useState)(!0),I=f()(Z,2),O=I[0],D=I[1];(0,p.useEffect)((function(){if(w){D(!0);var e=function(){var e=s()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<w.length)){e.next=8;break}return G(w.substring(0,t+1)+(w.length-1>t?" __":"")),e.next=5,new Promise((function(e){return setTimeout(e,30)}));case 5:t++,e.next=1;break;case 8:D(!1),null==n||n(i);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return m?G(w):e(),function(){return G("")}}}),[]),(0,p.useEffect)((function(){t.current&&t.current.scrollTo({top:t.current.scrollHeight,behavior:"smooth"})}),[_]);return(0,L.jsxs)("div",{className:"".concat(B," fadeIn animated"),children:[(0,L.jsx)(k.U,{components:{code:function(e){e.node;var n=e.inline,t=e.className,i=e.children,o=y()(e,M),r=/language-(\w+)/.exec(t||"");return!n&&r?(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)(C.CopyToClipboard,{text:String(i).replace(/\n$/,""),onCopy:function(){return h.ZP.success({content:"复制成功",key:"copy"})},children:(0,L.jsx)("button",{style:{position:"absolute",top:0,right:0,padding:"4px 8px",borderRadius:"0 0 0 5px",border:"none",backgroundColor:"#007bff",color:"#fff",cursor:"pointer",fontSize:"12px"},children:"复制"})}),(0,L.jsx)(S.Z,a()(a()({style:j.Z,language:r[1],PreTag:"div",showLineNumbers:!0,lineNumberStyle:{minWidth:"40px"}},o),{},{children:String(i||"").replace(/\n$/,"")}))]}):(0,L.jsx)("code",a()(a()({className:t},o),{},{children:i}))}},children:_}),u&&!O&&(0,L.jsxs)(v.Z,{className:"".concat(N," animated fadeIn"),children:[(0,L.jsx)(P.Z,{children:(0,L.jsx)(E.Z,{className:"font20 mr10"})}),(0,L.jsxs)(P.Z,{children:[null==u?void 0:u.name,(0,L.jsx)("br",{}),function(e){if(0===e)return"0 B";var n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(2))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n]}(null==u?void 0:u.size)]})]}),!O&&(0,L.jsxs)("div",{className:T,children:[null==r?void 0:r(i),c&&(0,L.jsx)(C.CopyToClipboard,{text:String(_).replace(/\n$/,""),onCopy:function(){return h.ZP.success({content:"复制成功",key:"copy"})},children:(0,L.jsxs)("div",{className:A,children:[(0,L.jsx)("i",{className:"iconfont icon-fuzhi3 mr5"}),"复制"]})})]})]})},Z={flex_box_center:"flex_box_center___GmElr",flex_space_between:"flex_space_between____pbWi",flex_box_vertical_center:"flex_box_vertical_center___COMWd",flex_box_center_end:"flex_box_center_end___lmAQf",flex_box_column:"flex_box_column___OJb7M","ai-wrp":"ai-wrp___AEGoS","loading-wanx":"loading-wanx___GtiUv","dot-flashing":"dot-flashing___xJNVn","dot-fade":"dot-fade___KWn1a","footer-container":"footer-container___HTy33","input-container":"input-container___M88BT","upload-btn":"upload-btn___fKRCG","send-btn":"send-btn___yOKG5","chat-container":"chat-container___pNTrU","chat-message":"chat-message___isXl8",title:"title___hXSVA",answerWrp:"answerWrp___COjAb",li:"li___PjMV3",img:"img___wZqEA",content:"content___OlYYG",user:"user___rbSU1",container:"container___hZAxN",item:"item___Z9j46"},I=t(85750),O=t(89260),D=t(66621),R=function(e){var n=e.src,t=e.onClick,i=(0,p.useRef)(null),o=(0,p.useState)(!1),r=f()(o,2),a=r[0],l=r[1],s=(0,p.useState)({x:20,y:.62*window.innerHeight}),c=f()(s,2),u=c[0],d=c[1],h=(0,p.useState)({x:20,y:.62*window.innerHeight}),m=f()(h,2),g=m[0],v=m[1],w=(0,p.useState)({x:20,y:.62*window.innerHeight}),x=f()(w,2),b=x[0],_=x[1],y=(0,p.useState)(!1),k=f()(y,2),S=k[0],j=k[1];(0,p.useEffect)((function(){var e=function(e){if(a){var n,t=e.clientY-b.y,o=g.y+t,r=window.innerHeight-((null===(n=i.current)||void 0===n?void 0:n.offsetHeight)||0)-50;o<50&&(o=50),o>r&&(o=r),requestAnimationFrame((function(){d({x:20,y:o})})),j(!0)}},n=function(){l(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n)}}),[a,b,g]);return(0,L.jsx)("div",{style:{position:"fixed",top:u.y,right:u.x,zIndex:100,cursor:a?"grabbing":"grab"},onMouseDown:function(e){l(!0),_({x:e.clientX,y:e.clientY}),v(u),j(!1)},onMouseUp:function(e){l(!1),!S&&t&&t(e)},ref:i,children:(0,L.jsx)("img",{src:n||"/images/ai_teacher.png",width:60,draggable:"false"})})},F=t(20817),W=(0,b.connect)((function(e){return{globalSetting:e.globalSetting}}))((function(e){var n,t,i,r,l,c,d=e.title,_=e.description,y=e.placeholder,k=e.hideUpload,S=e.hideInputBox,j=e.aiIcon,C=e.userIcon,B=e.children,N=e.taskData,T=e.name,A=e.code,P=e.globalSetting,E=e.authority,M=e.isShowComponent,W=void 0===M||M,H=e.DrawerProps,z=void 0===H?{}:H,V=e.FetchUrl,q=void 0===V?"https://ai-data.educoder.net/v1/chat-messages":V,U=e.FetchData,J=void 0===U?{}:U,K=e.defaultGetData,Y=void 0!==K&&K,X=e.extraEdit,Q=void 0===X?function(){return null}:X,$=e.isShowDefuatTips,ee=void 0===$||$,ne=e.isReview,te=e.onOpen,ie=e.loadingOption,oe=(0,p.useState)(["daiao","pu428f3pz","wangwei10061","pucmnw7fs","mlty7uhjf","pyf8v9u3c","a411763600"]),re=f()(oe,2),ae=re[0],le=re[1],se=(0,p.useState)(null),ce=f()(se,2),ue=ce[0],de=ce[1],fe=(0,p.useState)(!1),pe=f()(fe,2),he=pe[0],me=pe[1],ge=(0,p.useState)([]),ve=f()(ge,2),we=ve[0],xe=ve[1],be=(0,p.useState)(!1),_e=f()(be,2),ye=_e[0],ke=_e[1],Se=(0,p.useState)([]),je=f()(Se,2),Ce=je[0],Be=je[1],Ne=(0,p.useRef)(Ce),Te=(0,p.useRef)(),Ae=(0,p.useRef)(),Pe=(0,p.useState)(""),Ee=f()(Pe,2),Le=Ee[0],Me=Ee[1],Ge=(0,p.useState)(["".concat(null==N||null===(n=N.challenge)||void 0===n?void 0:n.task_pass,",请给出答题思考方向。\\n\\n不要给出学生正确答案,不要给出任何代码")]),Ze=f()(Ge,2),Ie=Ze[0],Oe=Ze[1],De=!!N,Re=[{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAYCAYAAAD+vg1LAAAAAXNSR0IArs4c6QAAA1FJREFUSEuVlctvVVUYxX/f7UNCkYdMHDA0caCJMcaQXB4VLX2IRJCgRtGg+EpMHJOIiQ8mxqF/AQOdmKJNqy0EJVrkWLWi8piYQIxNHAAhaINy4XxLzzl737t7uTV4Jvve7HPWXt/61re2vXJaHwi24ZgAORSrq1pVrKr+F48X++XGwv3wTi7x9uh6e89ePq2rcnrjhxEoXctDAnA8JIJ7JBMOQhwf3WDr7KVTasjpaTKKIAnTWEnJONmPv2NlZRVGdnC91e3Fk2pI9DTLDWUvYJ5I0qmiVDIg+3ij1e2Fn9XwAFxK6PyKKkmb+obfBaNS44J6YC7R5+L25oGQjfVb3fb8pIZ7xVjGJwfute1Vm27u2Tqupd0ruVT0KfQhG3vA6vbcjy0pwqkXSymjJJF5YHqDFLBEzq0p4/FNBfCJwLhdxwSwo2PCftnAwhqt77OJh6xuu39oafxfjalET1wRHBK1TiyZfVoAPztbSRE/7OSG1GILfJzYL5VicsDq9sz3bcBwXoUrFpu8fEHZBeE+d5YlA5RNbra67fqu1Txg4sO1tvXm/FC9NXJUayznt+YQGdlUAfz0t4nGhYpizhPGiV8X5kj0MSyXsyqpMDs8ZHV7qgCOPo7lL26t5tAs1mhEdnjY6vbkN4mPU8t1Am+3pHFJOUfcmMNZ7WIQce7ISAC+gXFrXFuRmTQzjPy7XSvZf+Es6lvFHbpGfmWec0uX0//5sE3ZE1nQOOSsxHwzwFo6opxewS3Blq9Nbrb3Bw9pL7BXYkWZIcYZOc8f3WIztvN4KzYNJkY3dHbF0JRu6+rmgmB6csD6Bw9pH+KdZnRWWTMv53dyHradX1fNC2Obu/ilzO54S8RKKPNgDcauv7oY621w3p0l0Q2IP2rG0HXnVYm/bcexinG8jtKxTaapOc44d8tY7c6XgnGJR1zM18SwGyOes0/ipD023Zq8jhZqm8A85y7VWGbOjBvDOHdizEoMeM6boYJjtn1aV71oTIfLsUNEYsaeFZc5cLGPuaJpVmNHfp37Jd6Kl4PVeN0e/Uof4WxzqOHhNk7s1uG2PvPFDPc8uJYt7hyU6G4LrhM9DTba/8mF9nc3faZ1+TXe+Ffr+wR/mhi90mD/7ON2+R9W5V2x0b6OvQAAAABJRU5ErkJggg==",name:"智能审题",des:"快速智能拆解任务,提供解题思路",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:""},{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAAAXNSR0IArs4c6QAAA6VJREFUSEuVlVtoXGUUhdc6SbQmRFPb2pDLdCaN0D6oIFpSiAgqUkWhbxbEWiQ+iA8iFCWQUoo22mCxL4JUYkJBSalWEHshXqLRqSYiSkHQJp2ZtEKrpMVC0Gb+y9IzZ850TpwUHJiHc/k/1t5r7X2I6/zeaNPqunrsdcBWKzU58lTRY2DPb5xe7hiXezC8Ws0LjZg20gZHwABwACy4aIEHXzvHbK2zywLfTKnfSYMhzJZA5T8BD07tm2PP/wLu79QJS22JQSV1FTh1mWgcLfDqUmhJ4W4o2AP66of7Un7SAvdFZVbDouuAXHmgwD/jMzGDI2mtKDp95MmvnjvH1+MXBlP61FK95b7BQgmwCdh6MMcr4fvb2tSpG3Vc4k6+s04Z4/G1gdo9OPDiee59ZZ02SrjXEs3lki8UgYIHNofmeMIZIteZx2e5LnQYrwlLdHlqqFTyWx3qXiQmLNVhwW8d0GMhxj1zYLZIHAtNCu/FbTDADw681UIZT+0/mq/bWXF5qFPrHXHKQLct7VsINCEQGqx2PE6AI4eO5vhyKK4CFMRXU7hsoZZrbkYG1AJWu+48H/h4jhMJ4GC7Vi3Waf5amVXZC5g1ihTWct2JzxwvcCQJ7Naav4z+SIS4HBkXMGuJY9aXS64KezkFfeN5DieA/d1aoypgtRLHSKEt93Dp9Diw7/MYuDullywQeKLJQANRz5JhjoGOocs876BZI7RacIOl6MW+L2PgQMpbS9RVIDWmwpPZIjAi4vcPcvwkDv9DXbrDAu/+C387GwP7U3rMABTQUqQO1TIlVHg4z94QtGW9tjn5hx2DBUOM+jrMWIO7pnL8JtHDFzJaa7wuJiJTCTGzH+bZ+2jGjTngCUuWRtGB1pLPfneWo7HqSg5D4N/SxaUuRwaUSj7goSPRpIRzHUEtuRA0MD39Cy8lFG5v16r6Bs3X3C5k1gI/OfjnK6DEfgweOX2WJxPA8OLptL9ggdbqsssTkXXiF4baFVUQbZ44Pl7Bpp9z/D6pMKNNDhq3wi3/yRmZdcKThjht4G9OLtvSrnx/ZjbYDjA8CuxIq8dAJx3R7KD3DLjVory6ImOyE7mgd3O37rdeI5bIRKYEJxy01kB3uwBjczPBU9yRVhjOKSs2OaDvSIGjj7ep0d+EjYsOzbY+/IbgyuQsf4ycVHBnBrdfbcClM2c4n0ppJW7QuIXuccAww9X9awYHBUwezvPQ9T6ryz1rSatlRb3GTMBd/wBBRVUxXeSVgwAAAABJRU5ErkJggg==",name:"代码诊断",des:"系统智能代码分析,提供修正建议",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:null==N||null===(t=N.challenge)||void 0===t?void 0:t.task_pass},{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAYAAAARfGZ1AAAAAXNSR0IArs4c6QAABD9JREFUSEvNlG1MU2cUx/+3hVJKoZQCKTIGTBw6ZB1CNmg/MHkNoqAJe9fhDMvWkhZcjG4fMdnMkm2Ei4Diy8IyEUPUGCNDjSxx2XgHCxN0sooI0spLQ2lpe1vuXe5d1oFNVkj8sPPlSe4553fOc87/PgTWYIcPnwl2OJzfi8WiXJvN0cvjMaXV1eopX6mErwDWr9PVf5Wfr/xcpVIQIyMGpqXlxgWSVL/nK3eN8LpWtfrtkqiocNjtThw7drafJDVpzwVeUVH3Tmxs9HmlUkEMDT1g7t4d+6KmRvP1c4H/PZoTOwC6EcBRktSwp0/zGsvBg98Fut3BMn9/ysvncuESn4+PeTzMrSS7XALG6aTnGxs/WVr53QM4cuSkxG5frpdIxG+Fh4f4E2vaxr+omRmLy2KxXuLxHJrq6s/mWY8HodM13NyzR5mdmZlMUJQbLpfb57WfDbh16w7T0aH/hSTVmR54ZeXJbQkJ8v7y8iKYzVZYrXaYTGZYLEuIiAhFaGiQVyHWx8aIxYGQy8PA3pTNu3q1C1NTsyqSLP+N61yna3g3NzflfE5OCqan59HW1oPxBQoCaQgo0yxSN2+ASpXkKdDbex+d+kcQyCPgtlgRFQDs2pUOilpGZ+cIo9cbPiJJTRMH12obPigoSP1RqXwF16714J6DhzBVKnh+fqCdFIxtHcjbFodNm6IxMfEUV26PImpnDvgiIRj3Msx9Q4ilFpGevgXd3aPMwIChrLZWfdYL/s23FxG+twQZchGmKWCSAmwPHyPoziCKijJw/Xo/ZuMToEhJgJsBJpzgGpg81Yz9+7J9wyPL3kdYgB8cDEAzwMKkEcLuHhQXZ6C9vQ/mLUmIS3yR85ndwDLD4HH9D9i/N2s1vLKy7jWGIXbk56d9yY6FXYhBGAqZMpWbMZ9NvHIDb74cgc2JMRgfN6Gt7yGiSwpB8HkIIABT/++QmyahVCZx8MHBsaM0TV8kKirqW2ga8QUFaa+z8Lm5Ra6AkfFDQIQM9okpJMdIkZn5qmehXV2j6PvDiMDYF0CZFyCjbCguVsLlWkZXFwfvJwhi2GvmrMRYe/JkDgsLS4iMlEAmC/GSIitZo9GM4GAhoqPDQRAErFbHf8/8H/i6/yCwOv8/wfX6P5GYGAOhUICBgTFs3RoHgcCPnS2n65W27s5bW28jLy8VEkkQmpt/xu7dGRCJhDh9+ieUlRWsgrMj7e29/+xPdKIkKyu5dft2BfeerLTLl39FdnYKQkJEYAsVFr4BkSgATU03UVqa6wmlaRqzsxb2dszw8KN9tbXqc5xaDh06FS+Vih8cOJDHdzpdKx/LNeyV4SS4uLjEne3tffTMjDnp+HHtPc+Tq9XW1WzcuEGrULxEBAUJ1wBdHWKzOTA0ZGAMBmNjTY3601XvOduuTlevAfAhQRByVrfrMZqmTQBzTip9WltVVUWzuX8BL+8z38bSCP4AAAAASUVORK5CYII=",name:"AI辅导",des:"为学生提供个性化智能学习辅导",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:null==N||null===(i=N.challenge)||void 0===i?void 0:i.task_pass}],Fe={action:"https://ai-data.educoder.net/v1/datasets/dc9e6c03-a629-4e9e-bd81-06fb93c29aa1/document/create_by_file",fileList:u()(we),maxCount:1,onChange:function(e){var n=e.fileList;console.log(":newFileList:",n),xe(n)},showUploadList:!1,accept:".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",beforeUpload:function(e){var n=["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.type);return n||(Le.error("只能上传Office文档!"),Promise.reject())},headers:{Authorization:"Bearer dataset-xBnNgFqcMjLGAXz7pFgXzGwY"},data:{data:JSON.stringify({indexing_technique:"high_quality",process_rule:{rules:{pre_processing_rules:[{id:"remove_extra_spaces",enabled:!0},{id:"remove_urls_emails",enabled:!0}],segmentation:{separator:"###",max_tokens:500}},mode:"custom"}})}},We={maxCount:1,showUploadList:!1,accept:".doc,.docx,.md,.txt,.pdf",beforeUpload:function(e){var n,t=null==e||null===(n=e.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(n=n.slice(-1))||void 0===n||null===(n=n[0])||void 0===n?void 0:n.toLowerCase(),i=["doc","docx","md","pdf","txt"].includes(t);return 0==e.size?(h.ZP.warning("文件内容不能为空"),m.Z.LIST_IGNORE):i||(h.ZP.warning("目前支持txt、md、doc、docx、pdf文件"),m.Z.LIST_IGNORE)},onChange:function(e){var n=e.fileList;xe((null==n?void 0:n.filter((function(e){return"done"===(null==e?void 0:e.status)})))||[])},action:"".concat(null===F.Z||void 0===F.Z?void 0:F.Z.API_SERVER,"/api/attachments.json")};(0,p.useEffect)((function(){Ne.current=Ce}),[Ce]),(0,p.useEffect)((function(){var e;null!=P&&P.setting&&le([].concat(u()(ae),u()((null==P||null===(e=P.setting)||void 0===e?void 0:e.big_model_users)||[])))}),[null==P?void 0:P.setting]),(0,p.useEffect)((function(){var e;Oe(["".concat(null==N||null===(e=N.challenge)||void 0===e?void 0:e.task_pass),"".concat(A),"".concat(A)])}),[A]),(0,p.useEffect)((function(){if(Y&&(null!=z&&z.open||he)&&null!=J&&J.student_work_id){if(ue!==(null==J?void 0:J.student_work_id))Be([{text:"",done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}]);else{if(Ce.length)return;Be([].concat(u()(Ce),[{text:"",done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}]))}Ve(),de(null==J?void 0:J.student_work_id)}}),[Y,he,Ce,null==z?void 0:z.open,null==J?void 0:J.student_work_id]);var He,ze=function(){me(!0)},Ve=function(){var e=s()(o()().mark((function e(){var n,t,i,r=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"",e.next=3,(0,I.ZP)(q,{method:"post",body:a()({inputs:{description:"",name:T},query:t,response_mode:"blocking",conversation_id:Te.current||"",user:"abc",files:(null==we||null===(n=we.filter((function(e){return"done"==(null==e?void 0:e.status)})))||void 0===n?void 0:n.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id})))||[]},J),mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB"}});case 3:i=e.sent,ke(!1),Ne.current[Ne.current.length-1].text=null==i?void 0:i.answer,Ne.current[Ne.current.length-1].loading=!1,Ne.current[Ne.current.length-1].response=i,Te.current=null==i?void 0:i.conversation_id,Be(u()(Ne.current));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=s()(o()().mark((function e(n,t){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ye){e.next=2;break}return e.abrupt("return");case 2:return ke(!0),Be([].concat(u()(Ce),[{text:Le,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0,name:null==n?void 0:n.name}])),setTimeout((function(){Ae.current.scrollTo({top:Ae.current.scrollHeight,behavior:"smooth"})})),e.next=7,(0,I.ZP)(q,{method:"post",body:{inputs:{description:null==n?void 0:n.inputs,name:null==n?void 0:n.name},query:Ie[t],response_mode:"blocking",user:"abc",files:[]},mode:"cors",headers:{"Content-Type":"application/json",Authorization:null==n?void 0:n.Authorization}});case 7:null!=(i=e.sent)&&i.answer&&(ke(!1),Ne.current[Ne.current.length-1].text=null==i?void 0:i.answer,Ne.current[Ne.current.length-1].loading=!1,Ne.current[Ne.current.length-1].response=i,Te.current=null==i?void 0:i.conversation_id,Be(u()(Ne.current)));case 9:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ue=function(){""!==Le.trim()&&(Me(""),xe([]),Be([].concat(u()(Ce),[{text:Le,done:!1,key:Date.now(),sender:"user",fileList:we[0]},{text:Le,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}])),ke(!0),setTimeout((function(){return Ve(Le)}),300))};if(De){if(null==N||!N.chatgpt)return(0,L.jsx)(L.Fragment,{})}else if(!W||!E&&!ae.includes(null===(He=(0,O.eY)())||void 0===He?void 0:He.login))return(0,L.jsx)(L.Fragment,{});return(0,L.jsxs)("div",{children:[B?(0,L.jsxs)("div",{onClick:te||ze,children:[(0,L.jsx)(b.Outlet,{}),B]}):(0,L.jsx)(R,{onClick:te||ze}),(0,L.jsx)(g.Z,{className:"".concat(null!=z&&z.open||he?"body-overflow-hidden":""," ").concat(Z.answerWrp),width:(null==z?void 0:z.width)||860,title:(0,L.jsx)("span",{className:Z.title,children:d||"头歌AI"}),onClose:(null==z?void 0:z.onClose)||function(){me(!1)},open:(null==z?void 0:z.open)||he,children:(0,L.jsxs)("div",{className:Z["ai-wrp"],children:[(0,L.jsxs)("div",{ref:Ae,className:Z["chat-container"],children:[ee&&(0,L.jsxs)("div",{className:Z.li,children:[(0,L.jsx)("img",{className:Z.img,src:j||"/images/ai_icon.png"}),(0,L.jsxs)("div",{className:Z.content,children:[(0,L.jsxs)("div",{className:"c-grey-333 font22",children:[(0,L.jsx)("span",{className:"mr5",children:"👋"}),"嗨,我是头歌",De?d:"智能助教",",您的教学好帮手。"]}),(0,L.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:_||"我可以阅读您上传的教案,书籍等教学资料,并根据您的要求为您自动生成任务要求。"}),(0,L.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:"快来试一下吧~"}),De&&(0,L.jsx)("div",{className:Z.container,children:Re.map((function(e,n){return(0,L.jsxs)("div",{onClick:function(){return qe(e,n)},className:Z.item,children:[(0,L.jsxs)(v.Z,{align:"middle",children:[(0,L.jsx)("img",{className:"mr10",src:e.img}),(0,L.jsx)("span",{style:{color:"#232B40",fontSize:16,fontWeight:600},children:e.name})]}),(0,L.jsx)("div",{className:"mt10",style:{color:"#434D6C"},children:e.des})]},n)}))})]})]}),null==Ce?void 0:Ce.map((function(e,n){var t;return(0,L.jsxs)("div",{className:Z.li,style:"AI"===e.sender&&"user"!==(null===(t=Ce[n+1])||void 0===t?void 0:t.sender)?{marginBottom:50}:{},children:[(0,L.jsx)("img",{className:Z.img,src:"AI"===e.sender?j||"/images/ai_icon.png":C||"/images/ai_user.png"}),(0,L.jsx)("div",{className:"".concat(Z.content," ").concat("AI"===e.sender?"":Z.user),children:e.loading?(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:Z["loading-wanx"],children:[(0,L.jsx)("div",{className:Z["dot-flashing"]}),(0,L.jsx)("div",{className:Z["dot-flashing"]}),(0,L.jsx)("div",{className:Z["dot-flashing"]})]}),(0,L.jsx)("div",{style:{marginTop:10,color:"#9096A3"},children:(null==ie?void 0:ie.text)||"请耐心等待,目前高峰期体验人数过多,我们已记录下您的需求,稍后将自动为您生成答案。"})]}):(0,L.jsxs)(L.Fragment,{children:[!!e.name&&(0,L.jsx)("div",{className:"mb10 font18",style:{color:"#232B40",fontWeight:600},children:null==e?void 0:e.name}),(0,L.jsx)(G,{scrollBox:Ae,Data:e,extraEdit:Q})]})})]},n)}))]}),!S&&(0,L.jsxs)("div",{className:"".concat(Z["footer-container"]," ").concat(we.length>=1&&Z["has-file"]),children:[!!we.length&&(0,L.jsxs)(v.Z,{align:"middle",className:"pb5 pt5",children:[(0,L.jsx)("span",{title:null==we||null===(r=we[0])||void 0===r?void 0:r.name,className:"mr10",children:(0,D.tP)(null==we||null===(l=we[0])||void 0===l?void 0:l.name,40)}),(0,L.jsx)("i",{onClick:function(){return xe([])},className:"iconfont current icon-shanchu15 delete-hover c-red-ee4 font14"})]}),(0,L.jsxs)("div",{style:we.length?{paddingLeft:0}:{},className:Z["input-container"],children:[!k&&(0,L.jsx)("div",{className:Z["footer-container-upload"],children:(0,L.jsx)(m.Z,a()(a()({},ne?We:Fe),{},{children:null!=we&&we.length?null:(0,L.jsx)(w.ZP,{className:Z["upload-btn"],icon:(0,L.jsx)("i",{className:"iconfont icon-shangchuan4 c-white"})})}))}),(0,L.jsx)(x.Z.TextArea,{rows:1,placeholder:y||"在这里输入你问题吧~",value:Le,bordered:!1,onChange:function(e){Me(e.target.value)},onKeyPress:function(e){if("Enter"===e.key){var n;if(e.preventDefault(),null!=we&&we.length&&"done"!==(null==we||null===(n=we[0])||void 0===n?void 0:n.status)||ye)return;Ue()}}}),(0,L.jsx)(w.ZP,{className:Z["send-btn"],icon:(0,L.jsx)("i",{className:"iconfont icon-fasong2 c-white"}),disabled:!(null==we||!we.length)&&"done"!==(null==we||null===(c=we[0])||void 0===c?void 0:c.status)||ye,onClick:Ue})]})]})]})})]})}))},1433:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(82100),o=t.n(i),r=t(29186),a=t.n(r),l=t(80619),s=t.n(l),c=t(47074),u=t.n(c),d=t(59301),f=t(92832),p=t(12563),h=t(8591),m="flex___eLcnP",g="color666___TiUhG",v=t(67147),w=t(37712),x=(f.Z.TextArea,function(e){s()(t,e);var n=u()(t);function t(e){var i;return o()(this,t),(i=n.call(this,e)).state={inputVisible:!1,EditInputIndex:-1},i}return a()(t,[{key:"render",value:function(){var e=this,n=this.props,t=n.index,i=n.onAnswerChange,o=n.addChildAnswer,r=(n.exerciseIsPublish,n.answers);n.activeOptionErrorIndex,n.flex;console.log("----",r);var a=this.state,l=a.inputVisible,s=a.EditInputIndex;return(0,w.jsxs)("div",{className:m,children:[(0,w.jsxs)("div",{className:"".concat(g," mb5 mt6"),style:{flex:"0 0 90px"},children:["答案(填空",t+1,"):"]}),(0,w.jsxs)("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10},children:[null==r?void 0:r.map((function(n,o){return(0,w.jsx)(w.Fragment,{children:s!==o&&(null==n?void 0:n.length)>0?(0,w.jsx)(p.Z,{className:"edit-tag",closable:!(1===(null==r?void 0:r.length)&&0===o),onClose:function(n){n.preventDefault(),1===(null==r?void 0:r.length)&&0===o?e.props.deleteChildAnswermain(t,o):e.props.deleteChildAnswer(t,o)},children:(0,w.jsx)("span",{onDoubleClick:function(n){e.setState({EditInputIndex:o}),n.preventDefault()},children:n})},n):(0,w.jsx)(f.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,o,n.target.value),e.setState({EditInputIndex:-1,inputVisible:!1}))}})})})),!l&&(0,w.jsxs)(p.Z,{className:"site-tag-plus",onClick:function(){o(t),e.setState({inputVisible:!0})},children:[(0,w.jsx)(v.Z,{})," 新增答案"]})]})]})}}]),t}(d.Component))},29780:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(82242),o=t.n(i),r=t(82100),a=t.n(r),l=t(29186),s=t.n(l),c=t(13720),u=t.n(c),d=t(80619),f=t.n(d),p=t(47074),h=t.n(p),m=t(85573),g=t.n(m),v=t(59301),w=t(95992),x=t(37712),b="▁",_=function(e){f()(t,e);var n=h()(t);function t(){var e;a()(this,t);for(var i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];return e=n.call.apply(n,[this].concat(o)),g()(u()(e),"getChCountBeforeCursor",(function(e,n){for(var t=n.line,i=0,o=0;o<t;o++)i+=e.getLine(o).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),o=0;if(t.text.forEach((function(e){o+=e.split(b).length-1})),i&&-1!=i.indexOf(b)){var r=i.split(b).length-1,a=e.getChCountBeforeCursor(n,t.from);console.log("删除".concat(r,"个, 之前有").concat(a,"个,新增").concat(o,"个")),e.props.deleteEmptyDisabled?t.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(a,r,o)}else if(o){var l=e.getChCountBeforeCursor(n,t.from);console.log("新增".concat(o,"个,之前有").concat(l,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(l,0,o)}})),e}return s()(t,[{key:"render",value:function(){return(0,x.jsx)(w.Z,o()(o()({},this.props),{},{onCMBeforeChange:this.onCMBeforeChange}))}}]),t}(v.Component)},93524:function(e,n,t){"use strict";t.d(n,{t:function(){return f}});var i=t(82242),o=t.n(i),r=(t(59301),t(3113)),a="buttonFixed___vyq30",l="button___hxmYv",s="buttonWrap___uK8dl",c=t(92310),u=t.n(c),d=t(37712),f=function(e){var n=e.cancelText,t=void 0===n?"取消":n,i=e.okText,c=void 0===i?"确定":i,f=e.loading,p=void 0!==f&&f,h=e.hasOkBtn,m=void 0===h||h,g=e.hasCancelBtn,v=void 0===g||g,w=e.okButtonProps,x=void 0===w?{}:w,b=e.onCancel,_=void 0===b?function(){}:b,y=e.onOk,k=void 0===y?function(){}:y,S=e.className,j=void 0===S?"":S;return(0,d.jsx)("div",{className:u()(a,j),children:(0,d.jsxs)("div",{className:s,children:[v&&(0,d.jsx)(r.ZP,{size:"middle",className:"".concat(l," mr20"),onClick:_,children:t}),m&&(0,d.jsx)(r.ZP,o()(o()({size:"middle",type:"primary",className:"".concat(l," mr20"),loading:p,onClick:k},x),{},{children:c}))]})})}},18433:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),l=t(79800),s=t.n(l),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",f="fullWidth___c492T",p=t(92310),h=t.n(p),m=t(71418),g=t(2859),v=t(85750),w=t(66621),x=t(37712),b=function(e){var n=e.data,t=e.className,i=e.fullWidth,r=e.style,l=void 0===r?{}:r,p=e.onClose,b=e.onOk,_=e.showFullTools,y=e.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),j=(0,c.useRef)(null),C=(0,c.useRef)(null),B=(0,c.useState)(!1),N=s()(B,2),T=N[0],A=N[1],P=(0,c.useState)("正在加载中"),E=s()(P,2),L=E[0],M=E[1];(0,c.useEffect)((function(){j.current||(j.current=document.createElement("style"),document.head.appendChild(j.current)),null!=n&&n.visible?(document.body.setAttribute("data-custom","y-hidden"),j.current.innerHTML=" html { overflow-y: hidden; }",null!=n&&n.src&&G()):(document.body.removeAttribute("data-custom"),j.current&&(document.head.removeChild(j.current),j.current=null))}),[null==n?void 0:n.visible]);var G=function(){var e=a()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),M("正在加载中"),e.next=4,(0,w.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,k.current.src="",k.current.src=t,k.current.onload=function(){I()},A(!1),M("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=a()(o()().mark((function e(t){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),M("正在保存中"),e.next=4,(0,v.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,v.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:A(!1),M("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),I=function(){S.current=new g.hP(k.current),S.current.targetRoot=C.current,S.current.addEventListener("render",Z),S.current.addEventListener("beforeclose",p),_&&(S.current.availableMarkerTypes=S.current.ALL_MARKER_TYPES,S.current.uiStyleSettings.redoButtonVisible=!0,S.current.uiStyleSettings.notesButtonVisible=!0,S.current.uiStyleSettings.zoomButtonVisible=!0,S.current.uiStyleSettings.zoomOutButtonVisible=!0,S.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=S.current.uiStyleSettings,S.current.show(),null!=n&&n.snapshotData&&S.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,x.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,x.jsx)(m.Z,{spinning:T,tip:L,style:{position:"absolute"},children:(0,x.jsx)("div",{ref:C,className:h()(u,t,i?f:""),style:l,children:(0,x.jsx)("img",{className:d,ref:k})})})})}},4469:function(e,n,t){"use strict";t.d(n,{h:function(){return v}});var i=t(82242),o=t.n(i),r=t(79800),a=t.n(r),l=t(59301),s=t(57809),c=t(78241),u=t(3113),d=t(89780),f=t.n(d),p=(t(24147),t(74794),t(37712)),h=s.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var n=e.value,t=e.onChange,i=e.mode,r=e.options,s=void 0===r?{}:r,c=(0,l.useRef)(),u=(0,l.useState)(),d=a()(u,2),h=d[0],m=d[1];return(0,l.useEffect)((function(){if(h){var e=function(e){var n=e.getValue();t&&t(n)};return h.on("change",e),function(){h.off("change",e)}}}),[h,t]),(0,l.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,l.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,l.useEffect)((function(){if(c.current&&!h){var e=f().fromTextArea(c.current,o()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));m(e)}}),[c.current,h]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,l.useState)("python"),r=a()(i,2),d=r[0],f=r[1];return(0,p.jsxs)(c.Z,o()(o()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){f(g[e][1])},children:Object.keys(g).map((function(e){return(0,p.jsx)(h,{value:e,children:g[e][0]},e)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(v,{mode:d})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},95992:function(e,n,t){"use strict";t.d(n,{Z:function(){return _e}});var i=t(91232),o=t.n(i),r=t(79800),a=t.n(r),l=t(85573),s=t.n(l),c=t(59301),u=t(89780),d=t.n(u),f=t(76374),p=(t(24147),t(6313),t(25717),t(99498),t(25419),t(67549),t(51150)),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),v=t.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(e){var n=e.onActionCallback,t=e.title,i=e.icon,o=e.actionName,r=e.className,a=void 0===r?"":r,l=e.children;return(0,h.jsxs)("a",{title:t,className:a,onClick:function(){n(o)},children:[(0,h.jsx)("i",{className:"".concat(i)}),l]})}var b=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,o=e.onActionCallback,r=e.fullScreen,a=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(w,[{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:[!l&&c.map((function(e,n){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(x,v()(v()({},e),{},{onActionCallback:o})):(0,h.jsx)("span",{className:"v-line"})},n)})),t?(0,h.jsx)("li",{children:(0,h.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:o,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)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(x,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,h.jsx)("li",{children:(0,h.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,h.jsx)("li",{children:s}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(x,{icon:"".concat(r?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:o})})]})},_=t(81074),y=t(78241),k=t(92832),S=t(3113),j={labelCol:{span:4},wrapperCol:{span:20}},C=function(e){var n=e.callback,t=e.onCancel;return(0,h.jsxs)(y.Z,v()(v()({},j),{},{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)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},B=t(4469),N=t(72952),T=t(95237),A=t(18433),P=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),o=i.getContext("2d");i.width=1e3,i.height=800,o.fillStyle="#ffffff",o.fillRect(0,0,i.width,i.height);var r=i.toDataURL("image/png");return(0,h.jsx)(T.Z,{style:{height:"100vh"},children:(0,h.jsx)(A.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:r,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},E=t(7557),L=t.n(E),M=t(41498),G=t.n(M),Z=t(37205),I=t.n(Z),O=t(12378);function D(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(D,go.CommandHandler),D.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},D.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")},D.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")},D.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")},D.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")},D.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")}},D.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")}},D.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 o=t[i],r=o.actualBounds.y+o.actualBounds.height+e;t[i+1].move(new go.Point(o.actualBounds.x,r))}n.commitTransaction("align Column")},D.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 o=t[i],r=o.actualBounds.x+o.actualBounds.width+e;t[i+1].move(new go.Point(r,o.actualBounds.y))}n.commitTransaction("align Row")},D.prototype.canRotate=function(e){var n=this.diagram;return null!==n&&!n.isReadOnly&&!n.isModelReadOnly&&!(n.selection.count<1)},D.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())},D.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){D._assignZOrder(e,n.get(e.layer)+1)})),e.commitTransaction("pullToFront")},D.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){D._assignZOrder(e,n.get(e.layer)-1-D._findGroupDepth(e))})),e.commitTransaction("pushToBack")},D._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){D._assignZOrder(e,n+1,t)}))},D._findGroupDepth=function(e){if(e instanceof go.Group){var n=0;return e.memberParts.each((function(e){n=Math.max(n,D._findGroupDepth(e))})),n+1}return 0},D.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)}},D.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},D.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 o=e.grid.gridCellSize;i=o.width,t=o.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")},D.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))},D.prototype._findNearestPartTowards=function(e){var n=this.diagram.selection.first();if(null===n)return null;for(var t=n.actualBounds.center,i=this._getAllParts(),o=1/0,r=n,a=0;a<i.length;a++){var l=i[a];if(l!==n&&l.canSelect()){var s=l.actualBounds.center,c=t.directionPoint(s),u=this._angleCloseness(c,e);if(u<=45){var d=t.distanceSquaredPoint(s);(d*=1+Math.sin(u*Math.PI/180))<o&&(o=d,r=l)}}}return r},D.prototype._angleCloseness=function(e,n){return Math.min(Math.abs(n-e),Math.min(Math.abs(n+360-e),Math.abs(n-360-e)))},D.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!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o)}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!==(r=n.findTreeParentNode())&&e.select(r)}else if("Up"===t.key){if(null!==(r=n.findTreeParentNode()))if((l=(a=this._sortTreeChildrenByY(r)).indexOf(n))>0){for(var i=a.elt(l-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(r)}else if("Down"===t.key){var o;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(o=this._sortTreeChildrenByY(n).first())&&e.select(o);else for(;null!==n;){var r,a,l;if(null===(r=n.findTreeParentNode()))break;if((l=(a=this._sortTreeChildrenByY(r)).indexOf(n))<a.length-1){e.select(a.elt(l+1));break}n=r}}var s=e.selection.first();null!==s&&e.scrollToRect(s.actualBounds)}},D.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},D.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},D.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(D.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(D.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=D,F=(t(57193),t(85160)),W=t(43418),H=t(43604),z=t(85750),V="myPaletteDiv___Xjz2I",q="maxH60___Pd4Re";window.go=O;var U=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),o=(0,c.useRef)(),r=(0,c.useRef)(),l=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useState)(0),d=a()(u,2),f=d[0],p=d[1],m=function(){var e=G()(L()().mark((function e(){var n,o;return L()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,z.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:o=e.sent,t({src:o.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){p(f+1)}),[]),(0,h.jsx)("div",{ref:s,className:l.current?"".concat(q," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(W.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!f,destroyOnClose:!0,maskClosable:!1,getContainer:s.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(){l.current=!l.current,p(f+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:r})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(F.FI,{initDiagram:function(){var e=O.GraphObject.make,n="#ff3333",t="#3358ff",a="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",f="#fffcd5",p="#d5ebff",h="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function x(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var o=t.part.adornedPart,r=(new O.Point).setRectSpot(o.actualBounds,n);r.subtract(o.location),r.scale(2,2),r.x+=130*Math.sign(r.x),r.y+=130*Math.sign(r.y),r.add(o.location),r.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=i.copyNodeData(o.data);i.setGroupKeyForNodeData(a,i.getGroupKeyForNodeData(o.data)),i.addNodeData(a);var l={from:o.key,to:i.getKeyForNodeData(a)};i.addLinkData(l);var s=e.diagram.findNodeForData(a);s.location=r,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(O.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(O.Spot.Top)||n.equals(O.Spot.Bottom)?25:18,height:n.equals(O.Spot.Top)||n.equals(O.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(O.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(O.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(O.Panel,"Horizontal",y(u,"fill"),y(f,"fill"),y(p,"fill"),y(h,"fill"))),e("ContextMenuButton",e(O.Panel,"Horizontal",y(g,"fill"),y(v,"fill"),y(m,"fill"),y(w,"fill")))]}function S(){return[e("ContextMenuButton",e(O.Panel,"Horizontal",y(d),y(a),y(t),y(n))),e("ContextMenuButton",e(O.Panel,"Horizontal",y(u),y(l),y(s),y(c)))]}function j(n,t){return t||(t="thickness"),e(O.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 C(n,t){return t||(t="dash"),e(O.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 B(){return[e("ContextMenuButton",e(O.Panel,"Horizontal",j(1),j(2),j(3),j(4))),e("ContextMenuButton",e(O.Panel,"Horizontal",C(null),C([2,4]),C([4,4])))]}function N(n,t){return t||(t="figure"),e(O.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(O.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function A(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(O.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 P(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",O.Spot.stringify(O.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(O.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 E(n,t){var i=0,o=O.Spot.RightSide;n.equals(O.Spot.Top)?(i=270,o=O.Spot.TopSide):n.equals(O.Spot.Left)?(i=180,o=O.Spot.LeftSide):n.equals(O.Spot.Bottom)&&(i=90,o=O.Spot.BottomSide),t||(i-=180);var r=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",O.Spot.stringify(o)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(O.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:r,contextClick:r})}return i.current=new O.Diagram(o.current,{padding:20,grid:e(O.Panel,"Grid",e(O.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(O.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(O.Node,"Auto",{locationSpot:O.Spot.Center,locationObjectName:"SHAPE",desiredSize:new O.Size(120,60),minSize:new O.Size(40,40),resizable:!0,resizeCellSize:new O.Size(10,10),rotatable:!0},new O.Binding("location","loc",O.Point.parse).makeTwoWay(O.Point.stringify),new O.Binding("desiredSize","size",O.Size.parse).makeTwoWay(O.Size.stringify),e(O.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:O.Spot.AllSides,toSpot:O.Spot.AllSides},new O.Binding("figure"),new O.Binding("fill"),new O.Binding("stroke","borderColor"),new O.Binding("strokeWidth","thickness"),new O.Binding("strokeDashArray","dash")),e(O.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(O.TextBlock,{margin:1,textAlign:"center",overflow:O.TextBlock.OverflowEllipsis,editable:!0},new O.Binding("text").makeTwoWay(),new O.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(O.Panel,"Vertical",{maxSize:new O.Size(200,NaN)},e(O.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new O.Binding("text")),e(O.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new O.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(O.Adornment,"Spot",e(O.Placeholder,{padding:10}),x(O.Spot.Top,"TriangleUp"),x(O.Spot.Left,"TriangleLeft"),x(O.Spot.Right,"TriangleRight"),x(O.Spot.Bottom,"TriangleDown"),b({alignment:new O.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(O.Panel,"Horizontal",N("Rectangle"),N("RoundedRectangle"),N("Ellipse"),N("Diamond"))),e("ContextMenuButton",e(O.Panel,"Horizontal",N("Parallelogram2"),N("ManualOperation"),N("Procedure"),N("Cylinder1"))),e("ContextMenuButton",e(O.Panel,"Horizontal",N("Terminator"),N("CreateRequest"),N("Document"),N("TriangleDown"))),k(),S(),B()),i.current.groupTemplate=e(O.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:O.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 O.Binding("location","loc",O.Point.parse).makeTwoWay(O.Point.stringify),e(O.Panel,"Auto",{name:"BODY"},e(O.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:O.Spot.AllSides,toSpot:O.Spot.AllSides},new O.Binding("fill"),new O.Binding("stroke","color"),new O.Binding("strokeWidth","thickness"),new O.Binding("strokeDashArray","dash")),e(O.Placeholder,{background:"transparent",margin:20})),e(O.TextBlock,{alignment:O.Spot.Top,alignmentFocus:O.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new O.Binding("text"),new O.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(O.Adornment,"Spot",e(O.Panel,"Auto",e(O.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(O.Placeholder,{margin:1.5})),b({alignment:O.Spot.TopRight,alignmentFocus:O.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),S(),B()),i.current.linkTemplate=e(O.Link,{layerName:"Foreground",routing:O.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new O.Binding("fromSpot","fromSpot",O.Spot.parse),new O.Binding("toSpot","toSpot",O.Spot.parse),new O.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new O.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new O.Binding("points").makeTwoWay(),e(O.Shape,{strokeWidth:2},new O.Binding("stroke","color"),new O.Binding("strokeWidth","thickness"),new O.Binding("strokeDashArray","dash")),e(O.Shape,{segmentIndex:0,segmentOffset:new O.Point(15,0),segmentOrientation:O.Link.OrientAlong,alignmentFocus:O.Spot.Right,figure:"circle",width:10,strokeWidth:0},new O.Binding("fill","color"),new O.Binding("visible","dir",(function(e){return 1===e}))),e(O.Shape,{segmentIndex:-1,segmentOffset:new O.Point(-10,6),segmentOrientation:O.Link.OrientPlus90,alignmentFocus:O.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new O.Binding("fill","color"),new O.Binding("visible","dir",(function(e){return e>=1})),new O.Binding("width","thickness",(function(e){return 7+3*e})),new O.Binding("height","thickness",(function(e){return 7+3*e})),new O.Binding("segmentOffset","thickness",(function(e){return new O.Point(-15,4+1.5*e)}))),e(O.Shape,{segmentIndex:0,segmentOffset:new O.Point(15,-6),segmentOrientation:O.Link.OrientMinus90,alignmentFocus:O.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new O.Binding("fill","color"),new O.Binding("visible","dir",(function(e){return 2===e})),new O.Binding("width","thickness",(function(e){return 7+3*e})),new O.Binding("height","thickness",(function(e){return 7+3*e})),new O.Binding("segmentOffset","thickness",(function(e){return new O.Point(-15,4+1.5*e)}))),e(O.TextBlock,{alignmentFocus:new O.Spot(0,1,-4,0),editable:!0},new O.Binding("text").makeTwoWay(),new O.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(O.Adornment,e(O.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:T(2)},new O.Binding("pathPattern","thickness",T)),b({alignmentFocus:new O.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",S(),B(),e("ContextMenuButton",e(O.Panel,"Horizontal",A(0),A(1),A(2))),e("ContextMenuButton",e(O.Panel,"Horizontal",e(O.Panel,"Spot",P(!1),E(O.Spot.Top,!1),E(O.Spot.Left,!1),E(O.Spot.Right,!1),E(O.Spot.Bottom,!1)),e(O.Panel,"Spot",{margin:new O.Margin(0,0,0,2)},P(!0),E(O.Spot.Top,!0),E(O.Spot.Left,!0),E(O.Spot.Right,!0),E(O.Spot.Bottom,!0))))),new O.Palette(r.current,{maxSelectionCount:1,linkTemplate:e(O.Link,{locationSpot:O.Spot.Center,selectionAdornmentTemplate:e(O.Adornment,"Link",{locationSpot:O.Spot.Center},e(O.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(O.Shape,{toArrow:"Standard",stroke:null}))},{routing:O.Link.AvoidsNodes,curve:O.Link.JumpOver,corner:5,toShortLength:4},new O.Binding("points"),e(O.Shape,{isPanelMain:!0,strokeWidth:2}),e(O.Shape,{toArrow:"Standard",stroke:null})),model:new O.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(I()(O.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(O.Node,"Auto",{locationSpot:O.Spot.Center},new O.Binding("location","location",O.Point.parse).makeTwoWay(O.Point.stringify),e(O.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 O.Binding("stroke").makeTwoWay(),new O.Binding("fill").makeTwoWay(),new O.Binding("figure")),e(O.TextBlock,{margin:new O.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new O.Size(16,16),maxSize:new O.Size(10,NaN),textAlign:"center",editable:!0},new O.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(O.Panel,"Grid",e(O.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(O.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:o})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(S.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},J=t(5112),K=t(94001),Y=J.ZP.Group,X={margin:"0 8px"},Q=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:X,children:"单元格数:"}),(0,h.jsx)("span",{style:X,children:"行数"}),(0,h.jsx)(y.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(K.Z,{})}),(0,h.jsx)("span",{style:X,children:"列数"}),(0,h.jsx)(y.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(K.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:X,children:"对齐方式:"}),(0,h.jsx)(y.Z.Item,{name:"align",children:(0,h.jsxs)(Y,{children:[(0,h.jsx)(J.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(J.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(J.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(J.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},$=t(78673),ee=t(38229),ne=t.n(ee),te=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,o=e.height,r=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),f=d[0],p=d[1],m=(0,c.useRef)({id:l,appName:"graphing",width:i||1e3,height:o||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(ne())(m.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return r&&r(e),e};return(0,c.useEffect)((function(){m.current.appName=f?"3D":"graphing",s.current.inject("applet_container")}),[f]),(0,c.useEffect)((function(){p(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:l}),(0,h.jsxs)(T.Z,{align:"middle",children:[(0,h.jsx)(H.Z,{flex:1,children:(0,h.jsx)($.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:f,onChange:function(e){return p(e)}})}),(0,h.jsx)(H.Z,{children:(0,h.jsx)(S.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ie=t(97488),oe=t(20817),re=t(8591),ae="link",le="upload-image",se="add-flowchart",ce="draw-image",ue="code-block",de="add-table",fe="------------",pe={default:fe,left:":".concat(fe),center:":".concat(fe,":"),right:"".concat(fe,":")},he=t(12066);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 ve(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var we=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",xe=s()(s()({},we+"-B","bold"),we+"-I","italic"),be=s()(s()(s()(s()(s()(s()(s()(s()({},ae,"添加链接"),ue,"添加代码块"),le,"添加图片"),ce,"添加画图"),se,"插入流程图"),de,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),_e=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,r=e.width,l=void 0===r?"100%":r,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,x=e.isFocus,y=void 0!==x&&x,k=e.watch,S=e.insertTemp,j=e.mode,T=void 0===j?"markdown":j,A=e.id,E=void 0===A?"markdown-editor-id":A,L=e.showResizeBar,M=void 0!==L&&L,G=e.noStorage,Z=void 0!==G&&G,I=e.showNullButton,O=void 0!==I&&I,D=e.showNullProgramButton,R=void 0!==D&&D,F=e.hidetoolBar,H=void 0!==F&&F,z=e.fullScreen,V=void 0!==z&&z,q=e.onBlur,J=e.onCMBeforeChange,K=e.onFullScreen,Y=e.className,X=void 0===Y?"":Y,$=e.disablePaste,ee=void 0!==$&&$,ne=e.disabled,fe=void 0!==ne&&ne,we=e.disabledFill,_e=void 0!==we&&we,ye=e.placeholder,ke=void 0===ye?"":ye,Se=e.values,je=void 0===Se?"":Se,Ce=e.extraUse,Be=(0,c.useState)(null),Ne=a()(Be,2),Te=Ne[0],Ae=Ne[1],Pe=(0,c.useState)(t),Ee=a()(Pe,2),Le=Ee[0],Me=Ee[1],Ge=(0,c.useState)(k),Ze=a()(Ge,2),Ie=Ze[0],Oe=Ze[1],De=(0,c.useState)(V),Re=a()(De,2),Fe=Re[0],We=Re[1],He=(0,c.useState)(""),ze=a()(He,2),Ve=ze[0],qe=ze[1],Ue=(0,c.useState)(0),Je=a()(Ue,2),Ke=Je[0],Ye=Je[1],Xe=(0,c.useState)(g),Qe=a()(Xe,2),$e=Qe[0],en=Qe[1],nn=(0,c.useState)(!1),tn=a()(nn,2),on=(tn[0],tn[1]),rn=(0,c.useState)(0),an=a()(rn,2),ln=an[0],sn=an[1],cn=(0,c.useState)(0),un=a()(cn,2),dn=un[0],fn=un[1],pn=(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;Me(je),null==Te||Te.setValue(je),window.scrollTo(0,e)}),[je]),(0,c.useEffect)((function(){null==K||K(Fe)}),[Fe]),(0,c.useEffect)((function(){if(pn.current){var e=function(e,t){if(!ee){var i=t.clipboardData;if(i){var o=i.types.toString(),r=i.items;if("Files"===o||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==T)return;try{var a,l=r[1];"file"===(null===(a=r[0])||void 0===a?void 0:a.kind)&&(l=r[0]);var s=l.getAsFile(),c=s.name.split(".").pop();(0,N.I)(s,(function(e){var t,i,o;e.id?(null==s||null===(t=s.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection(".concat(e.content_type,")")):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==s||null===(o=s.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(s.type,'&disposition=inline" target="_blank">').concat(s.name,"</a>")):ge.includes(c)?n.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(s.name,"</a>")):n.replaceSelection("[".concat(s.name,"](").concat(oe.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){re.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(pn.current,{mode:T,lineNumbers:!w,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(),o=t.getLine(i.line),r=o.charAt(i.ch-1),a=o.lastIndexOf("@▁@",i.ch),l=o.lastIndexOf("@▁▁@",i.ch),s=a>l?a:l,c=a>l?3:4;if(-1===me.indexOf(r))return null;if(console.log("change1:",n,e,o,i,s,a,l,r),s>=0&&i.ch-s<5){var u=s+c;return t.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),y&&n.focus(),n.on("paste",e),fe&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ae(n),function(){n.off("paste",e)}}}),[]);var vn=(0,c.useCallback)((function(){hn.current}),[$e,hn,Fe]);(0,c.useEffect)((function(){if(Te){var e=function(){var e=new f.Z((function(e){var n,t=o()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vn(),Te.setSize("100%","100%"),Te.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(pn.current.parentElement),e}();return function(){var n,t;null!==(n=pn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=pn.current)||void 0===t?void 0:t.parentElement)}}}),[Te,vn]),(0,c.useEffect)((function(){if(Te){for(var e=[],n=function(){var n=a()(i[t],2),o=n[0],r=n[1],l=s()({},o,(function(){wn(r)}));e.push(l),Te.addKeyMap(l)},t=0,i=Object.entries(xe);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!==Fe&&We(V)}),[V]),(0,he.Z)((function(){if(!Z&&Ke>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(E);e>=Ke+1e4&&(!n||n!==Le)&&(window.sessionStorage.setItem(E,Le),on(!0))}}),1e4),(0,c.useEffect)((function(){Oe(k)}),[Te,k]),(0,c.useEffect)((function(){Te&&y&&Te.focus()}),[Te,y]),(0,c.useEffect)((function(){if(Ie&&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,Ie]),(0,c.useEffect)((function(){if(Te&&J){var e=function(e,n){J(e,n)};return Te.on("beforeChange",e),function(){Te.off("beforeChange",e)}}}),[Te,J]),(0,c.useEffect)((function(){if(Te&&q){var e=function(){q(Te.getValue())};return Te.on("blur",e),function(){Te.off("blur",e)}}}),[Te,q]),(0,c.useEffect)((function(){if(Te){var e=function(e,n){var t=e.getValue();Me(t),Ye((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(""),Me("");else{var e=window.scrollY||window.pageYOffset;t!==Te.getValue()&&(Te.setValue(t),Me(t),Te.setCursor(fe?1:Te.lineCount(),0),window.scrollTo(0,e))}}),[Te,t]);var wn=(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 qe("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 Oe(!Ie),Te.focus();case"trigger-full-screen":return We(!Fe),Te.focus();case ae:return void qe(ae);case ue:return void qe(ue);case le:return void qe(le);case ce:return void qe(ce);case"maths-latex":return void qe("maths-latex");case se:return void qe(se);case de:return void qe(de);default:throw new Error}}),[Te,Ie,Fe]),xn=(0,c.useCallback)((function(e,n){var t,i,o,r,a;switch(qe(""),Ve){case ae:var l=e.title,s=e.link;return Te.replaceSelection("[".concat(l,"](").concat(s,")")),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),f=new Uint8Array(d.length),p=0;p<d.length;p++)f[p]=d.charCodeAt(p);var h=new Blob([f],{type:"image/png"});(0,N.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 le:case ce:case"add-flowchart":var m=e.src,g=e.alt,v=n,w=null==v||null===(t=v.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==v||null===(o=v.type)||void 0===o?void 0:o.indexOf("image"))>-1||null==v||!v.type?g?Te.replaceSelection(".concat(m,' "').concat(g,'" )')):Te.replaceSelection("")):(null==v||null===(r=v.type)||void 0===r?void 0:r.indexOf("video"))>-1?Te.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER).concat(m,'"></video>')):(null==v||null===(a=v.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Te.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(m,"?type=").concat(v.type,'&disposition=inline" target="_blank">').concat(v.name,"</a>")):ge.includes(w)?Te.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(m,'?type=office&disposition=inline" target="_blank">').concat(v.name,"</a>")):Te.replaceSelection("[".concat(v.name,"](").concat(oe.Z.API_SERVER).concat(m,")")),Te.focus();case de:for(var x=e.row,b=e.col,_=e.align,y="\n",k=0;k<x;k++){for(var S=[],j=[],C=0;C<b;C++)1===k&&j.push(pe[_]),S.push(" ");1===k&&(y+="| ".concat(j.join(" | ")," |\n")),y+="| ".concat(S.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 ae:return(0,h.jsx)(C,{callback:xn,onCancel:_n});case ue:return(0,h.jsx)(B.Z,{callback:xn,onCancel:_n});case le:return(0,h.jsx)(N.Z,{callback:xn,onCancel:_n});case se:return(0,h.jsx)(U,{callback:xn,onCancel:_n});case de:return(0,h.jsx)(Q,{callback:xn,onCancel:_n});case"maths-latex":return(0,h.jsx)(te,{showSaveButton:!0,callback:xn});case"inline-latex":return(0,h.jsx)(ie.Z,{showSaveButton:!0,callback:xn});default:return null}}),[Ve]);function _n(){qe("")}(0,c.useEffect)((function(){if(mn.current){var e=function(e){o=!0,r=e.pageY},n=function(){o=!1},t=function(e){if(o){var n=e.pageY-r;n<0&&(n=0),n>300&&(n=300),en(g+n+"px")}},i=mn.current,o=!1,r=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:ve(l),height:ve($e)},kn=((0,c.useMemo)((function(){if(Ke){var e=new Date(Ke),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}),[Ke]),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!==se&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;sn(n),fn(t)}),0)}),[Ve]);var Sn=function(e,n,t,i){var o=document.body.clientHeight,r=document.body.clientWidth;return!(e<20&&t>e||e>r-20&&t<e||n<20&&i>n||n>o-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(X," ").concat(Ie?"on-preview":""," ").concat(w?"mini":""," ").concat(Fe?"full-screen":""),style:yn,children:[(0,h.jsx)(b,{insertTemp:S,watch:Ie,fullScreen:Fe,showNullButton:O,showNullProgramButton:R,onActionCallback:wn,hidetoolBar:H,extraUse:Ce}),(0,h.jsxs)("div",{className:"markdown-editor-body",children:[(0,h.jsx)("div",{className:"codemirror-container",children:(0,h.jsx)("textarea",{ref:pn,placeholder:ke})}),Ie?(0,h.jsxs)("div",{ref:gn,className:"preview-container",children:["stex"===T&&(0,h.jsx)(m,{value:Le}),"stex"!==T&&(0,h.jsx)(p.Z,{disabledFill:_e,showProgramFill:R,value:Le})]}):null]})]})}),M?(0,h.jsx)("a",{ref:mn,className:"editor-resize"}):null,Ve===ce&&(0,h.jsx)(P,{callback:xn,onCancel:_n}),Ve===se&&(0,h.jsx)(U,{callback:xn,onCancel:_n}),(0,h.jsx)(_.Z,{children:be[Ve]&&Ve!==ce&&Ve!==se?(0,h.jsx)(W.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ln,top:dn},title:(0,h.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var n=e.clientX-ln,t=e.clientY-dn;document.body.onmousemove=function(e){var i=e.clientX-n,o=e.clientY-t,r=document.getElementsByClassName("markdown-popup-form")[0],a=window.innerWidth-r.offsetWidth,l=window.innerHeight-r.offsetHeight;i=Math.max(0,Math.min(i,a)),o=Math.max(0,Math.min(o,l)),Sn(e.clientX,e.clientY,n,t)&&(sn(i),fn(o))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:be[Ve]}),open:!0,onCancel:_n,footer:null,destroyOnClose:!0,width:Ve===se?"1200px":null,height:Ve===se?"80vh":null,className:"markdown-popup-form",children:bn}):null})]})}},72952:function(e,n,t){"use strict";t.d(n,{Z:function(){return v},I:function(){return x}});var i=t(82242),o=t.n(i),r=t(79800),a=t.n(r),l=t(78241),s=t(8591),c=t(92832),u=t(3113),d=t(44177),f=t(59301),p=t(37712),h=l.Z.useForm,m={width:280,marginRight:10},g={labelCol:{span:5},wrapperCol:{span:19}},v=function(e){var n=e.callback,t=e.onCancel,i=h(),r=a()(i,1)[0],d=(0,f.useRef)();function v(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):s.ZP.error(e.message)}return(0,p.jsxs)(l.Z,o()(o()({form:r},g),{},{className:"upload-image-panel",onFinish:function(e){n(e,d.current)},style:{width:470,overflow:"hidden"},children:[(0,p.jsx)(l.Z.Item,{label:"图片地址",required:!0,children:(0,p.jsxs)("div",{className:"flex-container",children:[(0,p.jsx)(l.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,p.jsx)(c.Z,{style:m})}),(0,p.jsx)(w,{onFileChange:function(e){var n=e.target.files[0];d.current=n,x(n,v)}})]})}),(0,p.jsx)(l.Z.Item,{label:"图片描述",name:"alt",children:(0,p.jsx)(c.Z,{style:{width:264}})}),(0,p.jsxs)(l.Z.Item,{style:{textAlign:"right"},children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function w(e){var n=e.onFileChange;return(0,p.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,p.jsx)("input",{type:"file",onChange:n})]})}function x(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)}},81074:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var i=t(82100),o=t.n(i),r=t(29186),a=t.n(r),l=t(80619),s=t.n(l),c=t(47074),u=t.n(c),d=t(59301),f=t(4676),p=function(e){s()(t,e);var n=u()(t);function t(e){var i;o()(this,t),i=n.call(this,e);var r=window.document;return i.node=r.createElement("div"),r.body.appendChild(i.node),i}return a()(t,[{key:"render",value:function(){var e=this.props.children;return(0,f.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(d.Component)},12066:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var i=t(59301);function o(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])}},10765:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return he}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),l=t(82242),s=t.n(l),c=t(79800),u=t.n(c),d=t(59301),f=t(32007),p=t(99313),h=t(78241),m=t(8591),g=t(3113),v=t(43418),w=t(5112),x=t(92832),b=t(95237),_=t(43604),y=t(95992),k=t(51150),S=t(32524),j=t(16896),C=t(57809),B=t(66621),N={flex_box_center:"flex_box_center___VNtUs",flex_space_between:"flex_space_between___yjHqt",flex_box_vertical_center:"flex_box_vertical_center___ExRYO",flex_box_center_end:"flex_box_center_end___R3pck",flex_box_column:"flex_box_column___jCizz",modal:"modal___QCUzg",main:"main___t9DEK",title:"title___roJ27",name:"name___AJcOc",body:"body___k8mdv",form:"form____xxpn",btns:"btns___Zy6h9"},T=t(37205),A=t.n(T),P=t(6848),E="wrap___zDMCt",L="modal___qzGUK",M="titleWrap___k3brc",G="required___h7eRD",Z="title___cMJHQ",I="colorGray___bSYRQ",O="choiceWrap___JBxMa",D="answer___LyOVU",R="activeAnswer___Jr8Iu",F="deleteIcon___xZU5J",W="addIcon___b8dJ9",H="editorWrap___LcO9S",z="htmlWrap___TI8l7",V="radio___xZG0G",q="color333___INjEp",U="color999___TucNz",J=t(37712),K=["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"],Y=function(e,n){var t=e.editData,i=(0,d.useState)(["","","",""]),o=u()(i,2),r=o[0],a=o[1],l=(0,d.useState)(),s=u()(l,2),c=s[0],f=s[1],p=(0,d.useState)([]),h=u()(p,2),g=h[0],v=h[1],w=(0,d.useState)(""),x=u()(w,2),b=x[0],_=x[1];(0,d.useEffect)((function(){var e,n;if(t){_(null==t?void 0:t.subject),a(null==t||null===(e=t.choose_contents)||void 0===e?void 0:e.map((function(e){return e.option_name})));var i=[];null==t||null===(n=t.choose_contents)||void 0===n||n.map((function(e,n){e.right_key&&i.push(n)})),v(i)}}),[t]),(0,d.useImperativeHandle)(n,(function(){return{onSave:S,Clear:j}}));var S=function(){if(!b)return m.ZP.info("请您输入题干"),!1;var e=r.findIndex((function(e){return!e}));if(e>-1)return m.ZP.info("请先输入 ".concat(K[e]," 选项的内容")),!1;if(console.log(r,"questionChoiceList"),function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=A()(e).sort(),t=0;t<n.length-1;t++)if(n[t]==n[t+1])return!0;return!1}(r))return m.ZP.info("选项已重复"),!1;if(!g.length)return m.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;var n=r.map((function(e,n){return{choice_text:e,is_answer:g.includes(n)?1:0}}));return{name:b,choices:n}},j=function(){a(["","","",""]),_(""),v([])};return(0,J.jsxs)("section",{className:E,children:[(0,J.jsxs)("p",{className:M,children:[(0,J.jsx)("span",{className:G,children:"*"}),(0,J.jsx)("span",{className:Z,children:"题干:"})]}),(0,J.jsx)(y.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:b,onChange:function(e){return _(e)}}),(0,J.jsxs)("p",{className:M,children:[(0,J.jsx)("span",{className:G,children:"*"}),(0,J.jsxs)("span",{className:Z,children:["答案选项:",(0,J.jsx)("span",{className:I,children:"点击选项可设置正确答案"})]})]}),r.map((function(e,n){return(0,J.jsxs)("div",{className:O,children:[(0,J.jsx)(P.Z,{title:"点击设置为标准答案",placement:"left",children:(0,J.jsx)("div",{className:"".concat(D," ").concat(g.includes(n)?R:""),onClick:function(){g.includes(n)?v(g.filter((function(e){return e!==n}))):v([].concat(A()(g),[n]))},children:K[n]})}),(0,J.jsx)("div",{className:H,children:c===n?(0,J.jsx)(y.Z,{id:"single-question-option-".concat(n),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){r[n]=e,a(r)}}):(0,J.jsx)("div",{className:z,onClick:function(){return f(n)},children:(0,J.jsx)(k.Z,{value:e})})}),n>1&&(0,J.jsx)(P.Z,{title:"删除",children:(0,J.jsx)("i",{className:"".concat(F," iconfont icon-htmal5icon19"),onClick:function(){return a(r.filter((function(e,t){return t!==n})))}})}),n<7&&n===r.length-1&&(0,J.jsx)(P.Z,{title:"新增参考答案",children:(0,J.jsx)("i",{className:"".concat(W," iconfont icon-roundaddfill ml6"),onClick:function(){return a([].concat(A()(r),[""]))}})})]},n)})),(0,J.jsx)("div",{className:"mt10 mb10",children:(0,J.jsx)("span",{className:"c-grey-999",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"})})]})},X=(0,d.forwardRef)(Y),Q=t(24905),$=t(29780),ee=t(1433),ne=function(e,n){var t=e.editData,i=(0,d.useState)(""),o=u()(i,2),r=o[0],a=o[1],l=(0,d.useState)([]),s=u()(l,2),c=s[0],f=s[1],p=(0,d.useState)(""),h=u()(p,2),g=h[0],w=h[1],x=(0,d.useState)(),b=u()(x,2),_=b[0],y=b[1],k=(0,d.useState)(!1),S=u()(k,2),j=S[0],C=S[1];(0,d.useEffect)((function(){t&&(a(null==t?void 0:t.subject),y(null==t?void 0:t.is_ordered),C(!0))}),[t]),(0,d.useEffect)((function(){var e;if(j){var n=null==t||null===(e=t.standard_answers)||void 0===e?void 0:e.map((function(e){return e.text}));f(n),C(!1)}}),[j]),(0,d.useImperativeHandle)(n,(function(){return{onSave:N,Clear:T}})),console.log(c,"answerList");var N=function(){var e=[],n=!1;return c.forEach((function(t,i){e.push({position:i+1,answer_text:[]}),t.forEach((function(t,o){e[i].answer_text.push(t),t&&(0,B.eR)(t,1e4)||(w("".concat(i,"-").concat(o)),m.ZP.info(t?"答案不能超过10000字符":"答案:不能为空"),n=!0)}))})),!n&&((null==e?void 0:e.length)>50?(m.ZP.warning("填空题标准答案不能为空/不能超过50个!"),!1):{name:r,standard_answers:e,is_ordered:_})},T=function(){a(""),f([]),y(!1)},P=function(e,n,t){w("");var i=c.slice();i[e][n]=t,f(i)},I=function(e){var n=c.slice();n[e]=[].concat(A()(n[e]),[""]),f(n)},O=function(e,n){var t=c.slice();if(!t[e][n])return t[e]=t[e].filter((function(e,t){return t!==n})),void f(t);v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:L,onOk:function(){t[e]=t[e].filter((function(e,t){return t!==n})),f(t)}})},D=function(e){v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:L,onOk:function(){var n=c.slice();n=c.filter((function(n,t){return e!==t})),f(n)}})};return(0,J.jsxs)("section",{className:E,children:[(0,J.jsxs)("p",{className:M,children:[(0,J.jsx)("span",{className:G,children:"*"}),(0,J.jsx)("span",{className:Z,children:"题干:"})]}),(0,J.jsx)("div",{children:(0,J.jsx)($.Z,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:r,onChange:function(e){return a(e)},showNullButton:!0,onPlaceholderChange:function(e,n,t){var i=c.slice();if(n&&i.splice(e,n),t)for(var o=0;o<t;o++)i.splice(e+o,0,[""]);f(i)}})}),(0,J.jsx)("div",{className:"mt20",children:c.map((function(e,n){return(0,J.jsx)(ee.Z,{answers:e,index:n,is_md:!0,activeOptionErrorIndex:g,onAnswerChange:P,addChildAnswer:I,deleteChildAnswer:O,deleteChildAnswermain:D},n)}))}),(0,J.jsx)("div",{className:"mt10 mb5",children:c.length>1&&(0,J.jsxs)("span",{children:[(0,J.jsx)(Q.Z,{checked:_,onChange:function(e){return y(e.target.checked)},className:q,children:"多个填空的答案有顺序要求"}),(0,J.jsx)("span",{className:"".concat(U," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})})]})},te=(0,d.forwardRef)(ne),ie=function(e,n){var t=e.editData,i=(0,d.useState)(),o=u()(i,2),r=o[0],a=o[1],l=(0,d.useState)(""),s=u()(l,2),c=s[0],f=s[1];(0,d.useEffect)((function(){t&&(f(null==t?void 0:t.subject),a("正确"===(null==t?void 0:t.standard_answer)?"0":"1"))}),[t]),(0,d.useImperativeHandle)(n,(function(){return{onSave:p,Clear:h}}));var p=function(){return c?r?{name:c,choices:[{choice_text:"正确",is_answer:"0"===r?1:0},{choice_text:"错误",is_answer:"1"===r?1:0}]}:(m.ZP.info("请先点击选择本判断题的正确选项"),!1):(m.ZP.info("请您输入题干"),!1)},h=function(){f(""),a("")};return(0,J.jsxs)("section",{className:E,children:[(0,J.jsxs)("p",{className:M,children:[(0,J.jsx)("span",{className:G,children:"*"}),(0,J.jsx)("span",{className:Z,children:"题干:"})]}),(0,J.jsx)(y.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:c,onChange:function(e){return f(e)}}),(0,J.jsxs)("p",{className:M,children:[(0,J.jsx)("span",{className:G,children:"*"}),(0,J.jsxs)("span",{className:Z,children:["答案选项:",(0,J.jsx)("span",{className:I,children:"点击选项可设置正确答案"})]})]}),(0,J.jsxs)(w.ZP.Group,{className:"mb10",buttonStyle:"solid",value:r,onChange:function(e){return a(e.target.value)},children:[(0,J.jsx)(w.ZP.Button,{value:"0",className:"".concat(V," mr40"),children:"正确"}),(0,J.jsx)(w.ZP.Button,{value:"1",className:V,children:"错误"})]})]})},oe=(0,d.forwardRef)(ie),re=t(35338),ae=function(e){var n=e.visible,t=void 0!==n&&n,i=e.is_published,r=e.editData,l=e.onOk,c=e.onCancel,f=(0,re.UO)(),p=(0,d.useState)([10,20]),v=u()(p,2),x=v[0],k=v[1],S=h.Z.useForm(),T=u()(S,1)[0],A=(0,d.useState)({}),P=u()(A,2),E=P[0],L=P[1],M=(0,d.useRef)();(0,d.useEffect)((function(){return document.getElementById("modal-level-question").style.transform="none",function(){document.getElementById("modal-level-question").style.transform="translateX(0)"}}),[]),(0,d.useEffect)((function(){t&&r&&(T.setFieldsValue(s()({},r)),k(G[r.difficult]))}),[t]);var G={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},Z=function(){var e=a()(o()().mark((function e(){var n,i,r,a,l,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.current.onSave();case 2:if(n=e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:if(1!==t){e.next=11;break}return i="",r={cnt:null==n?void 0:n.choices.map((function(e){return e.choice_text}))},null==(a={answer:null==n?void 0:n.choices.map((function(e){return e.is_answer}))})||a.answer.map((function(e,n){e&&(i+=B.oV[n])})),e.abrupt("return",{challenge_choose:{subject:n.name,answer:E.task_pass,standard_answer:i,score:E.score,difficult:E.difficult},question:r,choice:a});case 11:if(2!==t){e.next=13;break}return e.abrupt("return",{challenge_choose:{subject:n.name,answer:E.task_pass,score:E.score,difficult:E.difficult},blank_answers:null==n?void 0:n.standard_answers,is_ordered:null==n?void 0:n.is_ordered});case 13:if(3!==t){e.next=16;break}return s=null!=n&&null!==(l=n.choices)&&void 0!==l&&null!==(l=l[0])&&void 0!==l&&l.is_answer?"true":"false",e.abrupt("return",{challenge_choose:{subject:n.name,answer:E.task_pass,standard_answer:s,score:E.score,difficult:E.difficult}});case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(e){var n=G[e],t=null==n?void 0:n[0];k(n),T.setFieldsValue({score:t}),L(s()(s()({},T.getFieldsValue()),{score:t}))},O=function(){var e=a()(o()().mark((function e(n){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z();case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:if(!r){e.next=25;break}return e.t0=j.bq,e.t1=s(),e.t2=s(),e.t3=s(),e.t4={},e.next=13,i;case 13:return e.t5=e.sent,e.t6=(0,e.t3)(e.t4,e.t5),e.t7=f,e.t8=(0,e.t2)(e.t6,e.t7),e.t9={},e.t10={questionId:r.choose_id,type:t},e.t11=(0,e.t1)(e.t8,e.t9,e.t10),e.next=22,(0,e.t0)(e.t11);case 22:return e.sent.challenge_choose_id&&(m.ZP.success("操作成功"),l()),e.abrupt("return");case 25:return e.t12=j.Tn,e.t13=s(),e.t14=s(),e.t15=s(),e.t16={},e.next=32,i;case 32:return e.t17=e.sent,e.t18=(0,e.t15)(e.t16,e.t17),e.t19=f,e.t20=(0,e.t14)(e.t18,e.t19),e.t21={},e.t22={type:t},e.t23=(0,e.t13)(e.t20,e.t21,e.t22),e.next=41,(0,e.t12)(e.t23);case 41:e.sent.challenge_choose_id&&(m.ZP.success("操作成功"),l());case 43:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),D=function(){var e=a()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.current.onSave();case 2:if(e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:T.submit();case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,J.jsx)("div",{className:N.modal,children:(0,J.jsxs)("div",{className:N.main,children:[(0,J.jsxs)("div",{className:N.title,children:[(0,J.jsx)("span",{className:N.name,children:r?"编辑题目":"添加题目"}),(0,J.jsxs)("span",{className:N.edit,onClick:c,children:[" ",(0,J.jsx)("i",{className:"iconfont icon-guanbi1"})," "]})]}),(0,J.jsx)("div",{className:N.body,id:"question-scroll",children:(0,J.jsxs)(h.Z,{form:T,className:N.form,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(e,n){L(s()({},n)),"difficult"in e&&I(e.difficult)},onFinish:O,initialValues:{difficult:1,score:10},children:[1===t&&(0,J.jsx)(X,{ref:M,editData:r}),2===t&&(0,J.jsx)(te,{ref:M,editData:r}),3===t&&(0,J.jsx)(oe,{ref:M,editData:r}),(0,J.jsx)(h.Z.Item,{name:"task_pass",label:"参考答案:",rules:[{required:!0,message:"请输入参考答案"},{max:35e3,message:"参考答案最大限制5000个字符"}],children:(0,J.jsx)(y.Z,{className:"mt5",watch:!0,defaultValue:(null==r?void 0:r.answer)||""})}),(0,J.jsx)(h.Z.Item,{name:"difficult",label:"难度系数:",rules:[{required:!0,message:"请选择难度系数"}],children:(0,J.jsxs)(w.ZP.Group,{disabled:i,children:[(0,J.jsx)(w.ZP,{value:1,children:"简单"}),(0,J.jsx)(w.ZP,{style:{marginLeft:80},value:2,children:"中等"}),(0,J.jsx)(w.ZP,{style:{marginLeft:80},className:"ml80",value:3,children:"困难"})]})}),(0,J.jsxs)(b.Z,{className:"customAddItemSelect",children:[(0,J.jsx)(_.Z,{children:(0,J.jsx)(h.Z.Item,{name:"score",label:"奖励金币:",rules:[{required:!0,message:"请选择奖励经验值"}],children:(0,J.jsx)(C.default,{size:"large",disabled:i,children:x.map((function(e){return(0,J.jsx)(C.default.Option,{value:e,children:e},e)}))})})}),(0,J.jsx)(_.Z,{style:{paddingTop:18},children:(0,J.jsx)("div",{className:"font12 c-light-black ml10 mt20",children:"学员正确答题时获得金币,并且获得等量的经验值。如:+100金币、+100经验值。"})})]})]})}),(0,J.jsxs)("div",{className:N.btns,children:[(0,J.jsx)(g.ZP,{size:"middle",style:{marginRight:20},onClick:c,children:"取消"}),(0,J.jsx)(g.ZP,{size:"middle",type:"primary",onClick:D,children:"保存"})]})]})})},le={flex_box_center:"flex_box_center___ppUNW",flex_space_between:"flex_space_between___WJRAN",flex_box_vertical_center:"flex_box_vertical_center___7gMnX",flex_box_center_end:"flex_box_center_end___hvwcp",flex_box_column:"flex_box_column___yfVcD",bg:"bg___8Isfx",formWrap:"formWrap___r7knb",empty:"empty___eyoKW",list:"list___KSdLX",fs:"fs___Z5WVP",top:"top___brfch",left:"left___sqlv7",title:"title___DZUxC",qs:"qs___hVb1u",qsActive:"qsActive___sevZW",right:"right___dIeSm",bt:"bt___WD12g",answer:"answer___eM8QA",addBtn:"addBtn___uPtMo"},se=t(93524),ce=t(78721),ue=t(84431),de=t(81841),fe=t(89260),pe=p.Z.TabPane,he=(0,f.connect)((function(e){return{shixunsDetail:e.shixunsDetail,newCourse:e.newCourse,globalSetting:e.globalSetting,practiceSetting:e.practiceSetting}}))((function(e){var n,t,i,r=e.shixunsDetail,l=e.practiceSetting,c=e.dispatch,C=(0,f.useParams)(),B=(0,f.useLocation)(),N=(0,f.useSearchParams)(),T=u()(N,1)[0],A=h.Z.useForm(),P=u()(A,1)[0],E=(0,d.useState)({}),L=u()(E,2),M=L[0],G=L[1],Z=(0,d.useState)([]),I=u()(Z,2),O=I[0],D=I[1],R=(0,d.useState)(!0),F=u()(R,2),W=(F[0],F[1]),H=(0,d.useState)(!0),z=u()(H,2),V=z[0],q=z[1],U=(0,d.useState)(!1),K=u()(U,2),Y=K[0],X=K[1],Q=(0,d.useState)(null),$=u()(Q,2),ee=$[0],ne=$[1],te=(0,d.useState)(null),ie=u()(te,2),oe=(ie[0],ie[1]),re=(0,d.useState)("1"),he=u()(re,2),me=he[0],ge=he[1],ve=(0,d.useState)(1),we=u()(ve,2),xe=we[0],be=we[1],_e=(0,d.useRef)({subject:"",task_pass:""}),ye=(0,d.useRef)(null),ke=l.is_published,Se=l.id,je=r.challengesEdit,Ce=["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"];(0,d.useEffect)((function(){return T.get("tab")&&ge(T.get("tab")),Be(),Ne(),function(){clearTimeout(ye.current)}}),[B.pathname]);var Be=function(){var e=a()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),e.next=3,c({type:"shixunsDetail/getChallengesEdit",payload:s()({},C)});case 3:n=e.sent,oe(s()({},n)),_e.current={subject:n.subject,task_pass:(0,ue.S)(n.task_pass),unity_3d_routes:n.unity_3d_routes,has_relation:n.has_relation},G(s()({},_e.current)),P.setFieldsValue(s()({},n)),q(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=a()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W(!0),e.next=3,(0,j.eb)(s()({},C));case 3:n=e.sent,D(n.data),W(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=a()(o()().mark((function e(n){var t,i,a,l,u,d,f,p=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>1&&void 0!==p[1]&&p[1],i=p.length>2&&void 0!==p[2]?p[2]:1,a=!(!n.unity_3d_routes||""==n.unity_3d_routes),l=s()(s()(s()({},n),C),{},{unity_3d_routes:a?n.unity_3d_routes:null,unity_3d:a,sync_origin_shixun:t}),e.next=6,(0,j.Rs)(l);case 6:0===(u=e.sent).status&&(null!=r&&null!==(d=r.detail)&&void 0!==d&&d.copy_for_exercise||m.ZP.success(u.message),c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),c({type:"practiceSetting/setUpdateIndex"}),ge("2"),Le(),null!=r&&null!==(f=r.detail)&&void 0!==f&&f.copy_for_exercise&&(0,ue.m)(c,r,C.id,i));case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ae=function(){var e=a()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j._9)(s()(s()({},C),{},{questionId:n}));case 2:0===e.sent.status&&Ne();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Pe=function(){var e=a()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.im)(s()(s()({},C),{},{questionId:n}));case 2:0===e.sent.status&&Ne();case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ee=function(){var e=a()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.UQ)(s()(s()({},C),{},{questionId:n}));case 2:t=e.sent,ne(s()(s()({},t),{},{choose_id:n})),X("单选题/多选题"===(null==t?void 0:t.question_name)?1:"填空题"===(null==t?void 0:t.question_name)?2:3);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Le=function(){be(xe+1),Be()},Me=function(){var e,n=function(){f.history.push("/shixuns/".concat(Se,"/challenges")),c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=l&&null!==(e=l.sideBar)&&void 0!==e&&e.confirmLeave?v.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n()}}):n()};return(0,J.jsxs)("section",{className:le.bg,style:{marginBottom:"1"===me?67:0},children:[(0,J.jsxs)(p.Z,{activeKey:me,onChange:function(e){var n,t=function(){ge(e),Le(),c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=l&&null!==(n=l.sideBar)&&void 0!==n&&n.confirmLeave?v.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){t()}}):t()},tabBarExtraContent:"1"===me?null:(0,J.jsxs)("div",{className:"mb10",children:[(0,J.jsx)(g.ZP,{onClick:function(){return X(1)},type:"primary",ghost:!0,children:"添加选择题"}),(0,J.jsx)(g.ZP,{onClick:function(){return X(2)},type:"primary",className:"ml20 mr20",ghost:!0,children:"添加填空题"}),(0,J.jsx)(g.ZP,{onClick:function(){return X(3)},type:"primary",ghost:!0,children:"添加判断题"})]}),children:[(0,J.jsx)(pe,{tab:"本关任务",children:(0,J.jsxs)(h.Z,{form:P,scrollToFirstError:!0,className:le.formWrap,layout:"vertical",onValuesChange:function(e,n){G(s()({},n)),clearTimeout(ye.current),ye.current=setTimeout((function(){var e=P.getFieldsValue(),n=e.subject,t=e.task_pass;""!==_e.current.subject&&(n!==_e.current.subject||t!==_e.current.task_pass?c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}))}),500)},onFinish:function(e){var n,t;null!=r&&null!==(n=r.detail)&&void 0!==n&&n.is_fork_from_creator&&null!=r&&null!==(t=r.detail)&&void 0!==t&&t.copy_for_exercise&&_e.current.has_relation?c({type:"classroomList/setActionTabs",payload:{key:"同步修改",value:e,type:"taskLevel",fn:function(e,n,t){Te(e,n,t)}}}):Te(e)},children:[(0,J.jsx)("div",{className:le.fieldWrap,children:(0,J.jsx)(h.Z.Item,{initialValue:"",name:"subject",label:"任务名称:",rules:[{required:!0,message:"请输入任务名称"}],children:(0,J.jsx)(x.Z,{bordered:!1,maxLength:60,suffix:"".concat((null===(n=M.subject)||void 0===n?void 0:n.length)||0,"/60"),placeholder:"例如:从Python程序设计-入门精通"})})}),(0,J.jsx)("div",{className:le.mdWrap,children:(0,J.jsx)(h.Z.Item,{name:"task_pass",label:(0,J.jsxs)(b.Z,{align:"middle",children:[(0,J.jsx)(_.Z,{className:"mr10 font16",children:"任务要求:"}),(0,J.jsx)(_.Z,{children:(null==r||null===(t=r.detail)||void 0===t?void 0:t.id)&&(0,J.jsx)(S.Z,{title:"AI生成",children:(0,J.jsx)(g.ZP,{type:"primary",children:"AI生成"})})})]}),rules:[{required:!0,message:"请输入作业的简介"},{max:35e3,message:"作业简介最大限制5000个字符"}],children:(0,J.jsx)(y.Z,{watch:!0,defaultValue:je.task_pass},C.challengesId||"3")})}),(0,J.jsx)(h.Z.Item,{noStyle:!0,children:(0,J.jsx)(se.t,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:function(){Me()}})}),(0,fe.ag)()&&(0,J.jsx)("div",{className:le.fieldWrap,children:(0,J.jsx)(h.Z.Item,{initialValue:"",name:"unity_3d_routes",label:"嵌入第三方平台:",children:(0,J.jsx)(x.Z,{bordered:!1,maxLength:60,suffix:"".concat((null===(i=M.unity_3d_routes)||void 0===i?void 0:i.length)||0,"/60"),placeholder:"请输入第三方平台地址"})})})]},xe)},"1"),(0,J.jsxs)(pe,{tab:"题目",children:[!!O.length&&O.map((function(e,n){var t=e.challenge_choose_id,i=e.subject,r=e.choose_contents,l=e.standard_answer,c=e.answer,u=e.score,d=(e.category,e.question_name),f=e.standard_answers;return(0,J.jsxs)("div",{className:le.list,children:[(0,J.jsxs)("div",{className:le.top,children:[(0,J.jsxs)("div",{className:le.left,children:[(0,J.jsxs)("div",{className:le.title,children:[(0,J.jsxs)("div",{className:le.fs,children:[n+1,". "]}),(0,J.jsx)(k.Z,{value:i})]}),"单选题/多选题"===d&&(null==r?void 0:r.map((function(e,n){return(0,J.jsxs)("ul",{className:e.right_key?le.qsActive:le.qs,children:[(0,J.jsx)("li",{children:Ce[e.position]}),(0,J.jsx)("li",{children:(0,J.jsx)(k.Z,{value:e.option_name})})]},n)}))),"判断题"===d&&(0,J.jsxs)(w.ZP.Group,{className:"mb10",buttonStyle:"solid",value:l,children:[(0,J.jsx)(w.ZP,{value:"正确",className:"".concat(le.radio," mr40"),children:"正确"}),(0,J.jsx)(w.ZP,{value:"错误",className:le.radio,children:"错误"})]})]}),(0,J.jsxs)("div",{className:le.right,children:[(0,J.jsx)("i",{onClick:function(){return Ee(t)},className:"iconfont icon-xiaoxiugai"}),(0,J.jsx)("i",{onClick:function(){return e=t,n=function(){var n=a()(o()().mark((function n(){return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,j.Yn)(s()(s()({},C),{},{questionId:e}));case 2:n.sent.challenge_id&&(Ne(),m.ZP.success("删除成功"));case 4:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}(),void v.Z.confirm({title:"提示",content:"是否删除题目!",centered:!0,onOk:n});var e,n},className:"iconfont icon-shanchu23"}),n!==O.length-1&&(0,J.jsx)("i",{onClick:function(){return Pe(t)},className:"iconfont icon-xiayi2"}),0!==n&&(0,J.jsx)("i",{onClick:function(){return Ae(t)},className:"iconfont icon-shangyi2"})]})]}),(0,J.jsxs)("div",{className:le.bt,children:["题型:",d," 奖励金币:",u]}),(0,J.jsxs)("div",{className:le.answer,children:["填空题"===d?null==f?void 0:f.map((function(e,n){var t;return(0,J.jsxs)("p",{children:["填空",n+1,":",null==e||null===(t=e.text)||void 0===t?void 0:t.join("、")]},n)})):(0,J.jsxs)("p",{children:["标准答案:",l]}),(0,J.jsxs)("p",{children:[(0,J.jsx)("div",{className:le.fs,children:"参考答案:"}),(0,J.jsx)(k.Z,{value:c})]})]})]},t)})),!O.length&&(0,J.jsxs)("div",{className:le.empty,children:[(0,J.jsx)("img",{src:de.x7,width:"258"}),(0,J.jsx)("span",{className:"c-grey-c",children:"请点击右上角添加题目按钮进行题目的创建! "})]})]},"2")]}),!!Y&&(0,J.jsx)(ae,{is_published:ke,visible:Y,onCancel:function(){X(!1),ne(null)},onOk:function(){X(!1),ne(null),Ne()},editData:ee}),(0,J.jsx)(ce.Z,{loading:V})]})}))},78721:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});t(59301);var i=t(71418),o="loading___lueiN",r=t(37712),a=function(e){return e.loading?(0,r.jsx)("div",{className:o,children:(0,r.jsx)(i.Z,{})}):(0,r.jsx)(r.Fragment,{})}},84431:function(e,n,t){"use strict";t.d(n,{S:function(){return d},m:function(){return f}});var i=t(7557),o=t.n(i),r=t(41498),a=t.n(r),l=t(66621),s=t(8591),c=t(43418),u=t(37712),d=function(e){var n=document.createElement("textarea");return n.value=e,n.value},f=function(){var e=a()(o()().mark((function e(n,t,i,r,a){var d,f,p;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({type:"shixunsDetail/saveCopyForExercise",payload:{id:i,save_type:r}});case 2:d=e.sent,1===r?(0==(null==d?void 0:d.status)&&s.ZP.success("保存成功"),null!=d&&null!==(f=d.data)&&void 0!==f&&f.exists_same_shixun_name?n({type:"classroomList/setActionTabs",payload:{key:"重名修改",name:null==d||null===(p=d.data)||void 0===p?void 0:p.shixun_name}}):n({type:"classroomList/setActionTabs",payload:{}})):(n({type:"classroomList/setActionTabs",payload:{}}),0===(null==d?void 0:d.status)&&c.Z.info({title:"提示",width:460,icon:null,centered:!0,content:(0,u.jsx)("div",{children:(0,u.jsx)("div",{children:"实训同步修改完成,请验证实训是否可以正常使用。"})}),okText:"前往原实训",onOk:function(){var e;(0,l.xg)("/shixuns/".concat(null==t||null===(e=t.detail)||void 0===e||null===(e=e.fork_from)||void 0===e?void 0:e.fork_identifier,"/challenges"))}}));case 4:case"end":return e.stop()}}),e)})));return function(n,t,i,o,r){return e.apply(this,arguments)}}()}}]); |