|
|
(self.webpackChunk=self.webpackChunk||[]).push([[4496],{30638:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var t={},e="5.0",n={},i=null,r=!1,o=!1,a=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var h=arguments[u];if(null!==h)switch(_typeof(h)){case"number":e=h.toFixed(1);break;case"string":h.match(new RegExp("^[0-9]\\.[0-9]+$"))?e=h:a=h;break;case"object":void 0!==h.is3D?i=h:n=h;break;case"boolean":r=h,o=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===n.material_id||o||(r=!0)),null!==a&&void 0===n.id&&(n.id=a);var d="",p=!1,f=null,m=null,g=null,v=!1,y=null,b=null,x=null;void 0!==n.height&&(n.height=Math.round(n.height)),void 0!==n.width&&(n.width=Math.round(n.width));var w=function(t){return parseFloat(t)>4?parseFloat(t):5};function C(){try{return window.self!==window.top}catch(t){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}t.setHTML5Codebase=function(t,e){c=t,O(t,e)},t.setJavaCodebase=t.setJavaCodebaseVersion=t.isCompiledInstalled=t.setPreCompiledScriptPath=t.setPreCompiledResourcePath=function(){},t.setHTML5CodebaseVersion=function(t,e){var n=parseFloat(t);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=t,R(t,e))},t.getHTML5CodebaseVersion=function(){return m},t.getParameters=function(){return n},t.setFontsCSSURL=function(t){x=t},t.setGiacJSURL=function(t){},t.setJNLPFile=function(t){t},t.setJNLPBaseDir=function(t){},t.inject=function(){function e(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",o=n.id,a=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?r=c:o=arguments[l]:"boolean"==typeof c?a=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){r=_(r);var l=i||document.getElementById(o);if(l)if(t.removeExistingApplet(l,!1),void 0===n.width&&l.clientWidth&&(n.width=l.clientWidth),void 0===n.height&&l.clientHeight&&(n.height=l.clientHeight),n.width&&n.height||"html5"!==r||(delete n.width,delete n.height),f=r,"screenshot"===r)A(l,n);else{var c=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?c=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(c=(!C()||e())&&k()),c?(f="screenshot",P(l,n,a,r)):L(l,n,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},t.getViews=function(){return i},t.isJavaInstalled=function(){return!1};var S=function(e){var r=function(){n.onError&&n.onError(),F("Error: Fetching material (id "+n.material_id+") failed.",n)},o=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+n.material_id+"?scope=basic";M("https://"+o+"/api/proxy.php?path="+encodeURIComponent(a),(function(o){var a=JSON.parse(o),s=a.elements?a.elements.filter((function(t){return"G"==t.type||"E"==t.type}))[0]:a;if(s&&s.url){n.fileName=s.url,E(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";t.setPreviewImage(y||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),e()}else r()}),r)};function E(t){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(e){t[e]=!!t[e]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(e){void 0===n[e]&&void 0!==t[e]&&(n[e]=t[e])})),void 0===n.showToolBarHelp&&(n.showToolBarHelp=n.showToolBar)}function M(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.onload=function(){e(i.responseText)},i.onerror=n,i.send()}t.isHTML5Installed=function(){return!0},t.getLoadedAppletType=function(){return f},t.setPreviewImage=function(t,e,n){y=t,b=e,n},t.removeExistingApplet=function(t,e){var i;"string"==typeof t&&(t=document.getElementById(t)),f=null;var r=null;for(i=0;i<t.childNodes.length;i++){var o=t.childNodes[i],a=o.className;"applet_screenshot"===a?e?(o.style.display="block",f="screenshot"):o.style.display="none":"applet_scaler prerender"!==a&&(t.removeChild(o),r=a&&-1!=a.indexOf("appletParameters")?o.id:null,i--)}var s=void 0!==n.id?n.id:r,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},t.refreshHitPoints=function(){if(w(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var e=t.getAppletObject();return!(!e||"function"!=typeof e.recalculateEnvironments)&&(e.recalculateEnvironments(),!0)},t.startAnimation=function(){var e=t.getAppletObject();return!(!e||"function"!=typeof e.startAnimation)&&(e.startAnimation(),!0)},t.stopAnimation=function(){var e=t.getAppletObject();return!(!e||"function"!=typeof e.stopAnimation)&&(e.stopAnimation(),!0)},t.getAppletObject=function(){var t=void 0!==n.id?n.id:"ggbApplet";return window[t]},t.resize=function(){};var T=function(t){return t&&"false"!==t},L=function(e,n,i){w(m)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var a=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(w(m)<=4.4)T(n.showToolBar)&&(n.height-=7),T(n.showAlgebraInput)&&(n.height-=37),n.width<605&&T(n.showToolBar)&&(n.width=605,a=605);else{var u=100;(T(n.showToolBar)||T(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=T(n.showMenuBar)?245:155),a<u&&(n.width=u,a=u)}for(var h in o.style.border="none",o.style.display="inline-block",n)n.hasOwnProperty(h)&&"appletOnLoad"!==h&&o.setAttribute("data-param-"+h,n[h]);x&&o.setAttribute("data-param-fontscssurl",x),t.resize=function(){GGBAppletUtils.responsiveResize(e,n)},window.addEventListener("resize",(function(e){t.resize()}));var p="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var f=document.createElement("div");f.className="applet_scaler",f.style.position="relative",f.style.display="block",f.appendChild(o),e.appendChild(f),n.appletOnLoad=function(e){t.resize(),p(e)}}else{n.hasOwnProperty("showSplash")||o.setAttribute("data-param-showSplash","false");var y=e.querySelector(".applet_scaler.prerender"),b=null!==y;if(b)C=y.querySelector(".ggb_preview");else{var C=B(a,s,n.borderColor,!1);(y=document.createElement("div")).className="applet_scaler",y.style.position="relative",y.style.display="block",y.style.width=a+"px",y.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(y,"66%"),w(m)>=5?(n.appletOnLoad=function(t){var n=e.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(y),window.GGBT_wsf_view&&$(window).trigger("resize"),p(t)},b||y.appendChild(C)):o.appendChild(C),y.appendChild(o),b||e.appendChild(y),setTimeout((function(){t.resize()}),1)}function k(t,e){e&&"function"==typeof e.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(t,e.appletOnLoad):renderGGBElement(t),F("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",e)}function S(t,e){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:t,params:e}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(t){k(t.article,t.params)})),html5AppletsToProcess=null)},w(m)<5&&(t.className+=" geogebraweb")):k(t,e)}if(r){scriptLoadStarted=!0;for(var E=0;E<o.childNodes.length;E++){"TABLE"===o.childNodes[E].tagName&&(o.removeChild(o.childNodes[E]),E--)}if(null!==ggbHTML5LoadedScript){var M=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=M&&M.parentNode.removeChild(M)}var L=document.createElement("script"),A=function(){S(o,n)};L.src=d+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=L.src,F("GeoGebra HTML5 codebase loaded: '"+d+"'.",n),c||l&&"5.0"!=l?d.requirejs?__webpack_require__.e(3887).then(function(){var t=[__webpack_require__(43887)];A.apply(null,t)}.bind(this)).catch(__webpack_require__.oe):(L.onload=A,e.appendChild(L)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),A())}else S(o,n);n.height=s,n.width=a},A=function(e,n,i){var r=B(n.width,n.height,n.borderColor,i),o=document.createElement("div");o.style.position="relative",o.style.display="block",o.style.width=n.width+"px",o.style.height=n.height+"px",o.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),o.appendChild(r);var a=GGBAppletUtils.getScale(n,e,i);i?(e.appendChild(N()),window.GGBT_wsf_view||(e.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(o,"66%"),e.appendChild(o),1===a||isNaN(a)||(GGBAppletUtils.scaleElement(o,a),o.style.width=n.width+"px",o.style.height=n.height+"px",o.parentNode.style.width=n.width*a+"px",o.parentNode.style.height=n.height*a+"px"),t.resize=function(){D(e,r,o,i)},window.addEventListener("resize",(function(e){t.resize()})),t.resize()};function D(t,e,i,r){if(t.contains(e)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==t.id)return;window.GGBT_wsf_view.setCloseBtnPosition(t)}var o=GGBAppletUtils.getScale(n,t,r);null!==i.parentNode&&(isNaN(o)||1===o?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=n.width+"px",i.parentNode.style.height=n.height+"px"):(GGBAppletUtils.scaleElement(i,o),i.parentNode.style.width=n.width*o+"px",i.parentNode.style.height=n.height*o+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(t),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}t.onExitFullscreen=function(t,e){e.appendChild(t)};var P=function(t,e,n,i){A(t,e,!0);for(var r=function(){var n=[];for(a=0;a<t.childNodes.length;a++)n.push(t.childNodes[a]);if(window.GGBT_wsf_view){var r=window.GGBT_wsf_view.renderFullScreen(t,e.id),o=document.getElementById("fullscreencontainer"),s=jQuery(t).find(".fullscreencontent");s.length>0?(r.remove(),s.attr("id","fullscreencontent").show(),jQuery(o).append(s),window.dispatchEvent(new Event("resize"))):L(r,e,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,L(t,e,!1);if(!window.GGBT_wsf_view)for(a=0;a<n.length;a++)t.removeChild(n[a])},o=t.getElementsByClassName("ggb_preview_play"),a=0;a<o.length;a++)o[a].addEventListener("click",r,!1),o[a].addEventListener("ontouchstart",r,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(t),k()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},N=function(){var t=document.createElement("div");if(t.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var e='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(n)}return t},B=function(t,e,n,i){var r=document.createElement("div");r.className="ggb_preview",r.style.position="absolute",r.style.zIndex="90",r.style.width=t-2+"px",r.style.height=e-2+"px",r.style.top="0px",r.style.left="0px",r.style.overflow="hidden",r.style.backgroundColor="white";var o="lightgrey";void 0!==n&&(o="none"===n?"transparent":n),r.style.border="1px solid "+o;var a,s,l,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==y&&c.setAttribute("src",y),c.style.opacity=.7,null!==b)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,c.style.opacity=.3,(s=360)>t/4*3&&(s=t/4*3),l=s/5.8,a.setAttribute("src",b),a.setAttribute("width",s),a.setAttribute("height",l);var u=(t-s)/2,h=(e-l)/2;a.style.left=u+"px",a.style.top=h+"px",r.appendChild(a)}return r.appendChild(c),r},_=function(t){return"html5"===(t=t.toLowerCase())||"screenshot"===t?t:"html5"},I=["web","webSimple","web3d","tablet","tablet3d","phone"],R=function(t,e){if(m=t,e)O(m,!0);else{var o,a,s=!r;if(s){var l=w(m);!isNaN(l)&&l<4.4&&(s=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in a=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",I)if(m.slice(-1*I[u].length)===I[u]||m.slice(-1*(I[u].length+1))===I[u]+"/")return void O(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||T(n.showToolBar)||T(n.showMenuBar)||T(n.showAlgebraInput)||T(n.enableRightClick)||n.appName&&"classic"!=n.appName?a+="web3d/":a+="webSimple/",O(a,!1)}},O=function(t,e){if(t.requirejs)d=t;else{"/"!==t.slice(-1)&&(t+="/"),d=t,null===e&&(e=-1===t.indexOf("http")),p=e,g="web.nocache.js",v=!1;var n=d.split("/");n.length>1&&(e||"webSimple"!==n[n.length-2]?I.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=t.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&t.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),R("5.0",e))}},F=function(t,e){window.console&&window.console.log&&(!e||void 0===e.showLogging||e.showLogging&&"false"!==e.showLogging)&&console.log(t)};function j(){var t=e;null!==l?t=l:parseFloat(t)<5&&(t="5.0"),R(t,!1),null!==c&&O(c,p),s=!0}return void 0!==n.material_id?S(j):j(),t},GGBAppletUtils=function(){"use strict";function t(){return void 0!==window.GGBT_wsf_edit}function e(t,e){1!=e?(t.style.transformOrigin="0% 0% 0px",t.style.webkitTransformOrigin="0% 0% 0px",t.style.transform="scale("+e+","+e+")",t.style.webkitTransform="scale("+e+","+e+")",t.style.maxWidth="initial",null!==t.querySelector(".ggb_preview")&&(t.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==t.querySelectorAll(".ggb_preview img")[0]&&(t.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==t.querySelectorAll(".ggb_preview img")[1]&&(t.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(t.style.transform="none",t.style.webkitTransform="none")}function n(t,e,n,i,r){if(t.isScreenshoGenerator)return 1;var o,a=void 0!==i&&i,s=null!=t.noScaleMargin&&t.noScaleMargin,l=(o=t.autoHeight)&&"false"!==o,c=function(t,e,n,i,r,o){var a=null;if(null!=o&&""!=o)for(var s=t.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+o+" ")>-1){a=s;break}s=s.parentNode}var l=0,c=0,u=0,h=0,d=0,p=0,f=0;if(a)l=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),t){var m=t.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===r||!r)&&("rtl"===document.dir?(d=l-m.width-m.left,p=u<=480?10:30):(p=m.left,d=u<=480?10:30),h=p+d)}t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(t.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(h=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(h=0,f=40))}return t&&((void 0===n||!n)&&e>0&&e+h<l?l=e:l-=h,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(c-=f)),{width:l,height:c}}(e,t.width,n,l,a&&window.GGBT_wsf_view||s,r),u=parseInt(c.width),h=t.width,d=t.height;if(void 0===h){var p=e.querySelector(".appletParameters");p&&(h=p.offsetWidth,d=p.offsetHeight)}var f=u/h,m=a?1:c.height/d;return void 0===n||n||(f=Math.min(1,f),m=Math.min(1,m)),Math.min(f,m)}function i(t,e,i){var r,o=1,a=!1;return t.hasOwnProperty("allowUpscale")&&(a=t.allowUpscale),t.hasOwnProperty("scale")&&(o=parseFloat(t.scale),(isNaN(o)||null===o||0===o)&&(o=1),o>1&&(a=!0)),e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),t.hasOwnProperty("disableAutoScale")&&t.disableAutoScale?o:(r=n(t,e,a,i,t.scaleContainerClass),!a||t.hasOwnProperty("scale")&&1!==o?Math.min(o,r):r)}function r(t){var e=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=t.getBoundingClientRect(),r=(e-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),t.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(t.style.left=r<40?"40px":r+"px",t.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(t.style.top=o<40?"40px":o+"px",t.style.left=r+"px")}return{responsiveResize:function(n,o){var a=n.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var s=i(o,n);t()&&a.setAttribute("data-param-scale",s);for(var l=null,c=0;c<n.childNodes.length;c++)if(void 0!==n.childNodes[c].className&&n.childNodes[c].className.match(/^applet_scaler/)){l=n.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==o.id?o.id:"ggbApplet",h=window[u];null!=h&&h.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(e(l,1),l.parentNode.style.width=o.width+"px",l.parentNode.style.height=o.height+"px"):(l.parentNode.style.width=o.width*s+"px",l.parentNode.style.height=o.height*s+"px",e(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&r(n),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(a).parents(".content-added-content"))}},isFlexibleWorksheetEditor:t,positionCenter:r,getScale:i,scaleElement:e}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var t=n.location.search;return-1!=t.indexOf(J)||-1!=t.indexOf(K)}function q(t,e){}q(H,I),webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(t){q(cb,eb),function(t){function e(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var n=e();if(n)t();else{o.addEventListener&&o.addEventListener(Z,r,!1);var i=setInterval((function(){r()}),$)}function r(){if(!n){if(!e())return;n=!0,t(),o.removeEventListener&&o.removeEventListener(Z,r,!1),i&&clearInterval(i)}}}((function(){var e,n,i,r;e=t,n=u(),i=n.body,(r=n.createElement(_)).language=ab,r.crossOrigin=W,r.src=e,webModule.__errFn&&(r.onerror=function(){webModule.__errFn(L,new Error(bb+e))}),i.appendChild(r),q(cb,db)}))}function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(t){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(t){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(t){var e=c[t];return null==e?null:e},r=d,webModule.__errFn=e}function B(){function t(t){var e=t.lastIndexOf(rb);-1==e&&(e=t.length);var n=t.indexOf(sb);-1==n&&(n=t.length);var i=t.lastIndexOf(tb,Math.min(n,e));return i>=O?t.substring(O,i+P):W}var e,n=null!=(e=__gwt_getMetaProperty(wb))?e:W;return n==W&&(n=function(){for(var e=o.getElementsByTagName(_),n=O;n<e.length;++n)if(-1!=e[n].src.indexOf(xb))return t(e[n].src);return W}()),n==W&&(n=function(){var t=o.getElementsByTagName(yb);return t.length>O?t[t.length-P].href:W}()),n==W&&function(){var t=o.location;return t.href==t.protocol+zb+t.host+t.pathname+t.search+t.hash}()&&(n=t(o.location.href)),n=function(e){if(e.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=e+vb,e=t(n.src)}return e}(n),n}function C(t){return t.match(/^\//)||t.match(/^[a-zA-Z]+:\/\//)?t:webModule.__moduleBase+t}function D(){var t,e=O,i=[],o=[];function a(t){var e=o[t](),n=i[t];if(e in n)return e;var a=[];for(var s in n)a[n[s]]=s;throw r&&r(t,a,e),null}if(__gwt_isKnownPropertyValue=function(t,e){return e in i[t]},webModule.__getPropMap=function(){var t={};for(var e in i)i.hasOwnProperty(e)&&(t[e]=a(e));return t},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(t=Cb).indexOf(Db);-1!=s&&(e=parseInt(t.substring(s+P),$),t=t.substring(O,s))}catch(t){}return webModule.__softPermutationId=e,C(t+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(t){var e=s[L].bindings;s[L].bindings=function(){for(var n=e?e():{},i=t[webModule.__softPermutationId],r=O;r<i.length;r++){var o=i[r];n[o[O]]=o[P]}return n}},webModule.__startLoadingFragment=function(t){return C(t)},webModule.__installRunAsyncCode=function(t){var e=u(),n=e.body,i=e.createElement(_);i.language=ab,i.text=t,n.appendChild(i),n.removeChild(i)},A(),webModule.__moduleBase="/react/build/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},44483:function(t,e,n){"use strict";function i(t){var e=!0;if(t.length>0){for(var n=0;n<t.length;n++)if(0==t[n].compile_success||!t[n].compile_success){e=!1;break}}else e=!1;return e}function r(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<t.length;i++){var r=t[i],o=e?"".concat(e,"/").concat(r.name):"".concat(r.name);n.push({title:r.name,type:r.type,isLeaf:"tree"!==r.type,key:o})}return n}function o(t,e,n){for(var i=0;i<t.length;i++){var r=t[i];if(r.key===e){r.children=n;break}r.children&&o(r.children,e,n)}return t}function a(t,e,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||t.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,e),s&&t.apply(r,o)}}n.d(e,{Ax:function(){return o},Ds:function(){return a},KI:function(){return s},SI:function(){return r},f1:function(){return i}});var s=n(62233).Z.API_SERVER},62686:function(t,e,n){"use strict";n.d(e,{Z:function(){return x}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),s=n(79800),l=n.n(s),c=n(59301),u="imageDimensions___a7crR",h="img___Kroat",d="fullWidth___c492T",p=n(92310),f=n.n(p),m=n(29787),g=n(2859),v=n(43170),y=n(89728),b=n(37712),x=function(t){var e=t.data,n=t.className,i=t.fullWidth,o=t.style,s=void 0===o?{}:o,p=t.onClose,x=t.onOk,w=t.showFullTools,C=t.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),E=(0,c.useRef)(null),M=(0,c.useRef)(null),T=(0,c.useState)(!1),L=l()(T,2),A=L[0],D=L[1],P=(0,c.useState)("正在加载中"),N=l()(P,2),B=N[0],_=N[1];(0,c.useEffect)((function(){return E.current||(E.current=document.createElement("style"),document.head.appendChild(E.current)),null!=e&&e.visible?(document.body.setAttribute("data-custom","y-hidden"),E.current.innerHTML=" html { overflow-y: hidden; }",null!=e&&e.src&&I()):(document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)),function(){document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)}}),[null==e?void 0:e.visible]);var I=function(){var t=a()(r()().mark((function t(){var n;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return D(!0),_("正在加载中"),t.next=4,(0,y.ZJ)(null==e?void 0:e.src);case 4:n=t.sent,k.current.src="",k.current.src=n,k.current.onload=function(){O()},D(!1),_("");case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),R=function(){var t=a()(r()().mark((function t(n){var i;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return D(!0),_("正在保存中"),t.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:e.title,file:n.dataUrl}});case 4:if(null==(i=t.sent)||!i.id||C){t.next=12;break}return t.next=8,(0,v.ZP)("/api/attachments/".concat(e.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===t.sent.status&&x(),t.next=13;break;case 12:null!=i&&i.id&&x(i);case 13:D(!1),_("");case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),O=function(){S.current=new g.hP(k.current),S.current.targetRoot=M.current,S.current.addEventListener("render",R),S.current.addEventListener("beforeclose",p),w&&(S.current.availableMarkerTypes=S.current.ALL_MARKER_TYPES,S.current.uiStyleSettings.redoButtonVisible=!0,S.current.uiStyleSettings.notesButtonVisible=!0,S.current.uiStyleSettings.zoomButtonVisible=!0,S.current.uiStyleSettings.zoomOutButtonVisible=!0,S.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=S.current.uiStyleSettings,S.current.show(),null!=e&&e.snapshotData&&S.current.restoreState(e.snapshotData),setTimeout((function(){var t;window.scrollTo(0,0),(t=document.querySelector('a[href="https://markerjs.com/"]'))&&t.parentNode&&(t.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(t){var e=document.querySelector(t.name);e&&e.setAttribute("title",t.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==e?void 0:e.visible)&&(0,b.jsx)(m.Z,{spinning:A,tip:B,style:{position:"absolute",width:"100vw"},children:(0,b.jsx)("div",{ref:M,className:f()(u,n,i?d:""),style:s,children:(0,b.jsx)("img",{className:h,ref:k})})})})}},20037:function(t,e,n){"use strict";var i=n(59301),r=n(77019),o=n(5269),a=n(20554),s=n(99571),l=n(18714),c=n(96408),u=(n(48136),n(37712)),h=(0,i.forwardRef)((function(t,e){var n=t.callback,h=t.showSaveButton,d=t.value,p=void 0===d?"":d,f=(0,i.useRef)(),m=function(t){f.current.setValue(f.current.getValue()+" "+t.value+" ")},g=[{key:"1",label:"快捷模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"分数得分",value:"\\frac{x}{y}",children:[{name:"分数 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:"导数 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"模算术 Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"根式角标",value:"\\sqrt{x}",children:[{name:"根式 Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"上下标 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"重音符及其他 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:"极限对数",value:"\\lim_{x \\to 0}",children:[{name:"极限 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"对数指数 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"界限 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"三角函数",value:"\\sin a",children:[{name:"三角函数 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"反三角函数 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:"双曲函数 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"反双曲函数 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:"积分运算",value:"\\int_{a}^{b}",children:[{name:"积分 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"双重积分 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"三重积分 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"曲线积分 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"大型运算",value:"\\sum_{a}^{b}",children:[{name:"求和 Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"乘积余积 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:"并集交集 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"析取合取 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"括号取整",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"括号 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 "}]}]}].map((function(t,e){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"$$".concat(t.value,"$$")}),t.name]}),(0,u.jsx)("div",{className:c.Z.children,children:t.children.map((function(t,e){return(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{children:t.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:t.data.map((function(t,e){return(0,u.jsx)(o.Z,{onClick:function(){return m(t)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+t.value+"$$`"})},e)}))})]},e)}))})]})}))})},{key:"2",label:"公式模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"代数",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\n x=a + r\\text{cos}\\theta \\ \r\n y=b + r\\text{sin}\\theta \r\n\\end{matrix}\\right. "},{value:"\\begin{array}{l} \r\n \\text{对于方程形如:}x^{3}-1=0 \\ \r\n \\text{设}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\left\\{\\begin{matrix} \r\n \\Delta \\gt 0\\text{方程有两个不相等的实根} \\ \r\n \\Delta = 0\\text{方程有两个相等的实根} \\ \r\n \\Delta \\lt 0\\text{方程无实根} \r\n\\end{matrix}\\right. \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r\n \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r\n\\end{array} "}]}]},{name:"几何",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\n a \\perp \\alpha \\ \r\n b \\perp \\alpha \r\n\\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\n \\Rightarrow a \\perp \\beta "},{value:"\\left.\\begin{matrix} \r\n a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r\n a \\parallel \\partial ,b \\parallel \\partial \r\n\\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\n m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r\n a \\perp m,a \\perp n \r\n\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha "},{value:"\\begin{array}{c} \r\n \\text{直角三角形中,直角边长a,b,斜边边长c} \\ \r\n a^{2}+b^{2}=c^{2} \r\n\\end{array}"}]}]},{name:"不等式",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\n a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r\n a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r\n\\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\n a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r\n \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r\n\\end{array}"},{value:"\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r\n\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) "},{value:"\\begin{array}{c} \r\n a,b \\in R^{+} \\ \r\n \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n a,b \\in R \\ \r\n \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n 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\n\\end{array}"}]}]},{name:"积分",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:"三角",value:"e^{i \\theta}",children:[{name:"求和 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:"统计",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\n \\text{若}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r\n \\text{则}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r\n\\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\n P \\left( \\emptyset \\right) =0 \\\\ \r\n P \\left( S \\right) =1 \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n \\forall A \\in S \\\\ \r\n P \\left( A \\right) \\ge 0 \r\n\\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\n S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r\n P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n P_{n}=n! \\\\ \r\n A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r\n\\end{array}"}]}]}].map((function(t,e){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"`$$"+t.value+"$$`"}),t.name]}),(0,u.jsx)("div",{className:c.Z.children,children:t.children.map((function(t,e){return(0,u.jsxs)("div",{children:[t.name&&(0,u.jsx)("h1",{children:t.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:t.data.map((function(t,e){return(0,u.jsx)(o.Z,{onClick:function(){return m(t)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+t.value+"$$`"})},e)}))})]},e)}))})]})}))})}],v=function(){var t=document.createElement("div");t.innerHTML=f.current.getValue();var e=t.innerText;return n&&n(e),e};return(0,i.useImperativeHandle)(e,(function(){return{getData:v}})),(0,u.jsxs)("div",{className:c.Z.mathWrap,children:[(0,u.jsx)(a.Z,{defaultActiveKey:"1",items:g}),(0,u.jsx)("math-field",{locale:"zh_cn",className:c.Z.mathField,placeholder:"请打开键盘,输入公式",ref:f,style:{width:800,marginTop:30,fontSize:18},children:p||""}),h&&(0,u.jsx)("div",{className:c.Z.button,children:(0,u.jsx)(s.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})}));e.Z=h},50184:function(t,e,n){"use strict";var i=n(82242),r=n.n(i),o=(n(59301),n(93314)),a=n(99571),s=n(37712);e.Z=function(t){var e=t.img,n=t.buttonProps,i=void 0===n?{}:n,l=t.styles,c=void 0===l?{}:l,u=t.customText,h=t.ButtonText,d=t.ButtonClick,p=t.Buttonclass,f=t.ButtonTwo,m=t.imgStyles,g=t.loading,v=void 0!==g&&g,y=t.className,b=void 0===y?"":y;return(0,s.jsxs)("section",{className:"tc animated fadeIn ".concat(b),style:r()({color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"},c),children:[(0,s.jsx)("img",{src:e||o,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,s.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),h&&(0,s.jsx)(a.ZP,r()(r()({className:p,onClick:d},i),{},{children:h})),f&&f]})}},4896:function(t,e,n){"use strict";n.d(e,{Z:function(){return k}});var i=n(82242),r=n.n(i),o=n(7557),a=n.n(o),s=n(41498),l=n.n(s),c=n(79800),u=n.n(c),h=n(59301),d={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(99571),f=n(70557),m=n(54501),g=n(25399),v=n(89728),y=n(31005),b=n(50184),x=n(62233),w=n(49656),C=n(37712),k=function(t){var e,n,i,o,s,c,k=t.editOffice,S=void 0===k?"view":k,E=t.data,M=t.issaver,T=t.onSaver,L=(t.theme,t.type),A=t.filename,D=t.monacoEditor,P=t.className,N=t.style,B=t.close,_=t.onClose,I=t.hasMask,R=t.disabledDownload,O=t.onImgDimensions,F=t.showNodata,j=t.recordInfo,Z=(0,h.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=u()(Z,2),H=(z[0],z[1],(0,h.useState)("")),W=u()(H,2),G=(W[0],W[1]),V=(0,h.useState)(),U=u()(V,2),q=U[0],K=U[1],Y="build"===window.ENV?"/react/build":"",X=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,J=(0,h.useRef)();null!==(e=E)&&void 0!==e&&e.startsWith("/api")&&"txt"!==L&&(E=x.Z.API_SERVER+E);function Q(t){return $.apply(this,arguments)}function $(){return($=l()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:"pdfdata"===e.data.type&&(T(e.data.data),window.removeEventListener("message",Q,!1)),console.log("mess---:",e.data);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}A&&D&&(D.filename=A),(0,h.useEffect)((function(){var t,e=null===(t=document.cookie)||void 0===t||null===(t=t.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==e||e.map((function(t){var e=t.split("=");"_educoder_session"===e[0]&&G(e[1])}))}),[]),(0,h.useEffect)((function(){var t;"office"===L&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?K({url:E,fileType:(t=E,t.substring(t.lastIndexOf("/")+1).split(".").pop()),model:E.indexOf("model=edit")?"edit":"view"}):tt())}),[L,E]);var tt=function(){var t=l()(a()().mark((function t(){var e,n,i;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("data:",E),e=E,E.startsWith("http")||(e=location.origin+e),n=new URL(e).pathname.split("/").pop(),t.next=6,(0,y.gJ)({attachment_id:n});case 6:(i=t.sent).url=X+i.url,K(i);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),et=function(){E.startsWith("http")||E.startsWith("blob:")?nt():(0,v.Sv)(A||"educoder",E,A)},nt=function(){j&&(0,w.fc)({id:null==j?void 0:j.id,watch_type:1,course_id:null==j?void 0:j.course_id}),(0,v.Nd)(A||"educoder",decodeURIComponent(E))};return(0,C.jsxs)("div",{style:r()({},N||{}),className:"".concat(I&&d.bgBlack," ").concat(L?d.wrp:"hide"),children:[B&&(0,C.jsxs)("div",{className:d.close,ref:J,children:[!!O&&(0,C.jsx)(g.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:function(){_(),O()},children:(0,C.jsx)("i",{className:"icon-yulanpizhu"})})}),!R&&(0,C.jsx)(g.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:nt,children:(0,C.jsx)("i",{className:"icon-quxiaozhiding"})})}),M&&(0,C.jsx)(g.Z,{title:"保存pdf并退出",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){var t=document.getElementById("pdfiframe");window.addEventListener("message",Q,!1),setTimeout((function(){t.contentWindow.postMessage("getData","*")}),300)},children:(0,C.jsx)("i",{className:"icon-baocun"})})}),(0,C.jsx)(g.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){_()},children:(0,C.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,C.jsx)("div",{className:"".concat(d[P]," ").concat(P," ").concat(d.monaco," ").concat("txt"===L?"show":"hide"),children:"txt"===L&&(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(m.ZP,r()({},D))})}),"audio"===L&&(0,C.jsx)("audio",{src:"".concat((null===(n=E)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=E)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(E),autoPlay:!0}),"video"===L&&(0,C.jsx)(C.Fragment,{children:(null===(o=E)||void 0===o?void 0:o.indexOf("http"))>-1?(0,C.jsx)("video",{controls:!0,src:"".concat(E),autoPlay:!0}):(0,C.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(E),autoPlay:!0})}),"office"===L&&q&&(0,C.jsx)("iframe",{src:"".concat(Y,"/office.html?key=").concat(q.key,"&url=").concat(btoa(q.url),"&callbackUrl=").concat(X+(q.callbackUrl||""),"&fileType=").concat(q.fileType,"&title=").concat(q.title||"","&model=").concat(S,"&officeServer=").concat(x.Z.ONLYOFFICE,"&disabledDownload=").concat(!!R)}),"html"===L&&(0,C.jsx)("iframe",{src:E+"&disposition=inline"}),"pdf"===L&&(0,C.jsx)("iframe",{id:"pdfiframe",src:"".concat(Y,"/js/pdfview/index.html?filename=").concat(A||"educoder.pdf","&url=").concat(encodeURIComponent(E),"&disabledDownload=").concat(!!R,"&model=").concat(S)}),"image"===L&&(0,C.jsx)("img",{src:"".concat((null===(s=E)||void 0===s?void 0:s.indexOf("http://"))>-1||(null===(c=E)||void 0===c?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(E)}),("other"===L||"download"===L)&&(0,C.jsx)(C.Fragment,{children:F?(0,C.jsx)(b.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,C.jsx)(p.ZP,{icon:(0,C.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:et,disabled:R,children:"下载"})}):(0,C.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:et,disabled:R,children:[(0,C.jsx)(f.Z,{}),"点击下载"]})}),"flowChart"===L&&(0,C.jsx)("div",{className:"embed",children:(0,C.jsx)("iframe",{src:"/drawio/src/main/webapp/viewer.html?id=".concat(E||"","&gapi=0&od=0&db=0&gh=0&gl=0"),width:"100%",height:"100%",frameBorder:"0"})})]})}},18714:function(t,e,n){"use strict";n.d(e,{z:function(){return L},Z:function(){return A}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),s=n(91232),l=n.n(s),c=n(79800),u=n.n(c),h=n(59301),d=(n(48850),n(63741)),p=(n(64018),n(80360)),f=n(62233),m=n(89728),g=n(15342),v=n(77736),y=n(99571),b=n(1012),x=n(4896),w=n(37712),C=function(t){var e=t.html,n=(0,h.useRef)(null),i=(0,h.useRef)(null);return(0,h.useEffect)((function(){var t=n.current.attachShadow({mode:"open"});i.current=document.createElement("div"),i.current.className="markdown-body",i.current.innerHTML=e,t.appendChild(i.current);var r=document.createElement("style");return r.textContent='.markdown-body p {\n margin: 0 0 16px 0 !important;\n line-height: 28px;\n white-space: pre-wrap;\n }\n\n ol,\n ul,\n li {\n list-style-type: none\n }\n\n ol,\n ul,\n dl {\n margin-bottom: 0px;\n }\n\n .markdown-body {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n color: #333;\n overflow: hidden;\n font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif;\n word-break: break-word;\n font-size: 16px;\n line-height: 1.6;\n white-space: normal;\n word-wrap: break-word;\n position: relative;\n }\n\n .markdown-body ul>li {\n list-style-type: disc;\n }\n\n .markdown-body ol>li {\n list-style-type: decimal;\n }\n\n .markdown-body a {\n background: transparent;\n }\n\n .markdown-body a:active,\n .markdown-body a:hover {\n outline: 0;\n }\n\n .markdown-body strong {\n font-weight: bold;\n }\n\n .markdown-body h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n\n .markdown-body img {\n border: 0;\n }\n\n .markdown-body hr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n }\n\n .markdown-body pre {\n overflow: auto;\n }\n\n .markdown-body code,\n .markdown-body kbd,\n .markdown-body pre {\n font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;\n font-size: 1em;\n }\n\n .markdown-body input {\n color: inherit;\n font: inherit;\n margin: 0;\n }\n\n .markdown-body html input[disabled] {\n cursor: default;\n }\n\n .markdown-body input {\n line-height: normal;\n }\n\n .markdown-body input[type="checkbox"] {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n }\n\n .markdown-body table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .markdown-body td,\n .markdown-body th {\n padding: 0;\n }\n\n .markdown-body * {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body input {\n font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";\n }\n\n .markdown-body a {\n color: #4183c4;\n text-decoration: none;\n }\n\n .markdown-body a:hover,\n .markdown-body a:active {\n text-decoration: underline;\n }\n\n .markdown-body hr {\n height: 0;\n margin: 15px 0;\n overflow: hidden;\n background: transparent;\n border: 0;\n border-bottom: 1px solid #ddd;\n }\n\n .markdown-body hr:before {\n display: table;\n content: "";\n }\n\n .markdown-body hr:after {\n display: table;\n clear: both;\n content: "";\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n margin-top: 15px;\n margin-bottom: 15px;\n line-height: 1.1;\n }\n\n .markdown-body h1 {\n font-size: 30px;\n }\n\n .markdown-body h2 {\n font-size: 21px;\n }\n\n .markdown-body h3 {\n font-size: 16px;\n }\n\n .markdown-body h4 {\n font-size: 14px;\n }\n\n .markdown-body h5 {\n font-size: 12px;\n }\n\n .markdown-body h6 {\n font-size: 11px;\n }\n\n .markdown-body blockquote {\n margin: 0;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding: 0;\n margin-top: 0;\n margin-bottom: 0;\n }\n\n ul.linenums,\n ol.linenums {\n padding: 16px 0 0 56px !important;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding-left: 2em;\n }\n\n\n .markdown-body ol ol,\n .markdown-body ul ol {\n list-style-type: lower-roman;\n }\n\n .markdown-body ul ul ol,\n .markdown-body ul ol ol,\n .markdown-body ol ul ol,\n .markdown-body ol ol ol {\n list-style-type: lower-alpha;\n }\n\n .markdown-body dd {\n margin-left: 0;\n }\n\n .markdown-body code {\n font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;\n font-size: 12px;\n }\n\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 0;\n font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n }\n\n .markdown-body .octicon {\n font: normal normal 16px octicons-anchor;\n line-height: 1;\n display: inline-block;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .markdown-body .octicon-link:before {\n content: \'\f05c\';\n }\n\n .markdown-body>*:first-child {\n margin-top: 0 !important;\n }\n\n .markdown-body>*:last-child {\n margin-bottom: 0 !important;\n }\n\n .markdown-body .anchor {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n padding-right: 6px;\n padding-left: 30px;\n margin-left: -30px;\n }\n\n .markdown-body .anchor:focus {\n outline: none;\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n position: relative;\n margin-top: 1em;\n margin-bottom: 16px;\n font-weight: bold;\n line-height: 1.4;\n }\n\n .markdown-body h1 .octicon-link,\n .markdown-body h2 .octicon-link,\n .markdown-body h3 .octicon-link,\n .markdown-body h4 .octicon-link,\n .markdown-body h5 .octicon-link,\n .markdown-body h6 .octicon-link {\n display: none;\n color: #000;\n vertical-align: middle;\n }\n\n .markdown-body h1:hover .anchor,\n .markdown-body h2:hover .anchor,\n .markdown-body h3:hover .anchor,\n .markdown-body h4:hover .anchor,\n .markdown-body h5:hover .anchor,\n .markdown-body h6:hover .anchor {\n padding-left: 8px;\n margin-left: -30px;\n text-decoration: none;\n }\n\n .markdown-body h1:hover .anchor .octicon-link,\n .markdown-body h2:hover .anchor .octicon-link,\n .markdown-body h3:hover .anchor .octicon-link,\n .markdown-body h4:hover .anchor .octicon-link,\n .markdown-body h5:hover .anchor .octicon-link,\n .markdown-body h6:hover .anchor .octicon-link {\n display: inline-block;\n }\n\n .markdown-body h1 {\n padding-bottom: 0.3em;\n font-size: 2.25em;\n line-height: 1.2;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h1 .anchor {\n line-height: 1;\n }\n\n .markdown-body h2 {\n padding-bottom: 0.3em;\n font-size: 1.75em;\n line-height: 1.225;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h2 .anchor {\n line-height: 1;\n }\n\n .markdown-body h3 {\n font-size: 1.5em;\n line-height: 1.43;\n }\n\n .markdown-body h3 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h4 {\n font-size: 1.25em;\n }\n\n .markdown-body h4 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h5 {\n font-size: 1em;\n }\n\n .markdown-body h5 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body h6 {\n font-size: 1em;\n color: #777;\n }\n\n .markdown-body h6 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n .markdown-body ul ul,\n .markdown-body ul ol,\n .markdown-body ol ol,\n .markdown-body ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .markdown-body li>p {\n margin-top: 16px;\n }\n\n .markdown-body dl {\n padding: 0;\n }\n\n .markdown-body dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n .markdown-body dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n .markdown-body blockquote {\n padding: 0 15px;\n color: #777;\n border-left: 4px solid #ddd;\n }\n\n .markdown-body blockquote> :first-child {\n margin-top: 0;\n }\n\n .markdown-body blockquote> :last-child {\n margin-bottom: 0;\n }\n\n .markdown-body table {\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n }\n\n .markdown-body table th {\n font-weight: bold;\n text-align: revert;\n }\n\n .markdown-body table th,\n .markdown-body table td {\n padding: 6px 13px;\n border: 1px solid #ddd;\n }\n\n .markdown-body table tr {\n background-color: #fff;\n border-top: 1px solid #ccc;\n }\n\n .markdown-body table tr:nth-child(2n) {\n background-color: #f8f8f8;\n }\n\n .markdown-body img {\n max-width: 100%;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body code {\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n font-size: 85%;\n background-color: rgba(0, 0, 0, 0.04);\n border-radius: 3px;\n }\n\n .markdown-body code:has(.katex) {\n background-color: transparent;\n }\n\n .markdown-body code:before,\n .markdown-body code:after {\n letter-spacing: -0.2em;\n content: "\\00a0";\n }\n\n .markdown-body pre>code {\n padding: 0;\n margin: 0;\n font-size: 100%;\n word-break: normal;\n white-space: pre;\n background: transparent;\n border: 0;\n }\n\n .markdown-body .highlight {\n margin-bottom: 16px;\n }\n\n .markdown-body .highlight pre,\n .markdown-body pre {\n padding: 16px;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n background-color: #f7f7f7;\n border-radius: 3px;\n }\n\n .markdown-body .highlight pre {\n margin-bottom: 0;\n word-break: normal;\n }\n\n .markdown-body pre {\n word-wrap: normal;\n }\n\n .markdown-body pre code {\n display: inline;\n max-width: initial;\n padding: 0;\n margin: 0;\n overflow: initial;\n line-height: inherit;\n word-wrap: normal;\n background-color: transparent;\n border: 0;\n }\n\n .markdown-body pre code:before,\n .markdown-body pre code:after {\n content: normal;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font-size: 11px;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .pl-c {\n color: #969896;\n }\n\n .markdown-body .pl-c1,\n .markdown-body .pl-mdh,\n .markdown-body .pl-mm,\n .markdown-body .pl-mp,\n .markdown-body .pl-mr,\n .markdown-body .pl-s1 .pl-v,\n .markdown-body .pl-s3,\n .markdown-body .pl-sc,\n .markdown-body .pl-sv {\n color: #0086b3;\n }\n\n .markdown-body .pl-e,\n .markdown-body .pl-en {\n color: #795da3;\n }\n\n .markdown-body .pl-s1 .pl-s2,\n .markdown-body .pl-smi,\n .markdown-body .pl-smp,\n .markdown-body .pl-stj,\n .markdown-body .pl-vo,\n .markdown-body .pl-vpf {\n color: #333;\n }\n\n .markdown-body .pl-ent {\n color: #63a35c;\n }\n\n .markdown-body .pl-k,\n .markdown-body .pl-s,\n .markdown-body .pl-st {\n color: #a71d5d;\n }\n\n .markdown-body .pl-pds,\n .markdown-body .pl-s1,\n .markdown-body .pl-s1 .pl-pse .pl-s2,\n .markdown-body .pl-sr,\n .markdown-body .pl-sr .pl-cce,\n .markdown-body .pl-sr .pl-sra,\n .markdown-body .pl-sr .pl-sre,\n .markdown-body .pl-src {\n color: #df5000;\n }\n\n .markdown-body .pl-mo,\n .markdown-body .pl-v {\n color: #1d3e81;\n }\n\n .markdown-body .pl-id {\n color: #b52a1d;\n }\n\n .markdown-body .pl-ii {\n background-color: #b52a1d;\n color: #f8f8f8;\n }\n\n .markdown-body .pl-sr .pl-cce {\n color: #63a35c;\n font-weight: bold;\n }\n\n .markdown-body .pl-ml {\n color: #693a17;\n }\n\n .markdown-body .pl-mh,\n .markdown-body .pl-mh .pl-en,\n .markdown-body .pl-ms {\n color: #1d3e81;\n font-weight: bold;\n }\n\n .markdown-body .pl-mq {\n color: #008080;\n }\n\n .markdown-body .pl-mi {\n color: #333;\n font-style: italic;\n }\n\n .markdown-body .pl-mb {\n color: #333;\n font-weight: bold;\n }\n\n .markdown-body .pl-md,\n .markdown-body .pl-mdhf {\n background-color: #ffecec;\n color: #bd2c00;\n }\n\n .markdown-body .pl-mdht,\n .markdown-body .pl-mi1 {\n background-color: #eaffea;\n color: #55a532;\n }\n\n .markdown-body .pl-mdr {\n color: #795da3;\n font-weight: bold;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .task-list-item {\n list-style-type: none;\n }\n\n .markdown-body .task-list-item+.task-list-item {\n margin-top: 3px;\n }\n\n .markdown-body .task-list-item input {\n float: left;\n margin: 0.3em 0 0.25em -1.6em;\n vertical-align: middle;\n }\n\n .markdown-body :checked+.radio-label {\n z-index: 1;\n position: relative;\n border-color: #4183c4;\n }\n\n\n /*! Pretty printing styles. Used with prettify.js. */\n /* SPAN elements with the classes below are added by prettyprint. */\n .pln {\n color: #000\n }\n\n /* plain text */\n\n @media screen {\n .str {\n color: #080\n }\n\n /* string content */\n .kwd {\n color: #008\n }\n\n /* a keyword */\n .com {\n color: #800\n }\n\n /* a comment */\n .typ {\n color: #606\n }\n\n /* a type name */\n .lit {\n color: #066\n }\n\n /* a literal value */\n /* punctuation, lisp open bracket, lisp close bracket */\n .pun,\n .opn,\n .clo {\n color: #660\n }\n\n .tag {\n color: #008\n }\n\n /* a markup tag name */\n .atn {\n color: #606\n }\n\n /* a markup attribute name */\n .atv {\n color: #080\n }\n\n /* a markup attribute value */\n .dec,\n .var {\n color: #606\n }\n\n /* a declaration; a variable name */\n .fun {\n color: red\n }\n\n /* a function name */\n }\n\n /* Use higher contrast and text-weight for printable form. */\n @media print,\n projection {\n .str {\n color: #060\n }\n\n .kwd {\n color: #006;\n font-weight: bold\n }\n\n .com {\n color: #600;\n font-style: italic\n }\n\n .typ {\n color: #404;\n font-weight: bold\n }\n\n .lit {\n color: #044\n }\n\n .pun,\n .opn,\n .clo {\n color: #440\n }\n\n .tag {\n color: #006;\n font-weight: bold\n }\n\n .atn {\n color: #404\n }\n\n .atv {\n color: #060\n }\n }\n\n /* Put a border around prettyprinted code snippets. */\n pre.prettyprint {\n padding: 2px;\n /* border: 1px solid #888 */\n }\n\n /* Specify class=linenums on a pre to get line numbering */\n ol.linenums {\n margin-top: 0;\n margin-bottom: 0\n }\n\n /* IE indents via margin-left */\n li.L0,\n li.L1,\n li.L2,\n li.L3,\n li.L5,\n li.L6,\n li.L7,\n li.L8 {\n list-style-type: none\n }\n\n /* Alternate shading for lines */\n li.L1,\n li.L3,\n li.L5,\n li.L7,\n li.L9 {\n background: #eee\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }',t.appendChild(r),function(){t.innerHTML=""}}),[]),(0,h.useEffect)((function(){i.current&&(i.current.innerHTML=e)}),[e]),(0,w.jsx)("div",{ref:n})};var k="mdBody___raKXb",S="button___Ch5Pc",E="previewFlowChart___vY1dq",M="@▁@",T=/<pre[^>]*>/g;var L=function(t,e){t=t||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return e?t.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(t,e,n,i,r,o,a){var s=e||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(t.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):t=t.replace(/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(t,e,n,i,r,o,a){var s=e||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/attachments/download/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(t.indexOf(")")>-1?")":"&")})).replace(n,(function(t,e,n,i,r,o,a){var s=e||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(t.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(t,e,n,i,r){var o=e||i,a=n||r||"";return'"'+f.Z.API_SERVER+"/api/attachments/"+o+a+o+a+"&t="+(0,m.Jn)(o,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(t,e,n,i,r){var o=e||i,a=n||r||"";return"("+f.Z.API_SERVER+"/files/uploads/"+o+a+o+a+"&t="+(0,m.Jn)(o,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,"\n")},A=function(t){var e=t.value,n=void 0===e?"":e,i=t.edit,o=void 0!==i&&i,s=t.className,c=t.showTextOnly,m=t.showLines,L=t.style,A=void 0===L?{}:L,D=t.stylesPrev,P=void 0===D?{}:D,N=t.highlightKeywords,B=t.showProgramFill,_=(t.isProgramFill,t.disabledFill),I=void 0!==_&&_,R=t.programFillValue,O=t.openEditor,F=void 0===O?function(){}:O,j=t.onFillChange,Z=void 0===j?function(t){}:j,z=t.onFillBlur,H=void 0===z?function(){}:z,W=t.onFillFocus,G=void 0===W?function(){}:W,V=function(t){var e=new RegExp("\\b(".concat(["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"].join("|"),")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]*)"),"gi");return t.replace(e,"").trim()}(String(n||"")),U=(0,h.useRef)(),q=(0,h.useRef)(),K=(0,h.useState)(""),Y=u()(K,2),X=Y[0],J=Y[1],Q=(0,h.useState)("office"),$=u()(Q,2),tt=$[0],et=$[1],nt=(0,h.useState)([]),it=u()(nt,2),rt=it[0],ot=it[1],at=(0,h.useRef)("a"+(0,b.Z)()),st={},lt=function(t){return/<style[\s\S]*?>/i.test(t||"")};var ct=function(t){return!c&<(V)?t:t.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(t,e){var n=e.replace(/(\n|\r)/g,"").split("}"),i=[];return n.map((function(t){""!=t&&i.push(".".concat(at.current," ").concat(t))})),"<style>".concat(i.join("}"),"</style>")}))},ut=(0,h.useMemo)((function(){try{V=V.replace(/\(\/attachments\/download\//g,"("+f.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+f.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+f.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+f.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,"\n"),U.current.style.display="none"}catch(t){}if(B){var t=-1;return V=V.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(e,n,i){var r;return function(t,e,n){var i=document.createElement(t===M?"input":"textarea");i.style.width="100%",i.style.height=t===M?"40px":"151px",i.rows=5,i.spellcheck=!1,i.name="edu-program-fill",i.placeholder="请输入",i.dataset.id=e;var r=Object.keys(st).length;return st[r]=i,'<span class="edu-program-fill-wrap '.concat(t===M?"":"show",'" style="width:').concat(t===M?"600px":"100%",'" title=').concat(n||"","><span>").concat(i.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(e,++t,null==R||null===(r=R[t])||void 0===r?void 0:r.value.replaceAll("<","<").replaceAll(">",">"))})),'<pre style="background:#fff;padding:4px">'.concat(ct(V||""),"</pre>")}var e=ct(V);e=(0,d.ZP)(e);var n=(0,d.ez)();V.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",(0,d.Qv)()),(0,d.Iy)()),e=e.replace(/(__special_katext_id_\d+__)/g,(function(t,e){var i=n[e],r=i.type,o=i.expression;return(0,g.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),e=e.replace(/▁/g,"▁▁▁▁▁"),(0,d.AL)();var i=document.createElement("div");return i.innerHTML=e,c?i.innerText:N?(ft(i,N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):(setTimeout((function(){return vt()}),500),i.innerHTML)}),[V,N]);(0,h.useEffect)((function(){mt.current&&mt.current.querySelectorAll(["input","textarea"]).forEach((function(t){t.oninput=ht,t.onblur=dt,t.onfocus=pt}))}),[rt]),(0,h.useEffect)((function(){if(null!=R&&R.length)try{var t,e=mt.current.querySelectorAll(".edu-program-fill-score"),n=mt.current.querySelectorAll('[name="edu-program-fill"]'),i=l()(n.entries());try{for(i.s();!(t=i.n()).done;){var r,o,a,s=u()(t.value,2),c=s[0],h=s[1];h.value=(null==R||null===(r=R[c])||void 0===r?void 0:r.value)||"","warning"===(null==R||null===(o=R[c])||void 0===o?void 0:o.type)?h.className="program-fill-warning":"success"===(null==R||null===(a=R[c])||void 0===a?void 0:a.type)?h.className="program-fill-success":h.className=""}}catch(t){i.e(t)}finally{i.f()}var d,p=l()(e.entries());try{for(p.s();!(d=p.n()).done;){var f,m,g=u()(d.value,2),v=g[0];g[1].innerHTML=null!=R&&null!==(f=R[v])&&void 0!==f&&f.score?"".concat(null==R||null===(m=R[v])||void 0===m?void 0:m.score,"分"):""}}catch(t){p.e(t)}finally{p.f()}ot(R)}catch(t){console.log(t,"error")}}),[R]);var ht=function(t){rt[t.target.dataset.id]=rt[t.target.dataset.id]||{},rt[t.target.dataset.id].value=t.target.value,ot(a()(rt)),Z(rt,t.target.dataset.id)},dt=function(t){rt[t.target.dataset.id]=rt[t.target.dataset.id]||{},rt[t.target.dataset.id].value=t.target.value,ot(a()(rt)),H(rt,t.target.dataset.id)},pt=function(t){rt[t.target.dataset.id]=rt[t.target.dataset.id]||{},rt[t.target.dataset.id].value=t.target.value,ot(a()(rt)),G(rt,t.target.dataset.id)};function ft(t,e){return t.childNodes.forEach((function(t){if(t.childNodes.length>0)ft(t,e);else if("IMG"!==t.nodeName)if(t.innerHTML){var n;t.innerHTML=null===(n=t.innerHTML)||void 0===n?void 0:n.replace(new RegExp(e,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var i=document.createElement("span");i.innerHTML=t.textContent.replace(new RegExp(e,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),t.replaceWith(i)}}))}var mt=(0,h.useRef)();function gt(t){var e=t.target;if("A"===e.tagName.toUpperCase()){var n=e.getAttribute("href");if(n.indexOf("office")>-1)t.preventDefault(),J(n),et("office");else if(n.indexOf("application/pdf")>-1)t.preventDefault(),J(n),et("pdf");else if(n.indexOf("text/html")>-1)t.preventDefault(),J(n),et("html");else if(n.startsWith("#")){t.preventDefault();var i=document.getElementById(n.replace("#",""));i&&i.scrollIntoView(!0)}}}d.jb.WebkitLineClamp=m,m&&(A=r()(r()({},A),d.jb));var vt=function(){var t,e=null===(t=mt.current)||void 0===t?void 0:t.querySelectorAll("video");null==e||e.forEach((function(t){if(t.oncontextmenu=function(){return!1},t.src.indexOf(".m3u8")>-1)if(t.canPlayType("application/vnd.apple.mpegurl"));else if(p.ZP.isSupported()){var e=new p.ZP;e.loadSource(t.src),e.attachMedia(t)}}))};(0,h.useEffect)((function(){if(mt.current&&ut&&ut.match(T)&&window.PR.prettyPrint(),mt.current)return mt.current.addEventListener("click",gt),function(){var t;null===(t=mt.current)||void 0===t||t.removeEventListener("click",gt),(0,d.AL)(),(0,d.Iy)()}}),[ut,mt.current,gt]);return(0,h.useEffect)((function(){var t,e=function(t){t.preventDefault(),t.clipboardData.setData("text",window.getSelection().toString())};return null===(t=mt.current)||void 0===t||t.addEventListener("copy",e),function(){var t;null===(t=mt.current)||void 0===t||t.removeEventListener("copy",e)}}),[mt.current]),(0,w.jsxs)("div",{style:{position:"relative"},onMouseLeave:function(){U.current.style.display="none"},children:[c&&(0,w.jsx)("div",{ref:mt,className:"".concat(k," "),children:ut}),!c&&!lt(ut)&&(0,w.jsx)("div",{ref:mt,style:r()({},A),onMouseOver:function(t){"IMG"===t.target.nodeName&&t.target.className.indexOf("draw-flowchart")>-1?(U.current.style.zIndex=1,U.current.style.display="flex",U.current.style.width=t.target.clientWidth+"px",U.current.style.height=t.target.clientHeight+"px",U.current.style.top=t.target.offsetTop+"px",U.current.style.left=t.target.offsetLeft+"px",t.target.id&&(q.current=t.target.id)):U.current.style.display="none"},className:"".concat(s||""," ").concat(I?"disabled-fill":""," markdown-body ").concat(k," ").concat(at.current),dangerouslySetInnerHTML:{__html:ut}}),!c&<(ut)&&(0,w.jsx)(C,{html:ut}),(0,w.jsx)("div",{ref:U,className:"".concat(S," ").concat(o?"":E),children:(0,w.jsx)(v.Z,{children:(0,w.jsx)(y.ZP,{onClick:function(){o?F(q.current):(J(q.current),et("flowChart"))},children:o?"编辑":"预览"})})}),(0,w.jsx)(x.Z,{close:!0,data:X,type:null!=X&&X.length?tt:"",style:r()({},P),onClose:function(){return J("")}})]})}},42715:function(t,e,n){"use strict";n.d(e,{h:function(){return v}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(59301),l=n(82326),c=n(28284),u=n(99571),h=n(89780),d=n.n(h),p=(n(45559),n(42313),n(37712)),f=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(t){var e=t.value,n=t.onChange,i=t.mode,o=t.options,l=void 0===o?{}:o,c=(0,s.useRef)(),u=(0,s.useState)(),h=a()(u,2),f=h[0],m=h[1];return(0,s.useEffect)((function(){if(f){var t=function(t){var e=t.getValue();n&&n(e)};return f.on("change",t),function(){f.off("change",t)}}}),[f,n]),(0,s.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,s.useEffect)((function(){f&&(e===f.getValue()&&""!==e||setTimeout((function(){f.setValue(e||"")}),300))}),[f,e]),(0,s.useEffect)((function(){if(c.current&&!f){var t=d().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(t)}}),[c.current,f]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}e.Z=function(t){var e=t.callback,n=t.onCancel,i=(0,s.useState)("python"),o=a()(i,2),h=o[0],d=o[1];return(0,p.jsxs)(c.Z,r()(r()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(t){e(t)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(l.default,{getPopupContainer:function(t){return t.parentNode},onChange:function(t){d(g[t][1])},children:Object.keys(g).map((function(t){return(0,p.jsx)(f,{value:t,children:g[t][0]},t)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(v,{mode:h})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},97752:function(t,e,n){"use strict";n.d(e,{Z:function(){return dt}});var i=n(91232),r=n.n(i),o=n(79800),a=n.n(o),s=n(85573),l=n.n(s),c=n(59301),u=n(56565),h=n(89780),d=n.n(h),p=n(76374),f=(n(45559),n(6313),n(25717),n(99498),n(25419),n(67549),n(18714)),m=n(37712),g=function(t){var e=t.value,n=void 0===e?"":e,i=(t.className,t.showTextOnly,t.showLines,t.style,(0,c.useMemo)((function(){return""}),[n]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},v=n(82242),y=n.n(v),b=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学公式",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(t){var e=t.onActionCallback,n=t.title,i=t.icon,r=t.actionName,o=t.className,a=void 0===o?"":o,s=t.children;return(0,m.jsxs)("a",{title:n,className:a,onClick:function(){e(r)},children:[(0,m.jsx)("i",{className:"".concat(i)}),s]})}var w=function(t){var e=t.watch,n=t.showNullButton,i=t.showNullProgramButton,r=t.onActionCallback,o=t.fullScreen,a=t.insertTemp,s=t.hidetoolBar,l=t.extraUse,c=[].concat(b,[{title:"".concat(e?"关闭实时预览":"开启实时预览"),icon:"".concat(e?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(t,e){return(0,m.jsx)("li",{children:t.actionName?(0,m.jsx)(x,y()(y()({},t),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},e)})),n?(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击新增填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,m.jsx)("li",{children:l}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(x,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},C=n(22949),k=n(28284),S=n(37568),E=n(99571),M={labelCol:{span:4},wrapperCol:{span:20}},T=function(t){var e=t.callback,n=t.onCancel;return(0,m.jsxs)(k.Z,y()(y()({},M),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(t){e(t)},style:{width:500},children:[(0,m.jsx)(k.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsx)(k.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},L=n(42715),A=n(58358),D=n(62957),P=n(77019),N=n(62686),B=function(t){var e=t.callback,n=t.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,m.jsx)(D.Z,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1,children:(0,m.jsx)(P.Z,{style:{height:"100vh"},children:(0,m.jsx)(N.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(t){e({src:t.url})},onClose:n})})})},_=n(30641),I=n(5269),R=n(6767),O="drawerWrap___MfDw8",F=(0,c.forwardRef)((function(t,e){t.onCancel;var n=t.editImgId,i=t.callback,r=((0,c.useRef)(),(0,c.useRef)()),o=((0,c.useRef)(),(0,c.useRef)(!1),(0,c.useRef)(!1));console.log("ref:",e);var s=(0,c.useState)(0),l=a()(s,2),u=l[0],h=l[1],d=(0,c.useState)("100vh"),p=a()(d,2),f=p[0],g=p[1];return(0,c.useEffect)((function(){h(1)}),[]),(0,c.useImperativeHandle)(e,(function(){return{setHeight:g}})),(0,m.jsx)("div",{ref:o,className:"body-overflow-initial",children:(0,m.jsx)(_.Z,{width:"100vw",height:f,footer:null,closable:!0,placement:"bottom",open:!!u,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:"zIndex-9999 ".concat(O),onClose:function(){window.saveDrawData((function(t){i({src:"/api/attachments/".concat(t),id:t})}))},title:(0,m.jsxs)(P.Z,{align:"middle",children:[(0,m.jsx)(I.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(I.Z,{onClick:function(){g("60px"===f?"100vh":"60px")},children:(0,m.jsx)("span",{className:"current c-blue",style:{fontWeight:400},children:"展开/收起"})}),(0,m.jsx)(I.Z,{onClick:function(){window.saveDrawData((function(t){null!==t?(R.ZP.success({content:"保存成功",key:"saveFlowChart",style:{zIndex:999999999}}),i({src:"/api/attachments/".concat(t),id:t,disabledClose:!0})):R.ZP.warning({content:"内容为空,请先绘制流程图",key:"saveFlowChart"})}))},children:(0,m.jsx)(E.ZP,{type:"primary",className:"ml20",children:"保存"})})]}),children:(0,m.jsx)("iframe",{src:"/drawio/src/main/webapp/?id=".concat(n||"","&gapi=0&od=0&db=0&gh=0&gl=0&local=0"),width:"100%",height:"100%",frameBorder:"0",ref:r})})})})),j=n(62233),Z=n(47889),z=n(71051),H=Z.ZP.Group,W={margin:"0 8px"},G=function(t){var e=t.callback,n=t.onCancel;return(0,m.jsxs)(k.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(t){e(t)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"单元格数:"}),(0,m.jsx)("span",{style:W,children:"行数"}),(0,m.jsx)(k.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(z.Z,{})}),(0,m.jsx)("span",{style:W,children:"列数"}),(0,m.jsx)(k.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(z.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"对齐方式:"}),(0,m.jsx)(k.Z.Item,{name:"align",children:(0,m.jsxs)(H,{children:[(0,m.jsx)(Z.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(Z.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(Z.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(Z.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},V=n(71411),U=n(30638),q=n.n(U),K=(0,c.forwardRef)((function(t,e){var n=t.use3d,i=t.width,r=t.height,o=t.callback,s=(t.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),h=a()(u,2),d=h[0],p=h[1],f=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(q())(f.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var t=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(t),t};return(0,c.useEffect)((function(){f.current.appName=d?"3D":"graphing",l.current.inject("applet_container")}),[d]),(0,c.useEffect)((function(){p(n)}),[n]),(0,c.useImperativeHandle)(e,(function(){return{getImgData:g}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,m.jsxs)(P.Z,{align:"middle",children:[(0,m.jsx)(I.Z,{flex:1,children:(0,m.jsx)(V.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:d,onChange:function(t){return p(t)}})}),(0,m.jsx)(I.Z,{children:(0,m.jsx)(E.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),Y=n(20037),X="link",J="upload-image",Q="add-flowchart",$="draw-image",tt="code-block",et="add-table",nt="------------",it={default:nt,left:":".concat(nt),center:":".concat(nt,":"),right:"".concat(nt,":")},rt=n(14077),ot=n(89728);var at="@▁▁@",st=["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 lt(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}var ct=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ut=l()(l()({},ct+"-B","bold"),ct+"-I","italic"),ht=l()(l()(l()(l()(l()(l()(l()(l()({},X,"添加链接"),tt,"添加代码块"),J,"添加图片"),$,"添加画图"),Q,"插入流程图"),et,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),dt=function(t){var e=t.defaultValue,n=void 0===e?"":e,i=t.onChange,o=t.width,s=void 0===o?"100%":o,h=t.height,v=void 0===h?400:h,y=t.miniToolbar,b=void 0!==y&&y,x=t.isFocus,k=void 0!==x&&x,S=t.watch,E=t.insertTemp,M=t.mode,P=void 0===M?"markdown":M,N=t.id,_=void 0===N?"markdown-editor-id":N,I=t.showResizeBar,O=void 0!==I&&I,Z=t.noStorage,z=void 0!==Z&&Z,H=t.showNullButton,W=void 0!==H&&H,V=t.showNullProgramButton,U=void 0!==V&&V,q=t.hidetoolBar,nt=void 0!==q&&q,ct=t.fullScreen,dt=void 0!==ct&&ct,pt=t.onBlur,ft=t.onCMBeforeChange,mt=t.onFullScreen,gt=t.className,vt=void 0===gt?"":gt,yt=t.disablePaste,bt=void 0!==yt&&yt,xt=t.disabled,wt=void 0!==xt&&xt,Ct=t.disabledFill,kt=void 0!==Ct&&Ct,St=t.placeholder,Et=void 0===St?"":St,Mt=t.values,Tt=void 0===Mt?"":Mt,Lt=t.extraUse,At=t.onAddBlank,Dt=(0,c.useState)(null),Pt=a()(Dt,2),Nt=Pt[0],Bt=Pt[1],_t=(0,c.useState)(n),It=a()(_t,2),Rt=It[0],Ot=It[1],Ft=(0,c.useState)(S),jt=a()(Ft,2),Zt=jt[0],zt=jt[1],Ht=(0,c.useState)(dt),Wt=a()(Ht,2),Gt=Wt[0],Vt=Wt[1],Ut=(0,c.useState)(""),qt=a()(Ut,2),Kt=qt[0],Yt=qt[1],Xt=(0,c.useState)(0),Jt=a()(Xt,2),Qt=Jt[0],$t=Jt[1],te=(0,c.useState)(v),ee=a()(te,2),ne=ee[0],ie=ee[1],re=(0,c.useState)(!1),oe=a()(re,2),ae=(oe[0],oe[1]),se=(0,c.useState)(0),le=a()(se,2),ce=le[0],ue=le[1],he=(0,c.useState)(0),de=a()(he,2),pe=de[0],fe=de[1],me=(0,c.useRef)(),ge=(0,c.useRef)(),ve=(0,c.useRef)(),ye=(0,c.useRef)(),be=(0,c.useRef)(),xe=(0,c.useRef)(),we=(0,u.useDispatch)();(0,c.useEffect)((function(){var t=window.scrollY||window.pageYOffset;Ot(Tt),null==Nt||Nt.setValue(Tt),window.scrollTo(0,t)}),[Tt]),(0,c.useEffect)((function(){null==mt||mt(Gt)}),[Gt]),(0,c.useEffect)((function(){if(me.current){var t=function(t,n){if(!bt){var i=n.clipboardData;if(i){var r=i.types.toString(),o=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==P)return;try{var a,s=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(s=o[0]);var l=s.getAsFile(),c=l.name.split(".").pop();(0,A.I)(l,(function(t){var n,i,r;t.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?e.replaceSelection('<img width="100%" src="/api/attachments/'.concat(t.id,"?type=").concat(t.content_type,')" alt="','" />')):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="/api/attachments/'.concat(t.id,'"></video>')):(null==l||null===(r=l.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?e.replaceSelection('<a href="/api/attachments/'.concat(t.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):st.includes(c)?e.replaceSelection('<a href="/api/attachments/'.concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):e.replaceSelection("[".concat(l.name,"](/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(n){R.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},e=d().fromTextArea(me.current,{mode:P,lineNumbers:!b,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return e.on("keyup",(function(t,n){8===n.keyCode&&(""==t.getValue()?e.setOption("placeholder",Et):e.setOption("placeholder",null))})),e.on("keydown",(function(t,e){if(8===e.keyCode){var n=function(t,e){var n=t.getDoc(),i=n.getCursor(),r=n.getLine(i.line),o=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),s=r.lastIndexOf("@▁▁@",i.ch),l=a>s?a:s,c=a>s?3:4;if(-1===at.indexOf(o))return null;if(console.log("change1:",e,t,r,i,l,a,s,o),l>=0&&i.ch-l<5){var u=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(t);n&&e.preventDefault()}})),k&&e.focus(),e.on("paste",t),wt&&e.on("beforeChange",(function(t,e){"paste"!==e.origin&&"+input"!==e.origin||e.cancel()})),Bt(e),function(){e.off("paste",t)}}}),[]);var Ce=(0,c.useCallback)((function(){ge.current}),[ne,ge,Gt]);(0,c.useEffect)((function(){if(Nt){var t=function(){var t=new p.Z((function(t){var e,n=r()(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(Ce(),Nt.setSize("100%","100%"),Nt.refresh())}}catch(t){n.e(t)}finally{n.f()}}));return t.observe(me.current.parentElement),t}();return function(){var e,n;null!==(e=me.current)&&void 0!==e&&e.parentElement&&t.unobserve(null===(n=me.current)||void 0===n?void 0:n.parentElement)}}}),[Nt,Ce]),(0,c.useEffect)((function(){if(Nt){for(var t=[],e=function(){var e=a()(i[n],2),r=e[0],o=e[1],s=l()({},r,(function(){ke(o)}));t.push(s),Nt.addKeyMap(s)},n=0,i=Object.entries(ut);n<i.length;n++)e();return function(){for(var e=0,n=t;e<n.length;e++){var i=n[e];Nt.removeKeyMap(i)}}}}),[Nt]),(0,c.useEffect)((function(){dt!==Gt&&Vt(dt)}),[dt]),(0,rt.Z)((function(){if(!z&&Qt>0){var t=(new Date).getTime(),e=window.sessionStorage.getItem(_);t>=Qt+1e4&&(!e||e!==Rt)&&(window.sessionStorage.setItem(_,Rt),ae(!0))}}),1e4),(0,c.useEffect)((function(){zt(S)}),[Nt,S]),(0,c.useEffect)((function(){Nt&&k&&Nt.focus()}),[Nt,k]),(0,c.useEffect)((function(){if(Zt&&Nt){var t=function(t){var e=t.target;if(ye.current){var n=e.scrollTop/e.scrollHeight;ye.current.scrollTop=ye.current.scrollHeight*n}},e=Nt.getScrollerElement();return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[Nt,Zt]),(0,c.useEffect)((function(){if(Nt&&ft){var t=function(t,e){ft(t,e)};return Nt.on("beforeChange",t),function(){Nt.off("beforeChange",t)}}}),[Nt,ft]),(0,c.useEffect)((function(){if(Nt&&pt){var t=function(){pt(Nt.getValue())};return Nt.on("blur",t),function(){Nt.off("blur",t)}}}),[Nt,pt]),(0,c.useEffect)((function(){if(Nt){var t=function(t,e){var n=t.getValue();Ot(n),$t((new Date).getTime()),t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(U?i(n,Le(n)):i(n))};return Nt.on("change",t),function(){Nt.off("change",t)}}}),[Nt,i]),(0,c.useEffect)((function(){if(Nt)if(null==n)Nt.setValue(""),Ot("");else{var t=window.scrollY||window.pageYOffset;n!==Nt.getValue()&&(Nt.setValue(n),Ot(n),Nt.setCursor(wt?1:Nt.lineCount(),0),window.scrollTo(0,t))}}),[Nt,n]);var ke=(0,c.useCallback)((function(t){var e=Nt.getCursor(),n=Nt.getSelection(),i=n.split("\n");switch(t){case"bold":return Nt.replaceSelection("**"+n+"**"),""===n&&Nt.setCursor(e.line,e.ch+2),Nt.focus();case"italic":return Nt.replaceSelection("*"+n+"*"),""===n&&Nt.setCursor(e.line,e.ch+1),Nt.focus();case"code":return Nt.replaceSelection("`"+n+"`"),""===n&&Nt.setCursor(e.line,e.ch+1),Nt.focus();case"inline-latex":if((0,ot.Ye)(we))return;return Yt("inline-latex"),Nt.focus();case"latex":return Nt.replaceSelection("```latex\n"+n+"\n```"),Nt.setCursor(e.line+1,n.length+1),Nt.focus();case"line-break":return Nt.replaceSelection("<br/>\n"),Nt.focus();case"list-ul":return""===n?Nt.replaceSelection("- "+n):Nt.replaceSelection(i.map((function(t){return""===t?"":"- ".concat(t)})).join("\n")),Nt.focus();case"list-ol":return""===n?Nt.replaceSelection("1. "+n):Nt.replaceSelection(i.map((function(t,e){return""===t?"":"".concat(e+1,". ").concat(t)})).join("\n")),Nt.focus();case"add-null-ch":return void(null==At||At());case"add-signal":return""===n&&Nt.setCursor(e.line,e.ch),Nt.replaceSelection("@▁@"),Nt.focus();case"add-multiple":return""===n&&Nt.setCursor(e.line,e.ch),Nt.replaceSelection(at),Nt.focus();case"inster-template-1":return""===n&&Nt.setCursor(e.line,e.ch),Nt.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Nt.focus();case"eraser":return Nt.setValue(""),Nt.focus();case"trigger-watch":return zt(!Zt),Nt.focus();case"trigger-full-screen":return Vt(!Gt),Nt.focus();case X:return void Yt(X);case tt:return void Yt(tt);case J:return void Yt(J);case $:return void Yt($);case"maths-latex":if((0,ot.Ye)(we))return;return void Yt("maths-latex");case Q:return be.current="",sessionStorage.removeItem("file_id"),void Yt(Q);case et:return void Yt(et);default:throw new Error}}),[Nt,Zt,Gt]),Se=(0,c.useCallback)((function(t,e){var n,i,r,o,a;null!=t&&t.disabledClose||Yt("");var s=t||{},l=s.src,c=s.alt,u=s.id;switch(Kt){case X:var h=t.title,d=t.link;return Nt.replaceSelection("[".concat(h,"](").concat(d,")")),Nt.focus();case tt:var p=t.language,f=t.content;return Nt.replaceSelection(["```"+p,f,"```"].join("\n")),Nt.focus();case"maths-latex":for(var m=atob(t),g=new Uint8Array(m.length),v=0;v<m.length;v++)g[v]=m.charCodeAt(v);var y=new Blob([g],{type:"image/png"});(0,A.I)(y,(function(t){t.id?Nt.replaceSelection(".concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}));break;case"inline-latex":if((0,ot.Ye)(we))return;Nt.replaceSelection("`$$"+t+"$$`");break;case"add-flowchart":if(!u)return;-1===Nt.getValue().indexOf(l)?Nt.replaceSelection('<center><img id="'.concat(u,'" width="80%" src="').concat(l,'" class="draw-flowchart" alt="').concat(c||"",'" /></center>')):document.getElementById(u).src=j.Z.API_SERVER+l+"?t="+Date.now();break;case J:case $:var b=e,x=null==b||null===(n=b.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(i=n.pop)||void 0===i?void 0:i.call(n);return(null==b||null===(r=b.type)||void 0===r?void 0:r.indexOf("image"))>-1||null==b||!b.type?null!=b&&b.align||null!=b&&b.width?Nt.replaceSelection('<p style="text-align:'.concat(b.align||"initial",'"><img width="').concat(b.width?b.width+"%":"initial",'" src="').concat(l,'" alt="').concat(c||"",'" /></p>')):Nt.replaceSelection('<img width="100%" src="'.concat(l,'" alt="').concat(c||"",'" />')):(null==b||null===(o=b.type)||void 0===o?void 0:o.indexOf("video"))>-1?Nt.replaceSelection('<video width="100%" controls src="'.concat(l,'"></video>')):(null==b||null===(a=b.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Nt.replaceSelection('<a href="'.concat(l,"?type=").concat(b.type,'&disposition=inline" target="_blank">').concat(b.name,"</a>")):st.includes(x)?Nt.replaceSelection('<a href="'.concat(l,'?type=office&disposition=inline" target="_blank">').concat(b.name,"</a>")):Nt.replaceSelection("[".concat(b.name,"](").concat(l,")")),Nt.focus();case et:for(var w=t.row,C=t.col,k=t.align,S="\n",E=0;E<w;E++){for(var M=[],T=[],L=0;L<C;L++)1===E&&T.push(it[k]),M.push(" ");1===E&&(S+="| ".concat(T.join(" | ")," |\n")),S+="| ".concat(M.join(1===C?"":" | ")," |\n")}return Nt.replaceSelection(S+"\n"),Nt.focus();default:throw new Error}}),[Nt,Kt]),Ee=(0,c.useMemo)((function(){switch(Kt){case X:return(0,m.jsx)(T,{callback:Se,onCancel:Me});case tt:return(0,m.jsx)(L.Z,{callback:Se,onCancel:Me});case J:return(0,m.jsx)(A.Z,{callback:Se,onCancel:Me});case Q:return(0,m.jsx)(F,{editImgId:be.current,callback:Se,onCancel:Me});case et:return(0,m.jsx)(G,{callback:Se,onCancel:Me});case"maths-latex":return(0,m.jsx)(K,{showSaveButton:!0,callback:Se});case"inline-latex":return(0,m.jsx)(Y.Z,{showSaveButton:!0,callback:Se});default:return null}}),[Kt]);function Me(){Yt("")}(0,c.useEffect)((function(){if(ve.current){var t=function(t){r=!0,o=t.pageY},e=function(){r=!1},n=function(t){if(r){var e=t.pageY-o;e<0&&(e=0),e>300&&(e=300),ie(v+e+"px")}},i=ve.current,r=!1,o=0;return i.addEventListener("mousedown",t),document.addEventListener("mousemove",n),document.addEventListener("mouseup",e),function(){i.removeEventListener("mousedown",t),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",e)}}}),[Nt,ve]),(0,c.useEffect)((function(){ie(v)}),[v]);var Te={width:lt(s),height:lt(ne)},Le=((0,c.useMemo)((function(){if(Qt){var t=new Date(Qt),e=t.getHours(),n=t.getMinutes(),i=t.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(e=e<10?"0"+e:e,":").concat(n,":").concat(i)}return 0}),[Qt]),function(t){var e=[];if(U){t=t.replace(/(@▁▁@|@▁@)/g,(function(t,n,i){e.push({multiLine:!("@▁@"===t)})}))}return e});(0,c.useEffect)((function(){ht[Kt]&&Kt!==$&&Kt!==Q&&setTimeout((function(){var t=document.getElementsByClassName("markdown-popup-form")[0],e=window.innerWidth/2-t.offsetWidth/2,n=window.innerHeight/2-t.offsetHeight/2;ue(e),fe(n)}),0)}),[Kt]);var Ae=function(t,e,n,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(t<20&&n>t||t>o-20&&n<t||e<20&&i>e||e>r-20&&i<e)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,m.jsxs)(c.Fragment,{children:[(0,m.jsx)("div",{className:"markdown-editor-wrapper",ref:ge,children:(0,m.jsxs)("div",{className:"markdown-editor-container ".concat(vt," ").concat(Zt?"on-preview":""," ").concat(b?"mini":""," ").concat(Gt?"full-screen":""),style:Te,children:[(0,m.jsx)(w,{insertTemp:E,watch:Zt,fullScreen:Gt,showNullButton:W,showNullProgramButton:U,onActionCallback:ke,hidetoolBar:nt,extraUse:Lt}),(0,m.jsxs)("div",{className:"markdown-editor-body",children:[(0,m.jsx)("div",{className:"codemirror-container",children:(0,m.jsx)("textarea",{ref:me,placeholder:Et})}),Zt?(0,m.jsxs)("div",{ref:ye,className:"preview-container",children:["stex"===P&&(0,m.jsx)(g,{value:Rt}),"stex"!==P&&(0,m.jsx)(f.Z,{edit:!0,disabledFill:kt,showProgramFill:U,value:Rt,openEditor:function(t){var e;be.current=t,null===(e=xe.current)||void 0===e||e.setHeight("100vh"),setTimeout((function(){Yt("add-flowchart")}),150)}})]}):null]})]})}),O?(0,m.jsx)("a",{ref:ve,className:"editor-resize"}):null,Kt===$&&(0,m.jsx)(B,{callback:Se,onCancel:Me}),Kt===Q&&(0,m.jsx)(F,{ref:xe,editImgId:be.current,callback:Se,onCancel:Me}),(0,m.jsx)(C.Z,{children:ht[Kt]&&Kt!==$&&Kt!==Q?(0,m.jsx)(D.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ce,top:pe},title:(0,m.jsx)("div",{style:{cursor:"move"},onMouseDown:function(t){t.preventDefault();var e=t.clientX-ce,n=t.clientY-pe;document.body.onmousemove=function(t){var i=t.clientX-e,r=t.clientY-n,o=document.getElementsByClassName("markdown-popup-form")[0],a=window.innerWidth-o.offsetWidth,s=window.innerHeight-o.offsetHeight;i=Math.max(0,Math.min(i,a)),r=Math.max(0,Math.min(r,s)),Ae(t.clientX,t.clientY,e,n)&&(ue(i),fe(r))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:ht[Kt]}),open:!0,onCancel:Me,footer:null,destroyOnClose:!0,width:Kt===Q?"1200px":null,height:Kt===Q?"80vh":null,className:"markdown-popup-form",children:Ee}):null})]})}},58358:function(t,e,n){"use strict";n.d(e,{Z:function(){return x},I:function(){return C}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(28284),l=n(6767),c=n(37568),u=n(77736),h=n(71051),d=n(47889),p=n(99571),f=n(44483),m=n(59301),g=n(37712),v=s.Z.useForm,y={width:280,marginRight:10},b={labelCol:{span:5},wrapperCol:{span:19}},x=function(t){var e=t.callback,n=t.onCancel,i=v(),o=a()(i,1)[0],f=(0,m.useRef)();function x(t,e){-1!==t.status?o.setFieldsValue({src:"/api/attachments/".concat(t.id),type:e.type}):l.ZP.error(t.message)}return(0,g.jsxs)(s.Z,r()(r()({form:o},b),{},{className:"upload-image-panel",onFinish:function(t){f.current.width=o.getFieldValue("width"),f.current.align=o.getFieldValue("align"),e(t,f.current)},style:{width:470,overflow:"hidden"},children:[(0,g.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,g.jsxs)("div",{className:"flex-container",children:[(0,g.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,g.jsx)(c.Z,{style:y})}),(0,g.jsx)(w,{onFileChange:function(t){var e=t.target.files[0];f.current=e,C(e,x)}})]})}),(0,g.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,g.jsx)(c.Z,{style:{width:264}})}),(0,g.jsx)(s.Z.Item,{label:"图片宽度",name:"width",children:(0,g.jsxs)(u.Z,{children:[(0,g.jsx)(s.Z.Item,{name:"width",style:{margin:0},children:(0,g.jsx)(h.Z,{style:{width:264}})}),(0,g.jsx)("span",{className:"ml8",children:"%"})]})}),(0,g.jsx)(s.Z.Item,{label:"对齐方式",name:"align",children:(0,g.jsx)(d.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"左对齐"},{value:"center",label:"居中对齐"},{value:"right",label:"右对齐"}]})}),(0,g.jsx)("aside",{children:(0,g.jsxs)(s.Z.Item,{style:{textAlign:"right",position:"relative",right:-98},children:[(0,g.jsx)(p.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(p.ZP,{type:"default",onClick:n,children:"取消"})]})})]}))};function w(t){var e=t.onFileChange;return(0,g.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,g.jsx)("input",{type:"file",onChange:e})]})}function C(t,e){if(!t)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",t),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){e(JSON.parse(n.target.responseText),t)}),!1),i.addEventListener("error",(function(t){console.error(t)}),!1),i.open("POST","".concat(f.KI,"/api/attachments.json")),i.send(n)}},22949:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var i=n(82100),r=n.n(i),o=n(29186),a=n.n(o),s=n(80619),l=n.n(s),c=n(47074),u=n.n(c),h=n(59301),d=n(4676),p=function(t){l()(n,t);var e=u()(n);function n(t){var i;r()(this,n),i=e.call(this,t);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return a()(n,[{key:"render",value:function(){var t=this.props.children;return(0,d.createPortal)(t,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(h.Component)},54501:function(t,e,n){"use strict";n.d(e,{SV:function(){return J},ZP:function(){return X}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),s=n(91232),l=n.n(s),c=n(79800),u=n.n(c),h=n(39647),d=n.n(h),p=n(7557),f=n.n(p),m=n(41498),g=n.n(m),v=n(59301),y=n(76374),b=["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"],x={quickKey:[{label:"main",content:["public static void main(String[] args) {","\t$0","}"].join("\n")},{label:"System.out.println",content:["System.out.println($0)"].join("\n")},{label:"System.out.print",content:["System.out.print($0)"].join("\n")}],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"]},w={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}) {","\t$0","} else {","\t","}"].join("\n")},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {","\t$0","}"].join("\n")},{label:"if",content:["if () {","\t$0","}"].join("\n")},{label:"for",content:["for(int j=0 ; j<10; j++){","\t$0","}"].join("\n")},{label:"trycatch",content:["try{","\t$0","}catch(ExceptionName e){","}"].join("\n")},{label:"using namespace std;",content:["using namespace std;"].join("\n")},{label:"include <iostream>",content:["#include <iostream>"].join("\n")},{label:"include <vector>",content:["#include <vector>"].join("\n")},{label:"include <cstdio>",content:["#include <cstdio>"].join("\n")},{label:"include <cstring>",content:["#include <cstring>"].join("\n")},{label:"include <sstream>",content:["#include <sstream>"].join("\n")},{label:"include <fstream>",content:["#include <fstream>"].join("\n")},{label:"include <map>",content:["#include <map>"].join("\n")},{label:"include <string>",content:["#include <string>"].join("\n")},{label:"include <cmath>",content:["#include <cmath>"].join("\n")}]},C={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("\n")}]},k={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("\n")}]},S=n(53184),E=n.n(S),M={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"]}},T=function(t,e,n,i){t.languages.registerCompletionItemProvider(e,{provideCompletionItems:function(e,r){var o=e.getWordUntilPosition(r),s={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},l=e.getLineContent(r.lineNumber).substring(o.startColumn-2,o.endColumn),c=function(t,e,n,i){var r=e.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});return Array.from(new Set(r.match(/\b\w{2,}\b/g)||[])).map((function(e){return{label:e,kind:t.languages.CompletionItemKind.Text,insertText:e,range:i}}))}(t,e,r,s);return{suggestions:[].concat(a()(c),a()(n.map((function(e){return{label:e,kind:t.languages.CompletionItemKind.Keyword,documentation:e,insertText:e,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}))),a()(i.map((function(e){return{label:e.label,kind:t.languages.CompletionItemKind.Snippet,documentation:e.content,insertText:l.startsWith("#")?e.content.replace(/#/,""):e.content,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}))))}}})},L=n(82100),A=n.n(L),D=n(29186),P=n.n(D),N=n(85573),B=n.n(N),_=function(){function t(e,n,i){var r=this;A()(this,t),this.placeholder=e,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return P()(t,[{key:"onDidChangeModelContent",value:function(){""===this.editor.getValue()?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}},{key:"getId",value:function(){return t.ID}},{key:"getDomNode",value:function(){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}},{key:"getPosition",value:function(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}},{key:"dispose",value:function(){this.editor.removeContentWidget(this)}}]),t}();B()(_,"ID","editor.widget.placeholderHint");var I=_,R=n(96236),O=n(6767),F=n(25399),j=n(89392),Z=n(89794),z=n(56102),H=n(37712),W=["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"];function G(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}function V(){}var U={"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 q(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t;if(Array.isArray(t)){for(var n=0;n<t.length;n++){var i=U[t[n]];if(i)return i}return e[0]}return U[e]||e}var K=null,Y=function(){var t=g()(f()().mark((function t(){return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.clipboard.writeText(" ");case 3:console.log("内容已自动复制到剪贴板:"),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error("自动复制失败:",t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(){return t.apply(this,arguments)}}(),X=function(t){var e=t.width,i=void 0===e?"100%":e,o=t.height,s=void 0===o?"100%":o,c=t.value,h=t.language,p=void 0===h?"javascript":h,m=t.style,S=void 0===m?{}:m,L=t.options,A=void 0===L?{}:L,D=t.overrideServices,P=void 0===D?{}:D,N=t.theme,B=void 0===N?"vs-dark":N,_=t.onEditBlur,U=t.isCopy,X=void 0!==U&&U,J=t.onSave,Q=t.autoHeight,$=void 0!==Q&&Q,tt=t.forbidCopy,et=void 0!==tt&&tt,nt=t.onChange,it=void 0===nt?V:nt,rt=t.editorDidMount,ot=void 0===rt?V:rt,at=t.onFocus,st=void 0===at?V:at,lt=t.onBreakPoint,ct=void 0===lt?V:lt,ut=t.breakPointValue,ht=void 0===ut?[]:ut,dt=t.filename,pt=void 0===dt?"educoder.txt":dt,ft=t.errorLine,mt=t.errorContent,gt=void 0===mt?"":mt,vt=t.highlightLine,yt=t.openBreakPoint,bt=void 0!==yt&&yt,xt=t.placeholder,wt=void 0===xt?"":xt,Ct=t.showMiniMap,kt=void 0===Ct||Ct,St=(d()(t,W),(0,v.useRef)()),Et=(0,v.useRef)({}),Mt=(0,v.useRef)(),Tt=(0,v.useRef)(),Lt=(0,v.useRef)([]),At=(0,v.useRef)(!1),Dt=(0,v.useRef)(),Pt=(0,v.useRef)(),Nt=(0,v.useRef)(!1),Bt=(0,v.useState)(!1),_t=u()(Bt,2),It=_t[0],Rt=_t[1];(0,v.useEffect)((function(){var t=Z.Z.subscribe("formatDocument",(function(t){var e,n=Et.current.instance;null==n||null===(e=n.getAction)||void 0===e||e.call(n,"editor.action.formatDocument").run()}));return window.updateMonacoValue=function(t){it(t)},t}),[]),(0,v.useEffect)((function(){var t,e=Et.current.instance;(Tt.current&&clearTimeout(Tt.current),Tt.current=setTimeout((function(){!function(){var t=Et.current.instance;if(null!=c&&t&&It){var e=t.getModel();e&&c!==e.getValue()&&(!0,e.setValue(c),t.layout(),!1)}}()}),500),c&&null!=c&&c.length)&&(null==e||null===(t=e.updateOptions)||void 0===t||t.call(e,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(c.split(/\r\n|\r|\n/g).length))+3,5)}))}),[c,It,Et.current]),(0,v.useEffect)((function(){if(ft&&Et.current&&Et.current.instance){var t=Et.current.instance;t.changeViewZones((function(t){var e=document.createElement("div");e.style.padding="10px 20px",e.style.width="calc(100% - 20px)",e.className="my-error-line-wrp",e.innerHTML=gt,t.addZone({afterLineNumber:ft||11,heightInLines:3,domNode:e})}));var e={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}};t.addOverlayWidget(e),t.revealPositionInCenter({lineNumber:20,column:1})}}),[ft,Et.current,It]);var Ot=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!t||""===t.trim())return!0;for(var n=Et.current.instance.getModel(),i=n.getLineTokens(e),r=!1,o=0;o<2;o++)1===i.getStandardTokenType(o)&&(r=!0);return r};function Ft(t){(window.navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)&&83==t.keyCode&&(t.preventDefault(),J())}(0,v.useEffect)((function(){var t,e=null===(t=Et.current)||void 0===t?void 0:t.instance;if(e&&It&&et){var n=e.onDidBlurEditorWidget((function(){Nt.current=!1})),i=e.onDidFocusEditorText((function(){Nt.current=!0}));return function(){n.dispose(),i.dispose()}}}),[Et.current,It,et]),(0,v.useEffect)((function(){var t;if(null!==(t=Et.current)&&void 0!==t&&t.instance&&It&&bt){var e=Et.current.instance,n=e.getModel();if(!n)return;!function(){var t,i=[],r=[],o=n.getAllDecorations(),a=l()(o);try{for(a.s();!(t=a.n()).done;){var s,c=t.value;if("highlighted-line"===c.options.className)i.push(null==c||null===(s=c.range)||void 0===s?void 0:s.startLineNumber),r.push(null==c?void 0:c.id)}}catch(t){a.e(t)}finally{a.f()}if(vt!==i[0]){n.deltaDecorations(r,[]);var u=n.getLineCount();vt&&vt<=u&&(e.deltaDecorations([],[{range:new K.Range(vt,1,vt,n.getLineMaxColumn(vt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),e.revealLineInCenter(vt))}}();var i=function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],o=n.getAllDecorations(),a=l()(o);try{for(a.s();!(t=a.n()).done;){var s,c=t.value;if("breakpoints-select"===c.options.linesDecorationsClassName)i.push(null==c||null===(s=c.range)||void 0===s?void 0:s.startLineNumber),r.push(null==c?void 0:c.id)}}catch(t){a.e(t)}finally{a.f()}if(e)return{lines:i,ids:r};ct(i)},r=function(){var t=g()(f()().mark((function t(e){var r;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}},t.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),o=function(){var t=g()(f()().mark((function t(r){var o,a,s,c,u;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=[],a=e.getLineDecorations(r),s=l()(a);try{for(s.s();!(c=s.n()).done;)"breakpoints-select"===(u=c.value).options.linesDecorationsClassName&&o.push(u.id)}catch(t){s.e(t)}finally{s.f()}return t.next=6,n.deltaDecorations(o,[]);case 6:i();case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),a=function(t){var n,i=e.getLineDecorations(t),r=l()(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints-select"===n.value.options.linesDecorationsClassName)return!0}}catch(t){r.e(t)}finally{r.f()}return!1};if(!(0,j.isEqual)(ht,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var s=ht.map((function(t){return{range:new K.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],s)}var c=e.onDidChangeModelContent((function(t){var s=e.getPosition();if(s){var l=s.lineNumber;clearTimeout(Pt.current),Pt.current=setTimeout((function(){Ot(n.getLineContent(l),l)?o(l):a(l)?(o(l),r(l)):i()}),100)}})),u=e.onMouseDown((function(t){var e;if(t.target.detail&&null!==(e=t.target)&&void 0!==e&&null!==(e=e.element)&&void 0!==e&&null!==(e=e.className)&&void 0!==e&&e.includes("line-numbers")){var i=t.target.position.lineNumber;if(Ot(n.getLineContent(i),i))return;a(i)?o(i):r(i)}})),h=function(){Lt.current=e.deltaDecorations(Lt.current,[])},d=e.onMouseMove((function(t){var i;if(h(),t.target.detail&&null!==(i=t.target)&&void 0!==i&&null!==(i=i.element)&&void 0!==i&&null!==(i=i.className)&&void 0!==i&&i.includes("line-numbers")){var r=t.target.position.lineNumber;if(Ot(n.getLineContent(r),r))return;!function(t){var n={range:new K.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Lt.current=e.deltaDecorations(Lt.current,[n])}(r)}})),p=e.onMouseLeave((function(){h()}));return function(){c.dispose(),u.dispose(),d.dispose(),p.dispose()}}}),[Et.current,It,ht,vt,bt,p]),(0,v.useEffect)((function(){var t;null!==(t=Et.current)&&void 0!==t&&t.instance&&bt&&Et.current.instance.setPosition({lineNumber:0,column:0})}),[vt]);var jt=function(){if($&&Et.current.instance){var t=Et.current.instance.getContentHeight();Kt(t<s?s:t)}else Kt(s)};var Zt=function(t){if(Nt.current){var e=t.keyCode,n=t.ctrlKey,i=t.metaKey,r=t.target;return"paste"!==t.type&&(67!==e&&86!==e||!i&&!n)||"TEXTAREA"!==r.nodeName||(O.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),t.preventDefault()),!1}};function zt(t,e){var n,i,r=window.URL||window.webkitURL||window,o=new Blob([e]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(o),a.download=t,n=a,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}(0,v.useEffect)((function(){jt()}),[jt]),(0,v.useEffect)((function(){St.current&&!It&&Promise.all([n.e(8909),n.e(2460)]).then(n.bind(n,71448)).then((function(t){try{K=t,Et.current.instance=K.editor.create(St.current,{value:c,language:q(p),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:kt||!1}},P);var e=Et.current.instance,n=R.BH._menuItems,i=a()(n).find((function(t){return"EditorContext"==t[0]._debugName}))[1];if(ot(e,K),setTimeout((function(){jt(),Et.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){zt(pt||"educoder.txt",e.getValue())}})}),500),Et.current.subscription=e.onDidChangeModelContent((function(t){At.current?clearTimeout(Dt.current):(jt(),it(e.getValue(),t)),Dt.current=setTimeout((function(){At.current=!1}),500)})),window.Monaco||function(t){M.languages.forEach((function(e){t.languages.registerDocumentFormattingEditProvider(e,{provideDocumentFormattingEdits:function(t){return g()(f()().mark((function e(){var n;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=E()(t.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}),e.abrupt("return",[{range:t.getFullModelRange(),text:n}]);case 2:case"end":return e.stop()}}),e)})))()}})})),T(t,"java",x.keywords,x.quickKey),T(t,"cpp",w.keywords,w.quickKey),T(t,"c",b,[]),T(t,"python",C.keywords,C.quickKey),T(t,"scala",k.keywords,k.quickKey)}(K,q(p)),et&&(!function(t,e){var n=t._first;do{var i;e.includes(null===(i=n.element)||void 0===i||null===(i=i.command)||void 0===i?void 0:i.id)&&t._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),St.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Zt),window.removeEventListener("paste",Zt),window.addEventListener("keydown",Zt),window.addEventListener("paste",Zt)),window.Monaco=K,_&&e.onDidBlurEditorWidget((function(){_(e.getValue())})),st&&e.onDidFocusEditorText((function(){et&&Y(),st(e.getValue())})),et){Y();try{e.onDidPaste((function(t){var n=e.getSelection(),i=Et.current.pastePos||{};new K.Range(i.startLineNumber||n.endLineNumber,i.startColumn||n.endColumn,i.endLineNumber||n.endLineNumber,i.endColumn||n.endColumn);e.executeEdits("",[{range:t.range,text:""}])}))}catch(t){}}var r=function(){var t;return St.current&&(t=new y.Z((function(t){var e,n=l()(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&Et.current.instance.layout()}}catch(t){n.e(t)}finally{n.f()}}))).observe(St.current),t}();return wt&&"string"==typeof wt&&new I(wt,e,K),Rt(!0),function(){var t=Et.current.instance;t.dispose();var e=t.getModel();e&&e.dispose(),Et.current.subscription&&Et.current.subscription.dispose(),r.unobserve(St.current)}}catch(t){}}))}),[]),(0,v.useEffect)((function(){if(Et.current.instance&&It)return document.addEventListener("keydown",Ft,!1),function(){document.removeEventListener("keydown",Ft)}}),[J,It]),(0,v.useEffect)((function(){var t=Et.current.instance;if(t&&It){var e=q(p);K.editor.setModelLanguage(t.getModel(),e)}}),[p,It]),(0,v.useEffect)((function(){Et.current.instance&&It&&K.editor.setTheme(B)}),[B,It]),(0,v.useEffect)((function(){var t=Et.current.instance;Mt.current=A,t&&It&&(t.updateOptions(r()({},A)),setTimeout((function(){t.getModel().updateOptions(r()({},A))}),200))}),[JSON.stringify(A),It]),(0,v.useEffect)((function(){var t=Et.current.instance;t&&It&&t.layout()}),[i,s,It]);var Ht=(0,v.useState)(G(i)),Wt=u()(Ht,2),Gt=Wt[0],Vt=(Wt[1],(0,v.useState)(G(s))),Ut=u()(Vt,2),qt=Ut[0],Kt=Ut[1],Yt=r()(r()({},S),{},{width:Gt,height:qt,position:"relative"});return(0,H.jsx)("div",{className:"my-monaco-editor",ref:St,style:Yt,children:X&&(0,H.jsx)(z.CopyToClipboard,{text:c,onCopy:function(){return O.ZP.success("复制成功")},children:(0,H.jsx)(F.Z,{title:"复制代码",children:(0,H.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,H.jsx)("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," 复制代码"]})})})})};function J(t){var e=t.width,i=void 0===e?"100%":e,o=t.height,a=void 0===o?"100%":o,s=t.original,c=t.modified,h=t.language,d=t.options,p=void 0===d?{}:d,f=(0,v.useRef)(),m=(0,v.useState)(null),g=u()(m,2),b=g[0],x=g[1];(0,v.useEffect)((function(){return f.current&&Promise.all([n.e(8909),n.e(9404)]).then(n.bind(n,2550)).then((function(t){var e=(K=t).editor.createDiffEditor(f.current,r()(r()({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},p),{},{wordWrap:!0}));x(e);var n=function(t){var e;return f.current&&(e=new y.Z((function(e){var n,i=l()(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&t.layout()}}catch(t){i.e(t)}finally{i.f()}}))).observe(f.current),e}(e);return function(){e.dispose();var t=e.getModel();t&&t.dispose(),n.unobserve(f.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),(0,v.useEffect)((function(){b&&b.setModel({original:K.editor.createModel(s,h),modified:K.editor.createModel(c,h)})}),[s,c,h,b]);var w={width:G(i),height:G(a)};return(0,H.jsx)("div",{className:"my-diff-editor",ref:f,style:w})}},14077:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});var i=n(59301);function r(t,e){var n=(0,i.useRef)();(0,i.useEffect)((function(){n.current=t})),(0,i.useEffect)((function(){if(null!==e){var t=setInterval((function(){n.current()}),e);return function(){return clearInterval(t)}}}),[e])}},52802:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return S}});var i=n(7557),r=n.n(i),o=n(82242),a=n.n(o),s=n(41498),l=n.n(s),c=n(79800),u=n.n(c),h=n(59301),d=n(97752),p=n(6767),f=n(37568),m=n(99571),g=n(43170),v=n(37712);var y=function(t){var e=t.setIscreate,n=t.init,i=t.UpdateItem,o=(0,h.useState)(""),a=u()(o,2),s=a[0],c=a[1],y=(0,h.useState)(""),b=u()(y,2),x=b[0],w=b[1];function C(){return(C=l()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=3;break}return p.ZP.info("标题不能为空"),t.abrupt("return");case 3:if(x){t.next=6;break}return p.ZP.info("内容不能为空"),t.abrupt("return");case 6:if(!i){t.next=9;break}return k(),t.abrupt("return");case 9:return t.next=11,(0,g.ZP)("/api/hpc_courses.json",{method:"post",body:{name:s,description:x,container_type:window.location.pathname.split("/")[1]}});case 11:t.sent&&(p.ZP.info("创建成功"),e(!1),n("add"));case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(){return S.apply(this,arguments)}function S(){return(S=l()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,g.ZP)("/api/hpc_courses/".concat(i.id,".json"),{method:"put",body:{name:s,description:x,container_type:window.location.pathname.split("/")[1]}});case 2:t.sent&&(p.ZP.info("编辑成功"),e(!1),n(""));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return(0,h.useEffect)((function(){i&&(c(i&&i.name),w(i&&i.description))}),[i]),(0,v.jsxs)("div",{children:[(0,v.jsx)(f.Z,{style:{marginBottom:"20px"},placeholder:"请输入标题",value:s,maxLength:60,addonAfter:String(s.length)+"/60",onChange:function(t){return c(t.target.value)}}),(0,v.jsx)(d.Z,{id:"courseContentMD",defaultValue:x,onChange:function(t){return w(t)}}),(0,v.jsxs)("div",{className:"clearfix mt30 mb30",children:[(0,v.jsx)(m.ZP,{type:"primary",onClick:function(){return function(){return C.apply(this,arguments)}()},className:"defalutSubmitbtn fl mr20",children:"提交"}),(0,v.jsx)("a",{className:"defalutCancelbtn fl",onClick:function(){return e(!1)},children:"取消"})]})]})},b=n(18714);var x=function(t){var e=t.CourseItem,n=t.userId,i=t.init,o=t.ItemUpdate,a=t.setSee,s=t.UserInfo;function c(){return(c=l()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,g.ZP)("/api/hpc_courses/".concat(e.id,".json"),{method:"delete"});case 2:t.sent&&(p.ZP.info("删除成功"),i("delete"),a(!1));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return(0,v.jsxs)("div",{children:[299635===n||301458===n||null!=s&&s.admin||null!=s&&s.business?(0,v.jsxs)("div",{style:{textAlign:"right"},children:[(0,v.jsx)(m.ZP,{onClick:function(){o(e)},children:"编辑"}),(0,v.jsx)(m.ZP,{onClick:function(){return function(){return c.apply(this,arguments)}()},style:{marginLeft:"30px"},children:"删除"})]}):null,(0,v.jsx)("h1",{children:null==e?void 0:e.name}),(0,v.jsx)(b.Z,{value:null==e?void 0:e.description})]})},w=n(14566),C=n(62233),k=n(56565);var S=(0,k.connect)((function(t){return{user:t.user}}))((function(t){var e,n,i,o,s,c,d,f,b,S=t.user,E=t.dispatch,M=(0,h.useState)(1),T=u()(M,2),L=T[0],A=(T[1],(0,h.useState)(100)),D=u()(A,2),P=D[0],N=(D[1],(0,h.useState)([])),B=u()(N,2),_=B[0],I=B[1],R=(0,h.useState)(!1),O=u()(R,2),F=O[0],j=O[1],Z=(0,h.useState)(!1),z=u()(Z,2),H=z[0],W=z[1],G=(0,h.useState)(""),V=u()(G,2),U=V[0],q=V[1],K=(0,h.useState)(""),Y=u()(K,2),X=Y[0],J=Y[1],Q=(0,h.useState)(""),$=u()(Q,2),tt=$[0],et=$[1],nt=(0,k.useParams)().itemname,it=(0,h.useState)(""),rt=u()(it,2),ot=rt[0],at=rt[1];function st(t){return lt.apply(this,arguments)}function lt(){return(lt=l()(r()().mark((function t(e){var n,i,o,a;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,g.ZP)("/api/hpc_courses.json",{method:"get",params:{page:L,per_page:P,container_type:window.location.pathname.split("/")[1]}});case 2:if(!(n=t.sent)){t.next=24;break}if(i=n.data.hpc_courses.length,I(n.data.hpc_courses),et(n.data.file_url),J(""),i){t.next=10;break}return t.abrupt("return");case 10:if(ot){t.next=14;break}nt?(a=0,null==n||null===(o=n.data)||void 0===o||null===(o=o.hpc_courses)||void 0===o||o.map((function(t,e){var n;(null==nt?void 0:nt.toLocaleLowerCase())===(null==t||null===(n=t.name)||void 0===n?void 0:n.toLocaleLowerCase())&&(a=e)})),q(n.data.hpc_courses[a]),W(!0),at(n.data.hpc_courses[a].id),"resources"===(null==nt?void 0:nt.toLocaleLowerCase())&&(q(n.data.hpc_courses.filter((function(t){return 15===t.id}))[0]),W(!0),at(15))):(q(n.data.hpc_courses[0]),W(!0),at(n.data.hpc_courses[0].id)),t.next=24;break;case 14:if("delete"!==e){t.next=23;break}if(0!==i){t.next=18;break}return W(!1),t.abrupt("return");case 18:q(n.data.hpc_courses[0]),W(!0),at(n.data.hpc_courses[0].id),t.next=24;break;case 23:"add"===e?(q(n.data.hpc_courses[i-1]),W(!0),at(n.data.hpc_courses[i-1].id)):(q(n.data.hpc_courses.filter((function(t){return t.id===ot}))[0]),W(!0),at(ot));case 24:case"end":return t.stop()}}),t)})))).apply(this,arguments)}(0,h.useEffect)((function(){E({type:"globalSetting/headerToggle",payload:!1}),L&&st("")}),[L]);var ct={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(t){var e=t.file.status;"done"===e?(p.ZP.success("".concat(t.file.name," 文件上传成功")),st("")):"error"===e&&p.ZP.error("".concat(t.file.name," 文件上传失败"))},beforeUpload:function(t){var e=t.size/1024/1024<150;return e||p.ZP.info("文件大小必须小于150MB"),e}};return(0,v.jsxs)("div",{style:{marginBottom:"40px"},children:[(0,v.jsx)("div",{className:"bannterdiv",style:{background:"url(".concat(C.Z.IMG_SERVER+"/".concat(tt),")")}}),(0,v.jsx)("img",{style:{width:"100%"},src:C.Z.IMG_SERVER+"/".concat(tt)}),(0,v.jsxs)("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"},children:[(0,v.jsxs)("div",{style:{flex:"1",marginTop:"17px"},children:[_&&_.map((function(t,e){return(0,v.jsx)("p",{onClick:function(){return function(t){j(!1),W(!0),q(t),at(t.id)}(t)},className:ot===t.id?"menuitemselect":"menuitem task-hide",children:t.name},e)})),299635===(null==S||null===(e=S.userInfo)||void 0===e?void 0:e.user_id)||301458===(null==S||null===(n=S.userInfo)||void 0===n?void 0:n.user_id)||null!=S&&null!==(i=S.userInfo)&&void 0!==i&&i.admin||null!=S&&null!==(o=S.userInfo)&&void 0!==o&&o.business?(0,v.jsx)("p",{onClick:function(){return J(""),j(!0),void W(!1)},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"},children:(0,v.jsx)("span",{style:{fontSize:"16px",marginLeft:"5px"},children:"Last updated"})}):null]}),(0,v.jsxs)("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"},children:[F?(0,v.jsx)(y,{UpdateItem:X,setIscreate:j,init:st}):null,H?(0,v.jsx)(x,{UserInfo:null==S?void 0:S.userInfo,setSee:W,userId:null==S||null===(s=S.userInfo)||void 0===s?void 0:s.user_id,ItemUpdate:function(t){J(t),j(!0),W(!1)},CourseItem:U,init:st}):null]})]}),299635===(null==S||null===(c=S.userInfo)||void 0===c?void 0:c.user_id)||301458===(null==S||null===(d=S.userInfo)||void 0===d?void 0:d.user_id)||null!=S&&null!==(f=S.userInfo)&&void 0!==f&&f.admin||null!=S&&null!==(b=S.userInfo)&&void 0!==b&&b.business?(0,v.jsx)(w.Z,a()(a()({},ct),{},{children:(0,v.jsx)(m.ZP,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"},children:"上传首页图片"})})):null]})}))},63741:function(t,e,n){"use strict";n.d(e,{AL:function(){return k},Iy:function(){return p},Qv:function(){return g},ez:function(){return C},jb:function(){return f}});var i=n(79800),r=n.n(i),o=n(32834),a=n.n(o),s=n(11690),l=1;var c=[],u=["<ul>"],h=new(a().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){c.length=0,u=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(t,e,n,i){if(e>=t.length||t[e].level<=n)return e;var r=t[e];i.push("<li><a href='#"+l+r.anchor+"'>"+r.text+"</a>");var o=[];return e=m(t,++e,r.level,o),o.length>0&&(i.push("<ul>"),o.forEach((function(t){i.push(t)})),i.push("</ul>")),i.push("</li>"),e=m(t,e,n,i)}function g(){return m(c,0,0,u),u.push("</ul>"),u.join("")}var v={heading:function(t){var e=d.exec(t);if(l+=1,e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:r()(e,1)[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||""),o=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(o)>=0){var a=x(),s=i;i=a,w[a]={type:"block",expression:s}}return{type:"code",raw:n,lang:o,text:i}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},w={};function C(){return w}function k(){b=0,w={}}function S(t){return t=t.replace(y,(function(t,e){var n=x();return w[n]={type:"inline",expression:e},n}))}var E=h.listitem;h.listitem=function(t){return E(S(t))};var M=h.paragraph;h.paragraph=function(t){return M(S(t))};var T=h.tablecell;h.tablecell=function(t,e){return T(S(t),e)},h.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(t,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(e,'">').concat(n?t:(0,s.escape)(t,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?t:(0,s.escape)(t,!0))+"</code></pre>"},h.heading=function(t,e,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:i,level:e,text:t}),"<h"+e+' id="'+l+i+'">'+t+"</h"+e+">"},a().setOptions({silent:!0,gfm:!0,pedantic:!1}),a().use({tokenizer:v,renderer:h}),e.ZP=a()},45559:function(){},42313:function(){},96408:function(t,e){"use strict";e.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},99498:function(t,e,n){!function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function n(t){e(t);var n=t.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=t.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=t.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),t.display.lineSpace.insertBefore(n,t.display.lineSpace.firstChild)}function i(t){setTimeout((function(){var i=!1,r=t.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==t.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(t):e(t)}),20)}function r(t){a(t)&&n(t)}function o(t){var i=t.getWrapperElement(),r=a(t);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(t):e(t)}function a(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(n,a,s){var l=s&&s!=t.Init;if(a&&!l)n.on("blur",r),n.on("change",o),n.on("swapDoc",o),t.on(n.getInputField(),"compositionupdate",n.state.placeholderCompose=function(){i(n)}),o(n);else if(!a&&l){n.off("blur",r),n.off("change",o),n.off("swapDoc",o),t.off(n.getInputField(),"compositionupdate",n.state.placeholderCompose),e(n);var c=n.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!n.hasFocus()&&r(n)}))}(n(89780))},25717:function(t,e,n){!function(t){var e={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=t.Pos;function i(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,a){a&&a!=t.Init&&(e.removeKeyMap(r),e.state.closeBrackets=null),n&&(o(i(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(r))}));var r={Backspace:l,Enter:c};function o(t){for(var e=0;e<t.length;e++){var n=t.charAt(e),i="'"+n+"'";r[i]||(r[i]=a(n))}}function a(t){return function(e){return h(e,t)}}function s(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(e){var r=s(e);if(!r||e.getOption("disableInput"))return t.Pass;for(var o=i(r,"pairs"),a=e.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return t.Pass;var c=d(e,a[l].head);if(!c||o.indexOf(c)%2!=0)return t.Pass}for(l=a.length-1;l>=0;l--){var u=a[l].head;e.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(e){var n=s(e),r=n&&i(n,"explode");if(!r||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return t.Pass;var l=d(e,o[a].head);if(!l||r.indexOf(l)%2!=0)return t.Pass}e.operation((function(){var t=e.lineSeparator()||"\n";e.replaceSelection(t+t,null),e.execCommand("goCharLeft"),o=e.listSelections();for(var n=0;n<o.length;n++){var i=o[n].head.line;e.indentLine(i,null,!0),e.indentLine(i+1,null,!0)}}))}function u(e){var i=t.cmpPos(e.anchor,e.head)>0;return{anchor:new n(e.anchor.line,e.anchor.ch+(i?-1:1)),head:new n(e.head.line,e.head.ch+(i?1:-1))}}function h(e,r){var o=s(e);if(!o||e.getOption("disableInput"))return t.Pass;var a=i(o,"pairs"),l=a.indexOf(r);if(-1==l)return t.Pass;for(var c,h=i(o,"closeBefore"),d=i(o,"triples"),f=a.charAt(l+1)==r,m=e.listSelections(),g=l%2==0,v=0;v<m.length;v++){var y,b=m[v],x=b.head,w=e.getRange(x,n(x.line,x.ch+1));if(g&&!b.empty())y="surround";else if(!f&&g||w!=r)if(f&&x.ch>1&&d.indexOf(r)>=0&&e.getRange(n(x.line,x.ch-2),x)==r+r){if(x.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(x.line,x.ch-2))))return t.Pass;y="addFour"}else if(f){var C=0==x.ch?" ":e.getRange(n(x.line,x.ch-1),x);if(t.isWordChar(w)||C==r||t.isWordChar(C))return t.Pass;y="both"}else{if(!g||!(0===w.length||/\s/.test(w)||h.indexOf(w)>-1))return t.Pass;y="both"}else y=f&&p(e,x)?"both":d.indexOf(r)>=0&&e.getRange(x,n(x.line,x.ch+3))==r+r+r?"skipThree":"skip";if(c){if(c!=y)return t.Pass}else c=y}var k=l%2?a.charAt(l-1):r,S=l%2?r:a.charAt(l+1);e.operation((function(){if("skip"==c)e.execCommand("goCharRight");else if("skipThree"==c)for(var t=0;t<3;t++)e.execCommand("goCharRight");else if("surround"==c){var n=e.getSelections();for(t=0;t<n.length;t++)n[t]=k+n[t]+S;for(e.replaceSelections(n,"around"),n=e.listSelections().slice(),t=0;t<n.length;t++)n[t]=u(n[t]);e.setSelections(n)}else"both"==c?(e.replaceSelection(k+S,null),e.triggerElectric(k+S),e.execCommand("goCharLeft")):"addFour"==c&&(e.replaceSelection(k+k+k+k,"before"),e.execCommand("goCharRight"))}))}function d(t,e){var i=t.getRange(n(e.line,e.ch-1),n(e.line,e.ch+1));return 2==i.length?i:null}function p(t,e){var i=t.getTokenAt(n(e.line,e.ch+1));return/\bstring/.test(i.type)&&i.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}o(e.pairs+"`")}(n(89780))},6313:function(t,e,n){!function(t){t.defineOption("autoCloseTags",!1,(function(e,n,r){if(r!=t.Init&&r&&e.removeKeyMap("autoCloseTags"),n){var a={name:"autoCloseTags"};"object"==typeof n&&!1===n.whenClosing||(a["'/'"]=function(t){return o(t)}),"object"==typeof n&&!1===n.whenOpening||(a["'>'"]=function(t){return i(t)}),e.addKeyMap(a)}}));var e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function i(i){if(i.getOption("disableInput"))return t.Pass;for(var r=i.listSelections(),o=[],l=i.getOption("autoCloseTags"),c=0;c<r.length;c++){if(!r[c].empty())return t.Pass;var u=r[c].head,h=i.getTokenAt(u),d=t.innerMode(i.getMode(),h.state),p=d.state,f=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(p),m=f&&f.name;if(!m)return t.Pass;var g="html"==d.mode.configuration,v="object"==typeof l&&l.dontCloseTags||g&&e,y="object"==typeof l&&l.indentTags||g&&n;h.end>u.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&f.close||h.string.indexOf("/")==u.ch-h.start-1||v&&a(v,b)>-1||s(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p)||[],m,u,!0))return t.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&a(x,m)>-1)o[c]={text:"/>",newPos:t.Pos(u.line,u.ch+2)};else{var w=y&&a(y,b)>-1;o[c]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?t.Pos(u.line+1,0):t.Pos(u.line,u.ch+1)}}}var C="object"==typeof l&&l.dontIndentOnAutoClose;for(c=r.length-1;c>=0;c--){var k=o[c];i.replaceRange(k.text,r[c].head,r[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!C&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}function r(e,n){for(var i=e.listSelections(),r=[],o=n?"/":"</",a=e.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return t.Pass;var u=i[c].head,h=e.getTokenAt(u),d=t.innerMode(e.getMode(),h.state),p=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return t.Pass;var f,m="xml"!=d.mode.name&&"htmlmixed"==e.getMode().name;if(m&&"javascript"==d.mode.name)f=o+"script";else if(m&&"css"==d.mode.name)f=o+"style";else{var g=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p);if(!g||g.length&&s(e,g,g[g.length-1],u))return t.Pass;f=o+g[g.length-1]}">"!=e.getLine(u.line).charAt(h.end)&&(f+=">"),r[c]=f}if(e.replaceSelections(r),i=e.listSelections(),!l)for(c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&e.indentLine(i[c].head.line)}function o(e){return e.getOption("disableInput")?t.Pass:r(e,!0)}function a(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;++n)if(t[n]==e)return n;return-1}function s(e,n,i,r,o){if(!t.scanForClosingTag)return!1;var a=Math.min(e.lastLine()+1,r.line+500),s=t.scanForClosingTag(e,r,null,a);if(!s||s.tag!=i)return!1;for(var l=o?1:0,c=n.length-1;c>=0&&n[c]==i;c--)++l;for(r=s.to,c=1;c<l;c++){var u=t.scanForClosingTag(e,r,null,a);if(!u||u.tag!=i)return!1;r=u.to}return!0}t.commands.closeTag=function(t){return r(t)}}(n(89780),n(32855))},32855:function(t,e,n){!function(t){"use strict";var e=t.Pos;function n(t,e){return t.line-e.line||t.ch-e.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(t,e,n,i){this.line=e,this.ch=n,this.cm=t,this.text=t.getLine(e),this.min=i?Math.max(i.from,t.firstLine()):t.firstLine(),this.max=i?Math.min(i.to-1,t.lastLine()):t.lastLine()}function a(t,n){var i=t.cm.getTokenTypeAt(e(t.line,n));return i&&/\btag\b/.test(i)}function s(t){if(!(t.line>=t.max))return t.ch=0,t.text=t.cm.getLine(++t.line),!0}function l(t){if(!(t.line<=t.min))return t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0}function c(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(s(t))continue;return}if(a(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,i?"selfClose":"regular"}t.ch=e+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(a(t,e+1)){r.lastIndex=e,t.ch=e;var n=r.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function h(t){for(;;){r.lastIndex=t.ch;var e=r.exec(t.text);if(!e){if(s(t))continue;return}if(a(t,e.index+1))return t.ch=e.index+e[0].length,e;t.ch=e.index+1}}function d(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(a(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,i?"selfClose":"regular"}t.ch=e}}function p(t,n){for(var i=[];;){var r,o=h(t),a=t.line,s=t.ch-(o?o[0].length:0);if(!o||!(r=c(t)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:e(a,s),to:e(t.line,t.ch)}}else i.push(o[2])}}function f(t,n){for(var i=[];;){var r=d(t);if(!r)return;if("selfClose"!=r){var o=t.line,a=t.ch,s=u(t);if(!s)return;if(s[1])i.push(s[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:e(t.line,t.ch),to:e(o,a)}}}else u(t)}}t.registerHelper("fold","xml",(function(t,i){for(var r=new o(t,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var s=c(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=e(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),t.findMatchingTag=function(t,i,r){var a=new o(t,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&e(a.line,a.ch),h=s&&u(a);if(s&&h&&!(n(a,i)>0)){var d={from:e(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:f(a,h[2]),close:d,at:"close"}:{open:d,close:p(a=new o(t,l.line,l.ch,r),h[2]),at:"open"}}}},t.findEnclosingTag=function(t,e,n,i){for(var r=new o(t,e.line,e.ch,n);;){var a=f(r,i);if(!a)break;var s=p(new o(t,e.line,e.ch,n),a.tag);if(s)return{open:a,close:s}}},t.scanForClosingTag=function(t,e,n,i){return p(new o(t,e.line,e.ch,i?{from:0,to:i}:null),n)}}(n(89780))},89780:function(t){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),h=/Opera\//.test(t),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),f=/PhantomJS/.test(t),m=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),g=/Android/.test(t),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),w=h&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==w||w<12.11)),k=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,M=function(t,e){var n=t.className,i=S(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function L(t,e){return T(t).appendChild(e)}function A(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)r.appendChild(e[o]);return r}function D(t,e,n,i){var r=A(t,e,n,i);return r.setAttribute("role","presentation"),r}function P(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do{if(11==e.nodeType&&(e=e.host),e==t)return!0}while(e=e.parentNode)}function N(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function B(t,e){var n=t.className;S(e).test(n)||(t.className+=(n?" ":"")+e)}function _(t,e){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!S(n[i]).test(e)&&(e+=" "+n[i]);return e}E=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(t){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var I=function(t){t.select()};function R(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function O(t,e,n){for(var i in e||(e={}),t)!t.hasOwnProperty(i)||!1===n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e}function F(t,e,n,i,r){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var o=i||0,a=r||0;;){var s=t.indexOf("\t",o);if(s<0||s>=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}m?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function Z(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}j.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},j.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var z=50,H={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},G={origin:"*mouse"},V={origin:"+move"};function U(t,e,n){for(var i=0,r=0;;){var o=t.indexOf("\t",i);-1==o&&(o=t.length);var a=o-i;if(o==t.length||r+a>=e)return i+Math.min(a,e-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=e)return i}}var q=[""];function K(t){for(;q.length<=t;)q.push(Y(q)+" ");return q[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],i=0;i<t.length;i++)n[i]=e(t[i],i);return n}function J(t,e,n){for(var i=0,r=n(e);i<t.length&&n(t[i])<=r;)i++;t.splice(i,0,e)}function Q(){}function $(t,e){var n;return Object.create?n=Object.create(t):(Q.prototype=t,n=new Q),e&&O(e,n),n}var tt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function et(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ot(t){return t.charCodeAt(0)>=768&&rt.test(t)}function at(t,e,n){for(;(n<0?e>0:e<t.length)&&ot(t.charAt(e));)e+=n;return e}function st(t,e,n){for(var i=e>n?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}function lt(t,e,n,i){if(!t)return i(e,n,"ltr",0);for(var r=!1,o=0;o<t.length;++o){var a=t[o];(a.from<n&&a.to>e||e==n&&a.to==e)&&(i(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}var ct=null;function ut(t,e,n){var i;ct=null;for(var r=0;r<t.length;++r){var o=t[r];if(o.from<e&&o.to>e)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:ct=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:ct=r)}return null!=i?i:ct}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!i.test(t))return!1;for(var u=t.length,h=[],d=0;d<u;++d)h.push(n(t.charCodeAt(d)));for(var p=0,f=c;p<u;++p){var m=h[p];"m"==m?h[p]=f:f=m}for(var g=0,v=c;g<u;++g){var y=h[g];"1"==y&&"r"==v?h[g]="n":o.test(y)&&(v=y,"r"==y&&(h[g]="R"))}for(var b=1,x=h[0];b<u-1;++b){var w=h[b];"+"==w&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=w||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=w}for(var C=0;C<u;++C){var k=h[C];if(","==k)h[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<u&&"%"==h[S];++S);for(var E=C&&"!"==h[C-1]||S<u&&"1"==h[S]?"1":"N",M=C;M<S;++M)h[M]=E;C=S-1}}for(var T=0,L=c;T<u;++T){var A=h[T];"L"==L&&"1"==A?h[T]="L":o.test(A)&&(L=A)}for(var D=0;D<u;++D)if(r.test(h[D])){var P=void 0;for(P=D+1;P<u&&r.test(h[P]);++P);for(var N="L"==(D?h[D-1]:c),B=N==("L"==(P<u?h[P]:c))?N?"L":"R":c,_=D;_<P;++_)h[_]=B;D=P-1}for(var I,R=[],O=0;O<u;)if(a.test(h[O])){var F=O;for(++O;O<u&&a.test(h[O]);++O);R.push(new l(0,F,O))}else{var j=O,Z=R.length,z="rtl"==e?1:0;for(++O;O<u&&"L"!=h[O];++O);for(var H=j;H<O;)if(s.test(h[H])){j<H&&(R.splice(Z,0,new l(1,j,H)),Z+=z);var W=H;for(++H;H<O&&s.test(h[H]);++H);R.splice(Z,0,new l(2,W,H)),Z+=z,j=H}else++H;j<O&&R.splice(Z,0,new l(1,j,O))}return"ltr"==e&&(1==R[0].level&&(I=t.match(/^\s+/))&&(R[0].from=I[0].length,R.unshift(new l(0,0,I[0].length))),1==Y(R).level&&(I=t.match(/\s+$/))&&(Y(R).to-=I[0].length,R.push(new l(0,u-I[0].length,u)))),"rtl"==e?R.reverse():R}}();function dt(t,e){var n=t.order;return null==n&&(n=t.order=ht(t.text,e)),n}var pt=[],ft=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var i=t._handlers||(t._handlers={});i[e]=(i[e]||pt).concat(n)}};function mt(t,e){return t._handlers&&t._handlers[e]||pt}function gt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var i=t._handlers,r=i&&i[e];if(r){var o=Z(r,n);o>-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function vt(t,e){var n=mt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function yt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),vt(t,n||e.type,t,e),St(e)||e.codemirrorIgnore}function bt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),i=0;i<e.length;++i)-1==Z(n,e[i])&&n.push(e[i])}function xt(t,e){return mt(t,e).length>0}function wt(t){t.prototype.on=function(t,e){ft(this,t,e)},t.prototype.off=function(t,e){gt(this,t,e)}}function Ct(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Et(t){Ct(t),kt(t)}function Mt(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Lt,At,Dt=function(){if(a&&s<9)return!1;var t=A("div");return"draggable"in t||"dragDrop"in t}();function Pt(t){if(null==Lt){var e=A("span","");L(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Lt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Lt?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=At)return At;var e=L(t,document.createTextNode("AخA")),n=E(e,0,1).getBoundingClientRect(),i=E(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(At=i.right-n.right<3)}var Bt,_t=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Rt="oncopy"in(Bt=A("div"))||(Bt.setAttribute("oncopy","return;"),"function"==typeof Bt.oncopy),Ot=null;function Ft(t){if(null!=Ot)return Ot;var e=L(t,A("span","x")),n=e.getBoundingClientRect(),i=E(e,0,1).getBoundingClientRect();return Ot=Math.abs(n.left-i.left)>1}var jt={},Zt={};function zt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),jt[t]=e}function Ht(t,e){Zt[t]=e}function Wt(t){if("string"==typeof t&&Zt.hasOwnProperty(t))t=Zt[t];else if(t&&"string"==typeof t.name&&Zt.hasOwnProperty(t.name)){var e=Zt[t.name];"string"==typeof e&&(e={name:e}),(t=$(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Wt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Wt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Gt(t,e){e=Wt(e);var n=jt[e.name];if(!n)return Gt(t,"text/plain");var i=n(t,e);if(Vt.hasOwnProperty(e.name)){var r=Vt[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)i[a]=e.modeProps[a];return i}var Vt={};function Ut(t,e){O(e,Vt.hasOwnProperty(t)?Vt[t]:Vt[t]={})}function qt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Kt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Yt(t,e,n){return!t.startState||t.startState(e,n)}var Xt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Jt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e<o){n=r;break}e-=o}return n.lines[e]}function Qt(t,e,n){var i=[],r=e.line;return t.iter(e.line,n.line+1,(function(t){var o=t.text;r==n.line&&(o=o.slice(0,n.ch)),r==e.line&&(o=o.slice(e.ch)),i.push(o),++r})),i}function $t(t,e,n){var i=[];return t.iter(e,n,(function(t){i.push(t.text)})),i}function te(t,e){var n=e-t.height;if(n)for(var i=t;i;i=i.parent)i.height+=n}function ee(t){if(null==t.parent)return null;for(var e=t.parent,n=Z(e.lines,t),i=e.parent;i;e=i,i=i.parent)for(var r=0;i.children[r]!=e;++r)n+=i.children[r].chunkSize();return n+e.first}function ne(t,e){var n=t.first;t:do{for(var i=0;i<t.children.length;++i){var r=t.children[i],o=r.height;if(e<o){t=r;continue t}e-=o,n+=r.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a].height;if(e<s)break;e-=s}return n+a}function ie(t,e){return e>=t.first&&e<t.first+t.size}function re(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function oe(t,e,n){if(void 0===n&&(n=null),!(this instanceof oe))return new oe(t,e,n);this.line=t,this.ch=e,this.sticky=n}function ae(t,e){return t.line-e.line||t.ch-e.ch}function se(t,e){return t.sticky==e.sticky&&0==ae(t,e)}function le(t){return oe(t.line,t.ch)}function ce(t,e){return ae(t,e)<0?e:t}function ue(t,e){return ae(t,e)<0?t:e}function he(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function de(t,e){if(e.line<t.first)return oe(t.first,0);var n=t.first+t.size-1;return e.line>n?oe(n,Jt(t,n).text.length):pe(e,Jt(t,e.line).text.length)}function pe(t,e){var n=t.ch;return null==n||n>e?oe(t.line,e):n<0?oe(t.line,0):t}function fe(t,e){for(var n=[],i=0;i<e.length;i++)n[i]=de(t,e[i]);return n}Xt.prototype.eol=function(){return this.pos>=this.string.length},Xt.prototype.sol=function(){return this.pos==this.lineStart},Xt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xt.prototype.eat=function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t.test?t.test(e):t(e)))return++this.pos,e},Xt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},Xt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Xt.prototype.skipToEnd=function(){this.pos=this.string.length},Xt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Xt.prototype.backUp=function(t){this.pos-=t},Xt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xt.prototype.match=function(t,e,n){if("string"!=typeof t){var i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},Xt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Xt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Xt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var me=function(t,e){this.state=t,this.lookAhead=e},ge=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ve(t,e,n,i){var r=[t.state.modeGen],o={};Me(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=t.state.overlays[i],l=1,c=0;n.state=!0,Me(t,e.text,s.mode,n,(function(t,e){for(var n=l;c<t;){var i=r[l];i>t&&r.splice(l,1,t,r[l+1],i),l+=2,c=Math.min(t,i)}if(e)if(s.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function ye(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var i=be(t,ee(e)),r=e.text.length>t.options.maxHighlightLength&&qt(t.doc.mode,i.state),o=ve(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function be(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new ge(i,!0,e);var o=Te(t,e,n),a=o>i.first&&Jt(i,o-1).stateAfter,s=a?ge.fromSaved(i,a,o):new ge(i,Yt(i.mode),o);return i.iter(o,e,(function(n){xe(t,n.text,s);var i=s.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?s.save():null,s.nextLine()})),n&&(i.modeFrontier=s.line),s}function xe(t,e,n,i){var r=t.doc.mode,o=new Xt(e,t.options.tabSize,n);for(o.start=o.pos=i||0,""==e&&we(r,n.state);!o.eol();)Ce(r,o,n.state),o.start=o.pos}function we(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Kt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ce(t,e,n,i){for(var r=0;r<10;r++){i&&(i[0]=Kt(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ge.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ge.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ge.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ge.fromSaved=function(t,e,n){return e instanceof me?new ge(t,qt(t.mode,e.state),n,e.lookAhead):new ge(t,qt(t.mode,e),n)},ge.prototype.save=function(t){var e=!1!==t?qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(e,this.maxLookAhead):e};var ke=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,i){var r,o,a=t.doc,s=a.mode,l=Jt(a,(e=de(a,e)).line),c=be(t,e.line,n),u=new Xt(l.text,t.options.tabSize,c);for(i&&(o=[]);(i||u.pos<e.ch)&&!u.eol();)u.start=u.pos,r=Ce(s,u,c.state),i&&o.push(new ke(u,r,qt(a.mode,c.state)));return i?o:new ke(u,r,c.state)}function Ee(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==e[i]?e[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[i])||(e[i]+=" "+n[2])}return t}function Me(t,e,n,i,r,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,h=new Xt(e,t.options.tabSize,i),d=t.options.addModeClass&&[null];for(""==e&&Ee(we(n,i.state),o);!h.eol();){if(h.pos>t.options.maxHighlightLength?(s=!1,a&&xe(t,e,i,h.pos),h.pos=e.length,l=null):l=Ee(Ce(n,h,i.state,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<h.start;)r(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var f=Math.min(h.pos,c+5e3);r(f,u),c=f}}function Te(t,e,n){for(var i,r,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Jt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof me?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}function Le(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,i=e-1;i>n;i--){var r=Jt(t,i).stateAfter;if(r&&(!(r instanceof me)||i+r.lookAhead<e)){n=i+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}var Ae=!1,De=!1;function Pe(){Ae=!0}function Ne(){De=!0}function Be(t,e,n){this.marker=t,this.from=e,this.to=n}function _e(t,e){if(t)for(var n=0;n<t.length;++n){var i=t[n];if(i.marker==e)return i}}function Ie(t,e){for(var n,i=0;i<t.length;++i)t[i]!=e&&(n||(n=[])).push(t[i]);return n}function Re(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}function Oe(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e)||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(i||(i=[])).push(new Be(a,o.from,s?null:o.to))}}return i}function Fe(t,e,n){var i;if(t)for(var r=0;r<t.length;++r){var o=t[r],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(i||(i=[])).push(new Be(a,s?null:o.from-e,null==o.to?null:o.to-e))}}return i}function je(t,e){if(e.full)return null;var n=ie(t,e.from.line)&&Jt(t,e.from.line).markedSpans,i=ie(t,e.to.line)&&Jt(t,e.to.line).markedSpans;if(!n&&!i)return null;var r=e.from.ch,o=e.to.ch,a=0==ae(e.from,e.to),s=Oe(n,r,a),l=Fe(i,o,a),c=1==e.text.length,u=Y(e.text).length+(c?r:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var p=_e(l,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=r}}if(l)for(var f=0;f<l.length;++f){var m=l[f];null!=m.to&&(m.to+=u),null==m.from?_e(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Ze(s)),l&&l!=s&&(l=Ze(l));var g=[s];if(!c){var v,y=e.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Be(s[b].marker,null,null));for(var x=0;x<y;++x)g.push(v);g.push(l)}return g}function Ze(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&t.splice(e--,1)}return t.length?t:null}function ze(t,e,n){var i=null;if(t.iter(e.line,n.line+1,(function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||i&&-1!=Z(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:e,to:n}],o=0;o<i.length;++o)for(var a=i[o],s=a.find(0),l=0;l<r.length;++l){var c=r[l];if(!(ae(c.to,s.from)<0||ae(c.from,s.to)>0)){var u=[l,1],h=ae(c.from,s.from),d=ae(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function He(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function We(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Ge(t){return t.inclusiveLeft?-1:0}function Ve(t){return t.inclusiveRight?1:0}function Ue(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var i=t.find(),r=e.find(),o=ae(i.from,r.from)||Ge(t)-Ge(e);if(o)return-o;var a=ae(i.to,r.to)||Ve(t)-Ve(e);return a||e.id-t.id}function qe(t,e){var n,i=De&&t.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(e?r.from:r.to)&&(!n||Ue(n,r.marker)<0)&&(n=r.marker);return n}function Ke(t){return qe(t,!0)}function Ye(t){return qe(t,!1)}function Xe(t,e){var n,i=De&&t.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||Ue(n,o.marker)<0)&&(n=o.marker)}return n}function Je(t,e,n,i,r){var o=Jt(t,e),a=De&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ae(c.from,n)||Ge(l.marker)-Ge(r),h=ae(c.to,i)||Ve(l.marker)-Ve(r);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ae(c.to,n)>=0:ae(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ae(c.from,i)<=0:ae(c.from,i)<0)))return!0}}}function Qe(t){for(var e;e=Ke(t);)t=e.find(-1,!0).line;return t}function $e(t){for(var e;e=Ye(t);)t=e.find(1,!0).line;return t}function tn(t){for(var e,n;e=Ye(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function en(t,e){var n=Jt(t,e),i=Qe(n);return n==i?e:ee(i)}function nn(t,e){if(e>t.lastLine())return e;var n,i=Jt(t,e);if(!rn(t,i))return e;for(;n=Ye(i);)i=n.find(1,!0).line;return ee(i)+1}function rn(t,e){var n=De&&e.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&on(t,e,i))return!0}}function on(t,e,n){if(null==n.to){var i=n.marker.find(1,!0);return on(t,i.line,_e(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var r=void 0,o=0;o<e.markedSpans.length;++o)if((r=e.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(t,e,r))return!0}function an(t){for(var e=0,n=(t=Qe(t)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==t)break;e+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;e+=s.height}return e}function sn(t){if(0==t.height)return 0;for(var e,n=t.text.length,i=t;e=Ke(i);){var r=e.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=t;e=Ye(i);){var o=e.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function ln(t){var e=t.display,n=t.doc;e.maxLine=Jt(n,n.first),e.maxLineLength=sn(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=sn(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var cn=function(t,e,n){this.text=t,We(this,e),this.height=n?n(this):1};function un(t,e,n,i){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),He(t),We(t,n);var r=i?i(t):1;r!=t.height&&te(t,r)}function hn(t){t.parent=null,He(t)}cn.prototype.lineNo=function(){return ee(this)},wt(cn);var dn={},pn={};function fn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?pn:dn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function mn(t,e){var n=D("span",null,null,l?"padding-right: .1px":null),i={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,a=void 0;i.pos=0,i.addToken=vn,Nt(t.display.measure)&&(a=dt(o,t.doc.direction))&&(i.addToken=bn(i.addToken,a)),i.map=[],wn(o,i,ye(t,o,e!=t.display.externalMeasured&&ee(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=_(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=_(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Pt(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=_(i.pre.className,i.textClass||"")),i}function gn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function vn(t,e,n,i,r,o,l){if(e){var c,u=t.splitSpaces?yn(e,t.trailingSpace):e,h=t.cm.state.specialChars,d=!1;if(h.test(e)){c=document.createDocumentFragment();for(var p=0;;){h.lastIndex=p;var f=h.exec(e),m=f?f.index-p:e.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));a&&s<9?c.appendChild(A("span",[g])):c.appendChild(g),t.map.push(t.pos,t.pos+m,g),t.col+=m,t.pos+=m}if(!f)break;p+=m+1;var v=void 0;if("\t"==f[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(v=c.appendChild(A("span",K(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==f[0]||"\n"==f[0]?((v=c.appendChild(A("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),a&&s<9?c.appendChild(A("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||i||r||d||o||l){var x=n||"";i&&(x+=i),r&&(x+=r);var w=A("span",[c],x,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,l[C]);return t.content.appendChild(w)}t.content.appendChild(c)}}function yn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;r<t.length;r++){var o=t.charAt(r);" "!=o||!n||r!=t.length-1&&32!=t.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}function bn(t,e){return function(n,i,r,o,a,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var h=void 0,d=0;d<e.length&&!((h=e[d]).to>c&&h.from<=c);d++);if(h.to>=u)return t(n,i,r,o,a,s,l);t(n,i.slice(0,h.to-c),r,o,null,s,l),o=null,i=i.slice(h.to-c),c=h.to}}}function xn(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var a,s,l,c,u,h,d,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var w=i[x],C=w.marker;if("bookmark"==C.type&&w.from==f&&C.widgetNode)y.push(C);else if(w.from<=f&&(null==w.to||w.to>f||C.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&w.from==f&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var k in C.attributes)(d||(d={}))[k]=C.attributes[k];C.collapsed&&(!h||Ue(h.marker,C)<0)&&(h=w)}else w.from>f&&v>w.from&&(v=w.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!h||h.from==f)for(var E=0;E<y.length;++E)xn(e,0,y[E]);if(h&&(h.from||0)==f){if(xn(e,(null==h.to?p+1:h.to)-f,h.marker,null==h.from),null==h.to)return;h.to==f&&(h=!1)}}if(f>=p)break;for(var M=Math.min(p,v);;){if(g){var T=f+g.length;if(!h){var L=T>M?g.slice(0,M-f):g;e.addToken(e,L,a?a+l:l,u,f+L.length==v?c:"",s,d)}if(T>=M){g=g.slice(M-f),f=M;break}f=T,u=""}g=r.slice(o,o=n[m++]),a=fn(n[m++],e.cm.options)}}else for(var A=1;A<n.length;A+=2)e.addToken(e,r.slice(o,o=n[A]),fn(n[A+1],e.cm.options))}function Cn(t,e,n){this.line=e,this.rest=tn(e),this.size=this.rest?ee(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(t,e)}function kn(t,e,n){for(var i,r=[],o=e;o<n;o=i){var a=new Cn(t.doc,Jt(t.doc,o),o);i=o+a.size,r.push(a)}return r}var Sn=null;function En(t){Sn?Sn.ops.push(t):t.ownsGroup=Sn={ops:[t],delayedCallbacks:[]}}function Mn(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var i=0;i<t.ops.length;i++){var r=t.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<e.length)}function Tn(t,e){var n=t.ownsGroup;if(n)try{Mn(n)}finally{Sn=null,e(n)}}var Ln=null;function An(t,e){var n=mt(t,e);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Sn?i=Sn.delayedCallbacks:Ln?i=Ln:(i=Ln=[],setTimeout(Dn,0));for(var o=function(t){i.push((function(){return n[t].apply(null,r)}))},a=0;a<n.length;++a)o(a)}}function Dn(){var t=Ln;Ln=null;for(var e=0;e<t.length;++e)t[e]()}function Pn(t,e,n,i){for(var r=0;r<e.changes.length;r++){var o=e.changes[r];"text"==o?In(t,e):"gutter"==o?On(t,e,n,i):"class"==o?Rn(t,e):"widget"==o&&Fn(t,e,i)}e.changes=null}function Nn(t){return t.node==t.text&&(t.node=A("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),a&&s<8&&(t.node.style.zIndex=2)),t.node}function Bn(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var i=Nn(e);e.background=i.insertBefore(A("div",null,n),i.firstChild),t.display.input.setUneditable(e.background)}}function _n(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):mn(t,e)}function In(t,e){var n=e.text.className,i=_n(t,e);e.text==e.node&&(e.node=i.pre),e.text.parentNode.replaceChild(i.pre,e.text),e.text=i.pre,i.bgClass!=e.bgClass||i.textClass!=e.textClass?(e.bgClass=i.bgClass,e.textClass=i.textClass,Rn(t,e)):n&&(e.text.className=n)}function Rn(t,e){Bn(t,e),e.line.wrapClass?Nn(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function On(t,e,n,i){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var r=Nn(e);e.gutterBackground=A("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),r.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=Nn(e),s=e.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(t.display.input.setUneditable(s),a.insertBefore(s,e.text),e.line.gutterClass&&(s.className+=" "+e.line.gutterClass),!t.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(e.lineNumber=s.appendChild(A("div",re(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function Fn(t,e,n){e.alignable&&(e.alignable=null);for(var i=S("CodeMirror-linewidget"),r=e.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&e.node.removeChild(r);Zn(t,e,n)}function jn(t,e,n,i){var r=_n(t,e);return e.text=e.node=r.pre,r.bgClass&&(e.bgClass=r.bgClass),r.textClass&&(e.textClass=r.textClass),Rn(t,e),On(t,e,n,i),Zn(t,e,i),e.node}function Zn(t,e,n){if(zn(t,e.line,e,n,!0),e.rest)for(var i=0;i<e.rest.length;i++)zn(t,e.rest[i],e,n,!1)}function zn(t,e,n,i,r){if(e.widgets)for(var o=Nn(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=A("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Hn(l,c,n,i),t.display.input.setUneditable(c),r&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),An(l,"redraw")}}function Hn(t,e,n,i){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var r=i.wrapperWidth;e.style.left=i.fixedPos+"px",t.coverGutter||(r-=i.gutterTotalWidth,e.style.paddingLeft=i.gutterTotalWidth+"px"),e.style.width=r+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-i.gutterTotalWidth+"px"))}function Wn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!P(document.body,t.node)){var n="position: relative;";t.coverGutter&&(n+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(n+="width: "+e.display.wrapper.clientWidth+"px;"),L(e.display.measure,A("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function Gn(t,e){for(var n=Mt(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Vn(t){return t.lineSpace.offsetTop}function Un(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function qn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=L(t.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(t.cachedPaddingH=i),i}function Kn(t){return z-t.display.nativeBarWidth}function Yn(t){return t.display.scroller.clientWidth-Kn(t)-t.display.barWidth}function Xn(t){return t.display.scroller.clientHeight-Kn(t)-t.display.barHeight}function Jn(t,e,n){var i=t.options.lineWrapping,r=i&&Yn(t);if(!e.measure.heights||i&&e.measure.width!=r){var o=e.measure.heights=[];if(i){e.measure.width=r;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var i=0;i<t.rest.length;i++)if(t.rest[i]==e)return{map:t.measure.maps[i],cache:t.measure.caches[i]};for(var r=0;r<t.rest.length;r++)if(ee(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function $n(t,e){var n=ee(e=Qe(e)),i=t.display.externalMeasured=new Cn(t.doc,e,n);i.lineN=n;var r=i.built=mn(t,i);return i.text=r.pre,L(t.display.lineMeasure,r.pre),i}function ti(t,e,n,i){return ii(t,ni(t,e),n,i)}function ei(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Ri(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function ni(t,e){var n=ee(e),i=ei(t,n);i&&!i.text?i=null:i&&i.changes&&(Pn(t,i,n,Pi(t)),t.curOp.forceUpdate=!0),i||(i=$n(t,e));var r=Qn(i,e,n);return{line:e,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ii(t,e,n,i,r){e.before&&(n=-1);var o,a=n+(i||"");return e.cache.hasOwnProperty(a)?o=e.cache[a]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(Jn(t,e.view,e.rect),e.hasHeights=!0),(o=li(t,e,n,i)).bogus||(e.cache[a]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var ri,oi={left:0,right:0,top:0,bottom:0};function ai(t,e,n){for(var i,r,o,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(r=0,o=1,a="left"):e<l?o=1+(r=e-s):(c==t.length-3||e==l&&t[c+3]>e)&&(r=(o=l-s)-1,e>=l&&(a="right")),null!=r){if(i=t[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)i=t[2+(c-=3)],a="left";if("right"==n&&r==l-s)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)i=t[(c+=3)+2],a="right";break}return{node:i,start:r,end:o,collapse:a,coverStart:s,coverEnd:l}}function si(t,e){var n=oi;if("left"==e)for(var i=0;i<t.length&&(n=t[i]).left==n.right;i++);else for(var r=t.length-1;r>=0&&(n=t[r]).left==n.right;r--);return n}function li(t,e,n,i){var r,o=ai(e.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&ot(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&ot(e.line.text.charAt(o.coverStart+u));)++u;if((r=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():si(E(l,c,u).getClientRects(),i)).left||r.right||0==c)break;u=c,c-=1,h="right"}a&&s<11&&(r=ci(t.display.measure,r))}else{var p;c>0&&(h=i="right"),r=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+Di(t.display),top:f.top,bottom:f.bottom}:oi}for(var m=r.top-e.rect.top,g=r.bottom-e.rect.top,v=(m+g)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var x=b?y[b-1]:0,w=y[b],C={left:("right"==h?r.right:r.left)-e.rect.left,right:("left"==h?r.left:r.right)-e.rect.left,top:x,bottom:w};return r.left||r.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g),C}function ci(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ft(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}function ui(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function hi(t){t.display.externalMeasure=null,T(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)ui(t.display.view[e])}function di(t){hi(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function pi(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fi(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mi(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=Wn(t.widgets[n]));return e}function gi(t,e,n,i,r){if(!r){var o=mi(e);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var a=an(e);if("local"==i?a+=Vn(t.display):a-=t.display.viewOffset,"page"==i||"window"==i){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==i?0:fi());var l=s.left+("window"==i?0:pi());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function vi(t,e,n){if("div"==n)return e;var i=e.left,r=e.top;if("page"==n)i-=pi(),r-=fi();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:r-a.top}}function yi(t,e,n,i,r){return i||(i=Jt(t.doc,e.line)),gi(t,i,ti(t,i,e.ch,r),n)}function bi(t,e,n,i,r,o){function a(e,a){var s=ii(t,r,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,gi(t,i,s,n)}i=i||Jt(t.doc,e.line),r||(r=ni(t,i));var s=dt(i,t.doc.direction),l=e.ch,c=e.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var h=ut(s,l,c),d=ct,p=u(l,h,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function xi(t,e){var n=0;e=de(t.doc,e),t.options.lineWrapping||(n=Di(t.display)*e.ch);var i=Jt(t.doc,e.line),r=an(i)+Vn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(t,e,n,i,r){var o=oe(t,e,n);return o.xRel=r,i&&(o.outside=i),o}function Ci(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return wi(i.first,0,null,-1,-1);var r=ne(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Jt(i,o).text.length,null,1,1);e<0&&(e=0);for(var a=Jt(i,r);;){var s=Mi(t,a,r,e,n),l=Xe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Jt(i,r=c.line)}}function ki(t,e,n,i){i-=mi(e);var r=e.text.length,o=st((function(e){return ii(t,n,e-1).bottom<=i}),r,0);return{begin:o,end:r=st((function(e){return ii(t,n,e).top>i}),o,r)}}function Si(t,e,n,i){return n||(n=ni(t,e)),ki(t,e,n,gi(t,e,ii(t,n,i),"line").top)}function Ei(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function Mi(t,e,n,i,r){r-=an(e);var o=ni(t,e),a=mi(e),s=0,l=e.text.length,c=!0,u=dt(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?Li:Ti)(t,e,n,o,u,i,r);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,p,f=null,m=null,g=st((function(e){var n=ii(t,o,e);return n.top+=a,n.bottom+=a,!!Ei(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=e,m=n),!0)}),s,l),v=!1;if(m){var y=i-m.left<m.right-i,b=y==c;g=f+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||g!=l&&g!=s||g++,p=0==g?"after":g==e.text.length?"before":ii(t,o,g-(c?1:0)).bottom+a<=r==c?"after":"before";var x=bi(t,oe(n,g,p),"line",e,o);d=x.left,v=r<x.top?-1:r>=x.bottom?1:0}return wi(n,g=at(e.text,g,1),p,v,i-d)}function Ti(t,e,n,i,r,o,a){var s=st((function(s){var l=r[s],c=1!=l.level;return Ei(bi(t,oe(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=bi(t,oe(n,c?l.from:l.to,c?"after":"before"),"line",e,i);Ei(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function Li(t,e,n,i,r,o,a){var s=ki(t,e,i,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<r.length;d++){var p=r[d];if(!(p.from>=c||p.to<=l)){var f=ii(t,i,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=f<o?o-f+1e9:f-o;(!u||h>m)&&(u=p,h=m)}}return u||(u=r[r.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Ai(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ri){ri=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ri.appendChild(document.createTextNode("x")),ri.appendChild(A("br"));ri.appendChild(document.createTextNode("x"))}L(t.measure,ri);var n=ri.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Di(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");L(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function Pi(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:Ni(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function Ni(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Bi(t){var e=Ai(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/Di(t.display)-3);return function(r){if(rn(t.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a<r.widgets.length;a++)r.widgets[a].height&&(o+=r.widgets[a].height);return n?o+(Math.ceil(r.text.length/i)||1)*e:o+e}}function _i(t){var e=t.doc,n=Bi(t);e.iter((function(t){var e=n(t);e!=t.height&&te(t,e)}))}function Ii(t,e,n,i){var r=t.display;if(!n&&"true"==Mt(e).getAttribute("cm-not-content"))return null;var o,a,s=r.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(t){return null}var l,c=Ci(t,o,a);if(i&&c.xRel>0&&(l=Jt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=oe(c.line,Math.max(0,Math.round((o-qn(t.display).left)/Di(t.display))-u))}return c}function Ri(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;i<n.length;i++)if((e-=n[i].size)<0)return i}function Oi(t,e,n,i){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),i||(i=0);var r=t.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>e)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)De&&en(t.doc,e)<r.viewTo&&ji(t);else if(n<=r.viewFrom)De&&nn(t.doc,n+i)>r.viewFrom?ji(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)ji(t);else if(e<=r.viewFrom){var o=Zi(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):ji(t)}else if(n>=r.viewTo){var a=Zi(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):ji(t)}else{var s=Zi(t,e,e,-1),l=Zi(t,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(kn(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):ji(t)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=i:e<c.lineN+c.size&&(r.externalMeasured=null))}function Fi(t,e,n){t.curOp.viewChanged=!0;var i=t.display,r=t.display.externalMeasured;if(r&&e>=r.lineN&&e<r.lineN+r.size&&(i.externalMeasured=null),!(e<i.viewFrom||e>=i.viewTo)){var o=i.view[Ri(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Z(a,n)&&a.push(n)}}}function ji(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Zi(t,e,n,i){var r,o=Ri(t,e),a=t.display.view;if(!De||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=e){if(i>0){if(o==a.length-1)return null;r=s+a[o].size-e,o++}else r=s-e;e+=r,n+=r}for(;en(t.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function zi(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=kn(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=kn(t,e,i.viewFrom).concat(i.view):i.viewFrom<e&&(i.view=i.view.slice(Ri(t,e))),i.viewFrom=e,i.viewTo<n?i.view=i.view.concat(kn(t,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Ri(t,n)))),i.viewTo=n}function Hi(t){for(var e=t.display.view,n=0,i=0;i<e.length;i++){var r=e[i];r.hidden||r.node&&!r.changes||++n}return n}function Wi(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Gi(t,e){void 0===e&&(e=!0);for(var n=t.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(e||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=t.display.viewTo||s.to().line<t.display.viewFrom)){var l=s.empty();(l||t.options.showCursorWhenSelecting)&&Vi(t,s.head,r),l||qi(t,s,o)}}return i}function Vi(t,e,n){var i=bi(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),r=n.appendChild(A("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px",i.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Ui(t,e){return t.top-e.top||t.left-e.left}function qi(t,e,n){var i=t.display,r=t.doc,o=document.createDocumentFragment(),a=qn(t.display),s=a.left,l=Math.max(i.sizerWidth,Yn(t)-i.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(i-e)+"px"))}function h(e,n,i){var o,a,h=Jt(r,e),d=h.text.length;function p(n,i){return yi(t,oe(e,n),"div",h,i)}function f(e,n,i){var r=Si(t,h,null,e),o="ltr"==n==("after"==i)?"left":"right";return p("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=dt(h,r.direction);return lt(m,n||0,null==i?d:i,(function(t,e,r,h){var g="ltr"==r,v=p(t,g?"left":"right"),y=p(e-1,g?"right":"left"),b=null==n&&0==t,x=null==i&&e==d,w=0==h,C=!m||h==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&C,S=(c?b:x)&&w?s:(g?v:y).left,E=k?l:(g?y:v).right;u(S,v.top,E-S,v.bottom)}else{var M,T,L,A;g?(M=c&&b&&w?s:v.left,T=c?l:f(t,r,"before"),L=c?s:f(e,r,"after"),A=c&&x&&C?l:y.right):(M=c?f(t,r,"before"):s,T=!c&&b&&w?l:v.right,L=!c&&x&&C?s:y.left,A=c?f(e,r,"after"):l),u(M,v.top,T-M,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(L,y.top,A-L,y.bottom)}(!o||Ui(v,o)<0)&&(o=v),Ui(y,o)<0&&(o=y),(!a||Ui(v,a)<0)&&(a=v),Ui(y,a)<0&&(a=y)})),{start:o,end:a}}var d=e.from(),p=e.to();if(d.line==p.line)h(d.line,d.ch,p.ch);else{var f=Jt(r,d.line),m=Jt(r,p.line),g=Qe(f)==Qe(m),v=h(d.line,d.ch,g?f.text.length+1:null).end,y=h(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function Ki(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||Qi(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Yi(t){t.state.focused||(t.display.input.focus(),Ji(t))}function Xi(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Qi(t))}),100)}function Ji(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,B(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Ki(t))}function Qi(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,M(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function $i(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i<e.view.length;i++){var r=e.view[i],o=t.options.lineWrapping,l=void 0,c=0;if(!r.hidden){if(a&&s<8){var u=r.node.offsetTop+r.node.offsetHeight;l=u-n,n=u}else{var h=r.node.getBoundingClientRect();l=h.bottom-h.top,!o&&r.text.firstChild&&(c=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-l;if((d>.005||d<-.005)&&(te(r.line,l),tr(r.line),r.rest))for(var p=0;p<r.rest.length;p++)tr(r.rest[p]);if(c>t.display.sizerWidth){var f=Math.ceil(c/Di(t.display));f>t.display.maxLineLength&&(t.display.maxLineLength=f,t.display.maxLine=r.line,t.display.maxLineChanged=!0)}}}}function tr(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function er(t,e,n){var i=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;i=Math.floor(i-Vn(t));var r=n&&null!=n.bottom?n.bottom:i+t.wrapper.clientHeight,o=ne(e,i),a=ne(e,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=ne(e,an(Jt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(o=ne(e,an(Jt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function nr(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),r=null;if(e.top+i.top<0?r=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=A("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Vn(t.display))+"px;\n height: "+(e.bottom-e.top+Kn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}function ir(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?oe(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?oe(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=bi(t,e),l=n&&n!=e?bi(t,n):s,c=or(t,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(dr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(fr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}function rr(t,e){var n=or(t,e);null!=n.scrollTop&&dr(t,n.scrollTop),null!=n.scrollLeft&&fr(t,n.scrollLeft)}function or(t,e){var n=t.display,i=Ai(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Xn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Un(n),l=e.top<i,c=e.bottom>s-i;if(e.top<r)a.scrollTop=l?0:e.top;else if(e.bottom>r+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=r&&(a.scrollTop=u)}var h=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-h,p=Yn(t)-n.gutters.offsetWidth,f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?a.scrollLeft=0:e.left<d?a.scrollLeft=Math.max(0,e.left+h-(f?0:10)):e.right>p+d-3&&(a.scrollLeft=e.right+(f?0:10)-p),a}function ar(t,e){null!=e&&(ur(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function sr(t){ur(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function lr(t,e,n){null==e&&null==n||ur(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function cr(t,e){ur(t),t.curOp.scrollToPos=e}function ur(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,hr(t,xi(t,e.from),xi(t,e.to),e.margin))}function hr(t,e,n,i){var r=or(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});lr(t,r.scrollLeft,r.scrollTop)}function dr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Wr(t,{top:e}),pr(t,e,!0),n&&Wr(t),Ir(t,100))}function pr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function fr(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,qr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function mr(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Un(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var gr=function(t,e,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),ft(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),ft(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},gr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var t=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},gr.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},gr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var vr=function(){};function yr(t,e){e||(e=mr(t));var n=t.display.barWidth,i=t.display.barHeight;br(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&$i(t),br(t,mr(t)),n=t.display.barWidth,i=t.display.barHeight}function br(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}vr.prototype.update=function(){return{bottom:0,right:0}},vr.prototype.setScrollLeft=function(){},vr.prototype.setScrollTop=function(){},vr.prototype.clear=function(){};var xr={native:gr,null:vr};function wr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new xr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ft(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?fr(t,e):dr(t,e)}),t),t.display.scrollbars.addClass&&B(t.display.wrapper,t.display.scrollbars.addClass)}var Cr=0;function kr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Cr},En(t.curOp)}function Sr(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;Er(t)}))}function Er(t){for(var e=t.ops,n=0;n<e.length;n++)Mr(e[n]);for(var i=0;i<e.length;i++)Tr(e[i]);for(var r=0;r<e.length;r++)Lr(e[r]);for(var o=0;o<e.length;o++)Ar(e[o]);for(var a=0;a<e.length;a++)Dr(e[a])}function Mr(t){var e=t.cm,n=e.display;Fr(e),t.updateMaxLine&&ln(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Or(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Tr(t){t.updatedDisplay=t.mustUpdate&&zr(t.cm,t.update)}function Lr(t){var e=t.cm,n=e.display;t.updatedDisplay&&$i(e),t.barMeasure=mr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=ti(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Yn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Ar(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&fr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==N();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&yr(e,t.barMeasure),t.updatedDisplay&&Ur(e,t.barMeasure),t.selectionChanged&&Ki(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Yi(t.cm)}function Dr(t){var e=t.cm,n=e.display,i=e.doc;t.updatedDisplay&&Hr(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&pr(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&fr(e,t.scrollLeft,!0,!0),t.scrollToPos&&nr(e,ir(e,de(i,t.scrollToPos.from),de(i,t.scrollToPos.to),t.scrollToPos.margin));var r=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(r)for(var a=0;a<r.length;++a)r[a].lines.length||vt(r[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&vt(o[s],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&vt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Pr(t,e){if(t.curOp)return e();kr(t);try{return e()}finally{Sr(t)}}function Nr(t,e){return function(){if(t.curOp)return e.apply(t,arguments);kr(t);try{return e.apply(t,arguments)}finally{Sr(t)}}}function Br(t){return function(){if(this.curOp)return t.apply(this,arguments);kr(this);try{return t.apply(this,arguments)}finally{Sr(this)}}}function _r(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);kr(e);try{return t.apply(this,arguments)}finally{Sr(e)}}}function Ir(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,R(Rr,t))}function Rr(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,i=be(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(i.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?qt(e.mode,i.state):null,l=ve(t,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=t.options.maxHighlightLength&&xe(t,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return Ir(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Pr(t,(function(){for(var e=0;e<r.length;e++)Fi(t,r[e],"text")}))}}var Or=function(t,e,n){var i=t.display;this.viewport=e,this.visible=er(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Yn(t),this.force=n,this.dims=Pi(t),this.events=[]};function Fr(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Kn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Kn(t)+"px",e.scrollbarsClipped=!0)}function jr(t){if(t.hasFocus())return null;var e=N();if(!e||!P(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&P(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function Zr(t){if(t&&t.activeElt&&t.activeElt!=N()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&P(document.body,t.anchorNode)&&P(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}function zr(t,e){var n=t.display,i=t.doc;if(e.editorIsHidden)return ji(t),!1;if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hi(t))return!1;Kr(t)&&(ji(t),e.dims=Pi(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),a=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),De&&(o=en(t.doc,o),a=nn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;zi(t,o,a),n.viewOffset=an(Jt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Hi(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=jr(t);return l>4&&(n.lineDiv.style.display="none"),Gr(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Zr(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ir(t,400)),n.updateLineNumbers=null,!0}function Hr(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Yn(t))i&&(e.visible=er(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Un(t.display)-Xn(t),n.top)}),e.visible=er(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!zr(t,e))break;$i(t);var r=mr(t);Wi(t),yr(t,r),Ur(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Wr(t,e){var n=new Or(t,e);if(zr(t,n)){$i(t),Hr(t,n);var i=mr(t);Wi(t),yr(t,i),Ur(t,i),n.finish()}}function Gr(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=s(a);var p=r&&null!=e&&e<=u&&d.lineNumber;d.changes&&(Z(d.changes,"gutter")>-1&&(p=!1),Pn(t,d,u,n)),p&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(re(t.options,u)))),a=d.node.nextSibling}else{var f=jn(t,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=s(a)}function Vr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Ur(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Kn(t)+"px"}function qr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=Ni(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=i+r+"px")}}function Kr(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=re(t.options,e.first+e.size-1),i=t.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,a=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Vr(t.display),!0}return!1}function Yr(t,e){for(var n=[],i=!1,r=0;r<t.length;r++){var o=t[r],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;i=!0}n.push({className:o,style:a})}return e&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Xr(t){var e=t.gutters,n=t.gutterSpecs;T(e),t.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,a=r.style,s=e.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",Vr(t)}function Jr(t){Xr(t.display),Oi(t),qr(t)}function Qr(t,e,i,r){var o=this;this.input=i,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[c],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yr(r.gutters,r.lineNumbers),Xr(o),i.init(o)}Or.prototype.signal=function(t,e){xt(t,e)&&this.events.push(arguments)},Or.prototype.finish=function(){for(var t=0;t<this.events.length;t++)vt.apply(null,this.events[t])};var $r=0,to=null;function eo(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function no(t){var e=eo(t);return e.x*=to,e.y*=to,e}function io(t,e){var i=eo(e),r=i.x,o=i.y,a=t.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&y&&l)t:for(var d=e.target,p=a.view;d!=s;d=d.parentNode)for(var f=0;f<p.length;f++)if(p[f].node==d){t.display.currentWheelTarget=d;break t}if(r&&!n&&!h&&null!=to)return o&&u&&dr(t,Math.max(0,s.scrollTop+o*to)),fr(t,Math.max(0,s.scrollLeft+r*to)),(!o||o&&u)&&Ct(e),void(a.wheelStartX=null);if(o&&null!=to){var m=o*to,g=t.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(t.doc.height,v+m+50),Wr(t,{top:g,bottom:v})}$r<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=r,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var t=s.scrollLeft-a.wheelStartX,e=s.scrollTop-a.wheelStartY,n=e&&a.wheelDY&&e/a.wheelDY||t&&a.wheelDX&&t/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(to=(to*$r+n)/($r+1),++$r)}}),200)):(a.wheelDX+=r,a.wheelDY+=o))}}a?to=-.53:n?to=15:u?to=-.7:d&&(to=-1/3);var ro=function(t,e){this.ranges=t,this.primIndex=e};ro.prototype.primary=function(){return this.ranges[this.primIndex]},ro.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],i=t.ranges[e];if(!se(n.anchor,i.anchor)||!se(n.head,i.head))return!1}return!0},ro.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new oo(le(this.ranges[e].anchor),le(this.ranges[e].head));return new ro(t,this.primIndex)},ro.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},ro.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(ae(e,i.from())>=0&&ae(t,i.to())<=0)return n}return-1};var oo=function(t,e){this.anchor=t,this.head=e};function ao(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return ae(t.from(),e.from())})),n=Z(e,r);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=ae(s.to(),a.from());if(i&&!a.empty()?l>0:l>=0){var c=ue(s.from(),a.from()),u=ce(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new oo(h?u:c,h?c:u))}}return new ro(e,n)}function so(t,e){return new ro([new oo(t,e||t)],0)}function lo(t){return t.text?oe(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function co(t,e){if(ae(t,e.from)<0)return t;if(ae(t,e.to)<=0)return lo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=lo(e).ch-e.to.ch),oe(n,i)}function uo(t,e){for(var n=[],i=0;i<t.sel.ranges.length;i++){var r=t.sel.ranges[i];n.push(new oo(co(r.anchor,e),co(r.head,e)))}return ao(t.cm,n,t.sel.primIndex)}function ho(t,e,n){return t.line==e.line?oe(n.line,t.ch-e.ch+n.ch):oe(n.line+(t.line-e.line),t.ch)}function po(t,e,n){for(var i=[],r=oe(t.first,0),o=r,a=0;a<e.length;a++){var s=e[a],l=ho(s.from,r,o),c=ho(lo(s),r,o);if(r=s.to,o=c,"around"==n){var u=t.sel.ranges[a],h=ae(u.head,u.anchor)<0;i[a]=new oo(h?c:l,h?l:c)}else i[a]=new oo(l,l)}return new ro(i,t.sel.primIndex)}function fo(t){t.doc.mode=Gt(t.options,t.doc.modeOption),mo(t)}function mo(t){t.doc.iter((function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)})),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,Ir(t,100),t.state.modeGen++,t.curOp&&Oi(t)}function go(t,e){return 0==e.from.ch&&0==e.to.ch&&""==Y(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function vo(t,e,n,i){function r(t){return n?n[t]:null}function o(t,n,r){un(t,n,r,i),An(t,"change",t,e)}function a(t,e){for(var n=[],o=t;o<e;++o)n.push(new cn(c[o],r(o),i));return n}var s=e.from,l=e.to,c=e.text,u=Jt(t,s.line),h=Jt(t,l.line),d=Y(c),p=r(c.length-1),f=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(go(t,e)){var m=a(0,c.length-1);o(h,h.text,p),f&&t.remove(s.line,f),m.length&&t.insert(s.line,m)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),p);else{var g=a(1,c.length-1);g.push(new cn(d+u.text.slice(l.ch),p,i)),o(u,u.text.slice(0,s.ch)+c[0],r(0)),t.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),r(0)),t.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],r(0)),o(h,d+h.text.slice(l.ch),p);var v=a(1,c.length-1);f>1&&t.remove(s.line+1,f-1),t.insert(s.line+1,v)}An(t,"change",t,e)}function yo(t,e,n){function i(t,r,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=r){var l=o&&s.sharedHist;n&&!l||(e(s.doc,l),i(s.doc,t,l))}}}i(t,null,!0)}function bo(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,_i(t),fo(t),xo(t),t.options.lineWrapping||ln(t),t.options.mode=e.modeOption,Oi(t)}function xo(t){("rtl"==t.doc.direction?B:M)(t.display.lineDiv,"CodeMirror-rtl")}function wo(t){Pr(t,(function(){xo(t),Oi(t)}))}function Co(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function ko(t,e){var n={from:le(e.from),to:lo(e),text:Qt(t,e.from,e.to)};return Do(t,n,e.from.line,e.to.line+1),yo(t,(function(t){return Do(t,n,e.from.line,e.to.line+1)}),!0),n}function So(t){for(;t.length&&Y(t).ranges;)t.pop()}function Eo(t,e){return e?(So(t.done),Y(t.done)):t.done.length&&!Y(t.done).ranges?Y(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}function Mo(t,e,n,i){var r=t.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=Eo(r,r.lastOp==i)))a=Y(o.changes),0==ae(e.from,e.to)&&0==ae(e.from,a.to)?a.to=lo(e):o.changes.push(ko(t,e));else{var l=Y(r.done);for(l&&l.ranges||Ao(t.sel,r.done),o={changes:[ko(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,a||vt(t,"historyAdded")}function To(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Lo(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||To(t,o,Y(r.done),e))?r.done[r.done.length-1]=e:Ao(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&So(r.undone)}function Ao(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Do(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Po(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function No(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var i=[],r=0;r<e.text.length;++r)i.push(Po(n[r]));return i}function Bo(t,e){var n=No(t,e),i=je(t,e);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],a=i[r];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else a&&(n[r]=a)}return n}function _o(t,e,n){for(var i=[],r=0;r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?ro.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&Z(e,Number(u[1]))>-1&&(Y(s)[h]=c[h],delete c[h])}}}return i}function Io(t,e,n,i){if(i){var r=t.anchor;if(n){var o=ae(e,r)<0;o!=ae(n,r)<0?(r=e,e=n):o!=ae(e,n)<0&&(e=n)}return new oo(r,e)}return new oo(n||e,e)}function Ro(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Ho(t,new ro([Io(t.sel.primary(),e,n,r)],0),i)}function Oo(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)i[o]=Io(t.sel.ranges[o],e[o],null,r);Ho(t,ao(t.cm,i,t.sel.primIndex),n)}function Fo(t,e,n,i){var r=t.sel.ranges.slice(0);r[e]=n,Ho(t,ao(t.cm,r,t.sel.primIndex),i)}function jo(t,e,n,i){Ho(t,so(e,n),i)}function Zo(t,e,n){var i={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new oo(de(t,e[n].anchor),de(t,e[n].head))},origin:n&&n.origin};return vt(t,"beforeSelectionChange",t,i),t.cm&&vt(t.cm,"beforeSelectionChange",t.cm,i),i.ranges!=e.ranges?ao(t.cm,i.ranges,i.ranges.length-1):e}function zo(t,e,n){var i=t.history.done,r=Y(i);r&&r.ranges?(i[i.length-1]=e,Wo(t,e,n)):Ho(t,e,n)}function Ho(t,e,n){Wo(t,e,n),Lo(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Wo(t,e,n){(xt(t,"beforeSelectionChange")||t.cm&&xt(t.cm,"beforeSelectionChange"))&&(e=Zo(t,e,n));var i=n&&n.bias||(ae(e.primary().head,t.sel.primary().head)<0?-1:1);Go(t,Uo(t,e,i,!0)),n&&!1===n.scroll||!t.cm||sr(t.cm)}function Go(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,bt(t.cm)),An(t,"cursorActivity",t))}function Vo(t){Go(t,Uo(t,t.sel,null,!1))}function Uo(t,e,n,i){for(var r,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=Ko(t,a.anchor,s&&s.anchor,n,i),c=Ko(t,a.head,s&&s.head,n,i);(r||l!=a.anchor||c!=a.head)&&(r||(r=e.ranges.slice(0,o)),r[o]=new oo(l,c))}return r?ao(t.cm,r,e.primIndex):e}function qo(t,e,n,i,r){var o=Jt(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(r&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=Yo(t,h,-i,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(d=ae(h,n))&&(i<0?d<0:d>0))return qo(t,h,e,i,r)}var p=l.find(i<0?-1:1);return(i<0?c:u)&&(p=Yo(t,p,i,p.line==e.line?o:null)),p?qo(t,p,e,i,r):null}}return e}function Ko(t,e,n,i,r){var o=i||1,a=qo(t,e,n,o,r)||!r&&qo(t,e,n,o,!0)||qo(t,e,n,-o,r)||!r&&qo(t,e,n,-o,!0);return a||(t.cantEdit=!0,oe(t.first,0))}function Yo(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?de(t,oe(e.line-1)):null:n>0&&e.ch==(i||Jt(t,e.line)).text.length?e.line<t.first+t.size-1?oe(e.line+1,0):null:new oe(e.line,e.ch+n)}function Xo(t){t.setSelection(oe(t.firstLine(),0),oe(t.lastLine()),W)}function Jo(t,e,n){var i={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(e,n,r,o){e&&(i.from=de(t,e)),n&&(i.to=de(t,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),vt(t,"beforeChange",t,i),t.cm&&vt(t.cm,"beforeChange",t.cm,i),i.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Qo(t,e,n){if(t.cm){if(!t.cm.curOp)return Nr(t.cm,Qo)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(xt(t,"beforeChange")||t.cm&&xt(t.cm,"beforeChange"))||(e=Jo(t,e,!0))){var i=Ae&&!n&&ze(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)$o(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else $o(t,e)}}function $o(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ae(e.from,e.to)){var n=uo(t,e);Mo(t,e,n,t.cm?t.cm.curOp.id:NaN),na(t,e,n,je(t,e));var i=[];yo(t,(function(t,n){n||-1!=Z(i,t.history)||(sa(t.history,e),i.push(t.history)),na(t,e,null,je(t,e))}))}}function ta(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c<s.length&&(r=s[c],n?!r.ranges||r.equals(t.sel):r.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=s.pop()).ranges){if(i)return void s.push(r);break}if(Ao(r,l),n&&!r.equals(t.sel))return void Ho(t,r,{clearRedo:!1});a=r}var u=[];Ao(a,l),l.push({changes:u,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=xt(t,"beforeChange")||t.cm&&xt(t.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=e,h&&!Jo(t,i,!1))return s.length=0,{};u.push(ko(t,i));var o=n?uo(t,i):Y(s);na(t,i,o,Bo(t,i)),!n&&t.cm&&t.cm.scrollIntoView({from:i.from,to:lo(i)});var a=[];yo(t,(function(t,e){e||-1!=Z(a,t.history)||(sa(t.history,i),a.push(t.history)),na(t,i,null,Bo(t,i))}))},p=r.changes.length-1;p>=0;--p){var f=d(p);if(f)return f.v}}}}function ea(t,e){if(0!=e&&(t.first+=e,t.sel=new ro(X(t.sel.ranges,(function(t){return new oo(oe(t.anchor.line+e,t.anchor.ch),oe(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Oi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;i<n.viewTo;i++)Fi(t.cm,i,"gutter")}}function na(t,e,n,i){if(t.cm&&!t.cm.curOp)return Nr(t.cm,na)(t,e,n,i);if(e.to.line<t.first)ea(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var r=e.text.length-1-(t.first-e.from.line);ea(t,r),e={from:oe(t.first,0),to:oe(e.to.line+r,e.to.ch),text:[Y(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:oe(o,Jt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Qt(t,e.from,e.to),n||(n=uo(t,e)),t.cm?ia(t.cm,e,i):vo(t,e,i),Wo(t,n,W),t.cantEdit&&Ko(t,oe(t.firstLine(),0))&&(t.cantEdit=!1)}}function ia(t,e,n){var i=t.doc,r=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ee(Qe(Jt(i,o.line))),i.iter(l,a.line+1,(function(t){if(t==r.maxLine)return s=!0,!0}))),i.sel.contains(e.from,e.to)>-1&&bt(t),vo(i,e,n,Bi(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),Le(i,o.line),Ir(t,400);var c=e.text.length-(a.line-o.line)-1;e.full?Oi(t):o.line!=a.line||1!=e.text.length||go(t.doc,e)?Oi(t,o.line,a.line+1,c):Fi(t,o.line,"text");var u=xt(t,"changes"),h=xt(t,"change");if(h||u){var d={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};h&&An(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function ra(t,e,n,i,r){var o;i||(i=n),ae(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Qo(t,{from:n,to:i,text:e,origin:r})}function oa(t,e,n,i){n<t.line?t.line+=i:e<t.line&&(t.line=e,t.ch=0)}function aa(t,e,n,i){for(var r=0;r<t.length;++r){var o=t[r],a=!0;if(o.ranges){o.copied||((o=t[r]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)oa(o.ranges[s].anchor,e,n,i),oa(o.ranges[s].head,e,n,i)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=oe(c.from.line+i,c.from.ch),c.to=oe(c.to.line+i,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,r+1),r=0)}}}function sa(t,e){var n=e.from.line,i=e.to.line,r=e.text.length-(i-n)-1;aa(t.done,n,i,r),aa(t.undone,n,i,r)}function la(t,e,n,i){var r=e,o=e;return"number"==typeof e?o=Jt(t,he(t,e)):r=ee(e),null==r?null:(i(o,r)&&t.cm&&Fi(t.cm,r,n),o)}function ca(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function ua(t){this.children=t;for(var e=0,n=0,i=0;i<t.length;++i){var r=t[i];e+=r.chunkSize(),n+=r.height,r.parent=this}this.size=e,this.height=n,this.parent=null}oo.prototype.from=function(){return ue(this.anchor,this.head)},oo.prototype.to=function(){return ce(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,i=t+e;n<i;++n){var r=this.lines[n];this.height-=r.height,hn(r),An(r,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var i=0;i<e.length;++i)e[i].parent=this},iterN:function(t,e,n){for(var i=t+e;t<i;++t)if(n(this.lines[t]))return!0}},ua.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(t<r){var o=Math.min(e,r-t),a=i.height;if(i.removeInner(t,o),this.height-=a-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(e-=o))break;t=0}else t-=r}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(t<=o){if(r.insertInner(t,e,n),r.lines&&r.lines.length>50){for(var a=r.lines.length%25+25,s=a;s<r.lines.length;){var l=new ca(r.lines.slice(s,s+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,a),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new ua(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=Z(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var i=new ua(t.children);i.parent=t,t.children=[i,e],t=i}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(t<o){var a=Math.min(e,o-t);if(r.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var ha=function(t,e,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=t,this.node=e};function da(t,e,n){an(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&ar(t,n)}function pa(t,e,n,i){var r=new ha(t,n,i),o=t.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),la(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=e,o&&!rn(t,e)){var i=an(e)<t.scrollTop;te(e,e.height+Wn(r)),i&&ar(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&An(o,"lineWidgetAdded",o,r,"number"==typeof e?e:ee(e)),r}ha.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,i=ee(n);if(null!=i&&e){for(var r=0;r<e.length;++r)e[r]==this&&e.splice(r--,1);e.length||(n.widgets=null);var o=Wn(this);te(n,Math.max(0,n.height-o)),t&&(Pr(t,(function(){da(t,n,-o),Fi(t,i,"widget")})),An(t,"lineWidgetCleared",t,this,i))}},ha.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Wn(this)-e;r&&(rn(this.doc,i)||te(i,i.height+r),n&&Pr(n,(function(){n.curOp.forceUpdate=!0,da(n,i,r),An(n,"lineWidgetChanged",n,t,ee(i))})))},wt(ha);var fa=0,ma=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++fa};function ga(t,e,n,i,r){if(i&&i.shared)return ya(t,e,n,i,r);if(t.cm&&!t.cm.curOp)return Nr(t.cm,ga)(t,e,n,i,r);var o=new ma(t,r),a=ae(e,n);if(i&&O(i,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Je(t,e.line,e,n,o)||e.line!=n.line&&Je(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ne()}o.addToHistory&&Mo(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(t){c&&o.collapsed&&!c.options.lineWrapping&&Qe(t)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&te(t,0),Re(t,new Be(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){rn(t,e)&&te(e,0)})),o.clearOnEnter&&ft(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Pe(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Oi(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)Fi(c,u,"text");o.atomic&&Vo(c.doc),An(c,"markerAdded",c,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&kr(t),xt(this,"clear")){var n=this.find();n&&An(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=_e(a.markedSpans,this);t&&!this.collapsed?Fi(t,ee(a),"text"):t&&(null!=s.to&&(r=ee(a)),null!=s.from&&(i=ee(a))),a.markedSpans=Ie(a.markedSpans,s),null==s.from&&this.collapsed&&!rn(this.doc,a)&&t&&te(a,Ai(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Qe(this.lines[l]),u=sn(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&Oi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Vo(t.doc)),t&&An(t,"markerCleared",t,this,i,r),e&&Sr(t),this.parent&&this.parent.clear()}},ma.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],a=_e(o.markedSpans,this);if(null!=a.from&&(n=oe(e?o:ee(o),a.from),-1==t))return n;if(null!=a.to&&(i=oe(e?o:ee(o),a.to),1==t))return i}return n&&{from:n,to:i}},ma.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,i=this.doc.cm;e&&i&&Pr(i,(function(){var r=e.line,o=ee(e.line),a=ei(i,o);if(a&&(ui(a),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!rn(n.doc,r)&&null!=n.height){var s=n.height;n.height=null;var l=Wn(n)-s;l&&te(r,r.height+l)}An(i,"markerChanged",i,t)}))},ma.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=Z(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},ma.prototype.detachLine=function(t){if(this.lines.splice(Z(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},wt(ma);var va=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function ya(t,e,n,i,r){(i=O(i)).shared=!1;var o=[ga(t,e,n,i,r)],a=o[0],s=i.widgetNode;return yo(t,(function(t){s&&(i.widgetNode=s.cloneNode(!0)),o.push(ga(t,de(t,e),de(t,n),i,r));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=Y(o)})),new va(o,a)}function ba(t){return t.findMarks(oe(t.first,0),t.clipPos(oe(t.lastLine())),(function(t){return t.parent}))}function xa(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=i.find(),o=t.clipPos(r.from),a=t.clipPos(r.to);if(ae(o,a)){var s=ga(t,o,a,i.primary,i.primary.type);i.markers.push(s),s.parent=i}}}function wa(t){for(var e=function(e){var n=t[e],i=[n.primary.doc];yo(n.primary.doc,(function(t){return i.push(t)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==Z(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<t.length;n++)e(n)}va.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();An(this,"clear")}},va.prototype.find=function(t,e){return this.primary.find(t,e)},wt(va);var Ca=0,ka=function(t,e,n,i,r){if(!(this instanceof ka))return new ka(t,e,n,i,r);null==n&&(n=0),ua.call(this,[new ca([new cn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=oe(n,0);this.sel=so(o),this.history=new Co(null),this.id=++Ca,this.modeOption=e,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),vo(this,{from:o,to:o,text:t}),Ho(this,so(o),W)};ka.prototype=$(ua.prototype,{constructor:ka,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,i=0;i<e.length;++i)n+=e[i].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=$t(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:_r((function(t){var e=oe(this.first,0),n=this.first+this.size-1;Qo(this,{from:e,to:oe(n,Jt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&lr(this.cm,0,0),Ho(this,so(e),W)})),replaceRange:function(t,e,n,i){ra(this,t,e=de(this,e),n=n?de(this,n):e,i)},getRange:function(t,e,n){var i=Qt(this,de(this,t),de(this,e));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(ie(this,t))return Jt(this,t)},getLineNumber:function(t){return ee(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Jt(this,t)),Qe(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return de(this,t)},getCursor:function(t){var e=this.sel.primary();return null==t||"head"==t?e.head:"anchor"==t?e.anchor:"end"==t||"to"==t||!1===t?e.to():e.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_r((function(t,e,n){jo(this,de(this,"number"==typeof t?oe(t,e||0):t),null,n)})),setSelection:_r((function(t,e,n){jo(this,de(this,t),de(this,e||t),n)})),extendSelection:_r((function(t,e,n){Ro(this,de(this,t),e&&de(this,e),n)})),extendSelections:_r((function(t,e){Oo(this,fe(this,t),e)})),extendSelectionsBy:_r((function(t,e){Oo(this,fe(this,X(this.sel.ranges,t)),e)})),setSelections:_r((function(t,e,n){if(t.length){for(var i=[],r=0;r<t.length;r++)i[r]=new oo(de(this,t[r].anchor),de(this,t[r].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Ho(this,ao(this.cm,i,e),n)}})),addSelection:_r((function(t,e,n){var i=this.sel.ranges.slice(0);i.push(new oo(de(this,t),de(this,e||t))),Ho(this,ao(this.cm,i,i.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,i=0;i<n.length;i++){var r=Qt(this,n[i].from(),n[i].to());e=e?e.concat(r):r}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Qt(this,n[i].from(),n[i].to());!1!==t&&(r=r.join(t||this.lineSeparator())),e[i]=r}return e},replaceSelection:function(t,e,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=t;this.replaceSelections(i,e,n||"+input")},replaceSelections:_r((function(t,e,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var a=r.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(t[o]),origin:n}}for(var s=e&&"end"!=e&&po(this,i,e),l=i.length-1;l>=0;l--)Qo(this,i[l]);s?zo(this,s):this.cm&&sr(this.cm)})),undo:_r((function(){ta(this,"undo")})),redo:_r((function(){ta(this,"redo")})),undoSelection:_r((function(){ta(this,"undo",!0)})),redoSelection:_r((function(){ta(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i<t.done.length;i++)t.done[i].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Co(this.history.maxGeneration),yo(this,(function(e){return e.history=t.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:_o(this.history.done),undone:_o(this.history.undone)}},setHistory:function(t){var e=this.history=new Co(this.history.maxGeneration);e.done=_o(t.done.slice(0),null,!0),e.undone=_o(t.undone.slice(0),null,!0)},setGutterMarker:_r((function(t,e,n){return la(this,t,"gutter",(function(t){var i=t.gutterMarkers||(t.gutterMarkers={});return i[e]=n,!n&&it(i)&&(t.gutterMarkers=null),!0}))})),clearGutter:_r((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&la(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,it(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!ie(this,t))return null;if(e=t,!(t=Jt(this,t)))return null}else if(null==(e=ee(t)))return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:_r((function(t,e,n){return la(this,t,"gutter"==e?"gutter":"class",(function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[i]){if(S(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0}))})),removeLineClass:_r((function(t,e,n){return la(this,t,"gutter"==e?"gutter":"class",(function(t){var i="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",r=t[i];if(!r)return!1;if(null==n)t[i]=null;else{var o=r.match(S(n));if(!o)return!1;var a=o.index+o[0].length;t[i]=r.slice(0,o.index)+(o.index&&a!=r.length?" ":"")+r.slice(a)||null}return!0}))})),addLineWidget:_r((function(t,e,n){return pa(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return ga(this,de(this,t),de(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return ga(this,t=de(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Jt(this,(t=de(this,t)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=t.ch)&&(null==r.to||r.to>=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=de(this,t),e=de(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&r==t.line&&t.ch>=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&t.push(n[i].marker)})),t},posFromIndex:function(t){var e,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>t)return e=t,!0;t-=o,++n})),de(this,oe(n,e))},indexFromPos:function(t){var e=(t=de(this,t)).ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,(function(t){e+=t.text.length+n})),e},copy:function(t){var e=new ka($t(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var i=new ka($t(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:t.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],xa(i,ba(this)),i},unlinkDoc:function(t){if(t instanceof Os&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e)if(this.linked[e].doc==t){this.linked.splice(e,1),t.unlinkDoc(this),wa(ba(this));break}if(t.history==this.history){var n=[t.id];yo(t,(function(t){return n.push(t.id)}),!0),t.history=new Co(null),t.history.done=_o(this.history.done,n),t.history.undone=_o(this.history.undone,n)}},iterLinkedDocs:function(t){yo(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):_t(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:_r((function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&wo(this.cm))}))}),ka.prototype.eachLine=ka.prototype.iter;var Sa=0;function Ea(t){var e=this;if(La(e),!yt(e,t)&&!Gn(e.display,t)){Ct(t),a&&(Sa=+new Date);var n=Ii(e,t,!0),i=t.dataTransfer.files;if(n&&!e.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),s=0,l=function(){++s==r&&Nr(e,(function(){var t={from:n=de(e.doc,n),to:n,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};Qo(e.doc,t),zo(e.doc,so(de(e.doc,n),de(e.doc,lo(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==Z(e.options.allowDropFileTypes,t.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var t=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[n]=t),l()},i.readAsText(t)}},u=0;u<i.length;u++)c(i[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),Wo(e.doc,so(n,n)),d)for(var p=0;p<d.length;++p)ra(e.doc,"",d[p].anchor,d[p].head,"drag");e.replaceSelection(h,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Ma(t,e){if(a&&(!t.state.draggingText||+new Date-Sa<100))Et(e);else if(!yt(t,e)&&!Gn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Ta(t,e){var n=Ii(t,e);if(n){var i=document.createDocumentFragment();Vi(t,n,i),t.display.dragCursor||(t.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),L(t.display.dragCursor,i)}}function La(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Aa(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<e.length;i++){var r=e[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Da=!1;function Pa(){Da||(Na(),Da=!0)}function Na(){var t;ft(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Aa(Ba)}),100))})),ft(window,"blur",(function(){return Aa(Qi)}))}function Ba(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var _a={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ia=0;Ia<10;Ia++)_a[Ia+48]=_a[Ia+96]=String(Ia);for(var Ra=65;Ra<=90;Ra++)_a[Ra]=String.fromCharCode(Ra);for(var Oa=1;Oa<=12;Oa++)_a[Oa+111]=_a[Oa+63235]="F"+Oa;var Fa={};function ja(t){var e,n,i,r,o=t.split(/-(?!$)/);t=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),r&&(t="Cmd-"+t),i&&(t="Shift-"+t),t}function Za(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete t[n];continue}for(var r=X(n.split(" "),ja),o=0;o<r.length;o++){var a=void 0,s=void 0;o==r.length-1?(s=r.join(" "),a=i):(s=r.slice(0,o+1).join(" "),a="...");var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var c in e)t[c]=e[c];return t}function za(t,e,n,i){var r=(e=Va(e)).call?e.call(t,i):e[t];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return za(t,e.fallthrough,n,i);for(var o=0;o<e.fallthrough.length;o++){var a=za(t,e.fallthrough[o],n,i);if(a)return a}}}function Ha(t){var e="string"==typeof t?t:_a[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Wa(t,e,n){var i=t;return e.altKey&&"Alt"!=i&&(t="Alt-"+t),(C?e.metaKey:e.ctrlKey)&&"Ctrl"!=i&&(t="Ctrl-"+t),(C?e.ctrlKey:e.metaKey)&&"Mod"!=i&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=i&&(t="Shift-"+t),t}function Ga(t,e){if(h&&34==t.keyCode&&t.char)return!1;var n=_a[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Wa(n,t,e))}function Va(t){return"string"==typeof t?Fa[t]:t}function Ua(t,e){for(var n=t.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=e(n[r]);i.length&&ae(o.from,Y(i).to)<=0;){var a=i.pop();if(ae(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Pr(t,(function(){for(var e=i.length-1;e>=0;e--)ra(t.doc,"",i[e].from,i[e].to,"+delete");sr(t)}))}function qa(t,e,n){var i=at(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Ka(t,e,n){var i=qa(t,e.ch,n);return null==i?null:new oe(e.line,i,n<0?"after":"before")}function Ya(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var o=dt(n,e.doc.direction);if(o){var a,s=r<0?Y(o):o[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=ni(e,n);a=r<0?n.text.length-1:0;var u=ii(e,c,a).top;a=st((function(t){return ii(e,c,t).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=r<0?s.to:s.from;return new oe(i,a,l)}}return new oe(i,r<0?n.text.length:0,r<0?"before":"after")}function Xa(t,e,n,i){var r=dt(e,t.doc.direction);if(!r)return Ka(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ut(r,n.ch,n.sticky),a=r[o];if("ltr"==t.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from<n.ch))return Ka(e,n,i);var s,l=function(t,n){return qa(e,t instanceof oe?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||ni(t,e),Si(t,e,s,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==a.level){var h=1==a.level==i<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=h?"before":"after";return new oe(n.line,d,p)}}var f=function(t,e,i){for(var o=function(t,e){return e?new oe(n.line,l(t,1),"before"):new oe(n.line,t,"after")};t>=0&&t<r.length;t+=e){var a=r[t],s=e>0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),i.begin<=c&&c<i.end)return o(c,s)}},m=f(o+i,i,u);if(m)return m;var g=i>0?u.end:l(u.begin,-1);return null==g||i>0&&g==e.text.length||!(m=f(i>0?0:r.length-1,i,c(g)))?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa.default=y?Fa.macDefault:Fa.pcDefault;var Ja={selectAll:Xo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),W)},killLine:function(t){return Ua(t,(function(e){if(e.empty()){var n=Jt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:oe(e.head.line+1,0)}:{from:e.head,to:oe(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Ua(t,(function(e){return{from:oe(e.from().line,0),to:de(t.doc,oe(e.to().line+1,0))}}))},delLineLeft:function(t){return Ua(t,(function(t){return{from:oe(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Ua(t,(function(e){var n=t.charCoords(e.head,"div").top+5;return{from:t.coordsChar({left:0,top:n},"div"),to:e.from()}}))},delWrappedLineRight:function(t){return Ua(t,(function(e){var n=t.charCoords(e.head,"div").top+5,i=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:i}}))},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(oe(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(oe(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return Qa(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ts(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return $a(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,i=t.coordsChar({left:0,top:n},"div");return i.ch<t.getLine(i.line).search(/\S/)?ts(t,e.head):i}),V)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),i=t.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),a=F(t.getLine(o.line),o.ch,i);e.push(K(i-a%i))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Pr(t,(function(){for(var e=t.listSelections(),n=[],i=0;i<e.length;i++)if(e[i].empty()){var r=e[i].head,o=Jt(t.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new oe(r.line,r.ch-1)),r.ch>0)r=new oe(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),oe(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=Jt(t.doc,r.line-1).text;a&&(r=new oe(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),oe(r.line-1,a.length-1),r,"+transpose"))}n.push(new oo(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Pr(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i<e.length;i++)t.indentLine(e[i].from().line,null,!0);sr(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Qa(t,e){var n=Jt(t.doc,e),i=Qe(n);return i!=n&&(e=ee(i)),Ya(!0,t,i,e,1)}function $a(t,e){var n=Jt(t.doc,e),i=$e(n);return i!=n&&(e=ee(i)),Ya(!0,t,n,e,-1)}function ts(t,e){var n=Qa(t,e.line),i=Jt(t.doc,n.line),r=dt(i,t.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return oe(n.line,a?0:o,n.sticky)}return n}function es(t,e,n){if("string"==typeof e&&!(e=Ja[e]))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=H}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}function ns(t,e,n){for(var i=0;i<t.state.keyMaps.length;i++){var r=za(e,t.state.keyMaps[i],n,t);if(r)return r}return t.options.extraKeys&&za(e,t.options.extraKeys,n,t)||za(e,t.options.keyMap,n,t)}var is=new j;function rs(t,e,n,i){var r=t.state.keySeq;if(r){if(Ha(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:is.set(50,(function(){t.state.keySeq==r&&(t.state.keySeq=null,t.display.input.reset())})),os(t,r+" "+e,n,i))return!0}return os(t,e,n,i)}function os(t,e,n,i){var r=ns(t,e,i);return"multi"==r&&(t.state.keySeq=e),"handled"==r&&An(t,"keyHandled",t,e,n),"handled"!=r&&"multi"!=r||(Ct(n),Ki(t)),!!r}function as(t,e){var n=Ga(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?rs(t,"Shift-"+n,e,(function(e){return es(t,e,!0)}))||rs(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return es(t,e)})):rs(t,n,e,(function(e){return es(t,e)})))}function ss(t,e,n){return rs(t,"'"+n+"'",e,(function(e){return es(t,e,!0)}))}var ls=null;function cs(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=N(),yt(e,t)))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var i=t.keyCode;e.display.shift=16==i||t.shiftKey;var r=as(e,t);h&&(ls=r?i:null,r||88!=i||Rt||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||us(e)}}function us(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(M(e,"CodeMirror-crosshair"),gt(document,"keyup",n),gt(document,"mouseover",n))}B(e,"CodeMirror-crosshair"),ft(document,"keyup",n),ft(document,"mouseover",n)}function hs(t){16==t.keyCode&&(this.doc.sel.shift=!1),yt(this,t)}function ds(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||Gn(e.display,t)||yt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,i=t.charCode;if(h&&n==ls)return ls=null,void Ct(t);if(!h||t.which&&!(t.which<10)||!as(e,t)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(ss(e,t,r)||e.display.input.onKeyPress(t))}}}var ps,fs,ms=400,gs=function(t,e,n){this.time=t,this.pos=e,this.button=n};function vs(t,e){var n=+new Date;return fs&&fs.compare(n,t,e)?(ps=fs=null,"triple"):ps&&ps.compare(n,t,e)?(fs=new gs(n,t,e),ps=null,"double"):(ps=new gs(n,t,e),fs=null,"single")}function ys(t){var e=this,n=e.display;if(!(yt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,Gn(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ts(e,t)){var i=Ii(e,t),r=Tt(t),o=i?vs(i,r):"single";window.focus(),1==r&&e.state.selectingText&&e.state.selectingText(t),i&&bs(e,r,i,o,t)||(1==r?i?ws(e,i,o,t):Mt(t)==n.scroller&&Ct(t):2==r?(i&&Ro(e.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?e.display.input.onContextMenu(t):Xi(e)))}}function bs(t,e,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),rs(t,Wa(o=(1==e?"Left":2==e?"Middle":"Right")+o,r),r,(function(e){if("string"==typeof e&&(e=Ja[e]),!e)return!1;var i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),i=e(t,n)!=H}finally{t.state.suppressEdits=!1}return i}))}function xs(t,e,n){var i=t.getOption("configureMouse"),r=i?i(t,e,n):{};if(null==r.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==r.extend||t.doc.extend)&&(r.extend=t.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}function ws(t,e,n,i){a?setTimeout(R(Yi,t),0):t.curOp.focus=N();var r,o=xs(t,n,i),s=t.doc.sel;t.options.dragDrop&&Dt&&!t.isReadOnly()&&"single"==n&&(r=s.contains(e))>-1&&(ae((r=s.ranges[r]).from(),e)<0||e.xRel>0)&&(ae(r.to(),e)>0||e.xRel<0)?Cs(t,i,e,o):Ss(t,i,e,o)}function Cs(t,e,n,i){var r=t.display,o=!1,c=Nr(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,gt(r.wrapper.ownerDocument,"mouseup",c),gt(r.wrapper.ownerDocument,"mousemove",u),gt(r.scroller,"dragstart",h),gt(r.scroller,"drop",c),o||(Ct(e),i.addNew||Ro(t.doc,n,null,null,i.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ft(r.wrapper.ownerDocument,"mouseup",c),ft(r.wrapper.ownerDocument,"mousemove",u),ft(r.scroller,"dragstart",h),ft(r.scroller,"drop",c),Xi(t),setTimeout((function(){return r.input.focus()}),20)}function ks(t,e,n){if("char"==n)return new oo(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new oo(oe(e.line,0),de(t.doc,oe(e.line+1,0)));var i=n(t,e);return new oo(i.from,i.to)}function Ss(t,e,n,i){var r=t.display,o=t.doc;Ct(e);var a,s,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new oo(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new oo(n,n)),n=Ii(t,e,!0,!0),s=-1;else{var u=ks(t,n,i.unit);a=i.extend?Io(a,u.anchor,u.head,i.extend):u}i.addNew?-1==s?(s=c.length,Ho(o,ao(t,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==i.unit&&!i.extend?(Ho(o,ao(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Fo(o,s,a,G):(s=0,Ho(o,new ro([a],0),G),l=o.sel);var h=n;function d(e){if(0!=ae(h,e))if(h=e,"rectangle"==i.unit){for(var r=[],c=t.options.tabSize,u=F(Jt(o,n.line).text,n.ch,c),d=F(Jt(o,e.line).text,e.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));m<=g;m++){var v=Jt(o,m).text,y=U(v,p,c);p==f?r.push(new oo(oe(m,y),oe(m,y))):v.length>y&&r.push(new oo(oe(m,y),oe(m,U(v,f,c))))}r.length||r.push(new oo(n,n)),Ho(o,ao(t,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=a,w=ks(t,e,i.unit),C=x.anchor;ae(w.anchor,C)>0?(b=w.head,C=ue(x.from(),w.anchor)):(b=w.anchor,C=ce(x.to(),w.head));var k=l.ranges.slice(0);k[s]=Es(t,new oo(de(o,C),b)),Ho(o,ao(t,k,s),G)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(e){var n=++f,a=Ii(t,e,!0,"rectangle"==i.unit);if(a)if(0!=ae(a,h)){t.curOp.focus=N(),d(a);var s=er(r,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Nr(t,(function(){f==n&&m(e)})),150)}else{var l=e.clientY<p.top?-20:e.clientY>p.bottom?20:0;l&&setTimeout(Nr(t,(function(){f==n&&(r.scroller.scrollTop+=l,m(e))})),50)}}function g(e){t.state.selectingText=!1,f=1/0,e&&(Ct(e),r.input.focus()),gt(r.wrapper.ownerDocument,"mousemove",v),gt(r.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var v=Nr(t,(function(t){0!==t.buttons&&Tt(t)?m(t):g(t)})),y=Nr(t,g);t.state.selectingText=y,ft(r.wrapper.ownerDocument,"mousemove",v),ft(r.wrapper.ownerDocument,"mouseup",y)}function Es(t,e){var n=e.anchor,i=e.head,r=Jt(t.doc,n.line);if(0==ae(n,i)&&n.sticky==i.sticky)return e;var o=dt(r);if(!o)return e;var a=ut(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ut(o,i.ch,i.sticky),h=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],p=l==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?e:new oo(new oe(n.line,f,m),i)}function Ms(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Ct(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r)return vt(t,n,t,ne(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Ms(t,e,"gutterClick",!0)}function Ls(t,e){Gn(t.display,e)||As(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function As(t,e){return!!xt(t,"gutterContextMenu")&&Ms(t,e,"gutterContextMenu",!1)}function Ds(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),di(t)}gs.prototype.compare=function(t,e,n){return this.time+ms>t&&0==ae(e,this.pos)&&n==this.button};var Ps={toString:function(){return"CodeMirror.Init"}},Ns={},Bs={};function _s(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=Ps&&r(t,e,n)}:r)}t.defineOption=n,t.Init=Ps,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,fo(t)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){mo(t),di(t),Oi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(oe(i,o))}i++}));for(var r=n.length-1;r>=0;r--)ra(t.doc,e,n[r],oe(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ps&&t.refresh()})),n("specialCharPlaceholder",gn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ds(t),Jr(t)}),!0),n("keyMap","default",(function(t,e,n){var i=Va(e),r=n!=Ps&&Va(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Yr(e,t.options.lineNumbers),Jr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Ni(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return yr(t)}),!0),n("scrollbarStyle","native",(function(t){wr(t),yr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Yr(t.options.gutters,e),Jr(t)}),!0),n("firstLineNumber",1,Jr,!0),n("lineNumberFormatter",(function(t){return t}),Jr,!0),n("showCursorWhenSelecting",!1,Wi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Qi(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wi,!0),n("singleCursorHeightPerLine",!0,Wi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Is(t,e,n){if(!e!=!(n&&n!=Ps)){var i=t.display.dragFunctions,r=e?ft:gt;r(t.display.scroller,"dragstart",i.start),r(t.display.scroller,"dragenter",i.enter),r(t.display.scroller,"dragover",i.over),r(t.display.scroller,"dragleave",i.leave),r(t.display.scroller,"drop",i.drop)}}function Rs(t){t.options.lineWrapping?(B(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(M(t.display.wrapper,"CodeMirror-wrap"),ln(t)),_i(t),Oi(t),di(t),setTimeout((function(){return yr(t)}),100)}function Os(t,e){var n=this;if(!(this instanceof Os))return new Os(t,e);this.options=e=e?O(e):{},O(Ns,e,!1);var i=e.value;"string"==typeof i?i=new ka(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Os.inputStyles[e.inputStyle](this),o=this.display=new Qr(t,i,r,e);for(var c in o.wrapper.CodeMirror=this,Ds(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Pa(),kr(this),this.curOp.forceUpdate=!0,bo(this,i),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Ji(n)}),20):Qi(this),Bs)Bs.hasOwnProperty(c)&&Bs[c](this,e[c],Ps);Kr(this),e.finishInit&&e.finishInit(this);for(var u=0;u<js.length;++u)js[u](this);Sr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(t){var e=t.display;ft(e.scroller,"mousedown",Nr(t,ys)),ft(e.scroller,"dblclick",a&&s<11?Nr(t,(function(e){if(!yt(t,e)){var n=Ii(t,e);if(n&&!Ts(t,e)&&!Gn(t.display,e)){Ct(e);var i=t.findWordAt(n);Ro(t.doc,i.anchor,i.head)}}})):function(e){return yt(t,e)||Ct(e)}),ft(e.scroller,"contextmenu",(function(e){return Ls(t,e)})),ft(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Ls(t,n)}));var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(i=e.activeTouch).end=+new Date)}function o(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}ft(e.scroller,"touchstart",(function(r){if(!yt(t,r)&&!o(r)&&!Ts(t,r)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),ft(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ft(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!Gn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!i.prev||l(i,i.prev)?new oo(a,a):!i.prev.prev||l(i,i.prev.prev)?t.findWordAt(a):new oo(oe(a.line,0),de(t.doc,oe(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),Ct(n)}r()})),ft(e.scroller,"touchcancel",r),ft(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(dr(t,e.scroller.scrollTop),fr(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),ft(e.scroller,"mousewheel",(function(e){return io(t,e)})),ft(e.scroller,"DOMMouseScroll",(function(e){return io(t,e)})),ft(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Et(e)},over:function(e){yt(t,e)||(Ta(t,e),Et(e))},start:function(e){return Ma(t,e)},drop:Nr(t,Ea),leave:function(e){yt(t,e)||La(t)}};var c=e.input.getField();ft(c,"keyup",(function(e){return hs.call(t,e)})),ft(c,"keydown",Nr(t,cs)),ft(c,"keypress",Nr(t,ds)),ft(c,"focus",(function(e){return Ji(t,e)})),ft(c,"blur",(function(e){return Qi(t,e)}))}Os.defaults=Ns,Os.optionHandlers=Bs;var js=[];function Zs(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=be(t,e).state:n="prev");var a=t.options.tabSize,s=Jt(o,e),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(r,s.text.slice(u.length),s.text))==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?F(Jt(o,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(t.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(d<c&&(h+=K(c-d)),h!=u)return ra(o,h,oe(e,0),oe(e,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==e&&m.head.ch<u.length){var g=oe(e,u.length);Fo(o,f,new oo(g,g));break}}}Os.defineInitHook=function(t){return js.push(t)};var zs=null;function Hs(t){zs=t}function Ws(t,e,n,i,r){var o=t.doc;t.display.shift=!1,i||(i=o.sel);var a=+new Date-200,s="paste"==r||t.state.pasteIncoming>a,l=_t(e),c=null;if(s&&i.ranges.length>1)if(zs&&zs.text.join("\n")==e){if(i.ranges.length%zs.text.length==0){c=[];for(var u=0;u<zs.text.length;u++)c.push(o.splitLines(zs.text[u]))}}else l.length==i.ranges.length&&t.options.pasteLinesPerSelection&&(c=X(l,(function(t){return[t]})));for(var h=t.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var p=i.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=oe(f.line,f.ch-n):t.state.overwrite&&!s?m=oe(m.line,Math.min(Jt(o,m.line).text.length,m.ch+Y(l).length)):s&&zs&&zs.lineWise&&zs.text.join("\n")==l.join("\n")&&(f=m=oe(f.line,0)));var g={from:f,to:m,text:c?c[d%c.length]:l,origin:r||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Qo(t.doc,g),An(t,"inputRead",t,g)}e&&!s&&Vs(t,e),sr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Gs(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Pr(e,(function(){return Ws(e,n,0,null,"paste")})),!0}function Vs(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(e.indexOf(o.electricChars.charAt(s))>-1){a=Zs(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Jt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Zs(t,r.head.line,"smart"));a&&An(t,"electricInput",t,r.head.line)}}}function Us(t){for(var e=[],n=[],i=0;i<t.doc.sel.ranges.length;i++){var r=t.doc.sel.ranges[i].head.line,o={anchor:oe(r,0),head:oe(r+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function qs(t,e,n,i){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",i?"":"off"),t.setAttribute("spellcheck",!!e)}function Ks(){var t=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=A("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),m&&(t.style.border="1px solid black"),qs(t),e}function Ys(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&Nr(this,e[t])(this,n,r),vt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Va(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:Br((function(e,n){var i=e.token?e:t.getMode(this.options,e);if(i.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:i,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,Oi(this)})),removeOverlay:Br((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var i=e[n].modeSpec;if(i==t||"string"==typeof t&&i.name==t)return e.splice(n,1),this.state.modeGen++,void Oi(this)}})),indentLine:Br((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),ie(this.doc,t)&&Zs(this,t,e,n)})),indentSelection:Br((function(t){for(var e=this.doc.sel.ranges,n=-1,i=0;i<e.length;i++){var r=e[i];if(r.empty())r.head.line>n&&(Zs(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&sr(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Zs(this,l,t);var c=this.doc.sel.ranges;0==o.ch&&e.length==c.length&&c[i].from().ch>0&&Fo(this.doc,i,new oo(o,c[i].to()),W)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,oe(t),e,!0)},getTokenTypeAt:function(t){t=de(this.doc,t);var e,n=ye(this,Jt(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}i=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var i=[];if(!n.hasOwnProperty(e))return i;var r=n[e],o=this.getModeAt(t);if("string"==typeof o[e])r[o[e]]&&i.push(r[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=r[o[e][a]];s&&i.push(s)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var c=r._global[l];c.pred(o,this)&&-1==Z(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(t,e){var n=this.doc;return be(this,(t=he(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return bi(this,null==t?n.head:"object"==typeof t?de(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return yi(this,de(this.doc,t),e||"page")},coordsChar:function(t,e){return Ci(this,(t=vi(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=vi(this,{top:t,left:0},e||"page").top,ne(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var i,r=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,r=!0),i=Jt(this.doc,t)}else i=t;return gi(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-an(i):0)},defaultTextHeight:function(){return Ai(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display,a=(t=bi(this,de(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)a=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==r?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&rr(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Br(cs),triggerOnKeyPress:Br(ds),triggerOnKeyUp:hs,triggerOnMouseDown:Br(ys),execCommand:function(t){if(Ja.hasOwnProperty(t))return Ja[t].call(null,this)},triggerElectric:Br((function(t){Vs(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=de(this.doc,t),a=0;a<e&&!(o=Xs(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:Br((function(t,e){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Xs(n.doc,i.head,t,e,n.options.rtlMoveVisually):t<0?i.from():i.to()}),V)})),deleteH:Br((function(t,e){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Ua(this,(function(n){var r=Xs(i,n.head,t,e,!1);return t<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(t,e,n,i){var r=1,o=i;e<0&&(r=-1,e=-e);for(var a=de(this.doc,t),s=0;s<e;++s){var l=bi(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Js(this,l,r,n)).hitSide)break}return a},moveV:Br((function(t,e){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(a){if(o)return t<0?a.from():a.to();var s=bi(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),r.push(s.left);var l=Js(n,s,t,e);return"page"==e&&a==i.sel.primary()&&ar(n,yi(n,l,"div").top-s.top),l}),V),r.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=r[a]})),findWordAt:function(t){var e=Jt(this.doc,t.line).text,n=t.ch,i=t.ch;if(e){var r=this.getHelper(t,"wordChars");"before"!=t.sticky&&i!=e.length||!n?++i:--n;for(var o=e.charAt(n),a=nt(o,r)?function(t){return nt(t,r)}:/\s/.test(o)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!nt(t)};n>0&&a(e.charAt(n-1));)--n;for(;i<e.length&&a(e.charAt(i));)++i}return new oo(oe(t.line,n),oe(t.line,i))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),vt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Br((function(t,e){lr(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Kn(this)-this.display.barHeight,width:t.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Xn(this),clientWidth:Yn(this)}},scrollIntoView:Br((function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:oe(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?cr(this,t):hr(this,t.from,t.to,t.margin)})),setSize:Br((function(t,e){var n=this,i=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=i(t)),null!=e&&(this.display.wrapper.style.height=i(e)),this.options.lineWrapping&&hi(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){Fi(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,vt(this,"refresh",this)})),operation:function(t){return Pr(this,t)},startOperation:function(){return kr(this)},endOperation:function(){return Sr(this)},refresh:Br((function(){var t=this.display.cachedTextHeight;Oi(this),this.curOp.forceUpdate=!0,di(this),lr(this,this.doc.scrollLeft,this.doc.scrollTop),Vr(this.display),(null==t||Math.abs(t-Ai(this.display))>.5||this.options.lineWrapping)&&_i(this),vt(this,"refresh",this)})),swapDoc:Br((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,t),di(this),this.display.input.reset(),lr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,An(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},wt(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}function Xs(t,e,n,i,r){var o=e,a=n,s=Jt(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new oe(n,e.ch,e.sticky),s=Jt(t,n))}function u(o){var a;if("codepoint"==i){var u=s.text.charCodeAt(e.ch+(i>0?0:-1));a=isNaN(u)?null:new oe(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?Xa(t.cm,s,e,n):Ka(s,e,n);if(null==a){if(o||!c())return!1;e=Ya(r,t.cm,s,e.line,l)}else e=a;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var h=null,d="group"==i,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var m=s.text.charAt(e.ch)||"\n",g=nt(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||f||g||(g="s"),h&&h!=g){n<0&&(n=1,u(),e.sticky="after");break}if(g&&(h=g),n>0&&!u(!f))break}var v=Ko(t,e,o,a,!0);return se(o,v)&&(v.hitSide=!0),v}function Js(t,e,n,i){var r,o,a=t.doc,s=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Ai(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;(o=Ci(t,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Qs=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function $s(t,e){var n=ei(t,e.line);if(!n||n.hidden)return null;var i=Jt(t.doc,e.line),r=Qn(n,i,e.line),o=dt(i,t.doc.direction),a="left";o&&(a=ut(o,e.ch)%2?"right":"left");var s=ai(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function el(t,e){return e&&(t.bad=!0),t}function nl(t,e,n,i,r){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function h(t){t&&(u(),o+=t)}function d(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void h(n);var o,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(oe(i,0),oe(r+1,0),c(+p));return void(f.length&&(o=f[0].find(0))&&h(Qt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;m&&u();for(var g=0;g<e.childNodes.length;g++)d(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),m&&(a=!0)}else 3==e.nodeType&&h(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(e),e!=n;)e=e.nextSibling,l=!1;return o}function il(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return el(t.clipPos(oe(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r<t.display.view.length;r++){var o=t.display.view[r];if(o.node==i)return rl(o,e,n)}}function rl(t,e,n){var i=t.text.firstChild,r=!1;if(!e||!P(i,e))return el(oe(ee(t.line),0),!0);if(e==i&&(r=!0,e=i.childNodes[n],n=0,!e)){var o=t.rest?Y(t.rest):t.line;return el(oe(ee(o),o.text.length),r)}var a=3==e.nodeType?e:null,s=e;for(a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var l=t.measure,c=l.maps;function u(e,n,i){for(var r=-1;r<(c?c.length:0);r++)for(var o=r<0?l.map:c[r],a=0;a<o.length;a+=3){var s=o[a+2];if(s==e||s==n){var u=ee(r<0?t.line:t.rest[r]),h=o[a]+i;return(i<0||s!=e)&&(h=o[a+(i?1:0)]),oe(u,h)}}}var h=u(a,s,n);if(h)return el(h,r);for(var d=s.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return el(oe(h.line,h.ch-p),r);p+=d.textContent.length}for(var f=s.previousSibling,m=n;f;f=f.previousSibling){if(h=u(f,f.firstChild,-1))return el(oe(h.line,h.ch+m),r);m+=f.textContent.length}}Qs.prototype.init=function(t){var e=this,n=this,i=n.cm,r=n.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(o(t)&&!yt(i,t)){if(i.somethingSelected())Hs({lineWise:!1,text:i.getSelections()}),"cut"==t.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var e=Us(i);Hs({lineWise:!0,text:e.text}),"cut"==t.type&&i.operation((function(){i.setSelections(e.ranges,0,W),i.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=zs.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Ks(),l=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),l.value=zs.text.join("\n");var c=document.activeElement;I(l),setTimeout((function(){i.display.lineSpace.removeChild(s),c.focus(),c==r&&n.showPrimarySelection()}),50)}}qs(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),ft(r,"paste",(function(t){!o(t)||yt(i,t)||Gs(t,i)||s<=11&&setTimeout(Nr(i,(function(){return e.updateFromDOM()})),20)})),ft(r,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),ft(r,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),ft(r,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),ft(r,"touchstart",(function(){return n.forceCompositionEnd()})),ft(r,"input",(function(){e.composing||e.readFromDOMSoon()})),ft(r,"copy",a),ft(r,"cut",a)},Qs.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},Qs.prototype.prepareSelection=function(){var t=Gi(this.cm,!1);return t.focus=document.activeElement==this.div,t},Qs.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Qs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qs.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,i=e.doc.sel.primary(),r=i.from(),o=i.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var a=il(e,t.anchorNode,t.anchorOffset),s=il(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=ae(ue(a,s),r)||0!=ae(ce(a,s),o)){var l=e.display.view,c=r.line>=e.display.viewFrom&&$s(e,r)||{node:l[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&$s(e,o);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,f=t.rangeCount&&t.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(t){}p&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),p.collapsed||(t.removeAllRanges(),t.addRange(p))):(t.removeAllRanges(),t.addRange(p)),f&&null==t.anchorNode?t.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},Qs.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation((function(){return t.cm.curOp.selectionChanged=!0}))}),20)},Qs.prototype.showMultipleSelections=function(t){L(this.cm.display.cursorDiv,t.cursors),L(this.cm.display.selectionDiv,t.selection)},Qs.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Qs.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return P(this.div,e)},Qs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qs.prototype.blur=function(){this.div.blur()},Qs.prototype.getField=function(){return this.div},Qs.prototype.supportsTouch=function(){return!0},Qs.prototype.receivedFocus=function(){var t=this;function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}this.selectionInEditor()?this.pollSelection():Pr(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,e)},Qs.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Qs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&tl(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=il(e,t.anchorNode,t.anchorOffset),i=il(e,t.focusNode,t.focusOffset);n&&i&&Pr(e,(function(){Ho(e.doc,so(n,i),W),(n.bad||i.bad)&&(e.curOp.selectionChanged=!0)}))}}},Qs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=oe(a.line-1,Jt(i.doc,a.line-1).length)),s.ch==Jt(i.doc,s.line).text.length&&s.line<i.lastLine()&&(s=oe(s.line+1,0)),a.line<r.viewFrom||s.line>r.viewTo-1)return!1;a.line==r.viewFrom||0==(t=Ri(i,a.line))?(e=ee(r.view[0].line),n=r.view[0].node):(e=ee(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Ri(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=ee(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(nl(i,n,c,e,l)),d=Qt(i.doc,oe(e,0),oe(l,Jt(i.doc,l).text.length));h.length>1&&d.length>1;)if(Y(h)==Y(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var p=0,f=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=Y(h),b=Y(d),x=Math.min(y.length-(1==h.length?p:0),b.length-(1==d.length?p:0));f<x&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)++f;if(1==h.length&&1==d.length&&e==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var w=oe(e,p),C=oe(l,d.length?Y(d).length-f:0);return h.length>1||h[0]||ae(w,C)?(ra(i.doc,h,w,C,"+input"),!0):void 0},Qs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qs.prototype.reset=function(){this.forceCompositionEnd()},Qs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qs.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Qs.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Pr(this.cm,(function(){return Oi(t.cm)}))},Qs.prototype.setUneditable=function(t){t.contentEditable="false"},Qs.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Nr(this.cm,Ws)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Qs.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Qs.prototype.onContextMenu=function(){},Qs.prototype.resetPosition=function(){},Qs.prototype.needsContentAttribute=!0;var ol=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};function al(t,e){if((e=e?O(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=N();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=s.getValue()}var r;if(t.form&&(ft(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(gt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var s=Os((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function sl(t){t.off=gt,t.on=ft,t.wheelEventPixels=no,t.Doc=ka,t.splitLines=_t,t.countColumn=F,t.findColumn=U,t.isWordChar=et,t.Pass=H,t.signal=vt,t.Line=cn,t.changeEnd=lo,t.scrollbarModel=xr,t.Pos=oe,t.cmpPos=ae,t.modes=jt,t.mimeModes=Zt,t.resolveMode=Wt,t.getMode=Gt,t.modeExtensions=Vt,t.extendMode=Ut,t.copyState=qt,t.startState=Yt,t.innerMode=Kt,t.commands=Ja,t.keyMap=Fa,t.keyName=Ga,t.isModifierKey=Ha,t.lookupKey=za,t.normalizeKeyMap=Za,t.StringStream=Xt,t.SharedTextMarker=va,t.TextMarker=ma,t.LineWidget=ha,t.e_preventDefault=Ct,t.e_stopPropagation=kt,t.e_stop=Et,t.addClass=B,t.contains=P,t.rmClass=M,t.keyNames=_a}ol.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function o(t){if(!yt(i,t)){if(i.somethingSelected())Hs({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Us(i);Hs({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,W):(n.prevInput="",r.value=e.text.join("\n"),I(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),m&&(r.style.width="0px"),ft(r,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ft(r,"paste",(function(t){yt(i,t)||Gs(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),ft(r,"cut",o),ft(r,"copy",o),ft(t.scroller,"paste",(function(e){if(!Gn(t,e)&&!yt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,r.dispatchEvent(o)}})),ft(t.lineSpace,"selectstart",(function(e){Gn(t,e)||Ct(e)})),ft(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),ft(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(t){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=Gi(t);if(t.options.moveInputWithCursor){var r=bi(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},ol.prototype.showSelection=function(t){var e=this.cm.display;L(e.cursorDiv,t.cursors),L(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ol.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||N()!=this.textarea))try{this.textarea.focus()}catch(t){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ol.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ol.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l<c&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Pr(e,(function(){Ws(e,r.slice(l),i.length-l,null,t.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ii(n,t),c=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Nr(n,Ho)(n.doc,so(o),W);var u,d=r.style.cssText,p=e.wrapper.style.cssText,f=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-f.top-5)+"px; left: "+(t.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&g(),k){Et(t);var m=function(){gt(window,"mouseup",m),setTimeout(v,20)};ft(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var t=n.somethingSelected(),o=""+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,r.style.cssText=d,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&g();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==e.prevInput?Nr(n,Xo)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,_s(Os),Ys(Os);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in ka.prototype)ka.prototype.hasOwnProperty(cl)&&Z(ll,cl)<0&&(Os.prototype[cl]=function(t){return function(){return t.apply(this.doc,arguments)}}(ka.prototype[cl]));return wt(ka),Os.inputStyles={textarea:ol,contenteditable:Qs},Os.defineMode=function(t){Os.defaults.mode||"null"==t||(Os.defaults.mode=t),zt.apply(this,arguments)},Os.defineMIME=Ht,Os.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Os.defineMIME("text/plain","null"),Os.defineExtension=function(t,e){Os.prototype[t]=e},Os.defineDocExtension=function(t,e){ka.prototype[t]=e},Os.fromTextArea=al,sl(Os),Os.version="5.58.2",Os}()},25419:function(t,e,n){!function(t){"use strict";t.defineMode("markdown",(function(e,n){var i=t.getMode(e,"text/html"),r="null"==i.name;function o(n){if(t.findModeByName){var i=t.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=t.getMode(e,n);return"null"==r.name?null:r}void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in a)a.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(a[s]=n.tokenTypeOverrides[s]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,h=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,v=" ";function y(t,e,n){return e.f=e.inline=n,n(t,e)}function b(t,e,n){return e.f=e.block=n,n(t,e)}function x(t){return!t||!/\S/.test(t.string)}function w(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==k){var n=r;if(!n){var o=t.innerMode(i,e.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(e.f=T,e.block=C,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function C(e,i){var r=e.column()===i.indentation,s=x(i.prevLine.stream),p=i.indentedCode,g=i.prevLine.hr,v=!1!==i.list,b=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var w=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,v)){for(i.list=null;w<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=w-i.listStack[i.listStack.length-1])}var C=!(s||g||i.prevLine.header||v&&p||i.prevLine.fencedCodeEnd),k=(!1===i.list||g||s)&&i.indentation<=b&&e.match(l),M=null;if(i.indentationDiff>=4&&(p||i.prevLine.fencedCodeEnd||i.prevLine.header||s))return e.skipToEnd(),i.indentedCode=!0,a.code;if(e.eatSpace())return null;if(r&&i.indentation<=b&&(M=e.match(h))&&M[1].length<=6)return i.quote=0,i.header=M[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,E(i);if(i.indentation<=b&&e.eat(">"))return i.quote=r?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),e.eatSpace(),E(i);if(!k&&!i.setext&&r&&i.indentation<=b&&(M=e.match(c))){var T=M[1]?"ol":"ul";return i.indentation=w+e.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,n.taskLists&&e.match(u,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+T]),E(i)}return r&&i.indentation<=b&&(M=e.match(f,!0))?(i.quote=0,i.fencedEndRE=new RegExp(M[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&o(M[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=t.startState(i.localMode)),i.f=i.block=S,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,E(i)):i.setext||!(C&&v||i.quote||!1!==i.list||i.code||k||m.test(e.string))&&(M=e.lookAhead(1))&&(M=M.match(d))?(i.setext?(i.header=i.setext,i.setext=0,e.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==M[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,E(i)):k?(e.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===e.peek()?y(e,i,N):y(e,i,i.inline)}function k(e,n){var o=i.token(e,n.htmlState);if(!r){var a=t.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&e.current().indexOf(">")>-1)&&(n.f=T,n.block=C,n.htmlState=null)}return o}function S(t,e){var i,r=e.listStack[e.listStack.length-1]||0,o=e.indentation<r,s=r+3;return e.fencedEndRE&&e.indentation<=s&&(o||t.match(e.fencedEndRE))?(n.highlightFormatting&&(e.formatting="code-block"),o||(i=E(e)),e.localMode=e.localState=null,e.block=C,e.f=T,e.fencedEndRE=null,e.code=0,e.thisLine.fencedCodeEnd=!0,o?b(t,e,e.block):i):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),a.code)}function E(t){var e=[];if(t.formatting){e.push(a.formatting),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var i=0;i<t.formatting.length;i++)e.push(a.formatting+"-"+t.formatting[i]),"header"===t.formatting[i]&&e.push(a.formatting+"-"+t.formatting[i]+"-"+t.header),"quote"===t.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(a.formatting+"-"+t.formatting[i]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(a.linkHref,"url"):(t.strong&&e.push(a.strong),t.em&&e.push(a.em),t.strikethrough&&e.push(a.strikethrough),t.emoji&&e.push(a.emoji),t.linkText&&e.push(a.linkText),t.code&&e.push(a.code),t.image&&e.push(a.image),t.imageAltText&&e.push(a.imageAltText,"link"),t.imageMarker&&e.push(a.imageMarker)),t.header&&e.push(a.header,a.header+"-"+t.header),t.quote&&(e.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(a.quote+"-"+t.quote):e.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==t.list){var r=(t.listStack.length-1)%3;r?1===r?e.push(a.list2):e.push(a.list3):e.push(a.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function M(t,e){if(t.match(p,!0))return E(e)}function T(e,r){var o=r.text(e,r);if(void 0!==o)return o;if(r.list)return r.list=null,E(r);if(r.taskList)return" "===e.match(u,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,E(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&e.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),E(r);var s=e.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(c),!0))return a.linkHref}if("`"===s){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),e.eatWhile("`");var d=e.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var p=E(r);return r.code=0,p}return r.formatting=h,E(r)}return r.code=d,E(r)}if(r.code)return E(r);if("\\"===s&&(e.next(),n.highlightFormatting)){var f=E(r),m=a.formatting+"-escape";return f?f+" "+m:m}if("!"===s&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("["===s&&r.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=E(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=A,f}if("["===s&&!r.image)return r.linkText&&e.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),E(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=E(r);return r.linkText=!1,r.inline=r.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?A:T,f}if("<"===s&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkInline;if("<"===s&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkEmail;if(n.xml&&"<"===s&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=e.string.indexOf(">",e.pos);if(-1!=v){var y=e.string.substring(e.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(r.md_inside=!0)}return e.backUp(1),r.htmlState=t.startState(i),b(e,r,k)}if(n.xml&&"<"===s&&e.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var x=1,w=1==e.pos?" ":e.string.charAt(e.pos-2);x<3&&e.eat(s);)x++;var C=e.peek()||" ",S=!/\s/.test(C)&&(!g.test(C)||/\s/.test(w)||g.test(w)),M=!/\s/.test(w)&&(!g.test(w)||/\s/.test(C)||g.test(C)),D=null,P=null;if(x%2&&(r.em||!S||"*"!==s&&M&&!g.test(w)?r.em!=s||!M||"*"!==s&&S&&!g.test(C)||(D=!1):D=!0),x>1&&(r.strong||!S||"*"!==s&&M&&!g.test(w)?r.strong!=s||!M||"*"!==s&&S&&!g.test(C)||(P=!1):P=!0),null!=P||null!=D)return n.highlightFormatting&&(r.formatting=null==D?"strong":null==P?"em":"strong em"),!0===D&&(r.em=s),!0===P&&(r.strong=s),p=E(r),!1===D&&(r.em=!1),!1===P&&(r.strong=!1),p}else if(" "===s&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return E(r);e.backUp(1)}if(n.strikethrough)if("~"===s&&e.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=E(r),r.strikethrough=!1,p;if(e.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),E(r)}else if(" "===s&&e.match(/^~~/,!0)){if(" "===e.peek())return E(r);e.backUp(2)}if(n.emoji&&":"===s&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var N=E(r);return r.emoji=!1,N}return" "===s&&(e.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),E(r)}function L(t,e){if(">"===t.next()){e.f=e.inline=T,n.highlightFormatting&&(e.formatting="link");var i=E(e);return i?i+=" ":i="",i+a.linkInline}return t.match(/^[^>]+/,!0),a.linkInline}function A(t,e){if(t.eatSpace())return null;var i=t.next();return"("===i||"["===i?(e.f=e.inline=P("("===i?")":"]"),n.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,E(e)):"error"}var D={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(t){return function(e,i){if(e.next()===t){i.f=i.inline=T,n.highlightFormatting&&(i.formatting="link-string");var r=E(i);return i.linkHref=!1,r}return e.match(D[t]),i.linkHref=!0,E(i)}}function N(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=B,t.next(),n.highlightFormatting&&(e.formatting="link"),e.linkText=!0,E(e)):y(t,e,T)}function B(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=_,n.highlightFormatting&&(e.formatting="link");var i=E(e);return e.linkText=!1,i}return t.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function _(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=T,a.linkHref+" url")}var I={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:T,text:M,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(i,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine.stream){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return w(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:t},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=k)){var n=t.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(e.indentation=n,e.indentationDiff=null,n>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==k?{state:t.htmlState,mode:i}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:I}},indent:function(e,n,r){return e.block==k&&i.indent?i.indent(e.htmlState,n,r):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},blankLine:w,getType:E,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return I}),"xml"),t.defineMIME("text/markdown","markdown"),t.defineMIME("text/x-markdown","markdown")}(n(89780),n(15525),n(98101))},98101:function(t,e,n){!function(t){"use strict";t.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var e=0;e<t.modeInfo.length;e++){var n=t.modeInfo[e];n.mimes&&(n.mime=n.mimes[0])}t.findModeByMIME=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.mime==e)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==e)return i}return/\+xml$/.test(e)?t.findModeByMIME("application/xml"):/\+json$/.test(e)?t.findModeByMIME("application/json"):void 0},t.findModeByExtension=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==e)return i}},t.findModeByFileName=function(e){for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.file&&i.file.test(e))return i}var r=e.lastIndexOf("."),o=r>-1&&e.substring(r+1,e.length);if(o)return t.findModeByExtension(o)},t.findModeByName=function(e){e=e.toLowerCase();for(var n=0;n<t.modeInfo.length;n++){var i=t.modeInfo[n];if(i.name.toLowerCase()==e)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==e)return i}}}(n(89780))},67549:function(t,e,n){!function(t){"use strict";t.defineMode("stex",(function(t,e){function n(t,e){t.cmdState.push(e)}function i(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function r(t){var e=t.cmdState.pop();e&&e.closeBracket()}function o(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var i=e[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}function a(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};function l(t,e){t.f=e}function c(t,e){var r;if(t.match(/^\\[a-zA-Z@]+/)){var a=t.current().slice(1);return n(e,r=new(r=s.hasOwnProperty(a)?s[a]:s.DEFAULT)),l(e,h),r.style}if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return l(e,(function(t,e){return u(t,e,"\\]")})),"keyword";if(t.match("\\("))return l(e,(function(t,e){return u(t,e,"\\)")})),"keyword";if(t.match("$$"))return l(e,(function(t,e){return u(t,e,"$$")})),"keyword";if(t.match("$"))return l(e,(function(t,e){return u(t,e,"$")})),"keyword";var c=t.next();return"%"==c?(t.skipToEnd(),"comment"):"}"==c||"]"==c?(r=i(e))?(r.closeBracket(c),l(e,h),"bracket"):"error":"{"==c||"["==c?(n(e,r=new(r=s.DEFAULT)),"bracket"):/\d/.test(c)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),"begin"==(r=o(e)).name&&(r.argument=t.current()),r.styleIdentifier())}function u(t,e,n){if(t.eatSpace())return null;if(n&&t.match(n))return l(e,c),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=t.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(t.skipToEnd(),"comment"):"error"}function h(t,e){var n=t.peek();return"{"==n||"["==n?(i(e).openBracket(n),t.eat(n),l(e,c),"bracket"):/[ \t\r]/.test(n)?(t.eat(n),null):(l(e,c),r(e),c(t,e))}return s.importmodule=a("importmodule","tag",["string","builtin"]),s.documentclass=a("documentclass","tag",["","atom"]),s.usepackage=a("usepackage","tag",["atom"]),s.begin=a("begin","tag",["atom"]),s.end=a("end","tag",["atom"]),s.label=a("label","tag",["atom"]),s.ref=a("ref","tag",["atom"]),s.eqref=a("eqref","tag",["atom"]),s.cite=a("cite","tag",["atom"]),s.bibitem=a("bibitem","tag",["atom"]),s.Bibitem=a("Bibitem","tag",["atom"]),s.RBibitem=a("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:e.inMathMode?function(t,e){return u(t,e)}:c}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=c,t.cmdState.length=0},lineComment:"%"}})),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}(n(89780))},15525:function(t,e,n){!function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(i,r){var o,a,s=i.indentUnit,l={},c=r.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function h(t,e){function n(n){return e.tokenize=n,n(t,e)}var i=t.next();return"<"==i?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(m(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==i?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=h,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=h,e.state=b,e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=p(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=d;break}return"string"};return e.isInAttribute=!0,e}function f(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=h;break}n.next()}return t}}function m(t){return function(e,n){for(var i;null!=(i=e.next());){if("<"==i)return n.tokenize=m(t+1),n.tokenize(e,n);if(">"==i){if(1==t){n.tokenize=h;break}return n.tokenize=m(t-1),n.tokenize(e,n)}}return"meta"}}function g(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function y(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;v(t)}}function b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?w:b}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",x)}function w(t,e,n){if("word"==t){var i=e.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",C):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,e,n)):(a="error",k)}function C(t,e,n){return"endTag"!=t?(a="error",C):(v(n),b)}function k(t,e,n){return a="error",C(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",E;if("endTag"==t||"selfcloseTag"==t){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(i)?y(n,i):(y(n,i),n.context=new g(n,i,r==n.indented)),b}return a="error",S}function E(t,e,n){return"equals"==t?M:(l.allowMissing||(a="error"),S(t,e,n))}function M(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return h.isInText=!0,{startState:function(t){var e={tokenize:h,state:b,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,i){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var a=l.contextGrabbers[r.tagName];if(!a||!a.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==M&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)n.tagName&&e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(89780))},2859:function(t,e,n){"use strict";n.d(e,{hP:function(){return Q}});var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function a(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}var l=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var n=0,i=e;n<i.length;n++){var r=i[n],o=r[0],a=r[1];t.setAttribute(o,a)}},t.createRect=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",e.toString()),r.setAttribute("height",n.toString()),i&&t.setAttributes(r,i),r},t.createLine=function(e,n,i,r,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",e.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",r.toString()),o&&t.setAttributes(a,o),a},t.createPolygon=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",e),n&&t.setAttributes(i,n),i},t.createCircle=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(e/2).toString()),i.setAttribute("r",e.toString()),n&&t.setAttributes(i,n),i},t.createEllipse=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(e/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(e/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&t.setAttributes(r,i),r},t.createGroup=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(n,e),n},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,n,i,r,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},t.createText=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),e&&t.setAttributes(n,e),n},t.createTSpan=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=e,n&&t.setAttributes(i,n),i},t.createImage=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(n,e),n},t.createPoint=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=t,n.y=e,n},t.createPath=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),n&&t.setAttributes(i,n),i},t}(),c=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),u=function(){function t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return t.prototype.rasterize=function(t,e,n){var i=this;return new Promise((function(r){var o=void 0!==n?n:document.createElement("canvas");null===t&&(i.markersOnly=!0,i.naturalSize=!1);var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",e.width.baseVal.valueAsString),a.setAttribute("height",e.height.baseVal.valueAsString),a.setAttribute("viewBox","0 0 "+e.viewBox.baseVal.width.toString()+" "+e.viewBox.baseVal.height.toString()),a.innerHTML=e.innerHTML,!0===i.naturalSize?(a.width.baseVal.value=t.naturalWidth,a.height.baseVal.value=t.naturalHeight):void 0!==i.width&&void 0!==i.height&&(a.width.baseVal.value=i.width,a.height.baseVal.value=i.height),o.width=a.width.baseVal.value,o.height=a.height.baseVal.value;var s=a.outerHTML,l=o.getContext("2d");!0!==i.markersOnly&&l.drawImage(t,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([s],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(d);var t=o.toDataURL(i.imageType,i.imageQuality);r(t)},u.src=d}))},t}(),h=function(){},d=function(){function t(t){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+t+"_"}return Object.defineProperty(t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),t.prototype.addClass=function(t){return void 0===this.styleSheet&&this.addStyleSheet(),t.name=""+this.classNamePrefix+t.localName,this.classes.push(t),this.styleSheet.sheet.insertRule("."+t.name+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length),t},t.prototype.addRule=function(t){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(t),this.styleSheet.sheet.insertRule(t.selector+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length)},t.prototype.addStyleSheet=function(){var t;this.styleSheet=document.createElement("style"),(null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).appendChild(this.styleSheet),this.addRule(new p("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new f("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new f("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},t.prototype.removeStyleSheet=function(){var t;this.styleSheet&&((null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},t}(),p=function(t,e){this.selector=t,this.style=e},f=function(t,e){this.localName=t,this.style=e},m=function(){function t(t,e,n,i,r){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=t,this.displayMode=e,this.markerItems=n,this.uiStyleSettings=i,this.styles=r,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return t.prototype.show=function(t){var e=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(n,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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(t){var n=document.createElement("div");n.className=""+e.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",t.typeName),n.innerHTML=t.icon,n.addEventListener("click",(function(){e.markerToolbarButtonClicked(n,t)})),e.buttons.push(n),e.markerButtons.push(n)})),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e<this.markerButtons.length;e++)e<t||e===t&&this.markerButtons.length-1===t?this.markerButtonBlock.appendChild(this.markerButtons[e]):(e===t&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[e]))}},t.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},t.prototype.resetButtonStyles=function(){var t=this;this.buttons.forEach((function(e){e.className=e.className.replace(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name,"").trim(),e.className=e.className.replace(t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:t.toolbarActiveButtonStyleColorsClass.name,"").trim(),e.className+=" "+(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name)}))},t.prototype.addActionButton=function(t,e,n){var i=this,r=document.createElement("div");switch(r.className=""+this.toolbarButtonStyleClass.name,r.innerHTML=e,r.setAttribute("data-action",n),r.addEventListener("click",(function(){i.actionToolbarButtonClicked(r,n)})),n){case"select":case"undo":case"redo":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":r.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"render":r.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":r.style.fill=this.uiStyleSettings.closeButtonColor}t.appendChild(r),this.buttons.push(r)},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},t.prototype.markerToolbarButtonClicked=function(t,e){this.setActiveButton(t),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("marker",e)})),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("action",e)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find((function(e){return e.getAttribute("data-type-name")===t}));e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter((function(t){return/delete|notes/.test(t.getAttribute("data-action"))})).forEach((function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")}))},t}(),g=function(){function t(t,e,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new f("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new f("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new f("toolbox-panel-row_colors","\n background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,n,i=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(e=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:i.toolboxButtonStyleColorsClass.name),n.innerHTML=t.icon,n.title=t.title,n.addEventListener("click",(function(){i.panelButtonClick(t)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,n=-1;if(t!==this.activePanel){n=this.panels.indexOf(t),this.panelRow.innerHTML="";var i=t.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(t,i){var r,o;t.className=e.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:e.toolboxButtonStyleColorsClass.name))}))},t}(),v=function(t,e){this.title=t,this.icon=e},y=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=t.getColorBox(n);e.appendChild(i),t.colorBoxes.push(i)})),e},e.prototype.getColorBox=function(t){var e=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentColor(t,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=t,o.style.borderRadius=i/2+"px","transparent"===t&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='<svg viewBox="0 0 24 24">\n <path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />\n </svg>'),r.appendChild(o),r},e.prototype.setCurrentColor=function(t,e){var n=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(v),b=function(){function t(t,e,n){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){this.stateChanged()},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t),this.stateChanged()},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t),this.stateChanged()},t.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var t=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),t.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(t)&&this.onStateChanged(this)}},t.typeName="MarkerBase",t}(),x=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),w=function(){function t(){this.GRIP_SIZE=10,this.visual=l.createGroup(),this.visual.appendChild(l.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(l.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),C=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),k=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(l.createTransform()),r.setupControlBox(),r}return r(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=l.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!!(void 0!==this.controlGrips.findGripByVisual(e)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(e);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+t.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+t.y-this.manipulationStartY}n>=0?(this.left=e,this.width=n):(this.left=e+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),n=l.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var n=l.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=l.createGroup();var t=l.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=l.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=l.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 x,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},e.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},e.prototype.createGrip=function(){var t=new w;return t.visual.transform.baseVal.appendItem(l.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,n=e,i=(this.width+this.CB_DISTANCE)/2-t/2,r=(this.height+this.CB_DISTANCE)/2-t/2,o=this.height+this.CB_DISTANCE-t/2,a=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,e,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,e,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:C.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:C.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*e,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*e,this.height=this.height*n,this.adjustControlBox()},e}(b),S=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=l.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&l.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&l.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&l.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&l.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.title="Rectangle marker",e}(k),E=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentWidth(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+t.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),t.widthBoxes.push(i)})),e},e.prototype.setCurrentWidth=function(t,e){var n=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(v),M=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.styles.length-5+"%",i.style.borderColor=n===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentStyle(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+t.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";r.innerHTML=o,i.appendChild(r),t.styleBoxes.push(i)})),e},e.prototype.setCurrentStyle=function(t,e){var n=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(v),T=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="FrameMarker",e.title="Frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',e}(S),L=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"},A=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return r(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&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(e),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=l.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new w;return t.visual.transform.baseVal.appendItem(l.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.x1=this.x1*e,this.y1=this.y1*n,this.x2=this.x2*e,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},e}(b),D=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=l.createGroup(),this.selectorLine=l.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=l.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.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()),l.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),l.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),l.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',e}(A),P=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.fonts.length-5+"%",i.style.borderColor=n===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentFont(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),t.fontBoxes.push(i)})),e},e.prototype.setCurrentFont=function(t,e){var n=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(v),N=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="请输入文本",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return r(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(n=!0)})),n},e.prototype.createVisual=function(){this.visual=l.createGroup(),this.bgRectangle=l.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=l.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(l.createTransform()),this.textElement.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=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(e){t.textElement.appendChild(l.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var n=(1*this.width-this.width*this.padding*2/100)/t.width,i=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(n,i)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),n=0,i=0;return e.width>0&&e.height>0&&(n=(this.width-e.width*t)/2,i=this.height/2-e.height*t/2),{x:n,y:i}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),n=this.getTextPosition(e);n.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=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(t){t.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){t.textEditDivClicked(t.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*t,y:n.height*t};e.x-=i.x/2,e.y-=i.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},e.prototype.select=function(){t.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,n){t.prototype.dblClick.call(this,e,n),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&l.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&l.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',e}(k),B=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=l.createGroup(),this.drawingImage=l.createImage(),this.visual.appendChild(this.drawingImage);var t=l.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.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)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=e[0],i=e[1],r=e[2],o=e[3],a=!1,s=0;s<this.canvasElement.height;s++)for(var l=0;l<this.canvasElement.width;l++)t.data[s*this.canvasElement.width*4+4*l+3]>0&&(a=!0,s<i&&(i=s),l<n&&(n=l),s>o&&(o=s),l>r&&(r=l));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){l.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',e}(k),_=function(t){function e(e,n,i){var r=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){t.setCurrentType(r,o)})),e.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',a.style.marginLeft="5px",o.appendChild(a)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),o.appendChild(s),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return e},e.prototype.setCurrentType=function(t,e){var n=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(v),I=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new _("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return t-n/2+","+(e+i/2)+" "+t+","+(e-i/2)+" "+(t+n/2)+","+(e+i/2)},e.prototype.createTips=function(){this.arrow1=l.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=l.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",l.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),l.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var e=0;Math.abs(this.x1-this.x2)>.1&&(e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',e}(D),R=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new y("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return r(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="CoverMarker",e.title="Cover marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',e}(S),O=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return r(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentOpacity(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),t.opacityBoxes.push(i)})),e},e.prototype.setCurrentOpacity=function(t,e){var n=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(v),F=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new y("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new O("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&l.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',e}(R),j='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',Z='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',z=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new y("Text color",i.defaultColorSet,r.color,j),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new y("Fill color",i.defaultColorSet,r.bgColor,Z),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new w,r.tipGrip.visual.transform.baseVal.appendItem(l.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return r(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){l.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=l.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,n){"new"===this.state&&t.prototype.pointerDown.call(this,e,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var n="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(n),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var n=this.unrotatePoint(e);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(l.setAttributes(this.bgRectangle,[["fill",t]]),l.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),n=this.height/5;t&&(this.tipPosition={x:e+n/2,y:this.height+20});var i=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:0},this.tipBase2Position={x:e+n,y:0}):(this.tipBase1Position={x:0,y:e},this.tipBase2Position={x:0,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:0},this.tipBase2Position={x:this.width-e,y:0}):(this.tipBase1Position={x:this.width,y:e},this.tipBase2Position={x:this.width,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?i<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:this.height},this.tipBase2Position={x:this.width-e,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-e-n},this.tipBase2Position={x:this.width,y:this.height-e}):i<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:this.height},this.tipBase2Position={x:e+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-e},this.tipBase2Position={x:0,y:this.height-e-n})},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.positionTip()},e.prototype.positionTip=function(){l.setAttributes(this.tip,[["points",this.getTipPoints()]]);var t=this.tipGrip.visual.transform.baseVal.getItem(0);t.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(t,0)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.positionTip(),t.prototype.select.call(this)},e.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,t.prototype.restoreState.call(this,e),this.createTip(),this.setTipPoints()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.tipPosition={x:this.tipPosition.x*e,y:this.tipPosition.y*n},this.positionTip()},e.typeName="CalloutMarker",e.title="Callout marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',e}(N),H=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new y("Line color",s(i.defaultColorSet,["transparent"]),i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",s(i.defaultColorSet,["transparent"]),r.fillColor,Z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new O("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=l.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),l.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&l.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&l.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&l.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&l.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&l.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(k),W=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return r(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=l.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.tip1),this.tip2=l.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(l.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),l.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',e}(D),G=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return r(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(H),V=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),U=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=l.createGroup(),this.selectorCurve=l.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=l.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),l.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),l.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),l.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=l.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=l.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)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/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()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,n){this.curveX=this.curveX*e,this.curveY=this.curveY*n,t.prototype.scale.call(this,e,n)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',e}(A),q=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.textColor="transparent",r.fontSize="1rem",r.isMoved=!1,r.captionText="Caption",r.PADDING=5,r.captionBoxWidth=0,r.captionBoxHeight=0,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.textColor=i.defaultStrokeColor,r.fontFamily=i.defaultFontFamily,r.fontSize=i.defaultCaptionFontSize,r.captionText=i.defaultCaptionText,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r.sizeCaption=r.sizeCaption.bind(r),r.setCaptionText=r.setCaptionText.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.finishTextEditing=r.finishTextEditing.bind(r),r.setFont=r.setFont.bind(r),r.setTextColor=r.setTextColor.bind(r),r.strokePanel=new y("Line color",s(i.defaultColorSet,["transparent"]),r.strokeColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",s(i.defaultColorSet,["transparent"]),r.fillColor,Z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.textColorPanel=new y("Text color",i.defaultColorSet,r.textColor,j),r.textColorPanel.onColorChanged=r.setTextColor,r}return r(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.frame&&e!==this.captionBg&&e!==this.captionElement)},e.prototype.createVisual=function(){this.visual=l.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=l.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=l.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=l.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()},e.prototype.setCaptionText=function(t){this.captionText=t,this.captionElement.textContent=this.captionText,this.sizeCaption()},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.sizeCaption=function(){var t=this.captionElement.getBBox();""!==this.captionText.trim()?(this.captionBoxWidth=t.width+2*this.PADDING,this.captionBoxHeight=t.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),l.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')"]]),l.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')"]])},e.prototype.showTextEditor=function(){var t=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(t){t.stopPropagation()})),this.textEditBox.addEventListener("keypress",(function(e){"Enter"===e.key&&t.finishTextEditing(t.textEditBox.value)})),this.textEditBox.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditBox.addEventListener("blur",(function(){t.finishTextEditing(t.textEditBox.value)})),this.textEditDiv.addEventListener("pointerup",(function(){t.finishTextEditing(t.textEditBox.value)})),this.positionTextEditor(),this.textEditBox.focus()},e.prototype.positionTextEditor=function(){"edit"===this.state&&(void 0===this.textEditBox?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"))},e.prototype.finishTextEditing=function(t){this.setCaptionText(t.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},e.prototype.setFont=function(t){this.captionElement&&l.setAttributes(this.captionElement,[["font-family",t]]),this.fontFamily=t,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},e.prototype.setTextColor=function(t){this.captionElement&&l.setAttributes(this.captionElement,[["fill",t]]),this.textColor=t,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},e.prototype.setSize=function(){t.prototype.setSize.call(this),l.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.dblClick=function(e,n){t.prototype.dblClick.call(this,e,n),this.showTextEditor()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.frame&&l.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.captionBg&&l.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.frame&&l.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.frame&&l.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var e=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},t.prototype.getState.call(this));return e.typeName=this.typeName,e},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.textColor=n.textColor,this.fontFamily=n.fontFamily,this.captionText=n.captionText,this.fontSize=n.fontSize,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.typeName="CaptionFrameMarker",e.title="Caption frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',e}(k),K=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),Y=function(t){function e(e,n,i){var r=t.call(this,e,!1)||this;return r.dataUrl=n,r.state=i,r}return r(e,t),e}(K),X=function(t){function e(e,n,i){void 0===i&&(i=!1);var r=t.call(this,e,i)||this;return r.marker=n,r}return r(e,t),e}(K),J=function(){function t(){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 t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var n=this[t].indexOf(e);n>-1&&this[t].splice(n,1)},t}(),Q=function(){function t(e){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new L,this._isOpen=!1,this.undoRedoManager=new V,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 J,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=t.instanceCounter++,this.styles=new d(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=e,this.targetRoot=document.body,this.width=e.clientWidth,this.height=e.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(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[T,B,I,N,G,H,F,z,W,R,D,U,q]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[T,B,I,N,H,F,z]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[T,B,I,N,F]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach((function(t){if("string"==typeof t){var n=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==n&&e._availableMarkerTypes.push(n)}else e._availableMarkerTypes.push(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),c.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==h.styleSheetRoot&&(this.styles.styleSheetRoot=h.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new K(t))}))},t.prototype.render=function(){return o(this,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new u).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}}))}))},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var n=!1;t||this.eventListeners.beforeclose.forEach((function(t){var i=new K(e,!0);t(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(t){return t(new K(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=this._availableMarkerTypes).push.apply(t,e)},t.prototype.addRenderEventListener=function(t){this.addEventListener("render",(function(e){t(e.dataUrl,e.state)}))},t.prototype.removeRenderEventListener=function(t){},t.prototype.addCloseEventListener=function(t){this.addEventListener("close",(function(){t()}))},t.prototype.removeCloseEventListener=function(t){},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return t.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupTargetResize=function(){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.editorCanvas.clientWidth/t>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,n=e<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/t;this.resize(e,n)},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.prototype.resize=function(t,e){this._isResizing=!0;var n=t/this.imageWidth,i=e/this.imageHeight;this.imageWidth=Math.round(t),this.imageHeight=Math.round(e),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,i),this._isResizing=!1},t.prototype.scaleMarkers=function(t,e){var n,i=this;this._currentMarker&&this._currentMarker instanceof N?this._currentMarker.scale(t,e):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==i._currentMarker&&n.scale(t,e)})),void 0!==n&&this.setCurrentMarker(n)},t.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},t.prototype.setTopLeft=function(){var t=this.editingTarget.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left,this.top=t.top-e.top},t.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},t.prototype.addDefs=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.defs=l.createDefs(),this.addDefsToImage(),(t=this.defs).append.apply(t,e)},t.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},t.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},t.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},t.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},t.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var t=document.createElement("a");t.href="https://markerjs.com/",t.target="_blank",t.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 t=void 0!==this.settings.uiOffsetTop?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=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new m(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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"),void 0===this.settings.uiOffsetTop&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new g(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},t.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.removeMarker=function(t){this.markerImage.removeChild(t.container),this.markers.indexOf(t)>-1&&this.markers.splice(this.markers.indexOf(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this._currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(t,t._currentMarker,!0);n(i),i.defaultPrevented&&(e=!0)})),!e){var n=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(e){return e(new X(t,n))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(t,void 0,!0);n(i),i.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var n=function(e){var n=i.markers[e];i.setCurrentMarker(i.markers[e]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(e){return e(new X(t,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this._currentMarker&&(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=null!==(t=this._currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){var t=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var e=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===e.width&&n.height===e.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),i<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(e){return e(new K(t))}))}else this.undoRedoManager.replaceLastUndoStep(e),this.eventListeners.statechange.forEach((function(e){return e(new K(t))}))}},t.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},t.prototype.undoStep=function(){var t=this,e=this.undoRedoManager.undo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new K(t))})))},t.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},t.prototype.redoStep=function(){var t=this,e=this.undoRedoManager.redo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new K(t))})))},t.prototype.stepZoom=function(){var t=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=t<this.zoomSteps.length-1?this.zoomSteps[t+1]:this.zoomSteps[0]},t.prototype.panTo=function(t){this.contentDiv.scrollBy({left:this.prevPanPoint.x-t.x,top:this.prevPanPoint.y-t.y}),this.prevPanPoint=t},t.prototype.startRenderAndClose=function(){return o(this,void 0,void 0,(function(){var t,e,n=this;return a(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return t=i.sent(),e=this.getState(),this.eventListeners.render.forEach((function(i){return i(new Y(n,t,e))})),this.close(!0),[2]}}))}))},t.prototype.getState=function(t){!0===t&&this.setCurrentMarker();var e={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(t){return e.markers.push(t.getState())})),e},t.prototype.restoreState=function(t){var e=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);t.markers.forEach((function(t){var n=e._availableMarkerTypes.find((function(e){return e.typeName===t.typeName}));if(void 0!==n){var i=e.addNewMarker(n);i.restoreState(t),e.markers.push(i)}})),t.width&&t.height&&(t.width!==this.imageWidth||t.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/t.width,this.imageHeight/t.height),this.eventListeners.restorestate.forEach((function(t){return t(new K(e))}))},t.prototype.addNewMarker=function(t){var e=l.createGroup();return this.markerImage.appendChild(e),new t(e,this.overlayContainer,this.settings)},t.prototype.createNewMarker=function(t){var e,n=this;(e="string"==typeof t?this._availableMarkerTypes.find((function(e){return e.typeName===t})):t)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(e),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(e.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(t){return t(new X(n,n._currentMarker))})))},t.prototype.markerCreated=function(t){var e=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(t),this.setCurrentMarker(t),t instanceof B&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(B):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(t){return t(new X(e,e._currentMarker))}))},t.prototype.colorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=t,this.settings.defaultStrokeColor=t)},t.prototype.fillColorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=t)},t.prototype.markerStateChanged=function(t){var e=this;this.eventListeners.markerchange.forEach((function(n){return n(new X(e,t))}))},t.prototype.setCurrentMarker=function(t){var e=this;this._currentMarker!==t&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(t){return t(new X(e,e._currentMarker))}))),this._currentMarker=t,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(t){return t(new X(e,e._currentMarker))})))},t.prototype.onPointerDown=function(t){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==t.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e?(this.setCurrentMarker(e),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:t.clientX,y:t.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY))},t.prototype.onDblClick=function(t){if(this._isFocused||this.focus(),"select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e&&e!==this._currentMarker&&this.setCurrentMarker(e),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target):this.setCurrentMarker()}},t.prototype.onPointerMove=function(t){1!==this.touchPoints&&"touch"===t.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||t.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(t.clientX,t.clientY)):this.zoomLevel>1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.markerImage.getBoundingClientRect();return{x:(t-n.left)/this.zoomLevel,y:(e-n.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.addLicenseKey=function(t){c.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(e){return e(new K(t))})))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(e){return e(new K(t))})))},t.instanceCounter=0,t}()},66042:function(t,e,n){"use strict";n.d(e,{Z:function(){return T}});var i=n(33885),r=n(42978),o=n(43403),a=n(34280),s=n(59301),l=s.createContext(null),c=s.createContext({}),u=l,h=n(20068),d=n(54476),p=n(92310),f=n.n(p),m=n(77900),g=n(10228),v=n(26112),y=n(75931),b=n(8654),x=["prefixCls","className","containerRef"];var w=function(t){var e=t.prefixCls,n=t.className,i=t.containerRef,r=(0,y.Z)(t,x),o=s.useContext(c).panel,a=(0,b.x1)(o,i);return s.createElement("div",(0,d.Z)({className:f()("".concat(e,"-content"),n),role:"dialog",ref:a},(0,v.Z)(t,{aria:!0}),{"aria-modal":"true"},r))},C=n(48736);function k(t){return"string"==typeof t&&String(Number(t))===t?((0,C.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(t)):t}var S={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function E(t,e){var n,o,a,l=t.prefixCls,c=t.open,p=t.placement,y=t.inline,b=t.push,x=t.forceRender,C=t.autoFocus,E=t.keyboard,M=t.classNames,T=t.rootClassName,L=t.rootStyle,A=t.zIndex,D=t.className,P=t.id,N=t.style,B=t.motion,_=t.width,I=t.height,R=t.children,O=t.mask,F=t.maskClosable,j=t.maskMotion,Z=t.maskClassName,z=t.maskStyle,H=t.afterOpenChange,W=t.onClose,G=t.onMouseEnter,V=t.onMouseOver,U=t.onMouseLeave,q=t.onClick,K=t.onKeyDown,Y=t.onKeyUp,X=t.styles,J=t.drawerRender,Q=s.useRef(),$=s.useRef(),tt=s.useRef();s.useImperativeHandle(e,(function(){return Q.current}));s.useEffect((function(){var t;c&&C&&(null===(t=Q.current)||void 0===t||t.focus({preventScroll:!0}))}),[c]);var et=s.useState(!1),nt=(0,r.Z)(et,2),it=nt[0],rt=nt[1],ot=s.useContext(u),at=null!==(n=null!==(o=null===(a="boolean"==typeof b?b?{}:{distance:0}:b||{})||void 0===a?void 0:a.distance)&&void 0!==o?o:null==ot?void 0:ot.pushDistance)&&void 0!==n?n:180,st=s.useMemo((function(){return{pushDistance:at,push:function(){rt(!0)},pull:function(){rt(!1)}}}),[at]);s.useEffect((function(){var t,e;c?null==ot||null===(t=ot.push)||void 0===t||t.call(ot):null==ot||null===(e=ot.pull)||void 0===e||e.call(ot)}),[c]),s.useEffect((function(){return function(){var t;null==ot||null===(t=ot.pull)||void 0===t||t.call(ot)}}),[]);var lt=O&&s.createElement(m.default,(0,d.Z)({key:"mask"},j,{visible:c}),(function(t,e){var n=t.className,r=t.style;return s.createElement("div",{className:f()("".concat(l,"-mask"),n,null==M?void 0:M.mask,Z),style:(0,i.Z)((0,i.Z)((0,i.Z)({},r),z),null==X?void 0:X.mask),onClick:F&&c?W:void 0,ref:e})})),ct="function"==typeof B?B(p):B,ut={};if(it&&at)switch(p){case"top":ut.transform="translateY(".concat(at,"px)");break;case"bottom":ut.transform="translateY(".concat(-at,"px)");break;case"left":ut.transform="translateX(".concat(at,"px)");break;default:ut.transform="translateX(".concat(-at,"px)")}"left"===p||"right"===p?ut.width=k(_):ut.height=k(I);var ht={onMouseEnter:G,onMouseOver:V,onMouseLeave:U,onClick:q,onKeyDown:K,onKeyUp:Y},dt=s.createElement(m.default,(0,d.Z)({key:"panel"},ct,{visible:c,forceRender:x,onVisibleChanged:function(t){null==H||H(t)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),(function(e,n){var r=e.className,o=e.style,a=s.createElement(w,(0,d.Z)({id:P,containerRef:n,prefixCls:l,className:f()(D,null==M?void 0:M.content),style:(0,i.Z)((0,i.Z)({},N),null==X?void 0:X.content)},(0,v.Z)(t,{aria:!0}),ht),R);return s.createElement("div",(0,d.Z)({className:f()("".concat(l,"-content-wrapper"),null==M?void 0:M.wrapper,r),style:(0,i.Z)((0,i.Z)((0,i.Z)({},ut),o),null==X?void 0:X.wrapper)},(0,v.Z)(t,{data:!0})),J?J(a):a)})),pt=(0,i.Z)({},L);return A&&(pt.zIndex=A),s.createElement(u.Provider,{value:st},s.createElement("div",{className:f()(l,"".concat(l,"-").concat(p),T,(0,h.Z)((0,h.Z)({},"".concat(l,"-open"),c),"".concat(l,"-inline"),y)),style:pt,tabIndex:-1,ref:Q,onKeyDown:function(t){var e=t.keyCode,n=t.shiftKey;switch(e){case g.Z.TAB:var i;if(e===g.Z.TAB)if(n||document.activeElement!==tt.current){if(n&&document.activeElement===$.current){var r;null===(r=tt.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=$.current)||void 0===i||i.focus({preventScroll:!0});break;case g.Z.ESC:W&&E&&(t.stopPropagation(),W(t))}}},lt,s.createElement("div",{tabIndex:0,ref:$,style:S,"aria-hidden":"true","data-sentinel":"start"}),dt,s.createElement("div",{tabIndex:0,ref:tt,style:S,"aria-hidden":"true","data-sentinel":"end"})))}var M=s.forwardRef(E);var T=function(t){var e=t.open,n=void 0!==e&&e,l=t.prefixCls,u=void 0===l?"rc-drawer":l,h=t.placement,d=void 0===h?"right":h,p=t.autoFocus,f=void 0===p||p,m=t.keyboard,g=void 0===m||m,v=t.width,y=void 0===v?378:v,b=t.mask,x=void 0===b||b,w=t.maskClosable,C=void 0===w||w,k=t.getContainer,S=t.forceRender,E=t.afterOpenChange,T=t.destroyOnClose,L=t.onMouseEnter,A=t.onMouseOver,D=t.onMouseLeave,P=t.onClick,N=t.onKeyDown,B=t.onKeyUp,_=t.panelRef,I=s.useState(!1),R=(0,r.Z)(I,2),O=R[0],F=R[1];var j=s.useState(!1),Z=(0,r.Z)(j,2),z=Z[0],H=Z[1];(0,a.Z)((function(){H(!0)}),[]);var W=!!z&&n,G=s.useRef(),V=s.useRef();(0,a.Z)((function(){W&&(V.current=document.activeElement)}),[W]);var U=s.useMemo((function(){return{panel:_}}),[_]);if(!S&&!O&&!W&&T)return null;var q={onMouseEnter:L,onMouseOver:A,onMouseLeave:D,onClick:P,onKeyDown:N,onKeyUp:B},K=(0,i.Z)((0,i.Z)({},t),{},{open:W,prefixCls:u,placement:d,autoFocus:f,keyboard:g,width:y,mask:x,maskClosable:C,inline:!1===k,afterOpenChange:function(t){var e,n;(F(t),null==E||E(t),t||!V.current||null!==(e=G.current)&&void 0!==e&&e.contains(V.current))||(null===(n=V.current)||void 0===n||n.focus({preventScroll:!0}))},ref:G},q);return s.createElement(c.Provider,{value:U},s.createElement(o.Z,{open:W||S||O,autoDestroy:!1,getContainer:k,autoLock:x&&(W||O)},s.createElement(M,K)))}},25930:function(t,e,n){"use strict";n.d(e,{Cd:function(){return S}});var i=n(54476),r=n(33885),o=n(75931),a=n(59301),s=n(92310),l=n.n(s),c={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},u=function(){var t=(0,a.useRef)([]),e=(0,a.useRef)(null);return(0,a.useEffect)((function(){var n=Date.now(),i=!1;t.current.forEach((function(t){if(t){i=!0;var r=t.style;r.transitionDuration=".3s, .3s, .3s, .06s",e.current&&n-e.current<100&&(r.transitionDuration="0s, 0s")}})),i&&(e.current=Date.now())})),t.current};var h=n(76190),d=n(42978),p=n(47273),f=0,m=(0,p.Z)();var g=function(t){var e=a.useState(),n=(0,d.Z)(e,2),i=n[0],r=n[1];return a.useEffect((function(){var t;r("rc_progress_".concat((m?(t=f,f+=1):t="TEST_OR_SSR",t)))}),[]),t||i},v=function(t){var e=t.bg,n=t.children;return a.createElement("div",{style:{width:"100%",height:"100%",background:e}},n)};function y(t,e){return Object.keys(t).map((function(n){var i=parseFloat(n),r="".concat(Math.floor(i*e),"%");return"".concat(t[n]," ").concat(r)}))}var b=a.forwardRef((function(t,e){var n=t.prefixCls,i=t.color,r=t.gradientId,o=t.radius,s=t.style,l=t.ptg,c=t.strokeLinecap,u=t.strokeWidth,d=t.size,p=t.gapDegree,f=i&&"object"===(0,h.Z)(i),m=f?"#FFF":void 0,g=d/2,b=a.createElement("circle",{className:"".concat(n,"-circle-path"),r:o,cx:g,cy:g,stroke:m,strokeLinecap:c,strokeWidth:u,opacity:0===l?0:1,style:s,ref:e});if(!f)return b;var x="".concat(r,"-conic"),w=p?"".concat(180+p/2,"deg"):"0deg",C=y(i,(360-p)/360),k=y(i,1),S="conic-gradient(from ".concat(w,", ").concat(C.join(", "),")"),E="linear-gradient(to ".concat(p?"bottom":"top",", ").concat(k.join(", "),")");return a.createElement(a.Fragment,null,a.createElement("mask",{id:x},b),a.createElement("foreignObject",{x:0,y:0,width:d,height:d,mask:"url(#".concat(x,")")},a.createElement(v,{bg:E},a.createElement(v,{bg:S}))))})),x=100,w=function(t,e,n,i,r,o,a,s,l,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,h=n/100*360*((360-o)/360),d=0===o?0:{bottom:0,top:180,left:90,right:-90}[a],p=(100-i)/100*e;"round"===l&&100!==i&&(p+=c/2)>=e&&(p=e-.01);var f=50;return{stroke:"string"==typeof s?s:void 0,strokeDasharray:"".concat(e,"px ").concat(t),strokeDashoffset:p+u,transform:"rotate(".concat(r+h+d,"deg)"),transformOrigin:"".concat(f,"px ").concat(f,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},C=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function k(t){var e=null!=t?t:[];return Array.isArray(e)?e:[e]}var S=function(t){var e,n,s,d=(0,r.Z)((0,r.Z)({},c),t),p=d.id,f=d.prefixCls,m=d.steps,v=d.strokeWidth,y=d.trailWidth,S=d.gapDegree,E=void 0===S?0:S,M=d.gapPosition,T=d.trailColor,L=d.strokeLinecap,A=d.style,D=d.className,P=d.strokeColor,N=d.percent,B=(0,o.Z)(d,C),_=g(p),I="".concat(_,"-gradient"),R=50-v/2,O=2*Math.PI*R,F=E>0?90+E/2:-90,j=O*((360-E)/360),Z="object"===(0,h.Z)(m)?m:{count:m,gap:2},z=Z.count,H=Z.gap,W=k(N),G=k(P),V=G.find((function(t){return t&&"object"===(0,h.Z)(t)})),U=V&&"object"===(0,h.Z)(V)?"butt":L,q=w(O,j,0,100,F,E,M,T,U,v),K=u();return a.createElement("svg",(0,i.Z)({className:l()("".concat(f,"-circle"),D),viewBox:"0 0 ".concat(x," ").concat(x),style:A,id:p,role:"presentation"},B),!z&&a.createElement("circle",{className:"".concat(f,"-circle-trail"),r:R,cx:50,cy:50,stroke:T,strokeLinecap:U,strokeWidth:y||v,style:q}),z?(e=Math.round(z*(W[0]/100)),n=100/z,s=0,new Array(z).fill(null).map((function(t,i){var r=i<=e-1?G[0]:T,o=r&&"object"===(0,h.Z)(r)?"url(#".concat(I,")"):void 0,l=w(O,j,s,n,F,E,M,r,"butt",v,H);return s+=100*(j-l.strokeDashoffset+H)/j,a.createElement("circle",{key:i,className:"".concat(f,"-circle-path"),r:R,cx:50,cy:50,stroke:o,strokeWidth:v,opacity:1,style:l,ref:function(t){K[i]=t}})}))):function(){var t=0;return W.map((function(e,n){var i=G[n]||G[G.length-1],r=w(O,j,t,e,F,E,M,i,U,v);return t+=e,a.createElement(b,{key:n,color:i,ptg:e,radius:R,prefixCls:f,gradientId:I,style:r,strokeLinecap:U,strokeWidth:v,gapDegree:E,ref:function(t){K[n]=t},size:x})})).reverse()}())}},6551:function(t,e,n){"use strict";n.d(e,{ZP:function(){return l}});var i=n(42978),r=n(59301),o=n(47273),a=0,s=(0,o.Z)();function l(t){var e=r.useState(),n=(0,i.Z)(e,2),o=n[0],l=n[1];return r.useEffect((function(){var t;l("rc_select_".concat((s?(t=a,a+=1):t="TEST_OR_SSR",t)))}),[]),t||o}},37463:function(t,e,n){"use strict";n.d(e,{Ac:function(){return tt},Xo:function(){return nt},Wx:function(){return rt},ZP:function(){return Et},lk:function(){return x}});var i=n(54476),r=n(94480),o=n(20068),a=n(33885),s=n(42978),l=n(75931),c=n(76190),u=n(18929),h=n(48736),d=n(59301),p=n(92310),f=n.n(p),m=n(34280),g=n(49658),v=n(8654),y=function(t){var e=t.className,n=t.customizeIcon,i=t.customizeIconProps,r=t.children,o=t.onMouseDown,a=t.onClick,s="function"==typeof n?n(i):n;return d.createElement("span",{className:e,onMouseDown:function(t){t.preventDefault(),null==o||o(t)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==s?s:d.createElement("span",{className:f()(e.split(/\s+/).map((function(t){return"".concat(t,"-icon")})))},r))},b=d.createContext(null);function x(){return d.useContext(b)}function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,e=d.useRef(null),n=d.useRef(null);function i(i){(i||null===e.current)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout((function(){e.current=null}),t)}return d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return e.current},i]}var C=n(10228);var k=n(26112),S=n(83836);var E=function(t,e,n){var i=(0,a.Z)((0,a.Z)({},t),n?e:{});return Object.keys(e).forEach((function(n){var r=e[n];"function"==typeof r&&(i[n]=function(){for(var e,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r.apply(void 0,o),null===(e=t[n])||void 0===e?void 0:e.call.apply(e,[t].concat(o))})})),i},M=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],T=function(t,e){var n=t.prefixCls,i=t.id,r=t.inputElement,o=t.autoFocus,s=t.autoComplete,c=t.editable,u=t.activeDescendantId,p=t.value,m=t.open,g=t.attrs,y=(0,l.Z)(t,M),b=r||d.createElement("input",null),x=b,w=x.ref,C=x.props;return(0,h.Kp)(!("maxLength"in b.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),b=d.cloneElement(b,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},E(y,C,!0)),{},{id:i,ref:(0,v.sQ)(e,w),autoComplete:s||"off",autoFocus:o,className:f()("".concat(n,"-selection-search-input"),null==C?void 0:C.className),role:"combobox","aria-expanded":m||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":m?u:void 0},g),{},{value:c?p:"",readOnly:!c,unselectable:c?null:"on",style:(0,a.Z)((0,a.Z)({},C.style),{},{opacity:c?null:0})}))};var L=d.forwardRef(T);function A(t){return Array.isArray(t)?t:void 0!==t?[t]:[]}var D="undefined"!=typeof window&&window.document&&window.document.documentElement;function P(t){return["string","number"].includes((0,c.Z)(t))}function N(t){var e=void 0;return t&&(P(t.title)?e=t.title.toString():P(t.label)&&(e=t.label.toString())),e}function B(t){var e;return null!==(e=t.key)&&void 0!==e?e:t.value}var _=function(t){t.preventDefault(),t.stopPropagation()},I=function(t){var e,n,i=t.id,r=t.prefixCls,a=t.values,l=t.open,c=t.searchValue,u=t.autoClearSearchValue,h=t.inputRef,p=t.placeholder,m=t.disabled,g=t.mode,v=t.showSearch,b=t.autoFocus,x=t.autoComplete,w=t.activeDescendantId,C=t.tabIndex,E=t.removeIcon,M=t.maxTagCount,T=t.maxTagTextLength,A=t.maxTagPlaceholder,P=void 0===A?function(t){return"+ ".concat(t.length," ...")}:A,I=t.tagRender,R=t.onToggleOpen,O=t.onRemove,F=t.onInputChange,j=t.onInputPaste,Z=t.onInputKeyDown,z=t.onInputMouseDown,H=t.onInputCompositionStart,W=t.onInputCompositionEnd,G=t.onInputBlur,V=d.useRef(null),U=(0,d.useState)(0),q=(0,s.Z)(U,2),K=q[0],Y=q[1],X=(0,d.useState)(!1),J=(0,s.Z)(X,2),Q=J[0],$=J[1],tt="".concat(r,"-selection"),et=l||"multiple"===g&&!1===u||"tags"===g?c:"",nt="tags"===g||"multiple"===g&&!1===u||v&&(l||Q);e=function(){Y(V.current.scrollWidth)},n=[et],D?d.useLayoutEffect(e,n):d.useEffect(e,n);var it=function(t,e,n,i,r){return d.createElement("span",{title:N(t),className:f()("".concat(tt,"-item"),(0,o.Z)({},"".concat(tt,"-item-disabled"),n))},d.createElement("span",{className:"".concat(tt,"-item-content")},e),i&&d.createElement(y,{className:"".concat(tt,"-item-remove"),onMouseDown:_,onClick:r,customizeIcon:E},"×"))},rt=function(t,e,n,i,r,o){return d.createElement("span",{onMouseDown:function(t){_(t),R(!l)}},I({label:e,value:t,disabled:n,closable:i,onClose:r,isMaxTag:!!o}))},ot=d.createElement("div",{className:"".concat(tt,"-search"),style:{width:K},onFocus:function(){$(!0)},onBlur:function(){$(!1)}},d.createElement(L,{ref:h,open:l,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:b,autoComplete:x,editable:nt,activeDescendantId:w,value:et,onKeyDown:Z,onMouseDown:z,onChange:F,onPaste:j,onCompositionStart:H,onCompositionEnd:W,onBlur:G,tabIndex:C,attrs:(0,k.Z)(t,!0)}),d.createElement("span",{ref:V,className:"".concat(tt,"-search-mirror"),"aria-hidden":!0},et," ")),at=d.createElement(S.Z,{prefixCls:"".concat(tt,"-overflow"),data:a,renderItem:function(t){var e=t.disabled,n=t.label,i=t.value,r=!m&&!e,o=n;if("number"==typeof T&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>T&&(o="".concat(a.slice(0,T),"..."))}var s=function(e){e&&e.stopPropagation(),O(t)};return"function"==typeof I?rt(i,o,e,r,s):it(t,o,e,r,s)},renderRest:function(t){if(!a.length)return null;var e="function"==typeof P?P(t):P;return"function"==typeof I?rt(void 0,e,!1,!1,void 0,!0):it({title:e},e,!1)},suffix:ot,itemKey:B,maxCount:M});return d.createElement("span",{className:"".concat(tt,"-wrap")},at,!a.length&&!et&&d.createElement("span",{className:"".concat(tt,"-placeholder")},p))},R=function(t){var e=t.inputElement,n=t.prefixCls,i=t.id,r=t.inputRef,o=t.disabled,a=t.autoFocus,l=t.autoComplete,c=t.activeDescendantId,u=t.mode,h=t.open,p=t.values,f=t.placeholder,m=t.tabIndex,g=t.showSearch,v=t.searchValue,y=t.activeValue,b=t.maxLength,x=t.onInputKeyDown,w=t.onInputMouseDown,C=t.onInputChange,S=t.onInputPaste,E=t.onInputCompositionStart,M=t.onInputCompositionEnd,T=t.onInputBlur,A=t.title,D=d.useState(!1),P=(0,s.Z)(D,2),B=P[0],_=P[1],I="combobox"===u,R=I||g,O=p[0],F=v||"";I&&y&&!B&&(F=y),d.useEffect((function(){I&&_(!1)}),[I,y]);var j=!("combobox"!==u&&!h&&!g)&&!!F,Z=void 0===A?N(O):A,z=d.useMemo((function(){return O?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:j?{visibility:"hidden"}:void 0},f)}),[O,j,f,n]);return d.createElement("span",{className:"".concat(n,"-selection-wrap")},d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(L,{ref:r,prefixCls:n,id:i,open:h,inputElement:e,disabled:o,autoFocus:a,autoComplete:l,editable:R,activeDescendantId:c,value:F,onKeyDown:x,onMouseDown:w,onChange:function(t){_(!0),C(t)},onPaste:S,onCompositionStart:E,onCompositionEnd:M,onBlur:T,tabIndex:m,attrs:(0,k.Z)(t,!0),maxLength:I?b:void 0})),!I&&O?d.createElement("span",{className:"".concat(n,"-selection-item"),title:Z,style:j?{visibility:"hidden"}:void 0},O.label):null,z)},O=function(t,e){var n=(0,d.useRef)(null),r=(0,d.useRef)(!1),o=t.prefixCls,a=t.open,l=t.mode,c=t.showSearch,u=t.tokenWithEnter,h=t.disabled,p=t.prefix,f=t.autoClearSearchValue,m=t.onSearch,g=t.onSearchSubmit,v=t.onToggleOpen,y=t.onInputKeyDown,b=t.onInputBlur,x=t.domRef;d.useImperativeHandle(e,(function(){return{focus:function(t){n.current.focus(t)},blur:function(){n.current.blur()}}}));var k=w(0),S=(0,s.Z)(k,2),E=S[0],M=S[1],T=(0,d.useRef)(null),L=function(t){!1!==m(t,!0,r.current)&&v(!0)},A={inputRef:n,onInputKeyDown:function(t){var e,i=t.which,o=n.current instanceof HTMLTextAreaElement;(o||!a||i!==C.Z.UP&&i!==C.Z.DOWN||t.preventDefault(),y&&y(t),i!==C.Z.ENTER||"tags"!==l||r.current||a||null==g||g(t.target.value),o&&!a&&~[C.Z.UP,C.Z.DOWN,C.Z.LEFT,C.Z.RIGHT].indexOf(i))||(e=i)&&![C.Z.ESC,C.Z.SHIFT,C.Z.BACKSPACE,C.Z.TAB,C.Z.WIN_KEY,C.Z.ALT,C.Z.META,C.Z.WIN_KEY_RIGHT,C.Z.CTRL,C.Z.SEMICOLON,C.Z.EQUALS,C.Z.CAPS_LOCK,C.Z.CONTEXT_MENU,C.Z.F1,C.Z.F2,C.Z.F3,C.Z.F4,C.Z.F5,C.Z.F6,C.Z.F7,C.Z.F8,C.Z.F9,C.Z.F10,C.Z.F11,C.Z.F12].includes(e)&&v(!0)},onInputMouseDown:function(){M(!0)},onInputChange:function(t){var e=t.target.value;if(u&&T.current&&/[\r\n]/.test(T.current)){var n=T.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");e=e.replace(n,T.current)}T.current=null,L(e)},onInputPaste:function(t){var e=t.clipboardData,n=null==e?void 0:e.getData("text");T.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(t){r.current=!1,"combobox"!==l&&L(t.target.value)},onInputBlur:b},D="multiple"===l||"tags"===l?d.createElement(I,(0,i.Z)({},t,A)):d.createElement(R,(0,i.Z)({},t,A));return d.createElement("div",{ref:x,className:"".concat(o,"-selector"),onClick:function(t){t.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(t){var e=E();t.target===n.current||e||"combobox"===l&&h||t.preventDefault(),("combobox"===l||c&&e)&&a||(a&&!1!==f&&m("",!0,!1),v())}},p&&d.createElement("div",{className:"".concat(o,"-prefix")},p),D)};var F=d.forwardRef(O),j=n(65030),Z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],z=function(t,e){var n=t.prefixCls,r=(t.disabled,t.visible),s=t.children,c=t.popupElement,u=t.animation,h=t.transitionName,p=t.dropdownStyle,m=t.dropdownClassName,g=t.direction,v=void 0===g?"ltr":g,y=t.placement,b=t.builtinPlacements,x=t.dropdownMatchSelectWidth,w=t.dropdownRender,C=t.dropdownAlign,k=t.getPopupContainer,S=t.empty,E=t.getTriggerDOMNode,M=t.onPopupVisibleChange,T=t.onPopupMouseEnter,L=(0,l.Z)(t,Z),A="".concat(n,"-dropdown"),D=c;w&&(D=w(c));var P=d.useMemo((function(){return b||function(t){var e=!0===t?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:e,adjustY:1},htmlRegion:"scroll"}}}(x)}),[b,x]),N=u?"".concat(A,"-").concat(u):h,B="number"==typeof x,_=d.useMemo((function(){return B?null:!1===x?"minWidth":"width"}),[x,B]),I=p;B&&(I=(0,a.Z)((0,a.Z)({},I),{},{width:x}));var R=d.useRef(null);return d.useImperativeHandle(e,(function(){return{getPopupElement:function(){var t;return null===(t=R.current)||void 0===t?void 0:t.popupElement}}})),d.createElement(j.Z,(0,i.Z)({},L,{showAction:M?["click"]:[],hideAction:M?["click"]:[],popupPlacement:y||("rtl"===v?"bottomRight":"bottomLeft"),builtinPlacements:P,prefixCls:A,popupTransitionName:N,popup:d.createElement("div",{onMouseEnter:T},D),ref:R,stretch:_,popupAlign:C,popupVisible:r,getPopupContainer:k,popupClassName:f()(m,(0,o.Z)({},"".concat(A,"-empty"),S)),popupStyle:I,getTriggerDOMNode:E,onPopupVisibleChange:M}),s)};var H=d.forwardRef(z),W=n(66712);function G(t,e){var n,i=t.key;return"value"in t&&(n=t.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(e)}function V(t){return void 0!==t&&!Number.isNaN(t)}function U(t,e){var n=t||{},i=n.label||(e?"children":"label");return{label:i,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||i}}function q(t){var e=(0,a.Z)({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return(0,h.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var K=d.createContext(null);function Y(t){var e=t.visible,n=t.values;if(!e)return null;return d.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map((function(t){var e=t.label,n=t.value;return["number","string"].includes((0,c.Z)(e))?e:n})).join(", ")),n.length>50?", ...":null)}var X=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],J=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Q=function(t){return"tags"===t||"multiple"===t},$=d.forwardRef((function(t,e){var n,h=t.id,p=t.prefixCls,x=t.className,C=t.showSearch,k=t.tagRender,S=t.direction,E=t.omitDomProps,M=t.displayValues,T=t.onDisplayValuesChange,L=t.emptyOptions,A=t.notFoundContent,D=void 0===A?"Not Found":A,P=t.onClear,N=t.mode,B=t.disabled,_=t.loading,I=t.getInputElement,R=t.getRawInputElement,O=t.open,j=t.defaultOpen,Z=t.onDropdownVisibleChange,z=t.activeValue,G=t.onActiveValueChange,U=t.activeDescendantId,q=t.searchValue,$=t.autoClearSearchValue,tt=t.onSearch,et=t.onSearchSplit,nt=t.tokenSeparators,it=t.allowClear,rt=t.prefix,ot=t.suffixIcon,at=t.clearIcon,st=t.OptionList,lt=t.animation,ct=t.transitionName,ut=t.dropdownStyle,ht=t.dropdownClassName,dt=t.dropdownMatchSelectWidth,pt=t.dropdownRender,ft=t.dropdownAlign,mt=t.placement,gt=t.builtinPlacements,vt=t.getPopupContainer,yt=t.showAction,bt=void 0===yt?[]:yt,xt=t.onFocus,wt=t.onBlur,Ct=t.onKeyUp,kt=t.onKeyDown,St=t.onMouseDown,Et=(0,l.Z)(t,X),Mt=Q(N),Tt=(void 0!==C?C:Mt)||"combobox"===N,Lt=(0,a.Z)({},Et);J.forEach((function(t){delete Lt[t]})),null==E||E.forEach((function(t){delete Lt[t]}));var At=d.useState(!1),Dt=(0,s.Z)(At,2),Pt=Dt[0],Nt=Dt[1];d.useEffect((function(){Nt((0,g.Z)())}),[]);var Bt=d.useRef(null),_t=d.useRef(null),It=d.useRef(null),Rt=d.useRef(null),Ot=d.useRef(null),Ft=d.useRef(!1),jt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=d.useState(!1),n=(0,s.Z)(e,2),i=n[0],r=n[1],o=d.useRef(null),a=function(){window.clearTimeout(o.current)};return d.useEffect((function(){return a}),[]),[i,function(e,n){a(),o.current=window.setTimeout((function(){r(e),n&&n()}),t)},a]}(),Zt=(0,s.Z)(jt,3),zt=Zt[0],Ht=Zt[1],Wt=Zt[2];d.useImperativeHandle(e,(function(){var t,e;return{focus:null===(t=Rt.current)||void 0===t?void 0:t.focus,blur:null===(e=Rt.current)||void 0===e?void 0:e.blur,scrollTo:function(t){var e;return null===(e=Ot.current)||void 0===e?void 0:e.scrollTo(t)},nativeElement:Bt.current||_t.current}}));var Gt=d.useMemo((function(){var t;if("combobox"!==N)return q;var e=null===(t=M[0])||void 0===t?void 0:t.value;return"string"==typeof e||"number"==typeof e?String(e):""}),[q,N,M]),Vt="combobox"===N&&"function"==typeof I&&I()||null,Ut="function"==typeof R&&R(),qt=(0,v.x1)(_t,null==Ut||null===(n=Ut.props)||void 0===n?void 0:n.ref),Kt=d.useState(!1),Yt=(0,s.Z)(Kt,2),Xt=Yt[0],Jt=Yt[1];(0,m.Z)((function(){Jt(!0)}),[]);var Qt=(0,u.Z)(!1,{defaultValue:j,value:O}),$t=(0,s.Z)(Qt,2),te=$t[0],ee=$t[1],ne=!!Xt&&te,ie=!D&&L;(B||ie&&ne&&"combobox"===N)&&(ne=!1);var re=!ie&&ne,oe=d.useCallback((function(t){var e=void 0!==t?t:!ne;B||(ee(e),ne!==e&&(null==Z||Z(e)))}),[B,ne,ee,Z]),ae=d.useMemo((function(){return(nt||[]).some((function(t){return["\n","\r\n"].includes(t)}))}),[nt]),se=d.useContext(K)||{},le=se.maxCount,ce=se.rawValues,ue=function(t,e,n){if(!(Mt&&V(le)&&(null==ce?void 0:ce.size)>=le)){var i=!0,o=t;null==G||G(null);var a=function(t,e,n){if(!e||!e.length)return null;var i=!1,o=function t(e,n){var o=(0,W.Z)(n),a=o[0],s=o.slice(1);if(!a)return[e];var l=e.split(a);return i=i||l.length>1,l.reduce((function(e,n){return[].concat((0,r.Z)(e),(0,r.Z)(t(n,s)))}),[]).filter(Boolean)}(t,e);return i?void 0!==n?o.slice(0,n):o:null}(t,nt,V(le)?le-ce.size:void 0),s=n?null:a;return"combobox"!==N&&s&&(o="",null==et||et(s),oe(!1),i=!1),tt&&Gt!==o&&tt(o,{source:e?"typing":"effect"}),i}};d.useEffect((function(){ne||Mt||"combobox"===N||ue("",!1,!1)}),[ne]),d.useEffect((function(){te&&B&&ee(!1),B&&!Ft.current&&Ht(!1)}),[B]);var he=w(),de=(0,s.Z)(he,2),pe=de[0],fe=de[1],me=d.useRef(!1),ge=d.useRef(!1),ve=[];d.useEffect((function(){return function(){ve.forEach((function(t){return clearTimeout(t)})),ve.splice(0,ve.length)}}),[]);var ye,be=d.useState({}),xe=(0,s.Z)(be,2)[1];Ut&&(ye=function(t){oe(t)}),function(t,e,n,i){var r=d.useRef(null);r.current={open:e,triggerOpen:n,customizedTrigger:i},d.useEffect((function(){function e(e){var n;if(null===(n=r.current)||void 0===n||!n.customizedTrigger){var i=e.target;i.shadowRoot&&e.composed&&(i=e.composedPath()[0]||i),r.current.open&&t().filter((function(t){return t})).every((function(t){return!t.contains(i)&&t!==i}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[])}((function(){var t;return[Bt.current,null===(t=It.current)||void 0===t?void 0:t.getPopupElement()]}),re,oe,!!Ut);var we,Ce=d.useMemo((function(){return(0,a.Z)((0,a.Z)({},t),{},{notFoundContent:D,open:ne,triggerOpen:re,id:h,showSearch:Tt,multiple:Mt,toggleOpen:oe})}),[t,D,re,ne,h,Tt,Mt,oe]),ke=!!ot||_;ke&&(we=d.createElement(y,{className:f()("".concat(p,"-arrow"),(0,o.Z)({},"".concat(p,"-arrow-loading"),_)),customizeIcon:ot,customizeIconProps:{loading:_,searchValue:Gt,open:ne,focused:zt,showSearch:Tt}}));var Se,Ee=function(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,l=d.useMemo((function(){return"object"===(0,c.Z)(i)?i.clearIcon:r||void 0}),[i,r]),u=d.useMemo((function(){return!(o||!i||!n.length&&!a||"combobox"===s&&""===a)}),[i,o,n.length,a,s]);return{allowClear:u,clearIcon:d.createElement(y,{className:"".concat(t,"-clear"),onMouseDown:e,customizeIcon:l},"×")}}(p,(function(){var t;null==P||P(),null===(t=Rt.current)||void 0===t||t.focus(),T([],{type:"clear",values:M}),ue("",!1,!1)}),M,it,at,B,Gt,N),Me=Ee.allowClear,Te=Ee.clearIcon,Le=d.createElement(st,{ref:Ot}),Ae=f()(p,x,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(p,"-focused"),zt),"".concat(p,"-multiple"),Mt),"".concat(p,"-single"),!Mt),"".concat(p,"-allow-clear"),it),"".concat(p,"-show-arrow"),ke),"".concat(p,"-disabled"),B),"".concat(p,"-loading"),_),"".concat(p,"-open"),ne),"".concat(p,"-customize-input"),Vt),"".concat(p,"-show-search"),Tt)),De=d.createElement(H,{ref:It,disabled:B,prefixCls:p,visible:re,popupElement:Le,animation:lt,transitionName:ct,dropdownStyle:ut,dropdownClassName:ht,direction:S,dropdownMatchSelectWidth:dt,dropdownRender:pt,dropdownAlign:ft,placement:mt,builtinPlacements:gt,getPopupContainer:vt,empty:L,getTriggerDOMNode:function(t){return _t.current||t},onPopupVisibleChange:ye,onPopupMouseEnter:function(){xe({})}},Ut?d.cloneElement(Ut,{ref:qt}):d.createElement(F,(0,i.Z)({},t,{domRef:_t,prefixCls:p,inputElement:Vt,ref:Rt,id:h,prefix:rt,showSearch:Tt,autoClearSearchValue:$,mode:N,activeDescendantId:U,tagRender:k,values:M,open:ne,onToggleOpen:oe,activeValue:z,searchValue:Gt,onSearch:ue,onSearchSubmit:function(t){t&&t.trim()&&tt(t,{source:"submit"})},onRemove:function(t){var e=M.filter((function(e){return e!==t}));T(e,{type:"remove",values:[t]})},tokenWithEnter:ae,onInputBlur:function(){me.current=!1}})));return Se=Ut?De:d.createElement("div",(0,i.Z)({className:Ae},Lt,{ref:Bt,onMouseDown:function(t){var e,n=t.target,i=null===(e=It.current)||void 0===e?void 0:e.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var t,e=ve.indexOf(r);-1!==e&&ve.splice(e,1),Wt(),Pt||i.contains(document.activeElement)||null===(t=Rt.current)||void 0===t||t.focus()}));ve.push(r)}for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];null==St||St.apply(void 0,[t].concat(a))},onKeyDown:function(t){var e,n=pe(),i=t.key,o="Enter"===i;if(o&&("combobox"!==N&&t.preventDefault(),ne||oe(!0)),fe(!!Gt),"Backspace"===i&&!n&&Mt&&!Gt&&M.length){for(var a=(0,r.Z)(M),s=null,l=a.length-1;l>=0;l-=1){var c=a[l];if(!c.disabled){a.splice(l,1),s=c;break}}s&&T(a,{type:"remove",values:[s]})}for(var u=arguments.length,h=new Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];!ne||o&&me.current||(o&&(me.current=!0),null===(e=Ot.current)||void 0===e||e.onKeyDown.apply(e,[t].concat(h))),null==kt||kt.apply(void 0,[t].concat(h))},onKeyUp:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r;ne&&(null===(r=Ot.current)||void 0===r||r.onKeyUp.apply(r,[t].concat(n))),"Enter"===t.key&&(me.current=!1),null==Ct||Ct.apply(void 0,[t].concat(n))},onFocus:function(){Ht(!0),B||(xt&&!ge.current&&xt.apply(void 0,arguments),bt.includes("focus")&&oe(!0)),ge.current=!0},onBlur:function(){Ft.current=!0,Ht(!1,(function(){ge.current=!1,Ft.current=!1,oe(!1)})),B||(Gt&&("tags"===N?tt(Gt,{source:"submit"}):"multiple"===N&&tt("",{source:"blur"})),wt&&wt.apply(void 0,arguments))}}),d.createElement(Y,{visible:zt&&!ne,values:M}),De,we,Me&&Te),d.createElement(b.Provider,{value:Ce},Se)}));var tt=$,et=function(){return null};et.isSelectOptGroup=!0;var nt=et,it=function(){return null};it.isSelectOption=!0;var rt=it,ot=n(80547),at=n(2738),st=n(48911);var lt=["disabled","title","children","style","className"];function ct(t){return"string"==typeof t||"number"==typeof t}var ut=function(t,e){var n=x(),a=n.prefixCls,c=n.id,u=n.open,h=n.multiple,p=n.mode,m=n.searchValue,g=n.toggleOpen,v=n.notFoundContent,b=n.onPopupScroll,w=d.useContext(K),S=w.maxCount,E=w.flattenOptions,M=w.onActiveValue,T=w.defaultActiveFirstOption,L=w.onSelect,A=w.menuItemSelectedIcon,D=w.rawValues,P=w.fieldNames,N=w.virtual,B=w.direction,_=w.listHeight,I=w.listItemHeight,R=w.optionRender,O="".concat(a,"-item"),F=(0,ot.Z)((function(){return E}),[u,E],(function(t,e){return e[0]&&t[1]!==e[1]})),j=d.useRef(null),Z=d.useMemo((function(){return h&&V(S)&&(null==D?void 0:D.size)>=S}),[h,S,null==D?void 0:D.size]),z=function(t){t.preventDefault()},H=function(t){var e;null===(e=j.current)||void 0===e||e.scrollTo("number"==typeof t?{index:t}:t)},W=d.useCallback((function(t){return"combobox"!==p&&D.has(t)}),[p,(0,r.Z)(D).toString(),D.size]),G=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=F.length,i=0;i<n;i+=1){var r=(t+i*e+n)%n,o=F[r]||{},a=o.group,s=o.data;if(!a&&(null==s||!s.disabled)&&(W(s.value)||!Z))return r}return-1},U=d.useState((function(){return G(0)})),q=(0,s.Z)(U,2),Y=q[0],X=q[1],J=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];X(t);var n={source:e?"keyboard":"mouse"},i=F[t];i?M(i.value,t,n):M(null,-1,n)};(0,d.useEffect)((function(){J(!1!==T?G(0):-1)}),[F.length,m]);var Q=d.useCallback((function(t){return"combobox"===p?String(t).toLowerCase()===m.toLowerCase():D.has(t)}),[p,m,(0,r.Z)(D).toString(),D.size]);(0,d.useEffect)((function(){var t,e=setTimeout((function(){if(!h&&u&&1===D.size){var t=Array.from(D)[0],e=F.findIndex((function(e){var n=e.data;return m?String(n.value).startsWith(m):n.value===t}));-1!==e&&(J(e),H(e))}}));u&&(null===(t=j.current)||void 0===t||t.scrollTo(void 0));return function(){return clearTimeout(e)}}),[u,m]);var $=function(t){void 0!==t&&L(t,{selected:!D.has(t)}),h||g(!1)};if(d.useImperativeHandle(e,(function(){return{onKeyDown:function(t){var e=t.which,n=t.ctrlKey;switch(e){case C.Z.N:case C.Z.P:case C.Z.UP:case C.Z.DOWN:var i=0;if(e===C.Z.UP?i=-1:e===C.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(e===C.Z.N?i=1:e===C.Z.P&&(i=-1)),0!==i){var r=G(Y+i,i);H(r),J(r,!0)}break;case C.Z.TAB:case C.Z.ENTER:var o,a=F[Y];!a||null!=a&&null!==(o=a.data)&&void 0!==o&&o.disabled||Z?$(void 0):$(a.value),u&&t.preventDefault();break;case C.Z.ESC:g(!1),u&&t.stopPropagation()}},onKeyUp:function(){},scrollTo:function(t){H(t)}}})),0===F.length)return d.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(O,"-empty"),onMouseDown:z},v);var tt=Object.keys(P).map((function(t){return P[t]})),et=function(t){return t.label};function nt(t,e){return{role:t.group?"presentation":"option",id:"".concat(c,"_list_").concat(e)}}var it=function(t){var e=F[t];if(!e)return null;var n=e.data||{},r=n.value,o=e.group,a=(0,k.Z)(n,!0),s=et(e);return e?d.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof s||o?null:s},a,{key:t},nt(e,t),{"aria-selected":Q(r)}),r):null},rt={role:"listbox",id:"".concat(c,"_list")};return d.createElement(d.Fragment,null,N&&d.createElement("div",(0,i.Z)({},rt,{style:{height:0,width:0,overflow:"hidden"}}),it(Y-1),it(Y),it(Y+1)),d.createElement(st.Z,{itemKey:"key",ref:j,data:F,height:_,itemHeight:I,fullHeight:!1,onMouseDown:z,onScroll:b,virtual:N,direction:B,innerProps:N?null:rt},(function(t,e){var n=t.group,r=t.groupOption,a=t.data,s=t.label,c=t.value,u=a.key;if(n){var h,p=null!==(h=a.title)&&void 0!==h?h:ct(s)?s.toString():void 0;return d.createElement("div",{className:f()(O,"".concat(O,"-group"),a.className),title:p},void 0!==s?s:u)}var m=a.disabled,g=a.title,v=(a.children,a.style),b=a.className,x=(0,l.Z)(a,lt),w=(0,at.Z)(x,tt),C=W(c),S=m||!C&&Z,E="".concat(O,"-option"),M=f()(O,E,b,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(E,"-grouped"),r),"".concat(E,"-active"),Y===e&&!S),"".concat(E,"-disabled"),S),"".concat(E,"-selected"),C)),T=et(t),L=!A||"function"==typeof A||C,D="number"==typeof T?T:T||c,P=ct(D)?D.toString():void 0;return void 0!==g&&(P=g),d.createElement("div",(0,i.Z)({},(0,k.Z)(w),N?{}:nt(t,e),{"aria-selected":Q(c),className:M,title:P,onMouseMove:function(){Y===e||S||J(e)},onClick:function(){S||$(c)},style:v}),d.createElement("div",{className:"".concat(E,"-content")},"function"==typeof R?R(t,{index:e}):D),d.isValidElement(A)||C,L&&d.createElement(y,{className:"".concat(O,"-option-state"),customizeIcon:A,customizeIconProps:{value:c,disabled:S,isSelected:C}},C?"✓":null))})))};var ht=d.forwardRef(ut);function dt(t,e){return A(t).join("").toUpperCase().includes(e)}var pt=n(6551),ft=n(11592),mt=["children","value"],gt=["children"];function vt(t){var e=t,n=e.key,i=e.props,r=i.children,o=i.value,s=(0,l.Z)(i,mt);return(0,a.Z)({key:n,value:void 0!==o?o:n,children:r},s)}function yt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,ft.Z)(t).map((function(t,n){if(!d.isValidElement(t)||!t.type)return null;var i=t,r=i.type.isSelectOptGroup,o=i.key,s=i.props,c=s.children,u=(0,l.Z)(s,gt);return e||!r?vt(t):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},u),{},{options:yt(c)})})).filter((function(t){return t}))}var bt=function(t,e,n,i,r){return d.useMemo((function(){var o=t;!t&&(o=yt(e));var a=new Map,s=new Map,l=function(t,e,n){n&&"string"==typeof n&&t.set(e[n],e)};return function t(e){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c<e.length;c+=1){var u=e[c];!u[n.options]||o?(a.set(u[n.value],u),l(s,u,n.label),l(s,u,i),l(s,u,r)):t(u[n.options],!0)}}(o),{options:o,valueOptions:a,labelOptions:s}}),[t,e,n,i,r])};function xt(t){var e=d.useRef();e.current=t;var n=d.useCallback((function(){return e.current.apply(e,arguments)}),[]);return n}var wt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Ct=["inputValue"];var kt=d.forwardRef((function(t,e){var n=t.id,h=t.mode,p=t.prefixCls,f=void 0===p?"rc-select":p,m=t.backfill,g=t.fieldNames,v=t.inputValue,y=t.searchValue,b=t.onSearch,x=t.autoClearSearchValue,w=void 0===x||x,C=t.onSelect,k=t.onDeselect,S=t.dropdownMatchSelectWidth,E=void 0===S||S,M=t.filterOption,T=t.filterSort,L=t.optionFilterProp,D=t.optionLabelProp,P=t.options,N=t.optionRender,B=t.children,_=t.defaultActiveFirstOption,I=t.menuItemSelectedIcon,R=t.virtual,O=t.direction,F=t.listHeight,j=void 0===F?200:F,Z=t.listItemHeight,z=void 0===Z?20:Z,H=t.labelRender,W=t.value,V=t.defaultValue,Y=t.labelInValue,X=t.onChange,J=t.maxCount,$=(0,l.Z)(t,wt),et=(0,pt.ZP)(n),nt=Q(h),it=!(P||!B),rt=d.useMemo((function(){return(void 0!==M||"combobox"!==h)&&M}),[M,h]),ot=d.useMemo((function(){return U(g,it)}),[JSON.stringify(g),it]),at=(0,u.Z)("",{value:void 0!==y?y:v,postState:function(t){return t||""}}),st=(0,s.Z)(at,2),lt=st[0],ct=st[1],ut=bt(P,B,ot,L,D),ft=ut.valueOptions,mt=ut.labelOptions,gt=ut.options,vt=d.useCallback((function(t){return A(t).map((function(t){var e,n,i,r,o,a;(function(t){return!t||"object"!==(0,c.Z)(t)})(t)?e=t:(i=t.key,n=t.label,e=null!==(a=t.value)&&void 0!==a?a:i);var s,l=ft.get(e);l&&(void 0===n&&(n=null==l?void 0:l[D||ot.label]),void 0===i&&(i=null!==(s=null==l?void 0:l.key)&&void 0!==s?s:e),r=null==l?void 0:l.disabled,o=null==l?void 0:l.title);return{label:n,value:e,key:i,disabled:r,title:o}}))}),[ot,D,ft]),yt=(0,u.Z)(V,{value:W}),kt=(0,s.Z)(yt,2),St=kt[0],Et=kt[1],Mt=d.useMemo((function(){var t,e=vt(nt&&null===St?[]:St);return"combobox"===h&&function(t){return!t&&0!==t}(null===(t=e[0])||void 0===t?void 0:t.value)?[]:e}),[St,vt,h,nt]),Tt=function(t,e){var n=d.useRef({values:new Map,options:new Map});return[d.useMemo((function(){var i=n.current,r=i.values,o=i.options,s=t.map((function(t){var e;return void 0===t.label?(0,a.Z)((0,a.Z)({},t),{},{label:null===(e=r.get(t.value))||void 0===e?void 0:e.label}):t})),l=new Map,c=new Map;return s.forEach((function(t){l.set(t.value,t),c.set(t.value,e.get(t.value)||o.get(t.value))})),n.current.values=l,n.current.options=c,s}),[t,e]),d.useCallback((function(t){return e.get(t)||n.current.options.get(t)}),[e])]}(Mt,ft),Lt=(0,s.Z)(Tt,2),At=Lt[0],Dt=Lt[1],Pt=d.useMemo((function(){if(!h&&1===At.length){var t=At[0];if(null===t.value&&(null===t.label||void 0===t.label))return[]}return At.map((function(t){var e;return(0,a.Z)((0,a.Z)({},t),{},{label:null!==(e="function"==typeof H?H(t):t.label)&&void 0!==e?e:t.value})}))}),[h,At,H]),Nt=d.useMemo((function(){return new Set(At.map((function(t){return t.value})))}),[At]);d.useEffect((function(){if("combobox"===h){var t,e=null===(t=At[0])||void 0===t?void 0:t.value;ct(function(t){return null!=t}(e)?String(e):"")}}),[At]);var Bt=xt((function(t,e){var n=null!=e?e:t;return(0,o.Z)((0,o.Z)({},ot.value,t),ot.label,n)})),_t=function(t,e,n,i,r){return d.useMemo((function(){if(!n||!1===i)return t;var s=e.options,l=e.label,c=e.value,u=[],h="function"==typeof i,d=n.toUpperCase(),p=h?i:function(t,e){return r?dt(e[r],d):e[s]?dt(e["children"!==l?l:"label"],d):dt(e[c],d)},f=h?function(t){return q(t)}:function(t){return t};return t.forEach((function(t){if(t[s])if(p(n,f(t)))u.push(t);else{var e=t[s].filter((function(t){return p(n,f(t))}));e.length&&u.push((0,a.Z)((0,a.Z)({},t),{},(0,o.Z)({},s,e)))}else p(n,f(t))&&u.push(t)})),u}),[t,i,r,n,e])}(d.useMemo((function(){if("tags"!==h)return gt;var t=(0,r.Z)(gt);return(0,r.Z)(At).sort((function(t,e){return t.value<e.value?-1:1})).forEach((function(e){var n=e.value;(function(t){return ft.has(t)})(n)||t.push(Bt(n,e.label))})),t}),[Bt,gt,ft,At,h]),ot,lt,rt,L),It=d.useMemo((function(){return"tags"!==h||!lt||_t.some((function(t){return t[L||"value"]===lt}))||_t.some((function(t){return t[ot.value]===lt}))?_t:[Bt(lt)].concat((0,r.Z)(_t))}),[Bt,L,h,_t,lt,ot]),Rt=function t(e){return(0,r.Z)(e).sort((function(t,e){return T(t,e,{searchValue:lt})})).map((function(e){return Array.isArray(e.options)?(0,a.Z)((0,a.Z)({},e),{},{options:e.options.length>0?t(e.options):e.options}):e}))},Ot=d.useMemo((function(){return T?Rt(It):It}),[It,T,lt]),Ft=d.useMemo((function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.fieldNames,i=e.childrenAsData,r=[],o=U(n,!1),a=o.label,s=o.value,l=o.options,c=o.groupLabel;function u(t,e){Array.isArray(t)&&t.forEach((function(t){if(e||!(l in t)){var n=t[s];r.push({key:G(t,r.length),groupOption:e,data:t,label:t[a],value:n})}else{var o=t[c];void 0===o&&i&&(o=t.label),r.push({key:G(t,r.length),group:!0,data:t,label:o}),u(t[l],!0)}}))}return u(t,!1),r}(Ot,{fieldNames:ot,childrenAsData:it})}),[Ot,ot,it]),jt=function(t){var e=vt(t);if(Et(e),X&&(e.length!==At.length||e.some((function(t,e){var n;return(null===(n=At[e])||void 0===n?void 0:n.value)!==(null==t?void 0:t.value)})))){var n=Y?e:e.map((function(t){return t.value})),i=e.map((function(t){return q(Dt(t.value))}));X(nt?n:n[0],nt?i:i[0])}},Zt=d.useState(null),zt=(0,s.Z)(Zt,2),Ht=zt[0],Wt=zt[1],Gt=d.useState(0),Vt=(0,s.Z)(Gt,2),Ut=Vt[0],qt=Vt[1],Kt=void 0!==_?_:"combobox"!==h,Yt=d.useCallback((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;qt(e),m&&"combobox"===h&&null!==t&&"keyboard"===r&&Wt(String(t))}),[m,h]),Xt=function(t,e,n){var i=function(){var e,n=Dt(t);return[Y?{label:null==n?void 0:n[ot.label],value:t,key:null!==(e=null==n?void 0:n.key)&&void 0!==e?e:t}:t,q(n)]};if(e&&C){var r=i(),o=(0,s.Z)(r,2),a=o[0],l=o[1];C(a,l)}else if(!e&&k&&"clear"!==n){var c=i(),u=(0,s.Z)(c,2),h=u[0],d=u[1];k(h,d)}},Jt=xt((function(t,e){var n,i=!nt||e.selected;n=i?nt?[].concat((0,r.Z)(At),[t]):[t]:At.filter((function(e){return e.value!==t})),jt(n),Xt(t,i),"combobox"===h?Wt(""):Q&&!w||(ct(""),Wt(""))})),Qt=d.useMemo((function(){var t=!1!==R&&!1!==E;return(0,a.Z)((0,a.Z)({},ut),{},{flattenOptions:Ft,onActiveValue:Yt,defaultActiveFirstOption:Kt,onSelect:Jt,menuItemSelectedIcon:I,rawValues:Nt,fieldNames:ot,virtual:t,direction:O,listHeight:j,listItemHeight:z,childrenAsData:it,maxCount:J,optionRender:N})}),[J,ut,Ft,Yt,Kt,Jt,I,Nt,ot,R,E,O,j,z,it,N]);return d.createElement(K.Provider,{value:Qt},d.createElement(tt,(0,i.Z)({},$,{id:et,prefixCls:f,ref:e,omitDomProps:Ct,mode:h,displayValues:Pt,onDisplayValuesChange:function(t,e){jt(t);var n=e.type,i=e.values;"remove"!==n&&"clear"!==n||i.forEach((function(t){Xt(t.value,!1,n)}))},direction:O,searchValue:lt,onSearch:function(t,e){if(ct(t),Wt(null),"submit"!==e.source)"blur"!==e.source&&("combobox"===h&&jt(t),null==b||b(t));else{var n=(t||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(Nt),[n])));jt(i),Xt(n,!0),ct("")}}},autoClearSearchValue:w,onSearchSplit:function(t){var e=t;"tags"!==h&&(e=t.map((function(t){var e=mt.get(t);return null==e?void 0:e.value})).filter((function(t){return void 0!==t})));var n=Array.from(new Set([].concat((0,r.Z)(Nt),(0,r.Z)(e))));jt(n),n.forEach((function(t){Xt(t,!0)}))},dropdownMatchSelectWidth:E,OptionList:ht,emptyOptions:!Ft.length,activeValue:Ht,activeDescendantId:"".concat(et,"_list_").concat(Ut)})))}));var St=kt;St.Option=rt,St.OptGroup=nt;var Et=St},63158:function(t,e,n){"use strict";var i=n(54476),r=n(20068),o=n(42978),a=n(75931),s=n(59301),l=n(92310),c=n.n(l),u=n(18929),h=n(10228),d=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],p=s.forwardRef((function(t,e){var n,l=t.prefixCls,p=void 0===l?"rc-switch":l,f=t.className,m=t.checked,g=t.defaultChecked,v=t.disabled,y=t.loadingIcon,b=t.checkedChildren,x=t.unCheckedChildren,w=t.onClick,C=t.onChange,k=t.onKeyDown,S=(0,a.Z)(t,d),E=(0,u.Z)(!1,{value:m,defaultValue:g}),M=(0,o.Z)(E,2),T=M[0],L=M[1];function A(t,e){var n=T;return v||(L(n=t),null==C||C(n,e)),n}var D=c()(p,f,(n={},(0,r.Z)(n,"".concat(p,"-checked"),T),(0,r.Z)(n,"".concat(p,"-disabled"),v),n));return s.createElement("button",(0,i.Z)({},S,{type:"button",role:"switch","aria-checked":T,disabled:v,className:D,ref:e,onKeyDown:function(t){t.which===h.Z.LEFT?A(!1,t):t.which===h.Z.RIGHT&&A(!0,t),null==k||k(t)},onClick:function(t){var e=A(!T,t);null==w||w(e,t)}}),y,s.createElement("span",{className:"".concat(p,"-inner")},s.createElement("span",{className:"".concat(p,"-inner-checked")},b),s.createElement("span",{className:"".concat(p,"-inner-unchecked")},x)))}));p.displayName="Switch",e.Z=p},22711:function(t,e,n){"use strict";n.r(e),n.d(e,{ResizableTextArea:function(){return T},default:function(){return A}});var i,r=n(54476),o=n(20068),a=n(33885),s=n(94480),l=n(42978),c=n(75931),u=n(92310),h=n.n(u),d=n(36901),p=n(66003),f=n(30292),m=n(18929),g=n(59301),v=n(76190),y=n(29301),b=n(34280),x=n(16089),w="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],k={};function S(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&k[n])return k[n];var i=window.getComputedStyle(t),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),s=C.map((function(t){return"".concat(t,":").concat(i.getPropertyValue(t))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:r};return e&&n&&(k[n]=l),l}var E=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],M=g.forwardRef((function(t,e){var n=t,s=n.prefixCls,u=n.defaultValue,d=n.value,p=n.autoSize,f=n.onResize,C=n.className,k=n.style,M=n.disabled,T=n.onChange,L=(n.onInternalAutoSize,(0,c.Z)(n,E)),A=(0,m.Z)(u,{value:d,postState:function(t){return null!=t?t:""}}),D=(0,l.Z)(A,2),P=D[0],N=D[1],B=g.useRef();g.useImperativeHandle(e,(function(){return{textArea:B.current}}));var _=g.useMemo((function(){return p&&"object"===(0,v.Z)(p)?[p.minRows,p.maxRows]:[]}),[p]),I=(0,l.Z)(_,2),R=I[0],O=I[1],F=!!p,j=g.useState(2),Z=(0,l.Z)(j,2),z=Z[0],H=Z[1],W=g.useState(),G=(0,l.Z)(W,2),V=G[0],U=G[1],q=function(){H(0)};(0,b.Z)((function(){F&&q()}),[d,R,O,F]),(0,b.Z)((function(){if(0===z)H(1);else if(1===z){var t=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i||((i=document.createElement("textarea")).setAttribute("tab-index","-1"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","hiddenTextarea"),document.body.appendChild(i)),t.getAttribute("wrap")?i.setAttribute("wrap",t.getAttribute("wrap")):i.removeAttribute("wrap");var o=S(t,e),a=o.paddingSize,s=o.borderSize,l=o.boxSizing,c=o.sizingStyle;i.setAttribute("style","".concat(c,";").concat(w)),i.value=t.value||t.placeholder||"";var u,h=void 0,d=void 0,p=i.scrollHeight;if("border-box"===l?p+=s:"content-box"===l&&(p-=a),null!==n||null!==r){i.value=" ";var f=i.scrollHeight-a;null!==n&&(h=f*n,"border-box"===l&&(h=h+a+s),p=Math.max(h,p)),null!==r&&(d=f*r,"border-box"===l&&(d=d+a+s),u=p>d?"":"hidden",p=Math.min(d,p))}var m={height:p,overflowY:u,resize:"none"};return h&&(m.minHeight=h),d&&(m.maxHeight=d),m}(B.current,!1,R,O);H(2),U(t)}else!function(){try{if(document.activeElement===B.current){var t=B.current,e=t.selectionStart,n=t.selectionEnd,i=t.scrollTop;B.current.setSelectionRange(e,n),B.current.scrollTop=i}}catch(t){}}()}),[z]);var K=g.useRef(),Y=function(){x.Z.cancel(K.current)};g.useEffect((function(){return Y}),[]);var X=F?V:null,J=(0,a.Z)((0,a.Z)({},k),X);return 0!==z&&1!==z||(J.overflowY="hidden",J.overflowX="hidden"),g.createElement(y.Z,{onResize:function(t){2===z&&(null==f||f(t),p&&(Y(),K.current=(0,x.Z)((function(){q()}))))},disabled:!(p||f)},g.createElement("textarea",(0,r.Z)({},L,{ref:B,style:J,className:h()(s,C,(0,o.Z)({},"".concat(s,"-disabled"),M)),disabled:M,value:P,onChange:function(t){N(t.target.value),null==T||T(t)}})))})),T=M,L=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],A=g.forwardRef((function(t,e){var n,i=t.defaultValue,u=t.value,v=t.onFocus,y=t.onBlur,b=t.onChange,x=t.allowClear,w=t.maxLength,C=t.onCompositionStart,k=t.onCompositionEnd,S=t.suffix,E=t.prefixCls,M=void 0===E?"rc-textarea":E,A=t.showCount,D=t.count,P=t.className,N=t.style,B=t.disabled,_=t.hidden,I=t.classNames,R=t.styles,O=t.onResize,F=t.onClear,j=t.onPressEnter,Z=t.readOnly,z=t.autoSize,H=t.onKeyDown,W=(0,c.Z)(t,L),G=(0,m.Z)(i,{value:u,defaultValue:i}),V=(0,l.Z)(G,2),U=V[0],q=V[1],K=null==U?"":String(U),Y=g.useState(!1),X=(0,l.Z)(Y,2),J=X[0],Q=X[1],$=g.useRef(!1),tt=g.useState(null),et=(0,l.Z)(tt,2),nt=et[0],it=et[1],rt=(0,g.useRef)(null),ot=(0,g.useRef)(null),at=function(){var t;return null===(t=ot.current)||void 0===t?void 0:t.textArea},st=function(){at().focus()};(0,g.useImperativeHandle)(e,(function(){var t;return{resizableTextArea:ot.current,focus:st,blur:function(){at().blur()},nativeElement:(null===(t=rt.current)||void 0===t?void 0:t.nativeElement)||at()}})),(0,g.useEffect)((function(){Q((function(t){return!B&&t}))}),[B]);var lt=g.useState(null),ct=(0,l.Z)(lt,2),ut=ct[0],ht=ct[1];g.useEffect((function(){var t;ut&&(t=at()).setSelectionRange.apply(t,(0,s.Z)(ut))}),[ut]);var dt,pt=(0,p.Z)(D,A),ft=null!==(n=pt.max)&&void 0!==n?n:w,mt=Number(ft)>0,gt=pt.strategy(K),vt=!!ft&>>ft,yt=function(t,e){var n=e;!$.current&&pt.exceedFormatter&&pt.max&&pt.strategy(e)>pt.max&&e!==(n=pt.exceedFormatter(e,{max:pt.max}))&&ht([at().selectionStart||0,at().selectionEnd||0]),q(n),(0,f.rJ)(t.currentTarget,t,b,n)},bt=S;pt.show&&(dt=pt.showFormatter?pt.showFormatter({value:K,count:gt,maxLength:ft}):"".concat(gt).concat(mt?" / ".concat(ft):""),bt=g.createElement(g.Fragment,null,bt,g.createElement("span",{className:h()("".concat(M,"-data-count"),null==I?void 0:I.count),style:null==R?void 0:R.count},dt)));var xt=!z&&!A&&!x;return g.createElement(d.BaseInput,{ref:rt,value:K,allowClear:x,handleReset:function(t){q(""),st(),(0,f.rJ)(at(),t,b)},suffix:bt,prefixCls:M,classNames:(0,a.Z)((0,a.Z)({},I),{},{affixWrapper:h()(null==I?void 0:I.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(M,"-show-count"),A),"".concat(M,"-textarea-allow-clear"),x))}),disabled:B,focused:J,className:h()(P,vt&&"".concat(M,"-out-of-range")),style:(0,a.Z)((0,a.Z)({},N),nt&&!xt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof dt?dt:void 0}},hidden:_,readOnly:Z,onClear:F},g.createElement(T,(0,r.Z)({},W,{autoSize:z,maxLength:w,onKeyDown:function(t){"Enter"===t.key&&j&&j(t),null==H||H(t)},onChange:function(t){yt(t,t.target.value)},onFocus:function(t){Q(!0),null==v||v(t)},onBlur:function(t){Q(!1),null==y||y(t)},onCompositionStart:function(t){$.current=!0,null==C||C(t)},onCompositionEnd:function(t){$.current=!1,yt(t,t.currentTarget.value),null==k||k(t)},className:h()(null==I?void 0:I.textarea),style:(0,a.Z)((0,a.Z)({},null==R?void 0:R.textarea),{},{resize:null==N?void 0:N.resize}),disabled:B,prefixCls:M,onResize:function(t){var e;null==O||O(t),null!==(e=at())&&void 0!==e&&e.style.height&&it(!0)},ref:ot,readOnly:Z})))}))},90472:function(t,e,n){"use strict";n.d(e,{Z:function(){return _}});var i=n(54476),r=n(67732),o=n(83652),a=n(31226),s=n(42403),l=n(158),c=n(20068),u=n(59301),h=n(33885),d=n(75931),p=n(76190),f=n(75044),m=n(3202),g=n(94480),v=n(92310),y=n.n(v),b=n(26112),x=n(48736),w=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),i=t.name||"",r=t.type||"",o=r.replace(/\/.*$/,"");return n.some((function(t){var e=t.trim();if(/^\*(\/\*)?$/.test(t))return!0;if("."===e.charAt(0)){var n=i.toLowerCase(),a=e.toLowerCase(),s=[a];return".jpg"!==a&&".jpeg"!==a||(s=[".jpg",".jpeg"]),s.some((function(t){return n.endsWith(t)}))}return/\/\*$/.test(e)?o===e.replace(/\/.*$/,""):r===e||!!/^\w+$/.test(e)&&((0,x.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(e,"'.Skip for check.")),!0)}))}return!0};function C(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}function k(t){var e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress(e)});var n=new FormData;t.data&&Object.keys(t.data).forEach((function(e){var i=t.data[e];Array.isArray(i)?i.forEach((function(t){n.append("".concat(e,"[]"),t)})):n.append(e,i)})),t.file instanceof Blob?n.append(t.filename,t.file,t.file.name):n.append(t.filename,t.file),e.onerror=function(e){t.onError(e)},e.onload=function(){return e.status<200||e.status>=300?t.onError(function(t,e){var n="cannot ".concat(t.method," ").concat(t.action," ").concat(e.status,"'"),i=new Error(n);return i.status=e.status,i.method=t.method,i.url=t.action,i}(t,e),C(e)):t.onSuccess(C(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var i=t.headers||{};return null!==i["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(i).forEach((function(t){null!==i[t]&&e.setRequestHeader(t,i[t])})),e.send(n),{abort:function(){e.abort()}}}var S=function(){var t=(0,m.Z)((0,f.Z)().mark((function t(e,n){var i,r,o,a,s,l,c,u;return(0,f.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:l=function(){return(l=(0,m.Z)((0,f.Z)().mark((function t(e){return(0,f.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.file((function(i){n(i)?(e.fullPath&&!i.webkitRelativePath&&(Object.defineProperties(i,{webkitRelativePath:{writable:!0}}),i.webkitRelativePath=e.fullPath.replace(/^\//,""),Object.defineProperties(i,{webkitRelativePath:{writable:!1}})),t(i)):t(null)}))})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)},s=function(t){return l.apply(this,arguments)},a=function(){return(a=(0,m.Z)((0,f.Z)().mark((function t(e){var n,i,r,o,a;return(0,f.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.createReader(),i=[];case 2:return t.next=5,new Promise((function(t){n.readEntries(t,(function(){return t([])}))}));case 5:if(r=t.sent,o=r.length){t.next=9;break}return t.abrupt("break",12);case 9:for(a=0;a<o;a++)i.push(r[a]);t.next=2;break;case 12:return t.abrupt("return",i);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)},o=function(t){return a.apply(this,arguments)},i=[],r=[],e.forEach((function(t){return r.push(t.webkitGetAsEntry())})),c=function(){var t=(0,m.Z)((0,f.Z)().mark((function t(e,n){var a,l;return(0,f.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return");case 2:if(e.path=n||"",!e.isFile){t.next=10;break}return t.next=6,s(e);case 6:(a=t.sent)&&i.push(a),t.next=15;break;case 10:if(!e.isDirectory){t.next=15;break}return t.next=13,o(e);case 13:l=t.sent,r.push.apply(r,(0,g.Z)(l));case 15:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),u=0;case 9:if(!(u<r.length)){t.next=15;break}return t.next=12,c(r[u]);case 12:u++,t.next=9;break;case 15:return t.abrupt("return",i);case 16:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),E=S,M=+new Date,T=0;function L(){return"rc-upload-".concat(M,"-").concat(++T)}var A=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],D=function(t){(0,s.Z)(n,t);var e=(0,l.Z)(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,c.Z)((0,a.Z)(t),"state",{uid:L()}),(0,c.Z)((0,a.Z)(t),"reqs",{}),(0,c.Z)((0,a.Z)(t),"fileInput",void 0),(0,c.Z)((0,a.Z)(t),"_isMounted",void 0),(0,c.Z)((0,a.Z)(t),"onChange",(function(e){var n=t.props,i=n.accept,r=n.directory,o=e.target.files,a=(0,g.Z)(o).filter((function(t){return!r||w(t,i)}));t.uploadFiles(a),t.reset()})),(0,c.Z)((0,a.Z)(t),"onClick",(function(e){var n=t.fileInput;if(n){var i=e.target,r=t.props.onClick;if(i&&"BUTTON"===i.tagName)n.parentNode.focus(),i.blur();n.click(),r&&r(e)}})),(0,c.Z)((0,a.Z)(t),"onKeyDown",(function(e){"Enter"===e.key&&t.onClick(e)})),(0,c.Z)((0,a.Z)(t),"onFileDrop",function(){var e=(0,m.Z)((0,f.Z)().mark((function e(n){var i,r,o;return(0,f.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.props.multiple,n.preventDefault(),"dragover"!==n.type){e.next=4;break}return e.abrupt("return");case 4:if(!t.props.directory){e.next=11;break}return e.next=7,E(Array.prototype.slice.call(n.dataTransfer.items),(function(e){return w(e,t.props.accept)}));case 7:r=e.sent,t.uploadFiles(r),e.next=14;break;case 11:o=(0,g.Z)(n.dataTransfer.files).filter((function(e){return w(e,t.props.accept)})),!1===i&&(o=o.slice(0,1)),t.uploadFiles(o);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,c.Z)((0,a.Z)(t),"uploadFiles",(function(e){var n=(0,g.Z)(e),i=n.map((function(e){return e.uid=L(),t.processFile(e,n)}));Promise.all(i).then((function(e){var n=t.props.onBatchStart;null==n||n(e.map((function(t){return{file:t.origin,parsedFile:t.parsedFile}}))),e.filter((function(t){return null!==t.parsedFile})).forEach((function(e){t.post(e)}))}))})),(0,c.Z)((0,a.Z)(t),"processFile",function(){var e=(0,m.Z)((0,f.Z)().mark((function e(n,i){var r,o,a,s,l,c,u,h,d;return(0,f.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.props.beforeUpload,o=n,!r){e.next=14;break}return e.prev=3,e.next=6,r(n,i);case 6:o=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),o=!1;case 12:if(!1!==o){e.next=14;break}return e.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(a=t.props.action)){e.next=21;break}return e.next=18,a(n);case 18:s=e.sent,e.next=22;break;case 21:s=a;case 22:if("function"!=typeof(l=t.props.data)){e.next=29;break}return e.next=26,l(n);case 26:c=e.sent,e.next=30;break;case 29:c=l;case 30:return u="object"!==(0,p.Z)(o)&&"string"!=typeof o||!o?n:o,h=u instanceof File?u:new File([u],n.name,{type:n.type}),(d=h).uid=n.uid,e.abrupt("return",{origin:n,data:c,parsedFile:d,action:s});case 35:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n){return e.apply(this,arguments)}}()),(0,c.Z)((0,a.Z)(t),"saveFileInput",(function(e){t.fileInput=e})),t}return(0,o.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(t){var e=this,n=t.data,i=t.origin,r=t.action,o=t.parsedFile;if(this._isMounted){var a=this.props,s=a.onStart,l=a.customRequest,c=a.name,u=a.headers,h=a.withCredentials,d=a.method,p=i.uid,f=l||k,m={action:r,filename:c,data:n,file:o,headers:u,withCredentials:h,method:d||"post",onProgress:function(t){var n=e.props.onProgress;null==n||n(t,o)},onSuccess:function(t,n){var i=e.props.onSuccess;null==i||i(t,o,n),delete e.reqs[p]},onError:function(t,n){var i=e.props.onError;null==i||i(t,n,o),delete e.reqs[p]}};s(i),this.reqs[p]=f(m)}}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(t){var e=this.reqs;if(t){var n=t.uid?t.uid:t;e[n]&&e[n].abort&&e[n].abort(),delete e[n]}else Object.keys(e).forEach((function(t){e[t]&&e[t].abort&&e[t].abort(),delete e[t]}))}},{key:"render",value:function(){var t=this.props,e=t.component,n=t.prefixCls,r=t.className,o=t.classNames,a=void 0===o?{}:o,s=t.disabled,l=t.id,p=t.name,f=t.style,m=t.styles,g=void 0===m?{}:m,v=t.multiple,x=t.accept,w=t.capture,C=t.children,k=t.directory,S=t.openFileDialogOnClick,E=t.onMouseEnter,M=t.onMouseLeave,T=t.hasControlInside,L=(0,d.Z)(t,A),D=y()((0,c.Z)((0,c.Z)((0,c.Z)({},n,!0),"".concat(n,"-disabled"),s),r,r)),P=k?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},N=s?{}:{onClick:S?this.onClick:function(){},onKeyDown:S?this.onKeyDown:function(){},onMouseEnter:E,onMouseLeave:M,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:T?void 0:"0"};return u.createElement(e,(0,i.Z)({},N,{className:D,role:T?void 0:"button",style:f}),u.createElement("input",(0,i.Z)({},(0,b.Z)(L,{aria:!0,data:!0}),{id:l,name:p,disabled:s,type:"file",ref:this.saveFileInput,onClick:function(t){return t.stopPropagation()},key:this.state.uid,style:(0,h.Z)({display:"none"},g.input),className:a.input,accept:x},P,{multiple:v,onChange:this.onChange},null!=w?{capture:w}:{})),C)}}]),n}(u.Component),P=D;function N(){}var B=function(t){(0,s.Z)(n,t);var e=(0,l.Z)(n);function n(){var t;(0,r.Z)(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,c.Z)((0,a.Z)(t),"uploader",void 0),(0,c.Z)((0,a.Z)(t),"saveUploader",(function(e){t.uploader=e})),t}return(0,o.Z)(n,[{key:"abort",value:function(t){this.uploader.abort(t)}},{key:"render",value:function(){return u.createElement(P,(0,i.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(u.Component);(0,c.Z)(B,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:N,onError:N,onSuccess:N,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var _=B},48911:function(t,e,n){"use strict";n.d(e,{Z:function(){return F}});var i=n(54476),r=n(76190),o=n(33885),a=n(20068),s=n(42978),l=n(75931),c=n(92310),u=n.n(c),h=n(29301),d=n(70425),p=n(34280),f=n(59301),m=n(4676),g=f.forwardRef((function(t,e){var n=t.height,r=t.offsetY,s=t.offsetX,l=t.children,c=t.prefixCls,d=t.onInnerResize,p=t.innerProps,m=t.rtl,g=t.extra,v={},y={display:"flex",flexDirection:"column"};return void 0!==r&&(v={height:n,position:"relative",overflow:"hidden"},y=(0,o.Z)((0,o.Z)({},y),{},(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({transform:"translateY(".concat(r,"px)")},m?"marginRight":"marginLeft",-s),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:v},f.createElement(h.Z,{onResize:function(t){t.offsetHeight&&d&&d()}},f.createElement("div",(0,i.Z)({style:y,className:u()((0,a.Z)({},"".concat(c,"-holder-inner"),c)),ref:e},p),l,g)))}));g.displayName="Filler";var v=g;function y(t){var e=t.children,n=t.setRef,i=f.useCallback((function(t){n(t)}),[]);return f.cloneElement(e,{ref:i})}function b(t,e,n){var i=f.useState(t),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=f.useState(null),c=(0,s.Z)(l,2),u=c[0],h=c[1];return f.useEffect((function(){var i=function(t,e,n){var i,r,o=t.length,a=e.length;if(0===o&&0===a)return null;o<a?(i=t,r=e):(i=e,r=t);var s={__EMPTY_ITEM__:!0};function l(t){return void 0!==t?n(t):s}for(var c=null,u=1!==Math.abs(o-a),h=0;h<r.length;h+=1){var d=l(i[h]);if(d!==l(r[h])){c=h,u=u||d!==l(r[h+1]);break}}return null===c?null:{index:c,multiple:u}}(o||[],t||[],e);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),h(t[i.index])),a(t)}),[t]),[u]}var x=n(16089),w="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),C=function(t,e,n,i){var r=(0,f.useRef)(!1),o=(0,f.useRef)(null);function a(){clearTimeout(o.current),r.current=!0,o.current=setTimeout((function(){r.current=!1}),50)}var s=(0,f.useRef)({top:t,bottom:e,left:n,right:i});return s.current.top=t,s.current.bottom=e,s.current.left=n,s.current.right=i,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t?e<0&&s.current.left||e>0&&s.current.right:e<0&&s.current.top||e>0&&s.current.bottom;return n&&i?(clearTimeout(o.current),r.current=!1):i&&!r.current||a(),!r.current&&i}};function k(t,e,n,i,r,o,a){var s=(0,f.useRef)(0),l=(0,f.useRef)(null),c=(0,f.useRef)(null),u=(0,f.useRef)(!1),h=C(e,n,i,r);var d=(0,f.useRef)(null),p=(0,f.useRef)(null);return[function(e){if(t){x.Z.cancel(p.current),p.current=(0,x.Z)((function(){d.current=null}),2);var n=e.deltaX,i=e.deltaY,r=e.shiftKey,f=n,m=i;("sx"===d.current||!d.current&&r&&i&&!n)&&(f=i,m=0,d.current="sx");var g=Math.abs(f),v=Math.abs(m);null===d.current&&(d.current=o&&g>v?"x":"y"),"y"===d.current?function(t,e){if(x.Z.cancel(l.current),!h(!1,e)){var n=t;n._virtualHandled||(n._virtualHandled=!0,s.current+=e,c.current=e,w||n.preventDefault(),l.current=(0,x.Z)((function(){var t=u.current?10:1;a(s.current*t,!1),s.current=0})))}}(e,m):function(t,e){a(e,!0),w||t.preventDefault()}(e,f)}},function(e){t&&(u.current=e.detail===c.current)}]}var S=n(67732),E=n(83652),M=function(){function t(){(0,S.Z)(this,t),(0,a.Z)(this,"maps",void 0),(0,a.Z)(this,"id",0),(0,a.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,E.Z)(t,[{key:"set",value:function(t,e){this.diffRecords.set(t,this.maps[t]),this.maps[t]=e,this.id+=1}},{key:"get",value:function(t){return this.maps[t]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),t}();function T(t){var e=parseFloat(t);return isNaN(e)?0:e}var L=14/15;function A(t){return Math.floor(Math.pow(t,.5))}function D(t,e){return("touches"in t?t.touches[0]:t)[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}var P=f.forwardRef((function(t,e){var n=t.prefixCls,i=t.rtl,r=t.scrollOffset,l=t.scrollRange,c=t.onStartMove,h=t.onStopMove,d=t.onScroll,p=t.horizontal,m=t.spinSize,g=t.containerSize,v=t.style,y=t.thumbStyle,b=t.showScrollBar,w=f.useState(!1),C=(0,s.Z)(w,2),k=C[0],S=C[1],E=f.useState(null),M=(0,s.Z)(E,2),T=M[0],L=M[1],A=f.useState(null),P=(0,s.Z)(A,2),N=P[0],B=P[1],_=!i,I=f.useRef(),R=f.useRef(),O=f.useState(b),F=(0,s.Z)(O,2),j=F[0],Z=F[1],z=f.useRef(),H=function(){!0!==b&&!1!==b&&(clearTimeout(z.current),Z(!0),z.current=setTimeout((function(){Z(!1)}),3e3))},W=l-g||0,G=g-m||0,V=f.useMemo((function(){return 0===r||0===W?0:r/W*G}),[r,W,G]),U=f.useRef({top:V,dragging:k,pageY:T,startTop:N});U.current={top:V,dragging:k,pageY:T,startTop:N};var q=function(t){S(!0),L(D(t,p)),B(U.current.top),c(),t.stopPropagation(),t.preventDefault()};f.useEffect((function(){var t=function(t){t.preventDefault()},e=I.current,n=R.current;return e.addEventListener("touchstart",t,{passive:!1}),n.addEventListener("touchstart",q,{passive:!1}),function(){e.removeEventListener("touchstart",t),n.removeEventListener("touchstart",q)}}),[]);var K=f.useRef();K.current=W;var Y=f.useRef();Y.current=G,f.useEffect((function(){if(k){var t,e=function(e){var n=U.current,i=n.dragging,r=n.pageY,o=n.startTop;x.Z.cancel(t);var a=I.current.getBoundingClientRect(),s=g/(p?a.width:a.height);if(i){var l=(D(e,p)-r)*s,c=o;!_&&p?c-=l:c+=l;var u=K.current,h=Y.current,f=h?c/h:0,m=Math.ceil(f*u);m=Math.max(m,0),m=Math.min(m,u),t=(0,x.Z)((function(){d(m,p)}))}},n=function(){S(!1),h()};return window.addEventListener("mousemove",e,{passive:!0}),window.addEventListener("touchmove",e,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",e),window.removeEventListener("touchmove",e),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),x.Z.cancel(t)}}}),[k]),f.useEffect((function(){return H(),function(){clearTimeout(z.current)}}),[r]),f.useImperativeHandle(e,(function(){return{delayHidden:H}}));var X="".concat(n,"-scrollbar"),J={position:"absolute",visibility:j?null:"hidden"},Q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return p?(Object.assign(J,{height:8,left:0,right:0,bottom:0}),Object.assign(Q,(0,a.Z)({height:"100%",width:m},_?"left":"right",V))):(Object.assign(J,(0,a.Z)({width:8,top:0,bottom:0},_?"right":"left",0)),Object.assign(Q,{width:"100%",height:m,top:V})),f.createElement("div",{ref:I,className:u()(X,(0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(X,"-horizontal"),p),"".concat(X,"-vertical"),!p),"".concat(X,"-visible"),j)),style:(0,o.Z)((0,o.Z)({},J),v),onMouseDown:function(t){t.stopPropagation(),t.preventDefault()},onMouseMove:H},f.createElement("div",{ref:R,className:u()("".concat(X,"-thumb"),(0,a.Z)({},"".concat(X,"-thumb-moving"),k)),style:(0,o.Z)((0,o.Z)({},Q),y),onMouseDown:q}))}));function N(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var B=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],_=[],I={overflowY:"auto",overflowAnchor:"none"};function R(t,e){var n=t.prefixCls,c=void 0===n?"rc-virtual-list":n,g=t.className,w=t.height,S=t.itemHeight,E=t.fullHeight,R=void 0===E||E,O=t.style,F=t.data,j=t.children,Z=t.itemKey,z=t.virtual,H=t.direction,W=t.scrollWidth,G=t.component,V=void 0===G?"div":G,U=t.onScroll,q=t.onVirtualScroll,K=t.onVisibleChange,Y=t.innerProps,X=t.extraRender,J=t.styles,Q=t.showScrollBar,$=void 0===Q?"optional":Q,tt=(0,l.Z)(t,B),et=f.useCallback((function(t){return"function"==typeof Z?Z(t):null==t?void 0:t[Z]}),[Z]),nt=function(t,e,n){var i=f.useState(0),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=(0,f.useRef)(new Map),c=(0,f.useRef)(new M),u=(0,f.useRef)(0);function h(){u.current+=1}function d(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h();var e=function(){var t=!1;l.current.forEach((function(e,n){if(e&&e.offsetParent){var i=e.offsetHeight,r=getComputedStyle(e),o=r.marginTop,a=r.marginBottom,s=i+T(o)+T(a);c.current.get(n)!==s&&(c.current.set(n,s),t=!0)}})),t&&a((function(t){return t+1}))};if(t)e();else{u.current+=1;var n=u.current;Promise.resolve().then((function(){n===u.current&&e()}))}}return(0,f.useEffect)((function(){return h}),[]),[function(i,r){var o=t(i),a=l.current.get(o);r?(l.current.set(o,r),d()):l.current.delete(o),!a!=!r&&(r?null==e||e(i):null==n||n(i))},d,c.current,o]}(et,null,null),it=(0,s.Z)(nt,4),rt=it[0],ot=it[1],at=it[2],st=it[3],lt=!(!1===z||!w||!S),ct=f.useMemo((function(){return Object.values(at.maps).reduce((function(t,e){return t+e}),0)}),[at.id,at.maps]),ut=lt&&F&&(Math.max(S*F.length,ct)>w||!!W),ht="rtl"===H,dt=u()(c,(0,a.Z)({},"".concat(c,"-rtl"),ht),g),pt=F||_,ft=(0,f.useRef)(),mt=(0,f.useRef)(),gt=(0,f.useRef)(),vt=(0,f.useState)(0),yt=(0,s.Z)(vt,2),bt=yt[0],xt=yt[1],wt=(0,f.useState)(0),Ct=(0,s.Z)(wt,2),kt=Ct[0],St=Ct[1],Et=(0,f.useState)(!1),Mt=(0,s.Z)(Et,2),Tt=Mt[0],Lt=Mt[1],At=function(){Lt(!0)},Dt=function(){Lt(!1)},Pt={getKey:et};function Nt(t){xt((function(e){var n=function(t){var e=t;Number.isNaN(Jt.current)||(e=Math.min(e,Jt.current));return e=Math.max(e,0),e}("function"==typeof t?t(e):t);return ft.current.scrollTop=n,n}))}var Bt=(0,f.useRef)({start:0,end:pt.length}),_t=(0,f.useRef)(),It=b(pt,et),Rt=(0,s.Z)(It,1)[0];_t.current=Rt;var Ot=f.useMemo((function(){if(!lt)return{scrollHeight:void 0,start:0,end:pt.length-1,offset:void 0};var t;if(!ut)return{scrollHeight:(null===(t=mt.current)||void 0===t?void 0:t.offsetHeight)||0,start:0,end:pt.length-1,offset:void 0};for(var e,n,i,r=0,o=pt.length,a=0;a<o;a+=1){var s=pt[a],l=et(s),c=at.get(l),u=r+(void 0===c?S:c);u>=bt&&void 0===e&&(e=a,n=r),u>bt+w&&void 0===i&&(i=a),r=u}return void 0===e&&(e=0,n=0,i=Math.ceil(w/S)),void 0===i&&(i=pt.length-1),{scrollHeight:r,start:e,end:i=Math.min(i+1,pt.length-1),offset:n}}),[ut,lt,bt,pt,st,w]),Ft=Ot.scrollHeight,jt=Ot.start,Zt=Ot.end,zt=Ot.offset;Bt.current.start=jt,Bt.current.end=Zt,f.useLayoutEffect((function(){var t=at.getRecord();if(1===t.size){var e=Array.from(t.keys())[0],n=t.get(e),i=pt[jt];if(i&&void 0===n)if(et(i)===e){var r=at.get(e)-S;Nt((function(t){return t+r}))}}at.resetRecord()}),[Ft]);var Ht=f.useState({width:0,height:w}),Wt=(0,s.Z)(Ht,2),Gt=Wt[0],Vt=Wt[1],Ut=(0,f.useRef)(),qt=(0,f.useRef)(),Kt=f.useMemo((function(){return N(Gt.width,W)}),[Gt.width,W]),Yt=f.useMemo((function(){return N(Gt.height,Ft)}),[Gt.height,Ft]),Xt=Ft-w,Jt=(0,f.useRef)(Xt);Jt.current=Xt;var Qt=bt<=0,$t=bt>=Xt,te=kt<=0,ee=kt>=W,ne=C(Qt,$t,te,ee),ie=function(){return{x:ht?-kt:kt,y:bt}},re=(0,f.useRef)(ie()),oe=(0,d.zX)((function(t){if(q){var e=(0,o.Z)((0,o.Z)({},ie()),t);re.current.x===e.x&&re.current.y===e.y||(q(e),re.current=e)}}));function ae(t,e){var n=t;e?((0,m.flushSync)((function(){St(n)})),oe()):Nt(n)}var se=function(t){var e=t,n=W?W-Gt.width:0;return e=Math.max(e,0),e=Math.min(e,n)},le=(0,d.zX)((function(t,e){e?((0,m.flushSync)((function(){St((function(e){return se(e+(ht?-t:t))}))})),oe()):Nt((function(e){return e+t}))})),ce=k(lt,Qt,$t,te,ee,!!W,le),ue=(0,s.Z)(ce,2),he=ue[0],de=ue[1];!function(t,e,n){var i,r=(0,f.useRef)(!1),o=(0,f.useRef)(0),a=(0,f.useRef)(0),s=(0,f.useRef)(null),l=(0,f.useRef)(null),c=function(t){if(r.current){var e=Math.ceil(t.touches[0].pageX),i=Math.ceil(t.touches[0].pageY),s=o.current-e,c=a.current-i,u=Math.abs(s)>Math.abs(c);u?o.current=e:a.current=i;var h=n(u,u?s:c,!1,t);h&&t.preventDefault(),clearInterval(l.current),h&&(l.current=setInterval((function(){u?s*=L:c*=L;var t=Math.floor(u?s:c);(!n(u,t,!0)||Math.abs(t)<=.1)&&clearInterval(l.current)}),16))}},u=function(){r.current=!1,i()},h=function(t){i(),1!==t.touches.length||r.current||(r.current=!0,o.current=Math.ceil(t.touches[0].pageX),a.current=Math.ceil(t.touches[0].pageY),s.current=t.target,s.current.addEventListener("touchmove",c,{passive:!1}),s.current.addEventListener("touchend",u,{passive:!0}))};i=function(){s.current&&(s.current.removeEventListener("touchmove",c),s.current.removeEventListener("touchend",u))},(0,p.Z)((function(){return t&&e.current.addEventListener("touchstart",h,{passive:!0}),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("touchstart",h),i(),clearInterval(l.current)}}),[t])}(lt,ft,(function(t,e,n,i){var r=i;return!ne(t,e,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),he({preventDefault:function(){},deltaX:t?e:0,deltaY:t?0:e}),!0))})),function(t,e,n){f.useEffect((function(){var i=e.current;if(t&&i){var r,o,a=!1,s=function(){x.Z.cancel(r)},l=function t(){s(),r=(0,x.Z)((function(){n(o),t()}))},c=function(){a=!1,s()},u=function(t){if(!t.target.draggable&&0===t.button){var e=t;e._virtualHandled||(e._virtualHandled=!0,a=!0)}},h=function(t){if(a){var e=D(t,!1),n=i.getBoundingClientRect(),r=n.top,c=n.bottom;e<=r?(o=-A(r-e),l()):e>=c?(o=A(e-c),l()):s()}};return i.addEventListener("mousedown",u),i.ownerDocument.addEventListener("mouseup",c),i.ownerDocument.addEventListener("mousemove",h),i.ownerDocument.addEventListener("dragend",c),function(){i.removeEventListener("mousedown",u),i.ownerDocument.removeEventListener("mouseup",c),i.ownerDocument.removeEventListener("mousemove",h),i.ownerDocument.removeEventListener("dragend",c),s()}}}),[t])}(ut,ft,(function(t){Nt((function(e){return e+t}))})),(0,p.Z)((function(){function t(t){var e=Qt&&t.detail<0,n=$t&&t.detail>0;!lt||e||n||t.preventDefault()}var e=ft.current;return e.addEventListener("wheel",he,{passive:!1}),e.addEventListener("DOMMouseScroll",de,{passive:!0}),e.addEventListener("MozMousePixelScroll",t,{passive:!1}),function(){e.removeEventListener("wheel",he),e.removeEventListener("DOMMouseScroll",de),e.removeEventListener("MozMousePixelScroll",t)}}),[lt,Qt,$t]),(0,p.Z)((function(){if(W){var t=se(kt);St(t),oe({x:t})}}),[Gt.width,W]);var pe=function(){var t,e;null===(t=Ut.current)||void 0===t||t.delayHidden(),null===(e=qt.current)||void 0===e||e.delayHidden()},fe=function(t,e,n,i,a,l,c,u){var h=f.useRef(),d=f.useState(null),m=(0,s.Z)(d,2),g=m[0],v=m[1];return(0,p.Z)((function(){if(g&&g.times<10){if(!t.current)return void v((function(t){return(0,o.Z)({},t)}));l();var r=g.targetAlign,s=g.originAlign,u=g.index,h=g.offset,d=t.current.clientHeight,p=!1,f=r,m=null;if(d){for(var y=r||s,b=0,x=0,w=0,C=Math.min(e.length-1,u),k=0;k<=C;k+=1){var S=a(e[k]);x=b;var E=n.get(S);b=w=x+(void 0===E?i:E)}for(var M="top"===y?h:d-h,T=C;T>=0;T-=1){var L=a(e[T]),A=n.get(L);if(void 0===A){p=!0;break}if((M-=A)<=0)break}switch(y){case"top":m=x-h;break;case"bottom":m=w-d+h;break;default:var D=t.current.scrollTop;x<D?f="top":w>D+d&&(f="bottom")}null!==m&&c(m),m!==g.lastTop&&(p=!0)}p&&v((0,o.Z)((0,o.Z)({},g),{},{times:g.times+1,targetAlign:f,lastTop:m}))}}),[g,t.current]),function(t){if(null!=t){if(x.Z.cancel(h.current),"number"==typeof t)c(t);else if(t&&"object"===(0,r.Z)(t)){var n,i=t.align;n="index"in t?t.index:e.findIndex((function(e){return a(e)===t.key}));var o=t.offset;v({times:0,index:n,offset:void 0===o?0:o,originAlign:i})}}else u()}}(ft,pt,at,S,et,(function(){return ot(!0)}),Nt,pe);f.useImperativeHandle(e,(function(){return{nativeElement:gt.current,getScrollInfo:ie,scrollTo:function(t){var e;(e=t)&&"object"===(0,r.Z)(e)&&("left"in e||"top"in e)?(void 0!==t.left&&St(se(t.left)),fe(t.top)):fe(t)}}})),(0,p.Z)((function(){if(K){var t=pt.slice(jt,Zt+1);K(t,pt)}}),[jt,Zt,pt]);var me=function(t,e,n,i){var r=f.useMemo((function(){return[new Map,[]]}),[t,n.id,i]),o=(0,s.Z)(r,2),a=o[0],l=o[1];return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,s=a.get(r),c=a.get(o);if(void 0===s||void 0===c)for(var u=t.length,h=l.length;h<u;h+=1){var d,p=t[h],f=e(p);a.set(f,h);var m=null!==(d=n.get(f))&&void 0!==d?d:i;if(l[h]=(l[h-1]||0)+m,f===r&&(s=h),f===o&&(c=h),void 0!==s&&void 0!==c)break}return{top:l[s-1]||0,bottom:l[c]}}}(pt,et,at,S),ge=null==X?void 0:X({start:jt,end:Zt,virtual:ut,offsetX:kt,offsetY:zt,rtl:ht,getSize:me}),ve=function(t,e,n,i,r,o,a,s){var l=s.getKey;return t.slice(e,n+1).map((function(t,n){var s=a(t,e+n,{style:{width:i},offsetX:r}),c=l(t);return f.createElement(y,{key:c,setRef:function(e){return o(t,e)}},s)}))}(pt,jt,Zt,W,kt,rt,j,Pt),ye=null;w&&(ye=(0,o.Z)((0,a.Z)({},R?"height":"maxHeight",w),I),lt&&(ye.overflowY="hidden",W&&(ye.overflowX="hidden"),Tt&&(ye.pointerEvents="none")));var be={};return ht&&(be.dir="rtl"),f.createElement("div",(0,i.Z)({ref:gt,style:(0,o.Z)((0,o.Z)({},O),{},{position:"relative"}),className:dt},be,tt),f.createElement(h.Z,{onResize:function(t){Vt({width:t.offsetWidth,height:t.offsetHeight})}},f.createElement(V,{className:"".concat(c,"-holder"),style:ye,ref:ft,onScroll:function(t){var e=t.currentTarget.scrollTop;e!==bt&&Nt(e),null==U||U(t),oe()},onMouseEnter:pe},f.createElement(v,{prefixCls:c,height:Ft,offsetX:kt,offsetY:zt,scrollWidth:W,onInnerResize:ot,ref:mt,innerProps:Y,rtl:ht,extra:ge},ve))),ut&&Ft>w&&f.createElement(P,{ref:Ut,prefixCls:c,scrollOffset:bt,scrollRange:Ft,rtl:ht,onScroll:ae,onStartMove:At,onStopMove:Dt,spinSize:Yt,containerSize:Gt.height,style:null==J?void 0:J.verticalScrollBar,thumbStyle:null==J?void 0:J.verticalScrollBarThumb,showScrollBar:$}),ut&&W>Gt.width&&f.createElement(P,{ref:qt,prefixCls:c,scrollOffset:kt,scrollRange:W,rtl:ht,onScroll:ae,onStartMove:At,onStopMove:Dt,spinSize:Kt,containerSize:Gt.width,horizontal:!0,style:null==J?void 0:J.horizontalScrollBar,thumbStyle:null==J?void 0:J.horizontalScrollBarThumb,showScrollBar:$}))}var O=f.forwardRef(R);O.displayName="List";var F=O},93314:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},16722:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});const i=t=>"object"==typeof t&&null!=t&&1===t.nodeType,r=(t,e)=>(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t,o=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return r(n.overflowY,e)||r(n.overflowX,e)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},a=(t,e,n,i,r,o,a,s)=>o<t&&a>e||o>t&&a<e?0:o<=t&&s<=n||a>=e&&s>=n?o-t-i:a>e&&s<n||o<t&&s>n?a-e+r:0,s=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},l=(t,e)=>{var n,r,l,c;if("undefined"==typeof document)return[];const{scrollMode:u,block:h,inline:d,boundary:p,skipOverflowHiddenElements:f}=e,m="function"==typeof p?p:t=>t!==p;if(!i(t))throw new TypeError("Invalid target");const g=document.scrollingElement||document.documentElement,v=[];let y=t;for(;i(y)&&m(y);){if(y=s(y),y===g){v.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,f)&&v.push(y)}const b=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,x=null!=(c=null==(l=window.visualViewport)?void 0:l.height)?c:innerHeight,{scrollX:w,scrollY:C}=window,{height:k,width:S,top:E,right:M,bottom:T,left:L}=t.getBoundingClientRect(),{top:A,right:D,bottom:P,left:N}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);let B="start"===h||"nearest"===h?E-A:"end"===h?T+P:E+k/2-A+P,_="center"===d?L+S/2-N+D:"end"===d?M+D:L-N;const I=[];for(let t=0;t<v.length;t++){const e=v[t],{height:n,width:i,top:r,right:s,bottom:l,left:c}=e.getBoundingClientRect();if("if-needed"===u&&E>=0&&L>=0&&T<=x&&M<=b&&(e===g&&!o(e)||E>=r&&T<=l&&L>=c&&M<=s))return I;const p=getComputedStyle(e),f=parseInt(p.borderLeftWidth,10),m=parseInt(p.borderTopWidth,10),y=parseInt(p.borderRightWidth,10),A=parseInt(p.borderBottomWidth,10);let D=0,P=0;const N="offsetWidth"in e?e.offsetWidth-e.clientWidth-f-y:0,R="offsetHeight"in e?e.offsetHeight-e.clientHeight-m-A:0,O="offsetWidth"in e?0===e.offsetWidth?0:i/e.offsetWidth:0,F="offsetHeight"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(g===e)D="start"===h?B:"end"===h?B-x:"nearest"===h?a(C,C+x,x,m,A,C+B,C+B+k,k):B-x/2,P="start"===d?_:"center"===d?_-b/2:"end"===d?_-b:a(w,w+b,b,f,y,w+_,w+_+S,S),D=Math.max(0,D+C),P=Math.max(0,P+w);else{D="start"===h?B-r-m:"end"===h?B-l+A+R:"nearest"===h?a(r,l,n,m,A+R,B,B+k,k):B-(r+n/2)+R/2,P="start"===d?_-c-f:"center"===d?_-(c+i/2)+N/2:"end"===d?_-s+y+N:a(c,s,i,f,y+N,_,_+S,S);const{scrollLeft:t,scrollTop:o}=e;D=0===F?0:Math.max(0,Math.min(o+D/F,e.scrollHeight-n/F+R)),P=0===O?0:Math.max(0,Math.min(t+P/O,e.scrollWidth-i/O+N)),B+=o-D,_+=t-P}I.push({el:e,top:D,left:P})}return I};function c(t,e){if(!t.isConnected||!(t=>{let e=t;for(;e&&e.parentNode;){if(e.parentNode===document)return!0;e=e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}return!1})(t))return;const n=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);if((t=>"object"==typeof t&&"function"==typeof t.behavior)(e))return e.behavior(l(t,e));const i="boolean"==typeof e||null==e?void 0:e.behavior;for(const{el:r,top:o,left:a}of l(t,(t=>!1===t?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:"start",inline:"nearest"})(e))){const t=o-n.top+n.bottom,e=a-n.left+n.right;r.scroll({top:t,left:e,behavior:i})}}}}]); |