(self.webpackChunk=self.webpackChunk||[]).push([[6913],{65363:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return oe}});var Je=Ve(54476),wt=Ve(59301),y={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},we=y,ve=Ve(7657),x=function(ee,se){return wt.createElement(ve.Z,(0,Je.Z)({},ee,{ref:se,icon:we}))},z=wt.forwardRef(x),oe=z},76618:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return oe}});var Je=Ve(54476),wt=Ve(59301),y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"}}]},name:"poweroff",theme:"outlined"},we=y,ve=Ve(7657),x=function(ee,se){return wt.createElement(ve.Z,(0,Je.Z)({},ee,{ref:se,icon:we}))},z=wt.forwardRef(x),oe=z},2018:function(){"use strict"},40862:function(Kt,_t){"use strict";_t.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},94583:function(){"use strict"},75544:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var Kt={},_t="5.0",Ve={},Je=null,wt=!1,y=!1,we=null,ve=!1,x=null,z=null,oe=0;oe4?parseFloat(Ye):5};Kt.setHTML5Codebase=function(Ye,$e){z=Ye,rt(Ye,$e)},Kt.setJavaCodebase=Kt.setJavaCodebaseVersion=Kt.isCompiledInstalled=Kt.setPreCompiledScriptPath=Kt.setPreCompiledResourcePath=function(){},Kt.setHTML5CodebaseVersion=function(Ye,$e){var Ke=parseFloat(Ye);if(Ke!==NaN&&Ke<5){console.log("The GeoGebra HTML5 codebase version "+Ke+" is deprecated. Using version latest instead.");return}x=Ye,Ue(Ye,$e)},Kt.getHTML5CodebaseVersion=function(){return re},Kt.getParameters=function(){return Ve},Kt.setFontsCSSURL=function(Ye){fe=Ye},Kt.setGiacJSURL=function(Ye){},Kt.setJNLPFile=function(Ye){ee=Ye},Kt.setJNLPBaseDir=function(Ye){},Kt.inject=function(){function Ye(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var $e="auto",Ke=Ve.id,ft,tt=!1,ut=0;ut=5)return!0;var Ye=Kt.getAppletObject();return Ye&&typeof Ye.recalculateEnvironments=="function"?(Ye.recalculateEnvironments(),!0):!1},Kt.startAnimation=function(){var Ye=Kt.getAppletObject();return Ye&&typeof Ye.startAnimation=="function"?(Ye.startAnimation(),!0):!1},Kt.stopAnimation=function(){var Ye=Kt.getAppletObject();return Ye&&typeof Ye.stopAnimation=="function"?(Ye.stopAnimation(),!0):!1},Kt.getAppletObject=function(){var Ye=Ve.id!==void 0?Ve.id:"ggbApplet";return window[Ye]},Kt.resize=function(){};var Se=function(Ye,$e,Ke){var ft=document.createElement("param");ft.setAttribute("name",$e),ft.setAttribute("value",Ke),Ye.appendChild(ft)},De=function(Ye){return Ye&&Ye!=="false"},_e=function(Ye,$e,Ke){Ce(re)<=4.2&&(Ke=!0);var ft=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==re||ggbHTML5LoadedCodebaseIsWebSimple&&!ue)&&(ft=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var tt=document.createElement("div");tt.classList.add("appletParameters","notranslate");var ut=$e.width,lt=$e.height;if($e.disableAutoScale=$e.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():$e.disableAutoScale,$e.width!==void 0)if(Ce(re)<=4.4)De($e.showToolBar)&&($e.height-=7),De($e.showAlgebraInput)&&($e.height-=37),$e.width<605&&De($e.showToolBar)&&($e.width=605,ut=605);else{var Ze=100;(De($e.showToolBar)||De($e.showMenuBar))&&($e.hasOwnProperty("customToolBar")&&($e.customToolbar=$e.customToolBar),Ze=De($e.showMenuBar)?245:155),ut=5?($e.appletOnLoad=function(ye){var Fe=Ye.querySelector(".ggb_preview");Fe&&Fe.parentNode.removeChild(Fe),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Me),window.GGBT_wsf_view&&$(window).trigger("resize"),ze(ye)},Ge||Me.appendChild(ct)):tt.appendChild(ct),Me.appendChild(tt),Ge||Ye.appendChild(Me),setTimeout(function(){Kt.resize()},1)}else{var mt=document.createElement("div");mt.className="applet_scaler",mt.style.position="relative",mt.style.display="block",mt.appendChild(tt),Ye.appendChild(mt),$e.appletOnLoad=function(ye){Kt.resize(),ze(ye)}}function nt(ye,Fe){Fe&&typeof Fe.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(ye,Fe.appletOnLoad):renderGGBElement(ye),ot("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Fe)}function Ae(ye,Fe){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:ye,params:Fe}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Qe){nt(Qe.article,Qe.params)}),html5AppletsToProcess=null)},Ce(re)<5&&(ye.className+=" geogebraweb")):nt(ye,Fe)}if(ft){scriptLoadStarted=!0;for(var je=0;je0?(Ne.remove(),Me.attr("id","fullscreencontent").show(),jQuery(ze).append(Me),window.dispatchEvent(new Event("resize"))):_e(Ne,$e,!1),window.GGBT_wsf_view.launchFullScreen(ze)}else te=ft,_e(Ye,$e,!1);if(!window.GGBT_wsf_view)for(lt=0;ltYe/4*3&&(Ne=Ye/4*3),ze=Ne/5.8,Ze.setAttribute("src",he),Ze.setAttribute("width",Ne),Ze.setAttribute("height",ze);var Me=(Ye-Ne)/2,Ge=($e-ze)/2;Ze.style.left=Me+"px",Ze.style.top=Ge+"px",tt.appendChild(Ze)}}return tt.appendChild(lt),tt},st=function(Ye){return Ye=Ye.toLowerCase(),Ye==="html5"||Ye==="screenshot"?Ye:"html5"},Le=["web","webSimple","web3d","tablet","tablet3d","phone"],Ue=function(Ye,$e){if(re=Ye,$e){rt(re,!0);return}var Ke=!wt;if(Ke){var ft=Ce(re);!isNaN(ft)&&ft<4.4&&(Ke=!1)}var tt,ut;window.location.protocol.substr(0,4)==="http"?tt=window.location.protocol:tt="http:";var lt=re.indexOf("//");lt>0?ut=re:lt===0?ut=tt+re:ut="https://www.geogebra.org/apps/5.2.814.0/";for(var Ze in Le)if(re.slice(Le[Ze].length*-1)===Le[Ze]||re.slice((Le[Ze].length+1)*-1)===Le[Ze]+"/"){rt(ut,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Ke&&!Je.is3D&&!Je.AV&&!Je.SV&&!Je.CV&&!Je.EV2&&!Je.CP&&!Je.PC&&!Je.DA&&!Je.FI&&!Je.PV&&!De(Ve.showToolBar)&&!De(Ve.showMenuBar)&&!De(Ve.showAlgebraInput)&&!De(Ve.enableRightClick)&&(!Ve.appName||Ve.appName=="classic")?ut+="webSimple/":ut+="web3d/",rt(ut,!1)},rt=function(Ye,$e){if(Ye.requirejs){se=Ye;return}Ye.slice(-1)!=="/"&&(Ye+="/"),se=Ye,$e===null&&($e=Ye.indexOf("http")===-1),E=$e,le="web.nocache.js",ue=!1;var Ke=se.split("/");Ke.length>1&&(!$e&&Ke[Ke.length-2]==="webSimple"?(le="webSimple.nocache.js",ue=!0):Le.indexOf(Ke[Ke.length-2])>=0&&(le=Ke[Ke.length-2]+".nocache.js")),Ke=Ye.split("/"),re=Ke[Ke.length-3],re.substr(0,4)==="test"?re=re.substr(4,1)+"."+re.substr(5,1):(re.substr(0,3)==="war"||re.substr(0,4)==="beta")&&(re="5.0");var ft=parseFloat(re);ft!==NaN&&ft<5&&Ye.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+ft+" is deprecated. Using version latest instead."),Ue("5.0",$e))},ot=function(Ye,$e){window.console&&window.console.log&&(!$e||typeof $e.showLogging=="undefined"||$e.showLogging&&$e.showLogging!=="false")&&console.log(Ye)};Ve.material_id!==void 0?ke(it):it();function it(){var Ye=_t;x!==null?Ye=x:parseFloat(Ye)<5&&(Ye="5.0"),Ue(Ye,!1),z!==null&&rt(z,E),ve=!0}return Kt},GGBAppletUtils=function(){"use strict";function Kt(){return window.GGBT_wsf_edit!==void 0}function _t(ve,x){x!=1?(ve.style.transformOrigin="0% 0% 0px",ve.style.webkitTransformOrigin="0% 0% 0px",ve.style.transform="scale("+x+","+x+")",ve.style.webkitTransform="scale("+x+","+x+")",ve.style.maxWidth="initial",ve.querySelector(".ggb_preview")!==null&&(ve.querySelector(".ggb_preview").style.maxWidth="initial"),ve.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ve.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ve.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ve.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ve.style.transform="none",ve.style.webkitTransform="none")}function Ve(ve,x,z,oe,ie,ee){var se=null;if(ee!=null&&ee!="")for(var E=ve.parentNode;E!=null;)if((" "+E.className+" ").indexOf(" "+ee+" ")>-1){se=E;break}else E=E.parentNode;var te=0,re=0,le=0,ue=0,ce=0,he=0,me=0;if(se)te=se.offsetWidth,re=Math.max(oe?se.offsetWidth:0,se.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(te=Math.min(window.innerWidth,document.documentElement.clientWidth),re=Math.min(window.innerHeight,document.documentElement.clientHeight),le=te):(te=window.innerWidth,re=window.innerHeight,le=window.innerWidth),ve){var fe=ve.getBoundingClientRect();fe.left>0&&fe.left<=te&&(ie===void 0||!ie)&&(document.dir==="rtl"?(ce=te-fe.width-fe.left,he=le<=480?10:30):(he=fe.left,ce=le<=480?10:30),ue=he+ce)}if(ve&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var be=ve.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ue=40,me=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(ue=0,me=40)}}return ve&&((z===void 0||!z)&&x>0&&x+ue1&&(ee=!0)),x&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(ee=!0),!(ve.hasOwnProperty("disableAutoScale")&&ve.disableAutoScale))ie=Je(ve,x,ee,z,ve.scaleContainerClass);else return oe;return ee&&(!ve.hasOwnProperty("scale")||oe===1)?ie:Math.min(oe,ie)}function y(ve){var x=Math.min(window.innerWidth,document.documentElement.clientWidth),z=Math.min(window.innerHeight,document.documentElement.clientHeight),oe=ve.getBoundingClientRect(),ie=(x-oe.width)/2,ee=(z-oe.height)/2;ee<0&&(ee=0),ve.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ie<40?ve.style.left="40px":ve.style.left=ie+"px",ve.style.top=ee+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(ee<40?ve.style.top="40px":ve.style.top=ee+"px",ve.style.left=ie+"px")}function we(ve,x){var z=ve.querySelector(".appletParameters");if(z){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(x.id!==z.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ve)}if(z.parentElement&&/fullscreen/.test(z.parentElement.className))return;var oe=wt(x,ve);Kt()&&z.setAttribute("data-param-scale",oe);for(var ie=null,ee=0;ee=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(Kt){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Kt){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Kt){var _t=c[Kt];return _t==null?null:_t},r=d,webModule.__errFn=e}function B(){function Kt(ve){var x=ve.lastIndexOf(rb);x==-1&&(x=ve.length);var z=ve.indexOf(sb);z==-1&&(z=ve.length);var oe=ve.lastIndexOf(tb,Math.min(z,x));return oe>=O?ve.substring(O,oe+P):W}function _t(ve){if(!ve.match(/^\w+:\/\//)){var x=o.createElement(ub);x.src=ve+vb,ve=Kt(x.src)}return ve}function Ve(){var ve=__gwt_getMetaProperty(wb);return ve!=null?ve:W}function Je(){for(var ve=o.getElementsByTagName(_),x=O;xO?ve[ve.length-P].href:W}function y(){var ve=o.location;return ve.href==ve.protocol+zb+ve.host+ve.pathname+ve.search+ve.hash}var we=Ve();return we==W&&(we=Je()),we==W&&(we=wt()),we==W&&y()&&(we=Kt(o.location.href)),we=_t(we),we}function C(Kt){return Kt.match(/^\//)||Kt.match(/^[a-zA-Z]+:\/\//)?Kt:webModule.__moduleBase+Kt}function D(){var Kt=[],_t=O,Ve=[],Je=[];function wt(ve){var x=Je[ve](),z=Ve[ve];if(x in z)return x;var oe=[];for(var ie in z)oe[z[ie]]=ie;throw r&&r(ve,oe,x),null}if(__gwt_isKnownPropertyValue=function(ve,x){return x in Ve[ve]},webModule.__getPropMap=function(){var ve={};for(var x in Ve)Ve.hasOwnProperty(x)&&(ve[x]=wt(x));return ve},webModule.__computePropValue=wt,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var y;try{y=Cb;var we=y.indexOf(Db);we!=-1&&(_t=parseInt(y.substring(we+P),$),y=y.substring(O,we))}catch(ve){}return webModule.__softPermutationId=_t,C(y+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},52882:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Ax:function(){return we},Ds:function(){return ve},KI:function(){return z},SI:function(){return y},f1:function(){return wt}});var Je=Ve(26869);function wt(oe){let ie=!0;if(oe.length>0){for(let ee=0;ee0&&Qe[Qe.length-1])||ht[0]!==6&&ht[0]!==2)){vt=0;continue}if(ht[0]===3&&(!Qe||ht[1]>Qe[0]&&ht[1]',"select"),this.addActionButton(Fe,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Fe,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Fe,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Fe,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Fe,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Fe,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Fe,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Ie){var vt=document.createElement("div");vt.className=""+ye.toolbarButtonStyleClass.name,vt.setAttribute("data-type-name",Ie.typeName),vt.innerHTML=Ie.icon,vt.addEventListener("click",function(){ye.markerToolbarButtonClicked(vt,Ie)}),ye.buttons.push(vt),ye.markerButtons.push(vt)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Qe=document.createElement("div");Qe.className=this.toolbarBlockStyleClass.name,Qe.style.whiteSpace="nowrap",Qe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Qe),this.addActionButton(Qe,'',"render"),this.addActionButton(Qe,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Re.prototype.addButtonClickListener=function(xe){this.buttonClickListeners.push(xe)},Re.prototype.removeButtonClickListener=function(xe){this.buttonClickListeners.indexOf(xe)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(xe),1)},Re.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Re.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var xe=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var ye=0;ye0&&this.buttonClickListeners.forEach(function(Fe){return Fe("marker",ye)}),this.markerButtonOverflowBlock.style.display="none"},Re.prototype.actionToolbarButtonClicked=function(xe,ye){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Fe){return Fe("action",ye)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Re.prototype.setActiveButton=function(xe){this.resetButtonStyles(),xe.className=xe.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),xe.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Re.prototype.setActiveMarkerButton=function(xe){var ye=this.markerButtons.find(function(Fe){return Fe.getAttribute("data-type-name")===xe});ye&&this.setActiveButton(ye)},Re.prototype.setCurrentMarker=function(xe){var ye=this;this.currentMarker=xe,this.buttons.filter(function(Fe){return/delete|notes/.test(Fe.getAttribute("data-action"))}).forEach(function(Fe){ye.currentMarker===void 0?(Fe.style.fillOpacity="0.4",Fe.style.pointerEvents="none"):(Fe.style.fillOpacity="1",Fe.style.pointerEvents="all")})},Re}(),me=function(){function Re(xe,ye,Fe,Qe){this.panels=[],this.panelButtons=[],this.markerjsContainer=xe,this.displayMode=ye,this.uiStyleSettings=Fe,this.styles=Qe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Re.prototype.addStyles=function(){var xe;this.toolboxStyleClass=this.styles.addClass(new ce("toolbox",` width: 100%; flex-shrink: 0; display: flex; flex-direction: column; font-family: sans-serif; `+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+` box-sizing: content-box; `+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+` `+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` `+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+` overflow: hidden; `)),this.toolboxStyleColorsClass=this.styles.addClass(new ce("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var ye=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ce("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ce("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ce("toolbox-panel-row",` display: flex; `+(this.displayMode==="inline"?"position: absolute;":"")+` `+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+` cursor: default; height: `+1.5*this.uiStyleSettings.toolbarHeight+`px; `+(this.displayMode==="inline"?"width: 100%;":"")+` box-sizing: content-box; `)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ce("toolbox-panel-row_colors",` background-color: `+((xe=this.uiStyleSettings.toolboxBackgroundColor)!==null&&xe!==void 0?xe:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new ce("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*ye)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*ye)+`px; padding: `+ye+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ce("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ce("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new ue("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new ue("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},Re.prototype.show=function(xe){var ye;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=xe,this.uiContainer.className=this.toolboxStyleClass.name+" "+((ye=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&ye!==void 0?ye:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Re.prototype.setPanelButtons=function(xe){var ye,Fe,Qe=this;this.panels=xe,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((ye=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&ye!==void 0?ye:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Fe=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Fe!==void 0?Fe:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Ie){var vt;Ie.uiStyleSettings=Qe.uiStyleSettings;var yt=document.createElement("div");yt.className=Qe.toolboxButtonStyleClass.name+" "+((vt=Qe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&vt!==void 0?vt:Qe.toolboxButtonStyleColorsClass.name),yt.innerHTML=Ie.icon,yt.title=Ie.title,yt.addEventListener("click",function(){Qe.panelButtonClick(Ie)}),Qe.panelButtons.push(yt),Qe.buttonRow.appendChild(yt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Re.prototype.panelButtonClick=function(xe){var ye=this,Fe=-1;if(xe!==this.activePanel){Fe=this.panels.indexOf(xe),this.panelRow.innerHTML="";var Qe=xe.getUi();Qe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Qe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=xe}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){ye.displayMode==="inline"?ye.panelRow.style.display="none":ye.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Ie,vt){var yt,xt;Ie.className=ye.toolboxButtonStyleClass.name+" "+(vt===Fe?""+((yt=ye.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&yt!==void 0?yt:ye.toolboxActiveButtonStyleColorsClass.name):""+((xt=ye.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xt!==void 0?xt:ye.toolboxButtonStyleColorsClass.name))})},Re}(),fe=function(Re,xe){this.title=Re,this.icon=xe},be=function(Re){function xe(ye,Fe,Qe,Ie){var vt=Re.call(this,ye,Ie||'')||this;return vt.colors=[],vt.addTransparent=!1,vt.colorBoxes=[],vt.colors=Fe,vt.currentColor=Qe,vt.setCurrentColor=vt.setCurrentColor.bind(vt),vt.getColorBox=vt.getColorBox.bind(vt),vt}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");return Fe.style.overflow="hidden",Fe.style.whiteSpace="nowrap",this.colors.forEach(function(Qe){var Ie=ye.getColorBox(Qe);Fe.appendChild(Ie),ye.colorBoxes.push(Ie)}),Fe},xe.prototype.getColorBox=function(ye){var Fe=this,Qe=this.uiStyleSettings.toolbarHeight/4,Ie=this.uiStyleSettings.toolbarHeight-Qe,vt=document.createElement("div");vt.style.display="inline-block",vt.style.boxSizing="content-box",vt.style.width=Ie-2+"px",vt.style.height=Ie-2+"px",vt.style.padding="1px",vt.style.marginRight="2px",vt.style.marginBottom="2px",vt.style.borderWidth="2px",vt.style.borderStyle="solid",vt.style.borderRadius=(Ie+2)/2+"px",vt.style.borderColor=ye===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",vt.addEventListener("click",function(){Fe.setCurrentColor(ye,vt)});var yt=document.createElement("div");return yt.style.display="inline-block",yt.style.width=Ie-2+"px",yt.style.height=Ie-2+"px",yt.style.backgroundColor=ye,yt.style.borderRadius=Ie/2+"px",ye==="transparent"&&(yt.style.fill=this.uiStyleSettings.toolboxAccentColor,yt.innerHTML=` `),vt.appendChild(yt),vt},xe.prototype.setCurrentColor=function(ye,Fe){var Qe=this;this.currentColor=ye,this.colorBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(ye)},xe}(fe),Ce=function(){function Re(xe,ye,Fe){this._state="new",this._isSelected=!1,this._container=xe,this._overlayContainer=ye,this.globalSettings=Fe,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Re.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Re.prototype.ownsTarget=function(xe){return!1},Object.defineProperty(Re.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Re.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Re.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Re.prototype.pointerDown=function(xe,ye){},Re.prototype.dblClick=function(xe,ye){},Re.prototype.manipulate=function(xe){},Re.prototype.pointerUp=function(xe){this.stateChanged()},Re.prototype.dispose=function(){},Re.prototype.addMarkerVisualToContainer=function(xe){this.container.childNodes.length>0?this.container.insertBefore(xe,this.container.childNodes[0]):this.container.appendChild(xe)},Re.prototype.getState=function(){return{typeName:Re.typeName,state:this.state,notes:this.notes}},Re.prototype.restoreState=function(xe){this._state=xe.state,this.notes=xe.notes},Re.prototype.scale=function(xe,ye){},Re.prototype.colorChanged=function(xe){this.onColorChanged&&this.onColorChanged(xe),this.stateChanged()},Re.prototype.fillColorChanged=function(xe){this.onFillColorChanged&&this.onFillColorChanged(xe),this.stateChanged()},Re.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var xe=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),xe.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(xe)&&this.onStateChanged(this)}},Re.typeName="MarkerBase",Re}(),Te=function(){function Re(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Re.prototype.findGripByVisual=function(xe){return this.topLeft.ownsTarget(xe)?this.topLeft:this.topCenter.ownsTarget(xe)?this.topCenter:this.topRight.ownsTarget(xe)?this.topRight:this.centerLeft.ownsTarget(xe)?this.centerLeft:this.centerRight.ownsTarget(xe)?this.centerRight:this.bottomLeft.ownsTarget(xe)?this.bottomLeft:this.bottomCenter.ownsTarget(xe)?this.bottomCenter:this.bottomRight.ownsTarget(xe)?this.bottomRight:void 0},Re}(),Pe=function(){function Re(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Re.prototype.ownsTarget=function(xe){return xe===this.visual||xe===this.visual.childNodes[0]||xe===this.visual.childNodes[1]},Re}(),ke=function(){function Re(){}return Re.toITransformMatrix=function(xe){return{a:xe.a,b:xe.b,c:xe.c,d:xe.d,e:xe.e,f:xe.f}},Re.toSVGMatrix=function(xe,ye){return xe.a=ye.a,xe.b=ye.b,xe.c=ye.c,xe.d=ye.d,xe.e=ye.e,xe.f=ye.f,xe},Re}(),de=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.left=0,Ie.top=0,Ie.width=0,Ie.height=0,Ie.defaultSize={x:50,y:20},Ie.offsetX=0,Ie.offsetY=0,Ie.rotationAngle=0,Ie.CB_DISTANCE=10,Ie._suppressMarkerCreateEvent=!1,Ie.container.transform.baseVal.appendItem(se.createTransform()),Ie.setupControlBox(),Ie}return z(xe,Re),Object.defineProperty(xe.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(xe.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(xe.prototype,"visual",{get:function(){return this._visual},set:function(ye){this._visual=ye;var Fe=se.createTransform();this._visual.transform.baseVal.appendItem(Fe)},enumerable:!1,configurable:!0}),xe.prototype.ownsTarget=function(ye){return!!Re.prototype.ownsTarget.call(this,ye)||!!(this.controlGrips.findGripByVisual(ye)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ye))},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.state==="new"&&(this.left=ye.x,this.top=ye.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Qe=this.unrotatePoint(ye);if(this.manipulationStartX=Qe.x,this.manipulationStartY=Qe.y,this.offsetX=Qe.x-this.left,this.offsetY=Qe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Fe),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Fe)){this.activeGrip=this.rotatorGrip;var Ie=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Ie.x-this.width/2,this.top=Ie.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var vt=this.container.transform.baseVal.getItem(0);vt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(vt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},xe.prototype.pointerUp=function(ye){var Fe=this.state;Re.prototype.pointerUp.call(this,ye),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(ye),this._state="select",Fe==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},xe.prototype.moveVisual=function(ye){this.visual.style.transform="translate("+ye.x+"px, "+ye.y+"px)"},xe.prototype.manipulate=function(ye){var Fe=this.unrotatePoint(ye);this.state==="creating"?this.resize(ye):this.state==="move"?(this.left=this.manipulationStartLeft+(Fe.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Fe.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Fe):this.state==="rotate"&&this.rotate(ye)},xe.prototype.resize=function(ye){var Fe=this.manipulationStartLeft,Qe=this.manipulationStartWidth,Ie=this.manipulationStartTop,vt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Fe=this.manipulationStartLeft+ye.x-this.manipulationStartX,Qe=this.manipulationStartWidth+this.manipulationStartLeft-Fe;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Qe=this.manipulationStartWidth+ye.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Ie=this.manipulationStartTop+ye.y-this.manipulationStartY,vt=this.manipulationStartHeight+this.manipulationStartTop-Ie;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:vt=this.manipulationStartHeight+ye.y-this.manipulationStartY}Qe>=0?(this.left=Fe,this.width=Qe):(this.left=Fe+Qe,this.width=-Qe),vt>=0?(this.top=Ie,this.height=vt):(this.top=Ie+vt,this.height=-vt),this.setSize()},xe.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},xe.prototype.rotate=function(ye){if(Math.abs(ye.x-this.centerX)>.1){var Fe=Math.sign(ye.x-this.centerX);this.rotationAngle=180*Math.atan((ye.y-this.centerY)/(ye.x-this.centerX))/Math.PI+90*Fe,this.applyRotation()}},xe.prototype.applyRotation=function(){var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0)},xe.prototype.rotatePoint=function(ye){if(this.rotationAngle===0)return ye;var Fe=this.container.getCTM(),Qe=se.createPoint(ye.x,ye.y);return{x:(Qe=Qe.matrixTransform(Fe)).x,y:Qe.y}},xe.prototype.unrotatePoint=function(ye){if(this.rotationAngle===0)return ye;var Fe=this.container.getCTM();Fe=Fe.inverse();var Qe=se.createPoint(ye.x,ye.y);return{x:(Qe=Qe.matrixTransform(Fe)).x,y:Qe.y}},xe.prototype.select=function(){Re.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},xe.prototype.deselect=function(){Re.prototype.deselect.call(this),this.controlBox.style.display="none"},xe.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var ye=se.createTransform();ye.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(ye),this.container.appendChild(this.controlBox),this.controlRect=se.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=se.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Te,this.addControlGrips(),this.controlBox.style.display="none"},xe.prototype.adjustControlBox=function(){var ye=this.controlBox.transform.baseVal.getItem(0);ye.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(ye,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},xe.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},xe.prototype.createGrip=function(){var ye=new Pe;return ye.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(ye.visual),ye},xe.prototype.positionGrips=function(){var ye=this.controlGrips.topLeft.GRIP_SIZE,Fe=-ye/2,Qe=Fe,Ie=(this.width+this.CB_DISTANCE)/2-ye/2,vt=(this.height+this.CB_DISTANCE)/2-ye/2,yt=this.height+this.CB_DISTANCE-ye/2,xt=this.width+this.CB_DISTANCE-ye/2;this.positionGrip(this.controlGrips.topLeft.visual,Fe,Qe),this.positionGrip(this.controlGrips.topCenter.visual,Ie,Qe),this.positionGrip(this.controlGrips.topRight.visual,xt,Qe),this.positionGrip(this.controlGrips.centerLeft.visual,Fe,vt),this.positionGrip(this.controlGrips.centerRight.visual,xt,vt),this.positionGrip(this.controlGrips.bottomLeft.visual,Fe,yt),this.positionGrip(this.controlGrips.bottomCenter.visual,Ie,yt),this.positionGrip(this.controlGrips.bottomRight.visual,xt,yt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Ie,Qe-3*this.CB_DISTANCE)},xe.prototype.positionGrip=function(ye,Fe,Qe){var Ie=ye.transform.baseVal.getItem(0);Ie.setTranslate(Fe,Qe),ye.transform.baseVal.replaceItem(Ie,0)},xe.prototype.hideControlBox=function(){this.controlBox.style.display="none"},xe.prototype.showControlBox=function(){this.controlBox.style.display=""},xe.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ke.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ke.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Re.prototype.getState.call(this))},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye);var Fe=ye;this.left=Fe.left,this.top=Fe.top,this.width=Fe.width,this.height=Fe.height,this.rotationAngle=Fe.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ke.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Fe.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ke.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Fe.containerTransformMatrix))},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe);var Qe=this.rotatePoint({x:this.left,y:this.top}),Ie=this.unrotatePoint({x:Qe.x*ye,y:Qe.y*Fe});this.left=Ie.x,this.top=Ie.y,this.width=this.width*ye,this.height=this.height*Fe,this.adjustControlBox()},xe}(Ce),ge=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.fillColor="transparent",Ie.strokeColor="transparent",Ie.strokeWidth=0,Ie.strokeDasharray="",Ie.opacity=1,Ie.setStrokeColor=Ie.setStrokeColor.bind(Ie),Ie.setFillColor=Ie.setFillColor.bind(Ie),Ie.setStrokeWidth=Ie.setStrokeWidth.bind(Ie),Ie.setStrokeDasharray=Ie.setStrokeDasharray.bind(Ie),Ie.createVisual=Ie.createVisual.bind(Ie),Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.visual)},xe.prototype.createVisual=function(){this.visual=se.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.state==="new"&&(this.createVisual(),this.moveVisual(ye),this._state="creating")},xe.prototype.manipulate=function(ye){Re.prototype.manipulate.call(this,ye)},xe.prototype.resize=function(ye){Re.prototype.resize.call(this,ye),this.setSize()},xe.prototype.setSize=function(){Re.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},xe.prototype.pointerUp=function(ye){Re.prototype.pointerUp.call(this,ye),this.setSize()},xe.prototype.setStrokeColor=function(ye){this.strokeColor=ye,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(ye),this.stateChanged()},xe.prototype.setFillColor=function(ye){this.fillColor=ye,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},xe.prototype.setStrokeWidth=function(ye){this.strokeWidth=ye,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},xe.prototype.setStrokeDasharray=function(ye){this.strokeDasharray=ye,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},xe.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Re.prototype.getState.call(this))},xe.prototype.restoreState=function(ye){var Fe=ye;this.fillColor=Fe.fillColor,this.strokeColor=Fe.strokeColor,this.strokeWidth=Fe.strokeWidth,this.strokeDasharray=Fe.strokeDasharray,this.opacity=Fe.opacity,this.createVisual(),Re.prototype.restoreState.call(this,ye),this.setSize()},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe),this.setSize()},xe.title="Rectangle marker",xe}(de),Se=function(Re){function xe(ye,Fe,Qe,Ie){var vt=Re.call(this,ye,Ie||'')||this;return vt.widths=[],vt.widthBoxes=[],vt.widths=Fe,vt.currentWidth=Qe,vt.setCurrentWidth=vt.setCurrentWidth.bind(vt),vt}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");return Fe.style.display="flex",Fe.style.overflow="hidden",Fe.style.flexGrow="2",this.widths.forEach(function(Qe){var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.flexGrow="2",Ie.style.alignItems="center",Ie.style.justifyContent="space-between",Ie.style.padding="5px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderColor=Qe===ye.currentWidth?ye.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){ye.setCurrentWidth(Qe,Ie)}),Fe.appendChild(Ie);var vt=document.createElement("div");vt.innerText=Qe.toString(),vt.style.marginRight="5px",Ie.appendChild(vt);var yt=document.createElement("div");yt.style.minHeight="20px",yt.style.flexGrow="2",yt.style.display="flex",yt.style.alignItems="center";var xt=document.createElement("hr");xt.style.minWidth="20px",xt.style.border="0px",xt.style.borderTop=Qe+"px solid "+ye.uiStyleSettings.toolboxColor,xt.style.flexGrow="2",yt.appendChild(xt),Ie.appendChild(yt),ye.widthBoxes.push(Ie)}),Fe},xe.prototype.setCurrentWidth=function(ye,Fe){var Qe=this;this.currentWidth=ye,this.widthBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},xe}(fe),De=function(Re){function xe(ye,Fe,Qe,Ie){var vt=Re.call(this,ye,Ie||'')||this;return vt.styles=[],vt.styleBoxes=[],vt.styles=Fe,vt.currentStyle=Qe,vt.setCurrentStyle=vt.setCurrentStyle.bind(vt),vt}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");return Fe.style.display="flex",Fe.style.overflow="hidden",Fe.style.flexGrow="2",this.styles.forEach(function(Qe){var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.alignItems="center",Ie.style.justifyContent="space-between",Ie.style.padding="5px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.overflow="hidden",Ie.style.maxWidth=100/ye.styles.length-5+"%",Ie.style.borderColor=Qe===ye.currentStyle?ye.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){ye.setCurrentStyle(Qe,Ie)}),Fe.appendChild(Ie);var vt=document.createElement("div");vt.style.minHeight="20px",vt.style.flexGrow="2",vt.style.overflow="hidden";var yt=` `;vt.innerHTML=yt,Ie.appendChild(vt),ye.styleBoxes.push(Ie)}),Fe},xe.prototype.setCurrentStyle=function(ye,Fe){var Qe=this;this.currentStyle=ye,this.styleBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},xe}(fe),_e=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.strokeColor=Qe.defaultColor,Ie.strokeWidth=Qe.defaultStrokeWidth,Ie.strokeDasharray=Qe.defaultStrokeDasharray,Ie.strokePanel=new be("Line color",Qe.defaultColorSet,Qe.defaultColor),Ie.strokePanel.onColorChanged=Ie.setStrokeColor,Ie.strokeWidthPanel=new Se("Line width",Qe.defaultStrokeWidths,Qe.defaultStrokeWidth),Ie.strokeWidthPanel.onWidthChanged=Ie.setStrokeWidth,Ie.strokeStylePanel=new De("Line style",Qe.defaultStrokeDasharrays,Qe.defaultStrokeDasharray),Ie.strokeStylePanel.onStyleChanged=Ie.setStrokeDasharray,Ie}return z(xe,Re),Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Re.prototype.getState.call(this);return ye.typeName=xe.typeName,ye},xe.typeName="FrameMarker",xe.title="Frame marker",xe.icon='',xe}(ge),Ee=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},Oe=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.x1=0,Ie.y1=0,Ie.x2=0,Ie.y2=0,Ie.defaultLength=50,Ie.manipulationStartX=0,Ie.manipulationStartY=0,Ie.manipulationStartX1=0,Ie.manipulationStartY1=0,Ie.manipulationStartX2=0,Ie.manipulationStartY2=0,Ie.setupControlBox(),Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!!Re.prototype.ownsTarget.call(this,ye)||!(!this.grip1.ownsTarget(ye)&&!this.grip2.ownsTarget(ye))},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.manipulationStartX=ye.x,this.manipulationStartY=ye.y,this.state==="new"&&(this.x1=ye.x,this.y1=ye.y,this.x2=ye.x,this.y2=ye.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Fe)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Fe)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},xe.prototype.pointerUp=function(ye){var Fe=this.state;Re.prototype.pointerUp.call(this,ye),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(ye),this._state="select",Fe==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},xe.prototype.adjustVisual=function(){},xe.prototype.manipulate=function(ye){this.state==="creating"?this.resize(ye):this.state==="move"?(this.x1=this.manipulationStartX1+ye.x-this.manipulationStartX,this.y1=this.manipulationStartY1+ye.y-this.manipulationStartY,this.x2=this.manipulationStartX2+ye.x-this.manipulationStartX,this.y2=this.manipulationStartY2+ye.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(ye)},xe.prototype.resize=function(ye){switch(this.activeGrip){case this.grip1:this.x1=ye.x,this.y1=ye.y;break;case this.grip2:case void 0:this.x2=ye.x,this.y2=ye.y}this.adjustVisual(),this.adjustControlBox()},xe.prototype.select=function(){Re.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},xe.prototype.deselect=function(){Re.prototype.deselect.call(this),this.controlBox.style.display="none"},xe.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},xe.prototype.adjustControlBox=function(){this.positionGrips()},xe.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},xe.prototype.createGrip=function(){var ye=new Pe;return ye.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(ye.visual),ye},xe.prototype.positionGrips=function(){var ye=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-ye/2,this.y1-ye/2),this.positionGrip(this.grip2.visual,this.x2-ye/2,this.y2-ye/2)},xe.prototype.positionGrip=function(ye,Fe,Qe){var Ie=ye.transform.baseVal.getItem(0);Ie.setTranslate(Fe,Qe),ye.transform.baseVal.replaceItem(Ie,0)},xe.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Re.prototype.getState.call(this))},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye);var Fe=ye;this.x1=Fe.x1,this.y1=Fe.y1,this.x2=Fe.x2,this.y2=Fe.y2},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe),this.x1=this.x1*ye,this.y1=this.y1*Fe,this.x2=this.x2*ye,this.y2=this.y2*Fe,this.adjustVisual(),this.adjustControlBox()},xe}(Ce),He=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.strokeColor="transparent",Ie.strokeWidth=0,Ie.strokeDasharray="",Ie.setStrokeColor=Ie.setStrokeColor.bind(Ie),Ie.setStrokeWidth=Ie.setStrokeWidth.bind(Ie),Ie.setStrokeDasharray=Ie.setStrokeDasharray.bind(Ie),Ie.strokeColor=Qe.defaultColor,Ie.strokeWidth=Qe.defaultStrokeWidth,Ie.strokeDasharray=Qe.defaultStrokeDasharray,Ie.strokePanel=new be("Line color",Qe.defaultColorSet,Qe.defaultColor),Ie.strokePanel.onColorChanged=Ie.setStrokeColor,Ie.strokeWidthPanel=new Se("Line width",Qe.defaultStrokeWidths,Qe.defaultStrokeWidth),Ie.strokeWidthPanel.onWidthChanged=Ie.setStrokeWidth,Ie.strokeStylePanel=new De("Line style",Qe.defaultStrokeDasharrays,Qe.defaultStrokeDasharray),Ie.strokeStylePanel.onStyleChanged=Ie.setStrokeDasharray,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.visual&&ye!==this.selectorLine&&ye!==this.visibleLine)},xe.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},xe.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},xe.prototype.setStrokeColor=function(ye){this.strokeColor=ye,this.adjustVisual(),this.colorChanged(ye)},xe.prototype.setStrokeWidth=function(ye){this.strokeWidth=ye,this.adjustVisual()},xe.prototype.setStrokeDasharray=function(ye){this.strokeDasharray=ye,this.adjustVisual(),this.stateChanged()},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Re.prototype.getState.call(this));return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye);var Fe=ye;this.strokeColor=Fe.strokeColor,this.strokeWidth=Fe.strokeWidth,this.strokeDasharray=Fe.strokeDasharray,this.createVisual(),this.adjustVisual()},xe.typeName="LineMarker",xe.title="Line marker",xe.icon='',xe}(Oe),Xe=function(Re){function xe(ye,Fe,Qe,Ie){var vt=Re.call(this,ye,Ie||'')||this;return vt.fonts=[],vt.fontBoxes=[],vt.fonts=Fe,vt.currentFont=Qe,vt.setCurrentFont=vt.setCurrentFont.bind(vt),vt}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");return Fe.style.overflow="hidden",Fe.style.flexGrow="2",this.fonts.forEach(function(Qe){var Ie=document.createElement("div");Ie.style.display="inline-block",Ie.style.alignItems="center",Ie.style.justifyContent="space-between",Ie.style.padding="5px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.overflow="hidden",Ie.style.maxWidth=100/ye.fonts.length-5+"%",Ie.style.borderColor=Qe===ye.currentFont?ye.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){ye.setCurrentFont(Qe,Ie)}),Fe.appendChild(Ie);var vt=document.createElement("div");vt.style.display="flex",vt.style.minHeight="20px",vt.style.flexGrow="2",vt.style.fontFamily=Qe,vt.style.overflow="hidden";var yt=document.createElement("div");yt.style.whiteSpace="nowrap",yt.style.overflow="hidden",yt.style.textOverflow="ellipsis",yt.innerHTML="The quick brown fox jumps over the lazy dog",vt.appendChild(yt),Ie.appendChild(vt),ye.fontBoxes.push(Ie)}),Fe},xe.prototype.setCurrentFont=function(ye,Fe){var Qe=this;this.currentFont=ye,this.fontBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},xe}(fe),et=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.color="transparent",Ie.padding=5,Ie.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Ie.text=Ie.DEFAULT_TEXT,Ie.isMoved=!1,Ie.color=Qe.defaultColor,Ie.fontFamily=Qe.defaultFontFamily,Ie.defaultSize={x:100,y:30},Ie.setColor=Ie.setColor.bind(Ie),Ie.setFont=Ie.setFont.bind(Ie),Ie.renderText=Ie.renderText.bind(Ie),Ie.sizeText=Ie.sizeText.bind(Ie),Ie.textEditDivClicked=Ie.textEditDivClicked.bind(Ie),Ie.showTextEditor=Ie.showTextEditor.bind(Ie),Ie.setSize=Ie.setSize.bind(Ie),Ie.positionTextEditor=Ie.positionTextEditor.bind(Ie),Ie.colorPanel=new be("Color",Qe.defaultColorSet,Qe.defaultColor),Ie.colorPanel.onColorChanged=Ie.setColor,Ie.fontFamilyPanel=new Xe("Font",Qe.defaultFontFamilies,Qe.defaultFontFamily),Ie.fontFamilyPanel.onFontChanged=Ie.setFont,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){if(Re.prototype.ownsTarget.call(this,ye)||ye===this.visual||ye===this.textElement||ye===this.bgRectangle)return!0;var Fe=!1;return this.textElement.childNodes.forEach(function(Qe){Qe===ye&&(Fe=!0)}),Fe},xe.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.isMoved=!1,this.pointerDownPoint=ye,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(ye),this._state="creating")},xe.prototype.renderText=function(){var ye=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Fe){ye.textElement.appendChild(se.createTSpan(Fe.trim()===""?" ":Fe.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},xe.prototype.getTextScale=function(){var ye=this.textElement.getBBox(),Fe=1;if(ye.width>0&&ye.height>0){var Qe=(1*this.width-this.width*this.padding*2/100)/ye.width,Ie=(1*this.height-this.height*this.padding*2/100)/ye.height;Fe=Math.min(Qe,Ie)}return Fe},xe.prototype.getTextPosition=function(ye){var Fe=this.textElement.getBBox(),Qe=0,Ie=0;return Fe.width>0&&Fe.height>0&&(Qe=(this.width-Fe.width*ye)/2,Ie=this.height/2-Fe.height*ye/2),{x:Qe,y:Ie}},xe.prototype.sizeText=function(){var ye=this.textElement.getBBox(),Fe=this.getTextScale(),Qe=this.getTextPosition(Fe);Qe.y-=ye.y*Fe,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Qe.x+"px, "+Qe.y+"px) scale("+Fe+", "+Fe+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Qe.x,Qe.y),this.textElement.transform.baseVal.getItem(1).setScale(Fe,Fe))},xe.prototype.manipulate=function(ye){Re.prototype.manipulate.call(this,ye),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(ye.x-this.pointerDownPoint.x)>5||Math.abs(ye.y-this.pointerDownPoint.y)>5)},xe.prototype.resize=function(ye){Re.prototype.resize.call(this,ye),this.isMoved=!0,this.setSize(),this.sizeText()},xe.prototype.setSize=function(){Re.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},xe.prototype.pointerUp=function(ye){var Fe=this.state;Fe==="creating"&&(this._suppressMarkerCreateEvent=!0),Re.prototype.pointerUp.call(this,ye),this.setSize(),(Fe==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},xe.prototype.showTextEditor=function(){var ye=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Fe){Fe.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Fe=Number.parseFloat(ye.textEditor.style.fontSize);ye.textEditor.clientWidth>=Number.parseInt(ye.textEditor.style.maxWidth)&&Fe>.9;)Fe-=.1,ye.textEditor.style.fontSize=Math.max(Fe,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Fe){Fe.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Fe){if(Fe.clipboardData){var Qe=Fe.clipboardData.getData("text"),Ie=window.getSelection();if(!Ie.rangeCount)return!1;Ie.deleteFromDocument(),Ie.getRangeAt(0).insertNode(document.createTextNode(Qe)),Fe.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){ye.textEditDivClicked(ye.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},xe.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var ye=this.getTextScale(),Fe=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Qe=this.textElement.getBBox(),Ie={x:Qe.width*ye,y:Qe.height*ye};Fe.x-=Ie.x/2,Fe.y-=Ie.y/2,this.textEditor.style.top=Fe.y+"px",this.textEditor.style.left=Fe.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Fe.x+"px",this.textEditor.style.fontSize=Math.max(16*ye,12)+"px",this.textElement.style.display="none"}},xe.prototype.textEditDivClicked=function(ye){this.text=ye.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},xe.prototype.select=function(){Re.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},xe.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Re.prototype.deselect.call(this)},xe.prototype.dblClick=function(ye,Fe){Re.prototype.dblClick.call(this,ye,Fe),this.showTextEditor()},xe.prototype.setColor=function(ye){this.textElement&&se.setAttributes(this.textElement,[["fill",ye]]),this.color=ye,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(ye)},xe.prototype.setFont=function(ye){this.textElement&&se.setAttributes(this.textElement,[["font-family",ye]]),this.fontFamily=ye,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},xe.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},xe.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Re.prototype.getState.call(this));return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){var Fe=ye;this.color=Fe.color,this.fontFamily=Fe.fontFamily,this.padding=Fe.padding,this.text=Fe.text,this.createVisual(),Re.prototype.restoreState.call(this,ye),this.setSize()},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe),this.setSize(),this.sizeText(),this.positionTextEditor()},xe.typeName="TextMarker",xe.title="Text marker",xe.icon='',xe}(de),st=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.color="transparent",Ie.lineWidth=3,Ie.drawing=!1,Ie.pixelRatio=1,Ie.color=Qe.defaultColor,Ie.lineWidth=Qe.defaultStrokeWidth,Ie.pixelRatio=Qe.freehandPixelRatio,Ie.setColor=Ie.setColor.bind(Ie),Ie.addCanvas=Ie.addCanvas.bind(Ie),Ie.finishCreation=Ie.finishCreation.bind(Ie),Ie.setLineWidth=Ie.setLineWidth.bind(Ie),Ie.colorPanel=new be("Color",Qe.defaultColorSet,Qe.defaultColor),Ie.colorPanel.onColorChanged=Ie.setColor,Ie.lineWidthPanel=new Se("Line width",Qe.defaultStrokeWidths,Qe.defaultStrokeWidth),Ie.lineWidthPanel.onWidthChanged=Ie.setLineWidth,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.visual&&ye!==this.drawingImage)},xe.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var ye=se.createTransform();this.visual.transform.baseVal.appendItem(ye),this.addMarkerVisualToContainer(this.visual)},xe.prototype.pointerDown=function(ye,Fe){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(ye.x,ye.y),this.drawing=!0):Re.prototype.pointerDown.call(this,ye,Fe)},xe.prototype.manipulate=function(ye){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(ye.x,ye.y),this.canvasContext.stroke()):Re.prototype.manipulate.call(this,ye)},xe.prototype.resize=function(ye){Re.prototype.resize.call(this,ye),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},xe.prototype.pointerUp=function(ye){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Re.prototype.pointerUp.call(this,ye)},xe.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},xe.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Re.prototype.select.call(this)},xe.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Re.prototype.deselect.call(this)},xe.prototype.finishCreation=function(){for(var ye=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Fe=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Qe=Fe[0],Ie=Fe[1],vt=Fe[2],yt=Fe[3],xt=!1,bt=0;bt0&&(xt=!0,btyt&&(yt=bt),ht>vt&&(vt=ht));if(xt){this.left=Qe/this.pixelRatio,this.top=Ie/this.pixelRatio,this.width=(vt-Qe)/this.pixelRatio,this.height=(yt-Ie)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=vt-Qe,kt.height=yt-Ie,kt.getContext("2d").putImageData(this.canvasContext.getImageData(Qe,Ie,vt-Qe,yt-Ie),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},xe.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},xe.prototype.setColor=function(ye){this.color=ye,this.colorChanged(ye)},xe.prototype.setLineWidth=function(ye){this.lineWidth=ye},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({drawingImgUrl:this.drawingImgUrl},Re.prototype.getState.call(this));return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){this.createVisual(),Re.prototype.restoreState.call(this,ye),this.drawingImgUrl=ye.drawingImgUrl,this.setDrawingImage()},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe),this.setDrawingImage()},xe.typeName="FreehandMarker",xe.title="Freehand marker",xe.icon='',xe}(de),Le=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Qe||'')||this;return Ie.typeBoxes=[],Ie.currentType=Fe,Ie.setCurrentType=Ie.setCurrentType.bind(Ie),Ie}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");Fe.style.display="flex",Fe.style.overflow="hidden",Fe.style.flexGrow="2";for(var Qe=function(yt){var xt="both";switch(yt){case 0:xt="both";break;case 1:xt="start";break;case 2:xt="end";break;case 3:xt="none"}var bt=document.createElement("div");if(bt.style.display="flex",bt.style.flexGrow="2",bt.style.alignItems="center",bt.style.justifyContent="space-between",bt.style.padding="5px",bt.style.borderWidth="2px",bt.style.borderStyle="solid",bt.style.borderColor=xt===Ie.currentType?Ie.uiStyleSettings.toolboxAccentColor:"transparent",bt.addEventListener("click",function(){ye.setCurrentType(xt,bt)}),Fe.appendChild(bt),xt==="both"||xt==="start"){var ht=document.createElement("div");ht.style.display="flex",ht.style.alignItems="center",ht.style.minHeight="20px",ht.innerHTML=` `,ht.style.marginLeft="5px",bt.appendChild(ht)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var Tt=document.createElement("hr");if(Tt.style.minWidth="20px",Tt.style.border="0px",Tt.style.borderTop="3px solid "+(Ie.uiStyleSettings!==void 0?Ie.uiStyleSettings.toolboxColor:"#eeeeee"),Tt.style.flexGrow="2",kt.appendChild(Tt),bt.appendChild(kt),xt==="both"||xt==="end"){var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.innerHTML=` `,Pt.style.marginRight="5px",bt.appendChild(Pt)}Ie.typeBoxes.push(bt)},Ie=this,vt=0;vt<4;vt++)Qe(vt);return Fe},xe.prototype.setCurrentType=function(ye,Fe){var Qe=this;this.currentType=ye,this.typeBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings!==void 0?Qe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},xe}(fe),Ue=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.arrowType="end",Ie.arrowBaseHeight=10,Ie.arrowBaseWidth=10,Ie.getArrowPoints=Ie.getArrowPoints.bind(Ie),Ie.setArrowType=Ie.setArrowType.bind(Ie),Ie.arrowTypePanel=new Le("Arrow type","end"),Ie.arrowTypePanel.onArrowTypeChanged=Ie.setArrowType,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.arrow1&&ye!==this.arrow2)},xe.prototype.getArrowPoints=function(ye,Fe){var Qe=this.arrowBaseWidth+2*this.strokeWidth,Ie=this.arrowBaseHeight+2*this.strokeWidth;return ye-Qe/2+","+(Fe+Ie/2)+" "+ye+","+(Fe-Ie/2)+" "+(ye+Qe/2)+","+(Fe+Ie/2)},xe.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.state==="creating"&&this.createTips()},xe.prototype.adjustVisual=function(){if(Re.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var ye=0;Math.abs(this.x1-this.x2)>.1&&(ye=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Fe=this.arrow1.transform.baseVal.getItem(0);Fe.setRotate(ye,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Fe,0);var Qe=this.arrow2.transform.baseVal.getItem(0);Qe.setRotate(ye+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Qe,0)}},xe.prototype.setArrowType=function(ye){this.arrowType=ye,this.adjustVisual(),this.stateChanged()},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({arrowType:this.arrowType},Re.prototype.getState.call(this));return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye);var Fe=ye;this.arrowType=Fe.arrowType,this.createTips(),this.adjustVisual()},xe.typeName="ArrowMarker",xe.title="Arrow marker",xe.icon='',xe}(He),rt=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.fillColor=Qe.defaultFillColor,Ie.strokeWidth=0,Ie.fillPanel=new be("Color",Qe.defaultColorSet,Qe.defaultFillColor),Ie.fillPanel.onColorChanged=Ie.setFillColor,Ie}return z(xe,Re),Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Re.prototype.getState.call(this);return ye.typeName=xe.typeName,ye},xe.typeName="CoverMarker",xe.title="Cover marker",xe.icon='',xe}(ge),ot=function(Re){function xe(ye,Fe,Qe,Ie){var vt=Re.call(this,ye,Ie||'')||this;return vt.opacities=[],vt.opacityBoxes=[],vt.opacities=Fe,vt.currentOpacity=Qe,vt.setCurrentOpacity=vt.setCurrentOpacity.bind(vt),vt}return z(xe,Re),xe.prototype.getUi=function(){var ye=this,Fe=document.createElement("div");return Fe.style.display="flex",Fe.style.overflow="hidden",Fe.style.flexGrow="2",Fe.style.justifyContent="space-between",this.opacities.forEach(function(Qe){var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.alignItems="center",Ie.style.justifyContent="center",Ie.style.padding="5px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderColor=Qe===ye.currentOpacity?ye.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){ye.setCurrentOpacity(Qe,Ie)}),Fe.appendChild(Ie);var vt=document.createElement("div");vt.innerText=100*Qe+"%",Ie.appendChild(vt),ye.opacityBoxes.push(Ie)}),Fe},xe.prototype.setCurrentOpacity=function(ye,Fe){var Qe=this;this.currentOpacity=ye,this.opacityBoxes.forEach(function(Ie){Ie.style.borderColor=Ie===Fe?Qe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},xe}(fe),it=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.setOpacity=Ie.setOpacity.bind(Ie),Ie.fillColor=Qe.defaultHighlightColor,Ie.strokeWidth=0,Ie.opacity=Qe.defaultHighlightOpacity,Ie.fillPanel=new be("Color",Qe.defaultColorSet,Ie.fillColor),Ie.fillPanel.onColorChanged=Ie.setFillColor,Ie.opacityPanel=new ot("Opacity",Qe.defaultOpacitySteps,Ie.opacity),Ie.opacityPanel.onOpacityChanged=Ie.setOpacity,Ie}return z(xe,Re),xe.prototype.setOpacity=function(ye){this.opacity=ye,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Re.prototype.getState.call(this);return ye.typeName=xe.typeName,ye},xe.typeName="HighlightMarker",xe.title="Highlight marker",xe.icon='',xe}(rt),Ye='',$e='',Ke=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.bgColor="transparent",Ie.tipPosition={x:0,y:0},Ie.tipBase1Position={x:0,y:0},Ie.tipBase2Position={x:0,y:0},Ie.tipMoving=!1,Ie.color=Qe.defaultStrokeColor,Ie.bgColor=Qe.defaultFillColor,Ie.fontFamily=Qe.defaultFontFamily,Ie.defaultSize={x:100,y:30},Ie.setBgColor=Ie.setBgColor.bind(Ie),Ie.getTipPoints=Ie.getTipPoints.bind(Ie),Ie.positionTip=Ie.positionTip.bind(Ie),Ie.setTipPoints=Ie.setTipPoints.bind(Ie),Ie.colorPanel=new be("Text color",Qe.defaultColorSet,Ie.color,Ye),Ie.colorPanel.onColorChanged=Ie.setColor,Ie.bgColorPanel=new be("Fill color",Qe.defaultColorSet,Ie.bgColor,$e),Ie.bgColorPanel.onColorChanged=Ie.setBgColor,Ie.fontFamilyPanel=new Xe("Font",Qe.defaultFontFamilies,Qe.defaultFontFamily),Ie.fontFamilyPanel.onFontChanged=Ie.setFont,Ie.tipGrip=new Pe,Ie.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),Ie.controlBox.appendChild(Ie.tipGrip.visual),Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return Re.prototype.ownsTarget.call(this,ye)||this.tipGrip.ownsTarget(ye)||this.tip===ye},xe.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},xe.prototype.pointerDown=function(ye,Fe){this.state==="new"&&Re.prototype.pointerDown.call(this,ye,Fe),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Fe)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Re.prototype.pointerDown.call(this,ye,Fe)},xe.prototype.pointerUp=function(ye){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Re.prototype.pointerUp.call(this,ye);else{var Fe=this.state==="creating";Re.prototype.pointerUp.call(this,ye),this.setTipPoints(Fe),this.positionTip()}},xe.prototype.manipulate=function(ye){if(this.tipMoving){var Fe=this.unrotatePoint(ye);this.tipPosition={x:Fe.x-this.manipulationStartLeft,y:Fe.y-this.manipulationStartTop},this.positionTip()}else Re.prototype.manipulate.call(this,ye)},xe.prototype.setBgColor=function(ye){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",ye]]),se.setAttributes(this.tip,[["fill",ye]])),this.bgColor=ye,this.fillColorChanged(ye)},xe.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},xe.prototype.setTipPoints=function(ye){ye===void 0&&(ye=!1);var Fe=Math.min(this.height/2,15),Qe=this.height/5;ye&&(this.tipPosition={x:Fe+Qe/2,y:this.height+20});var Ie=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?Ie.1)){var ye=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Fe=this.tip1.transform.baseVal.getItem(0);Fe.setRotate(ye,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Fe,0);var Qe=this.tip2.transform.baseVal.getItem(0);Qe.setRotate(ye+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Qe,0)}},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Re.prototype.getState.call(this);return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye),this.createTips(),this.adjustVisual()},xe.typeName="MeasurementMarker",xe.title="Measurement marker",xe.icon='',xe}(He),ut=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.strokePanel.colors=Qe.defaultColorSet,Ie.fillColor="transparent",Ie}return z(xe,Re),Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Re.prototype.getState.call(this);return ye.typeName=xe.typeName,ye},xe.typeName="EllipseFrameMarker",xe.title="Ellipse frame marker",xe.icon='',xe}(ft),lt=function(){function Re(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Re.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Re.prototype.addUndoStep=function(xe){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(xe)||(this.undoStack.push(xe),JSON.stringify(this.lastRedoStep)!==JSON.stringify(xe)&&this.redoStack.splice(0,this.redoStack.length))},Re.prototype.replaceLastUndoStep=function(xe){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=xe)},Re.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Re.prototype.undo=function(){if(this.undoStack.length>1){var xe=this.undoStack.pop();return xe!==void 0&&this.redoStack.push(xe),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Re.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Re}(),Ze=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.strokeColor="transparent",Ie.strokeWidth=0,Ie.strokeDasharray="",Ie.curveX=0,Ie.curveY=0,Ie.manipulationStartCurveX=0,Ie.manipulationStartCurveY=0,Ie.setStrokeColor=Ie.setStrokeColor.bind(Ie),Ie.setStrokeWidth=Ie.setStrokeWidth.bind(Ie),Ie.setStrokeDasharray=Ie.setStrokeDasharray.bind(Ie),Ie.positionGrips=Ie.positionGrips.bind(Ie),Ie.addControlGrips=Ie.addControlGrips.bind(Ie),Ie.adjustVisual=Ie.adjustVisual.bind(Ie),Ie.setupControlBox=Ie.setupControlBox.bind(Ie),Ie.resize=Ie.resize.bind(Ie),Ie.strokeColor=Qe.defaultColor,Ie.strokeWidth=Qe.defaultStrokeWidth,Ie.strokeDasharray=Qe.defaultStrokeDasharray,Ie.strokePanel=new be("Line color",Qe.defaultColorSet,Qe.defaultColor),Ie.strokePanel.onColorChanged=Ie.setStrokeColor,Ie.strokeWidthPanel=new Se("Line width",Qe.defaultStrokeWidths,Qe.defaultStrokeWidth),Ie.strokeWidthPanel.onWidthChanged=Ie.setStrokeWidth,Ie.strokeStylePanel=new De("Line style",Qe.defaultStrokeDasharrays,Qe.defaultStrokeDasharray),Ie.strokeStylePanel.onStyleChanged=Ie.setStrokeDasharray,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.visual&&ye!==this.selectorCurve&&ye!==this.visibleCurve&&!this.curveGrip.ownsTarget(ye))},xe.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},xe.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=ye.x,this.curveY=ye.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Fe)&&(this.activeGrip=this.curveGrip,this._state="resize")},xe.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},xe.prototype.setupControlBox=function(){Re.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},xe.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Re.prototype.addControlGrips.call(this)},xe.prototype.positionGrips=function(){Re.prototype.positionGrips.call(this);var ye=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-ye/2,this.curveY-ye/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},xe.prototype.manipulate=function(ye){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+ye.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+ye.y-this.manipulationStartY),Re.prototype.manipulate.call(this,ye)},xe.prototype.resize=function(ye){this.activeGrip===this.curveGrip&&(this.curveX=ye.x,this.curveY=ye.y),Re.prototype.resize.call(this,ye),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},xe.prototype.setStrokeColor=function(ye){this.strokeColor=ye,this.adjustVisual(),this.colorChanged(ye)},xe.prototype.setStrokeWidth=function(ye){this.strokeWidth=ye,this.adjustVisual()},xe.prototype.setStrokeDasharray=function(ye){this.strokeDasharray=ye,this.adjustVisual()},xe.prototype.scale=function(ye,Fe){this.curveX=this.curveX*ye,this.curveY=this.curveY*Fe,Re.prototype.scale.call(this,ye,Fe)},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Re.prototype.getState.call(this));return ye.typeName=xe.typeName,ye},xe.prototype.restoreState=function(ye){Re.prototype.restoreState.call(this,ye);var Fe=ye;this.strokeColor=Fe.strokeColor,this.strokeWidth=Fe.strokeWidth,this.strokeDasharray=Fe.strokeDasharray,this.curveX=Fe.curveX,this.curveY=Fe.curveY,this.createVisual(),this.adjustVisual()},xe.typeName="CurveMarker",xe.title="Curve marker",xe.icon='',xe}(Oe),Ne=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,Fe,Qe)||this;return Ie.fillColor="transparent",Ie.strokeColor="transparent",Ie.strokeWidth=0,Ie.strokeDasharray="",Ie.textColor="transparent",Ie.fontSize="1rem",Ie.isMoved=!1,Ie.captionText="Caption",Ie.PADDING=5,Ie.captionBoxWidth=0,Ie.captionBoxHeight=0,Ie.strokeColor=Qe.defaultColor,Ie.strokeWidth=Qe.defaultStrokeWidth,Ie.strokeDasharray=Qe.defaultStrokeDasharray,Ie.fillColor=Qe.defaultFillColor,Ie.textColor=Qe.defaultStrokeColor,Ie.fontFamily=Qe.defaultFontFamily,Ie.fontSize=Qe.defaultCaptionFontSize,Ie.captionText=Qe.defaultCaptionText,Ie.setStrokeColor=Ie.setStrokeColor.bind(Ie),Ie.setFillColor=Ie.setFillColor.bind(Ie),Ie.setStrokeWidth=Ie.setStrokeWidth.bind(Ie),Ie.setStrokeDasharray=Ie.setStrokeDasharray.bind(Ie),Ie.createVisual=Ie.createVisual.bind(Ie),Ie.sizeCaption=Ie.sizeCaption.bind(Ie),Ie.setCaptionText=Ie.setCaptionText.bind(Ie),Ie.showTextEditor=Ie.showTextEditor.bind(Ie),Ie.positionTextEditor=Ie.positionTextEditor.bind(Ie),Ie.finishTextEditing=Ie.finishTextEditing.bind(Ie),Ie.setFont=Ie.setFont.bind(Ie),Ie.setTextColor=Ie.setTextColor.bind(Ie),Ie.strokePanel=new be("Line color",ee(Qe.defaultColorSet,["transparent"]),Ie.strokeColor),Ie.strokePanel.onColorChanged=Ie.setStrokeColor,Ie.fillPanel=new be("Fill color",ee(Qe.defaultColorSet,["transparent"]),Ie.fillColor,$e),Ie.fillPanel.onColorChanged=Ie.setFillColor,Ie.strokeWidthPanel=new Se("Line width",Qe.defaultStrokeWidths,Qe.defaultStrokeWidth),Ie.strokeWidthPanel.onWidthChanged=Ie.setStrokeWidth,Ie.strokeStylePanel=new De("Line style",Qe.defaultStrokeDasharrays,Qe.defaultStrokeDasharray),Ie.strokeStylePanel.onStyleChanged=Ie.setStrokeDasharray,Ie.fontFamilyPanel=new Xe("Font",Qe.defaultFontFamilies,Qe.defaultFontFamily),Ie.fontFamilyPanel.onFontChanged=Ie.setFont,Ie.textColorPanel=new be("Text color",Qe.defaultColorSet,Ie.textColor,Ye),Ie.textColorPanel.onColorChanged=Ie.setTextColor,Ie}return z(xe,Re),xe.prototype.ownsTarget=function(ye){return!(!Re.prototype.ownsTarget.call(this,ye)&&ye!==this.visual&&ye!==this.frame&&ye!==this.captionBg&&ye!==this.captionElement)},xe.prototype.createVisual=function(){this.visual=se.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=se.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=se.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=se.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},xe.prototype.setCaptionText=function(ye){this.captionText=ye,this.captionElement.textContent=this.captionText,this.sizeCaption()},xe.prototype.pointerDown=function(ye,Fe){Re.prototype.pointerDown.call(this,ye,Fe),this.isMoved=!1,this.pointerDownPoint=ye,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(ye),this._state="creating")},xe.prototype.manipulate=function(ye){Re.prototype.manipulate.call(this,ye),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(ye.x-this.pointerDownPoint.x)>5||Math.abs(ye.y-this.pointerDownPoint.y)>5)},xe.prototype.resize=function(ye){Re.prototype.resize.call(this,ye),this.setSize()},xe.prototype.sizeCaption=function(){var ye=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=ye.width+2*this.PADDING,this.captionBoxHeight=ye.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),se.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),se.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},xe.prototype.showTextEditor=function(){var ye=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(Fe){Fe.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Fe){Fe.key==="Enter"&&ye.finishTextEditing(ye.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Fe){Fe.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){ye.finishTextEditing(ye.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){ye.finishTextEditing(ye.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},xe.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},xe.prototype.finishTextEditing=function(ye){this.setCaptionText(ye.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},xe.prototype.setFont=function(ye){this.captionElement&&se.setAttributes(this.captionElement,[["font-family",ye]]),this.fontFamily=ye,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},xe.prototype.setTextColor=function(ye){this.captionElement&&se.setAttributes(this.captionElement,[["fill",ye]]),this.textColor=ye,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},xe.prototype.setSize=function(){Re.prototype.setSize.call(this),se.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},xe.prototype.pointerUp=function(ye){Re.prototype.pointerUp.call(this,ye),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},xe.prototype.dblClick=function(ye,Fe){Re.prototype.dblClick.call(this,ye,Fe),this.showTextEditor()},xe.prototype.setStrokeColor=function(ye){this.strokeColor=ye,this.frame&&se.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(ye),this.stateChanged()},xe.prototype.setFillColor=function(ye){this.fillColor=ye,this.captionBg&&se.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(ye),this.stateChanged()},xe.prototype.setStrokeWidth=function(ye){this.strokeWidth=ye,this.frame&&se.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},xe.prototype.setStrokeDasharray=function(ye){this.strokeDasharray=ye,this.frame&&se.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(xe.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),xe.prototype.getState=function(){var ye=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Re.prototype.getState.call(this));return ye.typeName=this.typeName,ye},xe.prototype.restoreState=function(ye){var Fe=ye;this.fillColor=Fe.fillColor,this.strokeColor=Fe.strokeColor,this.strokeWidth=Fe.strokeWidth,this.strokeDasharray=Fe.strokeDasharray,this.textColor=Fe.textColor,this.fontFamily=Fe.fontFamily,this.captionText=Fe.captionText,this.fontSize=Fe.fontSize,this.createVisual(),Re.prototype.restoreState.call(this,ye),this.setSize()},xe.prototype.scale=function(ye,Fe){Re.prototype.scale.call(this,ye,Fe),this.setSize()},xe.typeName="CaptionFrameMarker",xe.title="Caption frame marker",xe.icon='',xe}(de),ze=function(){function Re(xe,ye){ye===void 0&&(ye=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=xe,this.cancelable=ye}return Object.defineProperty(Re.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Re.prototype.preventDefault=function(){this._defaultPrevented=!0},Re}(),Me=function(Re){function xe(ye,Fe,Qe){var Ie=Re.call(this,ye,!1)||this;return Ie.dataUrl=Fe,Ie.state=Qe,Ie}return z(xe,Re),xe}(ze),Ge=function(Re){function xe(ye,Fe,Qe){Qe===void 0&&(Qe=!1);var Ie=Re.call(this,ye,Qe)||this;return Ie.marker=Fe,Ie}return z(xe,Re),xe}(ze),ct=function(){function Re(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Re.prototype.addEventListener=function(xe,ye){this[xe].push(ye)},Re.prototype.removeEventListener=function(xe,ye){var Fe=this[xe].indexOf(ye);Fe>-1&&this[xe].splice(Fe,1)},Re}(),mt=function(){function Re(xe){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ee,this._isOpen=!1,this.undoRedoManager=new lt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new ct,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Re.instanceCounter++,this.styles=new le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=xe,this.targetRoot=document.body,this.width=xe.clientWidth,this.height=xe.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Re.prototype,"ALL_MARKER_TYPES",{get:function(){return[_e,st,Ue,et,ut,ft,it,Ke,tt,rt,He,Ze,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_e,st,Ue,et,ft,it,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_e,st,Ue,et,it]},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(xe){var ye=this;this._availableMarkerTypes.splice(0),xe.forEach(function(Fe){if(typeof Fe=="string"){var Qe=ye.ALL_MARKER_TYPES.find(function(Ie){return Ie.typeName===Fe});Qe!==void 0&&ye._availableMarkerTypes.push(Qe)}else ye._availableMarkerTypes.push(Fe)})},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(xe){this._zoomLevel=xe,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Re.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Re.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),E.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Re.prototype.show=function(){var xe=this;this.styles.styleSheetRoot===void 0&&re.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=re.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(ye){return ye(new ze(xe))})},Re.prototype.render=function(){return oe(this,void 0,void 0,function(){var xe;return ie(this,function(ye){switch(ye.label){case 0:return this.setCurrentMarker(),(xe=new te).naturalSize=this.renderAtNaturalSize,xe.imageType=this.renderImageType,xe.imageQuality=this.renderImageQuality,xe.markersOnly=this.renderMarkersOnly,xe.width=this.renderWidth,xe.height=this.renderHeight,[4,xe.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return ye.sent(),[4,xe.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,ye.sent()]}})})},Re.prototype.close=function(xe){var ye=this;if(xe===void 0&&(xe=!1),this.isOpen){var Fe=!1;xe||this.eventListeners.beforeclose.forEach(function(Qe){var Ie=new ze(ye,!0);Qe(Ie),Ie.defaultPrevented&&(Fe=!0)}),Fe||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Qe){return Qe(new ze(ye))}),this.detachEvents(),this._isOpen=!1)}},Re.prototype.addMarkersToToolbar=function(){for(var xe,ye=[],Fe=0;Fethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*xe:this.editorCanvas.clientWidth,Fe=ye',xe.title="Powered by marker.js",xe.style.display="grid",xe.style.alignItems="center",xe.style.justifyItems="center",xe.style.padding="3px",xe.style.width="20px",xe.style.height="20px",this.logoUI.appendChild(xe),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Re.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Re.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Re.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Re.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var xe=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=xe+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new he(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop-1&&this.markers.splice(this.markers.indexOf(xe),1),xe.dispose()},Re.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Re.prototype.toolbarButtonClicked=function(xe,ye){if(xe==="marker"&&ye!==void 0)this.createNewMarker(ye);else if(xe==="action")switch(ye){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Re.prototype.deleteSelectedMarker=function(){var xe=this;if(this._currentMarker!==void 0){var ye=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Qe){var Ie=new Ge(xe,xe._currentMarker,!0);Qe(Ie),Ie.defaultPrevented&&(ye=!0)}),!ye){var Fe=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Qe){return Qe(new Ge(xe,Fe))})}}},Re.prototype.clear=function(){var xe=this,ye=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(vt){var yt=new Ge(xe,void 0,!0);vt(yt),yt.defaultPrevented&&(ye=!0)}),!ye)){this.setCurrentMarker();for(var Fe=function(vt){var yt=Qe.markers[vt];Qe.setCurrentMarker(Qe.markers[vt]),Qe._currentMarker.dispose(),Qe.markerImage.removeChild(Qe._currentMarker.container),Qe.markers.splice(Qe.markers.indexOf(Qe._currentMarker),1),Qe.eventListeners.markerdelete.forEach(function(xt){return xt(new Ge(xe,yt))})},Qe=this,Ie=this.markers.length-1;Ie>=0;Ie--)Fe(Ie);this.addUndoStep()}},Object.defineProperty(Re.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Re.prototype.showNotesEditor=function(){var xe;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(xe=this._currentMarker.notes)!==null&&xe!==void 0?xe:"",this.overlayContainer.appendChild(this.notesArea))},Re.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Re.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Re.prototype.addUndoStep=function(){var xe=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var ye=this.getState(),Fe=this.undoRedoManager.getLastUndoStep();if(!Fe||Fe.width===ye.width&&Fe.height===ye.height){var Qe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(ye),Qe1&&this.panTo({x:xe.clientX,y:xe.clientY}))},Re.prototype.onPointerUp=function(xe){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(xe.clientX,xe.clientY)),this.isDragging=!1,this.addUndoStep()},Re.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Re.prototype.onKeyUp=function(xe){this._currentMarker===void 0||this.notesArea!==void 0||xe.key!=="Delete"&&xe.key!=="Backspace"||this.deleteSelectedMarker()},Re.prototype.clientToLocalCoordinates=function(xe,ye){var Fe=this.markerImage.getBoundingClientRect();return{x:(xe-Fe.left)/this.zoomLevel,y:(ye-Fe.top)/this.zoomLevel}},Re.prototype.onWindowResize=function(){this.positionUI()},Re.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var xe=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=xe+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Re.prototype.addLicenseKey=function(xe){E.addKey(xe)},Re.prototype.addEventListener=function(xe,ye){this.eventListeners.addEventListener(xe,ye)},Re.prototype.removeEventListener=function(xe,ye){this.eventListeners.removeEventListener(xe,ye)},Re.prototype.renderState=function(xe){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(xe),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Re.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Re.prototype.focus=function(){var xe=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(ye){return ye(new ze(xe))}))},Re.prototype.blur=function(){var xe=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(ye){return ye(new ze(xe))}))},Re.instanceCounter=0,Re}(),nt=Ve(97013),Ae=Ve(31735),je=(Re,xe,ye)=>new Promise((Fe,Qe)=>{var Ie=xt=>{try{yt(ye.next(xt))}catch(bt){Qe(bt)}},vt=xt=>{try{yt(ye.throw(xt))}catch(bt){Qe(bt)}},yt=xt=>xt.done?Fe(xt.value):Promise.resolve(xt.value).then(Ie,vt);yt((ye=ye.apply(Re,xe)).next())}),at=({data:Re,className:xe,fullWidth:ye,style:Fe={},onClose:Qe,onOk:Ie,showFullTools:vt,noAssociationId:yt})=>{const xt=(0,Je.useRef)(null),bt=(0,Je.useRef)(null),ht=(0,Je.useRef)(null),kt=(0,Je.useRef)(null),[Tt,Pt]=(0,Je.useState)(!1),[Vt,vr]=(0,Je.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,Je.useEffect)(()=>(ht.current||(ht.current=document.createElement("style"),document.head.appendChild(ht.current)),Re!=null&&Re.visible?(document.body.setAttribute("data-custom","y-hidden"),ht.current.innerHTML=" html { overflow-y: hidden; }",Re!=null&&Re.src&&Yt()):(document.body.removeAttribute("data-custom"),ht.current&&(document.head.removeChild(ht.current),ht.current=null)),()=>{document.body.removeAttribute("data-custom"),ht.current&&(document.head.removeChild(ht.current),ht.current=null)}),[Re==null?void 0:Re.visible]);const Yt=()=>je(void 0,null,function*(){Pt(!0),vr("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Mr=yield(0,Ae.ZJ)(Re==null?void 0:Re.src);xt.current.src="",xt.current.src=Mr,xt.current.onload=function(){Pr()},Pt(!1),vr("")}),Cr=Mr=>je(void 0,null,function*(){Pt(!0),vr("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Xr=yield(0,nt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Re.title,file:Mr.dataUrl}});Xr!=null&&Xr.id&&!yt?(yield(0,nt.ZP)(`/api/attachments/${Re.id}/add_subitem.json`,{method:"post",body:{subitem_id:Xr==null?void 0:Xr.id,settings:JSON.stringify(Mr.state)}})).status===0&&Ie():Xr!=null&&Xr.id&&Ie(Xr),Pt(!1),vr("")}),jr=()=>{const Mr=document.querySelector('a[href="https://markerjs.com/"]');Mr&&Mr.parentNode&&(Mr.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(mn=>{const cn=document.querySelector(mn.name);cn&&cn.setAttribute("title",mn.title)})},Pr=()=>{bt.current=new mt(xt.current),bt.current.targetRoot=kt.current,bt.current.addEventListener("render",Cr),bt.current.addEventListener("beforeclose",Qe),vt&&(bt.current.availableMarkerTypes=bt.current.ALL_MARKER_TYPES,bt.current.uiStyleSettings.redoButtonVisible=!0,bt.current.uiStyleSettings.notesButtonVisible=!0,bt.current.uiStyleSettings.zoomButtonVisible=!0,bt.current.uiStyleSettings.zoomOutButtonVisible=!0,bt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=bt.current.uiStyleSettings,bt.current.show(),Re!=null&&Re.snapshotData&&bt.current.restoreState(Re.snapshotData),setTimeout(()=>{window.scrollTo(0,0),jr()},300)};return Je.createElement(Je.Fragment,null,(Re==null?void 0:Re.visible)&&Je.createElement(ve.Z,{spinning:Tt,tip:Vt,style:{position:"absolute",width:"100vw"}},Je.createElement("div",{ref:kt,className:we()(wt.imageDimensions,xe,ye?wt.fullWidth:""),style:Fe},Je.createElement("img",{className:wt.img,ref:xt}))))}},50047:function(Kt,_t,Ve){"use strict";var Je=Ve(59301),wt=Ve(77019),y=Ve(5269),we=Ve(20554),ve=Ve(7939),x=Ve(59944),z=Ve(40862),oe=Ve(48136),ie=Ve(59301);const ee=(0,Je.forwardRef)(({callback:se,showSaveButton:E,value:te=""},re)=>{const le=(0,Je.useRef)(),ue=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ce=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r x=a + r\\text{cos}\\theta \\ \r y=b + r\\text{sin}\\theta \r \\end{matrix}\\right. `},{value:`\\begin{array}{l} \r \\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r \\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r \\end{array} `},{value:`\\begin{array}{l} \r a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r \\left\\{\\begin{matrix} \r \\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r \\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r \\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r \\end{matrix}\\right. \r \\end{array} `},{value:`\\begin{array}{l} \r a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r \\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r a \\perp \\alpha \\ \r b \\perp \\alpha \r \\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r \\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r a \\parallel \\partial ,b \\parallel \\partial \r \\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r a \\perp m,a \\perp n \r \\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r \\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r a^{2}+b^{2}=c^{2} \r \\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r \\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r \\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r a,b \\in R^{+} \\ \r \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r \\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r \\end{array}`},{value:`\\begin{array}{c} \r a,b \\in R \\ \r \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r \\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r \\end{array}`},{value:`\\begin{array}{c} \r H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r \\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r \\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r \\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r \\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r P \\left( \\emptyset \\right) =0 \\\\ \r P \\left( S \\right) =1 \r \\end{array}`},{value:`\\begin{array}{c} \r \\forall A \\in S \\\\ \r P \\left( A \\right) \\ge 0 \r \\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r \\end{array}`},{value:`\\begin{array}{c} \r P_{n}=n! \\\\ \r A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r \\end{array}`}]}]}],he=be=>{le.current.setValue(le.current.getValue()+" "+be.value+" ")},me=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ie.createElement(wt.Z,{className:z.Z.lists,gutter:[10,10]},ue.map((be,Ce)=>ie.createElement(y.Z,{flex:"110px",className:z.Z.item},ie.createElement("div",null,ie.createElement(x.Z,{value:`$$${be.value}$$`}),be.name),ie.createElement("div",{className:z.Z.children},be.children.map((Te,Pe)=>ie.createElement("div",{key:Pe},ie.createElement("h1",null,Te.name),ie.createElement(wt.Z,{gutter:[10,10]},Te.data.map((ke,de)=>ie.createElement(y.Z,{key:de,onClick:()=>he(ke),className:z.Z.diamond},ie.createElement(x.Z,{value:"`$$"+ke.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ie.createElement(wt.Z,{className:z.Z.lists,gutter:[10,10]},ce.map((be,Ce)=>ie.createElement(y.Z,{flex:"110px",className:z.Z.item},ie.createElement("div",null,ie.createElement(x.Z,{value:"`$$"+be.value+"$$`"}),be.name),ie.createElement("div",{className:z.Z.children},be.children.map((Te,Pe)=>ie.createElement("div",{key:Pe},Te.name&&ie.createElement("h1",null,Te.name),ie.createElement(wt.Z,{gutter:[10,10]},Te.data.map((ke,de)=>ie.createElement(y.Z,{key:de,onClick:()=>he(ke),className:z.Z.diamond},ie.createElement(x.Z,{value:"`$$"+ke.value+"$$`"}))))))))))}],fe=()=>{var be=document.createElement("div");be.innerHTML=le.current.getValue();var Ce=be.innerText;return se&&se(Ce),Ce};return(0,Je.useImperativeHandle)(re,()=>({getData:fe})),ie.createElement("div",{className:z.Z.mathWrap},ie.createElement(we.default,{defaultActiveKey:"1",items:me}),ie.createElement("math-field",{locale:"zh_cn",className:z.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:le,style:{width:800,marginTop:30,fontSize:18}},te||""),E&&ie.createElement("div",{className:z.Z.button},ie.createElement(ve.ZP,{size:"large",onClick:fe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});_t.Z=ee},59243:function(Kt,_t,Ve){"use strict";var Je=Ve(59301),wt=Ve(93314),y=Ve(7939),we=Object.defineProperty,ve=Object.defineProperties,x=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,ee=(re,le,ue)=>le in re?we(re,le,{enumerable:!0,configurable:!0,writable:!0,value:ue}):re[le]=ue,se=(re,le)=>{for(var ue in le||(le={}))oe.call(le,ue)&&ee(re,ue,le[ue]);if(z)for(var ue of z(le))ie.call(le,ue)&&ee(re,ue,le[ue]);return re},E=(re,le)=>ve(re,x(le));const te=({img:re,buttonProps:le={},styles:ue={},customText:ce,ButtonText:he,ButtonClick:me,Buttonclass:fe,ButtonTwo:be,imgStyles:Ce,loading:Te=!1,className:Pe=""})=>Je.createElement("section",{className:`tc animated fadeIn ${Pe}`,style:se({color:"#999",margin:"100px auto",visibility:Te?"hidden":"visible"},ue)},Je.createElement("img",{src:re||wt,style:E(se({},Ce),{pointerEvents:"none",userSelect:"none"})}),Je.createElement("p",{className:"mt20 font14"},ce||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),he&&Je.createElement(y.ZP,se({className:fe,onClick:me},le),he),be&&be);_t.Z=te},47199:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return fe}});var Je=Ve(59301),wt={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},y=Ve(7939),we=Ve(70557),ve=Ve(58478),x=Ve(25399),z=Ve(31735),oe=Ve(22167),ie=Ve(59243),ee=Ve(26869),se=Ve(38609),E=Ve(59301),te=Object.defineProperty,re=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ce=(be,Ce,Te)=>Ce in be?te(be,Ce,{enumerable:!0,configurable:!0,writable:!0,value:Te}):be[Ce]=Te,he=(be,Ce)=>{for(var Te in Ce||(Ce={}))le.call(Ce,Te)&&ce(be,Te,Ce[Te]);if(re)for(var Te of re(Ce))ue.call(Ce,Te)&&ce(be,Te,Ce[Te]);return be},me=(be,Ce,Te)=>new Promise((Pe,ke)=>{var de=De=>{try{Se(Te.next(De))}catch(_e){ke(_e)}},ge=De=>{try{Se(Te.throw(De))}catch(_e){ke(_e)}},Se=De=>De.done?Pe(De.value):Promise.resolve(De.value).then(de,ge);Se((Te=Te.apply(be,Ce)).next())}),fe=({editOffice:be="view",data:Ce,issaver:Te,onSaver:Pe,theme:ke,type:de,filename:ge,monacoEditor:Se,className:De,style:_e,close:Ee,onClose:Oe,hasMask:He,disabledDownload:Xe,onImgDimensions:et,showNodata:st,recordInfo:Le})=>{const[Ue,rt]=(0,Je.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[ot,it]=(0,Je.useState)(""),[Ye,$e]=(0,Je.useState)(),Ke=window.ENV==="build"?"/react/build":"",ft=location.host.startsWith("localhost")?ee.Z.PROXY_SERVER:ee.Z.API_SERVER,ut=10*(1024*1024),lt=(0,Je.useRef)();Ce!=null&&Ce.startsWith("/api")&&de!=="txt"&&(Ce=ee.Z.API_SERVER+Ce);const Ze=ct=>ct.substring(ct.lastIndexOf("/")+1).split(".").pop();ge&&Se&&(Se.filename=ge),(0,Je.useEffect)(()=>{var ct,mt;const nt=(mt=(ct=document.cookie)==null?void 0:ct.replace(/\s/g,""))==null?void 0:mt.split(";");nt==null||nt.map(Ae=>{let je=Ae.split("=");je[0]==="_educoder_session"&&it(je[1])})},[]),(0,Je.useEffect)(()=>{de==="office"&&(Ce.indexOf("bigfilescdn.")>-1||Ce.indexOf("bigfiles1")>-1?$e({url:Ce,fileType:Ze(Ce),model:Ce.indexOf("model=edit")?"edit":"view"}):ze())},[de,Ce]);function Ne(ct){return me(this,null,function*(){ct.data.type==="pdfdata"&&(Pe(ct.data.data),window.removeEventListener("message",Ne,!1)),console.log("mess---:",ct.data)})}const ze=()=>me(void 0,null,function*(){console.log("data:",Ce);let ct=Ce;Ce.startsWith("http")||(ct=location.origin+ct);let mt=new URL(ct).pathname.split("/").pop();const nt=yield(0,oe.gJ)({attachment_id:mt});nt.url=ft+nt.url,$e(nt)}),Me=()=>{if(Ce.startsWith("http")||Ce.startsWith("blob:")){Ge();return}(0,z.Sv)(ge||"educoder",Ce,ge)},Ge=()=>{Le&&(0,se.fc)({id:Le==null?void 0:Le.id,watch_type:1,course_id:Le==null?void 0:Le.course_id}),(0,z.Nd)(ge||"educoder",decodeURIComponent(Ce))};return E.createElement("div",{style:he({},_e||{}),className:`${He&&wt.bgBlack} ${de?wt.wrp:"hide"}`},Ee&&E.createElement("div",{className:wt.close,ref:lt},!!et&&E.createElement(x.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>lt.current},E.createElement("span",{onClick:()=>{Oe(),et()}},E.createElement("i",{className:"icon-yulanpizhu"}))),!Xe&&E.createElement(x.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>lt.current},E.createElement("span",{onClick:Ge},E.createElement("i",{className:"icon-quxiaozhiding"}))),Te&&E.createElement(x.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>lt.current},E.createElement("span",{className:"",onClick:()=>{const ct=document.getElementById("pdfiframe");window.addEventListener("message",Ne,!1),setTimeout(()=>{ct.contentWindow.postMessage("getData","*")},300)}},E.createElement("i",{className:"icon-baocun"}))),E.createElement(x.Z,{title:"\u5173\u95ED",getPopupContainer:()=>lt.current},E.createElement("span",{className:"",onClick:()=>{Oe()}},E.createElement("i",{className:"icon-guanbi1"})))),E.createElement("div",{className:`${wt[De]} ${De} ${wt.monaco} ${de==="txt"?"show":"hide"}`},de==="txt"&&E.createElement(E.Fragment,null,E.createElement(ve.ZP,he({},Se)))),de==="audio"&&E.createElement("audio",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Ce}`,autoPlay:!0}),de==="video"&&E.createElement(E.Fragment,null,(Ce==null?void 0:Ce.indexOf("http"))>-1?E.createElement("video",{controls:!0,src:`${Ce}`,autoPlay:!0}):E.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Ce}`,autoPlay:!0})),de==="office"&&Ye&&E.createElement("iframe",{src:`${Ke}/office.html?key=${Ye.key}&url=${btoa(Ye.url)}&callbackUrl=${ft+(Ye.callbackUrl||"")}&fileType=${Ye.fileType}&title=${Ye.title||""}&model=${be}&officeServer=${ee.Z.ONLYOFFICE}&disabledDownload=${!!Xe}`}),de==="html"&&E.createElement("iframe",{src:Ce+"&disposition=inline"}),de==="pdf"&&Te&&E.createElement("iframe",{id:"pdfiframe",src:`${Ke}/js/pdfview/index.html?filename=${ge||"educoder.pdf"}&url=${encodeURIComponent(Ce)}&disabledDownload=${!!Xe}&model=${be}`}),de==="pdf"&&!Te&&E.createElement("embed",{className:wt.embed,src:Ce+"#toolbar=0&statusbar=0&navpanes=0&scrollbars=0"}),de==="image"&&E.createElement("img",{src:`${(Ce==null?void 0:Ce.indexOf("http://"))>-1||(Ce==null?void 0:Ce.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Ce}`}),(de==="other"||de==="download")&&E.createElement(E.Fragment,null,st?E.createElement(ie.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:E.createElement(y.ZP,{icon:E.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Me,disabled:Xe},"\u4E0B\u8F7D")}):E.createElement(y.ZP,{type:"primary",size:"middle",onClick:Me,disabled:Xe},E.createElement(we.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),de==="flowChart"&&E.createElement("div",{className:"embed"},E.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${Ce||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},59944:function(Kt,_t,Ve){"use strict";Ve.d(_t,{z:function(){return Se},Z:function(){return De}});var Je=Ve(59301),wt=Ve(54196),y=Ve(58489),we=Ve(64018),ve=Ve(80360),x=Ve(26869),z=Ve(31735),oe=Ve(15342),ie=Ve(44104),ee=Ve(7939),se=Ve(1012),E=Ve(47199),te=Ve(59301),le=({html:_e})=>{const Ee=(0,Je.useRef)(null),Oe=(0,Je.useRef)(null),He=`.markdown-body p { margin: 0 0 16px 0 !important; line-height: 28px; white-space: pre-wrap; } ol, ul, li { list-style-type: none } ol, ul, dl { margin-bottom: 0px; } .markdown-body { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #333; overflow: hidden; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif; word-break: break-word; font-size: 16px; line-height: 1.6; white-space: normal; word-wrap: break-word; position: relative; } .markdown-body ul>li { list-style-type: disc; } .markdown-body ol>li { list-style-type: decimal; } .markdown-body a { background: transparent; } .markdown-body a:active, .markdown-body a:hover { outline: 0; } .markdown-body strong { font-weight: bold; } .markdown-body h1 { font-size: 2em; margin: 0.67em 0; } .markdown-body img { border: 0; } .markdown-body hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } .markdown-body pre { overflow: auto; } .markdown-body code, .markdown-body kbd, .markdown-body pre { font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace; font-size: 1em; } .markdown-body input { color: inherit; font: inherit; margin: 0; } .markdown-body html input[disabled] { cursor: default; } .markdown-body input { line-height: normal; } .markdown-body input[type="checkbox"] { -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; } .markdown-body table { border-collapse: collapse; border-spacing: 0; } .markdown-body td, .markdown-body th { padding: 0; } .markdown-body * { -moz-box-sizing: border-box; box-sizing: border-box; } .markdown-body input { font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; } .markdown-body a { color: #4183c4; text-decoration: none; } .markdown-body a:hover, .markdown-body a:active { text-decoration: underline; } .markdown-body hr { height: 0; margin: 15px 0; overflow: hidden; background: transparent; border: 0; border-bottom: 1px solid #ddd; } .markdown-body hr:before { display: table; content: ""; } .markdown-body hr:after { display: table; clear: both; content: ""; } .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin-top: 15px; margin-bottom: 15px; line-height: 1.1; } .markdown-body h1 { font-size: 30px; } .markdown-body h2 { font-size: 21px; } .markdown-body h3 { font-size: 16px; } .markdown-body h4 { font-size: 14px; } .markdown-body h5 { font-size: 12px; } .markdown-body h6 { font-size: 11px; } .markdown-body blockquote { margin: 0; } .markdown-body ul, .markdown-body ol { padding: 0; margin-top: 0; margin-bottom: 0; } ul.linenums, ol.linenums { padding: 16px 0 0 56px !important; } .markdown-body ul, .markdown-body ol { padding-left: 2em; } .markdown-body ol ol, .markdown-body ul ol { list-style-type: lower-roman; } .markdown-body ul ul ol, .markdown-body ul ol ol, .markdown-body ol ul ol, .markdown-body ol ol ol { list-style-type: lower-alpha; } .markdown-body dd { margin-left: 0; } .markdown-body code { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; } .markdown-body pre { margin-top: 0; margin-bottom: 0; font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; } .markdown-body .octicon { font: normal normal 16px octicons-anchor; line-height: 1; display: inline-block; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .markdown-body .octicon-link:before { content: '\f05c'; } .markdown-body>*:first-child { margin-top: 0 !important; } .markdown-body>*:last-child { margin-bottom: 0 !important; } .markdown-body .anchor { position: absolute; top: 0; left: 0; display: block; padding-right: 6px; padding-left: 30px; margin-left: -30px; } .markdown-body .anchor:focus { outline: none; } .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { position: relative; margin-top: 1em; margin-bottom: 16px; font-weight: bold; line-height: 1.4; } .markdown-body h1 .octicon-link, .markdown-body h2 .octicon-link, .markdown-body h3 .octicon-link, .markdown-body h4 .octicon-link, .markdown-body h5 .octicon-link, .markdown-body h6 .octicon-link { display: none; color: #000; vertical-align: middle; } .markdown-body h1:hover .anchor, .markdown-body h2:hover .anchor, .markdown-body h3:hover .anchor, .markdown-body h4:hover .anchor, .markdown-body h5:hover .anchor, .markdown-body h6:hover .anchor { padding-left: 8px; margin-left: -30px; text-decoration: none; } .markdown-body h1:hover .anchor .octicon-link, .markdown-body h2:hover .anchor .octicon-link, .markdown-body h3:hover .anchor .octicon-link, .markdown-body h4:hover .anchor .octicon-link, .markdown-body h5:hover .anchor .octicon-link, .markdown-body h6:hover .anchor .octicon-link { display: inline-block; } .markdown-body h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid #eee; } .markdown-body h1 .anchor { line-height: 1; } .markdown-body h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid #eee; } .markdown-body h2 .anchor { line-height: 1; } .markdown-body h3 { font-size: 1.5em; line-height: 1.43; } .markdown-body h3 .anchor { line-height: 1.2; } .markdown-body h4 { font-size: 1.25em; } .markdown-body h4 .anchor { line-height: 1.2; } .markdown-body h5 { font-size: 1em; } .markdown-body h5 .anchor { line-height: 1.1; } .markdown-body h6 { font-size: 1em; color: #777; } .markdown-body h6 .anchor { line-height: 1.1; } .markdown-body p, .markdown-body blockquote, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body table, .markdown-body pre { margin-top: 0; margin-bottom: 16px; } .markdown-body ul ul, .markdown-body ul ol, .markdown-body ol ol, .markdown-body ol ul { margin-top: 0; margin-bottom: 0; } .markdown-body li>p { margin-top: 16px; } .markdown-body dl { padding: 0; } .markdown-body dl dt { padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: bold; } .markdown-body dl dd { padding: 0 16px; margin-bottom: 16px; } .markdown-body blockquote { padding: 0 15px; color: #777; border-left: 4px solid #ddd; } .markdown-body blockquote> :first-child { margin-top: 0; } .markdown-body blockquote> :last-child { margin-bottom: 0; } .markdown-body table { display: block; width: 100%; overflow: auto; word-break: normal; word-break: keep-all; } .markdown-body table th { font-weight: bold; text-align: revert; } .markdown-body table th, .markdown-body table td { padding: 6px 13px; border: 1px solid #ddd; } .markdown-body table tr { background-color: #fff; border-top: 1px solid #ccc; } .markdown-body table tr:nth-child(2n) { background-color: #f8f8f8; } .markdown-body img { max-width: 100%; -moz-box-sizing: border-box; box-sizing: border-box; } .markdown-body code { padding: 0; padding-top: 0.2em; padding-bottom: 0.2em; margin: 0; font-size: 85%; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; } .markdown-body code:has(.katex) { background-color: transparent; } .markdown-body code:before, .markdown-body code:after { letter-spacing: -0.2em; content: "\\00a0"; } .markdown-body pre>code { padding: 0; margin: 0; font-size: 100%; word-break: normal; white-space: pre; background: transparent; border: 0; } .markdown-body .highlight { margin-bottom: 16px; } .markdown-body .highlight pre, .markdown-body pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f7f7f7; border-radius: 3px; } .markdown-body .highlight pre { margin-bottom: 0; word-break: normal; } .markdown-body pre { word-wrap: normal; } .markdown-body pre code { display: inline; max-width: initial; padding: 0; margin: 0; overflow: initial; line-height: inherit; word-wrap: normal; background-color: transparent; border: 0; } .markdown-body pre code:before, .markdown-body pre code:after { content: normal; } .markdown-body kbd { display: inline-block; padding: 3px 5px; font-size: 11px; line-height: 10px; color: #555; vertical-align: middle; background-color: #fcfcfc; border: solid 1px #ccc; border-bottom-color: #bbb; border-radius: 3px; box-shadow: inset 0 -1px 0 #bbb; } .markdown-body .pl-c { color: #969896; } .markdown-body .pl-c1, .markdown-body .pl-mdh, .markdown-body .pl-mm, .markdown-body .pl-mp, .markdown-body .pl-mr, .markdown-body .pl-s1 .pl-v, .markdown-body .pl-s3, .markdown-body .pl-sc, .markdown-body .pl-sv { color: #0086b3; } .markdown-body .pl-e, .markdown-body .pl-en { color: #795da3; } .markdown-body .pl-s1 .pl-s2, .markdown-body .pl-smi, .markdown-body .pl-smp, .markdown-body .pl-stj, .markdown-body .pl-vo, .markdown-body .pl-vpf { color: #333; } .markdown-body .pl-ent { color: #63a35c; } .markdown-body .pl-k, .markdown-body .pl-s, .markdown-body .pl-st { color: #a71d5d; } .markdown-body .pl-pds, .markdown-body .pl-s1, .markdown-body .pl-s1 .pl-pse .pl-s2, .markdown-body .pl-sr, .markdown-body .pl-sr .pl-cce, .markdown-body .pl-sr .pl-sra, .markdown-body .pl-sr .pl-sre, .markdown-body .pl-src { color: #df5000; } .markdown-body .pl-mo, .markdown-body .pl-v { color: #1d3e81; } .markdown-body .pl-id { color: #b52a1d; } .markdown-body .pl-ii { background-color: #b52a1d; color: #f8f8f8; } .markdown-body .pl-sr .pl-cce { color: #63a35c; font-weight: bold; } .markdown-body .pl-ml { color: #693a17; } .markdown-body .pl-mh, .markdown-body .pl-mh .pl-en, .markdown-body .pl-ms { color: #1d3e81; font-weight: bold; } .markdown-body .pl-mq { color: #008080; } .markdown-body .pl-mi { color: #333; font-style: italic; } .markdown-body .pl-mb { color: #333; font-weight: bold; } .markdown-body .pl-md, .markdown-body .pl-mdhf { background-color: #ffecec; color: #bd2c00; } .markdown-body .pl-mdht, .markdown-body .pl-mi1 { background-color: #eaffea; color: #55a532; } .markdown-body .pl-mdr { color: #795da3; font-weight: bold; } .markdown-body kbd { display: inline-block; padding: 3px 5px; font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; line-height: 10px; color: #555; vertical-align: middle; background-color: #fcfcfc; border: solid 1px #ccc; border-bottom-color: #bbb; border-radius: 3px; box-shadow: inset 0 -1px 0 #bbb; } .markdown-body .task-list-item { list-style-type: none; } .markdown-body .task-list-item+.task-list-item { margin-top: 3px; } .markdown-body .task-list-item input { float: left; margin: 0.3em 0 0.25em -1.6em; vertical-align: middle; } .markdown-body :checked+.radio-label { z-index: 1; position: relative; border-color: #4183c4; } /*! Pretty printing styles. Used with prettify.js. */ /* SPAN elements with the classes below are added by prettyprint. */ .pln { color: #000 } /* plain text */ @media screen { .str { color: #080 } /* string content */ .kwd { color: #008 } /* a keyword */ .com { color: #800 } /* a comment */ .typ { color: #606 } /* a type name */ .lit { color: #066 } /* a literal value */ /* punctuation, lisp open bracket, lisp close bracket */ .pun, .opn, .clo { color: #660 } .tag { color: #008 } /* a markup tag name */ .atn { color: #606 } /* a markup attribute name */ .atv { color: #080 } /* a markup attribute value */ .dec, .var { color: #606 } /* a declaration; a variable name */ .fun { color: red } /* a function name */ } /* Use higher contrast and text-weight for printable form. */ @media print, projection { .str { color: #060 } .kwd { color: #006; font-weight: bold } .com { color: #600; font-style: italic } .typ { color: #404; font-weight: bold } .lit { color: #044 } .pun, .opn, .clo { color: #440 } .tag { color: #006; font-weight: bold } .atn { color: #404 } .atv { color: #060 } } /* Put a border around prettyprinted code snippets. */ pre.prettyprint { padding: 2px; /* border: 1px solid #888 */ } /* Specify class=linenums on a pre to get line numbering */ ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 { list-style-type: none } /* Alternate shading for lines */ li.L1, li.L3, li.L5, li.L7, li.L9 { background: #eee } .markdown-body p, .markdown-body blockquote, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body table, .markdown-body pre { margin-top: 0; margin-bottom: 16px; }`;return(0,Je.useEffect)(()=>{const Xe=Ee.current.attachShadow({mode:"open"});Oe.current=document.createElement("div"),Oe.current.className="markdown-body",Oe.current.innerHTML=_e,Xe.appendChild(Oe.current);const et=document.createElement("style");return et.textContent=He,Xe.appendChild(et),()=>{Xe.innerHTML=""}},[]),(0,Je.useEffect)(()=>{Oe.current&&(Oe.current.innerHTML=_e)},[_e]),te.createElement("div",{ref:Ee})};function ue(_e){const Ee=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],Oe=new RegExp(`\\b(${Ee.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return _e.replace(Oe,"").trim()}var ce={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},he=Object.defineProperty,me=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Ce=(_e,Ee,Oe)=>Ee in _e?he(_e,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Oe}):_e[Ee]=Oe,Te=(_e,Ee)=>{for(var Oe in Ee||(Ee={}))fe.call(Ee,Oe)&&Ce(_e,Oe,Ee[Oe]);if(me)for(var Oe of me(Ee))be.call(Ee,Oe)&&Ce(_e,Oe,Ee[Oe]);return _e};const Pe="@\u2581\u2581@",ke="@\u2581@",de=/]*>/g;function ge(_e){let Ee=document.createElement("div");return Ee.innerHTML=_e,Ee.childNodes.length===0?"":Ee.childNodes[0].nodeValue}const Se=(_e,Ee)=>{_e=_e||"";const Oe=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,He=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Xe=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,et=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return Ee?_e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Oe,(st,Le,Ue,rt,ot,it,Ye)=>{const $e=Le||rt||it,Ke=Ue||ot||Ye||"?";return x.Z.API_SERVER+"/api/attachments/"+$e+Ke+"&t="+(0,z.Jn)($e,Date.now())+(st.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(_e=_e.replace(et,(st,Le,Ue,rt,ot,it,Ye)=>{const $e=Le||rt||it,Ke=Ue||ot||Ye||"?";return x.Z.API_SERVER+"/attachments/download/"+$e+Ke+"&t="+(0,z.Jn)($e,Date.now())+(st.indexOf(")")>-1?")":"&")}).replace(Oe,(st,Le,Ue,rt,ot,it,Ye)=>{const $e=Le||rt||it,Ke=Ue||ot||Ye||"?";return x.Z.API_SERVER+"/api/attachments/"+$e+Ke+"&t="+(0,z.Jn)($e,Date.now())+(st.indexOf(")")>-1?")":"&")}).replace(He,(st,Le,Ue,rt,ot)=>{const it=Le||rt,Ye=Ue||ot||"";return'"'+x.Z.API_SERVER+"/api/attachments/"+it+Ye+it+Ye+"&t="+(0,z.Jn)(it,Date.now())}).replace(Xe,(st,Le,Ue,rt,ot)=>{const it=Le||rt,Ye=Ue||ot||"";return"("+x.Z.API_SERVER+"/files/uploads/"+it+Ye+it+Ye+"&t="+(0,z.Jn)(it,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `),_e)};var De=({value:_e="",edit:Ee=!1,className:Oe,showTextOnly:He,showLines:Xe,style:et={},stylesPrev:st={},highlightKeywords:Le,showProgramFill:Ue,isProgramFill:rt,disabledFill:ot=!1,programFillValue:it,openEditor:Ye=()=>{},onFillChange:$e=tt=>{},onFillBlur:Ke=()=>{},onFillFocus:ft=()=>{}})=>{let tt=ue(String(_e||""));const ut=(0,Je.useRef)(),lt=(0,Je.useRef)(),[Ze,Ne]=(0,Je.useState)(""),[ze,Me]=(0,Je.useState)("office"),[Ge,ct]=(0,Je.useState)([]),mt=(0,Je.useRef)("a"+(0,se.Z)()),nt={},Ae=ht=>//i.test(ht||""),je=(ht,kt,Tt)=>{const Pt=document.createElement(ht===ke?"input":"textarea");Pt.style.width="100%",Pt.style.height=ht===ke?"40px":"151px",Pt.rows=5,Pt.spellcheck=!1,Pt.name="edu-program-fill",Pt.placeholder="\u8BF7\u8F93\u5165",Pt.dataset.id=kt;const Vt=Object.keys(nt).length;return nt[Vt]=Pt,`${Pt.outerHTML}`};function We(ht){return ht=ht.replace(/!\[.*?\]\(.*?\)/g,""),ht=ht.replace(/\[.*?\]\(.*?\)/g,""),ht=ht.replace(new RegExp("","gs"),""),ht=ht.replace(//g,""),ht=ht.replace(//g,""),ht=ht.replace(new RegExp(".*?<\\/video>","gs"),""),ht=ht.replace(new RegExp(".*?<\\/audio>","gs"),""),ht=ht.replace(new RegExp(".*?<\\/style>","gs"),""),ht=ht.replace(new RegExp(".*?<\\/script>","gs"),""),ht}const at=ht=>!He&&Ae(tt)?ht:ht.replace(/([\s\S]+?)<\/style>/gim,function(kt,Tt){let Pt=Tt.replace(/(\n|\r)/g,"").split("}"),Vt=[];return Pt.map(vr=>{vr!=""&&Vt.push(`.${mt.current} ${vr}`)}),``}),Re=(0,Je.useMemo)(()=>{try{const Pt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Yt=/\(\/attachments\/download\//g;tt=tt.replace(Yt,"("+x.Z.API_SERVER+"/attachments/download/").replace(Pt,"("+x.Z.API_SERVER+"/api/attachments/").replace(Vt,'"'+x.Z.API_SERVER+"/api/attachments/").replace(vr,'"'+x.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `),ut.current.style.display="none"}catch(Pt){}if(Ue){let Pt=-1;return tt=tt.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Vt,vr,Yt){var Cr;return++Pt,je(Vt,Pt,(Cr=it==null?void 0:it[Pt])==null?void 0:Cr.value.replaceAll("<","<").replaceAll(">",">"))}),`
${at(tt||"")}
`}let ht=at(tt);ht=(0,y.ZP)(ht);const kt=(0,y.ez)();tt.match(/\[TOC\]/)&&(ht=ht.replace("

[TOC]

",(0,y.Qv)()),(0,y.Iy)()),ht=ht.replace(/(__special_katext_id_\d+__)/g,(Pt,Vt)=>{const{type:vr,expression:Yt}=kt[Vt];return(0,oe.renderToString)(ge(Yt)||"",{displayMode:vr==="block",throwOnError:!1,output:"html"})}),ht=ht.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,y.AL)();const Tt=document.createElement("div");if(Tt.innerHTML=ht,He)return Tt.innerText;if(Le){const Pt=Le.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Qe(Tt,Pt),Tt.innerHTML}return setTimeout(()=>yt(),500),Tt.innerHTML},[tt,Le]);(0,Je.useEffect)(()=>{Ie.current&&Ie.current.querySelectorAll(["input","textarea"]).forEach(kt=>{kt.oninput=xe,kt.onblur=ye,kt.onfocus=Fe})},[Ge]),(0,Je.useEffect)(()=>{var ht,kt,Tt,Pt,Vt;if(it!=null&&it.length)try{const vr=Ie.current.querySelectorAll(".edu-program-fill-score"),Yt=Ie.current.querySelectorAll('[name="edu-program-fill"]');for(const[Cr,jr]of Yt.entries())jr.value=((ht=it==null?void 0:it[Cr])==null?void 0:ht.value)||"",((kt=it==null?void 0:it[Cr])==null?void 0:kt.type)==="warning"?jr.className="program-fill-warning":((Tt=it==null?void 0:it[Cr])==null?void 0:Tt.type)==="success"?jr.className="program-fill-success":jr.className="";for(const[Cr,jr]of vr.entries())jr.innerHTML=(Pt=it==null?void 0:it[Cr])!=null&&Pt.score?`${(Vt=it==null?void 0:it[Cr])==null?void 0:Vt.score}\u5206`:"";ct(it)}catch(vr){console.log(vr,"error")}},[it]);const xe=ht=>{Ge[ht.target.dataset.id]=Ge[ht.target.dataset.id]||{},Ge[ht.target.dataset.id].value=ht.target.value,ct([...Ge]),$e(Ge,ht.target.dataset.id)},ye=ht=>{Ge[ht.target.dataset.id]=Ge[ht.target.dataset.id]||{},Ge[ht.target.dataset.id].value=ht.target.value,ct([...Ge]),Ke(Ge,ht.target.dataset.id)},Fe=ht=>{Ge[ht.target.dataset.id]=Ge[ht.target.dataset.id]||{},Ge[ht.target.dataset.id].value=ht.target.value,ct([...Ge]),ft(Ge,ht.target.dataset.id)};function Qe(ht,kt){return ht.childNodes.forEach(Tt=>{var Pt;if(Tt.childNodes.length>0)Qe(Tt,kt);else if(Tt.nodeName!=="IMG")if(Tt.innerHTML)Tt.innerHTML=(Pt=Tt.innerHTML)==null?void 0:Pt.replace(new RegExp(kt,"gi"),'$&');else{const Vt=document.createElement("span");Vt.innerHTML=Tt.textContent.replace(new RegExp(kt,"gi"),'$&'),Tt.replaceWith(Vt)}})}const Ie=(0,Je.useRef)();y.jb.WebkitLineClamp=Xe,Xe&&(et=Te(Te({},et),y.jb));function vt(ht){let kt=ht.target;if(kt.tagName.toUpperCase()==="A"){let Tt=kt.getAttribute("href");if(Tt.indexOf("office")>-1)ht.preventDefault(),Ne(Tt),Me("office");else if(Tt.indexOf("application/pdf")>-1)ht.preventDefault(),Ne(Tt),Me("pdf");else if(Tt.indexOf("text/html")>-1)ht.preventDefault(),Ne(Tt),Me("html");else if(Tt.startsWith("#")){ht.preventDefault();let Pt=document.getElementById(Tt.replace("#",""));Pt&&Pt.scrollIntoView(!0)}}}const yt=()=>{var ht;const kt=(ht=Ie.current)==null?void 0:ht.querySelectorAll("video");kt==null||kt.forEach(Tt=>{if(Tt.oncontextmenu=()=>!1,Tt.src.indexOf(".m3u8")>-1&&!Tt.canPlayType("application/vnd.apple.mpegurl")){if(ve.ZP.isSupported()){var Pt=new ve.ZP;Pt.loadSource(Tt.src),Pt.attachMedia(Tt)}}})};(0,Je.useEffect)(()=>{if(Ie.current&&Re&&Re.match(de)&&window.PR.prettyPrint(),Ie.current)return Ie.current.addEventListener("click",vt),()=>{var ht;(ht=Ie.current)==null||ht.removeEventListener("click",vt),(0,y.AL)(),(0,y.Iy)()}},[Re,Ie.current,vt]);const xt=ht=>{ht.target.nodeName==="IMG"&&ht.target.className.indexOf("draw-flowchart")>-1?(ut.current.style.zIndex=1,ut.current.style.display="flex",ut.current.style.width=ht.target.clientWidth+"px",ut.current.style.height=ht.target.clientHeight+"px",ut.current.style.top=ht.target.offsetTop+"px",ut.current.style.left=ht.target.offsetLeft+"px",ht.target.id&&(lt.current=ht.target.id)):ut.current.style.display="none"},bt=()=>{ut.current.style.display="none"};return(0,Je.useEffect)(()=>{var ht;const kt=Tt=>{Tt.preventDefault(),Tt.clipboardData.setData("text",window.getSelection().toString())};return(ht=Ie.current)==null||ht.addEventListener("copy",kt),()=>{var Tt;(Tt=Ie.current)==null||Tt.removeEventListener("copy",kt)}},[Ie.current]),Je.createElement("div",{style:{position:"relative"},onMouseLeave:bt},He&&Je.createElement("div",{ref:Ie,className:`${ce.mdBody} `},Re),!He&&!Ae(Re)&&Je.createElement("div",{ref:Ie,style:Te({},et),onMouseOver:xt,className:`${Oe||""} ${ot?"disabled-fill":""} markdown-body ${ce.mdBody} ${mt.current}`,dangerouslySetInnerHTML:{__html:Re}}),!He&&Ae(Re)&&Je.createElement(le,{html:Re}),Je.createElement("div",{ref:ut,className:`${ce.button} ${Ee?"":ce.previewFlowChart}`},Je.createElement(ie.Z,null,Je.createElement(ee.ZP,{onClick:()=>{Ee?Ye(lt.current):(Ne(lt.current),Me("flowChart"))}},Ee?"\u7F16\u8F91":"\u9884\u89C8"))),Je.createElement(E.Z,{close:!0,data:Ze,type:Ze!=null&&Ze.length?ze:"",style:Te({},st),onClose:()=>Ne("")}))}},34282:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return we}});var Je=Ve(59301),wt=Ve(94276),y=Ve(59301),we=({defaultX:ve="40%",leftChild:x,rightChild:z,className:oe,hideResize:ie=!1})=>{const[ee,se]=(0,Je.useState)(ve),E=(0,Je.useRef)();function te(){E.current=!0}(0,Je.useEffect)(()=>{function ue(he){E.current&&(wt.Z.publish("resize-move-bar",he),se(he.pageX))}function ce(){E.current=!1}return window.addEventListener("mousemove",ue),window.addEventListener("mouseup",ce),()=>{window.removeEventListener("mousemove",ue),window.removeEventListener("mouseup",ce)}},[]);const re=typeof ee=="number"&&ee!==.01?`${ee}px`:ve,le=`calc(100% - ${ie?"0px":"4px"} - ${re})`;return y.createElement("div",{className:`split-panel-container ${oe}`},y.createElement("section",{style:{width:re,display:ee===.01?"none":""}},x),y.createElement("section",{className:"resize-x-bar",onMouseDown:te},y.createElement("a",{className:"btn-resize"},y.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},y.createElement("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})))),y.createElement("section",{style:{width:le}},z))}},13683:function(Kt,_t,Ve){"use strict";Ve.d(_t,{cT:function(){return de},pe:function(){return Te}});var Je=Ve(59301),wt=Ve(14566),y=Ve(6767),we=Ve(97013),ve=Ve(28209),x=Ve.n(ve),z=Ve(1012),oe=Ve(58106),ie=Ve(47257),ee=Ve.n(ie),se=Object.defineProperty,E=Object.defineProperties,te=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ce=(Se,De,_e)=>De in Se?se(Se,De,{enumerable:!0,configurable:!0,writable:!0,value:_e}):Se[De]=_e,he=(Se,De)=>{for(var _e in De||(De={}))le.call(De,_e)&&ce(Se,_e,De[_e]);if(re)for(var _e of re(De))ue.call(De,_e)&&ce(Se,_e,De[_e]);return Se},me=(Se,De)=>E(Se,te(De)),fe=(Se,De)=>{var _e={};for(var Ee in Se)le.call(Se,Ee)&&De.indexOf(Ee)<0&&(_e[Ee]=Se[Ee]);if(Se!=null&&re)for(var Ee of re(Se))De.indexOf(Ee)<0&&ue.call(Se,Ee)&&(_e[Ee]=Se[Ee]);return _e},be=(Se,De,_e)=>new Promise((Ee,Oe)=>{var He=st=>{try{et(_e.next(st))}catch(Le){Oe(Le)}},Xe=st=>{try{et(_e.throw(st))}catch(Le){Oe(Le)}},et=st=>st.done?Ee(st.value):Promise.resolve(st.value).then(He,Xe);et((_e=_e.apply(Se,De)).next())});const{Dragger:Ce}=wt.default,Te=Se=>{const De="bf3c199c2470cb477d907b1e0917c17b",_e="5183666c72eec9e4";var Ee=x().enc.Utf8.parse(De);let Oe=x().enc.Utf8.parse(_e);var He=x().AES.decrypt(Se,Ee,{iv:Oe,mode:x().mode.CBC});return He.toString(x().enc.Utf8)};let Pe;const ke=Se=>be(void 0,[Se],function*({identifier:De,oldFilename:_e,newFilename:Ee}){var Oe,He,Xe,et,st,Le;const Ue=yield Fetch("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});Ue.data=JSON.parse(Te(Ue.data));const rt=new OSS({endpoint:(Oe=Ue==null?void 0:Ue.data)==null?void 0:Oe.end_point,region:(He=Ue==null?void 0:Ue.data)==null?void 0:He.region,accessKeyId:(Xe=Ue==null?void 0:Ue.data)==null?void 0:Xe.access_key_id,accessKeySecret:(et=Ue==null?void 0:Ue.data)==null?void 0:et.access_key_secret,bucket:(st=Ue==null?void 0:Ue.data)==null?void 0:st.bucket,stsToken:(Le=Ue==null?void 0:Ue.data)==null?void 0:Le.security_token});return new Promise((ot,it)=>{console.log(11111,`${De}/${_e}`,`${De}/${Ee}`,Ue.data),rt.copy(`/${De}/${_e}`,`/${De}/${Ee}`).then(Ye=>{console.log("\u62F7\u8D1D\u6210\u529F",Ye)}).catch(Ye=>{console.log(Ye)})})}),de=(Se,De,_e)=>be(void 0,null,function*(){var Ee,Oe,He,Xe,et,st;De.file_name=Se.name;const Le=yield(0,we.ZP)("/api/buckets/get_upload_token.json",{method:"get"});console.log("decrypt(res.data):",Te(Le.data)),Le.data=JSON.parse(Te(Le.data));const Ue=Se.name.split(".");Ue.pop();const rt=De.realFileName?Ue.join(""):(0,z.Z)(),ot=new(ee())({endpoint:(Ee=Le==null?void 0:Le.data)==null?void 0:Ee.end_point,region:(Oe=Le==null?void 0:Le.data)==null?void 0:Oe.region,accessKeyId:(He=Le==null?void 0:Le.data)==null?void 0:He.access_key_id,accessKeySecret:(Xe=Le==null?void 0:Le.data)==null?void 0:Xe.access_key_secret,bucket:(et=Le==null?void 0:Le.data)==null?void 0:et.bucket,stsToken:(st=Le==null?void 0:Le.data)==null?void 0:st.security_token});return new Promise((it,Ye)=>{var $e;ot.multipartUpload(`${rt}`,new Blob([Se],{type:Se.type}),me(he({timeout:200*1e3,partSize:102400},_e),{callback:{url:($e=Le==null?void 0:Le.data)==null?void 0:$e.callback_url,host:Le==null?void 0:Le.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+(0,we.rz)(De)}})).then(function(Ke){var ft;Se.response=(ft=Ke.data)==null?void 0:ft.data,it(Ke==null?void 0:Ke.data)}).catch(function(Ke){Ye(Ke),console.log("err:",Ke)})})}),ge=Se=>{var De=Se,{user:_e,cancelUpload:Ee}=De,Oe=fe(De,["user","cancelUpload"]);const[He,Xe]=(0,Je.useState)([]);let[et,st]=(0,Je.useState)();const Le={onRemove:rt=>{Xe([...He.filter(ot=>ot.name!==rt.name)]),Oe.onChange(He.filter(ot=>ot.name!==rt.name))},disabled:Oe.disabled,multiple:!0,fileList:He==null?void 0:He.map(rt=>rt.file),customRequest:()=>{},beforeUpload:rt=>be(void 0,null,function*(){let ot=Oe.maxSize||1073741824;if(He.filter(it=>it.name===rt.name).length){y.ZP.info(`${rt.name}\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9`);return}return(rt==null?void 0:rt.size)>ot?(y.ZP.info(`\u6587\u4EF6\u8D85\u8FC7${ot/1024/1024/1024}GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42`),!1):(He.push({name:rt.name,file:rt}),Xe([...He]),Oe.onChange(He),!1)})},Ue=(rt,ot)=>be(void 0,null,function*(){var it,Ye,$e,Ke,ft,tt;ot.file_name=rt.name;const ut=rt.name,lt=yield(0,we.ZP)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});if(lt.data=JSON.parse(Te(lt.data)),(lt==null?void 0:lt.status)!==0){He[He.findIndex(ze=>ze.name===ut)].status="error",He[He.findIndex(ze=>ze.name===ut)].file.status="error",Oe.onChange(He),y.ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5");return}et=new(ee())({endpoint:(it=lt==null?void 0:lt.data)==null?void 0:it.end_point,region:(Ye=lt==null?void 0:lt.data)==null?void 0:Ye.region,accessKeyId:($e=lt==null?void 0:lt.data)==null?void 0:$e.access_key_id,accessKeySecret:(Ke=lt==null?void 0:lt.data)==null?void 0:Ke.access_key_secret,bucket:(ft=lt==null?void 0:lt.data)==null?void 0:ft.bucket,stsToken:(tt=lt==null?void 0:lt.data)==null?void 0:tt.security_token}),console.log(rt,"file"),st(et);const Ze=rt.name.split(".");Ze.pop();const Ne=ut.indexOf(".")>-1?ot.realFileName?Ze.join("."):(0,z.Z)():ut;return new Promise((ze,Me)=>{var Ge;try{et.multipartUpload(`${Oe.identifier}/${Ne}${ut.indexOf(".")>-1?"."+ut.split(".").pop():""}`,new Blob([rt.file],{type:rt.file.type}),{timeout:3600*1e3,partSize:1002400,progress:(ct,mt,nt)=>{try{console.log("\u8FDB\u5EA6",ct,mt,nt);const Ae=He.findIndex(je=>je.name===ut);He[Ae].file.percent=ct*100,He[Ae].tempCheckpoint=mt,Xe([...He])}catch(Ae){}},checkpoint:He[He.findIndex(ct=>ct.name===ut)].tempCheckpoint,callback:{customValue:{id:ut+""},url:(Ge=lt==null?void 0:lt.data)==null?void 0:Ge.callback_url,host:lt==null?void 0:lt.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+(0,we.rz)(ot)}}).then(function(ct){var mt,nt,Ae;const je=He.findIndex(at=>at.name===ut);let We="done";if(((mt=ct.data)==null?void 0:mt.status)===0){rt.response=(nt=ct.data)==null?void 0:nt.data;const at=He.findIndex(Re=>Re.name===ut);He[at].status="done",He[at].file.status="done"}else y.ZP.warning((Ae=ct.data)==null?void 0:Ae.message),We="error";He[je].status=We,He[je].file.status=We,Oe.onChange(He),ze(ct==null?void 0:ct.data)}).catch(function(ct){He[He.findIndex(mt=>mt.name===ut)].status="error",He[He.findIndex(mt=>mt.name===ut)].file.status="error",y.ZP.warning("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Xe([...He]),Oe.onChange(He),Me(ct),console.log("err:",ct)})}catch(ct){}})});return(0,Je.useEffect)(()=>{He.every(rt=>rt==="done"||rt==="error")&&Oe.onComplete(He)},[He]),(0,Je.useEffect)(()=>{Ee&&(et==null||et.cancel())},[Ee]),(0,Je.useEffect)(()=>{Oe.uploading&&He.map(rt=>be(void 0,null,function*(){var ot;if((!rt.status||rt.status==="error")&&!Ee){rt.status="uploading",rt.file.status="uploading";const it=yield Ue(rt,{login:(ot=_e==null?void 0:_e.userInfo)==null?void 0:ot.login,container_type:Oe.container_type,container_id:Oe.container_id,description:Oe.description,realFileName:Oe.realFileName})}}))},[Oe.uploading]),Je.createElement(Ce,me(he({},Le),{height:Oe.height,className:Oe.className}),Je.createElement("p",{className:"ant-upload-hint"},Oe.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};_t.ZP=(0,oe.connect)(({loading:Se,globalSetting:De,user:_e})=>({globalSetting:De,loading:Se.models.competitions,user:_e}))(ge)},52504:function(Kt,_t,Ve){"use strict";Ve.d(_t,{h:function(){return be},Z:function(){return fe}});var Je=Ve(59301),wt=Ve(82326),y=Ve(28284),we=Ve(7939),ve=Ve(89780),x=Ve.n(ve),z=Ve(2018),oe=Object.defineProperty,ie=Object.defineProperties,ee=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,re=(Ce,Te,Pe)=>Te in Ce?oe(Ce,Te,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Ce[Te]=Pe,le=(Ce,Te)=>{for(var Pe in Te||(Te={}))E.call(Te,Pe)&&re(Ce,Pe,Te[Pe]);if(se)for(var Pe of se(Te))te.call(Te,Pe)&&re(Ce,Pe,Te[Pe]);return Ce},ue=(Ce,Te)=>ie(Ce,ee(Te));const ce=wt.default.Option,he={labelCol:{span:4},wrapperCol:{span:20}},me={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"]};var fe=({callback:Ce,onCancel:Te})=>{const[Pe,ke]=(0,Je.useState)("python");function de(Se){ke(me[Se][1])}function ge(Se){Ce(Se)}return Je.createElement(y.default,ue(le({},he),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ge,style:{width:500}}),Je.createElement(y.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},Je.createElement(wt.default,{getPopupContainer:Se=>Se.parentNode,onChange:de},Object.keys(me).map(Se=>Je.createElement(ce,{key:Se,value:Se},me[Se][0])))),Je.createElement(y.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},Je.createElement(be,{mode:Pe})),Je.createElement("div",{className:"flex-container flex-end"},Je.createElement(we.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Je.createElement(we.ZP,{type:"ghost",onClick:Te},"\u53D6\u6D88")))};function be({value:Ce,onChange:Te,mode:Pe,options:ke={}}){const de=(0,Je.useRef)(),[ge,Se]=(0,Je.useState)();return(0,Je.useEffect)(()=>{if(ge){let De=function(_e){const Ee=_e.getValue();Te&&Te(Ee)};return ge.on("change",De),()=>{ge.off("change",De)}}},[ge,Te]),(0,Je.useEffect)(()=>{ge&&ge.setOption("mode",Pe)},[ge,Pe]),(0,Je.useEffect)(()=>{ge&&(Ce!==ge.getValue()||Ce==="")&&setTimeout(()=>{ge.setValue(Ce||"")},300)},[ge,Ce]),(0,Je.useEffect)(()=>{if(de.current&&!ge){const De=x().fromTextArea(de.current,le({mode:Pe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ke));Se(De)}},[de.current,ge]),Je.createElement("div",{className:"my-codemirror-container"},Je.createElement("textarea",{ref:de}))}},77834:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return or}});var Je=Ve(59301),wt=Ve(58106),y=Ve(89780),we=Ve.n(y),ve=Ve(76374),x=Ve(2018),z=Ve(6313),oe=Ve(25717),ie=Ve(99498),ee=Ve(25419),se=Ve(67549),E=Ve(59944),te=({value:Zt="",className:ir,showTextOnly:Nr,showLines:gr,style:Hr={}})=>{const Qr=(0,Je.useMemo)(()=>"",[Zt]);return Je.createElement(Je.Fragment,null,Je.createElement("div",{dangerouslySetInnerHTML:{__html:Qr}}))},re=Object.defineProperty,le=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,ce=Object.getOwnPropertySymbols,he=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,fe=(Zt,ir,Nr)=>ir in Zt?re(Zt,ir,{enumerable:!0,configurable:!0,writable:!0,value:Nr}):Zt[ir]=Nr,be=(Zt,ir)=>{for(var Nr in ir||(ir={}))he.call(ir,Nr)&&fe(Zt,Nr,ir[Nr]);if(ce)for(var Nr of ce(ir))me.call(ir,Nr)&&fe(Zt,Nr,ir[Nr]);return Zt},Ce=(Zt,ir)=>le(Zt,ue(ir));let Te=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Pe({onActionCallback:Zt,title:ir,icon:Nr,actionName:gr,className:Hr="",children:Qr}){function rn(){Zt(gr)}return Je.createElement("a",{title:ir,className:Hr,onClick:rn},Je.createElement("i",{className:`${Nr}`}),Qr)}var ke=({watch:Zt,showNullButton:ir,showNullProgramButton:Nr,onActionCallback:gr,fullScreen:Hr,insertTemp:Qr,hidetoolBar:rn,extraUse:Kr})=>{const Wr=[...Te,{title:`${Zt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Zt?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Je.createElement("ul",{className:"markdown-toolbar-container"},!rn&&Wr.map((dn,pr)=>Je.createElement("li",{key:pr},dn.actionName?Je.createElement(Pe,Ce(be({},dn),{onActionCallback:gr})):Je.createElement("span",{className:"v-line"}))),ir?Je.createElement("li",null,Je.createElement(Pe,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:gr},Je.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,Nr?Je.createElement(Je.Fragment,null,Je.createElement("li",null,Je.createElement(Pe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:gr},Je.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),Je.createElement("li",null,Je.createElement(Pe,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:gr},Je.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Qr&&Je.createElement("li",null,Je.createElement(Pe,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Qr}`,onActionCallback:gr},Je.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Kr&&Je.createElement("li",null,Kr),Je.createElement("li",{className:"btn-full-screen"},Je.createElement(Pe,{icon:`${Hr?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Hr?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:gr})))},de=Ve(35990),ge=Ve(28284),Se=Ve(37568),De=Ve(7939),_e=Object.defineProperty,Ee=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,He=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,st=(Zt,ir,Nr)=>ir in Zt?_e(Zt,ir,{enumerable:!0,configurable:!0,writable:!0,value:Nr}):Zt[ir]=Nr,Le=(Zt,ir)=>{for(var Nr in ir||(ir={}))Xe.call(ir,Nr)&&st(Zt,Nr,ir[Nr]);if(He)for(var Nr of He(ir))et.call(ir,Nr)&&st(Zt,Nr,ir[Nr]);return Zt},Ue=(Zt,ir)=>Ee(Zt,Oe(ir));const rt={labelCol:{span:4},wrapperCol:{span:20}};var ot=({callback:Zt,onCancel:ir})=>{function Nr(gr){Zt(gr)}return Je.createElement(ge.default,Ue(Le({},rt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Nr,style:{width:500}}),Je.createElement(ge.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},Je.createElement(Se.default,null)),Je.createElement(ge.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},Je.createElement(Se.default,null)),Je.createElement("div",{className:"flex-container flex-end"},Je.createElement(De.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Je.createElement(De.ZP,{type:"ghost",onClick:ir},"\u53D6\u6D88")))},it=Ve(52504),Ye=Ve(82441),$e=Ve(62957),Ke=Ve(77019),ft=Ve(1986),tt=Ve(59301),ut=({callback:Zt,onCancel:ir})=>{const Nr=document.createElement("canvas"),gr=Nr.getContext("2d");Nr.width=1e3,Nr.height=800,gr.fillStyle="#ffffff",gr.fillRect(0,0,Nr.width,Nr.height);const Hr=Nr.toDataURL("image/png");return tt.createElement($e.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},tt.createElement(Ke.Z,{style:{height:"100vh"}},tt.createElement(ft.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Hr,visible:!0,title:String(Date.now())},onOk:Qr=>{Zt({src:Qr.url})},onClose:ir})))},lt=Ve(30641),Ze=Ve(5269),Ne=Ve(6767),ze={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re",drawerWrap:"drawerWrap___MfDw8"},Me=Ve(59301),ct=(0,Je.forwardRef)(({onCancel:Zt,editImgId:ir,callback:Nr},gr)=>{let Hr=(0,Je.useRef)(),Qr=(0,Je.useRef)(),rn=(0,Je.useRef)(),Kr=(0,Je.useRef)(!1);const Wr=(0,Je.useRef)(!1);console.log("ref:",gr);const[dn,pr]=(0,Je.useState)(0),[Wt,Sr]=(0,Je.useState)("100vh");return(0,Je.useEffect)(()=>{pr(1)},[]),(0,Je.useImperativeHandle)(gr,()=>({setHeight:Sr})),Me.createElement("div",{ref:Wr,className:"body-overflow-initial"},Me.createElement(lt.Z,{width:"100vw",height:Wt,footer:null,closable:!0,placement:"bottom",open:!!dn,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ze.drawerWrap}`,onClose:()=>{window.saveDrawData(Gr=>{Nr({src:`/api/attachments/${Gr}`,id:Gr})})},title:Me.createElement(Ke.Z,{align:"middle"},Me.createElement(Ze.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Me.createElement(Ze.Z,{onClick:()=>{Sr(Wt==="60px"?"100vh":"60px")}},Me.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),Me.createElement(Ze.Z,{onClick:()=>{window.saveDrawData(Gr=>{if(Gr===null){Ne.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Ne.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),Nr({src:`/api/attachments/${Gr}`,id:Gr,disabledClose:!0})})}},Me.createElement(De.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},Me.createElement("iframe",{src:`/drawio/src/main/webapp/?id=${ir||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Qr})))}),mt=Ve(26869),nt=Ve(47889),Ae=Ve(71051);const je=nt.ZP.Group,We={margin:"0 8px"};var at=({callback:Zt,onCancel:ir})=>{function Nr(gr){Zt(gr)}return Je.createElement(ge.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Nr},Je.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},Je.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),Je.createElement("span",{style:We},"\u884C\u6570"),Je.createElement(ge.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},Je.createElement(Ae.Z,null)),Je.createElement("span",{style:We},"\u5217\u6570"),Je.createElement(ge.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},Je.createElement(Ae.Z,null))),Je.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},Je.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),Je.createElement(ge.default.Item,{name:"align"},Je.createElement(je,null,Je.createElement(nt.ZP,{value:"default"},Je.createElement("i",{className:"fa fa-align-justify"})),Je.createElement(nt.ZP,{value:"left"},Je.createElement("i",{className:"fa fa-align-left"})),Je.createElement(nt.ZP,{value:"center"},Je.createElement("i",{className:"fa fa-align-center"})),Je.createElement(nt.ZP,{value:"right"},Je.createElement("i",{className:"fa fa-align-right"}))))),Je.createElement("div",{className:"flex-container flex-end"},Je.createElement(De.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Je.createElement(De.ZP,{type:"ghost",onClick:ir},"\u53D6\u6D88")))},Re=Ve(71411),xe=Ve(75544),ye=Ve.n(xe),Qe=(0,Je.forwardRef)(({use3d:Zt,width:ir,height:Nr,callback:gr,showSaveButton:Hr},Qr)=>{const rn=(0,Je.useRef)(),Kr=(0,Je.useRef)(),[Wr,dn]=(0,Je.useState)(!1),pr=(0,Je.useRef)({id:rn,appName:"graphing",width:ir||1e3,height:Nr||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,Je.useEffect)(()=>{Kr.current=new(ye())(pr.current,!0),window.onload=function(){Kr.current.inject("applet_container")}},[]);const Wt=()=>{var Sr=window.ggbApplet.getPNGBase64(1,!0,72);return gr&&gr(Sr),Sr};return(0,Je.useEffect)(()=>{pr.current.appName=Wr?"3D":"graphing",Kr.current.inject("applet_container")},[Wr]),(0,Je.useEffect)(()=>{dn(Zt)},[Zt]),(0,Je.useImperativeHandle)(Qr,()=>({getImgData:Wt})),Je.createElement(Je.Fragment,null,Je.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:rn}),Je.createElement(Ke.Z,{align:"middle"},Je.createElement(Ze.Z,{flex:1},Je.createElement(Re.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Wr,onChange:Sr=>dn(Sr)})),Je.createElement(Ze.Z,null,Je.createElement(De.ZP,{size:"large",onClick:Wt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Ie=Ve(50047);const vt="link",yt="upload-image",xt="add-flowchart",bt="draw-image",ht="add-flowchart",kt="code-block",Tt="add-table",Pt="------------",Vt={default:Pt,left:`:${Pt}`,center:`:${Pt}:`,right:`${Pt}:`};var vr=Ve(61904),Yt=Ve(31735);function Cr(){}let jr=0;const Pr=1e4,Mr="\u2581",Xr="@\u2581\u2581@",mn="@\u2581@",cn=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Yr=["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 kn(Zt){return/^\d+$/.test(Zt)?`${Zt}px`:Zt}const Dr=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Ar={[Dr+"-B"]:"bold",[Dr+"-I"]:"italic"},fn={[vt]:"\u6DFB\u52A0\u94FE\u63A5",[kt]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[yt]:"\u6DFB\u52A0\u56FE\u7247",[bt]:"\u6DFB\u52A0\u753B\u56FE",[xt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Tt]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var or=({defaultValue:Zt="",onChange:ir,width:Nr="100%",height:gr=400,miniToolbar:Hr=!1,isFocus:Qr=!1,watch:rn,insertTemp:Kr,mode:Wr="markdown",id:dn="markdown-editor-id",showResizeBar:pr=!1,noStorage:Wt=!1,showNullButton:Sr=!1,showNullProgramButton:Gr=!1,hidetoolBar:gn=!1,fullScreen:Ct=!1,onBlur:Dt,onCMBeforeChange:nr,onFullScreen:Gt,className:jt="",disablePaste:tr=!1,disabled:hr=!1,disabledFill:fr=!1,placeholder:kr="",values:sr="",extraUse:xr,onAddBlank:ar})=>{const[$t,lr]=(0,Je.useState)(null),[br,Rr]=(0,Je.useState)(Zt),[Fr,vn]=(0,Je.useState)(rn),[On,zr]=(0,Je.useState)(Ct),[Er,Ur]=(0,Je.useState)(""),[wr,jn]=(0,Je.useState)(0),[Hn,Ln]=(0,Je.useState)(gr),[Vn,Yn]=(0,Je.useState)(!1),[Gn,_n]=(0,Je.useState)(0),[Jn,Xn]=(0,Je.useState)(0),Ir=(0,Je.useRef)(),on=(0,Je.useRef)(),Tn=(0,Je.useRef)(),Bn=(0,Je.useRef)(),Mn=(0,Je.useRef)(),Fn=(0,Je.useRef)(),ri=(0,wt.useDispatch)();(0,Je.useEffect)(()=>{const er=window.scrollY||window.pageYOffset;Rr(sr),$t==null||$t.setValue(sr),window.scrollTo(0,er)},[sr]),(0,Je.useEffect)(()=>{Gt==null||Gt(On)},[On]),(0,Je.useEffect)(()=>{if(Ir.current){let er=function(ur,dr){var Tr;if(tr){dr.preventDefault();return}const Vr=dr.clipboardData;if(Vr){const _r=Vr.types.toString(),ln=Vr.items;if(_r==="Files"||Vr.types.indexOf("Files")>-1){if(dr.preventDefault(),Wr=="stex")return;try{let qr=ln[1];((Tr=ln[0])==null?void 0:Tr.kind)==="file"&&(qr=ln[0]);const sn=qr.getAsFile(),hn=sn.name.split(".").pop();(0,Ye.I)(sn,un=>{var Pn,yn,wn;un.id?((Pn=sn==null?void 0:sn.type)==null?void 0:Pn.indexOf("image"))>-1?Ft.replaceSelection(``):((yn=sn==null?void 0:sn.type)==null?void 0:yn.indexOf("video"))>-1?Ft.replaceSelection(``):((wn=sn==null?void 0:sn.type)==null?void 0:wn.indexOf("pdf"))>-1?Ft.replaceSelection(`${sn.name}`):Yr.includes(hn)?Ft.replaceSelection(`${sn.name}`):Ft.replaceSelection(`[${sn.name}](/api/attachments/${un.id}?type=${un.content_type})`):(un==null?void 0:un.status)===401&&(document.location.href="/user/login")})}catch(qr){Ne.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Ft=we().fromTextArea(Ir.current,{mode:Wr,lineNumbers:!Hr,lineWrapping:!0,value:Zt,autoCloseTags:!0,autoCloseBrackets:!0});return Ft.on("keyup",function(ur,dr){dr.keyCode===8&&(ur.getValue()==""?Ft.setOption("placeholder",kr):Ft.setOption("placeholder",null))}),Ft.on("keydown",function(ur,dr){if(dr.keyCode===8){var Tr=Lt(ur);Tr&&dr.preventDefault()}}),Qr&&Ft.focus(),Ft.on("paste",er),hr&&Ft.on("beforeChange",function(ur,dr){(dr.origin==="paste"||dr.origin==="+input")&&dr.cancel()}),lr(Ft),()=>{Ft.off("paste",er)}}},[]);const St=(0,Je.useCallback)(()=>{if(on.current)try{}catch(er){console.log(er,"---- to set md editor body height")}},[Hn,on,On]);(0,Je.useEffect)(()=>{function er(){let Ft=new ve.Z(ur=>{for(let dr of ur)(dr.target.offsetHeight>0||dr.target.offsetWidth>0)&&(St(),$t.setSize("100%","100%"),$t.refresh())});return Ft.observe(Ir.current.parentElement),Ft}if($t){const Ft=er();return()=>{var ur,dr;(ur=Ir.current)!=null&&ur.parentElement&&Ft.unobserve((dr=Ir.current)==null?void 0:dr.parentElement)}}},[$t,St]),(0,Je.useEffect)(()=>{if($t){let er=[];for(const[Ft,ur]of Object.entries(Ar)){let dr={[Ft]:()=>{Mt(ur)}};er.push(dr),$t.addKeyMap(dr)}return()=>{for(let Ft of er)$t.removeKeyMap(Ft)}}},[$t]),(0,Je.useEffect)(()=>{Ct!==On&&zr(Ct)},[Ct]),(0,vr.Z)(()=>{if(!Wt&&wr>0){let er=new Date().getTime(),Ft=window.sessionStorage.getItem(dn);er>=wr+Pr&&(!Ft||Ft!==br)&&(window.sessionStorage.setItem(dn,br),Yn(!0))}},Pr),(0,Je.useEffect)(()=>{vn(rn)},[$t,rn]),(0,Je.useEffect)(()=>{$t&&Qr&&$t.focus()},[$t,Qr]),(0,Je.useEffect)(()=>{if(Fr&&$t){let er=function(ur){let dr=ur.target;if(Bn.current){let Tr=dr.scrollTop/dr.scrollHeight;Bn.current.scrollTop=Bn.current.scrollHeight*Tr}};const Ft=$t.getScrollerElement();return Ft.addEventListener("scroll",er),()=>{Ft.removeEventListener("scroll",er)}}},[$t,Fr]),(0,Je.useEffect)(()=>{if($t&&nr){let er=function(Ft,ur){nr(Ft,ur)};return $t.on("beforeChange",er),()=>{$t.off("beforeChange",er)}}},[$t,nr]),(0,Je.useEffect)(()=>{if($t&&Dt){let er=function(){Dt($t.getValue())};return $t.on("blur",er),()=>{$t.off("blur",er)}}},[$t,Dt]);function Lt(er,Ft){var ur=er.getDoc(),dr=ur.getCursor(),Tr=ur.getLine(dr.line),Vr=Tr.charAt(dr.ch-1),_r=Tr.lastIndexOf("@\u2581@",dr.ch),ln=Tr.lastIndexOf("@\u2581\u2581@",dr.ch),qr=_r>ln?_r:ln,sn=_r>ln?3:4;if(Xr.indexOf(Vr)===-1)return null;if(console.log("change1:",Ft,er,Tr,dr,qr,_r,ln,Vr),qr>=0&&dr.ch-qr<5){var hn=qr+sn;return ur.replaceRange("",{line:dr.line,ch:qr},{line:dr.line,ch:hn}),{line:dr.line,ch:hn}}return null}(0,Je.useEffect)(()=>{if($t){let er=function(Ft,ur){const dr=Ft.getValue();Rr(dr),jn(new Date().getTime()),Ft.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ir&&(Gr?ir(dr,Bt(dr)):ir(dr))};return $t.on("change",er),()=>{$t.off("change",er)}}},[$t,ir]),(0,Je.useEffect)(()=>{if($t)if(Zt==null)$t.setValue(""),Rr("");else{const er=window.scrollY||window.pageYOffset;Zt!==$t.getValue()&&($t.setValue(Zt),Rr(Zt),$t.setCursor(hr?1:$t.lineCount(),0),window.scrollTo(0,er))}},[$t,Zt]);const Mt=(0,Je.useCallback)(er=>{const Ft=$t.getCursor(),ur=$t.getSelection();let dr=ur.split(` `);switch(er){case"bold":return $t.replaceSelection("**"+ur+"**"),ur===""&&$t.setCursor(Ft.line,Ft.ch+2),$t.focus();case"italic":return $t.replaceSelection("*"+ur+"*"),ur===""&&$t.setCursor(Ft.line,Ft.ch+1),$t.focus();case"code":return $t.replaceSelection("`"+ur+"`"),ur===""&&$t.setCursor(Ft.line,Ft.ch+1),$t.focus();case"inline-latex":return(0,Yt.Ye)(ri)?void 0:(Ur("inline-latex"),$t.focus());case"latex":return $t.replaceSelection("```latex\n"+ur+"\n```"),$t.setCursor(Ft.line+1,ur.length+1),$t.focus();case"line-break":return $t.replaceSelection(`
`),$t.focus();case"list-ul":return ur===""?$t.replaceSelection("- "+ur):$t.replaceSelection(dr.map(Tr=>Tr===""?"":`- ${Tr}`).join(` `)),$t.focus();case"list-ol":return ur===""?$t.replaceSelection("1. "+ur):$t.replaceSelection(dr.map((Tr,Vr)=>Tr===""?"":`${Vr+1}. ${Tr}`).join(` `)),$t.focus();case"add-null-ch":ar==null||ar();return;case"add-signal":return ur===""&&$t.setCursor(Ft.line,Ft.ch),$t.replaceSelection(mn),$t.focus();case"add-multiple":return ur===""&&$t.setCursor(Ft.line,Ft.ch),$t.replaceSelection(Xr),$t.focus();case"inster-template-1":return ur===""&&$t.setCursor(Ft.line,Ft.ch),$t.replaceSelection(cn),$t.focus();case"eraser":return $t.setValue(""),$t.focus();case"trigger-watch":return vn(!Fr),$t.focus();case"trigger-full-screen":return zr(!On),$t.focus();case vt:Ur(vt);return;case kt:Ur(kt);return;case yt:Ur(yt);return;case bt:Ur(bt);return;case"maths-latex":if((0,Yt.Ye)(ri))return;Ur("maths-latex");return;case xt:Mn.current="",sessionStorage.removeItem("file_id"),Ur(xt);return;case Tt:Ur(Tt);return;default:throw new Error}},[$t,Fr,On]),Nt=(0,Je.useCallback)((er,Ft)=>{var ur,dr,Tr,Vr,_r,ln;er!=null&&er.disabledClose||Ur("");const{src:qr,alt:sn,id:hn}=er||{};switch(Er){case vt:const{title:nn,link:Zr}=er;return $t.replaceSelection(`[${nn}](${Zr})`),$t.focus();case kt:const{language:tn,content:pn}=er;return $t.replaceSelection(["```"+tn,pn,"```"].join(` `)),$t.focus();case"maths-latex":for(var un=atob(er),Pn=new Uint8Array(un.length),yn=0;yn{yi.id?$t.replaceSelection(`![,](/api/attachments/${yi.id}?type=${yi.content_type})`):(yi==null?void 0:yi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":if((0,Yt.Ye)(ri))return;$t.replaceSelection("`$$"+er+"$$`");break;case ht:if(!hn)return;$t.getValue().indexOf(qr)===-1?$t.replaceSelection(`
${sn||
`):document.getElementById(hn).src=mt.Z.API_SERVER+qr+"?t="+Date.now();break;case yt:case bt:const Jr=Ft,An=(Tr=(dr=(ur=Jr==null?void 0:Jr.name)==null?void 0:ur.split("."))==null?void 0:dr.pop)==null?void 0:Tr.call(dr);return((Vr=Jr==null?void 0:Jr.type)==null?void 0:Vr.indexOf("image"))>-1||!(Jr!=null&&Jr.type)?Jr!=null&&Jr.align||Jr!=null&&Jr.width?$t.replaceSelection(`

${sn||

`):$t.replaceSelection(`${sn||`):((_r=Jr==null?void 0:Jr.type)==null?void 0:_r.indexOf("video"))>-1?$t.replaceSelection(``):((ln=Jr==null?void 0:Jr.type)==null?void 0:ln.indexOf("pdf"))>-1?$t.replaceSelection(`${Jr.name}`):Yr.includes(An)?$t.replaceSelection(`${Jr.name}`):$t.replaceSelection(`[${Jr.name}](${qr})`),$t.focus();case Tt:const{row:Rn,col:Qn,align:Di}=er;let Si=` `;for(let yi=0;yi{switch(Er){case vt:return Je.createElement(ot,{callback:Nt,onCancel:Rt});case kt:return Je.createElement(it.Z,{callback:Nt,onCancel:Rt});case yt:return Je.createElement(Ye.Z,{callback:Nt,onCancel:Rt});case xt:return Je.createElement(ct,{editImgId:Mn.current,callback:Nt,onCancel:Rt});case Tt:return Je.createElement(at,{callback:Nt,onCancel:Rt});case"maths-latex":return Je.createElement(Qe,{showSaveButton:!0,callback:Nt});case"inline-latex":return Je.createElement(Ie.Z,{showSaveButton:!0,callback:Nt});default:return null}},[Er]);function Rt(){Ur("")}(0,Je.useEffect)(()=>{if(Tn.current){let er=function(_r){Tr=!0,Vr=_r.pageY},Ft=function(){Tr=!1},ur=function(_r){if(Tr){let ln=_r.pageY-Vr;ln<0&&(ln=0),ln>300&&(ln=300);let qr=gr+ln+"px";Ln(qr)}},dr=Tn.current,Tr=!1,Vr=0;return dr.addEventListener("mousedown",er),document.addEventListener("mousemove",ur),document.addEventListener("mouseup",Ft),()=>{dr.removeEventListener("mousedown",er),document.removeEventListener("mousemove",ur),document.removeEventListener("mouseup",Ft)}}},[$t,Tn]),(0,Je.useEffect)(()=>{Ln(gr)},[gr]);const Jt=kn(Nr),rr=kn(Hn),Qt={width:Jt,height:rr},Ot=(0,Je.useMemo)(()=>{if(wr){let er=new Date(wr),Ft=er.getHours(),ur=er.getMinutes(),dr=er.getSeconds();return Ft=Ft<10?"0"+Ft:Ft,ur=ur<10?"0"+ur:ur,dr=dr<10?"0"+dr:dr,`${Ft}:${ur}:${dr}`}return 0},[wr]),Bt=er=>{const Ft=[];if(Gr){let ur=-1;er=er.replace(/(@▁▁@|@▁@)/g,function(dr,Tr,Vr){Ft.push({multiLine:dr!==mn})})}return Ft};function Ht(){window.sessionStorage.removeItem(dn),Yn(!1),jn(0)}function zt(){Yn(!1),jn(0),$t.setValue(window.sessionStorage.getItem(dn))}(0,Je.useEffect)(()=>{fn[Er]&&Er!==bt&&Er!==xt&&setTimeout(()=>{const er=document.getElementsByClassName("markdown-popup-form")[0],Ft=window.innerWidth/2-er.offsetWidth/2,ur=window.innerHeight/2-er.offsetHeight/2;_n(Ft),Xn(ur)},0)},[Er]);const qt=er=>{er.preventDefault();const Ft=er.clientX-Gn,ur=er.clientY-Jn;document.body.onmousemove=dr=>{let Tr=dr.clientX-Ft,Vr=dr.clientY-ur;const _r=document.getElementsByClassName("markdown-popup-form")[0],ln=window.innerWidth-_r.offsetWidth,qr=window.innerHeight-_r.offsetHeight;Tr=Math.max(0,Math.min(Tr,ln)),Vr=Math.max(0,Math.min(Vr,qr)),mr(dr.clientX,dr.clientY,Ft,ur)&&(_n(Tr),Xn(Vr))},document.body.onmouseup=function(){document.body.onmousemove=null}},mr=(er,Ft,ur,dr)=>{const Tr=document.body.clientHeight,Vr=document.body.clientWidth;return er<20&&ur>er||er>Vr-20&&urFt||Ft>Tr-20&&dr{var Ft;Mn.current=er,(Ft=Fn.current)==null||Ft.setHeight("100vh"),setTimeout(()=>{Ur("add-flowchart")},150)}})):null))),pr?Je.createElement("a",{ref:Tn,className:"editor-resize"}):null,Er===bt&&Je.createElement(ut,{callback:Nt,onCancel:Rt}),Er===xt&&Je.createElement(ct,{ref:Fn,editImgId:Mn.current,callback:Nt,onCancel:Rt}),Je.createElement(de.Z,null,fn[Er]&&Er!==bt&&Er!==xt?Je.createElement($e.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Gn,top:Jn},title:Je.createElement("div",{style:{cursor:"move"},onMouseDown:qt},fn[Er]),open:!0,onCancel:Rt,footer:null,destroyOnClose:!0,width:Er===xt?"1200px":null,height:Er===xt?"80vh":null,className:"markdown-popup-form"},Xt):null))}},82441:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return Te},I:function(){return ke}});var Je=Ve(28284),wt=Ve(6767),y=Ve(37568),we=Ve(44104),ve=Ve(71051),x=Ve(47889),z=Ve(7939),oe=Ve(52882),ie=Ve(59301),ee=Ve(59301),se=Object.defineProperty,E=Object.defineProperties,te=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ce=(de,ge,Se)=>ge in de?se(de,ge,{enumerable:!0,configurable:!0,writable:!0,value:Se}):de[ge]=Se,he=(de,ge)=>{for(var Se in ge||(ge={}))le.call(ge,Se)&&ce(de,Se,ge[Se]);if(re)for(var Se of re(ge))ue.call(ge,Se)&&ce(de,Se,ge[Se]);return de},me=(de,ge)=>E(de,te(ge));const{useForm:fe}=Je.default,be={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}};var Te=({callback:de,onCancel:ge})=>{const[Se]=fe();let De=(0,ie.useRef)();function _e(He){De.current.width=Se.getFieldValue("width"),De.current.align=Se.getFieldValue("align"),de(He,De.current)}function Ee(He,Xe){if(He.status===-1){wt.ZP.error(He.message);return}Se.setFieldsValue({src:`/api/attachments/${He.id}`,type:Xe.type})}function Oe(He){let Xe=He.target.files[0];De.current=Xe,ke(Xe,Ee)}return ee.createElement(Je.default,me(he({form:Se},Ce),{className:"upload-image-panel",onFinish:_e,style:{width:470,overflow:"hidden"}}),ee.createElement(Je.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},ee.createElement("div",{className:"flex-container"},ee.createElement(Je.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},ee.createElement(y.default,{style:be})),ee.createElement(Pe,{onFileChange:Oe}))),ee.createElement(Je.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},ee.createElement(y.default,{style:{width:264}})),ee.createElement(Je.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},ee.createElement(we.Z,null,ee.createElement(Je.default.Item,{name:"width",style:{margin:0}},ee.createElement(ve.Z,{style:{width:264}})),ee.createElement("span",{className:"ml8"},"%"))),ee.createElement(Je.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},ee.createElement(x.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),ee.createElement("aside",null,ee.createElement(Je.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},ee.createElement(z.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ee.createElement(z.ZP,{type:"default",onClick:ge},"\u53D6\u6D88"))))};function Pe({onFileChange:de}){return ee.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",ee.createElement("input",{type:"file",onChange:de}))}function ke(de,ge){if(!de)throw new String("\u6CA1\u6709\u6587\u4EF6");let Se=new FormData;Se.append("editormd-image-file",de),Se.append("file_param_name","editormd-image-file"),Se.append("byxhr","true");var De=new window.XMLHttpRequest;De.withCredentials=!0,De.addEventListener("load",function(_e){ge(JSON.parse(_e.target.responseText),de)},!1),De.addEventListener("error",function(_e){console.error(_e)},!1),De.open("POST",`${oe.KI}/api/attachments.json`),De.send(Se)}},35990:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return y}});var Je=Ve(59301),wt=Ve(4676);class y extends Je.Component{constructor(ve){super(ve);const x=window.document;this.node=x.createElement("div"),x.body.appendChild(this.node)}render(){const{children:ve}=this.props;return(0,wt.createPortal)(ve,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},58478:function(Kt,_t,Ve){"use strict";Ve.d(_t,{SV:function(){return ut},ZP:function(){return tt}});var Je=Ve(59301),wt=Ve(76374);const y={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},we={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},ve={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"if",content:["if () {"," $0","}"].join(` `)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std",content:["using namespace std"].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)}]},x={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(` `)}]},z={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(` `)}]};var oe=Ve(53184),ie=Ve.n(oe),ee=(lt,Ze,Ne)=>new Promise((ze,Me)=>{var Ge=nt=>{try{mt(Ne.next(nt))}catch(Ae){Me(Ae)}},ct=nt=>{try{mt(Ne.throw(nt))}catch(Ae){Me(Ae)}},mt=nt=>nt.done?ze(nt.value):Promise.resolve(nt.value).then(Ge,ct);mt((Ne=Ne.apply(lt,Ze)).next())});const se={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},E=(lt,Ze,Ne,ze)=>{const Me=Ze.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:Ne.lineNumber,endColumn:Ne.column});return Array.from(new Set(Me.match(/\b\w{2,}\b/g)||[])).map(ct=>({label:ct,kind:lt.languages.CompletionItemKind.Text,insertText:ct,range:ze}))},te=(lt,Ze,Ne,ze)=>{lt.languages.registerCompletionItemProvider(Ze,{provideCompletionItems(Me,Ge){const ct=Me.getWordUntilPosition(Ge),mt={startLineNumber:Ge.lineNumber,endLineNumber:Ge.lineNumber,startColumn:ct.startColumn,endColumn:ct.endColumn},nt=Me.getLineContent(Ge.lineNumber).substring(ct.startColumn-2,ct.endColumn);return{suggestions:[...E(lt,Me,Ge,mt),...Ne.map(je=>({label:je,kind:lt.languages.CompletionItemKind.Keyword,documentation:je,insertText:je,insertTextRules:lt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:mt})),...ze.map(je=>({label:je.label,kind:lt.languages.CompletionItemKind.Snippet,documentation:je.content,insertText:nt.startsWith("#")?je.content.replace(/#/,""):je.content,insertTextRules:lt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:mt}))]}}})};var re=lt=>{se.languages.forEach(Ze=>{lt.languages.registerDocumentFormattingEditProvider(Ze,{provideDocumentFormattingEdits(Ne){return ee(this,null,function*(){const ze=ie()(Ne.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:Ne.getFullModelRange(),text:ze}]})}})}),te(lt,"java",we.keywords,we.quickKey),te(lt,"cpp",ve.keywords,ve.quickKey),te(lt,"c",y.keywords,[]),te(lt,"python",x.keywords,x.quickKey),te(lt,"scala",z.keywords,z.quickKey)};const le="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var ue=Object.defineProperty,ce=(lt,Ze,Ne)=>Ze in lt?ue(lt,Ze,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):lt[Ze]=Ne,he=(lt,Ze,Ne)=>ce(lt,typeof Ze!="symbol"?Ze+"":Ze,Ne);const me=class Kl{constructor(Ze,Ne,ze){this.placeholder=Ze,this.editor=Ne,this.monaco=ze,Ne.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Kl.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};he(me,"ID","editor.widget.placeholderHint");var be=me,Ce=Ve(96236),Te=Ve(6767),Pe=Ve(25399),ke=Ve(89392),de=Ve(94276),ge=Ve(56102),Se=Object.defineProperty,De=Object.defineProperties,_e=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Xe=(lt,Ze,Ne)=>Ze in lt?Se(lt,Ze,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):lt[Ze]=Ne,et=(lt,Ze)=>{for(var Ne in Ze||(Ze={}))Oe.call(Ze,Ne)&&Xe(lt,Ne,Ze[Ne]);if(Ee)for(var Ne of Ee(Ze))He.call(Ze,Ne)&&Xe(lt,Ne,Ze[Ne]);return lt},st=(lt,Ze)=>De(lt,_e(Ze)),Le=(lt,Ze)=>{var Ne={};for(var ze in lt)Oe.call(lt,ze)&&Ze.indexOf(ze)<0&&(Ne[ze]=lt[ze]);if(lt!=null&&Ee)for(var ze of Ee(lt))Ze.indexOf(ze)<0&&He.call(lt,ze)&&(Ne[ze]=lt[ze]);return Ne},Ue=(lt,Ze,Ne)=>new Promise((ze,Me)=>{var Ge=nt=>{try{mt(Ne.next(nt))}catch(Ae){Me(Ae)}},ct=nt=>{try{mt(Ne.throw(nt))}catch(Ae){Me(Ae)}},mt=nt=>nt.done?ze(nt.value):Promise.resolve(nt.value).then(Ge,ct);mt((Ne=Ne.apply(lt,Ze)).next())});function rt(lt){return/^\d+$/.test(lt)?`${lt}px`:lt}function ot(){}let it=!1;const Ye={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function $e(lt=[]){let Ze=lt;if(Array.isArray(lt)){for(let Ne=0;NeUe(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(lt){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",lt)}});var tt=lt=>{var Ze=lt,{width:Ne="100%",height:ze="100%",value:Me,language:Ge="javascript",style:ct={},options:mt={},overrideServices:nt={},theme:Ae="vs-dark",onEditBlur:je,isCopy:We=!1,onSave:at,autoHeight:Re=!1,forbidCopy:xe=!1,onChange:ye=ot,editorDidMount:Fe=ot,onFocus:Qe=ot,onBreakPoint:Ie=ot,breakPointValue:vt=[],filename:yt="educoder.txt",errorLine:xt,errorContent:bt="",highlightLine:ht,openBreakPoint:kt=!1,placeholder:Tt="",showMiniMap:Pt=!0}=Ze,Vt=Le(Ze,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const vr=(0,Je.useRef)(),Yt=(0,Je.useRef)({}),Cr=(0,Je.useRef)(),jr=(0,Je.useRef)(),Pr=(0,Je.useRef)([]),Mr=(0,Je.useRef)(!1),Xr=(0,Je.useRef)(),mn=(0,Je.useRef)(),cn=(0,Je.useRef)(!1),[Yr,kn]=(0,Je.useState)(!1);function En(){let pr;return vr.current&&(pr=new wt.Z(Wt=>{for(let Sr of Wt)(Sr.target.offsetHeight>0||Sr.target.offsetWidth>0)&&Yt.current.instance.layout()}),pr.observe(vr.current)),pr}function Dr(){Te.ZP.warning({content:decodeURIComponent(le),key:"monaco-editor-tip"})}const Ar=()=>{let pr=Yt.current.instance;if(Me!=null&&pr&&Yr){const Wt=pr.getModel();Wt&&Me!==Wt.getValue()&&(it=!0,Wt.setValue(Me),pr.layout(),it=!1)}};(0,Je.useEffect)(()=>{const pr=de.Z.subscribe("formatDocument",Wt=>{var Sr;let Gr=Yt.current.instance;(Sr=Gr==null?void 0:Gr.getAction)==null||Sr.call(Gr,"editor.action.formatDocument").run()});return window.updateMonacoValue=Wt=>{ye(Wt)},pr},[]),(0,Je.useEffect)(()=>{var pr;let Wt=Yt.current.instance;jr.current&&clearTimeout(jr.current),jr.current=setTimeout(()=>{Ar()},500),Me&&(Me!=null&&Me.length)&&((pr=Wt==null?void 0:Wt.updateOptions)==null||pr.call(Wt,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Me.split(/\r\n|\r|\n/g).length))+3,5)}))},[Me,Yr,Yt.current]),(0,Je.useEffect)(()=>{if(xt&&Yt.current&&Yt.current.instance){let Wt=Yt.current.instance;Wt.changeViewZones(function(Sr){var Gr=document.createElement("div");Gr.style.padding="10px 20px",Gr.style.width="calc(100% - 20px)",Gr.className="my-error-line-wrp",Gr.innerHTML=bt,Sr.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:Gr})});var pr={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Wt.addOverlayWidget(pr),Wt.revealPositionInCenter({lineNumber:20,column:1})}},[xt,Yt.current,Yr]);const fn=(pr="",Wt)=>{if(!pr||pr.trim()==="")return!0;const Gr=Yt.current.instance.getModel().getLineTokens(Wt);let gn=!1;for(let Ct=0;Ct<2;Ct++)Gr.getStandardTokenType(Ct)===1&&(gn=!0);return gn};(0,Je.useEffect)(()=>{var pr;const Wt=(pr=Yt.current)==null?void 0:pr.instance;if(Wt&&Yr&&xe){const Sr=Wt.onDidBlurEditorWidget(()=>{cn.current=!1}),Gr=Wt.onDidFocusEditorText(()=>{cn.current=!0});return()=>{Sr.dispose(),Gr.dispose()}}},[Yt.current,Yr,xe]),(0,Je.useEffect)(()=>{var pr;if((pr=Yt.current)!=null&&pr.instance&&Yr&&kt){let Wt=Yt.current.instance,Sr=Wt.getModel();if(!Sr)return;(()=>{var sr;let xr=[],ar=[];const $t=Sr.getAllDecorations();for(let br of $t)br.options.className==="highlighted-line"&&(xr.push((sr=br==null?void 0:br.range)==null?void 0:sr.startLineNumber),ar.push(br==null?void 0:br.id));if(ht===xr[0])return;Sr.deltaDecorations(ar,[]);const lr=Sr.getLineCount();ht&&ht<=lr&&(Wt.deltaDecorations([],[{range:new Ke.Range(ht,1,ht,Sr.getLineMaxColumn(ht)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Wt.revealLineInCenter(ht))})();const gn=(sr=!1)=>{var xr;let ar=[],$t=[];const lr=Sr.getAllDecorations();for(let br of lr)br.options.linesDecorationsClassName==="breakpoints-select"&&(ar.push((xr=br==null?void 0:br.range)==null?void 0:xr.startLineNumber),$t.push(br==null?void 0:br.id));if(sr)return{lines:ar,ids:$t};Ie(ar)},Ct=sr=>Ue(void 0,null,function*(){let xr={range:new Ke.Range(sr,1,sr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Sr.deltaDecorations([],[xr]),gn()}),Dt=sr=>Ue(void 0,null,function*(){let xr=[];const ar=Wt.getLineDecorations(sr);for(let $t of ar)$t.options.linesDecorationsClassName==="breakpoints-select"&&xr.push($t.id);yield Sr.deltaDecorations(xr,[]),gn()}),nr=sr=>{let xr=Wt.getLineDecorations(sr);for(let ar of xr)if(ar.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,ke.isEqual)(vt,gn(!0).lines)){Sr.deltaDecorations(gn(!0).ids,[]);const sr=vt.map(xr=>({range:new Ke.Range(xr,1,xr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Sr.deltaDecorations([],sr)}const Gt=Wt.onDidChangeModelContent(sr=>{let xr=Wt.getPosition();if(xr){let ar=xr.lineNumber;clearTimeout(mn.current),mn.current=setTimeout(()=>{fn(Sr.getLineContent(ar),ar)?Dt(ar):nr(ar)?(Dt(ar),Ct(ar)):gn()},100)}}),jt=Wt.onMouseDown(sr=>{var xr,ar,$t;if(sr.target.detail&&(($t=(ar=(xr=sr.target)==null?void 0:xr.element)==null?void 0:ar.className)!=null&&$t.includes("line-numbers"))){let lr=sr.target.position.lineNumber;if(fn(Sr.getLineContent(lr),lr))return;nr(lr)?Dt(lr):Ct(lr)}}),tr=sr=>{let xr={range:new Ke.Range(sr,1,sr,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Pr.current=Wt.deltaDecorations(Pr.current,[xr])},hr=()=>{Pr.current=Wt.deltaDecorations(Pr.current,[])},fr=Wt.onMouseMove(sr=>{var xr,ar,$t;if(hr(),sr.target.detail&&(($t=(ar=(xr=sr.target)==null?void 0:xr.element)==null?void 0:ar.className)!=null&&$t.includes("line-numbers"))){let lr=sr.target.position.lineNumber;if(fn(Sr.getLineContent(lr),lr))return;tr(lr)}}),kr=Wt.onMouseLeave(()=>{hr()});return()=>{Gt.dispose(),jt.dispose(),fr.dispose(),kr.dispose()}}},[Yt.current,Yr,vt,ht,kt,Ge]),(0,Je.useEffect)(()=>{var pr;(pr=Yt.current)!=null&&pr.instance&&kt&&Yt.current.instance.setPosition({lineNumber:0,column:0})},[ht]);function or(){let pr=Yt.current.instance;if(pr){const Wt=pr.getSelection(),Sr=Yt.current.pastePos||{},Gr=new Ke.Range(Sr.startLineNumber||Wt.endLineNumber,Sr.startColumn||Wt.endColumn,Sr.endLineNumber||Wt.endLineNumber,Sr.endColumn||Wt.endColumn);setTimeout(()=>{pr.executeEdits("",[{range:Gr,text:""}])},300)}}function Zt(pr){(window.navigator.platform.match("Mac")?pr.metaKey:pr.ctrlKey)&&pr.keyCode==83&&(pr.preventDefault(),at())}const ir=()=>{if(Re&&Yt.current.instance){const pr=Yt.current.instance.getContentHeight();Wr(pr{if(!cn.current)return;const{keyCode:Wt,ctrlKey:Sr,metaKey:Gr,target:gn,type:Ct}=pr;return(Ct==="paste"||(Wt===67||Wt===86)&&(Gr||Sr))&&gn.nodeName==="TEXTAREA"&&(Dr(),pr.preventDefault()),!1};function Hr(pr,Wt){var Sr=window.URL||window.webkitURL||window,Gr=new Blob([Wt]),gn=document.createElementNS("http://www.w3.org/1999/xhtml","a");gn.href=Sr.createObjectURL(Gr),gn.download=pr,Nr(gn)}(0,Je.useEffect)(()=>{ir()},[ir]),(0,Je.useEffect)(()=>{vr.current&&!Yr&&Promise.all([Ve.e(8909),Ve.e(4474)]).then(Ve.bind(Ve,71448)).then(pr=>{try{Ke=pr,Yt.current.instance=Ke.editor.create(vr.current,{value:Me,language:$e(Ge),theme:Ae,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Pt||!1}},nt);const Wt=Yt.current.instance;let gn=[...Ce.BH._menuItems].find(Gt=>Gt[0]._debugName=="EditorContext")[1],Ct=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Dt=(Gt,jt)=>{var tr,hr;let fr=Gt._first;do jt.includes((hr=(tr=fr.element)==null?void 0:tr.command)==null?void 0:hr.id)&&Gt._remove(fr);while(fr=fr.next)};if(Fe(Wt,Ke),setTimeout(()=>{ir(),Yt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Hr(yt||"educoder.txt",Wt.getValue())}})},500),Yt.current.subscription=Wt.onDidChangeModelContent(Gt=>{Mr.current?clearTimeout(Xr.current):(ir(),ye(Wt.getValue(),Gt)),Xr.current=setTimeout(()=>{Mr.current=!1},500)}),window.Monaco||re(Ke,$e(Ge)),xe&&(Dt(gn,Ct),vr.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",gr),window.removeEventListener("paste",gr),window.addEventListener("keydown",gr),window.addEventListener("paste",gr)),window.Monaco=Ke,je&&Wt.onDidBlurEditorWidget(()=>{je(Wt.getValue())}),Qe&&Wt.onDidFocusEditorText(()=>{xe&&ft(),Qe(Wt.getValue())}),xe){ft();try{Wt.onDidPaste(Gt=>{const jt=Wt.getSelection(),tr=Yt.current.pastePos||{},hr=new Ke.Range(tr.startLineNumber||jt.endLineNumber,tr.startColumn||jt.endColumn,tr.endLineNumber||jt.endLineNumber,tr.endColumn||jt.endColumn);Wt.executeEdits("",[{range:Gt.range,text:""}])})}catch(Gt){}}let nr=En();return Tt&&typeof Tt=="string"&&new be(Tt,Wt,Ke),kn(!0),()=>{const Gt=Yt.current.instance;Gt.dispose();const jt=Gt.getModel();jt&&jt.dispose(),Yt.current.subscription&&Yt.current.subscription.dispose(),nr.unobserve(vr.current)}}catch(Wt){}})},[]),(0,Je.useEffect)(()=>{if(Yt.current.instance&&Yr)return document.addEventListener("keydown",Zt,!1),()=>{document.removeEventListener("keydown",Zt)}},[at,Yr]),(0,Je.useEffect)(()=>{let pr=Yt.current.instance;if(pr&&Yr){let Wt=$e(Ge);Ke.editor.setModelLanguage(pr.getModel(),Wt)}},[Ge,Yr]),(0,Je.useEffect)(()=>{Yt.current.instance&&Yr&&Ke.editor.setTheme(Ae)},[Ae,Yr]),(0,Je.useEffect)(()=>{let pr=Yt.current.instance;Cr.current=mt,pr&&Yr&&(pr.updateOptions(et({},mt)),setTimeout(()=>{pr.getModel().updateOptions(et({},mt))},200))},[JSON.stringify(mt),Yr]),(0,Je.useEffect)(()=>{let pr=Yt.current.instance;pr&&Yr&&pr.layout()},[Ne,ze,Yr]);const[Qr,rn]=(0,Je.useState)(rt(Ne)),[Kr,Wr]=(0,Je.useState)(rt(ze)),dn=st(et({},ct),{width:Qr,height:Kr,position:"relative"});return Je.createElement("div",{className:"my-monaco-editor",ref:vr,style:dn,onFocus:()=>{xe&&ft()}},We&&Je.createElement(ge.CopyToClipboard,{text:Me,onCopy:()=>Te.ZP.success("\u590D\u5236\u6210\u529F")},Je.createElement(Pe.Z,{title:"\u590D\u5236\u4EE3\u7801"},Je.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},Je.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ut({width:lt="100%",height:Ze="100%",original:Ne,modified:ze,language:Me,options:Ge={}}){const ct=(0,Je.useRef)(),[mt,nt]=(0,Je.useState)(null);function Ae(Re){let xe;return ct.current&&(xe=new wt.Z(ye=>{for(let Fe of ye)(Fe.target.offsetHeight>0||Fe.target.offsetWidth>0)&&Re.layout()}),xe.observe(ct.current)),xe}(0,Je.useEffect)(()=>(ct.current&&Promise.all([Ve.e(8909),Ve.e(9404)]).then(Ve.bind(Ve,2550)).then(Re=>{Ke=Re;const xe=Ke.editor.createDiffEditor(ct.current,st(et({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ge),{wordWrap:!0}));nt(xe);let ye=Ae(xe);return()=>{xe.dispose();const Fe=xe.getModel();Fe&&Fe.dispose(),ye.unobserve(ct.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,Je.useEffect)(()=>{mt&&mt.setModel({original:Ke.editor.createModel(Ne,Me),modified:Ke.editor.createModel(ze,Me)})},[Ne,ze,Me,mt]);const je=rt(lt),We=rt(Ze),at={width:je,height:We};return Je.createElement("div",{className:"my-diff-editor",ref:ct,style:at})}},74242:function(Kt,_t,Ve){"use strict";var Je=Ve(94583),wt=Ve(82326),y=Ve(71411),we=Ve(59301);const ve=wt.default.Option;_t.Z=({isTheoretical:x,onFontSizeChange:z,cmFontSize:oe,cmCodeMode:ie,autoFormat:ee,onCodeModeChange:se,onTabToSpace:E,onAutoFormat:te,formatDocument:re,className:le="",tabToSpace:ue,children:ce,code_editor:he,challenge:me,shixun_environment_id:fe,shixun_environments:be})=>{var Ce;const Te={1:"\u7B80\u5355",2:"\u4E2D\u7B49",3:"\u56F0\u96BE"},Pe=(Ce=be==null?void 0:be.find(ke=>ke.shixun_environment_id===fe))==null?void 0:Ce.program_language;return console.log("----",Pe,be,fe,he),we.createElement("div",{className:`tpi-code-setting ${le}`},we.createElement("h3",null,"\u4EE3\u7801\u683C\u5F0F"),we.createElement("section",null,we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u663E\u793A\u6A21\u5F0F"),we.createElement(wt.default,{bordered:!1,size:"small",value:ie,onChange:se},we.createElement(ve,{value:"vs"},"\u767D\u8272\u80CC\u666F"),we.createElement(ve,{value:"vs-dark"},"\u9ED1\u8272\u80CC\u666F"))),!x&&we.createElement(we.Fragment,null,we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5B57\u4F53\u5927\u5C0F"),we.createElement(wt.default,{bordered:!1,size:"small",value:oe,onChange:z},we.createElement(ve,{value:12},"12px"),we.createElement(ve,{value:14},"14px"),we.createElement(ve,{value:16},"16px"),we.createElement(ve,{value:18},"18px"),we.createElement(ve,{value:20},"20px"),we.createElement(ve,{value:22},"22px"))),we.createElement("div",{className:"file-item"},we.createElement("b",null,"Tab\u8F6C\u6362"),we.createElement(y.Z,{checked:ue,onChange:E})),we.createElement("div",{className:"file-item",onClick:re},we.createElement("b",{style:{cursor:"pointer"}},"\u683C\u5F0F\u5316\u4EE3\u7801")))),!x&&we.createElement(we.Fragment,null,we.createElement("h3",null,"\u5FEB\u6377\u952E"),we.createElement("section",null,we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u4FDD\u5B58\u4EE3\u7801"),we.createElement("span",null,"Ctrl + S")),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5524\u51FA\u5FEB\u6377\u952E\u5217\u8868"),we.createElement("span",null,"F1 / Alt + F1")),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5DE6\u53F3\u7F29\u8FDB"),we.createElement("span",null,"Ctrl + ]/[")),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u8DF3\u5230\u5339\u914D\u7684\u62EC\u53F7"),we.createElement("span",null,"Ctrl + Shift + \\")),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u8F6C\u5230\u884C\u9996"),we.createElement("span",null,"Home")),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u8F6C\u5230\u884C\u5C3E"),we.createElement("span",null,"End"))),ce),!x&&we.createElement(we.Fragment,null,we.createElement("h3",null,"\u5B9E\u8BAD\u57FA\u672C\u4FE1\u606F"),we.createElement("section",null,Pe&&we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u7F16\u7A0B\u8BED\u8A00"),we.createElement("span",null,Pe)),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5B9E\u8BAD\u96BE\u6613\u5EA6"),we.createElement("span",null,Te[me==null?void 0:me.difficulty])),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5B9E\u9A8C\u73AF\u5883"),we.createElement("span",null,he==null?void 0:he.name)),we.createElement("div",{className:"file-item"},we.createElement("b",null,"\u5B9E\u9A8C\u5BB9\u5668\u7F51\u7EDC"),we.createElement("span",null,he!=null&&he.close_internet?"\u5173\u95ED\u5916\u7F51":"\u5F00\u542F\u5916\u7F51")))))}},61904:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Z:function(){return wt}});var Je=Ve(59301);function wt(y,we){const ve=(0,Je.useRef)();(0,Je.useEffect)(()=>{ve.current=y}),(0,Je.useEffect)(()=>{function x(){ve.current()}if(we!==null){let z=setInterval(x,we);return()=>clearInterval(z)}},[we])}},69101:function(Kt,_t,Ve){"use strict";Ve.r(_t),Ve.d(_t,{Types:function(){return kn},default:function(){return Ar}});var Je=Ve(59301),wt={header:"header___N_IdR",field:"field___XG_dh","oj-form-container":"oj-form-container___syYzK","oj-left-panel":"oj-left-panel___L082x","oj-form-info":"oj-form-info___q0IU5",footer:"footer___pGCM2",result:"result___LM9Ms",passText:"passText___nUoL4",noPassText:"noPassText___ECHHG",pass:"pass___tDubp",noPass:"noPass___ilYvg","test-case-name":"test-case-name___MI_KD","btn-remove-case":"btn-remove-case___OiaTQ","icon-tag":"icon-tag___D86WO",btn_back:"btn_back___FyaSY",testJi:"testJi___NDviK",upBtn:"upBtn___FiZX4","oj-problems":"oj-problems___xb70g",row:"row___v036E",a:"a___yRaYH",b:"b___gWQyu",inputTwo:"inputTwo___IZ9og",inputOne:"inputOne____NmcT",cusModal:"cusModal___fJ5gm","oj-custom-large-spin":"oj-custom-large-spin___Aar0g",MdEditor:"MdEditor___hgoes"},y=Ve(37568),we=Ve(62957),ve=Ve(8848),x=Ve(28284),z=Ve(6767),oe=Ve(77019),ie=Ve(5269),ee=Ve(29787),se=Ve(7939),E=Ve(54172),te=Ve(82326),re=Ve(71051),le=Ve(47889),ue=Ve(62673),ce=Ve(44104),he=Ve(93725),me=Ve(59301);const{Option:fe}=te.default;var be=(or=>(or[or.language=0]="language",or[or.difficulty=1]="difficulty",or[or.category=2]="category",or[or.openOrNot=3]="openOrNot",or))(be||{});const Ce={0:[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],1:[{title:"\u7B80\u5355",key:1},{title:"\u9002\u4E2D",key:2},{title:"\u56F0\u96BE",key:3}],2:[{title:"\u7A0B\u5E8F\u8BBE\u8BA1",key:1},{title:"\u7B97\u6CD5",key:2}],3:[{title:"\u516C\u5F00",key:1},{title:"\u79C1\u6709",key:0}]};function Te(or){return Ce[or].map(Zt=>me.createElement(fe,{key:Zt.title,value:Zt.key}," ",Zt.title," "))}function Pe(or,Zt){or.map(ir=>{const{id:Nr,name:gr,sub_disciplines:Hr}=ir;let Qr={value:Nr,label:gr};Zt.push(Qr),Hr&&Hr.length>0&&(Qr.children=[],Pe(Hr,Qr.children))})}function ke(or,Zt){var ir;let Nr=[];for(let gr=0;gr0){Nr[0]=Hr.id;for(let Qr=0;QrZt in or?ft(or,Zt,{enumerable:!0,configurable:!0,writable:!0,value:ir}):or[Zt]=ir,Me=(or,Zt)=>{for(var ir in Zt||(Zt={}))Ze.call(Zt,ir)&&ze(or,ir,Zt[ir]);if(lt)for(var ir of lt(Zt))Ne.call(Zt,ir)&&ze(or,ir,Zt[ir]);return or},Ge=(or,Zt)=>tt(or,ut(Zt));const ct={theme:(0,$e.G)("cmCodeMode","vs-dark"),fontSize:(0,$e.G)("cmFontSize",14),showEditorSetting:!1,tabToSpace:(0,$e.G)("cmTabToSpace",!0)};var mt=(or=>(or[or.set_font_size=0]="set_font_size",or[or.set_theme=1]="set_theme",or[or.on_tab_to_space=2]="on_tab_to_space",or[or.set_show_editor_setting=3]="set_show_editor_setting",or))(mt||{});function nt(or,Zt){switch(Zt.type){case 3:return Ge(Me({},or),{showEditorSetting:Zt.payload});case 1:return Ge(Me({},or),{theme:Zt.payload});case 0:return Ge(Me({},or),{fontSize:Zt.payload});case 2:return Ge(Me({},or),{tabToSpace:Zt.payload});default:throw new Error}}var Ae=({value:or,onChange:Zt,language:ir,onLanguage:Nr,languageItems:gr,ActionBarRender:Hr=Qr=>Je.createElement(je,{languageItems:gr,onLanguage:Nr,language:ir,onShowCodeSetting:Qr})})=>{const[Qr,rn]=(0,Je.useReducer)(nt,ct),{theme:Kr,fontSize:Wr,showEditorSetting:dn,tabToSpace:pr}=Qr;console.log(or,ir,"value");const Wt={onFontSizeChange:Ct=>{rn({type:0,payload:Ct}),(0,$e.t)("cmFontSize",Ct)},tabToSpace:pr,cmFontSize:Wr,className:"oj",cmCodeMode:Kr,onTabToSpace:Ct=>{rn({type:2,payload:Ct}),(0,$e.t)("cmTabToSpace",Ct)},onCodeModeChange:Ct=>{rn({type:1,payload:Ct}),(0,$e.t)("cmCodeMode",Ct)}};function Sr(){rn({type:3,payload:!1})}function Gr(){rn({type:3,payload:!0})}const gn={value:or,language:ir,onChange:Zt,theme:Kr,height:"calc(100% - 56px)",options:{fontSize:Wr,insertSpaces:pr}};return Je.createElement(Je.Fragment,null,Je.createElement("div",{className:Ke["code-panel-container"]},Hr(Gr),Je.createElement(ot.ZP,Me({key:ir},gn))),Je.createElement(Ye.Z,null,Je.createElement(rt.Z,{rootClassName:"oj",title:null,placement:"right",closable:!1,open:dn,onClose:Sr},Je.createElement(it.Z,Me({},Wt)))))};function je({languageItems:or,language:Zt,onShowCodeSetting:ir,onLanguage:Nr}){return Je.createElement("div",{className:Ke["action-oj-bar"]},or==null?void 0:or.map(gr=>Je.createElement("div",{className:Zt===(gr==null?void 0:gr.language)?Ke.active:"",onClick:()=>Nr(gr==null?void 0:gr.language),key:gr==null?void 0:gr.language},gr==null?void 0:gr.language)),Je.createElement("a",{onClick:ir},Je.createElement("i",{className:"iconfont icon-shezhi"})))}var We=Ve(20554),at={flex_box_center:"flex_box_center___4yAaY",flex_space_between:"flex_space_between___YaUgM",flex_box_vertical_center:"flex_box_vertical_center___zR3dp",flex_box_center_end:"flex_box_center_end___rwgS5",flex_box_column:"flex_box_column___LhFeP",wrap:"wrap___xTL91",in:"in___eSY86",btns:"btns___UdEGI",customModal:"customModal___CL0OL"},Re=(or,Zt,ir)=>new Promise((Nr,gr)=>{var Hr=Kr=>{try{rn(ir.next(Kr))}catch(Wr){gr(Wr)}},Qr=Kr=>{try{rn(ir.throw(Kr))}catch(Wr){gr(Wr)}},rn=Kr=>Kr.done?Nr(Kr.value):Promise.resolve(Kr.value).then(Hr,Qr);rn((ir=ir.apply(or,Zt)).next())}),ye=({visible:or,onOK:Zt,onCancel:ir})=>{const[Nr,gr]=(0,Je.useState)(!1),[Hr,Qr]=(0,Je.useState)(!1),[rn,Kr]=(0,Je.useState)("1"),[Wr,dn]=(0,Je.useState)(""),[pr,Wt]=(0,Je.useState)([]),Sr=()=>Re(void 0,null,function*(){if(!Wr){z.ZP.warning(`\u9898\u76EE${nr}\u4E0D\u80FD\u4E3A\u7A7A`);return}Qr(!0);const Gt=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"post",body:{target:or,name:Wr}});if((Gt==null?void 0:Gt.status)===0){Zt();return}Qr(!1)}),Gr=(Gt="")=>Re(void 0,null,function*(){gr(!0);let jt=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"get",params:{target:or,search:Gt}});Wt(jt.tag_disciplines||[]),gr(!1)}),gn=Gt=>{let jt=Gt.name;we.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u91CD\u547D\u540D",content:Je.createElement("div",null,Je.createElement(y.default,{defaultValue:jt,placeholder:`\u8BF7\u8F93\u5165${nr}\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57`,maxLength:20,onChange:tr=>{jt=tr.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Re(void 0,null,function*(){if(!jt)return z.ZP.warning(`\u9898\u76EE${nr}\u4E0D\u80FD\u4E3A\u7A7A`),Promise.reject();const tr=yield(0,Ee.ZP)(`/api/tag_disciplines/${Gt.id}/rename.json`,{method:"post",body:{id:Gt.id,name:jt}});(tr==null?void 0:tr.status)===0&&Gr()})})},Ct=Gt=>{we.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,width:570,title:"\u5220\u9664",content:or==="practice"?Je.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u6765\u6E90\u201C",Je.createElement("span",{className:"c-light-primary"},Gt.name),"\u201D\u5220\u9664\u5417\uFF1F",Je.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u6765\u6E90\u8FDB\u884C\u6E05\u9664\u3002"):Je.createElement("div",null,"\u786E\u8BA4\u5C06\u9898\u76EE\u77E5\u8BC6\u70B9\u201C",Je.createElement("span",{className:"c-light-primary"},Gt.name),"\u201D\u5220\u9664\u5417\uFF1F",Je.createElement("br",null),"\u5220\u9664\u540E\uFF0C\u4F1A\u5C06\u76F8\u5173\u9898\u76EE\u4E2D\u7684\u77E5\u8BC6\u70B9\u8FDB\u884C\u6E05\u9664\u3002"),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Re(void 0,null,function*(){const jt=yield(0,Ee.ZP)(`/api/tag_disciplines/${Gt.id}.json`,{method:"delete",body:{id:Gt.id}});(jt==null?void 0:jt.status)===0&&Gr()})})},Dt=Gt=>{Gr(Gt)},nr=or==="practice"?"\u77E5\u8BC6\u70B9":"\u6765\u6E90";return Je.createElement(we.default,{afterClose:()=>{Qr(!1),gr(!1),dn(""),Kr("1"),Wt([])},centered:!0,keyboard:!1,width:600,title:`${nr}\u7BA1\u7406`,open:!!or,className:at.customModal,footer:null,onCancel:ir},Je.createElement("section",{className:at.wrap},Je.createElement(We.default,{activeKey:rn,onChange:Gt=>{dn(""),Kr(Gt),Gr()}},Je.createElement(We.default.TabPane,{tab:`\u65B0\u589E${nr}`,key:"1"},Je.createElement(y.default,{value:Wr,onChange:Gt=>dn(Gt.target.value),className:at.in,placeholder:`\u8F93\u5165${nr}\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57`,maxLength:20}),Je.createElement("div",{className:at.btns},Je.createElement(se.ZP,{onClick:ir,className:"mr20"},"\u53D6\u6D88 "),Je.createElement(se.ZP,{loading:Hr,onClick:Sr,type:"primary"},"\u786E\u8BA4\u65B0\u5EFA"))),Je.createElement(We.default.TabPane,{tab:`\u5DF2\u6709${nr}`,key:"2"},Je.createElement(y.default.Search,{allowClear:!0,onSearch:Dt,value:Wr,onChange:Gt=>dn(Gt.target.value),className:at.in,placeholder:`\u8F93\u5165${nr}\u540D\u79F0\u8FDB\u884C\u67E5\u8BE2`}),Je.createElement(E.default,{dataSource:pr,bordered:!1,loading:Nr,scroll:pr.length>7?{y:300}:{},style:{padding:"0 0px 20px 0px"},columns:[{title:`${nr}\u540D\u79F0`,dataIndex:"name",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"action",width:120,render:(Gt,jt)=>Je.createElement("span",null,Je.createElement("span",{onClick:()=>gn(jt),className:"current mr10 c-light-primary"},"\u91CD\u547D\u540D"),Je.createElement("span",{onClick:()=>Ct(jt),className:"current c-grey-666"},"\u5220\u9664"))}],pagination:!1})))))},Fe=Ve(26869),Qe=Ve(68989),Ie=Ve(56656),vt=Ve.n(Ie),yt=Ve(31735),xt=Ve(59944),bt=Ve(11968),ht=Ve(59301),kt=Object.defineProperty,Tt=Object.defineProperties,Pt=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Cr=(or,Zt,ir)=>Zt in or?kt(or,Zt,{enumerable:!0,configurable:!0,writable:!0,value:ir}):or[Zt]=ir,jr=(or,Zt)=>{for(var ir in Zt||(Zt={}))vr.call(Zt,ir)&&Cr(or,ir,Zt[ir]);if(Vt)for(var ir of Vt(Zt))Yt.call(Zt,ir)&&Cr(or,ir,Zt[ir]);return or},Pr=(or,Zt)=>Tt(or,Pt(Zt)),Mr=(or,Zt,ir)=>new Promise((Nr,gr)=>{var Hr=Kr=>{try{rn(ir.next(Kr))}catch(Wr){gr(Wr)}},Qr=Kr=>{try{rn(ir.throw(Kr))}catch(Wr){gr(Wr)}},rn=Kr=>Kr.done?Nr(Kr.value):Promise.resolve(Kr.value).then(Hr,Qr);rn((ir=ir.apply(or,Zt)).next())});const{TextArea:Xr}=y.default,{confirm:mn}=we.default,{Panel:cn}=ve.default,Yr={loading:!0,user:null,status:0,data:void 0,lastedUpdateTime:0};var kn=(or=>(or[or.SET_INITAL_DATA=0]="SET_INITAL_DATA",or[or.SET_LOADING=1]="SET_LOADING",or[or.SET_STATUS=2]="SET_STATUS",or))(kn||{});const En="#### \u9898\u76EE\u63CF\u8FF0\n\u73B0\u6709\u4E00\u4E2A\u6574\u578B\u6570\u7EC4 `nums`\uFF0C\u8BF7\u7F16\u5199\u7A0B\u5E8F\u5C06\u6570\u7EC4 `nums` \u4E2D\u7684\u6240\u6709 `$$0$$` \u79FB\u52A8\u5230\u6570\u7EC4\u7684\u672B\u5C3E\uFF0C\u4F46\u4E0D\u6539\u53D8\u975E\u96F6\u5143\u7D20\u5728\u6570\u7EC4\u4E2D\u7684\u76F8\u5BF9\u4F4D\u7F6E\u3002\u8BF7\u5728\u539F\u6570\u7EC4 `nums` \u4E0A\u8FDB\u884C\u64CD\u4F5C\u3002\n#### \u8F93\u5165\u8F93\u51FA\u683C\u5F0F\n**\u8F93\u5165\u683C\u5F0F**\n\u7B2C\u4E00\u884C\u6709\u4E00\u4E2A\u6574\u6570 `numsSize`\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u5927\u5C0F\uFF1B\n\u7B2C\u4E8C\u884C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u8868\u793A\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n**\u8F93\u51FA\u683C\u5F0F**\n\u4E00\u884C\u8F93\u51FA\u6570\u7EC4 `nums` \u7684\u6240\u6709\u5143\u7D20\uFF0C\u6709 `numsSize` \u4E2A\u6574\u6570\uFF0C\u6BCF\u4E2A\u6574\u6570\u7528\u4E00\u4E2A\u7A7A\u683C\u9694\u5F00\u3002\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B1\n**\u8F93\u5165**\n`4`\n`0 1 2 3`\n**\u8F93\u51FA**\n`1 2 3 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8F93\u5165\u8F93\u51FA\u6837\u4F8B2\n**\u8F93\u5165**\n`5`\n`1 1 0 1 0`\n**\u8F93\u51FA**\n`1 1 1 0 0`\n**\u89E3\u91CA\uFF08\u53EF\u9009\uFF09**\nXXXXX\n#### \u8BF4\u660E\u63D0\u793A\n-`1\u2264n\u2264100`";function Dr(or,Zt){switch(Zt.type){case 0:return jr(jr({},or),Zt.payload);case 1:return Pr(jr({},or),{loading:Zt.payload});case 2:return Pr(jr({},or),{status:Zt.payload});default:throw new Error}}var Ar=()=>{var or,Zt,ir;const Nr=(0,de.useLocation)(),{id:gr}=(0,de.useParams)(),[Hr]=x.default.useForm(),[Qr,rn]=(0,Je.useState)(),[Kr,Wr]=(0,Je.useState)(!1),[dn,pr]=(0,Je.useState)([]),[Wt,Sr]=(0,Je.useState)([]),[Gr,gn]=(0,Je.useState)([]),[Ct,Dt]=(0,Je.useState)([]),[nr,Gt]=(0,Je.useState)([]),[jt,tr]=(0,Je.useState)("C"),[hr,fr]=(0,Je.useReducer)(Dr,Yr),{loading:kr,data:sr,user:xr,status:ar}=hr,$t=sr==null?void 0:sr.hack_sets,lr=(or=sr==null?void 0:sr.hack)==null?void 0:or.test_set_average,[br,Rr]=(0,Je.useState)(!1),Fr=(0,Je.useRef)([]),[vn,On]=(0,Je.useState)(!1),[zr,Er]=(0,Je.useState)(!1),Ur=(0,Je.useRef)(!0),[wr,jn]=(0,Je.useState)({});(0,Je.useEffect)(()=>((0,de.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,de.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),()=>{(0,de.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,de.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}),[]),(0,Je.useEffect)(()=>{setTimeout(()=>{document.title="\u5728\u7EBF\u5237\u9898"},400)});const Hn=()=>Mr(void 0,null,function*(){const Rt=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"get",params:{target:"practice"}}),Jt=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source"}});Sr(Rt.tag_disciplines||[]),gn(Jt.tag_disciplines||[])});var Ln=[{language:"C",code:""},{language:"C++",code:""},{language:"Java",code:""},{language:"Python",code:""}];const Vn=(0,Je.useCallback)(()=>Mr(void 0,null,function*(){if(fr({type:1,payload:!0}),gr){const Rt=yield Xe(gr),{user:Jt,language:rr,practice_sets:Qt,practice_codes:Ot,description:Bt,difficulty:Ht,name:zt,open_or_not:qt,time_limit:mr,test_set_average:er,test_set_score:Ft,status:ur,tag_discipline_ids:dr,source_discipline_ids:Tr,item_banks_group_id:Vr,is_file:_r=!1,hide_actual_output:ln,review_privilege:qr,review_description:sn,submit_rule:hn}=Rt;jn({review_privilege:qr,status:ur,review_description:sn,name:zt}),Rr(ln);const Pn=_r?[{input:"",output:"",score:100,position:1}]:Qt;_r?(pr(Qt),Hr.setFieldsValue({hack_sets:Pn})):pr([]),fr({type:0,payload:{loading:!0,user:Jt,status:ur,data:{hack:{difficulty:Ht,name:zt,description:Bt,open_or_not:qt,time_limit:mr,test_set_average:er,test_set_score:Ft,tag_discipline_ids:dr,source_discipline_ids:Tr,is_file:_r,submit_rule:hn},hack_sets:Pn}}}),rn({hack:{difficulty:Ht,name:zt,description:Bt,open_or_not:qt,time_limit:mr,test_set_average:er,test_set_score:Ft,tag_discipline_ids:dr,source_discipline_ids:Tr,is_file:_r}});const wn=Ot==null?void 0:Ot.map(nn=>Pr(jr({},nn),{code:ge.Base64.decode(nn==null?void 0:nn.code)}));Gt(wn),Fr.current=wn}else{const{user:Rt}=yield He();fr({type:0,payload:{loading:!0,status:0,user:Rt,data:{hack:{difficulty:"",time_limit:3,description:En,test_set_score:!0,test_set_average:!0,open_or_not:!0,name:"",is_file:!1,submit_rule:1},hack_sets:[{input:"",output:"",score:100,position:1}]}}}),rn({hack:{difficulty:"",time_limit:3,description:"",test_set_average:!0,open_or_not:!0,name:"",is_file:!1}}),Gt(Ln),Fr.current=Ln}fr({type:1,payload:!1})}),[gr]);(0,Je.useEffect)(()=>{try{Vn(),Hn()}catch(Rt){console.log(Rt,"----")}},[]);function Yn(Rt,Jt){return Mr(this,null,function*(){var rr;const{hack_sets:Qt,hack:Ot}=jr({},Rt);Ot.hide_actual_output=br;let Bt=[],Ht=[],zt=0;const qt=Ot!=null&&Ot.is_file?dn.map((Ft,ur)=>Pr(jr({},Ft),{position:ur+1})):Qt.map(Ft=>Pr(jr({},Ft),{is_file:!1}));for(let Ft of qt)zt+=Ft.score,Ft.id&&Ft.id>=0?Bt.push(Ft):Ht.push(Ft);if(!(qt!=null&&qt.length)){z.ZP.error("\u6D4B\u8BD5\u96C6\u4E0D\u80FD\u4E3A\u7A7A");return}if(zt!==100&&!Ot.test_set_score){z.ZP.error("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100");return}if(qt!=null&&qt.some(Ft=>!Ft.output)){z.ZP.error("\u6D4B\u8BD5\u96C6\u8F93\u51FA\u4E0D\u80FD\u4E3A\u7A7A");return}Ur.current?On(!0):Er(!0);let mr;const er=nr==null?void 0:nr.map(Ft=>Pr(jr({},Ft),{code:ge.Base64.encode(Ft==null?void 0:Ft.code)}));if(gr?mr=yield et(gr,{practice:Ot,practice_codes:er,practice_sets:Ht,update_practice_sets:Bt}):mr=yield Oe({practice:Ot,practice_codes:er,practice_sets:qt,publish:!Ur.current}),On(!1),Er(!1),(mr==null?void 0:mr.status)===0){if((rr=mr==null?void 0:mr.similar_practice)!=null&&rr.length){Wr(!0),Dt(mr==null?void 0:mr.similar_practice);return}if(gr){if(z.ZP.success("\u4FDD\u5B58\u6210\u529F"),!Ur.current){const Ft=yield(0,Ee.ZP)(`/api/practices/${gr}/start`,{method:"get"});(Ft==null?void 0:Ft.status)===0&&de.history.push(`/problems/${Ft==null?void 0:Ft.identifier}/oj/${gr}`)}}else z.ZP.success("\u65B0\u5EFA\u6210\u529F"),de.history.replace(`/problems/${mr==null?void 0:mr.identifier}/ojedit`)}})}function Gn(){de.history.replace("/problems")}const _n=Rt=>{const Jt=Math.floor(100/Rt.length),rr=Jt+100%Rt.length;Rt=Rt.map((Qt,Ot)=>Ot===Rt.length-1?Pr(jr({},Qt),{score:rr}):Pr(jr({},Qt),{score:Jt})),pr(Rt)};function Jn(Rt){Rt.target.value||_n(dn),fr({type:0,payload:{data:Pr(jr({},sr),{hack:Pr(jr({},sr.hack),{test_set_score:Rt.target.value})})}})}function Xn(Rt){fr({type:0,payload:{data:Pr(jr({},sr),{hack:Pr(jr({},sr.hack),{is_file:Rt.target.value})})}})}function Ir(Rt){Rr(Rt.target.checked)}function on(Rt){const Jt=Rt.target.value;Jt&&_n(dn),fr({type:0,payload:{data:Pr(jr({},sr),{hack:Pr(jr({},sr.hack),{test_set_average:Jt})})}})}function Tn(){let Rt=Hr.getFieldValue("hack_sets");const Jt=Rt.length+1,rr=Math.floor(100/Jt),Qt=100%Jt;Rt.map((Ot,Bt)=>(lr&&(Ot.score=rr),Ot.position=Bt+1,Ot)),Rt.push({input:"",output:"",position:Jt,score:lr?rr+Qt:0}),Hr.setFieldsValue({hack_sets:Rt}),fr({type:0,payload:{data:Pr(jr({},sr),{hack_sets:Rt})}})}(0,Je.useEffect)(()=>{if(lr){const Rt=$t==null?void 0:$t.length,Jt=Math.floor(100/Rt),rr=100%Rt;$t==null||$t.map((Qt,Ot)=>(Qt.score=Jt,Qt.position=Ot+1,Ot===Rt-1&&(Qt.score=Jt+rr),Qt)),fr({type:0,payload:{data:Pr(jr({},sr),{hack_sets:$t})}}),Hr.setFieldsValue({hack_sets:$t})}},[lr]);function Bn(Rt){let Jt=Hr.getFieldValue("hack_sets");const rr=(Jt==null?void 0:Jt.length)-1,Qt=Math.ceil(100/rr),Ot=100%rr;Jt.splice(Rt,1),Jt==null||Jt.map((Bt,Ht)=>(lr&&(Bt.score=Qt,Ht===rr-1&&(Bt.score=Qt+Ot)),Bt.position=Ht+1,Bt)),fr({type:0,payload:{data:Pr(jr({},sr),{hack_sets:Jt})}}),Hr.setFieldsValue({hack_sets:Jt})}function Mn(Rt){tr(Rt)}const Fn=Rt=>{var Jt;const rr=(Jt=Fr.current)==null?void 0:Jt.findIndex(Qt=>Qt.language===jt);Fr.current[rr].code=Rt,Gt(Fr.current)},ri=Rt=>{rn(jr({},Hr.getFieldsValue()))},St=Rt=>Mr(void 0,null,function*(){const Jt=yield(0,Ee.ZP)(`/api/practices/${Rt}/start`,{method:"get"});(Jt==null?void 0:Jt.status)===0&&(0,yt.xg)(`/problems/${Jt==null?void 0:Jt.identifier}/oj/${Rt}`)}),Lt=()=>Mr(void 0,null,function*(){const Rt=yield Xe(gr),{name:Jt,status:rr,review_privilege:Qt,review_description:Ot}=Rt;jn({review_privilege:Qt,status:rr,review_description:Ot,name:Jt})}),Mt=()=>{let Rt="";we.default.confirm({icon:null,width:700,className:"custom-modal-divider",centered:!0,title:"\u4E0D\u901A\u8FC7\u539F\u56E0",content:ht.createElement("div",{className:"mt20"},ht.createElement(_e.Z,{className:wt.MdEditor,defaultValue:Rt,onChange:Jt=>{Rt=Jt}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Mr(void 0,null,function*(){if(!Rt)return z.ZP.warning("\u4E0D\u901A\u8FC7\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const Jt=yield(0,Ee.ZP)(`/api/practices/${gr}/review.json`,{method:"post",body:{op:"fail",description:Rt}});(Jt==null?void 0:Jt.status)===0&&(z.ZP.success("\u63D0\u4EA4\u6210\u529F"),Lt())})})},Nt=()=>Mr(void 0,null,function*(){we.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u63D0\u793A",content:`\u786E\u8BA4\u5C06\u9898\u76EE\u300A${wr==null?void 0:wr.name}\u300B\u7684\u5BA1\u6838\u901A\u8FC7\u5417\uFF1F`,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Mr(void 0,null,function*(){const Rt=yield(0,Ee.ZP)(`/api/practices/${gr}/review.json`,{method:"post",body:{op:"pass"}});(Rt==null?void 0:Rt.status)===0&&(z.ZP.success("\u63D0\u4EA4\u6210\u529F"),Lt())})})}),Xt=()=>{const Rt=we.default.confirm({icon:null,width:700,className:`${wt.cusModal} custom-modal-divider`,centered:!0,title:ht.createElement(oe.Z,null,ht.createElement(ie.Z,{flex:"1"},"\u4E0D\u901A\u8FC7\u539F\u56E0"),ht.createElement(ie.Z,null,ht.createElement("span",{className:"iconfont icon-guanbi7 font12 current c-grey-c",onClick:()=>Rt.destroy()}))),content:ht.createElement("div",null,ht.createElement(xt.Z,{className:"mt20",value:(wr==null?void 0:wr.review_description)||""}))})};return ht.createElement(ee.Z,{spinning:kr,size:"large",className:wt["oj-custom-large-spin"]},sr?ht.createElement(Je.Fragment,null,ht.createElement("header",{className:wt.header},ht.createElement("div",null,ht.createElement("img",{src:`${Fe.Z.IMG_SERVER}/images/${xr==null?void 0:xr.image_url}`,alt:"user",width:30}),ht.createElement("span",null,xr==null?void 0:xr.name)),ht.createElement("h2",null," ",(Zt=sr==null?void 0:sr.hack)==null?void 0:Zt.name," "),gr?ht.createElement("a",{className:wt.btn_back,onClick:Gn}," ",ht.createElement(Se.Z,null),"\u9000\u51FA"):null),ht.createElement(x.default,{form:Hr,initialValues:sr,layout:"vertical",className:wt["oj-form-container"],onValuesChange:ri,onFinish:Yn},ht.createElement(Ue.Z,{hideResize:!0,className:wt["oj-problems"],leftChild:ht.createElement(fn,{formValue:Qr,onRemoveTestCase:Bn,onAddTestCase:Tn,hack:sr.hack,onChangeScore:Jn,onChangehide:Ir,onChangeAverage:on,onChangeFile:Xn,uploadData:dn,setUploadData:pr,handleUploadRatio:_n,ischecked:br,pointData:Wt,sourceData:Gr,getPointData:Hn}),rightChild:ht.createElement(Ae,{value:(ir=nr==null?void 0:nr.find(Rt=>Rt.language===jt))==null?void 0:ir.code,onChange:Fn,onLanguage:Mn,languageItems:nr,language:jt})}),ht.createElement("div",{className:wt.footer},!!gr&&ht.createElement("div",{className:wt.result},ht.createElement("span",null,"\u5BA1\u6838\u7ED3\u679C:"),wr!=null&&wr.review_privilege?ht.createElement(ht.Fragment,null,ht.createElement("div",{onClick:Nt,className:wt.pass},"\u901A\u8FC7"),ht.createElement("div",{onClick:Mt,className:wt.noPass},"\u4E0D\u901A\u8FC7")):ht.createElement(ht.Fragment,null,(wr==null?void 0:wr.status)===0&&ht.createElement("div",{className:wt.passText},ht.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u53D1\u5E03"),(wr==null?void 0:wr.status)===1&&ht.createElement("div",{className:wt.passText},ht.createElement("i",{className:"iconfont icon-tongguo"}),"\u5DF2\u516C\u5F00"),(wr==null?void 0:wr.status)===2&&ht.createElement("div",{className:wt.passText},ht.createElement("i",{className:"iconfont icon-tongguo"}),"\u672A\u5BA1\u6279"),(wr==null?void 0:wr.status)===3&&ht.createElement("div",{className:wt.passText},ht.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u4E2D"),(wr==null?void 0:wr.status)===4&&ht.createElement("div",{className:wt.passText},ht.createElement("i",{className:"iconfont icon-tongguo"}),"\u5BA1\u6838\u5B8C\u6210\u5F85\u516C\u5F00"),(wr==null?void 0:wr.status)===5&&ht.createElement("div",{className:wt.noPassText},ht.createElement("i",{className:"iconfont icon-weitongguo1"}),"\u5BA1\u6838\u4E0D\u901A\u8FC7",ht.createElement("span",{onClick:Xt},"\u67E5\u770B\u539F\u56E0")))),ht.createElement(se.ZP,{type:"primary",ghost:!0,onClick:Gn},"\u9000\u51FA\u7F16\u8F91"),ht.createElement(se.ZP,{disabled:zr,loading:vn,type:"primary",onClick:()=>{Ur.current=!0,Hr.submit()}},"\u4FDD\u5B58 "),gr?ht.createElement(se.ZP,{disabled:vn,loading:zr,style:{background:"#2FC25B",border:0},type:"primary",onClick:()=>{Ur.current=!1,Hr.submit()}},"\u7ACB\u5373\u4F53\u9A8C"):ht.createElement(se.ZP,{disabled:vn,loading:zr,type:"primary",onClick:()=>{Ur.current=!1,Hr.submit()}},"\u4FDD\u5B58\u5E76\u53D1\u5E03\u5BA1\u6838")))):null,ht.createElement(we.default,{centered:!0,destroyOnClose:!0,footer:null,open:Kr,onCancel:()=>Wr(!1),title:"\u76F8\u4F3C\u6027\u68C0\u6D4B",width:"600px"},ht.createElement("div",null,ht.createElement("p",{className:"font14"},"\u7ECF\u7CFB\u7EDF\u68C0\u6D4B\u53D1\u73B0\uFF0C\u672C\u9898\u76EE\u4E0E\u7CFB\u7EDF\u4E2D\u5DF2\u521B\u5EFA\u7684\u9898\u76EE\u9AD8\u5EA6\u96F7\u540C\uFF0C\u8BF7\u8C03\u6574\u9898\u76EE\u540E\u518D\u8FDB\u884C\u4FDD\u5B58"),ht.createElement(E.default,{dataSource:Ct,bordered:!1,scroll:Ct.length>7?{y:300}:{},columns:[{title:"\u76F8\u4F3C\u9898\u9898\u76EE",dataIndex:"name",ellipsis:!0,render:(Rt,Jt)=>ht.createElement("span",{onClick:()=>St(Jt==null?void 0:Jt.identifier),style:{textDecorationLine:"underline"},className:"current c-light-primary"},Rt)},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"create_time",width:170,render:Rt=>{var Jt;return(Jt=vt()(Rt))==null?void 0:Jt.format("YYYY-MM-DD HH:mm")}}],pagination:!1}))))};function fn({ischecked:or,formValue:Zt,hack:ir,onChangeAverage:Nr,onChangeScore:gr,onChangehide:Hr,onChangeFile:Qr,onAddTestCase:rn,onRemoveTestCase:Kr,uploadData:Wr,setUploadData:dn,handleUploadRatio:pr,pointData:Wt,sourceData:Sr,getPointData:Gr}){var gn,Ct;const{test_set_average:Dt,test_set_score:nr}=ir,[Gt,jt]=(0,Je.useState)(!1),[tr,hr]=(0,Je.useState)(!1),fr=(lr,br)=>{const Rr=[...Wr];Rr.splice(br,1),Dt?pr(Rr):dn(Rr)},kr=(lr,br)=>{console.log(lr,br);const Rr=Wr.map((Fr,vn)=>vn===br?Pr(jr({},Fr),{score:lr.target.value?Number(lr.target.value):0}):Fr);dn(Rr)},sr=lr=>{const br=Wr.concat(lr);ir.test_set_average?pr(br):dn(br)};function xr(lr){lr.stopPropagation()}function ar(){if((0,bt.Ny)()){hr("practice");return}let lr="";we.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",content:ht.createElement("div",null,ht.createElement(y.default,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:br=>{lr=br.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Mr(this,null,function*(){const br=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"post",body:{target:"practice",name:lr}});(br==null?void 0:br.status)===0&&Gr()})})}function $t(){if((0,bt.Ny)()){hr("practice_source");return}let lr="";we.default.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u65B0\u5EFA\u6765\u6E90",content:ht.createElement("div",null,ht.createElement(y.default,{placeholder:"\u8BF7\u8F93\u5165\u6765\u6E90\u540D\u79F0\uFF0C\u4E0D\u8D85\u8FC720\u4E2A\u5B57",maxLength:20,onChange:br=>{lr=br.target.value}})),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Mr(this,null,function*(){const br=yield(0,Ee.ZP)("/api/tag_disciplines.json",{method:"post",body:{target:"practice_source",name:lr}});(br==null?void 0:br.status)===0&&Gr()})})}return ht.createElement("div",{className:wt["oj-left-panel"]},ht.createElement("div",{className:wt["oj-form-info"]},ht.createElement(x.default.Item,{label:"\u9898\u76EE\u540D\u79F0",name:["hack","name"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0"}],className:wt.inputOne},ht.createElement(y.default,{bordered:!1,maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0",suffix:ht.createElement("span",null,((Ct=(gn=Zt==null?void 0:Zt.hack)==null?void 0:gn.name)==null?void 0:Ct.length)||0,"/",ht.createElement("span",{className:"c-grey-999"},"60"))})),ht.createElement(x.default.Item,{name:["hack","description"],valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},ht.createElement(_e.Z,{placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u63CF\u8FF0\u2026",miniToolbar:!0,id:"moop_cases_content",noStorage:!0,height:200})),ht.createElement("div",{className:wt.row},ht.createElement("div",{className:wt.a},ht.createElement(x.default.Item,{label:"\u96BE\u6613\u5EA6",name:["hack","difficulty"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u6613\u5EA6"}]},ht.createElement(te.default,null,Te(be.difficulty)))),ht.createElement("div",{className:wt.b},ht.createElement(x.default.Item,{label:"\u9898\u76EE\u6765\u6E90",name:["hack","source_discipline_ids"]},ht.createElement(te.default,{placeholder:"\u9009\u62E9\u9898\u76EE\u6765\u6E90",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:lr=>lr.parentNode},Sr.map(lr=>ht.createElement(te.default.Option,{key:lr.id,value:lr.id},lr.name)))),ht.createElement(se.ZP,{style:{padding:"0 18px"},type:"primary",ghost:!0,onClick:()=>$t()},(0,bt.Ny)()?"\u6765\u6E90\u7BA1\u7406":"\u65B0\u5EFA\u6765\u6E90"))),ht.createElement("div",{className:wt.row},ht.createElement("div",{className:wt.b,style:{width:"100%",marginLeft:0}},ht.createElement(x.default.Item,{label:"\u77E5\u8BC6\u70B9",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"}],name:["hack","tag_discipline_ids"]},ht.createElement(te.default,{placeholder:"\u9009\u62E9\u77E5\u8BC6\u70B9",showSearch:!1,mode:"multiple",showArrow:!0,getPopupContainer:lr=>lr.parentNode},Wt.map(lr=>ht.createElement(te.default.Option,{key:lr.id,value:lr.id},lr.name)))),ht.createElement(se.ZP,{type:"primary",ghost:!0,onClick:()=>ar()},(0,bt.Ny)()?"\u77E5\u8BC6\u70B9\u7BA1\u7406":"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))),ht.createElement("div",{className:wt.field},ht.createElement(x.default.Item,{label:"\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236",name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:1,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F1\u79D2"}],className:wt.inputTwo,extra:ht.createElement("span",{style:{position:"absolute",left:200,top:11,color:"#333"}},"\u79D2",ht.createElement("span",{className:"ml5 c-grey-999"},"(\u4EE3\u7801\u6267\u884C\u6240\u5141\u8BB8\u7684\u6700\u5927\u65F6\u957F)"))},ht.createElement(re.Z,{style:{width:185},min:1}))),ht.createElement("div",{className:"tst-case-info"},ht.createElement("h3",{className:"flex-container",style:{justifyContent:"space-between"}}," ","\u6D4B\u8BD5\u7528\u4F8B\u4E0E\u7CFB\u7EDF\u8BC4\u5206\u89C4\u5219",!ir.is_file&&ht.createElement(se.ZP,{style:{height:40},type:"primary",ghost:!0,onClick:rn},"\u6DFB\u52A0\u6D4B\u8BD5\u7528\u4F8B")),ht.createElement(x.default.Item,{name:["hack","test_set_score"]},ht.createElement(le.ZP.Group,{onChange:gr},ht.createElement(le.ZP,{value:!0},"\u901A\u8FC7\u5168\u90E8\u6D4B\u8BD5\u96C6",ht.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u4EC5\u5F53\u6240\u6709\u6D4B\u8BD5\u96C6\u90FD\u6B63\u786E\u65F6\uFF0C\u624D\u83B7\u5F97\u4E00\u6B21\u6027\u5956\u52B1\uFF09")),ht.createElement(le.ZP,{value:!1},"\u901A\u8FC7\u90E8\u5206\u6D4B\u8BD5\u96C6",ht.createElement("span",{className:"tip"}," ","\uFF08\u5B66\u5458\u8BC4\u6D4B\uFF0C\u901A\u8FC7\u6D4B\u8BD5\u96C6\u5373\u53EF\u83B7\u5F97\u5BF9\u5E94\u5956\u52B1\uFF09")))),ht.createElement(ue.default,{style:{marginBottom:"5px"},checked:or,onChange:Hr},"\u9690\u85CF\u5B9E\u9645\u8F93\u51FA \uFF08\u9009\u4E2D\uFF0C\u5219\u5728\u5B66\u751F\u505A\u9898\u8FC7\u7A0B\u4E2D\u65E0\u6CD5\u770B\u5230\u5B9E\u9645\u8F93\u51FA\u7ED3\u679C\uFF0C\u4EC5\u5C55\u793A\u662F\u5426\u8BC4\u6D4B\u662F\u5426\u901A\u8FC7\uFF09"),ht.createElement(x.default.Item,{className:wt.testJi,name:["hack","is_file"],label:"\u7528\u4F8B\u7C7B\u578B:"},ht.createElement(le.ZP.Group,{onChange:Qr},ht.createElement(ce.Z,{direction:"horizontal"},ht.createElement(le.ZP,{value:!1},"\u6587\u672C"),ht.createElement(le.ZP,{value:!0},"\u6587\u4EF6")))),ht.createElement(x.default.Item,{label:"\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406",name:["hack","submit_rule"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406"}]},ht.createElement(le.ZP.Group,null,ht.createElement(le.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),ht.createElement(le.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),ht.createElement(le.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"),ht.createElement(le.ZP,{value:3},"\u5FFD\u7565\u6BCF\u884C\u9996\u5C3E\u7A7A\u683C"))),!ir.test_set_score&&ht.createElement(x.default.Item,{name:["hack","test_set_average"],label:"\u7CFB\u7EDF\u8BC4\u5206\u5360\u6BD4"},ht.createElement(le.ZP.Group,{onChange:Nr},ht.createElement(le.ZP,{value:!0},"\u5747\u5206\u6BD4\u4F8B"),ht.createElement(le.ZP,{value:!1},"\u81EA\u5B9A\u4E49\u6BD4\u4F8B"))),ir.is_file&&ht.createElement("div",{className:wt.upBtn},ht.createElement(se.ZP,{ghost:!0,type:"primary",className:"mb20",onClick:()=>jt(!0)},"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"),ht.createElement(Qe.Y2,{disabled:ir==null?void 0:ir.test_set_average,inputChange:kr,showScore:!ir.test_set_score,data:Wr,onRemove:fr})),!ir.is_file&&ht.createElement(x.default.List,{name:"hack_sets"},(lr,{})=>ht.createElement(ve.default,{accordion:!0},lr.map((br,Rr)=>ht.createElement(cn,{key:`${br.key}--${Rr}`,header:ht.createElement("a",{className:wt["test-case-name"]},ht.createElement("span",null,"\u6D4B\u8BD5\u7528\u4F8B",Rr+1),nr?null:ht.createElement(ht.Fragment,null,ht.createElement(x.default.Item,{name:[br.name,"score"],fieldKey:[br.fieldKey,"score"],rules:[{required:!0,message:`\u8BF7\u8F93\u5165\u6D4B\u8BD5\u96C6${Rr+1}\u8BC4\u5206`}]},ht.createElement(re.Z,{onClick:xr,min:0,max:100,disabled:Dt})),ht.createElement("span",null,"%"))),extra:Rr>0?ht.createElement("div",{onClick:xr},ht.createElement(he.Z,{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u5B9A\u5220\u9664\u6D4B\u8BD5\u96C6\b"+(Rr+1),onConfirm:()=>{Kr(Rr)}},ht.createElement(De.Z,{className:wt["btn-remove-case"]}))):null},ht.createElement(x.default.Item,{label:"\u8F93\u5165",name:[br.name,"input"],fieldKey:[br.fieldKey,"input"]},ht.createElement(Xr,null)),ht.createElement(x.default.Item,{label:"\u8F93\u51FA",name:[br.name,"output"],fieldKey:[br.fieldKey,"output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},ht.createElement(Xr,null)))))))),ht.createElement(Qe.ZP,{rootIdentifier:null,visible:Gt,onClose:()=>jt(!1),onOK:sr}),ht.createElement(ye,{visible:tr,onCancel:()=>{hr(!1),Gr()},onOK:()=>{hr(!1),Gr()}}))}},68989:function(Kt,_t,Ve){"use strict";Ve.d(_t,{Y2:function(){return Xe},ZP:function(){return et}});var Je=Ve(59301),wt=Ve(14566),y=Ve(6767),we=Ve(62957),ve=Ve(77019),x=Ve(47889),z=Ve(7939),oe=Ve(62673),ie=Ve(25399),ee=Ve(37568),se={wrap:"wrap___MkYbQ",colorBlue:"colorBlue___onjbP",repeatedName:"repeatedName___nbqnE",text:"text___xvutp",greyText:"greyText___dihvZ",noData:"noData___LxOJA",dragger:"dragger___y7F4A",uploadText:"uploadText___Et3KS",btnS:"btnS___k1e6j",testCaseRadio:"testCaseRadio___q1wXT",head:"head___s4Eix",operation:"operation___JCAVh",headProgram:"headProgram___uWA_M",listWrapper:"listWrapper___xW3b4",list:"list___dCbd6",del:"del___abNho",info:"info___J1Wmf"},E="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATEAAADICAYAAACAj9YNAAAAAXNSR0IArs4c6QAAD59JREFUeF7tnet527gShsFUZFeQpJN1GkncyG46iVJBVFG4D6mLKYmSMLgQM4NXf855NrgMvm/8egBC9BD4oIBhBV7++fPlHP6n8PH/p/84Dp8XS7v8txB2N8sext/h7+G/73++3v67YZ08hz54Xhxr86fAy7c/P+ZVHQB1DaYaCz7AbBzfgVsNefPHBGL5GjJCRQUW0PpecRrp0DugJpWsXnsgVk9bRk5QQCm0nq1khhpb0Gcy1fl3IFZHV0YVKDCfa03nWeOgqdoSrODc9Lz1BGgp8qX1AWJputGrgAJz1bXd2VaBiEVDUJ2J5EpvDMTStaNnogJHeFmvuiSrB2gStYRtgZhQMJqnKWD0rCttsfd7AbPSioYQgFgFURnyQwHnW8ZUq4FZqnIr/YBYQTEZ6lKBDreNshQYxvf9v6+He298khUAYsnS0fGeAsBLmBvj+JWnmULNFs2BWLp29LxSYL4qMczXJLa4Se9Nf7aYiY4CsUTh6MbWsUoOsMUUywrExJLRYakAW8cq+UBVJpAViAnEoinV16Y5QFUWJTcQi5KJRtcKUIFtlBOA7KnQQOypRDS42D5yeN8iIdhePlAdiLVISaNzUn01No6rGKsGALHGeWllegCmxCm2lzdGADEluak5DACmzB1AdmEIEFOWn9rCAWDaHDnGA8jOxgAxpTmqIayXt/0vbt9rcOJODIBsFgaIKc7RlqFRgbVUXzA3IANignTppikAM2Z15yCjEjOWr7XDBWC1Fa40fscgA2KVcsrisADMomuLmDsFGRAznrelwj++Rmc6yOdjWYEOL8QCMcsJWyh2AFZISCXD7P976ernuqvFKskxVWEAMFV2lAmms20lECuTNmZH4S6YWeseB94RyICY0xyOWRYH+TEqGW7TCciAmOEczQmdbWSOenb69nA+BsTs5GPRSNlGFpVT72AdVGNATG/6VYuMbWQ1aXUO7BxkQExn2lWN6uVtP1adgMHVKeB5WwnE1KVb3YDYRtbVV+3ojqsxIKY268oHxmF+eU0tjei1GgNilrIwM1a2kZkCWu/utBoDYtYTMzJ+tpGRQnlv5hBkQMx70h7XRxXWidHPl7nb//fy9XkzOy2AmB2vkiPlSkWydD47OqvGgJjPNL1YFVVYByZLlgjEJGrRtrUCPJFs7YDS+R2BjEpMSY7NsDl+9j9fd6XC4kC/lJLOxgFizgzdYDnzudTpMw6fj//3DK4HIRyANoy/w9+wkwCOKmwDYy1P4QRkVGIVk/AMrnH4XniaXQzUqMIKq+5tOCDmzdH89cyVz6fwJRwqrZgqK3/SEFaBRhVWQlr/Y3i4xU8lVihPlVxj2IVxfJ+2nFRhhYz1PoyDagyIZSapEnhdr2I6R9uqEsxUkO5NFQBiTeVvOrlSeDXVhMltKmB9S0klJsw74CUUjOb6FTBejQExQYoBMIFYNLWkgOnvUwKxyFTjoDxSKJqZVMDylhKIPUk5riqY/JkkaKkChreUQOyB2WwfpT8JtDerABAza93dwAGYP09Z0WMFrG4pqcRWfGULyY97jwoAMSeuAzAnRrIMuQJGt5RUYldW8xRSnvv0cKIAELNvJACz7yEryFLA5H0xKrGj5xzkZyU/nZ0oYPFcDIiFEDgHc/ITyDKyFQBi2RK2GYBtZBvdmVWhAuP4VfL2YA0r6L4SYxupIQ2JQY0CBg/3gdjbflSTQASCAq0VAGKtHZDNTxUm04vWHSgAxOyYzGG+Ha+IdFMFzF2z6HY7yWH+pj8YTGZHASBmwSuqMAsuEWMjBYBYI+FF0wIxkVw07kwBa3fFutxOspXs7KeS5YoUAGIiudo0fuFaRRvhmdWEAkBMuU1sJZUbRHjNFQBizS14HABbSeUGEV5zBYBYcwueQowb+so9Iry2CgCxtvo/nJ2tpGJzCE2NAkBMjRW3gQAxxeYQmhoFgJgaK1Yg9u3PjzAO3xWHSGgo0FoBLru2duDR/HzhW7M7xKZEASCmxIjVMHgyqdkdYlOiABBTYgQQ02wEsWlWAIhpdodKTLM7xKZCAd4npsKGu0HwdSPd/hCdAgV4x35bE+YrFNPnUzj87/IzDp9DWPnvbUNmdhTQpQAQ286P+Unj9DnAafrcgmu7cJgJBVwoYO2O2CS6mVfxXEELYLn4kWERShXYhXF8t/Kn21RDbAEuLqgqzXbCcq+AeqCpgxjgcv9DwQLtKqASaGogxm16u5lN5B0qoOgqRnOIAa8OfwBYshcFVFRmzSAGvLzkMetAgdAUZptD7Agv7myR+SjgT4EmMNsUYlRf/rKWFaHAigKbwmwTiAEvEh0FOlRgo8P/6hADYB0mL0tGgZMCG4CsGsSOr4KeLqlyu56URoG+Fai6vawCMaqvvjOW1aPAqgKVqrLiEANgJDAKoMBdBSqArCjEABjJiwIoEKFA0bfHFoMYAIuwjiYogAInBYqBrAjEeO0zmYkCKJCgQBGQZUMMgCVYRxcUQIFiFVkWxNhCkokogALZCmQe9idDDIBlW8cAKIACJwUyQJYEMQBG7qEAChRXIBFkYogdb+L/Kr4ABkQBFECBBJDJIfa2H1EaBVAABaopIASZCGI8iaxmGwOjAAosFJD86bhoiHEORo6hAApspoCgGouCGOdgm1nHRCiAAsInlnEQe9tPB/m8Uof0kiswjO/hb9jNHYeBVzPJFey6R8y28inE2EZ2nUM5i1/9Sgn5lCNph30jtpUPIcY2ssOkKbTkR79BAVkhkXsZ5gnIHkOMbWQvaVJ2neP4df/z9bCFvPMBZGUl9z7ao1+KdyFGFeY9LSqtLwJgp5m5slPJA4/DPqjG7kOMKsxjKtRdU8T5xXUAL1yeruuJo9HvVWOrEKMKc+T8VktJANgUGrm2lUEO5rmTY+sQowpz4PiGS0gE2Hlb+c+fL2EY+D7uhpaZnCoWYvxmNGlvu6AzAXYG2bc/P8I43yPjgwL3FVjJt5tKjMNWMkigQJHXCwMygeK9N42EGG+p6D1R4tZfFGCALE50WoVwfcB/UYmxlSRFohUQXKWIHvPYkDtkUsU6a39VjV1CjAP9zrIhcbkVAXauyMjFRHP66Lasxq4hxlayjxxIX+UGAANk6fZ003ORh2eIsZXsxv70hRZ6EikJgMuwErU6arvIxQ+IUb53lAEJS20AsClKfrkmeNVHl/ODpSXE2Er2Yb58lY0AxhNLuVU99Tidi80Q47ddT9aL11rlKoU0Cp5YShXroP3xlysQ68DrjCWqABgVWYaDnrteQIzzMM9Wp65NFcAAWaqNrvvNOXqoxICYa6eTFrfhVQppfGwtpYr5bT+di50gxqG+X5/lK1MMsHNFxi9eua8eewzj+8ChvkdnM9bU+EmkJHJ2EBK1nLYFYk6NTV2WIYDNxyC8hyzVaT/9ZojxHic/huasxBjAzttKQJbjuv2+M8Q4W7BvZO4KjAKMJ5a5xrvovwNiLnzMWoTKqxTSFbGjkCrmpj0Qc2Nl2kJcAIyKLM18L72oxLw4mbIOA1cppMuiIpMqZr/9BDHuiNn3Ub4ChwCjIpOngYceQMyDi9I1OAbYGWQ8sJJmhdn2QMysdYmBG38SKVk1uwyJWnbbAjG73skj7whgkzhchpWniMUeQMyiaykxdwaw87aSy7Ap2WKqD08nTdmVHKyrqxRSFXhiKVXMVnsgZsuvlGi7BhhPLFNSxlYfIGbLL2m0AGyhGBWZNH1stAdiNnxKi7KDqxRSYQCZVDH97XmLhX6P0iIEYHd146UHaSmltNcOiCl1JissAPZUPkD2VCIrDXa82dWKVbFxdnqVIlaeZTsuw6aopqzP9D6xKSTMVGZMajgATKQcl2FFculsPI7nv3bEl8B1WiSJiieRErWObTnoTxBNU5cFxH6FEL5oio1YhApwDiYU7KM5IEuWrnnHjz/Zxnv2m5uRGQBVWIaAQCxDvLZdF388l++XtbWiwOzTb6QCw3Q5BBAzavvxDPic+BzuGzXyFDbbyWQDuW6RLF3bjsecX0KMc7G2luTPDsjEGlKFiSVT0+G0+/iAGOdiaszJDGSX1X8c3/c/X/PGyAogrvMMn+kzDp/jeqy24mFWhniNu57PgT8gxrlYY09UTa/6QQHVk6pcaRPMYtdxcRjM2UAbP1TOqvTiLBdUVWbL5kEtH2RdQowt5eZmqJ0QiKm1hsDCxU7h5rE8TylJkaMCKreUVGLkZ7h6gHULMaoxsuSgABAjE1QqcH0nEoiptElFUEBMhQ0EcaXATV6u3vJmS0niUImRAyoVWLkLuQ4xtpQq/ds4KCqxjQVnuqcKrObk3e/bUY09FdR7AyDm3WFr67vzjZT7EKMas2Zx6XiBWGlFGS9Hgbv5+PDNB1RjOZqb7wvEzFvoaAEPvhf8GGJUY46yQLwUICaWjA5VFHhy8frpO6j4nloVWywMCsQsuOQ/xqd5+BRik0ZsK/1nysoKnyZPC1W4sd9C9YZzRrxeKg5ibCsbuthsaiDWTHomPioQlYNREJurMUDWW2ZFJdDWolCJba14u/liX7keDTG2le3MbDQzEGskPNNOL7scv8a+nFMGMaqxnvILiPXktqa1Cl8DJYIY20pNTlePBYhVl5gJSjxQEkMMkHWTeECsG6v1LDT2HGwZcRLEjudj/HUkPd7XiASI1VCVMe8rIDgHKwIxQOY+G4GYe4sVLTARYNMKkiuxGWL8hSRFWVA8FCBWXFIGXFVAeJB/PUYWxACZ66QEYq7tVbK4TIBlV2InGajIlCRE2TCAWFk9Ge2mhBrf9/++Hv4IcsYnuxK7Atn3EAJ/VTnDEEVdgZgiM9yFUqACO2lSDGJnmL3teWrpI+OAmA8f9a0i4xB/bTHFITafkwEyfYkjjwiIyTWjx2MFdmEc32O/ThQrZhWIzSDjK0qxHmhtB8S0OmMxroLbx5ujtZp6HA/8OSerKXK9sYFYPW37GrkiwCYhq1ViS5fYXprMWSBm0jZVQVfZPm5aiV2A7HAxlqpMVY49DAaI2fFKX6SVq6/lgjepxC5gxlmZvoRbjwiIWXFKU5wbwuu07M0hNh/6U5VpSrt7sQAxCy5pirEBwDY7E7unMzDTlIE3sQAx1fYoCq4RvJpWYtfyAzNFCfkRChBTaYuioBrDSxXETsEAM0UJGgIQU2WHkmCG8X2KpMR3HkutqMmZWEzwAC1GpaptgFhVeU0NvgvD+FsTuJbqqYXYMkiA1iThgVgT2dVMqhpc5iB2A7T5kcR852z68NaMOnkPxOroqnXUGVrhb9iV/m5j7QWbqMSeiTBXatPnU/gSxuHzSntA90zE238HYnLNWvTYXU26lusfbSZQnT4GgbUm8P/6C+VmwqlgeQAAAABJRU5ErkJggg==",te=Ve(47257),re=Ve.n(te),le=Ve(13683),ue=Ve(97013),ce=Ve(1012),he=Ve(31735),me=Ve(47199),fe=Ve(59301),be=Object.defineProperty,Ce=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,ge=(st,Le,Ue)=>Le in st?be(st,Le,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):st[Le]=Ue,Se=(st,Le)=>{for(var Ue in Le||(Le={}))ke.call(Le,Ue)&&ge(st,Ue,Le[Ue]);if(Pe)for(var Ue of Pe(Le))de.call(Le,Ue)&&ge(st,Ue,Le[Ue]);return st},De=(st,Le)=>Ce(st,Te(Le)),_e=(st,Le,Ue)=>new Promise((rt,ot)=>{var it=Ke=>{try{$e(Ue.next(Ke))}catch(ft){ot(ft)}},Ye=Ke=>{try{$e(Ue.throw(Ke))}catch(ft){ot(ft)}},$e=Ke=>Ke.done?rt(Ke.value):Promise.resolve(Ke.value).then(it,Ye);$e((Ue=Ue.apply(st,Le)).next())});const{Dragger:Ee}=wt.default,Oe=st=>{const Le=ft=>ft&&ft.substring(0,ft.lastIndexOf("."));for(var Ue=[...st],rt=0,ot=[],it=0;it{if(ft.forEach(tt=>{let ut=tt.name.split(/\.(?=[^\.]+$)/);tt.name=`${ut[0]}.${ut[1].toLowerCase()}`}),ft[0].name.includes(".in"))return ft.length===2?ft:[ft[0],{}];if(ft[0].name.includes(".out"))return ft.length===2?ft.reverse():[{},ft[0]]})},He=({onClose:st,onOK:Le,visible:Ue,wrapClassName:rt,rootIdentifier:ot,multiple:it=!1,defaultMultipleValue:Ye=!0})=>{const[$e,Ke]=(0,Je.useState)([]),[ft,tt]=(0,Je.useState)({}),[ut,lt]=(0,Je.useState)(!1),[Ze,Ne]=(0,Je.useState)(!0),ze=(0,Je.useRef)([]),Me=(0,Je.useRef)(0),Ge=()=>{st()};(0,Je.useEffect)(()=>{ct()},[]),(0,Je.useEffect)(()=>{Ue&&(ze.current=[],Me.current=0,Ke([]),Ne(Ye))},[Ue]);const ct=()=>_e(void 0,null,function*(){try{const xe=yield(0,ue.ZP)("/api/buckets/get_upload_token_for_big_files",{method:"get"}),ye=JSON.parse((0,le.pe)(xe.data));tt(ye)}catch(xe){}}),mt=xe=>xe&&xe.substring(0,xe.lastIndexOf(".")),nt=xe=>{var ye,Fe;const Qe=mt((ye=xe[0])==null?void 0:ye.name)||mt((Fe=xe[1])==null?void 0:Fe.name),Ie=$e.filter(vt=>mt(vt.name)!==Qe);ze.current=[...Ie],Ke([...Ie])},Ae=xe=>{if(!Ze){const yt=new FormData;yt.append("file",xe.file),(0,ue.ZP)("/api/attachments/get_file_content.json",{method:"post",body:yt},!0).then(bt=>{if(bt.status===0){Me.current=Me.current+1;const ht=ze.current.map(kt=>{var Tt;if(kt.name===xe.name){const Pt=Se({},kt);return(Tt=xe==null?void 0:xe.name)!=null&&Tt.includes(".in")?Pt.input=bt==null?void 0:bt.content:Pt.output=bt==null?void 0:bt.content,Pt}return kt});if(ze.current=[...ht],Ke([...ht]),Me.current>0&&Me.current===$e.length){lt(!1);let kt=Oe(ht);kt=kt.filter(Tt=>{var Pt,Vt;return!!((Pt=Tt[0])!=null&&Pt.name&&((Vt=Tt[1])!=null&&Vt.name))}),kt=kt.map(Tt=>De(Se(Se({},Tt[0]),Tt[1]),{is_file:!1})),Le(kt),st()}}else lt(!1),st()});return}const ye=new(re())({endpoint:ft.end_point,region:ft.region,accessKeyId:ft.access_key_id,accessKeySecret:ft.access_key_secret,bucket:ft.bucket,stsToken:ft.security_token}),Fe=xe.name,Qe={container_type:"TestSet",file_name:Fe},Ie=(0,ce.Z)();let vt=`testsets/${ot}/${Ie}${Fe.indexOf(".")>-1?"."+Fe.split(".").pop():""}`;ot===null&&(vt=`testsets/${Ie}${Fe.indexOf(".")>-1?"."+Fe.split(".").pop():""}`),ye.multipartUpload(vt,new Blob([xe.file],{type:xe.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:Fe+""},url:ft==null?void 0:ft.callback_url,host:ft==null?void 0:ft.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+(0,ue.rz)(Qe)}}).then(function(yt){if(yt.data.status===0){Me.current=Me.current+1;const xt=ze.current.map(bt=>{var ht,kt,Tt,Pt,Vt,vr,Yt,Cr,jr,Pr,Mr,Xr,mn,cn,Yr,kn,En;if(bt.name===((kt=(ht=yt.data)==null?void 0:ht.data)==null?void 0:kt.file_name)){const Dr=Se({},bt);return(Vt=(Pt=(Tt=yt.data)==null?void 0:Tt.data)==null?void 0:Pt.file_name)!=null&&Vt.includes(".in")?(Dr.in_object_key=(Yt=(vr=yt.data)==null?void 0:vr.data)==null?void 0:Yt.object,Dr.in_object_size=(jr=(Cr=yt.data)==null?void 0:Cr.data)==null?void 0:jr.size,Dr.input=(Mr=(Pr=yt.data)==null?void 0:Pr.data)==null?void 0:Mr.file_name,Dr.in_file=xe):(Dr.out_object_key=(mn=(Xr=yt.data)==null?void 0:Xr.data)==null?void 0:mn.object,Dr.out_object_size=(Yr=(cn=yt.data)==null?void 0:cn.data)==null?void 0:Yr.size,Dr.output=(En=(kn=yt.data)==null?void 0:kn.data)==null?void 0:En.file_name,Dr.out_file=xe),Dr}return bt});if(ze.current=[...xt],Ke([...xt]),Me.current>0&&Me.current===$e.length){lt(!1);let bt=Oe(xt);bt=bt.filter(ht=>{var kt,Tt;return!!((kt=ht[0])!=null&&kt.name&&((Tt=ht[1])!=null&&Tt.name))}),bt=bt.map(ht=>De(Se(Se({},ht[0]),ht[1]),{is_file:!0})),Le(bt),st()}}})},je=xe=>new Promise((ye,Fe)=>{let Qe=0,Ie=[];for(let vt=0;vt{Qe++,Qe===xe.length&&(Ie.length?(y.ZP.warning(`${Ie.join("\uFF0C")}\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01`),Fe()):ye(xe))}).catch(yt=>{console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",yt),Qe++,Ie.push(xe[vt].name),Qe===xe.length&&(Ie.length?(y.ZP.warning(`${Ie.join("\uFF0C")}\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01`),Fe()):ye(xe))})}),We=()=>_e(void 0,null,function*(){if($e.length===0){y.ZP.warning("\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6");return}if(yield je($e),lt(!0),Oe($e).some(ye=>{var Fe,Qe;return!((Fe=ye[0])!=null&&Fe.name&&((Qe=ye[1])!=null&&Qe.name))})){we.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u4E0A\u4F20\u7684\u6D4B\u8BD5\u7528\u4F8B\u4E2D\u5B58\u5728\u672A\u914D\u5BF9\u7684\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4EC5\u4FDD\u5B58\u5DF2\u914D\u5BF9\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF1F",onOk:()=>_e(void 0,null,function*(){$e.map(ye=>_e(void 0,null,function*(){Ae(ye)}))}),onCancel:()=>{lt(!1)}});return}$e.map(ye=>_e(void 0,null,function*(){Ae(ye)}))}),at={name:"file",fileList:$e,multiple:!0,accept:".in, .out",showUploadList:!1,beforeUpload:xe=>{if($e!=null&&$e.some(Fe=>Fe.name===xe.name))return y.ZP.info(`${xe.name}\u6587\u4EF6\u5DF2\u5B58\u5728`),!1;if(xe.size/1024/1024>100)return y.ZP.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(xe.name))return y.ZP.warning("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;const ye={name:xe.name,uid:xe.uid,file:xe,percent:0};return $e.push(ye),ze.current=[...$e],Ke([...$e]),!1}},Re=Oe($e);return console.log($e,Re,"fileList"),fe.createElement(we.default,{open:Ue,wrapClassName:rt,onOk:We,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:ut},onCancel:Ge,width:730,title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},fe.createElement("div",{className:se.wrap},$e.length?fe.createElement("div",null,fe.createElement(ve.Z,{justify:"space-between",align:"middle",style:{marginBottom:40}},fe.createElement("div",{style:{visibility:it?"visible":"hidden"}},fe.createElement("span",{className:se.greyText},"\u7528\u4F8B\u7C7B\u578B"),fe.createElement(x.ZP.Group,{className:`ml20 ${se.testCaseRadio}`,optionType:"button",value:Ze,onChange:xe=>Ne(xe.target.value)},fe.createElement(x.ZP,{value:!1},"\u6587\u672C"),fe.createElement(x.ZP,{value:!0},"\u6587\u4EF6"))),fe.createElement(wt.default,Se({},at),fe.createElement(z.ZP,{type:"primary",className:se.btnS},fe.createElement("i",{className:"iconfont icon-shangchuan2"}),"\u4E0A\u4F20\u6587\u4EF6"))),fe.createElement(Xe,{data:Re,onRemove:nt})):fe.createElement("div",{className:`${se.noData} mb30`},fe.createElement(wt.default.Dragger,De(Se({},at),{className:se.dragger}),fe.createElement("img",{src:E,alt:"",className:"mb20"}),fe.createElement("div",null,fe.createElement("span",null,"\u62D6\u62FD\u6587\u4EF6\u6216"),fe.createElement("span",{className:se.uploadText},"\u70B9\u51FB\u6B64\u5904\u4E0A\u4F20")))),fe.createElement("div",{className:se.text},fe.createElement("span",{style:{color:"#FA6400"}},"\u63D0\u793A"),fe.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",fe.createElement("br",null),"2\u3001\u4E0A\u4F20\u7684\u6587\u4EF6\u7F16\u7801\u4EC5\u652F\u6301UTF-8\uFF0C\u5426\u5219\u53EF\u80FD\u4F1A\u51FA\u73B0\u6587\u672C\u4E71\u7801\u3002",fe.createElement("br",null),"3\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",fe.createElement("br",null),"4\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002",fe.createElement("br",null))))},Xe=({data:st=[],onRemove:Le,width:Ue="auto",showScore:rt=!1,disabled:ot=!1,inputChange:it,onEvaluatingChange:Ye,onSelectAll:$e,checkAll1:Ke,checkAll2:ft,checkAll3:tt,checkAll4:ut,checkAll5:lt,showEvaluatingSetting:Ze=!1,className:Ne="",isProgramHomework:ze=!1})=>{const Me={value:"",filename:"",dataUrl:""},[Ge,ct]=(0,Je.useState)(Se({},Me)),mt=je=>{let We=document.createElement("a");document.body.appendChild(We);let at=URL.createObjectURL(je.file);We.href=at,We.download=je.name,We.click(),URL.revokeObjectURL(at),document.body.removeChild(We)},nt=(je,We)=>{(0,he.LR)(je,We)},Ae=(je,We)=>{we.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:fe.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:()=>{Le(je,We)},onCancel:()=>{}})};return st.length?fe.createElement("div",{className:Ne,style:{width:Ue}},fe.createElement("div",{className:`${ze?se.headProgram:se.head}`},Ze&&fe.createElement("div",{style:{width:"15%",display:"flex",alignItems:"center"}},fe.createElement(oe.default,{checked:Ke,onChange:je=>{$e(je.target.checked,"hidden")}}),fe.createElement(ie.Z,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},fe.createElement("span",{style:{marginLeft:"8px"}},"\u9690\u85CF"),fe.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),fe.createElement("div",{style:{width:ze?"25%":"15%"}},"\u7528\u4F8B"),fe.createElement("div",{style:{width:rt?ze?"20%":"15%":"25%",padding:"0 12px"}},"\u8F93\u5165"),fe.createElement("div",{style:{width:rt?ze?"20%":"15%":"25%",padding:"0 12px"}},"\u8F93\u51FA"),rt&&fe.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),Ze&&fe.createElement("div",{style:{width:"20%",display:"flex",alignItems:"center"}},fe.createElement(oe.default,{checked:ut,onChange:je=>{$e(je.target.checked,"input_visible")}}),fe.createElement(ie.Z,{title:"\u52FE\u9009\u540E\uFF0C\u8F93\u5165\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},fe.createElement("span",{style:{marginLeft:"8px"}},"\u8F93\u5165"),fe.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),Ze&&fe.createElement("div",{style:{width:"20%",display:"flex",alignItems:"center"}},fe.createElement(oe.default,{checked:ft,onChange:je=>{$e(je.target.checked,"is_invisible")}}),fe.createElement(ie.Z,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},fe.createElement("span",{style:{marginLeft:"8px"}},"\u9884\u671F\u8F93\u51FA"),fe.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),Ze&&fe.createElement("div",{style:{width:"20%",display:"flex",alignItems:"center"}},fe.createElement(oe.default,{checked:lt,onChange:je=>{$e(je.target.checked,"actual_output_visible")}}),fe.createElement(ie.Z,{title:"\u52FE\u9009\u540E\uFF0C\u5B9E\u9645\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},fe.createElement("span",{style:{marginLeft:"8px"}},"\u5B9E\u9645\u8F93\u51FA"),fe.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),Ze&&fe.createElement("div",{style:{width:"20%",display:"flex",alignItems:"center"}},fe.createElement(oe.default,{checked:tt,onChange:je=>{$e(je.target.checked,"last_match_rule")}}),fe.createElement(ie.Z,{title:"\u52FE\u9009\u540E\uFF0C\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173"},fe.createElement("span",{style:{marginLeft:"8px"}},"\u7279\u6B8A\u5224\u5B9A"),fe.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),fe.createElement("div",{className:se.operation,style:ze?{flex:1,textAlign:"right"}:{width:"10%"}},"\u64CD\u4F5C")),fe.createElement("div",{className:se.listWrapper,style:{boxShadow:ze?"0px 2px 4px 0px #EAEEF4":"unset"}},st.map((je,We)=>{var at,Re,xe,ye;return fe.createElement("div",{key:We,className:se.list,style:ze?{marginBottom:"0px",height:"66px",borderBottom:"1px solid #F6F7F8"}:{}},Ze&&fe.createElement("div",{style:{width:"15%"}},fe.createElement(oe.default,{checked:!!je.hidden,onChange:Fe=>{Ye(Fe.target.checked,We,"hidden")}})),fe.createElement("div",{style:{width:ze?"25%":"15%",paddingLeft:ze?"5px":"0px",paddingRight:ze?"5px":"0px"}},"\u6D4B\u8BD5\u7528\u4F8B",We+1),fe.createElement("div",{className:se.info,style:{width:rt?ze?"20%":"15%":"25%"}},fe.createElement("span",{title:je.input||((at=je[0])==null?void 0:at.name),onClick:()=>_e(void 0,null,function*(){let Fe;je.input?je.input_file_url?Fe=je.input_file_url:Fe=je.in_file:Fe=je[0];let Qe;typeof Fe=="string"?(Qe=yield fetch(Fe,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}}),ct({value:yield Qe.text(),filename:"",dataUrl:Fe})):(Qe=yield(0,he.db)(Fe.file),ct({value:Qe.text,filename:Fe.name,dataUrl:Qe.link}))})},je.input||((Re=je[0])==null?void 0:Re.name))),fe.createElement("div",{className:se.info,style:{width:rt?ze?"20%":"15%":"25%"}},fe.createElement("span",{title:je.output||((xe=je[1])==null?void 0:xe.name),onClick:()=>_e(void 0,null,function*(){let Fe;je.input?je.output_file_url?Fe=je.output_file_url:Fe=je.out_file:Fe=je[1];let Qe;typeof Fe=="string"?(Qe=yield fetch(Fe,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}}),ct({value:yield Qe.text(),filename:"",dataUrl:Fe})):(Qe=yield(0,he.db)(Fe.file),ct({value:Qe.text,filename:Fe.name,dataUrl:Qe.link}))})},je.output||((ye=je[1])==null?void 0:ye.name))),rt&&fe.createElement("div",{style:{width:"20%"}},fe.createElement(ee.default,{size:"large",addonAfter:ze?"%":null,disabled:ot,style:{width:"80%"},onChange:Fe=>it(Fe,We),value:je.score}),!ze&&fe.createElement("span",null,"\xA0%")),Ze&&fe.createElement("div",{style:{width:"20%"}},fe.createElement(oe.default,{checked:je.input_visible||!1,onChange:Fe=>{Ye(Fe.target.checked,We,"input_visible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),Ze&&fe.createElement("div",{style:{width:"20%"}},fe.createElement(oe.default,{checked:je.is_invisible||!1,onChange:Fe=>{Ye(Fe.target.checked,We,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),Ze&&fe.createElement("div",{style:{width:"20%"}},fe.createElement(oe.default,{checked:je.actual_output_visible||!1,onChange:Fe=>{Ye(Fe.target.checked,We,"actual_output_visible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),Ze&&fe.createElement("div",{style:{width:"20%"}},fe.createElement(oe.default,{checked:je.last_match_rule||!1,onChange:Fe=>{Ye(Fe.target.checked,We,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),fe.createElement("div",{onClick:()=>Ae(je,We),style:ze?{flex:1,textAlign:"right",paddingLeft:"5px",paddingRight:"5px"}:{width:"10%",textAlign:"center"}},fe.createElement("span",{className:se.del},"\u5220\u9664")))})),fe.createElement(me.Z,{close:!0,data:Ge.dataUrl,filename:Ge.filename,type:Ge.dataUrl.length?"txt":"",onClose:()=>ct(Se({},Me)),monacoEditor:{value:Ge.value,language:"txt",onChange:()=>{},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):fe.createElement(fe.Fragment,null)};var et=He},58489:function(Kt,_t,Ve){"use strict";Ve.d(_t,{AL:function(){return be},Iy:function(){return se},Qv:function(){return re},ez:function(){return fe},jb:function(){return E}});var Je=Ve(32834),wt=Ve.n(Je),y=Ve(11690),we=Ve.n(y);let ve=1;function x(de,ge){const Se=de.match(/^(\s+)(?:```)/);if(Se===null)return ge;const De=Se[1];return ge.split(` `).map(_e=>{const Ee=_e.match(/^\s+/);if(Ee===null)return _e;const[Oe]=Ee;return Oe.length>=De.length?_e.slice(De.length):_e}).join(` `)}let z=[],oe=["