|
|
(self.webpackChunk=self.webpackChunk||[]).push([[41657,87253],{77254:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,o=!1,a=!1,r=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":t=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?t=d:r=d;break;case"object":void 0!==d.is3D?i=d:n=d;break;case"boolean":o=d,a=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===n.material_id||a||(o=!0)),null!==r&&void 0===n.id&&(n.id=r);var f="",p=!1,h=null,m=null,g=null,v=!1,w=null,x=null,b=null;void 0!==n.height&&(n.height=Math.round(n.height)),void 0!==n.width&&(n.width=Math.round(n.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(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,I(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=e,Z(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){b=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,o="auto",a=n.id,r=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?o=c:a=arguments[l]:"boolean"==typeof c?r=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){o=M(o);var l=i||document.getElementById(a);if(l)if(e.removeExistingApplet(l,!1),void 0===n.width&&l.clientWidth&&(n.width=l.clientWidth),void 0===n.height&&l.clientHeight&&(n.height=l.clientHeight),n.width&&n.height||"html5"!==o||(delete n.width,delete n.height),h=o,"screenshot"===o)T(l,n);else{var c=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?c=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(c=(!y()||t())&&k()),c?(h="screenshot",P(l,n,r,o)):N(l,n,r)}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(t){var o=function(){n.onError&&n.onError(),D("Error: Fetching material (id "+n.material_id+") failed.",n)},a=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",r="/materials/"+n.material_id+"?scope=basic";C("https://"+a+"/api/proxy.php?path="+encodeURIComponent(r),(function(a){var r=JSON.parse(a),s=r.elements?r.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:r;if(s&&s.url){n.fileName=s.url,j(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";e.setPreviewImage(w||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),t()}else o()}),o)};function j(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(t){e[t]=!!e[t]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(t){void 0===n[t]&&void 0!==e[t]&&(n[t]=e[t])})),void 0===n.showToolBarHelp&&(n.showToolBarHelp=n.showToolBar)}function C(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){t(i.responseText)},i.onerror=n,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return h},e.setPreviewImage=function(e,t,n){w=e,x=t,n},e.removeExistingApplet=function(e,t){var i;"string"==typeof e&&(e=document.getElementById(e)),h=null;var o=null;for(i=0;i<e.childNodes.length;i++){var a=e.childNodes[i],r=a.className;"applet_screenshot"===r?t?(a.style.display="block",h="screenshot"):a.style.display="none":"applet_scaler prerender"!==r&&(e.removeChild(a),o=r&&-1!=r.indexOf("appletParameters")?a.id:null,i--)}var s=void 0!==n.id?n.id:o,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},e.refreshHitPoints=function(){if(_(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var B=function(e){return e&&"false"!==e},N=function(t,n,i){_(m)<=4.2&&(i=!0);var o=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(o=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var a=document.createElement("div");a.classList.add("appletParameters","notranslate");var r=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(_(m)<=4.4)B(n.showToolBar)&&(n.height-=7),B(n.showAlgebraInput)&&(n.height-=37),n.width<605&&B(n.showToolBar)&&(n.width=605,r=605);else{var u=100;(B(n.showToolBar)||B(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=B(n.showMenuBar)?245:155),r<u&&(n.width=u,r=u)}for(var d in a.style.border="none",a.style.display="inline-block",n)n.hasOwnProperty(d)&&"appletOnLoad"!==d&&a.setAttribute("data-param-"+d,n[d]);b&&a.setAttribute("data-param-fontscssurl",b),e.resize=function(){GGBAppletUtils.responsiveResize(t,n)},window.addEventListener("resize",(function(t){e.resize()}));var p="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var h=document.createElement("div");h.className="applet_scaler",h.style.position="relative",h.style.display="block",h.appendChild(a),t.appendChild(h),n.appletOnLoad=function(t){e.resize(),p(t)}}else{n.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var w=t.querySelector(".applet_scaler.prerender"),x=null!==w;if(x)y=w.querySelector(".ggb_preview");else{var y=L(r,s,n.borderColor,!1);(w=document.createElement("div")).className="applet_scaler",w.style.position="relative",w.style.display="block",w.style.width=r+"px",w.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(w,"66%"),_(m)>=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),p(e)},x||w.appendChild(y)):a.appendChild(y),w.appendChild(a),x||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function S(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},_(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(o){scriptLoadStarted=!0;for(var j=0;j<a.childNodes.length;j++){"TABLE"===a.childNodes[j].tagName&&(a.removeChild(a.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(a,n)};N.src=f+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=N.src,D("GeoGebra HTML5 codebase loaded: '"+f+"'.",n),c||l&&"5.0"!=l?f.requirejs?__webpack_require__.e(8076).then(function(){var e=[__webpack_require__(8076)];T.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(N.onload=T,t.appendChild(N)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),T())}else S(a,n);n.height=s,n.width=r},T=function(t,n,i){var o=L(n.width,n.height,n.borderColor,i),a=document.createElement("div");a.style.position="relative",a.style.display="block",a.style.width=n.width+"px",a.style.height=n.height+"px",a.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),a.appendChild(o);var r=GGBAppletUtils.getScale(n,t,i);i?(t.appendChild(E()),window.GGBT_wsf_view||(t.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(a,"66%"),t.appendChild(a),1===r||isNaN(r)||(GGBAppletUtils.scaleElement(a,r),a.style.width=n.width+"px",a.style.height=n.height+"px",a.parentNode.style.width=n.width*r+"px",a.parentNode.style.height=n.height*r+"px"),e.resize=function(){A(t,o,a,i)},window.addEventListener("resize",(function(t){e.resize()})),e.resize()};function A(e,t,i,o){if(e.contains(t)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var a=GGBAppletUtils.getScale(n,e,o);null!==i.parentNode&&(isNaN(a)||1===a?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=n.width+"px",i.parentNode.style.height=n.height+"px"):(GGBAppletUtils.scaleElement(i,a),i.parentNode.style.width=n.width*a+"px",i.parentNode.style.height=n.height*a+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,t){t.appendChild(e)};var P=function(e,t,n,i){T(e,t,!0);for(var o=function(){var n=[];for(r=0;r<e.childNodes.length;r++)n.push(e.childNodes[r]);if(window.GGBT_wsf_view){var o=window.GGBT_wsf_view.renderFullScreen(e,t.id),a=document.getElementById("fullscreencontainer"),s=jQuery(e).find(".fullscreencontent");s.length>0?(o.remove(),s.attr("id","fullscreencontent").show(),jQuery(a).append(s),window.dispatchEvent(new Event("resize"))):N(o,t,!1),window.GGBT_wsf_view.launchFullScreen(a)}else h=i,N(e,t,!1);if(!window.GGBT_wsf_view)for(r=0;r<n.length;r++)e.removeChild(n[r])},a=e.getElementsByClassName("ggb_preview_play"),r=0;r<a.length;r++)a[r].addEventListener("click",o,!1),a[r].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 t='.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");}',n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(n)}return e},L=function(e,t,n,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=t-2+"px",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.backgroundColor="white";var a="lightgrey";void 0!==n&&(a="none"===n?"transparent":n),o.style.border="1px solid "+a;var r,s,l,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){(r=document.createElement("img")).style.position="absolute",r.style.zIndex="1001",r.style.opacity=1,c.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,r.setAttribute("src",x),r.setAttribute("width",s),r.setAttribute("height",l);var u=(e-s)/2,d=(t-l)/2;r.style.left=u+"px",r.style.top=d+"px",o.appendChild(r)}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,t){if(m=e,t)I(m,!0);else{var a,r,s=!o;if(s){var l=_(m);!isNaN(l)&&l<4.4&&(s=!1)}a="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in r=c>0?m:0===c?a+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(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||B(n.showToolBar)||B(n.showMenuBar)||B(n.showAlgebraInput)||B(n.enableRightClick)||n.appName&&"classic"!=n.appName?r+="web3d/":r+="webSimple/",I(r,!1)}},I=function(e,t){if(e.requirejs)f=e;else{"/"!==e.slice(-1)&&(e+="/"),f=e,null===t&&(t=-1===e.indexOf("http")),p=t,g="web.nocache.js",v=!1;var n=f.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?G.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var 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",t))}},D=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function O(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),Z(e,!1),null!==c&&I(c,p),s=!0}return void 0!==n.material_id?S(O):O(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,o){if(e.isScreenshoGenerator)return 1;var a,r=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(a=e.autoHeight)&&"false"!==a,c=function(e,t,n,i,o,a){var r=null;if(null!=a&&""!=a)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+a+" ")>-1){r=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,f=0,p=0,h=0;if(r)l=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===o||!o)&&("rtl"===document.dir?(f=l-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===n||!n)&&t>0&&t+d<l?l=t:l-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(c-=h)),{width:l,height:c}}(t,e.width,n,l,r&&window.GGBT_wsf_view||s,o),u=parseInt(c.width),d=e.width,f=e.height;if(void 0===d){var p=t.querySelector(".appletParameters");p&&(d=p.offsetWidth,f=p.offsetHeight)}var h=u/d,m=r?1:c.height/f;return void 0===n||n||(h=Math.min(1,h),m=Math.min(1,m)),Math.min(h,m)}function i(e,t,i){var o,a=1,r=!1;return e.hasOwnProperty("allowUpscale")&&(r=e.allowUpscale),e.hasOwnProperty("scale")&&(a=parseFloat(e.scale),(isNaN(a)||null===a||0===a)&&(a=1),a>1&&(r=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?a:(o=n(e,t,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==a?Math.min(a,o):o)}function o(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),o=(t-i.width)/2,a=(n-i.height)/2;a<0&&(a=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=o<40?"40px":o+"px",e.style.top=a+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=a<40?"40px":a+"px",e.style.left=o+"px")}return{responsiveResize:function(n,a){var r=n.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(a.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var s=i(a,n);e()&&r.setAttribute("data-param-scale",s);for(var l=null,c=0;c<n.childNodes.length;c++)if(void 0!==n.childNodes[c].className&&n.childNodes[c].className.match(/^applet_scaler/)){l=n.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==a.id?a.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(t(l,1),l.parentNode.style.width=a.width+"px",l.parentNode.style.height=a.height+"px"):(l.parentNode.style.width=a.width*s+"px",l.parentNode.style.height=a.height*s+"px",t(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&o(n),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(r).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:o,getScale:i,scaleElement:t}}();__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,t){}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 t(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var n=t();if(n)e();else{o.addEventListener&&o.addEventListener(Z,a,!1);var i=setInterval((function(){a()}),$)}function a(){if(!n){if(!t())return;n=!0,e(),o.removeEventListener&&o.removeEventListener(Z,a,!1),i&&clearInterval(i)}}}((function(){var t,n,i,o;t=e,n=u(),i=n.body,(o=n.createElement(_)).language=ab,o.crossOrigin=W,o.src=t,webModule.__errFn&&(o.onerror=function(){webModule.__errFn(L,new Error(bb+t))}),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 t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;n<t.length;++n)if(-1!=t[n].src.indexOf(xb))return e(t[n].src);return W}()),n==W&&(n=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var t=o[e](),n=i[e];if(t in n)return t;var a=[];for(var s in n)a[n[s]]=s;throw r&&r(e,a,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=a(t));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],o=O;o<i.length;o++){var a=i[o];n[a[O]]=a[P]}return n}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var t=u(),n=t.body,i=t.createElement(_);i.language=ab,i.text=e,n.appendChild(i),n.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")})()},68682:function(e,t,n){"use strict";function i(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function o(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<e.length;i++){var o=e[i],a=t?"".concat(t,"/").concat(o.name):"".concat(o.name);n.push({title:o.name,type:o.type,isLeaf:"tree"!==o.type,key:a})}return n}function a(e,t,n){for(var i=0;i<e.length;i++){var o=e[i];if(o.key===t){o.children=n;break}o.children&&a(o.children,t,n)}return e}function r(e,t,n){var i;return function(){var o=this,a=arguments,r=function(){i=null,n||e.apply(o,a)},s=n&&!i;clearTimeout(i),i=setTimeout(r,t),s&&e.apply(o,a)}}n.d(t,{Ax:function(){return a},Ds:function(){return r},KI:function(){return s},SI:function(){return o},f1:function(){return i}});var s=n(22107).Z.API_SERVER},59708:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var i=n(7557),o=n.n(i),a=n(37205),r=n.n(a),s=n(41498),l=n.n(s),c=n(79800),u=n.n(c),d=n(59301),f=n(43428),p=n(95237),h=n(46651),m=n(3113),g=n(98135),v=n(75102),w=n(82242),x=n.n(w),b=n(39647),_=n.n(b),y=n(83557),k=n(50457),S=n(59455),j=n(56102),C="wrp___H70W8",B="file-list___S5XYJ",N="btn___Yiu8q",T=n(8591),A=n(43604),P=n(35472),E=n(37712),L=["node","inline","className","children"],M=function(e){var t=e.data,n=e.hideTextEffect,i=e.onCallback,a=e.fileList,r=e.allowCopy,s=e.scrollBox,c=(0,d.useState)(""),f=u()(c,2),h=f[0],m=f[1],g=(0,d.useState)(!0),v=u()(g,2),w=v[0],b=v[1];(0,d.useEffect)((function(){if(t.text){b(!0);var e=function(){var e=l()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<t.text.length)){e.next=8;break}return m(t.text.substring(0,n+1)+(t.text.length-1>n?" __":"")),e.next=5,new Promise((function(e){return setTimeout(e,30)}));case 5:n++,e.next=1;break;case 8:b(!1),null==i||i(t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return n?m(t.text):e(),function(){return m("")}}}),[]),(0,d.useEffect)((function(){s.current&&s.current.scrollTo({top:s.current.scrollHeight,behavior:"smooth"})}),[h]);return(0,E.jsxs)("div",{className:"".concat(C," fadeIn animated"),children:[(0,E.jsx)(y.U,{components:{code:function(e){e.node;var t=e.inline,n=e.className,i=e.children,o=_()(e,L),a=/language-(\w+)/.exec(n||"");return!t&&a?(0,E.jsxs)("div",{style:{position:"relative"},children:[(0,E.jsx)(j.CopyToClipboard,{text:String(i).replace(/\n$/,""),onCopy:function(){return T.ZP.success({content:"复制成功",key:"copy"})},children:(0,E.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,E.jsx)(k.Z,x()(x()({style:S.Z,language:a[1],PreTag:"div",showLineNumbers:!0,lineNumberStyle:{minWidth:"40px"}},o),{},{children:String(i||"").replace(/\n$/,"")}))]}):(0,E.jsx)("code",x()(x()({className:n},o),{},{children:i}))}},children:h}),a&&!w&&(0,E.jsxs)(p.Z,{className:"".concat(B," animated fadeIn"),children:[(0,E.jsx)(A.Z,{children:(0,E.jsx)(P.Z,{className:"font20 mr10"})}),(0,E.jsxs)(A.Z,{children:[null==a?void 0:a.name,(0,E.jsx)("br",{}),function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]}(null==a?void 0:a.size)]})]}),!w&&r&&(0,E.jsx)(j.CopyToClipboard,{text:String(h).replace(/\n$/,""),onCopy:function(){return T.ZP.success({content:"复制成功",key:"copy"})},children:(0,E.jsxs)("div",{className:N,children:[(0,E.jsx)("i",{className:"iconfont icon-fuzhi3 mr5"}),"复制"]})})]})},G={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"},Z=n(10032),I=n(95888),D=n(11298),O=function(e){var t,n,i,a,s,c,w,x=e.title,b=e.description,_=e.placeholder,y=e.hideUpload,k=e.hideInputBox,S=e.aiIcon,j=e.userIcon,C=e.children,B=e.taskData,N=e.code,T=(0,d.useState)(!1),A=u()(T,2),P=A[0],L=A[1],O=(0,d.useState)([]),R=u()(O,2),F=R[0],W=R[1],H=(0,d.useState)(!1),V=u()(H,2),z=V[0],q=V[1],U=(0,d.useState)([]),J=u()(U,2),K=J[0],Y=J[1],X=(0,d.useRef)(K),Q=(0,d.useRef)(),$=(0,d.useRef)(),ee=(0,d.useState)(""),te=u()(ee,2),ne=te[0],ie=te[1],oe=(0,d.useState)(["".concat(null==B||null===(t=B.challenge)||void 0===t?void 0:t.task_pass,",请给出答题思考方向。\\n\\n不要给出学生正确答案,不要给出任何代码")]),ae=u()(oe,2),re=ae[0],se=ae[1],le=["Bearer app-60ucoL9QIrVn7HY5HE7F6klk","Bearer app-KzDhQcrItFQpw8L3yZRFnlms","Bearer app-zNb8eGMsK3xWT4dvk2lZEBS6"],ce=(0,d.useState)(["",null==B||null===(n=B.challenge)||void 0===n?void 0:n.task_pass,null==B||null===(i=B.challenge)||void 0===i?void 0:i.task_pass]),ue=u()(ce,2),de=ue[0],fe=(ue[1],!!B);(0,d.useEffect)((function(){X.current=K}),[K]),(0,d.useEffect)((function(){var e;se(["".concat(null==B||null===(e=B.challenge)||void 0===e?void 0:e.task_pass),"".concat(N),"".concat(N)])}),[N]);var pe=function(){L(!0)},he=function(){var e=l()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.ZP)("https://ai-data.educoder.net/v1/chat-messages",{method:"post",body:{inputs:{description:"为我生成一个面向对象的案例"},query:t,response_mode:"blocking",conversation_id:Q.current||"",user:"abc-sssdd",files:[]},mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer app-pnyfYJSuVEnMCSoTpF37uJdp"}});case 2:n=e.sent,q(!1),X.current[X.current.length-1].text=null==n?void 0:n.answer,X.current[X.current.length-1].loading=!1,Q.current=null==n?void 0:n.conversation_id,Y(r()(X.current));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),me=[{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:"快速智能拆解任务,提供解题思路"},{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:"系统智能代码分析,提供修正建议"},{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:"为学生提供个性化智能学习辅导"}],ge=function(){var e=l()(o()().mark((function e(t){var n,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!z){e.next=2;break}return e.abrupt("return");case 2:return q(!0),Y([].concat(r()(K),[{text:ne,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0,name:null===(n=me[t])||void 0===n?void 0:n.name}])),setTimeout((function(){$.current.scrollTo({top:$.current.scrollHeight,behavior:"smooth"})})),e.next=7,(0,Z.ZP)("https://ai-data.educoder.net/v1/chat-messages",{method:"post",body:{inputs:{description:de[t]},query:re[t],response_mode:"blocking",conversation_id:"",user:"abc-".concat(Date.now()),files:[]},mode:"cors",headers:{"Content-Type":"application/json",Authorization:le[t]}});case 7:null!=(i=e.sent)&&i.answer&&(q(!1),X.current[X.current.length-1].text=null==i?void 0:i.answer,X.current[X.current.length-1].loading=!1,Y(r()(X.current)));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ve=function(){""!==ne.trim()&&(ie(""),W([]),Y([].concat(r()(K),[{text:ne,done:!1,key:Date.now(),sender:"user",fileList:F[0]},{text:ne,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}])),q(!0),setTimeout((function(){return he(ne)}),300))};return(0,E.jsxs)("div",{children:[["daiao","pu428f3pz","wangwei10061","pucmnw7fs","mlty7uhjf"].includes(null===(a=(0,I.eY)())||void 0===a?void 0:a.login)&&(C?(0,E.jsxs)("div",{onClick:pe,children:[(0,E.jsx)(v.Outlet,{}),C]}):(0,E.jsx)("div",{style:{width:60,height:60,position:"fixed",zIndex:2,right:20,bottom:"35%",cursor:"pointer"},onClick:pe,children:(0,E.jsx)("img",{src:"/images/ai_teacher.png",width:60})})),(0,E.jsx)(f.Z,{maskClosable:!1,width:860,title:(0,E.jsx)("span",{className:G.title,children:x||"头歌AI"}),onClose:function(){L(!1)},open:P,className:G.answerWrp,children:(0,E.jsxs)("div",{className:G["ai-wrp"],children:[(0,E.jsxs)("div",{ref:$,className:G["chat-container"],children:[(0,E.jsxs)("div",{className:G.li,children:[(0,E.jsx)("img",{className:G.img,src:S||"/images/ai_icon.png"}),(0,E.jsxs)("div",{className:G.content,children:[(0,E.jsxs)("div",{className:"c-grey-333 font22",children:[(0,E.jsx)("span",{className:"mr5",children:"👋"}),"嗨,我是头歌",fe?x:"智能助教",",您的教学好帮手。"]}),(0,E.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:b||"我可以阅读您上传的教案,书籍等教学资料,并根据您的要求为您自动生成任务要求。"}),(0,E.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:"快来试一下吧~"}),fe&&(0,E.jsx)("div",{className:G.container,children:me.map((function(e,t){return(0,E.jsxs)("div",{onClick:function(){return ge(t)},className:G.item,children:[(0,E.jsxs)(p.Z,{align:"middle",children:[(0,E.jsx)("img",{className:"mr10",src:e.img}),(0,E.jsx)("span",{style:{color:"#232B40",fontSize:16,fontWeight:600},children:e.name})]}),(0,E.jsx)("div",{className:"mt10",style:{color:"#434D6C"},children:e.des})]},t)}))})]})]}),null==K?void 0:K.map((function(e,t){var n;return(0,E.jsxs)("div",{className:G.li,style:"AI"===e.sender&&"user"!==(null===(n=K[t+1])||void 0===n?void 0:n.sender)?{marginBottom:50}:{},children:[(0,E.jsx)("img",{className:G.img,src:"AI"===e.sender?S||"/images/ai_icon.png":j||"/images/ai_user.png"}),(0,E.jsx)("div",{className:"".concat(G.content," ").concat("AI"===e.sender?"":G.user),children:e.loading?(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{className:G["loading-wanx"],children:[(0,E.jsx)("div",{className:G["dot-flashing"]}),(0,E.jsx)("div",{className:G["dot-flashing"]}),(0,E.jsx)("div",{className:G["dot-flashing"]})]}),(0,E.jsx)("div",{style:{marginTop:10,color:"#9096A3"},children:"请耐心等待,目前高峰期体验人数过多,我们已记录下您的需求,稍后将自动为您生成答案。"})]}):(0,E.jsxs)(E.Fragment,{children:[!!e.name&&(0,E.jsx)("div",{className:"mb10 font18",style:{color:"#232B40",fontWeight:600},children:e.name}),(0,E.jsx)(M,{scrollBox:$,allowCopy:e.allowCopy,data:{text:e.text},fileList:e.fileList,hideTextEffect:e.hideTextEffect})]})})]},t)}))]}),!k&&(0,E.jsxs)("div",{className:"".concat(G["footer-container"]," ").concat(F.length>=1&&G["has-file"]),children:[!!F.length&&(0,E.jsxs)(p.Z,{align:"middle",className:"pb5 pt5",children:[(0,E.jsx)("span",{title:null==F||null===(s=F[0])||void 0===s?void 0:s.name,className:"mr10",children:(0,D.tP)(null==F||null===(c=F[0])||void 0===c?void 0:c.name,40)}),(0,E.jsx)("i",{onClick:function(){return W([])},className:"iconfont current icon-shanchu15 delete-hover c-red-ee4 font14"})]}),(0,E.jsxs)("div",{style:F.length?{paddingLeft:0}:{},className:G["input-container"],children:[!y&&(0,E.jsx)("div",{className:G["footer-container-upload"],children:(0,E.jsx)(h.Z,{action:"https://ai-data.educoder.net/v1/datasets/dc9e6c03-a629-4e9e-bd81-06fb93c29aa1/document/create_by_file",fileList:r()(F),onChange:function(e){var t=e.fileList;console.log(":newFileList:",t),W(t)},showUploadList:!1,accept:".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",beforeUpload:function(e){var t=["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 t||(ne.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"}})},maxCount:1,children:F.length?null:(0,E.jsx)(m.ZP,{className:G["upload-btn"],icon:(0,E.jsx)("i",{className:"iconfont icon-shangchuan4 c-white"})})})}),(0,E.jsx)(g.Z.TextArea,{rows:1,placeholder:_||"在这里输入你问题吧~",value:ne,bordered:!1,onChange:function(e){ie(e.target.value)},onKeyPress:function(e){if("Enter"===e.key){var t;if(e.preventDefault(),null!=F&&F.length&&"done"!==(null==F||null===(t=F[0])||void 0===t?void 0:t.status)||z)return;ve()}}}),(0,E.jsx)(m.ZP,{className:G["send-btn"],icon:(0,E.jsx)("i",{className:"iconfont icon-fasong2 c-white"}),disabled:!(null==F||!F.length)&&"done"!==(null==F||null===(w=F[0])||void 0===w?void 0:w.status)||z,onClick:ve})]})]})]})})]})}},49330:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(82100),o=n.n(i),a=n(29186),r=n.n(a),s=n(80619),l=n.n(s),c=n(47074),u=n.n(c),d=n(59301),f=n(98135),p=n(12563),h=n(8591),m="flex___eLcnP",g="color666___TiUhG",v=n(22415),w=n(37712),x=(f.Z.TextArea,function(e){l()(n,e);var t=u()(n);function n(e){var i;return o()(this,n),(i=t.call(this,e)).state={inputVisible:!1,EditInputIndex:-1},i}return r()(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.index,i=t.onAnswerChange,o=t.addChildAnswer,a=(t.exerciseIsPublish,t.answers);t.activeOptionErrorIndex,t.flex;console.log("----",a);var r=this.state,s=r.inputVisible,l=r.EditInputIndex;return(0,w.jsxs)("div",{className:m,children:[(0,w.jsxs)("div",{className:"".concat(g," mb5 mt6"),style:{flex:"0 0 90px"},children:["答案(填空",n+1,"):"]}),(0,w.jsxs)("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10},children:[null==a?void 0:a.map((function(t,o){return(0,w.jsx)(w.Fragment,{children:l!==o&&(null==t?void 0:t.length)>0?(0,w.jsx)(p.Z,{className:"edit-tag",closable:!0,onClose:function(t){t.preventDefault(),1===(null==a?void 0:a.length)&&0===o?e.props.deleteChildAnswermain(n,o):e.props.deleteChildAnswer(n,o)},children:(0,w.jsx)("span",{onDoubleClick:function(t){e.setState({EditInputIndex:o}),t.preventDefault()},children:t})},t):(0,w.jsx)(f.Z,{defaultValue:t,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:function(t){t.target.value.replaceAll(" ","").length<=0?h.ZP.info("内容不能为纯空格"):(i(n,o,t.target.value),e.setState({EditInputIndex:-1,inputVisible:!1}))}})})})),!s&&(0,w.jsxs)(p.Z,{className:"site-tag-plus",onClick:function(){o(n),e.setState({inputVisible:!0})},children:[(0,w.jsx)(v.Z,{})," 新增答案"]})]})]})}}]),n}(d.Component))},80801:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var i=n(82242),o=n.n(i),a=n(82100),r=n.n(a),s=n(29186),l=n.n(s),c=n(13720),u=n.n(c),d=n(80619),f=n.n(d),p=n(47074),h=n.n(p),m=n(85573),g=n.n(m),v=n(59301),w=n(70464),x=n(37712),b="▁",_=function(e){f()(n,e);var t=h()(n);function n(){var e;r()(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),g()(u()(e),"getChCountBeforeCursor",(function(e,t){for(var n=t.line,i=0,o=0;o<n;o++)i+=e.getLine(o).split(b).length-1;return i+=e.getLine(n).substring(0,t.ch).split(b).length-1})),g()(u()(e),"onCMBeforeChange",(function(t,n){var i=t.getRange(n.from,n.to),o=0;if(n.text.forEach((function(e){o+=e.split(b).length-1})),i&&-1!=i.indexOf(b)){var a=i.split(b).length-1,r=e.getChCountBeforeCursor(t,n.from);console.log("删除".concat(a,"个, 之前有").concat(r,"个,新增").concat(o,"个")),e.props.deleteEmptyDisabled?n.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(r,a,o)}else if(o){var s=e.getChCountBeforeCursor(t,n.from);console.log("新增".concat(o,"个,之前有").concat(s,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(s,0,o)}})),e}return l()(n,[{key:"render",value:function(){return(0,x.jsx)(w.Z,o()(o()({},this.props),{},{onCMBeforeChange:this.onCMBeforeChange}))}}]),n}(v.Component)},64244:function(e,t,n){"use strict";n.d(t,{t:function(){return f}});var i=n(82242),o=n.n(i),a=(n(59301),n(3113)),r="buttonFixed___vyq30",s="button___hxmYv",l="buttonWrap___uK8dl",c=n(92310),u=n.n(c),d=n(37712),f=function(e){var t=e.cancelText,n=void 0===t?"取消":t,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()(r,j),children:(0,d.jsxs)("div",{className:l,children:[v&&(0,d.jsx)(a.ZP,{size:"middle",className:"".concat(s," mr20"),onClick:_,children:n}),m&&(0,d.jsx)(a.ZP,o()(o()({size:"middle",type:"primary",className:"".concat(s," mr20"),loading:p,onClick:k},x),{},{children:c}))]})})}},68833:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),s=n(79800),l=n.n(s),c=n(59301),u="imageDimensions___a7crR",d="img___Kroat",f="fullWidth___c492T",p=n(92310),h=n.n(p),m=n(71418),g=n(2859),v=n(10032),w=n(11298),x=n(37712),b=function(e){var t=e.data,n=e.className,i=e.fullWidth,a=e.style,s=void 0===a?{}:a,p=e.onClose,b=e.onOk,_=e.showFullTools,y=e.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),j=(0,c.useState)(!1),C=l()(j,2),B=C[0],N=C[1],T=(0,c.useState)("正在加载中"),A=l()(T,2),P=A[0],E=A[1];(0,c.useEffect)((function(){null!=t&&t.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=t&&t.src&&L()}),[null==t?void 0:t.visible]);var L=function(){var e=r()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),E("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){G()},N(!1),E("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){var e=r()(o()().mark((function e(n){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),E("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||y){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&b(),e.next=13;break;case 12:null!=i&&i.id&&b(i);case 13:N(!1),E("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),G=function(){S.current=new g.hP(k.current),S.current.addEventListener("render",M),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!=t&&t.snapshotData&&S.current.restoreState(t.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,x.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,x.jsxs)("div",{className:h()(u,n,i?f:""),style:s,children:[(0,x.jsx)(m.Z,{spinning:B,tip:P,style:{position:"absolute"}}),(0,x.jsx)("img",{className:d,ref:k})]})})}},54430:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),o=n.n(i),a=n(79800),r=n.n(a),s=n(59301),l=n(57809),c=n(78241),u=n(3113),d=n(89780),f=n.n(d),p=(n(52886),n(21065),n(37712)),h=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,a=e.options,l=void 0===a?{}:a,c=(0,s.useRef)(),u=(0,s.useState)(),d=r()(u,2),h=d[0],m=d[1];return(0,s.useEffect)((function(){if(h){var e=function(e){var t=e.getValue();n&&n(t)};return h.on("change",e),function(){h.off("change",e)}}}),[h,n]),(0,s.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,s.useEffect)((function(){h&&(t===h.getValue()&&""!==t||setTimeout((function(){h.setValue(t||"")}),300))}),[h,t]),(0,s.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},l));m(e)}}),[c.current,h]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),a=r()(i,2),d=a[0],f=a[1];return(0,p.jsxs)(c.Z,o()(o()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(l.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:n,children:"取消"})]})]}))}},70464:function(e,t,n){"use strict";n.d(t,{Z:function(){return Be}});var i=n(91232),o=n.n(i),a=n(79800),r=n.n(a),s=n(85573),l=n.n(s),c=n(59301),u=n(89780),d=n.n(u),f=n(76374),p=(n(52886),n(6313),n(25717),n(99498),n(25419),n(67549),n(28388)),h=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(e){var t=e.onActionCallback,n=e.title,i=e.icon,o=e.actionName,a=e.className,r=void 0===a?"":a,s=e.children;return(0,h.jsxs)("a",{title:n,className:r,onClick:function(){t(o)},children:[(0,h.jsx)("i",{className:"".concat(i)}),s]})}var b=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,o=e.onActionCallback,a=e.fullScreen,r=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,t){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(x,v()(v()({},e),{},{onActionCallback:o})):(0,h.jsx)("span",{className:"v-line"})},t)})),n?(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,r&&(0,h.jsx)("li",{children:(0,h.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,h.jsx)("li",{children:l}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(x,{icon:"".concat(a?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:a?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:o})})]})},_=n(4420),y=n(78241),k=n(98135),S=n(3113),j={labelCol:{span:4},wrapperCol:{span:20}},C=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(y.Z,v()(v()({},j),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(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:n,children:"取消"})]})]}))},B=n(54430),N=n(8591),T=n(68682),A=y.Z.useForm,P={width:280,marginRight:10},E={labelCol:{span:5},wrapperCol:{span:19}},L=function(e){var t=e.callback,n=e.onCancel,i=A(),o=r()(i,1)[0],a=(0,c.useRef)();function s(e,t){-1!==e.status?o.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):N.ZP.error(e.message)}return(0,h.jsxs)(y.Z,v()(v()({form:o},E),{},{className:"upload-image-panel",onFinish:function(e){t(e,a.current)},style:{width:470,overflow:"hidden"},children:[(0,h.jsx)(y.Z.Item,{label:"图片地址",required:!0,children:(0,h.jsxs)("div",{className:"flex-container",children:[(0,h.jsx)(y.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,h.jsx)(k.Z,{style:P})}),(0,h.jsx)(M,{onFileChange:function(e){var t=e.target.files[0];a.current=t,G(t,s)}})]})}),(0,h.jsx)(y.Z.Item,{label:"图片描述",name:"alt",children:(0,h.jsx)(k.Z,{style:{width:264}})}),(0,h.jsxs)(y.Z.Item,{style:{textAlign:"right"},children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function M(e){var t=e.onFileChange;return(0,h.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,h.jsx)("input",{type:"file",onChange:t})]})}function G(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(T.KI,"/api/attachments.json")),i.send(n)}var Z=n(95237),I=n(68833),D=function(e){var t=e.callback,n=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 a=i.toDataURL("image/png");return(0,h.jsx)(Z.Z,{style:{height:"100vh"},children:(0,h.jsx)(I.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:a,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},O=n(7557),R=n.n(O),F=n(41498),W=n.n(F),H=n(37205),V=n.n(H),z=n(12378);function q(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(q,go.CommandHandler),q.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},q.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},q.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},q.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},q.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},q.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},q.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},q.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i<n.length-1;i++){var o=n[i],a=o.actualBounds.y+o.actualBounds.height+e;n[i+1].move(new go.Point(o.actualBounds.x,a))}t.commitTransaction("align Column")},q.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var t=this.diagram;t.startTransaction("align Row");var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i<n.length-1;i++){var o=n[i],a=o.actualBounds.x+o.actualBounds.width+e;n[i+1].move(new go.Point(a,o.actualBounds.y))}t.commitTransaction("align Row")},q.prototype.canRotate=function(e){var t=this.diagram;return null!==t&&!t.isReadOnly&&!t.isModelReadOnly&&!(t.selection.count<1)},q.prototype.rotate=function(e){var t;void 0===e&&(e=90),(t=this.diagram).startTransaction("rotate "+e.toString()),(t=this.diagram).selection.each((function(t){t instanceof go.Link||t instanceof go.Group||(t.angle+=e)})),t.commitTransaction("rotate "+e.toString())},q.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.max(n,t)}})),t.set(e,n)})),e.selection.each((function(e){q._assignZOrder(e,t.get(e.layer)+1)})),e.commitTransaction("pullToFront")},q.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.min(n,t)}})),t.set(e,n)})),e.selection.each((function(e){q._assignZOrder(e,t.get(e.layer)-1-q._findGroupDepth(e))})),e.commitTransaction("pushToBack")},q._assignZOrder=function(e,t,n){void 0===n&&(n=e),e.layer===n.layer&&(e.zOrder=t),e instanceof go.Group&&e.memberParts.each((function(e){q._assignZOrder(e,t+1,n)}))},q._findGroupDepth=function(e){if(e instanceof go.Group){var t=0;return e.memberParts.each((function(e){t=Math.max(t,q._findGroupDepth(e))})),t+1}return 0},q.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var t=e.lastInput;if("Up"===t.key||"Down"===t.key||"Left"===t.key||"Right"===t.key){var n=this.arrowKeyBehavior;if("none"===n)return;if("select"===n)return void this._arrowKeySelect();if("move"===n)return void this._arrowKeyMove();if("tree"===n)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},q.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(t){e.push(t)})),this.diagram.parts.each((function(t){e.push(t)})),e},q.prototype._arrowKeyMove=function(){var e=this.diagram,t=e.lastInput,n=0,i=0;if(t.control||t.meta)n=1,i=1;else if(null!==e.grid){var o=e.grid.gridCellSize;i=o.width,n=o.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-n)):"Down"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+n)):"Left"===t.key?e.move(new go.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===t.key&&e.move(new go.Point(e.actualBounds.x+i,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},q.prototype._arrowKeySelect=function(){var e=this.diagram,t=e.lastInput,n=null;"Up"===t.key?n=this._findNearestPartTowards(270):"Down"===t.key?n=this._findNearestPartTowards(90):"Left"===t.key?n=this._findNearestPartTowards(180):"Right"===t.key&&(n=this._findNearestPartTowards(0)),null!==n&&(t.shift?n.isSelected=!0:t.control||t.meta?n.isSelected=!n.isSelected:e.select(n))},q.prototype._findNearestPartTowards=function(e){var t=this.diagram.selection.first();if(null===t)return null;for(var n=t.actualBounds.center,i=this._getAllParts(),o=1/0,a=t,r=0;r<i.length;r++){var s=i[r];if(s!==t&&s.canSelect()){var l=s.actualBounds.center,c=n.directionPoint(l),u=this._angleCloseness(c,e);if(u<=45){var d=n.distanceSquaredPoint(l);(d*=1+Math.sin(u*Math.PI/180))<o&&(o=d,a=s)}}}return a},q.prototype._angleCloseness=function(e,t){return Math.min(Math.abs(t-e),Math.min(Math.abs(t+360-e),Math.abs(t-360-e)))},q.prototype._arrowKeyTree=function(){var e=this.diagram,t=e.selection.first();if(t instanceof go.Node){var n=e.lastInput;if("Right"===n.key)if(t.isTreeLeaf);else if(t.isTreeExpanded){null!==(o=this._sortTreeChildrenByY(t).first())&&e.select(o)}else e.commandHandler.canExpandTree(t)&&e.commandHandler.expandTree(t);else if("Left"===n.key){if(!t.isTreeLeaf&&t.isTreeExpanded)e.commandHandler.canCollapseTree(t)&&e.commandHandler.collapseTree(t);else null!==(a=t.findTreeParentNode())&&e.select(a)}else if("Up"===n.key){if(null!==(a=t.findTreeParentNode()))if((s=(r=this._sortTreeChildrenByY(a)).indexOf(t))>0){for(var i=r.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(a)}else if("Down"===n.key){var o;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(o=this._sortTreeChildrenByY(t).first())&&e.select(o);else for(;null!==t;){var a,r,s;if(null===(a=t.findTreeParentNode()))break;if((s=(r=this._sortTreeChildrenByY(a)).indexOf(t))<r.length-1){e.select(r.elt(s+1));break}t=a}}var l=e.selection.first();null!==l&&e.scrollToRect(l.actualBounds)}},q.prototype._sortTreeChildrenByY=function(e){var t=(new go.List).addAll(e.findTreeChildrenNodes());return t.sort((function(e,t){var n=e.location,i=t.location;return n.y<i.y?-1:n.y>i.y?1:n.x<i.x?-1:n.x>i.x?1:0})),t},q.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},q.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(q.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(q.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var U=q,J=(n(47742),n(85160)),K=n(43418),Y=n(43604),X=n(10032),Q="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=z;var ee=function(e){var t=e.onCancel,n=e.callback,i=(0,c.useRef)(),o=(0,c.useRef)(),a=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),u=(0,c.useState)(0),d=r()(u,2),f=d[0],p=d[1],m=function(){var e=W()(R()().mark((function e(){var t,o;return R()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.current.makeImage(),e.next=3,(0,X.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:o=e.sent,n({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:l,className:s.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(K.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!f,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(Z.Z,{children:[(0,h.jsx)(Y.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(Y.Z,{onClick:function(){s.current=!s.current,p(f+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,h.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,h.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,h.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,h.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,h.jsx)("div",{style:{height:"calc(100% - 50px)"},className:Q,ref:a})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(J.FI,{initDiagram:function(){var e=z.GraphObject.make,t="#ff3333",n="#3358ff",r="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",f="#fffcd5",p="#d5ebff",h="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function x(t,n){var i=function(e,n){e.handled=!0,e.diagram.model.commit((function(i){var o=n.part.adornedPart,a=(new z.Point).setRectSpot(o.actualBounds,t);a.subtract(o.location),a.scale(2,2),a.x+=130*Math.sign(a.x),a.y+=130*Math.sign(a.y),a.add(o.location),a.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(o.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(o.data)),i.addNodeData(r);var s={from:o.key,to:i.getKeyForNodeData(r)};i.addLinkData(s);var l=e.diagram.findNodeForData(r);l.location=a,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(z.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(z.Spot.Top)||t.equals(z.Spot.Bottom)?25:18,height:t.equals(z.Spot.Top)||t.equals(z.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:i,contextClick:i})}function b(t){return e(z.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function _(e,t){return function(n,i){n.handled=!0,n.diagram.model.commit((function(n){n.set(i.part.adornedPart.data,e,t)}))}}function y(t,n){return n||(n="color"),e(z.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:_(n,t),contextClick:_(n,t)})}function k(){return[e("ContextMenuButton",e(z.Panel,"Horizontal",y(u,"fill"),y(f,"fill"),y(p,"fill"),y(h,"fill"))),e("ContextMenuButton",e(z.Panel,"Horizontal",y(g,"fill"),y(v,"fill"),y(m,"fill"),y(w,"fill")))]}function S(){return[e("ContextMenuButton",e(z.Panel,"Horizontal",y(d),y(r),y(n),y(t))),e("ContextMenuButton",e(z.Panel,"Horizontal",y(u),y(s),y(l),y(c)))]}function j(t,n){return n||(n="thickness"),e(z.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:_(n,t),contextClick:_(n,t)})}function C(t,n){return n||(n="dash"),e(z.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:_(n,t),contextClick:_(n,t)})}function B(){return[e("ContextMenuButton",e(z.Panel,"Horizontal",j(1),j(2),j(3),j(4))),e("ContextMenuButton",e(z.Panel,"Horizontal",C(null),C([2,4]),C([4,4])))]}function N(t,n){return n||(n="figure"),e(z.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:_(n,t),contextClick:_(n,t)})}function T(t){return e(z.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function A(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(z.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:_("dir",t),contextClick:_("dir",t)})}function P(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",z.Spot.stringify(z.Spot.AllSides)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(z.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var i=0,o=z.Spot.RightSide;t.equals(z.Spot.Top)?(i=270,o=z.Spot.TopSide):t.equals(z.Spot.Left)?(i=180,o=z.Spot.LeftSide):t.equals(z.Spot.Bottom)&&(i=90,o=z.Spot.BottomSide),n||(i-=180);var a=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",z.Spot.stringify(o)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(z.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:a,contextClick:a})}return i.current=new z.Diagram(o.current,{padding:20,grid:e(z.Panel,"Grid",e(z.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(z.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(U),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(z.Node,"Auto",{locationSpot:z.Spot.Center,locationObjectName:"SHAPE",desiredSize:new z.Size(120,60),minSize:new z.Size(40,40),resizable:!0,resizeCellSize:new z.Size(10,10),rotatable:!0},new z.Binding("location","loc",z.Point.parse).makeTwoWay(z.Point.stringify),new z.Binding("desiredSize","size",z.Size.parse).makeTwoWay(z.Size.stringify),e(z.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:z.Spot.AllSides,toSpot:z.Spot.AllSides},new z.Binding("figure"),new z.Binding("fill"),new z.Binding("stroke","borderColor"),new z.Binding("strokeWidth","thickness"),new z.Binding("strokeDashArray","dash")),e(z.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(z.TextBlock,{margin:1,textAlign:"center",overflow:z.TextBlock.OverflowEllipsis,editable:!0},new z.Binding("text").makeTwoWay(),new z.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(z.Panel,"Vertical",{maxSize:new z.Size(200,NaN)},e(z.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new z.Binding("text")),e(z.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new z.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(z.Adornment,"Spot",e(z.Placeholder,{padding:10}),x(z.Spot.Top,"TriangleUp"),x(z.Spot.Left,"TriangleLeft"),x(z.Spot.Right,"TriangleRight"),x(z.Spot.Bottom,"TriangleDown"),b({alignment:new z.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(z.Panel,"Horizontal",N("Rectangle"),N("RoundedRectangle"),N("Ellipse"),N("Diamond"))),e("ContextMenuButton",e(z.Panel,"Horizontal",N("Parallelogram2"),N("ManualOperation"),N("Procedure"),N("Cylinder1"))),e("ContextMenuButton",e(z.Panel,"Horizontal",N("Terminator"),N("CreateRequest"),N("Document"),N("TriangleDown"))),k(),S(),B()),i.current.groupTemplate=e(z.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:z.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new z.Binding("location","loc",z.Point.parse).makeTwoWay(z.Point.stringify),e(z.Panel,"Auto",{name:"BODY"},e(z.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:z.Spot.AllSides,toSpot:z.Spot.AllSides},new z.Binding("fill"),new z.Binding("stroke","color"),new z.Binding("strokeWidth","thickness"),new z.Binding("strokeDashArray","dash")),e(z.Placeholder,{background:"transparent",margin:20})),e(z.TextBlock,{alignment:z.Spot.Top,alignmentFocus:z.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new z.Binding("text"),new z.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(z.Adornment,"Spot",e(z.Panel,"Auto",e(z.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(z.Placeholder,{margin:1.5})),b({alignment:z.Spot.TopRight,alignmentFocus:z.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),S(),B()),i.current.linkTemplate=e(z.Link,{layerName:"Foreground",routing:z.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new z.Binding("fromSpot","fromSpot",z.Spot.parse),new z.Binding("toSpot","toSpot",z.Spot.parse),new z.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new z.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new z.Binding("points").makeTwoWay(),e(z.Shape,{strokeWidth:2},new z.Binding("stroke","color"),new z.Binding("strokeWidth","thickness"),new z.Binding("strokeDashArray","dash")),e(z.Shape,{segmentIndex:0,segmentOffset:new z.Point(15,0),segmentOrientation:z.Link.OrientAlong,alignmentFocus:z.Spot.Right,figure:"circle",width:10,strokeWidth:0},new z.Binding("fill","color"),new z.Binding("visible","dir",(function(e){return 1===e}))),e(z.Shape,{segmentIndex:-1,segmentOffset:new z.Point(-10,6),segmentOrientation:z.Link.OrientPlus90,alignmentFocus:z.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new z.Binding("fill","color"),new z.Binding("visible","dir",(function(e){return e>=1})),new z.Binding("width","thickness",(function(e){return 7+3*e})),new z.Binding("height","thickness",(function(e){return 7+3*e})),new z.Binding("segmentOffset","thickness",(function(e){return new z.Point(-15,4+1.5*e)}))),e(z.Shape,{segmentIndex:0,segmentOffset:new z.Point(15,-6),segmentOrientation:z.Link.OrientMinus90,alignmentFocus:z.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new z.Binding("fill","color"),new z.Binding("visible","dir",(function(e){return 2===e})),new z.Binding("width","thickness",(function(e){return 7+3*e})),new z.Binding("height","thickness",(function(e){return 7+3*e})),new z.Binding("segmentOffset","thickness",(function(e){return new z.Point(-15,4+1.5*e)}))),e(z.TextBlock,{alignmentFocus:new z.Spot(0,1,-4,0),editable:!0},new z.Binding("text").makeTwoWay(),new z.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(z.Adornment,e(z.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:T(2)},new z.Binding("pathPattern","thickness",T)),b({alignmentFocus:new z.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",S(),B(),e("ContextMenuButton",e(z.Panel,"Horizontal",A(0),A(1),A(2))),e("ContextMenuButton",e(z.Panel,"Horizontal",e(z.Panel,"Spot",P(!1),E(z.Spot.Top,!1),E(z.Spot.Left,!1),E(z.Spot.Right,!1),E(z.Spot.Bottom,!1)),e(z.Panel,"Spot",{margin:new z.Margin(0,0,0,2)},P(!0),E(z.Spot.Top,!0),E(z.Spot.Left,!0),E(z.Spot.Right,!0),E(z.Spot.Bottom,!0))))),new z.Palette(a.current,{maxSelectionCount:1,linkTemplate:e(z.Link,{locationSpot:z.Spot.Center,selectionAdornmentTemplate:e(z.Adornment,"Link",{locationSpot:z.Spot.Center},e(z.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(z.Shape,{toArrow:"Standard",stroke:null}))},{routing:z.Link.AvoidsNodes,curve:z.Link.JumpOver,corner:5,toShortLength:4},new z.Binding("points"),e(z.Shape,{isPanelMain:!0,strokeWidth:2}),e(z.Shape,{toArrow:"Standard",stroke:null})),model:new z.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(V()(z.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(z.Node,"Auto",{locationSpot:z.Spot.Center},new z.Binding("location","location",z.Point.parse).makeTwoWay(z.Point.stringify),e(z.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 z.Binding("stroke").makeTwoWay(),new z.Binding("fill").makeTwoWay(),new z.Binding("figure")),e(z.TextBlock,{margin:new z.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new z.Size(16,16),maxSize:new z.Size(10,NaN),textAlign:"center",editable:!0},new z.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(z.Panel,"Grid",e(z.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(z.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:"保存到编辑器"})})]})})})},te=n(5112),ne=n(94001),ie=te.ZP.Group,oe={margin:"0 8px"},ae=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(y.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:oe,children:"单元格数:"}),(0,h.jsx)("span",{style:oe,children:"行数"}),(0,h.jsx)(y.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(ne.Z,{})}),(0,h.jsx)("span",{style:oe,children:"列数"}),(0,h.jsx)(y.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(ne.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:oe,children:"对齐方式:"}),(0,h.jsx)(y.Z.Item,{name:"align",children:(0,h.jsxs)(ie,{children:[(0,h.jsx)(te.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(te.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(te.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(te.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(S.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},re=n(78673),se=n(77254),le=n.n(se),ce=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,o=e.height,a=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=r()(u,2),f=d[0],p=d[1],m=(0,c.useRef)({id:s,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(){l.current=new(le())(m.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return a&&a(e),e};return(0,c.useEffect)((function(){m.current.appName=f?"3D":"graphing",l.current.inject("applet_container")}),[f]),(0,c.useEffect)((function(){p(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,h.jsxs)(Z.Z,{align:"middle",children:[(0,h.jsx)(Y.Z,{flex:1,children:(0,h.jsx)(re.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:f,onChange:function(e){return p(e)}})}),(0,h.jsx)(Y.Z,{children:(0,h.jsx)(S.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ue=n(30980),de=n(22107),fe="link",pe="upload-image",he="add-flowchart",me="draw-image",ge="code-block",ve="add-table",we="------------",xe={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},be=n(54172);var _e="@▁▁@",ye=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Se=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",je=l()(l()({},Se+"-B","bold"),Se+"-I","italic"),Ce=l()(l()(l()(l()(l()(l()(l()(l()({},fe,"添加链接"),ge,"添加代码块"),pe,"添加图片"),me,"添加画图"),he,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Be=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,a=e.width,s=void 0===a?"100%":a,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,P=void 0===A?"markdown-editor-id":A,E=e.showResizeBar,M=void 0!==E&&E,Z=e.noStorage,I=void 0!==Z&&Z,O=e.showNullButton,R=void 0!==O&&O,F=e.showNullProgramButton,W=void 0!==F&&F,H=e.hidetoolBar,V=void 0!==H&&H,z=e.fullScreen,q=void 0!==z&&z,U=e.onBlur,J=e.onCMBeforeChange,Y=e.onFullScreen,X=e.className,Q=void 0===X?"":X,$=e.disablePaste,te=void 0!==$&&$,ne=e.disabled,ie=void 0!==ne&&ne,oe=e.disabledFill,re=void 0!==oe&&oe,se=e.placeholder,le=void 0===se?"":se,we=e.values,Se=void 0===we?"":we,Be=e.extraUse,Ne=(0,c.useState)(null),Te=r()(Ne,2),Ae=Te[0],Pe=Te[1],Ee=(0,c.useState)(n),Le=r()(Ee,2),Me=Le[0],Ge=Le[1],Ze=(0,c.useState)(k),Ie=r()(Ze,2),De=Ie[0],Oe=Ie[1],Re=(0,c.useState)(q),Fe=r()(Re,2),We=Fe[0],He=Fe[1],Ve=(0,c.useState)(""),ze=r()(Ve,2),qe=ze[0],Ue=ze[1],Je=(0,c.useState)(0),Ke=r()(Je,2),Ye=Ke[0],Xe=Ke[1],Qe=(0,c.useState)(g),$e=r()(Qe,2),et=$e[0],tt=$e[1],nt=(0,c.useState)(!1),it=r()(nt,2),ot=(it[0],it[1]),at=(0,c.useState)(0),rt=r()(at,2),st=rt[0],lt=rt[1],ct=(0,c.useState)(0),ut=r()(ct,2),dt=ut[0],ft=ut[1],pt=(0,c.useRef)(),ht=(0,c.useRef)(),mt=(0,c.useRef)(),gt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Ge(Se),null==Ae||Ae.setValue(Se),window.scrollTo(0,e)}),[Se]),(0,c.useEffect)((function(){null==Y||Y(We)}),[We]),(0,c.useEffect)((function(){if(pt.current){var e=function(e,n){if(!te){var i=n.clipboardData;if(i){var o=i.types.toString(),a=i.items;if("Files"===o||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==T)return;try{var r,s=a[1];"file"===(null===(r=a[0])||void 0===r?void 0:r.kind)&&(s=a[0]);var l=s.getAsFile(),c=l.name.split(".").pop();G(l,(function(e){var n,i,o;e.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection(".concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="'.concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==l||null===(o=l.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?t.replaceSelection('<a href="'.concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):ye.includes(c)?t.replaceSelection('<a href="'.concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):t.replaceSelection("[".concat(l.name,"](").concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){N.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=d().fromTextArea(pt.current,{mode:T,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",le):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),o=n.getLine(i.line),a=o.charAt(i.ch-1),r=o.lastIndexOf("@▁@",i.ch),s=o.lastIndexOf("@▁▁@",i.ch),l=r>s?r:s,c=r>s?3:4;if(-1===_e.indexOf(a))return null;if(console.log("change1:",t,e,o,i,l,r,s,a),l>=0&&i.ch-l<5){var u=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);n&&t.preventDefault()}})),y&&t.focus(),t.on("paste",e),ie&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Pe(t),function(){t.off("paste",e)}}}),[]);var vt=(0,c.useCallback)((function(){ht.current}),[et,ht,We]);(0,c.useEffect)((function(){if(Ae){var e=function(){var e=new f.Z((function(e){var t,n=o()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vt(),Ae.setSize("100%","100%"),Ae.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(pt.current.parentElement),e}();return function(){var t,n;null!==(t=pt.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=pt.current)||void 0===n?void 0:n.parentElement)}}}),[Ae,vt]),(0,c.useEffect)((function(){if(Ae){for(var e=[],t=function(){var t=r()(i[n],2),o=t[0],a=t[1],s=l()({},o,(function(){wt(a)}));e.push(s),Ae.addKeyMap(s)},n=0,i=Object.entries(je);n<i.length;n++)t();return function(){for(var t=0,n=e;t<n.length;t++){var i=n[t];Ae.removeKeyMap(i)}}}}),[Ae]),(0,c.useEffect)((function(){q!==We&&He(q)}),[q]),(0,be.Z)((function(){if(!I&&Ye>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Ye+1e4&&(!t||t!==Me)&&(window.sessionStorage.setItem(P,Me),ot(!0))}}),1e4),(0,c.useEffect)((function(){Oe(k)}),[Ae,k]),(0,c.useEffect)((function(){Ae&&y&&Ae.focus()}),[Ae,y]),(0,c.useEffect)((function(){if(De&&Ae){var e=function(e){var t=e.target;if(gt.current){var n=t.scrollTop/t.scrollHeight;gt.current.scrollTop=gt.current.scrollHeight*n}},t=Ae.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ae,De]),(0,c.useEffect)((function(){if(Ae&&J){var e=function(e,t){J(e,t)};return Ae.on("beforeChange",e),function(){Ae.off("beforeChange",e)}}}),[Ae,J]),(0,c.useEffect)((function(){if(Ae&&U){var e=function(){U(Ae.getValue())};return Ae.on("blur",e),function(){Ae.off("blur",e)}}}),[Ae,U]),(0,c.useEffect)((function(){if(Ae){var e=function(e,t){var n=e.getValue();Ge(n),Xe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(W?i(n,kt(n)):i(n))};return Ae.on("change",e),function(){Ae.off("change",e)}}}),[Ae,i]),(0,c.useEffect)((function(){if(Ae)if(null==n)Ae.setValue(""),Ge("");else{var e=window.scrollY||window.pageYOffset;n!==Ae.getValue()&&(Ae.setValue(n),Ge(n),Ae.setCursor(ie?1:Ae.lineCount(),0),window.scrollTo(0,e))}}),[Ae,n]);var wt=(0,c.useCallback)((function(e){var t=Ae.getCursor(),n=Ae.getSelection(),i=n.split("\n");switch(e){case"bold":return Ae.replaceSelection("**"+n+"**"),""===n&&Ae.setCursor(t.line,t.ch+2),Ae.focus();case"italic":return Ae.replaceSelection("*"+n+"*"),""===n&&Ae.setCursor(t.line,t.ch+1),Ae.focus();case"code":return Ae.replaceSelection("`"+n+"`"),""===n&&Ae.setCursor(t.line,t.ch+1),Ae.focus();case"inline-latex":return Ue("inline-latex"),Ae.focus();case"latex":return Ae.replaceSelection("```latex\n"+n+"\n```"),Ae.setCursor(t.line+1,n.length+1),Ae.focus();case"line-break":return Ae.replaceSelection("<br/>\n"),Ae.focus();case"list-ul":return""===n?Ae.replaceSelection("- "+n):Ae.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ae.focus();case"list-ol":return""===n?Ae.replaceSelection("1. "+n):Ae.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ae.focus();case"add-null-ch":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("▁"),Ae.focus();case"add-signal":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("@▁@"),Ae.focus();case"add-multiple":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection(_e),Ae.focus();case"inster-template-1":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ae.focus();case"eraser":return Ae.setValue(""),Ae.focus();case"trigger-watch":return Oe(!De),Ae.focus();case"trigger-full-screen":return He(!We),Ae.focus();case fe:return void Ue(fe);case ge:return void Ue(ge);case pe:return void Ue(pe);case me:return void Ue(me);case"maths-latex":return void Ue("maths-latex");case he:return void Ue(he);case ve:return void Ue(ve);default:throw new Error}}),[Ae,De,We]),xt=(0,c.useCallback)((function(e,t){var n,i,o,a,r;switch(Ue(""),qe){case fe:var s=e.title,l=e.link;return Ae.replaceSelection("[".concat(s,"](").concat(l,")")),Ae.focus();case ge:var c=e.language,u=e.content;return Ae.replaceSelection(["```"+c,u,"```"].join("\n")),Ae.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);G(new Blob([f],{type:"image/png"}),(function(e){e.id?Ae.replaceSelection(".concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":Ae.replaceSelection("`$$"+e+"$$`");break;case pe:case me:case"add-flowchart":var h=e.src,m=e.alt,g=t,v=null==g||null===(n=g.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(i=n.pop)||void 0===i?void 0:i.call(n);return(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("image"))>-1||null==g||!g.type?m?Ae.replaceSelection(".concat(h,' "').concat(m,'" )')):Ae.replaceSelection("")):(null==g||null===(a=g.type)||void 0===a?void 0:a.indexOf("video"))>-1?Ae.replaceSelection('<video width="100%" controls src="'.concat(de.Z.API_SERVER).concat(h,'"></video>')):(null==g||null===(r=g.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Ae.replaceSelection('<a href="'.concat(de.Z.API_SERVER).concat(h,"?type=").concat(g.type,'&disposition=inline" target="_blank">').concat(g.name,"</a>")):ye.includes(v)?Ae.replaceSelection('<a href="'.concat(de.Z.API_SERVER).concat(h,'?type=office&disposition=inline" target="_blank">').concat(g.name,"</a>")):Ae.replaceSelection("[".concat(g.name,"](").concat(de.Z.API_SERVER).concat(h,")")),Ae.focus();case ve:for(var w=e.row,x=e.col,b=e.align,_="\n",y=0;y<w;y++){for(var k=[],S=[],j=0;j<x;j++)1===y&&S.push(xe[b]),k.push(" ");1===y&&(_+="| ".concat(S.join(" | ")," |\n")),_+="| ".concat(k.join(1===x?"":" | ")," |\n")}return Ae.replaceSelection(_+"\n"),Ae.focus();default:throw new Error}}),[Ae,qe]),bt=(0,c.useMemo)((function(){switch(qe){case fe:return(0,h.jsx)(C,{callback:xt,onCancel:_t});case ge:return(0,h.jsx)(B.Z,{callback:xt,onCancel:_t});case pe:return(0,h.jsx)(L,{callback:xt,onCancel:_t});case he:return(0,h.jsx)(ee,{callback:xt,onCancel:_t});case ve:return(0,h.jsx)(ae,{callback:xt,onCancel:_t});case"maths-latex":return(0,h.jsx)(ce,{showSaveButton:!0,callback:xt});case"inline-latex":return(0,h.jsx)(ue.Z,{showSaveButton:!0,callback:xt});default:return null}}),[qe]);function _t(){Ue("")}(0,c.useEffect)((function(){if(mt.current){var e=function(e){o=!0,a=e.pageY},t=function(){o=!1},n=function(e){if(o){var t=e.pageY-a;t<0&&(t=0),t>300&&(t=300),tt(g+t+"px")}},i=mt.current,o=!1,a=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ae,mt]),(0,c.useEffect)((function(){tt(g)}),[g]);var yt={width:ke(s),height:ke(et)},kt=((0,c.useMemo)((function(){if(Ye){var e=new Date(Ye),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Ye]),function(e){var t=[];if(W){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){Ce[qe]&&qe!==me&&qe!==he&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;lt(t),ft(n)}),0)}),[qe]);var St=function(e,t,n,i){var o=document.body.clientHeight,a=document.body.clientWidth;return!(e<20&&n>e||e>a-20&&n<e||t<20&&i>t||t>o-20&&i<t)||(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:ht,children:(0,h.jsxs)("div",{className:"markdown-editor-container ".concat(Q," ").concat(De?"on-preview":""," ").concat(w?"mini":""," ").concat(We?"full-screen":""),style:yt,children:[(0,h.jsx)(b,{insertTemp:S,watch:De,fullScreen:We,showNullButton:R,showNullProgramButton:W,onActionCallback:wt,hidetoolBar:V,extraUse:Be}),(0,h.jsxs)("div",{className:"markdown-editor-body",children:[(0,h.jsx)("div",{className:"codemirror-container",children:(0,h.jsx)("textarea",{ref:pt,placeholder:le})}),De?(0,h.jsxs)("div",{ref:gt,className:"preview-container",children:["stex"===T&&(0,h.jsx)(m,{value:Me}),"stex"!==T&&(0,h.jsx)(p.Z,{disabledFill:re,showProgramFill:W,value:Me})]}):null]})]})}),M?(0,h.jsx)("a",{ref:mt,className:"editor-resize"}):null,qe===me&&(0,h.jsx)(D,{callback:xt,onCancel:_t}),qe===he&&(0,h.jsx)(ee,{callback:xt,onCancel:_t}),(0,h.jsx)(_.Z,{children:Ce[qe]&&qe!==me&&qe!==he?(0,h.jsx)(K.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:st,top:dt},title:(0,h.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var t=e.clientX-st,n=e.clientY-dt;document.body.onmousemove=function(e){var i=e.clientX-t,o=e.clientY-n,a=document.getElementsByClassName("markdown-popup-form")[0],r=window.innerWidth-a.offsetWidth,s=window.innerHeight-a.offsetHeight;i=Math.max(0,Math.min(i,r)),o=Math.max(0,Math.min(o,s)),St(e.clientX,e.clientY,t,n)&&(lt(i),ft(o))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:Ce[qe]}),open:!0,onCancel:_t,footer:null,destroyOnClose:!0,width:qe===he?"1200px":null,height:qe===he?"80vh":null,className:"markdown-popup-form",children:bt}):null})]})}},4420:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(82100),o=n.n(i),a=n(29186),r=n.n(a),s=n(80619),l=n.n(s),c=n(47074),u=n.n(c),d=n(59301),f=n(4676),p=function(e){l()(n,e);var t=u()(n);function n(e){var i;o()(this,n),i=t.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return r()(n,[{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)}}]),n}(d.Component)},54172:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var i=n(59301);function o(e,t){var n=(0,i.useRef)();(0,i.useEffect)((function(){n.current=e})),(0,i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},29431:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return he}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),s=n(82242),l=n.n(s),c=n(79800),u=n.n(c),d=n(59301),f=n(75102),p=n(99313),h=n(78241),m=n(8591),g=n(3113),v=n(43418),w=n(5112),x=n(98135),b=n(95237),_=n(43604),y=n(70464),k=n(28388),S=n(59708),j=n(17047),C=n(57809),B=n(11298),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=n(37205),A=n.n(T),P=n(6848),E="wrap___zDMCt",L="modal___qzGUK",M="titleWrap___k3brc",G="required___h7eRD",Z="title___cMJHQ",I="colorGray___bSYRQ",D="choiceWrap___JBxMa",O="answer___LyOVU",R="activeAnswer___Jr8Iu",F="deleteIcon___xZU5J",W="addIcon___b8dJ9",H="editorWrap___LcO9S",V="htmlWrap___TI8l7",z="radio___xZG0G",q="color333___INjEp",U="color999___TucNz",J=n(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,t){var n=e.editData,i=(0,d.useState)(["","","",""]),o=u()(i,2),a=o[0],r=o[1],s=(0,d.useState)(),l=u()(s,2),c=l[0],f=l[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,t;if(n){_(null==n?void 0:n.subject),r(null==n||null===(e=n.choose_contents)||void 0===e?void 0:e.map((function(e){return e.option_name})));var i=[];null==n||null===(t=n.choose_contents)||void 0===t||t.map((function(e,t){e.right_key&&i.push(t)})),v(i)}}),[n]),(0,d.useImperativeHandle)(t,(function(){return{onSave:S,Clear:j}}));var S=function(){if(!b)return m.ZP.info("请您输入题干"),!1;var e=a.findIndex((function(e){return!e}));if(e>-1)return m.ZP.info("请先输入 ".concat(K[e]," 选项的内容")),!1;if(console.log(a,"questionChoiceList"),function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=A()(e).sort(),n=0;n<t.length-1;n++)if(t[n]==t[n+1])return!0;return!1}(a))return m.ZP.info("选项已重复"),!1;if(!g.length)return m.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;var t=a.map((function(e,t){return{choice_text:e,is_answer:g.includes(t)?1:0}}));return{name:b,choices:t}},j=function(){r(["","","",""]),_(""),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:"点击选项可设置正确答案"})]})]}),a.map((function(e,t){return(0,J.jsxs)("div",{className:D,children:[(0,J.jsx)(P.Z,{title:"点击设置为标准答案",placement:"left",children:(0,J.jsx)("div",{className:"".concat(O," ").concat(g.includes(t)?R:""),onClick:function(){g.includes(t)?v(g.filter((function(e){return e!==t}))):v([].concat(A()(g),[t]))},children:K[t]})}),(0,J.jsx)("div",{className:H,children:c===t?(0,J.jsx)(y.Z,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){a[t]=e,r(a)}}):(0,J.jsx)("div",{className:V,onClick:function(){return f(t)},children:(0,J.jsx)(k.Z,{value:e})})}),t>1&&(0,J.jsx)(P.Z,{title:"删除",children:(0,J.jsx)("i",{className:"".concat(F," iconfont icon-htmal5icon19"),onClick:function(){return r(a.filter((function(e,n){return n!==t})))}})}),t<7&&t===a.length-1&&(0,J.jsx)(P.Z,{title:"新增参考答案",children:(0,J.jsx)("i",{className:"".concat(W," iconfont icon-roundaddfill ml6"),onClick:function(){return r([].concat(A()(a),[""]))}})})]},t)})),(0,J.jsx)("div",{className:"mt10 mb10",children:(0,J.jsx)("span",{className:"c-grey-999",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"})})]})},X=(0,d.forwardRef)(Y),Q=n(24905),$=n(80801),ee=n(49330),te=function(e,t){var n=e.editData,i=(0,d.useState)(""),o=u()(i,2),a=o[0],r=o[1],s=(0,d.useState)([]),l=u()(s,2),c=l[0],f=l[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(){n&&(r(null==n?void 0:n.subject),y(null==n?void 0:n.is_ordered),C(!0))}),[n]),(0,d.useEffect)((function(){var e;if(j){var t=null==n||null===(e=n.standard_answers)||void 0===e?void 0:e.map((function(e){return e.text}));f(t),C(!1)}}),[j]),(0,d.useImperativeHandle)(t,(function(){return{onSave:N,Clear:T}})),console.log(c,"answerList");var N=function(){var e=[],t=!1;return c.forEach((function(n,i){e.push({position:i+1,answer_text:[]}),n.forEach((function(n,o){e[i].answer_text.push(n),n&&(0,B.eR)(n,1e4)||(w("".concat(i,"-").concat(o)),m.ZP.info(n?"答案不能超过10000字符":"答案:不能为空"),t=!0)}))})),!t&&((null==e?void 0:e.length)>50?(m.ZP.warning("填空题标准答案不能为空/不能超过50个!"),!1):{name:a,standard_answers:e,is_ordered:_})},T=function(){r(""),f([]),y(!1)},P=function(e,t,n){w("");var i=c.slice();i[e][t]=n,f(i)},I=function(e){var t=c.slice();t[e]=[].concat(A()(t[e]),[""]),f(t)},D=function(e,t){var n=c.slice();if(!n[e][t])return n[e]=n[e].filter((function(e,n){return n!==t})),void f(n);v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:L,onOk:function(){n[e]=n[e].filter((function(e,n){return n!==t})),f(n)}})},O=function(e){v.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:L,onOk:function(){var t=c.slice();t=c.filter((function(t,n){return e!==n})),f(t)}})};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:a,onChange:function(e){return r(e)},showNullButton:!0,onPlaceholderChange:function(e,t,n){var i=c.slice();if(t&&i.splice(e,t),n)for(var o=0;o<n;o++)i.splice(e+o,0,[""]);f(i)}})}),(0,J.jsx)("div",{className:"mt20",children:c.map((function(e,t){return(0,J.jsx)(ee.Z,{answers:e,index:t,is_md:!0,activeOptionErrorIndex:g,onAnswerChange:P,addChildAnswer:I,deleteChildAnswer:D,deleteChildAnswermain:O},t)}))}),(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:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})})]})},ne=(0,d.forwardRef)(te),ie=function(e,t){var n=e.editData,i=(0,d.useState)(),o=u()(i,2),a=o[0],r=o[1],s=(0,d.useState)(""),l=u()(s,2),c=l[0],f=l[1];(0,d.useEffect)((function(){n&&(f(null==n?void 0:n.subject),r("正确"===(null==n?void 0:n.standard_answer)?"0":"1"))}),[n]),(0,d.useImperativeHandle)(t,(function(){return{onSave:p,Clear:h}}));var p=function(){return c?a?{name:c,choices:[{choice_text:"正确",is_answer:"0"===a?1:0},{choice_text:"错误",is_answer:"1"===a?1:0}]}:(m.ZP.info("请先点击选择本判断题的正确选项"),!1):(m.ZP.info("请您输入题干"),!1)},h=function(){f(""),r("")};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:a,onChange:function(e){return r(e.target.value)},children:[(0,J.jsx)(w.ZP.Button,{value:"0",className:"".concat(z," mr40"),children:"正确"}),(0,J.jsx)(w.ZP.Button,{value:"1",className:z,children:"错误"})]})]})},oe=(0,d.forwardRef)(ie),ae=n(35338),re=function(e){var t=e.visible,n=void 0!==t&&t,i=e.is_published,a=e.editData,s=e.onOk,c=e.onCancel,f=(0,ae.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(){n&&a&&(T.setFieldsValue(l()({},a)),k(G[a.difficult]))}),[n]);var G={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},Z=function(){var e=r()(o()().mark((function e(){var t,i,a,r,s,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.current.onSave();case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",!1);case 5:if(1!==n){e.next=11;break}return i="",a={cnt:null==t?void 0:t.choices.map((function(e){return e.choice_text}))},null==(r={answer:null==t?void 0:t.choices.map((function(e){return e.is_answer}))})||r.answer.map((function(e,t){e&&(i+=B.oV[t])})),e.abrupt("return",{challenge_choose:{subject:t.name,answer:E.task_pass,standard_answer:i,score:E.score,difficult:E.difficult},question:a,choice:r});case 11:if(2!==n){e.next=13;break}return e.abrupt("return",{challenge_choose:{subject:t.name,answer:E.task_pass,score:E.score,difficult:E.difficult},blank_answers:null==t?void 0:t.standard_answers,is_ordered:null==t?void 0:t.is_ordered});case 13:if(3!==n){e.next=16;break}return l=null!=t&&null!==(s=t.choices)&&void 0!==s&&null!==(s=s[0])&&void 0!==s&&s.is_answer?"true":"false",e.abrupt("return",{challenge_choose:{subject:t.name,answer:E.task_pass,standard_answer:l,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 t=G[e],n=null==t?void 0:t[0];k(t),T.setFieldsValue({score:n}),L(l()(l()({},T.getFieldsValue()),{score:n}))},D=function(){var e=r()(o()().mark((function e(t){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(!a){e.next=25;break}return e.t0=j.bq,e.t1=l(),e.t2=l(),e.t3=l(),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:a.choose_id,type:n},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("操作成功"),s()),e.abrupt("return");case 25:return e.t12=j.Tn,e.t13=l(),e.t14=l(),e.t15=l(),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:n},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("操作成功"),s());case 43:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=r()(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:a?"编辑题目":"添加题目"}),(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,t){L(l()({},t)),"difficult"in e&&I(e.difficult)},onFinish:D,initialValues:{difficult:1,score:10},children:[1===n&&(0,J.jsx)(X,{ref:M,editData:a}),2===n&&(0,J.jsx)(ne,{ref:M,editData:a}),3===n&&(0,J.jsx)(oe,{ref:M,editData:a}),(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==a?void 0:a.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:O,children:"保存"})]})]})})},se={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"},le=n(64244),ce=n(20409),ue=n(16542),de=n(77278),fe=n(95888),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 t,n,i,a=e.shixunsDetail,s=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),D=I[0],O=I[1],R=(0,d.useState)(!0),F=u()(R,2),W=(F[0],F[1]),H=(0,d.useState)(!0),V=u()(H,2),z=V[0],q=V[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],te=$[1],ne=(0,d.useState)(null),ie=u()(ne,2),oe=(ie[0],ie[1]),ae=(0,d.useState)("1"),he=u()(ae,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=s.is_published,Se=s.id,je=a.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=r()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return q(!0),e.next=3,c({type:"shixunsDetail/getChallengesEdit",payload:l()({},C)});case 3:t=e.sent,oe(l()({},t)),_e.current={subject:t.subject,task_pass:(0,ue.S)(t.task_pass),unity_3d_routes:t.unity_3d_routes,has_relation:t.has_relation},G(l()({},_e.current)),P.setFieldsValue(l()({},t)),q(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=r()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return W(!0),e.next=3,(0,j.eb)(l()({},C));case 3:t=e.sent,O(t.data),W(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=r()(o()().mark((function e(t){var n,i,r,s,u,d,f,p=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]&&p[1],i=p.length>2&&void 0!==p[2]?p[2]:1,r=!(!t.unity_3d_routes||""==t.unity_3d_routes),s=l()(l()(l()({},t),C),{},{unity_3d_routes:r?t.unity_3d_routes:null,unity_3d:r,sync_origin_shixun:n}),e.next=6,(0,j.Rs)(s);case 6:0===(u=e.sent).status&&(null!=a&&null!==(d=a.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!=a&&null!==(f=a.detail)&&void 0!==f&&f.copy_for_exercise&&(0,ue.m)(c,a,C.id,i));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ae=function(){var e=r()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j._9)(l()(l()({},C),{},{questionId:t}));case 2:0===e.sent.status&&Ne();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Pe=function(){var e=r()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.im)(l()(l()({},C),{},{questionId:t}));case 2:0===e.sent.status&&Ne();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ee=function(){var e=r()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.UQ)(l()(l()({},C),{},{questionId:t}));case 2:n=e.sent,te(l()(l()({},n),{},{choose_id:t})),X("单选题/多选题"===(null==n?void 0:n.question_name)?1:"填空题"===(null==n?void 0:n.question_name)?2:3);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Le=function(){be(xe+1),Be()},Me=function(){var e,t=function(){f.history.push("/shixuns/".concat(Se,"/challenges")),c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=s&&null!==(e=s.sideBar)&&void 0!==e&&e.confirmLeave?v.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){t()}}):t()};return(0,J.jsxs)("section",{className:se.bg,style:{marginBottom:"1"===me?67:0},children:[(0,J.jsxs)(p.Z,{activeKey:me,onChange:function(e){var t,n=function(){ge(e),Le(),c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=s&&null!==(t=s.sideBar)&&void 0!==t&&t.confirmLeave?v.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n()}}):n()},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:se.formWrap,layout:"vertical",onValuesChange:function(e,t){G(l()({},t)),clearTimeout(ye.current),ye.current=setTimeout((function(){var e=P.getFieldsValue(),t=e.subject,n=e.task_pass;""!==_e.current.subject&&(t!==_e.current.subject||n!==_e.current.task_pass?c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):c({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}))}),500)},onFinish:function(e){var t,n;null!=a&&null!==(t=a.detail)&&void 0!==t&&t.is_fork_from_creator&&null!=a&&null!==(n=a.detail)&&void 0!==n&&n.copy_for_exercise&&_e.current.has_relation?c({type:"classroomList/setActionTabs",payload:{key:"同步修改",value:e,type:"taskLevel",fn:function(e,t,n){Te(e,t,n)}}}):Te(e)},children:[(0,J.jsx)("div",{className:se.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===(t=M.subject)||void 0===t?void 0:t.length)||0,"/60"),placeholder:"例如:从Python程序设计-入门精通"})})}),(0,J.jsx)("div",{className:se.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==a||null===(n=a.detail)||void 0===n?void 0:n.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)(le.t,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:function(){Me()}})}),(0,fe.ag)()&&(0,J.jsx)("div",{className:se.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:[!!D.length&&D.map((function(e,t){var n=e.challenge_choose_id,i=e.subject,a=e.choose_contents,s=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:se.list,children:[(0,J.jsxs)("div",{className:se.top,children:[(0,J.jsxs)("div",{className:se.left,children:[(0,J.jsxs)("div",{className:se.title,children:[(0,J.jsxs)("div",{className:se.fs,children:[t+1,". "]}),(0,J.jsx)(k.Z,{value:i})]}),"单选题/多选题"===d&&(null==a?void 0:a.map((function(e,t){return(0,J.jsxs)("ul",{className:e.right_key?se.qsActive:se.qs,children:[(0,J.jsx)("li",{children:Ce[e.position]}),(0,J.jsx)("li",{children:(0,J.jsx)(k.Z,{value:e.option_name})})]},t)}))),"判断题"===d&&(0,J.jsxs)(w.ZP.Group,{className:"mb10",buttonStyle:"solid",value:s,children:[(0,J.jsx)(w.ZP,{value:"正确",className:"".concat(se.radio," mr40"),children:"正确"}),(0,J.jsx)(w.ZP,{value:"错误",className:se.radio,children:"错误"})]})]}),(0,J.jsxs)("div",{className:se.right,children:[(0,J.jsx)("i",{onClick:function(){return Ee(n)},className:"iconfont icon-xiaoxiugai"}),(0,J.jsx)("i",{onClick:function(){return e=n,t=function(){var t=r()(o()().mark((function t(){return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,j.Yn)(l()(l()({},C),{},{questionId:e}));case 2:t.sent.challenge_id&&(Ne(),m.ZP.success("删除成功"));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),void v.Z.confirm({title:"提示",content:"是否删除题目!",centered:!0,onOk:t});var e,t},className:"iconfont icon-shanchu23"}),t!==D.length-1&&(0,J.jsx)("i",{onClick:function(){return Pe(n)},className:"iconfont icon-xiayi2"}),0!==t&&(0,J.jsx)("i",{onClick:function(){return Ae(n)},className:"iconfont icon-shangyi2"})]})]}),(0,J.jsxs)("div",{className:se.bt,children:["题型:",d," 奖励金币:",u]}),(0,J.jsxs)("div",{className:se.answer,children:["填空题"===d?null==f?void 0:f.map((function(e,t){var n;return(0,J.jsxs)("p",{children:["填空",t+1,":",null==e||null===(n=e.text)||void 0===n?void 0:n.join("、")]},t)})):(0,J.jsxs)("p",{children:["标准答案:",s]}),(0,J.jsxs)("p",{children:[(0,J.jsx)("div",{className:se.fs,children:"参考答案:"}),(0,J.jsx)(k.Z,{value:c})]})]})]},n)})),!D.length&&(0,J.jsxs)("div",{className:se.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)(re,{is_published:ke,visible:Y,onCancel:function(){X(!1),te(null)},onOk:function(){X(!1),te(null),Ne()},editData:ee}),(0,J.jsx)(ce.Z,{loading:z})]})}))},20409:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});n(59301);var i=n(71418),o="loading___lueiN",a=n(37712),r=function(e){return e.loading?(0,a.jsx)("div",{className:o,children:(0,a.jsx)(i.Z,{})}):(0,a.jsx)(a.Fragment,{})}},16542:function(e,t,n){"use strict";n.d(t,{S:function(){return d},m:function(){return f}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),s=n(11298),l=n(8591),c=n(43418),u=n(37712),d=function(e){var t=document.createElement("textarea");return t.value=e,t.value},f=function(){var e=r()(o()().mark((function e(t,n,i,a,r){var d,f,p;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:"shixunsDetail/saveCopyForExercise",payload:{id:i,save_type:a}});case 2:d=e.sent,1===a?(0==(null==d?void 0:d.status)&&l.ZP.success("保存成功"),null!=d&&null!==(f=d.data)&&void 0!==f&&f.exists_same_shixun_name?t({type:"classroomList/setActionTabs",payload:{key:"重名修改",name:null==d||null===(p=d.data)||void 0===p?void 0:p.shixun_name}}):t({type:"classroomList/setActionTabs",payload:{}})):(t({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,s.xg)("/shixuns/".concat(null==n||null===(e=n.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(t,n,i,o,a){return e.apply(this,arguments)}}()}}]); |